diff --git a/dist/keen-tracking.js b/dist/keen-tracking.js index d9c4e918..c784b301 100644 --- a/dist/keen-tracking.js +++ b/dist/keen-tracking.js @@ -76,7 +76,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 44); +/******/ return __webpack_require__(__webpack_require__.s = 45); /******/ }) /************************************************************************/ /******/ ([ @@ -134,7 +134,7 @@ function extend(target){ "use strict"; __webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19); /* harmony import */ var _finally__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); @@ -693,7 +693,8 @@ module.exports = g; headers: parseHeaders(xhr.getAllResponseHeaders() || '') } options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') - var body = 'response' in xhr ? xhr.response : xhr.responseText + var body = 'response' in xhr ? xhr.response : xhr.responseText; + resolve(new Response(body, options)) } @@ -732,7 +733,7 @@ module.exports = g; /* 7 */ /***/ (function(module) { -module.exports = {"name":"keen-tracking","version":"4.4.0","description":"Track events - custom user actions, clicks, pageviews, purchases.","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.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","demo":"node ./test/demo/index.node.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO (https://keen.io/)","homepage":"https://keen.io","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 (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)","Dariusz Łacheta (https://github.com/dariuszlacheta)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","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":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.14","xhr-mock":"^2.3.2"}}; +module.exports = {"name":"keen-tracking","version":"4.4.1","description":"Track events - custom user actions, clicks, pageviews, purchases.","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.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/keen/keen-tracking.js/issues","author":"Keen IO (https://keen.io/)","homepage":"https://keen.io","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 (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)","Dariusz Łacheta (https://github.com/dariuszlacheta)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","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"}}; /***/ }), /* 8 */ @@ -914,7 +915,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _keenCore = __webpack_require__(42); +var _keenCore = __webpack_require__(43); var _keenCore2 = _interopRequireDefault(_keenCore); @@ -926,9 +927,9 @@ var _extend = __webpack_require__(1); var _extend2 = _interopRequireDefault(_extend); -var _queue = __webpack_require__(17); +var _queue = __webpack_require__(18); -var _optOut = __webpack_require__(16); +var _optOut = __webpack_require__(17); var _package = __webpack_require__(7); @@ -1261,13 +1262,41 @@ function getExtendedEventBody(result, queue) { "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function lsTest() { + var test = 'test'; + try { + localStorage.setItem(test, test); + localStorage.removeItem(test); + return true; + } catch (e) { + return false; + } +} + +var isLocalStorageAvailable = exports.isLocalStorageAvailable = lsTest(); + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); exports.setOptOut = setOptOut; + +var _localStorage = __webpack_require__(16); + function setOptOut() { var optOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + if (!_localStorage.isLocalStorageAvailable) return; + if (optOut) { localStorage.setItem('optout', optOut); return; @@ -1277,7 +1306,7 @@ function setOptOut() { }; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1364,7 +1393,7 @@ function shouldFlushQueue(props) { } /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1598,10 +1627,10 @@ Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { /* harmony default export */ __webpack_exports__["a"] = (Promise); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(37).setImmediate)) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(38).setImmediate)) /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1643,7 +1672,7 @@ timer.prototype.clear = function () { }; /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1909,7 +1938,7 @@ function str_serialize(result, key, value) { } /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -2055,7 +2084,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2068,7 +2097,7 @@ exports.cookie = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -var _jsCookie = __webpack_require__(21); +var _jsCookie = __webpack_require__(22); var _jsCookie2 = _interopRequireDefault(_jsCookie); @@ -2139,7 +2168,7 @@ cookie.prototype.enabled = function () { }; /***/ }), -/* 23 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2168,7 +2197,7 @@ function getUniqueId() { } /***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2224,7 +2253,7 @@ function getWindowHeight() { } /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2270,7 +2299,7 @@ var getElementProps = function getElementProps(el, prop) { }; /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2318,7 +2347,7 @@ function getDomainName(url) { } /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2340,7 +2369,7 @@ function getDatetimeIndex(input) { } /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2381,7 +2410,7 @@ function getDocumentDescription() { } /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2726,7 +2755,7 @@ function getMiliSecondsSinceDate(date) { } /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2754,7 +2783,7 @@ var _each = __webpack_require__(0); var _each2 = _interopRequireDefault(_each); -var _queue = __webpack_require__(17); +var _queue = __webpack_require__(18); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2836,7 +2865,7 @@ function handleValidationError(message) { } /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2979,7 +3008,7 @@ var getFromCache = exports.getFromCache = function getFromCache(hash) { }; /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2998,7 +3027,7 @@ var _md = __webpack_require__(13); var _md2 = _interopRequireDefault(_md); -var _cacheBrowser = __webpack_require__(31); +var _cacheBrowser = __webpack_require__(32); var _configDefault = __webpack_require__(3); @@ -3055,7 +3084,7 @@ var isUnique = exports.isUnique = function isUnique(customCacheConfig, extendedE exports.default = isUnique; /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3127,7 +3156,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de ; /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, exports) { module.exports = { @@ -3179,7 +3208,7 @@ module.exports = { /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, exports) { // shim for using process in browser @@ -3369,7 +3398,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 36 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { @@ -3559,10 +3588,10 @@ process.umask = function() { return 0; }; attachTo.clearImmediate = clearImmediate; }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(35))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(36))) /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || @@ -3618,7 +3647,7 @@ exports._unrefActive = exports.active = function(item) { }; // setimmediate attaches itself to the global object -__webpack_require__(36); +__webpack_require__(37); // On some exotic environments, it's not clear which object `setimmediate` was // able to install onto. Search each possibility in the same order as the // `setimmediate` library. @@ -3632,7 +3661,7 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), -/* 38 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3653,7 +3682,7 @@ __webpack_require__(2); __webpack_require__(6); -var _base = __webpack_require__(34); +var _base = __webpack_require__(35); var _base2 = _interopRequireDefault(_base); @@ -3673,11 +3702,11 @@ var _package = __webpack_require__(7); var _extendEvents = __webpack_require__(15); -var _fetchRetry = __webpack_require__(33); +var _fetchRetry = __webpack_require__(34); var _fetchRetry2 = _interopRequireDefault(_fetchRetry); -var _unique = __webpack_require__(32); +var _unique = __webpack_require__(33); var _unique2 = _interopRequireDefault(_unique); @@ -4028,7 +4057,7 @@ function sendBeacon(url, callback) { } /***/ }), -/* 39 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4318,7 +4347,7 @@ function deferFormSubmit(evt, form, callback) { } /***/ }), -/* 40 */ +/* 41 */ /***/ (function(module, exports, __webpack_require__) { var each = __webpack_require__(0), @@ -4339,7 +4368,7 @@ function serialize(data){ /***/ }), -/* 41 */ +/* 42 */ /***/ (function(module, exports) { module.exports = parseParams; @@ -4361,15 +4390,15 @@ function parseParams(str){ /***/ }), -/* 42 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {(function(env){ var previousKeen = env.Keen || undefined; var each = __webpack_require__(0), extend = __webpack_require__(1), - parseParams = __webpack_require__(41), - serialize = __webpack_require__(40); + parseParams = __webpack_require__(42), + serialize = __webpack_require__(41); var Emitter = __webpack_require__(8); @@ -4596,7 +4625,7 @@ function parseParams(str){ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), -/* 43 */ +/* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4619,43 +4648,45 @@ var _extend = __webpack_require__(1); var _extend2 = _interopRequireDefault(_extend); -var _listener = __webpack_require__(39); +var _listener = __webpack_require__(40); -var _recordEventsBrowser = __webpack_require__(38); +var _recordEventsBrowser = __webpack_require__(39); -var _deferEvents = __webpack_require__(30); +var _deferEvents = __webpack_require__(31); var _extendEvents = __webpack_require__(15); -var _browserAutoTracking = __webpack_require__(29); +var _browserAutoTracking = __webpack_require__(30); -var _getBrowserProfile = __webpack_require__(28); +var _getBrowserProfile = __webpack_require__(29); -var _getDatetimeIndex = __webpack_require__(27); +var _getDatetimeIndex = __webpack_require__(28); -var _getDomainName = __webpack_require__(26); +var _getDomainName = __webpack_require__(27); var _getDomNodePath = __webpack_require__(10); -var _getDomNodeProfile = __webpack_require__(25); +var _getDomNodeProfile = __webpack_require__(26); var _getScreenProfile = __webpack_require__(12); -var _getScrollState = __webpack_require__(24); +var _getScrollState = __webpack_require__(25); -var _getUniqueId = __webpack_require__(23); +var _getUniqueId = __webpack_require__(24); var _getWindowProfile = __webpack_require__(11); -var _cookie = __webpack_require__(22); +var _cookie = __webpack_require__(23); var _deepExtend = __webpack_require__(14); -var _serializeForm = __webpack_require__(20); +var _serializeForm = __webpack_require__(21); -var _timer = __webpack_require__(19); +var _timer = __webpack_require__(20); -var _optOut = __webpack_require__(16); +var _optOut = __webpack_require__(17); + +var _localStorage = __webpack_require__(16); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4730,7 +4761,7 @@ if (typeof webpackKeenGlobals !== 'undefined') { exports.keenGlobals = keenGlobals = webpackKeenGlobals; } -if (localStorage && localStorage.getItem('optout')) { +if (_localStorage.isLocalStorageAvailable && localStorage.getItem('optout')) { _index2.default.optedOut = true; } @@ -4743,10 +4774,10 @@ var KeenTracking = exports.KeenTracking = Keen; exports.default = Keen; /***/ }), -/* 44 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(43); +module.exports = __webpack_require__(44); /***/ }) diff --git a/dist/keen-tracking.js.map b/dist/keen-tracking.js.map index b0674b5a..ed6ffe01 100644 --- a/dist/keen-tracking.js.map +++ b/dist/keen-tracking.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./node_modules/keen-core/lib/utils/each.js","webpack:///./node_modules/keen-core/lib/utils/extend.js","webpack:///./node_modules/promise-polyfill/src/polyfill.js","webpack:///./lib/config-default.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/promise-polyfill/src/finally.js","webpack:///./node_modules/whatwg-fetch/fetch.js","webpack:///./node_modules/component-emitter/index.js","webpack:///./lib/index.js","webpack:///./lib/helpers/getDomNodePath.js","webpack:///./lib/helpers/getWindowProfile.js","webpack:///./lib/helpers/getScreenProfile.js","webpack:///./lib/utils/md5.js","webpack:///./lib/utils/deepExtend.js","webpack:///./lib/extend-events.js","webpack:///./lib/utils/optOut.js","webpack:///./lib/utils/queue.js","webpack:///./node_modules/promise-polyfill/src/index.js","webpack:///./lib/utils/timer.js","webpack:///./lib/utils/serializeForm.js","webpack:///./node_modules/js-cookie/src/js.cookie.js","webpack:///./lib/utils/cookie.js","webpack:///./lib/helpers/getUniqueId.js","webpack:///./lib/helpers/getScrollState.js","webpack:///./lib/helpers/getDomNodeProfile.js","webpack:///./lib/helpers/getDomainName.js","webpack:///./lib/helpers/getDatetimeIndex.js","webpack:///./lib/helpers/getBrowserProfile.js","webpack:///./lib/browser-auto-tracking.js","webpack:///./lib/defer-events.js","webpack:///./lib/utils/cache-browser.js","webpack:///./lib/utils/unique.js","webpack:///./lib/utils/fetchRetry.js","webpack:///./node_modules/keen-core/lib/utils/base64.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./lib/record-events-browser.js","webpack:///./lib/utils/listener.js","webpack:///./node_modules/keen-core/lib/utils/serialize.js","webpack:///./node_modules/keen-core/lib/utils/parse-params.js","webpack:///./node_modules/keen-core/lib/index.js","webpack:///./lib/browser.js"],"names":["configDefault","queue","capacity","interval","retry","limit","initialDelay","retryOnResponseStatuses","unique","cache","dbName","dbCollectionName","dbCollectionKey","maxAge","KeenCore","helpers","prototype","observers","on","client","extensions","events","collections","config","respectDoNotTrack","doNotTrack","optOut","optedOut","recordDeferredEvents","writeKey","str","arguments","length","String","referrerPolicy","setGlobalProperties","props","log","version","pkg","getDomNodePath","el","nodeName","stack","parentNode","sibCount","sibIndex","i","childNodes","sib","hasAttribute","id","unshift","toLowerCase","slice","join","getWindowProfile","body","html","output","document","documentElement","window","innerHeight","offsetHeight","innerWidth","offsetWidth","Math","max","scrollHeight","clientHeight","screen","ratio","availHeight","parseFloat","toFixed","availWidth","getScreenProfile","keys","orientation","MD5","d","result","M","V","Y","X","_","m","f","r","charCodeAt","charAt","Array","fromCharCode","n","h","t","g","e","md5_ii","md5_hh","md5_gg","md5_ff","safe_add","md5_cmn","bit_rol","deepExtend","target","j","indexOf","push","prop","clone","undefined","input","JSON","parse","stringify","extendEvent","extendEvents","getExtendedEventBody","eventCollection","eventModifier","handleValidationError","call","emit","eventsModifier","message","modifierResult","setOptOut","localStorage","setItem","removeItem","configQueue","timer","check","shouldFlushQueue","flush","pause","clearInterval","start","self","setInterval","num","count","value","clear","serializeForm","k_r_submitter","k_r_success_contrls","brackets","form","options","hash","serializer","hash_serializer","str_serialize","elements","radio_store","Object","create","element","ignoreTypes","type","disabled","name","test","key","val","checked","empty","selectOptions","isSelectedOptions","option","allowedEmpty","hasValue","selected","parse_keys","string","prefix","children","RegExp","match","exec","hash_assign","shift","between","isArray","_values","index","isNaN","matches","existing","replace","encodeURIComponent","cookie","expires","data","get","Cookies","getJSON","set","enabled","expire","daysUntilExpire","remove","obj","navigator","cookieEnabled","getUniqueId","crypto","getRandomValues","c","Uint8Array","toString","random","v","getScrollState","state","pixel","pixel_max","ratio_max","getScrollOffset","getWindowHeight","Number","getScrollableArea","pageYOffset","scrollTop","getDomNodeProfile","action","class","className","href","getElementProps","event_key","method","node_name","selector","text","title","x_position","offsetLeft","clientLeft","y_position","offsetTop","clientTop","getAttribute","getDomainName","extractHostname","url","hostname","split","domain","splitArr","arrLen","getDatetimeIndex","date","Date","getHours","parseInt","getDay","getDate","getMonth","getFullYear","getBrowserProfile","appCodeName","getDocumentDescription","language","appName","onLine","platform","userAgent","appVersion","querySelector","content","initAutoTrackingCore","lib","utils","extend","ignoreDisabledFormFields","ignoreFormFieldTypes","recordClicks","recordClicksPositionPointer","recordFormSubmits","recordPageViews","recordPageViewsOnExit","recordScrollState","shareUuidAcrossDomains","collectIpAddress","collectUuid","recordElementViews","catchError","requestType","now","allTimeOnSiteS","allTimeOnSiteMS","hidden","visibilityChange","msHidden","webkitHidden","handleVisibilityChange","getSecondsSinceDate","getMiliSecondsSinceDate","addEventListener","domainName","location","cookieDomain","uuid","initialReferrer","referrer","scrollState","listener","addons","ua_string","date_time","ip_address","ip","remove_ip_property","browserProfile","tracked_by","local_time_full","toISOString","user","page","description","scroll_state","time_on_page","time_on_page_ms","geo","user_agent","tech","profile","full","info","initial","time","local","utc","keen","timestamp","event","pointer","pageX","pageY","recordEvent","collection","catch","err","serializerOptions","fields","IntersectionObserver","elementViewsOptions","threshold","elementViewsCallback","observer","forEach","isIntersecting","querySelectorAll","observe","round","getTime","deferEvent","deferEvents","queueCapacity","queueInterval","eventBody","eventsHash","eventList","concat","clonedQueueConfig","clonedQueueEvents","recordEvents","res","console","indexedDBAvailable","cachingEnabled","db","cacheConfig","initializeIndexedDb","requestCacheConfig","Promise","resolve","reject","dbConnectionRequest","indexedDB","open","onerror","onupgradeneeded","objectStore","createObjectStore","keyPath","createIndex","onsuccess","saveToCache","configOptions","then","transactionSave","transaction","requestSave","add","expiryTime","getFromCache","transactionCleanUp","indexCleanUp","upperBoundOpenKeyRange","IDBKeyRange","upperBound","openCursor","cursor","transactionDelete","delete","continue","transactionIndex","responseFromCache","uniqueIds","isUnique","customCacheConfig","extendedEventBody","configCache","stringifiedEvent","hashingMethod","item","filter","alreadySentEvent","find","storage","retriesLimit","retryInitialDelay","retryOn","retriesCount","wrappedFetch","fetch","response","status","error","setTimeout","eventCollectionOrConfigObject","callback","useBeaconApi","configObject","clientConfig","event_collection","checkValidation","extendedEventsHash","isUniqueResult","created","Keen","send","sendBeacon","getRequestUrl","api_key","base64","encode","modified","getRequestUrlOkLength","getUrlMaxLength","sendFetch","mode","redirect","headers","connectionError","ok","json","error_code","responseJSON","statusText","eventsSavedSuccessfuly","checkEventsSavedSuccessfuly","responseKeys","notSavedEvents","map","success","projectId","img","createElement","loaded","onload","naturalHeight","naturalWidth","width","height","src","listenerCore","ctx","domListeners","fn","addListener","eventHandler","once","off","apply","survivors","handler","eventType","evt","srcElement","handlers","deferClickEvent","deferFormSubmit","attachEvent","elem","nodeList","anchor","timeout","targetAttr","cbResponse","defaultPrevented","returnValue","preventDefault","metaKey","submit","initAutoTracking","listenTo","listenerHash","keenGlobals","webpackKeenGlobals","getItem","extendLibrary","KeenTracking"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;ACnEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACTA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;AACD;AACA;;;;;;;;;;;;;;ACvBO,IAAMA,wCAAgB;;AAE3B;AACA;AACAC,SAAO;AACLC,cAAU,IADL;AAELC,cAAU;AAFL,GAJoB;;AAS3B;AACAC,SAAO;AACLC,WAAO,EADF;AAELC,kBAAc,GAFT;AAGLC,6BAAyB,CACvB,GADuB,EAEvB,GAFuB,EAGvB,GAHuB,EAIvB,GAJuB,EAKvB,GALuB;AAHpB,GAVoB;;AAsB3BC,UAAQ,KAtBmB,EAsBZ;AACf;AACAC,SAAO;AACL;;;AAGAC,YAAQ,cAJH,EAImB;AACxBC,sBAAkB,QALb;AAMLC,qBAAiB,MANZ;;AAQL;;;AAGAC,YAAQ,KAAK,IAXR,CAWc;AAXd;AAxBoB,CAAtB;;kBAuCQb,a;;;;;;ACvCf;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;ACdA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;;AAEA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;;AAEA;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD,SAAS;AACT;AACA,SAAS;AACT,8EAA8E;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B,uBAAuB;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,uCAAuC,0BAA0B;AACjE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,+BAA+B,0BAA0B,eAAe;AACxE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;AACL;AACA;AACA,CAAC;;;;;;;;;;;;;;AChdD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ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YAAW;AACjC,MAAI,KAAKJ,KAAT,EAAgB;AACdK,kBAAc,KAAKL,KAAnB;AACA,SAAKA,KAAL,GAAa,IAAb;AACD;AACD,SAAO,IAAP;AACD,CAND;;AAQAtI,MAAMe,SAAN,CAAgB6H,KAAhB,GAAwB,YAAW;AACjC,MAAIC,OAAO,IAAX;AACAA,OAAKH,KAAL;AACAG,OAAKP,KAAL,GAAaQ,YAAY,YAAW;AAClCD,SAAK3I,QAAL;AACA2I,SAAKN,KAAL;AACD,GAHY,EAGV,IAHU,CAAb;AAIA,SAAOM,IAAP;AACD,CARD;;AAUA,SAASL,gBAAT,CAA0BrG,KAA1B,EAAiC;AAC/B,MAAIA,MAAMlC,QAAN,GAAiB,CAAjB,IAAsBkC,MAAMjC,QAAN,IAAkBiC,MAAMb,MAAN,CAAapB,QAAzD,EAAmE;AACjE,WAAO,IAAP;AACD,GAFD,MAGK,IAAIiC,MAAMlC,QAAN,IAAkBkC,MAAMb,MAAN,CAAarB,QAAnC,EAA6C;AAChD,WAAO,IAAP;AACD;AACD,SAAO,KAAP;AACD,C;;;;;;;;AClED;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;;;;;;;;;;;;;;QCnOgBqI,K,GAAAA,K;AAAT,SAASA,KAAT,CAAeS,GAAf,EAAmB;AACxB,MAAI,gBAAgBT,KAAhB,KAA0B,KAA9B,EAAqC;AACnC,WAAO,IAAIA,KAAJ,CAAUS,GAAV,CAAP;AACD;AACD,OAAKC,KAAL,GAAaD,OAAO,CAApB;AACA,SAAO,IAAP;AACD;;AAEDT,MAAMvH,SAAN,CAAgB6H,KAAhB,GAAwB,YAAU;AAChC,MAAIC,OAAO,IAAX;AACA,OAAKH,KAAL;AACA,OAAKxI,QAAL,GAAgB4I,YAAY,YAAU;AACpCD,SAAKG,KAAL;AACD,GAFe,EAEb,IAFa,CAAhB;AAGA,SAAO,IAAP;AACD,CAPD;;AASAV,MAAMvH,SAAN,CAAgB2H,KAAhB,GAAwB,YAAU;AAChCC,gBAAc,KAAKzI,QAAnB;AACA,SAAO,IAAP;AACD,CAHD;;AAKAoI,MAAMvH,SAAN,CAAgBkI,KAAhB,G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KAAT,GAAiB;AACf0a,qBAAeA,eAAe,CAA9B;AACAM,iBAAW,YAAW;AAClBL,qBAAaJ,eAAeG,YAA5B;AACD,OAFH,EAEK,IAAEA,eAAeF,iBAFtB;AAGD;;AAEDG,iBAAaJ,eAAeG,YAA5B;AACD,GA/BM,CAAP;AAgCD,C;;AAvDD;;AACA;;AAEA;;;;;;AAoDC,C;;;;;;ACvDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wBAAwB;AACrD,qBAAqB,oCAAoC;AACzD;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,oCAAoC;AACpC,iCAAiC;AACjC;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;AC7CA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;ACvLtC;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C,sBAAsB,EAAE;AAClE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AA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OF,UAAP,KAAsB,WAA1B,EAAuC;AACrC,YAAI1S,aAAaA,UAAUiP,UAA3B,EAAuC;AACrCzS,eAAKuW,MAAL;AACA;AACD;AACD;AACAL,mBAAW9G,IAAX,CAAgB,YAAM;AACpBpP,eAAKuW,MAAL;AACD,SAFD,EAEGpK,KAFH,CAES,eAAO;AACd;AACAnM,eAAKuW,MAAL;AACD,SALD;AAMD,OAZD,MAYO;AACL3E,mBAAW,YAAU;AACnB5R,eAAKuW,MAAL;AACD,SAFD,EAEGP,OAFH;AAGD;AACF;;AAED,SAAO,KAAP;AACD,C;;;;;;ACxRD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACdA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,+CAA+C,EAAE;AAC9E;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,SAAS,IAAI,KAAK;AACtC,oBAAoB,SAAS,IAAI,KAAK;AACtC,oBAAoB,SAAS,IAAI,KAAK;AACtC,oBAAoB,SAAS,IAAI,KAAK,eAAe,UAAU;AAC/D,oBAAoB,SAAS,IAAI,KAAK,eAAe,UAAU;AAC/D,oBAAoB,SAAS,IAAI,KAAK,eAAe,UAAU;AAC/D,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,kDAAkD,SAAS,IAAI,KAAK;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,CAAC,sIAAsI;;;;;;;;;;;;;;;;ACnOvI;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAIA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA,sBAAO1e,gBAASE,SAAhB,EAA2B;AACzByU,+CADyB;AAEzB2B;AAFyB,CAA3B;;AAKA,sBAAOtW,gBAASE,SAAhB,EAA2B;AACzB0V,qCADyB;AAEzBC,uCAFyB;AAGzBC,2CAHyB;AAIzBC,2CAJyB;AAKzBjV,yDALyB;AAMzBsG;AANyB,CAA3B;AAQA,sBAAOpH,gBAASE,SAAhB,EAA2B;AACzBuG,wCADyB;AAEzBC;AAFyB,CAA3B;;AAKA;AACA;AACA;AACA,IAAMwY,mBAAmB,+CAAqBlf,eAArB,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AAtB;AACD;;AAEM,IAAMsa,sBAAOjb,gBAASwf,aAAT,CAAuBxf,eAAvB,CAAb,C,CAA+C;AAC/C,IAAMyf,sCAAexE,IAArB;kBACQA,I","file":"keen-tracking.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 44);\n","module.exports = each;\n\nfunction each(o, cb, s){\n var n;\n if (!o){\n return 0;\n }\n s = !s ? o : s;\n if (o instanceof Array){\n // Indexed arrays, needed for Safari\n for (n=0; n -1\n }\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue+','+value : value\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit })\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n var xhr = new XMLHttpRequest()\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","import KeenCore from 'keen-core';\nimport each from 'keen-core/lib/utils/each';\nimport extend from 'keen-core/lib/utils/extend';\nimport { queue } from './utils/queue';\nimport { setOptOut } from './utils/optOut';\nimport pkg from '../package.json';\n\nKeenCore.helpers = KeenCore.helpers || {};\nKeenCore.prototype.observers = KeenCore.observers || {};\n\n// Install internal queue\nKeenCore.on('client', function(client){\n client.extensions = {\n events: [],\n collections: {}\n };\n \n if (!client.config.respectDoNotTrack) {\n this.doNotTrack = false;\n }\n\n if (typeof client.config.optOut !== 'undefined') {\n setOptOut(client.config.optOut);\n this.optedOut = client.config.optOut;\n }\n \n client.queue = queue(client.config.queue);\n client.queue.on('flush', function(){\n client.recordDeferredEvents();\n });\n});\n\n// Accessors\nKeenCore.prototype.writeKey = function(str){\n if (!arguments.length) return this.config.writeKey;\n this.config.writeKey = (str ? String(str) : null);\n return this;\n};\n\nKeenCore.prototype.referrerPolicy = function(str){\n if (!arguments.length) return this.config.referrerPolicy;\n this.config.referrerPolicy = (str ? String(str) : null);\n return this;\n};\n\n// DEPRECATED\nKeenCore.prototype.setGlobalProperties = function(props){\n KeenCore.log('This method has been removed. Check out #extendEvents: https://github.com/keen/keen-tracking.js#extend-events');\n return this;\n};\n\nKeenCore.version = pkg.version;\n\nexport default KeenCore;\n","export function getDomNodePath(el){\n if (!el.nodeName) return '';\n\n var stack = [];\n while ( el.parentNode != null ) {\n // console.log(el.nodeName);\n var sibCount = 0;\n var sibIndex = 0;\n for ( var i = 0; i < el.parentNode.childNodes.length; i++ ) {\n var sib = el.parentNode.childNodes[i];\n if ( sib.nodeName == el.nodeName ) {\n if ( sib === el ) {\n sibIndex = sibCount;\n }\n sibCount++;\n }\n }\n if ( el.hasAttribute('id') && el.id != '' ) {\n stack.unshift(el.nodeName.toLowerCase() + '#' + el.id);\n } else if ( sibCount > 1 ) {\n stack.unshift(el.nodeName.toLowerCase() + ':eq(' + sibIndex + ')');\n } else {\n stack.unshift(el.nodeName.toLowerCase());\n }\n el = el.parentNode;\n }\n\n return stack.slice(1).join(' > ');\n}\n\n\n// via: http://stackoverflow.com/a/16742828/2511985\n","export function getWindowProfile(){\n var body, html, output;\n\n if ('undefined' == typeof document) return {};\n\n body = document.body || {};\n html = document.documentElement || {};\n\n output = {\n 'height': ('innerHeight' in window) ? window.innerHeight : document.documentElement.offsetHeight,\n 'width': ('innerWidth' in window) ? window.innerWidth : document.documentElement.offsetWidth,\n 'scrollHeight': Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ) || null\n };\n\n if (window.screen) {\n output.ratio = {\n 'height': (window.screen.availHeight) ? parseFloat( (window.innerHeight/window.screen.availHeight).toFixed(2) ) : null,\n 'width': (window.screen.availWidth) ? parseFloat( (window.innerWidth/window.screen.availWidth).toFixed(2) ) : null\n };\n }\n\n return output;\n}\n\n/*\n Notes:\n document.documentElement.offsetHeight/Width is a workaround for IE8 and below, where window.innerHeight/Width is undefined\n*/\n","export function getScreenProfile(){\n var keys, output;\n\n if ('undefined' == typeof window || !window.screen) return {};\n\n keys = ['height', 'width', 'colorDepth', 'pixelDepth', 'availHeight', 'availWidth'];\n output = {};\n\n for (var i = 0; i < keys.length; i++) {\n output[keys[i]] = window.screen[keys[i]] ? window.screen[keys[i]] : null;\n }\n\n output.orientation = {\n 'angle' : window.screen.orientation ? window.screen.orientation['angle'] : 0,\n 'type' : window.innerWidth > window.innerHeight ? 'landscape': 'portrait'\n };\n\n return output;\n}\n","export const MD5 = function(d){const result = M(V(Y(X(d),8*d.length)));return result.toLowerCase()};function M(d){for(var _,m=\"0123456789ABCDEF\",f=\"\",r=0;r>>4&15)+m.charAt(15&_);return f}function X(d){for(var _=Array(d.length>>2),m=0;m<_.length;m++)_[m]=0;for(m=0;m<8*d.length;m+=8)_[m>>5]|=(255&d.charCodeAt(m/8))<>5]>>>m%32&255);return _}function Y(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,r=-1732584194,i=271733878,n=0;n>16)+(_>>16)+(m>>16)<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}\n\nexport default MD5;\n","export const deepExtend = function(target){\n for (var i = 1; i < arguments.length; i++) {\n // Copy unique items from incoming array\n if (target instanceof Array && arguments[i] instanceof Array) {\n for (var j = 0; j < arguments[i].length; j++) {\n if (target.indexOf(arguments[i][j]) < 0) {\n target.push(arguments[i][j]);\n }\n }\n }\n // Blend objects\n else {\n for (var prop in arguments[i]){\n // Recurse when both contain objects of same name\n // and incoming is not a null object\n if (typeof target[prop] !== 'undefined'\n && typeof target[prop] === 'object'\n && typeof arguments[i][prop] === 'object'\n && arguments[i][prop] !== null) {\n deepExtend(target[prop], clone(arguments[i][prop]));\n }\n // Otherwise just copy it over...\n else if (\n arguments[i][prop] !== undefined &&\n typeof arguments[i][prop] !== 'function') {\n target[prop] = clone(arguments[i][prop]);\n }\n }\n }\n }\n return target;\n}\n\nfunction clone(input){\n return JSON.parse( JSON.stringify(input) );\n}\n","import { deepExtend } from './utils/deepExtend';\nimport each from 'keen-core/lib/utils/each';\n\nexport function extendEvent(eventCollection, eventModifier){\n if (arguments.length !== 2 || typeof eventCollection !== 'string'\n || ('object' !== typeof eventModifier && 'function' !== typeof eventModifier)) {\n handleValidationError.call(this, 'Incorrect arguments provided to #extendEvent method');\n return;\n }\n this.extensions.collections[eventCollection] = this.extensions.collections[eventCollection] || [];\n this.extensions.collections[eventCollection].push(eventModifier);\n this.emit('extendEvent', eventCollection, eventModifier);\n return this;\n}\n\nexport function extendEvents(eventsModifier){\n if (arguments.length !== 1 || ('object' !== typeof eventsModifier && 'function' !== typeof eventsModifier)) {\n handleValidationError.call(this, 'Incorrect arguments provided to #extendEvents method');\n return;\n }\n this.extensions.events.push(eventsModifier);\n this.emit('extendEvents', eventsModifier);\n return this;\n}\n\nfunction handleValidationError(message){\n this.emit('error', `Event(s) not extended: ${message}`);\n}\n\nexport function getExtendedEventBody(result, queue){\n if (queue && queue.length > 0) {\n each(queue, function(eventModifier, i){\n let modifierResult = (typeof eventModifier === 'function') ? eventModifier() : eventModifier;\n deepExtend(result, modifierResult);\n });\n }\n return result;\n}\n","export function setOptOut(optOut = true) {\n if (optOut) {\n localStorage.setItem('optout', optOut);\n return;\n }\n\n localStorage.removeItem('optout');\n};\n","import Emitter from 'component-emitter';\n\nimport configDefault from '../config-default.js';\n\nexport function queue(configQueue = {}) {\n if (this instanceof queue === false) {\n return new queue(configQueue);\n }\n this.capacity = 0;\n this.config = {\n ...configDefault.queue,\n ...configQueue\n };\n this.events = {\n // \"collection-1\": [],\n // \"collection-2\": []\n };\n this.interval = 0;\n this.timer = null;\n return this;\n}\n\nEmitter(queue.prototype);\n\nqueue.prototype.check = function() {\n if (shouldFlushQueue(this)) {\n this.flush();\n }\n if (this.config.interval === 0 || this.capacity === 0) {\n this.pause();\n }\n return this;\n};\n\nqueue.prototype.flush = function() {\n this.emit('flush');\n this.interval = 0;\n return this;\n};\n\nqueue.prototype.pause = function() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n return this;\n};\n\nqueue.prototype.start = function() {\n var self = this;\n self.pause();\n self.timer = setInterval(function() {\n self.interval++;\n self.check();\n }, 1000);\n return self;\n};\n\nfunction shouldFlushQueue(props) {\n if (props.capacity > 0 && props.interval >= props.config.interval) {\n return true;\n }\n else if (props.capacity >= props.config.capacity) {\n return true;\n }\n return false;\n}\n","import promiseFinally from './finally';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!arr || typeof arr.length === 'undefined')\n throw new TypeError('Promise.all accepts an array');\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(values) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n (typeof setImmediate === 'function' &&\n function(fn) {\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","export function timer(num){\n if (this instanceof timer === false) {\n return new timer(num);\n }\n this.count = num || 0;\n return this;\n}\n\ntimer.prototype.start = function(){\n var self = this;\n this.pause();\n this.interval = setInterval(function(){\n self.count++;\n }, 1000);\n return this;\n};\n\ntimer.prototype.pause = function(){\n clearInterval(this.interval);\n return this;\n};\n\ntimer.prototype.value = function(){\n return this.count;\n};\n\ntimer.prototype.clear = function(){\n this.count = 0;\n return this;\n};\n","/*\n This is a modified copy of https://github.com/defunctzombie/form-serialize/ v0.7.1\n Includes a new configuration option:\n * ignoreTypes - Array, Default: [], Example: [ 'password' ]\n*/\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nexport function serializeForm(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n // Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i -1) {\n continue;\n }\n // ingore disabled fields\n if ((!options.disabled && element.disabled) || !element.name) {\n continue;\n }\n // ignore anyhting that is not considered a success field\n if (!k_r_success_contrls.test(element.nodeName) ||\n k_r_submitter.test(element.type)) {\n continue;\n }\n\n var key = element.name;\n var val = element.value;\n\n // we can't just use element.value for checkboxes cause some browsers lie to us\n // they say \"on\" for value when the box isn't checked\n if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) {\n val = undefined;\n }\n\n // If we want empty elements\n if (options.empty) {\n if (element.type === 'checkbox' && !element.checked) {\n val = '';\n }\n\n // for radio\n if (element.type === 'radio') {\n if (!radio_store[element.name] && !element.checked) {\n radio_store[element.name] = false;\n }\n else if (element.checked) {\n radio_store[element.name] = true;\n }\n }\n\n // if options empty is true, continue only if its radio\n if (val == undefined && element.type == 'radio') {\n continue;\n }\n }\n else {\n // value-less fields are ignored unless options.empty is true\n if (!val) {\n continue;\n }\n }\n\n // multi select boxes\n if (element.type === 'select-multiple') {\n val = [];\n\n var selectOptions = element.options;\n var isSelectedOptions = false;\n for (var j=0 ; j 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\treturn (document.cookie = [\n\t\t\t\t\tkey, '=', value,\n\t\t\t\t\tattributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE\n\t\t\t\t\tattributes.path && '; path=' + attributes.path,\n\t\t\t\t\tattributes.domain && '; domain=' + attributes.domain,\n\t\t\t\t\tattributes.secure ? '; secure' : ''\n\t\t\t\t].join(''));\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.get = api.set = api;\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","import Cookies from 'js-cookie';\nimport extend from 'keen-core/lib/utils/extend';\n\nexport const cookie = function(str){\n if (!arguments.length) return;\n if (this instanceof cookie === false) {\n return new cookie(str);\n }\n\n this.config = {\n key: str,\n options: {\n expires: 365\n }\n };\n this.data = this.get();\n return this;\n}\n\ncookie.prototype.get = function(str){\n var data = {};\n\n if (Cookies.get(this.config.key)) {\n data = Cookies.getJSON(this.config.key);\n }\n if (str && typeof data === 'object' && typeof data !== null) {\n return (typeof data[str] !== 'undefined') ? data[str] : null;\n }\n else {\n return data;\n }\n};\n\ncookie.prototype.set = function(str, value, options){\n if (!arguments.length || !this.enabled()) return this;\n if (typeof str === 'string' && arguments.length >= 2) {\n this.data[str] = value ? value : null;\n }\n else if (typeof str === 'object' && arguments.length === 1) {\n extend(this.data, str);\n }\n Cookies.set(\n this.config.key,\n this.data,\n extend(this.config.options, options || {})\n );\n return this;\n};\n\ncookie.prototype.expire = function(daysUntilExpire){\n if (daysUntilExpire) {\n Cookies.set(\n this.config.key,\n this.data,\n extend(this.config.options, { expires: daysUntilExpire })\n );\n } else {\n Cookies.remove(this.config.key);\n this.data = {};\n }\n return this;\n};\n\ncookie.prototype.options = function(obj){\n if (!arguments.length) return this.config.options;\n this.config.options = (typeof obj === 'object') ? obj : {};\n return this;\n};\n\ncookie.prototype.enabled = function(){\n return navigator.cookieEnabled;\n};\n","export function getUniqueId() {\n // uuidv4\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n // browser\n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n )\n } else {\n // node & older browsers\n let str = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n return str.replace(/[xy]/g, function(c) {\n let r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }\n}\n","import extend from 'keen-core/lib/utils/extend';\n\nexport function getScrollState(obj){\n var config = typeof obj === 'object' ? obj : {};\n var state = extend({\n pixel: 0,\n pixel_max: 0,\n ratio: null,\n ratio_max: null\n }, config);\n\n if (typeof window !== undefined || typeof document !== undefined) {\n state.pixel = getScrollOffset() + getWindowHeight();\n if (state.pixel > state.pixel_max) {\n state.pixel_max = state.pixel;\n }\n state.ratio = parseFloat(Number(state.pixel / getScrollableArea()).toFixed(2));\n state.ratio_max = parseFloat(Number(state.pixel_max / getScrollableArea()).toFixed(2));\n }\n\n return state;\n}\n\nfunction getScrollableArea() {\n var body = document.body;\n var html = document.documentElement;\n return Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ) || null;\n}\n\nfunction getScrollOffset() {\n return (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;\n}\n\nfunction getWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight;\n}\n","import { getDomNodePath } from './getDomNodePath';\n\nexport function getDomNodeProfile(el) {\n return {\n action: el.action,\n class: el.className,\n href: getElementProps(el, 'href'),\n id: getElementProps(el, 'id'),\n event_key: getElementProps(el, 'data-event-key'),\n method: el.method,\n name: el.name,\n node_name: el.nodeName,\n selector: getDomNodePath(el),\n text: getElementProps(el, 'text'),\n title: getElementProps(el, 'title'),\n type: el.type,\n x_position: el.offsetLeft || el.clientLeft || null,\n y_position: el.offsetTop || el.clientTop || null\n };\n}\n\nconst getElementProps = (el, prop) => {\n if (el[prop]) {\n return el[prop];\n }\n if (el.hasAttribute && el.hasAttribute(prop)) {\n return el.getAttribute(prop);\n }\n if (el.parentNode) {\n return getElementProps(el.parentNode, prop);\n }\n return null;\n};\n","function extractHostname(url) {\n var hostname;\n //find & remove protocol (http, ftp, etc.) and get hostname\n\n if (url.indexOf(\"://\") > -1) {\n hostname = url.split('/')[2];\n }\n else {\n hostname = url.split('/')[0];\n }\n\n //find & remove port number\n hostname = hostname.split(':')[0];\n //find & remove \"?\"\n hostname = hostname.split('?')[0];\n\n return hostname;\n}\n\n// To address those who want the \"root domain,\" use this function:\nexport function getDomainName(url) {\n var domain = extractHostname(url),\n splitArr = domain.split('.'),\n arrLen = splitArr.length;\n\n //extracting the root domain here\n //if there is a subdomain\n if (arrLen > 2) {\n domain = splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1];\n //check to see if it's using a Country Code Top Level Domain (ccTLD) (i.e. \".me.uk\")\n if (splitArr[arrLen - 2].length == 2 && splitArr[arrLen - 1].length == 2) {\n //this is using a ccTLD\n domain = splitArr[arrLen - 3] + '.' + domain;\n }\n }\n return domain;\n}\n","export function getDatetimeIndex(input){\n var date = input || new Date();\n return {\n 'hour_of_day' : date.getHours(),\n 'day_of_week' : parseInt( 1 + date.getDay() ),\n 'day_of_month' : date.getDate(),\n 'month' : parseInt( 1 + date.getMonth() ),\n 'year' : date.getFullYear()\n };\n}\n","import { getScreenProfile } from './getScreenProfile';\nimport { getWindowProfile } from './getWindowProfile';\n\nexport function getBrowserProfile() {\n return {\n 'cookies' : ('undefined' !== typeof navigator.cookieEnabled) ? navigator.cookieEnabled : false,\n 'codeName' : navigator.appCodeName,\n 'description': getDocumentDescription(),\n 'language' : navigator.language,\n 'name' : navigator.appName,\n 'online' : navigator.onLine,\n 'platform' : navigator.platform,\n 'useragent' : navigator.userAgent,\n 'version' : navigator.appVersion,\n 'doNotTrack' : navigator.doNotTrack,\n 'screen' : getScreenProfile(),\n 'window' : getWindowProfile()\n }\n}\n\nfunction getDocumentDescription() {\n var el;\n if (document && typeof document.querySelector === 'function') {\n el = document.querySelector('meta[name=\"description\"]');\n }\n return el ? el.content : '';\n}\n","import pkg from '../package.json';\n\nexport function initAutoTrackingCore(lib) {\n return function(obj) {\n const client = this;\n const helpers = lib.helpers;\n const utils = lib.utils;\n\n const options = utils.extend({\n ignoreDisabledFormFields: false,\n ignoreFormFieldTypes: ['password'],\n recordClicks: true,\n recordClicksPositionPointer: false,\n recordFormSubmits: true,\n recordPageViews: true,\n recordPageViewsOnExit: false,\n recordScrollState: true,\n shareUuidAcrossDomains: false,\n collectIpAddress: true,\n collectUuid: true,\n recordElementViews: true,\n catchError: undefined // optional, function(someError) - error handler\n }, obj);\n\n if (client.config.requestType === 'beaconAPI' && options.catchError) {\n 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'`;\n return;\n }\n\n if (\n client.config.requestType === 'jsonp' // jsonp is deprecated, it's the default value from old keen's client\n ) {\n if (options.catchError) {\n client.config.requestType = 'fetch';\n } else {\n client.config.requestType = 'beaconAPI';\n }\n }\n\n let now = new Date();\n let allTimeOnSiteS = 0;\n let allTimeOnSiteMS = 0;\n if(typeof document !== 'undefined') {\n let hidden;\n let visibilityChange;\n if (typeof document.hidden !== \"undefined\") {\n hidden = \"hidden\";\n visibilityChange = \"visibilitychange\";\n } else if (typeof document.msHidden !== \"undefined\") {\n hidden = \"msHidden\";\n visibilityChange = \"msvisibilitychange\";\n } else if (typeof document.webkitHidden !== \"undefined\") {\n hidden = \"webkitHidden\";\n visibilityChange = \"webkitvisibilitychange\";\n }\n\n const handleVisibilityChange = () => {\n if(document[hidden]) {\n allTimeOnSiteS += getSecondsSinceDate(now);\n allTimeOnSiteMS += getMiliSecondsSinceDate(now);\n return;\n } \n now = new Date();\n }\n if(typeof document.addEventListener !== \"undefined\" ||\n hidden !== undefined){\n document.addEventListener(visibilityChange, handleVisibilityChange, false);\n }\n }\n\n const cookie = new utils.cookie('keen');\n\n const domainName = helpers.getDomainName(window.location.hostname);\n const cookieDomain = domainName && options.shareUuidAcrossDomains ? {\n domain: '.' + domainName\n } : {};\n\n let uuid;\n if (options.collectUuid) {\n uuid = cookie.get('uuid');\n if (!uuid) {\n uuid = helpers.getUniqueId();\n cookie.set('uuid', uuid, cookieDomain);\n }\n }\n\n let initialReferrer = cookie.get('initialReferrer');\n if (!initialReferrer){\n initialReferrer = document && document.referrer || undefined;\n cookie.set('initialReferrer', initialReferrer, cookieDomain);\n }\n\n let scrollState = {};\n if (options.recordScrollState) {\n scrollState = helpers.getScrollState();\n utils.listener('window').on('scroll', () => {\n scrollState = helpers.getScrollState(scrollState);\n });\n }\n\n const addons = [\n {\n name: 'keen:ua_parser',\n input: {\n ua_string: 'user_agent'\n },\n output: 'tech'\n },\n {\n name: 'keen:url_parser',\n input: {\n url: 'url.full'\n },\n output: 'url.info'\n },\n {\n name: 'keen:url_parser',\n input: {\n url: 'referrer.full'\n },\n output: 'referrer.info'\n },\n {\n name: 'keen:date_time_parser',\n input: {\n date_time: 'keen.timestamp'\n },\n output: 'time.utc'\n },\n {\n name: 'keen:date_time_parser',\n input: {\n date_time: 'local_time_full'\n },\n output: 'time.local'\n }\n ];\n\n let ip_address = '${keen.ip}';\n addons.push({\n name: 'keen:ip_to_geo',\n input: {\n ip: 'ip_address',\n remove_ip_property: !options.collectIpAddress\n },\n output : 'geo'\n });\n\n client.extendEvents(function() {\n const browserProfile = helpers.getBrowserProfile();\n return {\n tracked_by: pkg.name + '-' + pkg.version,\n local_time_full: new Date().toISOString(),\n user: {\n uuid\n },\n page: {\n title: document ? document.title : null,\n description: browserProfile.description,\n scroll_state: scrollState,\n time_on_page: allTimeOnSiteS > 0 ? allTimeOnSiteS : getSecondsSinceDate(now),\n time_on_page_ms: allTimeOnSiteMS > 0 ? allTimeOnSiteMS : getMiliSecondsSinceDate(now)\n },\n\n ip_address,\n geo: { /* Enriched */ },\n\n user_agent: '${keen.user_agent}',\n tech: {\n profile: browserProfile\n /* Enriched */\n },\n\n url: {\n full: window ? window.location.href : '',\n info: { /* Enriched */ }\n },\n\n referrer: {\n initial: initialReferrer,\n full: document ? document.referrer : '',\n info: { /* Enriched */ }\n },\n\n time: {\n local: { /* Enriched */ },\n utc: { /* Enriched */ }\n },\n\n keen: {\n timestamp: new Date().toISOString(),\n addons,\n }\n };\n });\n\n if (options.recordClicks === true) {\n utils.listener('a, a *').on('click', function(e) {\n const el = e.target;\n let event = {\n element: helpers.getDomNodeProfile(el),\n local_time_full: new Date().toISOString(),\n };\n\n // pointer position tracking\n if(options.recordClicksPositionPointer === true) {\n const pointer = {\n x_position: e.pageX,\n y_position: e.pageY,\n }\n event = {...event, pointer};\n }\n\n if (options.catchError) {\n return client\n .recordEvent({\n collection: 'clicks',\n event\n }).catch(err => {\n options.catchError(err);\n });\n }\n\n return client\n .recordEvent({\n collection: 'clicks',\n event\n });\n });\n }\n\n if (options.recordFormSubmits === true) {\n utils.listener('form').on('submit', function(e) {\n const el = e.target;\n const serializerOptions = {\n disabled: options.ignoreDisabledFormFields,\n ignoreTypes: options.ignoreFormFieldTypes\n };\n const event = {\n form: {\n action: el.action,\n fields: utils.serializeForm(el, serializerOptions),\n method: el.method\n },\n element: helpers.getDomNodeProfile(el),\n local_time_full: new Date().toISOString()\n };\n\n if (options.catchError) {\n return client\n .recordEvent({\n collection: 'form_submissions',\n event\n })\n .catch(err => {\n options.catchError(err);\n });\n }\n\n return client.recordEvent({\n collection: 'form_submissions',\n event\n });\n });\n }\n\n if (options.recordPageViews === true && !options.recordPageViewsOnExit) {\n if (options.catchError) {\n client\n .recordEvent({\n collection: 'pageviews'\n })\n .catch(err => {\n options.catchError(err);\n });\n } else {\n client\n .recordEvent({\n collection: 'pageviews'\n });\n }\n }\n\n if (options.recordPageViewsOnExit && typeof window !== 'undefined') {\n window.addEventListener('beforeunload', () => {\n client.config.requestType = 'beaconAPI'; // you can run beforeunload only with beaconAPI\n client.recordEvent({\n collection: 'pageviews'\n });\n });\n }\n\n if(options.recordElementViews === true){\n if(typeof IntersectionObserver !== 'undefined'){\n const elementViewsOptions = {\n threshold: 1.0,\n }\n const elementViewsCallback = (events, observer) => {\n events.forEach(el => {\n if(el.isIntersecting){\n const event = {\n element: helpers.getDomNodeProfile(el.target),\n local_time_full: new Date().toISOString()\n }\n if (options.catchError) {\n return client\n .recordEvent({\n collection: 'element_views',\n event\n }).catch(err => {\n options.catchError(err);\n });\n }\n\n return client\n .recordEvent({\n collection: 'element_views',\n event\n });\n }\n })\n }\n const observer = new IntersectionObserver(elementViewsCallback, elementViewsOptions);\n const target = document.querySelectorAll('.track-element-view');\n target.forEach(el => {\n observer.observe(el);\n });\n client.observers.IntersectionObserver = observer;\n }\n }\n\n return client;\n };\n}\n\nfunction getSecondsSinceDate(date) {\n return Math.round(getMiliSecondsSinceDate(date) / 1000);\n}\n\nfunction getMiliSecondsSinceDate(date) {\n return new Date().getTime() - date.getTime();\n}\n","import Keen from './index';\nimport each from 'keen-core/lib/utils/each';\nimport { queue } from './utils/queue';\n\nexport function deferEvent(eventCollection, eventBody){\n\n if (arguments.length !== 2 || typeof eventCollection !== 'string') {\n handleValidationError.call(this, 'Incorrect arguments provided to #deferEvent method');\n return;\n }\n\n this.queue.events[eventCollection] = this.queue.events[eventCollection] || [];\n this.queue.events[eventCollection].push(eventBody);\n this.queue.capacity++;\n if (!this.queue.timer) {\n this.queue.start();\n }\n this.emit('deferEvent', eventCollection, eventBody);\n return this;\n}\n\nexport function deferEvents(eventsHash){\n var self = this;\n\n if (arguments.length !== 1 || typeof eventsHash !== 'object') {\n handleValidationError.call(this, 'Incorrect arguments provided to #deferEvents method');\n return;\n }\n\n each(eventsHash, function(eventList, eventCollection){\n self.queue.events[eventCollection] = self.queue.events[eventCollection] || [];\n self.queue.events[eventCollection] = self.queue.events[eventCollection].concat(eventList);\n self.queue.capacity = self.queue.capacity + eventList.length;\n if (!self.queue.timer) {\n self.queue.start();\n }\n });\n self.emit('deferEvents', eventsHash);\n return self;\n}\n\nexport function queueCapacity(num){\n if (!arguments.length) return this.queue.config.capacity;\n this.queue.config.capacity = num ? Number(num): 0;\n this.queue.check();\n return this;\n}\n\nexport function queueInterval(num){\n if (!arguments.length) return this.queue.config.interval;\n this.queue.config.interval = num ? Number(num): 0;\n this.queue.check();\n return this;\n}\n\nexport function recordDeferredEvents(){\n const self = this;\n\n if (self.queue.capacity > 0) {\n self.queue.pause();\n let clonedQueueConfig = { ...self.queue.config };\n let clonedQueueEvents = { ...self.queue.events };\n self.queue = queue();\n self.queue.config = clonedQueueConfig;\n self.queue.on('flush', function(){\n self.recordDeferredEvents();\n });\n self.emit('recordDeferredEvents', clonedQueueEvents);\n self.recordEvents(clonedQueueEvents, (err, res) => {\n if (err) {\n self.emit('recordDeferredEventsError', err, clonedQueueEvents);\n }\n });\n }\n return self;\n}\n\nfunction handleValidationError(message){\n this.emit('error', `Event(s) not deferred: ${message}`);\n}\n","import 'promise-polyfill/src/polyfill';\nimport 'whatwg-fetch';\n\nimport md5 from './md5';\n\nimport configDefault from '../config-default.js';\n\nif (typeof self === 'undefined') {\n console.log('IndexedDB is available only in Browser ENV');\n}\n\nconst indexedDBAvailable = typeof self !== 'undefined' && 'indexedDB' in self;\n\nlet cachingEnabled = true;\n\nif (!indexedDBAvailable) {\n // console.log(\"Your browser doesn't support a stable version of IndexedDB.\");\n cachingEnabled = false; // graceful degradation\n}\n\nlet db;\nlet cacheConfig = {\n ...configDefault.cache\n};\n\nfunction initializeIndexedDb(requestCacheConfig = {}){\n if (db) { return Promise.resolve(); }\n if (!cachingEnabled) { return Promise.resolve(); }\n cacheConfig = {\n ...cacheConfig,\n ...requestCacheConfig\n };\n return new Promise((resolve, reject) => {\n const dbConnectionRequest = self.indexedDB.open(cacheConfig.dbName);\n dbConnectionRequest.onerror = function(event) {\n cachingEnabled = false;\n resolve();\n };\n\n dbConnectionRequest.onupgradeneeded = function(event) {\n const db = event.target.result;\n const objectStore = db\n .createObjectStore(cacheConfig.dbCollectionName,\n { keyPath: cacheConfig.dbCollectionKey });\n objectStore.createIndex(\n cacheConfig.dbCollectionKey,\n cacheConfig.dbCollectionKey,\n { unique: true }\n );\n objectStore.createIndex('expiryTime', 'expiryTime', { unique: false });\n };\n\n dbConnectionRequest.onsuccess = function(event) {\n db = event.target.result;\n db.onerror = function(event) {\n cachingEnabled = false; // graceful degradation\n };\n resolve(db);\n };\n });\n}\n\nexport const saveToCache = (hash, configOptions = {}) => {\n return initializeIndexedDb(configOptions).then(() => {\n const transactionSave = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName);\n const requestSave = transactionSave.add({\n hash,\n expiryTime: Date.now() + cacheConfig.maxAge\n });\n requestSave.onsuccess = function(event) {\n };\n requestSave.onerror = function(event) {\n cachingEnabled = false;\n };\n });\n}\n\nexport const getFromCache = (hash, configOptions = {}) => {\n return initializeIndexedDb(configOptions).then(() => {\n return new Promise((resolve, reject) => {\n if (!cachingEnabled) {\n return resolve(null);\n }\n\n const transactionCleanUp = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName);\n const indexCleanUp = transactionCleanUp.index('expiryTime');\n const upperBoundOpenKeyRange = IDBKeyRange.upperBound(Date.now(), true);\n indexCleanUp.openCursor(upperBoundOpenKeyRange).onsuccess = function(event) {\n let cursor = event.target.result;\n if (cursor) {\n let transactionDelete = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName)\n .delete(event.target.result.value[cacheConfig.dbCollectionKey]);\n cursor.continue();\n }\n };\n\n const transactionIndex = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName);\n const index = transactionIndex.index(cacheConfig.dbCollectionKey);\n const responseFromCache = index.get(hash);\n responseFromCache.onsuccess = function(event) {\n if (!event.target.result ||\n event.target.result.expiryTime < Date.now()\n ) {\n if (event.target.result && event.target.result.expiryTime < Date.now()){\n const transactionDelete = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName)\n .delete(event.target.result[cacheConfig.dbCollectionKey]);\n transactionDelete.onsuccess = (event) => {\n resolve(getFromCache(hash, configOptions));\n };\n transactionDelete.onerror = (event) => {\n cachingEnabled = false;\n resolve(getFromCache(hash, configOptions));\n };\n return resolve(null);\n }\n return resolve(null);\n } else {\n return resolve(event.target.result);\n }\n };\n responseFromCache.onerror = function(event) {\n cachingEnabled = false;\n resolve(getFromCache(hash, configOptions));\n };\n });\n });\n}\n","import 'promise-polyfill/src/polyfill';\n\nimport md5 from './md5';\nimport { getFromCache, saveToCache } from './cache-browser';\n\nimport configDefault from '../config-default.js';\n\nlet uniqueIds = [];\n\nexport const isUnique = (customCacheConfig, extendedEventBody) => {\n const configCache = { ...configDefault.cache, ...customCacheConfig.cache };\n const stringifiedEvent = JSON.stringify(extendedEventBody);\n const { hashingMethod } = configCache;\n const hash = hashingMethod && hashingMethod.toLowerCase() === 'md5'\n ? md5(stringifiedEvent) : stringifiedEvent;\n const expiryTime = configCache.maxAge ? (Date.now() + configCache.maxAge) : undefined;\n const item = {\n hash,\n expiryTime\n };\n if (expiryTime){\n const now = Date.now();\n uniqueIds = uniqueIds.filter(item => item.expiryTime > now);\n }\n\n const alreadySentEvent = uniqueIds.find(item => item.hash === hash);\n if (alreadySentEvent) {\n if (alreadySentEvent.expiryTime && alreadySentEvent.expiryTime < Date.now()) {\n uniqueIds = uniqueIds.filter(item => item.hash !== hash);\n } else {\n return Promise.resolve(false);\n }\n }\n uniqueIds.push(item);\n if (configCache.storage && configCache.storage.toLowerCase() === 'indexeddb') {\n return getFromCache(hash, configCache).then(alreadySentEvent => {\n if (alreadySentEvent) {\n return false;\n }\n saveToCache(hash, configCache);\n return true;\n });\n }\n\n return Promise.resolve(true);\n}\n\nexport default isUnique;\n","import 'promise-polyfill/src/polyfill';\nimport 'whatwg-fetch';\n\nimport configDefault from '../config-default.js';\n\nexport default function(url, options) {\n const config = {\n ...configDefault,\n ...(options.retry || {})\n };\n\n const retriesLimit = config.retry.limit;\n const retryInitialDelay = config.retry.initialDelay;\n const retryOn = config.retry.retryOnResponseStatuses;\n let retriesCount = 0;\n\n if (retryOn && !(retryOn instanceof Array)) {\n throw {\n name: 'ArgumentError',\n message: 'retryOn property expects an array'\n }\n }\n\n return new Promise(function(resolve, reject) {\n const wrappedFetch = function(n) {\n fetch(url, options)\n .then(function(response) {\n if (retryOn.indexOf(response.status) === -1) {\n resolve(response);\n } else {\n if (n > 0) {\n retry();\n } else {\n reject(response);\n }\n }\n })\n .catch(function(error) {\n if (n > 0) {\n retry();\n } else {\n reject(error);\n }\n });\n };\n\n function retry() {\n retriesCount = retriesCount + 1;\n setTimeout(function() {\n wrappedFetch(retriesLimit - retriesCount);\n }, 2^retriesCount * retryInitialDelay);\n }\n\n wrappedFetch(retriesLimit - retriesCount);\n });\n};\n","module.exports = {\n map: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n encode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, m = this.map, i1, i2, i3, e1, e2, e3, e4;\n n = this.utf8.encode(n);\n while (i < n.length) {\n i1 = n.charCodeAt(i++); i2 = n.charCodeAt(i++); i3 = n.charCodeAt(i++);\n e1 = (i1 >> 2); e2 = (((i1 & 3) << 4) | (i2 >> 4)); e3 = (isNaN(i2) ? 64 : ((i2 & 15) << 2) | (i3 >> 6));\n e4 = (isNaN(i2) || isNaN(i3)) ? 64 : i3 & 63;\n o = o + m.charAt(e1) + m.charAt(e2) + m.charAt(e3) + m.charAt(e4);\n } return o;\n },\n decode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, m = this.map, cc = String.fromCharCode, e1, e2, e3, e4, c1, c2, c3;\n n = n.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n while (i < n.length) {\n e1 = m.indexOf(n.charAt(i++)); e2 = m.indexOf(n.charAt(i++));\n e3 = m.indexOf(n.charAt(i++)); e4 = m.indexOf(n.charAt(i++));\n c1 = (e1 << 2) | (e2 >> 4); c2 = ((e2 & 15) << 4) | (e3 >> 2);\n c3 = ((e3 & 3) << 6) | e4;\n o = o + (cc(c1) + ((e3 != 64) ? cc(c2) : \"\")) + (((e4 != 64) ? cc(c3) : \"\"));\n } return this.utf8.decode(o);\n },\n utf8: {\n encode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, cc = String.fromCharCode, c;\n while (i < n.length) {\n c = n.charCodeAt(i++); o = o + ((c < 128) ? cc(c) : ((c > 127) && (c < 2048)) ?\n (cc((c >> 6) | 192) + cc((c & 63) | 128)) : (cc((c >> 12) | 224) + cc(((c >> 6) & 63) | 128) + cc((c & 63) | 128)));\n } return o;\n },\n decode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, cc = String.fromCharCode, c2, c;\n while (i < n.length) {\n c = n.charCodeAt(i);\n o = o + ((c < 128) ? [cc(c), i++][0] : ((c > 191) && (c < 224)) ?\n [cc(((c & 31) << 6) | ((c2 = n.charCodeAt(i + 1)) & 63)), (i += 2)][0] :\n [cc(((c & 15) << 12) | (((c2 = n.charCodeAt(i + 1)) & 63) << 6) | ((c3 = n.charCodeAt(i + 2)) & 63)), (i += 3)][0]);\n } return o;\n }\n }\n};\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a