New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

analytics

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics - npm Package Compare versions

Comparing version 0.5.5 to 0.6.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.6.0](https://github.com/DavidWells/analytics/compare/analytics@0.5.5...analytics@0.6.0) (2020-11-20)
### Features
* **plugins:** add mixpanel ([d084055](https://github.com/DavidWells/analytics/commit/d084055))
## [0.5.5](https://github.com/DavidWells/analytics/compare/analytics@0.5.4...analytics@0.5.5) (2020-07-17)

@@ -8,0 +19,0 @@

2

dist/analytics.min.js

@@ -1,1 +0,1 @@

var _analytics=function(t){"use strict";var r=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function o(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e};function Y(t,e,n,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:o;return t===o?n:t}function n(t,e,n,r,o,a){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=t+"="+encodeURIComponent(e)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(a?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var u=n,c=n;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==a(n)&&(n=parseFloat(n))}catch(t){n=e}return n}var H="object"===("undefined"==typeof self?"undefined":a(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":a(global))&&global.global===global&&global||void 0,l="localStorage",f="cookie",p="global",i=!1,d=function(){try{n("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return n("_c_","",-1),t}catch(t){return!1}}();function h(t){return"string"==typeof t?t:t.storage}function m(t){return i&&(!t||t===l)}function y(t){return d&&(!t||t===f)}var g={getItem:function(t){if(!t)return null;var e,n=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});if("all"===n)return{cookie:s(u(e=t)),localStorage:s(localStorage.getItem(e)),global:H[e]||null};if(m(n)){var r=localStorage.getItem(t);if(r||n===l)return s(r)}if(y(n)){var o=u(t);if(o||n===f)return s(o)}return H[t]||null},setItem:function(t,e){if(!t||!e)return!1;var n=h(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),r=JSON.stringify(e);if(m(n)){var o=s(localStorage.getItem(t));return localStorage.setItem(t,r),{value:e,oldValue:o,location:l}}if(y(n)){var a=s(u(t));return c(t,r),{value:e,oldValue:a,location:f}}var i=H[t];return{value:H[t]=e,oldValue:i,location:p}},removeItem:function(t){if(!t)return!1;var e=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return m(e)?(localStorage.removeItem(t),l):y(e)?(n(t,"",-1),f):(H[t]=void 0,p)}};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t){return"function"==typeof t}function K(t){return"string"==typeof t}function Q(t){if("object"===v(t)&&null!==t){for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}}function b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var Z="undefined"!=typeof document;function tt(t){var e=function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return Z&&window.location.search.substring(1)}(t);return e?function(t){var e,n=/([^&=]+)=?([^&]*)/g,r={};for(;e=n.exec(t);){var o,a=b(e[1]),i=b(e[2]);"[]"===a.substring(a.length-2)?(a=a.substring(0,a.length-2),(r[a]||(r[a]=[])).push(i)):(o=""===i||i,r[a]=o)}for(var u in r){var c,s=u.split("[");1<s.length&&(c=[],s.forEach(function(t,e){var n=t.replace(/[?[\]\\ ]/g,"");c.push(n)}),function(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var a=e[o];a in t||(t[a]={}),t=t[a]}t[e[r]]=n}(r,c,r[u]),delete r[u])}return r}(e):{}}function et(){for(var t,e,n,r,o=[],a=0;a<256;a++)o[a]=(a<16?"0":"")+a.toString(16);return t=w(),e=w(),n=w(),r=w(),"".concat(o[255&t]+o[t>>8&255]+o[t>>16&255]+o[t>>24&255],"-").concat(o[255&e]).concat(o[e>>8&255],"-").concat(o[e>>16&15|64]).concat(o[e>>24&255],"-").concat(o[63&n|128]).concat(o[n>>8&255],"-").concat(o[n>>16&255]).concat(o[n>>24&255]).concat(o[255&r]).concat(o[r>>8&255]).concat(o[r>>16&255]).concat(o[r>>24&255])}function w(){return 4294967295*Math.random()|0}var S=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var E=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var x=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var nt=function(t){return S(t)||E(t)||x()};function O(t,e){return t(e={exports:{}},e.exports),e.exports}var rt=O(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r});var I=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function k(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var ot=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(n,!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},P="function",_="undefined",j="reducer",A="@@redux/",N=A+"INIT",T=A+Math.random().toString(36),L=function(){return("undefined"==typeof Symbol?"undefined":rt(Symbol))===P&&Symbol.observable||"@@observable"}(),z=" != "+P;function at(t,e,n){if(rt(e)===P&&rt(n)===_&&(n=e,e=void 0),rt(n)!==_){if(rt(n)!==P)throw new Error("enhancer"+z);return n(at)(t,e)}if(rt(t)!==P)throw new Error(j+z);var r=t,o=e,a=[],i=a,u=!1;function c(){i===a&&(i=a.slice())}function s(){return o}function l(e){if(rt(e)!==P)throw new Error("Listener"+z);var n=!0;return c(),i.push(e),function(){var t;n&&(n=!1,c(),t=i.indexOf(e),i.splice(t,1))}}function f(t){if(!Q(t))throw new Error("Act != obj");if(rt(t.type)===_)throw new Error("ActType "+_);if(u)throw new Error("Dispatch in "+j);try{u=!0,o=r(o,t)}finally{u=!1}for(var e=a=i,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),I({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(rt(t)!==P)throw new Error("next "+j+z);r=t,f({type:N})}},L,function(){var n=l;return I({subscribe:function(t){if("object"!==rt(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(o)}return e(),{unsubscribe:n(e)}}},L,function(){return this})})}function it(t){for(var e=Object.keys(t),m={},n=0;n<e.length;n++){var r=e[n];rt(t[r])===P&&(m[r]=t[r])}var y,o,g=Object.keys(m);try{o=m,Object.keys(o).forEach(function(t){var e=o[t],n=e(void 0,{type:N});if(rt(n)===_||rt(e(void 0,{type:T}))===_)throw new Error(j+" "+t+" "+_)})}catch(t){y=t}return function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(y)throw y;for(var o,a,i,u=!1,c={},s=0;s<g.length;s++){var l=g[s],f=m[l],p=n[l],d=f(p,r);if(rt(d)===_){var h=(o=l,i=void 0,"action "+((i=(a=r)&&a.type)&&i.toString()||"?")+j+" "+o+" returns "+_);throw new Error(h)}c[l]=d,u=u||d!==p}return u?c:n}}function ut(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}var ct=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","loadPlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],st=["name","EVENTS","config","loaded"],lt=ct.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var ft="__anon_id",pt="__user_id",dt="__user_traits",M=Object.freeze({ANON_ID:ft,USER_ID:pt,USER_TRAITS:dt}),ht=/^utm_/,mt=/^an_prop_/,yt=/^an_trait_/;var D="analytics",gt="userId",vt="anonymousId",bt="https://lytics.dev/errors/",wt=["enable","disable","load"];function St(t,e){return{userId:e.getItem(pt)||t.an_uid,anonymousId:e.getItem(ft)||t.an_aid||et(),traits:e.getItem(dt)||{}}}var Et=function(t){return"__TEMP__"+t};var xt=O(function(t){var e=function(i){var f,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function u(t,e,n,r){var a,i,u,c,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new k(r||[]);return s._invoke=(a=t,i=n,u=l,c=d,function(t,e){if(c===m)throw new Error("Generator is already running");if(c===y){if("throw"===t)throw e;return _()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=function t(e,n){var r=e.iterator[n.method];if(r===f){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=f,t(e,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=p(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=f),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,u);if(r){if(r===g)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===d)throw c=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=m;var o=p(a,i,u);if("normal"===o.type){if(c=u.done?y:h,o.arg===g)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=y,u.method="throw",u.arg=o.arg)}}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=u;var d="suspendedStart",h="suspendedYield",m="executing",y="completed",g={};function v(){}function a(){}function c(){}var s={};s[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==t&&l.call(w,o)&&(s=w);var S=c.prototype=v.prototype=Object.create(s);function E(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function x(c,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var a=p(c[t],c,n);if("throw"!==a.type){var i=a.arg,u=i.value;return u&&"object"==typeof u&&l.call(u,"__await")?s.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(u).then(function(t){i.value=t,r(i)},function(t){return e("throw",t,r,o)})}o(a.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=f,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:f,done:!0}}return(a.prototype=S.constructor=c).constructor=a,c[r]=a.displayName="GeneratorFunction",i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(S),t},i.awrap=function(t){return{__await:t}},E(x.prototype),x.prototype[n]=function(){return this},i.AsyncIterator=x,i.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var a=new x(u(t,e,n,r),o);return i.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(S),S[r]="Generator",S[o]=function(){return this},S.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=P,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=f),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],a=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var i=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(i&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(i){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r,o=n.completion;return"throw"===o.type&&(r=o.arg,I(n)),r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=f),g}},i}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function q(t,e,n,r,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var Ot=function(u){return function(){var t=this,i=arguments;return new Promise(function(e,n){var r=u.apply(t,i);function o(t){q(r,e,n,o,a,"next",t)}function a(t){q(r,e,n,o,a,"throw",t)}o(void 0)})}};function It(o,a,i){return new Promise(function(e,n){return a()?e(o):i<1?n(ot(ot({},o),{},{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)}).then(function(t){return It(o,a,i-10).then(e,n)}));var r})}function kt(u,t,c){var n,e,s=t(),r=u.getState(),l=r.plugins,o=r.context,f=r.queue,p=r.user;!o.offline&&f&&f.actions&&f.actions.length&&((n=f.actions.reduce(function(t,e,n){return l[e.plugin].loaded?(t.process.push(e),t.processIndex.push(n)):(t.requeue.push(e),t.requeueIndex.push(n)),t},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(t){var e,n,r=f.actions[t],o=r.plugin,a=r.payload.type,i=s[o][a];i&&W(i)&&(i({payload:e=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[gt,vt].reduce(function(t,e){return function(t,e,n){if(t.hasOwnProperty(n)&&!t[n]&&e[n])return Object.assign({},t,I({},"".concat(n),e[n]));return t}(t,n,e)},t)}(r.payload,p),config:l[o].config,instance:c}),n="".concat(a,":").concat(o),u.dispatch(ot(ot({},e),{},{type:n,_:{called:n,from:"queueDrain"}})))}),e=f.actions.filter(function(t,e){return!~n.processIndex.indexOf(e)}),f.actions=e))}var R=function(t){if(Array.isArray(t))return t};var V=function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw a}}return n};var C=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var F=function(t,e){return R(t)||V(t,e)||C()};var G=/Start$/,U=/^bootstrap/,$=/^ready/;function Pt(){return B.apply(this,arguments)}function B(){return(B=Ot(xt.mark(function t(e,n,r,o,a){var i,u,c,s,l,f,p,d,h,m,y,g;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=W(n)?n():n,u=e.type,c=u.replace(G,""),e._&&e._.called)return t.abrupt("return",e);t.next=5;break;case 5:return s=r.getState(),l=function(e,t,n){var r=1<arguments.length&&void 0!==t?t:{},o=2<arguments.length&&void 0!==n?n:{};return Object.keys(e).filter(function(t){var e=o.plugins||{};return!1!==e[t]&&(!0===e[t]||!1!==e.all&&(!r[t]||!1!==r[t].enabled))}).map(function(t){return e[t]})}(i,s.plugins,e.options),f=l.map(function(t){return t.name}),p=function(c,s){var t=Nt(c).map(function(t){return At(t,s)});return s.reduce(function(t,e){var n=e.name,r=Nt(c,n).map(function(t){return At(t,s)}),o=F(r,3),a=o[0],i=o[1],u=o[2];return a.length&&(t.beforeNS[n]=a),i.length&&(t.duringNS[n]=i),u.length&&(t.afterNS[n]=u),t},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}})}(u,l),t.next=11,J({action:e,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});case 11:if(Lt(d=t.sent,f.length))return t.abrupt("return",d);t.next=14;break;case 14:if(u!==c){t.next=18;break}h=d,t.next=21;break;case 18:return t.next=20,J({action:ot(ot({},d),{},{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});case 20:h=t.sent;case 21:if(u.match(G))return m="".concat(c,"End"),t.next=25,J({action:ot(ot({},h),{},{type:m}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});t.next=28;break;case 25:y=t.sent,(g=function(r){return!!r.meta&&Object.keys(r.meta).reduce(function(t,e){var n=r.meta[e];return W(n)?n:t},!1)}(y))&&g({payload:y});case 28:return t.abrupt("return",d);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function J(){return X.apply(this,arguments)}function X(){return(X=Ot(xt.mark(function t(e){var y,i,g,n,v,r,b,o,w,a,S,E,u,x,O,I,c,s;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y=e.data,i=e.action,g=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,a=n.context,S=i.type,E=S.match(G),u=y.exact.map(function(t){return t.pluginName}),E&&(u=r.during.map(function(t){return t.pluginName})),x=function(m,y){return function(t,e,n){var r=e.config,o=e.name,a="".concat(o,".").concat(t.type);n&&(a=n.event);var i,u,c,s,l,f,p,d,h=t.type.match(G)?(c=o,s=a,l=y,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&zt(e)?e:l;if(f&&(!(r=e&&zt(e)?e:[c]).includes(c)||1!==r.length))throw new Error("Method ".concat(s," can only abort ").concat(c," plugin. ").concat(JSON.stringify(r)," input valid"));return ot(ot({},p),{},{abort:{reason:t,plugins:r,caller:s,_:n}})}):(i=t,u=a,function(){throw new Error(i.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(Q(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:m,config:r||{},abort:h}}}(g,u),O=y.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,o=!1;return r.match(/^initialize/)||r.match(/^reset/)||(o=!w[n].loaded),a.offline&&r.match(/^(page|track|identify)/)&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,y.exact.reduce(function(){var r=Ot(xt.mark(function t(e,n,r){var c,o,a;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(o=t.sent,y.namespaced&&y.namespaced[c])return t.next=7,y.namespaced[c].reduce(function(){var r=Ot(xt.mark(function t(e,n,r){var o,a,i,u;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=function(r,o,a){return function(t,e){var n=a||o;return ot(ot({},r),{},{abort:{reason:t,plugins:e||[o],caller:S,from:n}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&W(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return function(t,e){var n=Dt(t);if(n&&n.name===e){var r=Dt(n.method),o=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call themselves","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:g,abort:a(o,c,n.pluginName),config:jt(n.pluginName,w,v),plugins:w});case 9:return i=t.sent,u=Q(i)?i:{},t.abrupt("return",Promise.resolve(ot(ot({},o),u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(i));t.next=11;break;case 7:a=t.sent,o[c]=a,t.next=12;break;case 11:o[c]=i;case 12:return t.abrupt("return",Promise.resolve(o));case 13:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve({}));case 10:return I=t.sent,t.next=13,y.exact.reduce(function(){var r=Ot(xt.mark(function t(e,n,r){var o,a,i,u,c,s,l,f,p,d,h,m;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=y.exact.length===r+1,a=n.pluginName,i=v[a],t.next=5,e;case 5:if(u=t.sent,c=I[a]?I[a]:{},E&&(c=u),Tt(c,a))return _t({data:c,method:S,instance:g,pluginName:a,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(Tt(u,a))return o&&_t({data:u,method:S,instance:g,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(O.hasOwnProperty(a)&&!0===O[a])return b.dispatch({type:"queue",plugin:a,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=x(I[a],v[a]),t.next=20,i[S]({hello:a,abort:s.abort,payload:c,instance:g,config:jt(a,w,v),plugins:w});case 20:return l=t.sent,f=Q(l)?l:{},p=ot(ot({},u),f),Tt(d=I[a],a)?_t({data:d,method:S,instance:g,pluginName:a,store:b}):(h="".concat(S,":").concat(a),(h.match(/:/g)||[]).length<2&&!S.match(U)&&!S.match($)&&(m=E?p:c,g.dispatch(ot(ot({},m),{},{type:h,_:{called:h,from:"submethod"}})))),t.abrupt("return",Promise.resolve(p));case 26:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(i));case 13:if(c=t.sent,S.match(G)||S.match(/^registerPlugin/)||S.match($)||S.match(U)||S.match(/^params/)||S.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(S),c._&&c._.originalAction===S)return t.abrupt("return",c);t.next=18;break;case 18:s=ot(ot({},c),{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Lt(c,y.exact.length)&&!S.match(/End$/)&&(s=ot(ot({},s),{type:c.type+"Aborted"})),b.dispatch(s);case 21:return t.abrupt("return",c);case 22:case"end":return t.stop()}},t)}))).apply(this,arguments)}function _t(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=n+"Aborted"+(r?":"+r:"");t.store.dispatch(ot(ot({},e),{},{type:o,_:{called:o,from:"abort"}}))}function jt(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function At(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Nt(t,e){var n=t.replace(G,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function Tt(t,e){var n=t.abort;return n&&(!0===n||(Mt(n,e)||n&&Mt(n.plugins,e)))}function Lt(t,e){var n=t.abort;if(n){if(!0===n||K(n))return 1;var r=n.plugins;return zt(n)&&n.length===e||zt(r)&&r.length===e}}function zt(t){return Array.isArray(t)}function Mt(t,e){return!(!t||!zt(t))&&t.includes(e)}function Dt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function qt(){return(new Date).getTime()}var Rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Vt=function t(){var i=this;Rt(this,t),I(this,"before",[]),I(this,"after",[]),I(this,"addMiddleware",function(t,e){i[e]=i[e].concat(t)}),I(this,"removeMiddleware",function(e,t){var n=i[t].findIndex(function(t){return t===e});-1!==n&&(i[t]=[].concat(nt(i[t].slice(0,n)),nt(i[t].slice(n+1))))}),I(this,"dynamicMiddlewares",function(a){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=i[a].map(function(t){return t(e)});return ut.apply(void 0,nt(n))(r)(t)}}}})},Ct={};var Ft,Gt=function(t,e){return{type:lt.enablePlugin,name:t,callback:e,_:{originalAction:lt.enablePlugin}}},Ut=function(t,e){return{type:lt.disablePlugin,name:t,callback:e,_:{originalAction:lt.disablePlugin}}};var $t={initialized:!(Ft={}),sessionId:et(),app:null,version:null,debug:!1,offline:!!Z&&!navigator.onLine,os:{name:"na"},userAgent:Z?navigator.userAgent:"node",library:{name:D,version:"0.6.1"},timezone:void 0,locale:void 0,campaign:{},referrer:Ft};function Bt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:$t,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case lt.campaign:return ot(ot({},t),{campaign:o});case lt.offline:return ot(ot({},t),{offline:!0});case lt.online:return ot(ot({},t),{offline:!1});default:return n?t:ot(ot(ot({},$t),t),{initialized:!0})}}var Jt=["plugins","reducers","storage"];function Xt(t){var e=t;try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e}var Yt=/#.*$/;function Ht(t){var e=function(){if(Z)for(var t,e=document.getElementsByTagName("link"),n=0;t=e[n];n++)if("canonical"===t.getAttribute("rel"))return t.getAttribute("href")}();return e?e.match(/\?/)?e:e+t:window.location.href.replace(Yt,"")}var Wt=function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!Z)return e;var n,r=document,o=r.title,a=r.referrer,i=window,u=i.location,c=i.innerWidth,s=i.innerHeight,l=u.hash,f=u.search,p=Ht(f),d={title:o,url:p,path:"/"+((n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(p))&&n[3]?n[3].split("?")[0].replace(Yt,""):""),hash:l,search:f,width:c,height:s};return a&&""!==a&&(d.referrer=a),ot(ot({},d),e)},Kt={last:{},history:[]};function Qt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Kt,e=1<arguments.length?arguments[1]:void 0,n=e.properties,r=e.options,o=e.meta;switch(e.type){case lt.page:var a=Xt(ot({properties:n,meta:o},Object.keys(r).length&&{options:r}));return ot(ot({},t),{last:a,history:t.history.concat(a)});default:return t}}var Zt={last:{},history:[]};function te(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Zt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.meta,o=e.options,a=e.event,i=e.properties;switch(n){case lt.track:var u=Xt(ot(ot({event:a,properties:i},Object.keys(o).length&&{options:o}),{},{meta:r}));return ot(ot({},t),{last:u,history:t.history.concat(u)});default:return t}}var ee={actions:[]};function ne(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:ee,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload;switch(n){case"queue":var o=r&&r.type&&r.type===lt.identify?[e].concat(t.actions):t.actions.concat(e);return ot(ot({},t),{},{actions:o});case"dequeue":return[];default:return t}}function re(){return Array.prototype.slice.call(arguments).reduce(function(t,e){return t||(W(e)?e:t)},!1)}function oe(){var i="__"+D+"__";return H[i]=[],function(a){return function(t,e,n){var r=a(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return H[i].push(e),o(t)}})}}}function ae(){return function(){return ut(ut.apply(null,arguments),oe())}}var ie=function(t,e,n){return{type:lt.setItemStart,timestamp:qt(),key:t,value:e,options:n}},ue=function(t,e){return{type:lt.removeItemStart,timestamp:qt(),key:t,options:e}};function ce(t){function e(){return k}function u(){throw new Error("Abort disabled in listener")}function l(e,n){return function(t){n&&n(t),e(t)}}var a,n,s,f,p,d,r,h,m,i,b,w,S,E,y,o,c,g=0<arguments.length&&void 0!==t?t:{},v=g.reducers||{},x=(g.plugins||[]).reduce(function(t,n){if(W(n))return t.middlewares=t.middlewares.concat(n),t;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error(bt+"1");var e=n.EVENTS?Object.keys(n.EVENTS).map(function(t){return n.EVENTS[t]}):[];if(n.methods){if(wt.includes(n.name))throw new Error(n.name+" is reserved pluginName");t.methods[n.name]=Object.keys(n.methods).reduce(function(t,e){var r;return t[e]=(r=n.methods[e],function(){var n=Array.prototype.slice.call(arguments),t=Array.apply(null,Array(r.length)).map(function(){}).map(function(t,e){if(n[e]||!1===n[e]||null===n[e])return n[e]}).concat(R);return r.apply({instance:R},t)}),t},{}),delete n.methods}var r=Object.keys(n).concat(e),o=new Set(t.events.concat(r));if(t.events=Array.from(o),t.pluginsArray=t.pluginsArray.concat(n),t.plugins[n.name])throw new Error(n.name+" already loaded");return t.plugins[n.name]=n,t.plugins[n.name].loaded||(t.plugins[n.name].loaded=function(){return!0}),t},{plugins:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),O=g.storage?g.storage:{getItem:function(t){return H[t]},setItem:function(t,e){return H[t]=e},removeItem:function(t){return H[t]=void 0}},I=(a=O,function(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&Q(n)&&n[t])return n[t];var o=St({},a)[t];return o||(H[Et(t)]?H[Et(t)]:null)}),k=x.plugins,P=x.events.filter(function(t){return!st.includes(t)}),_=new Set(P.concat(ct).filter(function(t){return!st.includes(t)})),j=Array.from(_).sort(),A=P.sort(),N=new Vt,T=N.addMiddleware,L=N.removeMiddleware,z=N.dynamicMiddlewares,M=tt(),D=St(M,O),q=ot({enable:function(t,e){J.dispatch(Gt(t,e))},disable:function(t,e){J.dispatch(Ut(t,e))},load:function(t){J.dispatch({type:lt.loadPlugin,plugins:t?[t]:Object.keys(e())})}},x.methods),R={identify:function(t,n,r,o){var a=K(t)?t:null,i=Q(t)?t:n,u=r||{},c=R.user(),s=(H[Et(gt)]=a)||i.userId||I(gt,R,i);return new Promise(function(t,e){J.dispatch(ot(ot({type:lt.identifyStart,userId:s,traits:i||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==a&&{previousId:c.id}),{},{meta:{timestamp:qt(),callback:l(t,re(n,r,o))}}))})},track:function(t,n,r,o){var a=Q(t)?t.event:t;if(!a||!K(a))throw new Error("Event missing");var i=Q(t)?t:n||{},u=Q(r)?r:{};return new Promise(function(t,e){J.dispatch({type:lt.trackStart,event:a,properties:i,options:u,userId:I(gt,R,n),anonymousId:I(vt,R,n),meta:{timestamp:qt(),callback:l(t,re(n,r,o))}})})},page:function(n,r,o){var a=Q(n)?n:{},i=Q(r)?r:{};return new Promise(function(t,e){J.dispatch({type:lt.pageStart,properties:Wt(a),options:i,userId:I(gt,R,a),anonymousId:I(vt,R,a),meta:{timestamp:qt(),callback:l(t,re(n,r,o))}})})},user:function(t){if(t===gt||"id"===t)return I(gt,R);var e=R.getState("user");return t?Y(e,t):e},reset:function(n){return new Promise(function(t,e){J.dispatch({type:lt.resetStart,timestamp:qt(),callback:l(t,n)})})},ready:function(t){return R.on(lt.ready,t)},on:function(n,r){if(!n||!W(r))return!1;if(n===lt.bootstrap)throw new Error(".on disabled for "+n);var o=/Start$|Start:/;if("*"===n){var t=function(){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:R,plugins:k}),e(t)}}},e=function(){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:R,plugins:k}),e(t)}}};return T(t,se),T(e,le),function(){L(t,se),L(e,le)}}function a(){return function(e){return function(t){return t.type===n&&r({payload:t,instance:R,plugins:k,abort:u}),e(t)}}}var i=n.match(o)?se:le;return T(a,i),function(){return L(a,i)}},once:function(t,n){if(!t||!W(n))return!1;if(t===lt.bootstrap)throw new Error(".once disabled for "+t);var r=R.on(t,function(t){var e=t.payload;n({payload:e,instance:R,plugins:k,abort:u}),r()});return r},getState:function(t){var e=J.getState();return t?Y(e,t):Object.assign({},e)},dispatch:function(t){var e,n=K(t)?{type:t}:t;if(e=n.type,ct.includes(e))throw new Error("reserved action "+n.type);var r=n.meta||{},o=t._||{},a=ot(ot({},n),{},{meta:ot({timestamp:qt()},r),_:ot({originalAction:n.type},o)});J.dispatch(a)},enablePlugin:q.enable,disablePlugin:q.disable,loadPlugin:q.load,plugins:q,storage:{getItem:O.getItem,setItem:function(t,e,n){J.dispatch(ie(t,e,n))},removeItem:function(t,e){J.dispatch(ue(t,e))}},setAnonymousId:function(t,e){R.storage.setItem(ft,t,e)},events:{all:j,core:ct,plugins:A}},V=x.middlewares.concat([z(se),(w=e,S={all:j,plugins:A},E={},function(v){return function(g){return function(){var e=Ot(xt.mark(function t(e){var n,r,o,a,i,u,c,s,l,f,p,d,h,m,y;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.type,r=e.name,o=e.callback,(a=e).abort)return t.abrupt("return",g(e));t.next=4;break;case 4:if(n!==lt.disablePlugin&&n!==lt.enablePlugin||W(o)&&o(r),n===lt.loadPlugin)return i=w(),u=Object.keys(i).filter(function(t){return e.plugins.includes(t)}).reduce(function(t,e){return t[e]=i[e],t},{}),c={type:lt.initializeStart,plugins:e.plugins},t.next=11,Pt(c,u,b,v,S);t.next=13;break;case 11:return s=t.sent,t.abrupt("return",g(s));case 13:if(n===lt.initializeEnd&&(l=w(),f=Object.keys(l),p=f.filter(function(t){return e.plugins.includes(t)}).map(function(t){return l[t]}),d=[],h=[],m=p.map(function(e){var t=e.loaded,n=e.name;return It(e,t,1e4).then(function(t){E[n]||(v.dispatch({type:lt.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!st.includes(t)})}),E[n]=!0),d=d.concat(n)}).catch(function(t){if(t instanceof Error)throw new Error(t);return h=h.concat(t.name),t})}),Promise.all(m).then(function(t){setTimeout(function(){f.length===m.length&&v.dispatch({type:lt.ready,plugins:d,failed:h})},0)})),n!==lt.bootstrap)return/^ready:([^:]*)$/.test(n)&&setTimeout(function(){return kt(v,w,b)},0),t.next=18,Pt(e,w,b,v,S);t.next=20;break;case 18:return y=t.sent,t.abrupt("return",g(y));case 20:return t.abrupt("return",g(a));case 21:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()}}),(i=O,function(t){return function(a){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===lt.setItem||e===lt.removeItem){if(t.abort)return a(t);e===lt.setItem?i.setItem(n,r,o):i.removeItem(n,o)}return a(t)}}}),(r=(d=b=R).storage,h=r.setItem,m=r.getItem,function(c){return function(u){return function(t){var o,e,n,r,a,i;return t.type===lt.bootstrap&&(o=t.params,e=t.user,m(ft)||h(ft,e.anonymousId),(n=Object.keys(t.params)).length&&(r=o.an_uid,a=o.an_event,i=n.reduce(function(t,e){var n,r;return(e.match(ht)||e.match(/^(d|g)clid/))&&(r="campaign"===(n=e.replace(ht,""))?"name":n,t.campaign[r]=o[e]),e.match(mt)&&(t.props[e.replace(mt,"")]=o[e]),e.match(yt)&&(t.traits[e.replace(yt,"")]=o[e]),t},{campaign:{},props:{},traits:{}}),c.dispatch(ot(ot({type:lt.params,raw:o},i),r?{userId:r}:{})),r&&setTimeout(function(){return d.identify(r,i.traits)},0),a&&setTimeout(function(){return d.track(a,i.props)},0),Object.keys(i.campaign).length&&c.dispatch({type:lt.campaign,campaign:i.campaign}))),u(t)}}}),(n=R.storage,s=n.setItem,f=n.removeItem,p=n.getItem,function(c){return function(u){return function(t){var e,n,r=t.userId,o=t.traits,a=t.options,i=t.callback;return t.type===lt.reset&&([pt,dt,ft].forEach(function(t){return f(t)}),[gt,vt,"traits"].forEach(function(t){H[Et(t)]=void 0}),W(i)&&i()),t.type===lt.identify&&(p(ft)||s(ft,et()),e=p(pt),n=p(dt)||{},e&&e!==r&&c.dispatch({type:lt.userIdChanged,old:{userId:e,traits:n},new:{userId:r,traits:o},options:a}),r&&s(pt,r),o&&s(dt,ot(ot({},n),o))),u(t)}}}),z(le)]),C={context:Bt,user:(o=O,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(r&&r.type===lt.setItemEnd&&r.key===ft)return Object.assign({},n,{anonymousId:r.value});switch(r.type){case lt.identify:return Object.assign({},n,{userId:r.userId,traits:ot(ot({},n.traits),r.traits)});case lt.reset:return[gt,vt,"traits"].forEach(function(t){H[Et(t)]=null}),[pt,ft,dt].forEach(function(t){o.removeItem(t)}),Object.assign({},n,{userId:null,anonymousId:null,traits:{}});default:return n}}),page:Qt,track:te,plugins:(y=e,function(t,e){var n=0<arguments.length&&void 0!==t?t:Ct,r=1<arguments.length?e:void 0,o={};if("initialize:aborted"===r.type)return n;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=r.type.split(":")[1],i=y()[a];return i&&a?(o[a]={enabled:!0,initialized:!i.initialize,loaded:Boolean(i.loaded()),config:i.config||{}},ot(ot({},n),o)):n}if(/^initialize:([^:]*)$/.test(r.type)){var u=r.type.split(":")[1],c=y()[u];return c&&u?(o[u]=ot(ot({},n[u]),{initialized:!0,loaded:Boolean(c.loaded())}),ot(ot({},n),o)):n}if(/^ready:([^:]*)$/.test(r.type))return o[r.name]=ot(ot({},n[r.name]),{loaded:!0}),ot(ot({},n),o);switch(r.type){case lt.disablePlugin:return Array.isArray(r.name)?o=r.name.reduce(function(t,e){return t[e]=ot(ot({},n[e]),{enabled:!1}),t},n):o[r.name]=ot(ot({},n[r.name]),{enabled:!1}),ot(ot({},n),o);case lt.enablePlugin:return Array.isArray(r.name)?o=r.name.reduce(function(t,e){return t[e]=ot(ot({},n[e]),{enabled:!0}),t},n):o[r.name]=ot(ot({},n[r.name]),{enabled:!0}),ot(ot({},n),o);default:return n}}),queue:ne},F=ut,G=ut;Z&&g.debug&&((c=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(F=c({trace:!0,traceLimit:25})),G=function(t){return 0===arguments.length?oe():Q(rt(t))?ae():ae().apply(null,arguments)});var U,$=(U=g,Object.keys(U).reduce(function(t,e){return Jt.includes(e)||(t[e]=U[e]),t},{})),B={context:$,user:D,plugins:x.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded;return t[n]={enabled:!0,initialized:Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},J=at(it(ot(ot({},C),v)),B,G(F(function(){for(var t=arguments.length,c=new Array(t),e=0;e<t;e++)c[e]=arguments[e];return function(u){return function(t,e,n){var r=u(t,e,n),o=r.dispatch,a={getState:r.getState,dispatch:function(t){return o(t)}},i=c.map(function(t){return t(a)}),o=ut.apply(void 0,nt(i))(r.dispatch);return ot(ot({},r),{},{dispatch:o})}}}.apply(void 0,nt(V))))),X=Object.keys(k);return J.dispatch({type:lt.bootstrap,plugins:X,config:$,params:M,user:D}),J.dispatch({type:lt.registerPlugins,plugins:X}),x.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config;n&&W(n)&&n({instance:R,config:r,payload:t});var o=x.pluginsArray.length===e+1;J.dispatch({type:lt.registerPluginType(t.name),name:t.name,plugin:t}),o&&J.dispatch({type:lt.initializeStart,plugins:X})}),R}var se="before",le="after";function fe(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return ce(e(e({},{storage:g}),t))}return t.default=fe,t.init=fe,t.Analytics=fe,t.EVENTS=lt,t.CONSTANTS=M,t}({});
var _analytics=function(t){"use strict";var r=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function o(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e};function Y(t,e,n,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:o;return t===o?n:t}function n(t,e,n,r,o,a){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=t+"="+encodeURIComponent(e)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(a?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var u=n,c=n;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==a(n)&&(n=parseFloat(n))}catch(t){n=e}return n}var H="object"===("undefined"==typeof self?"undefined":a(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":a(global))&&global.global===global&&global||void 0,l="localStorage",f="cookie",p="global",i=!1,d=function(){try{n("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return n("_c_","",-1),t}catch(t){return!1}}();function h(t){return"string"==typeof t?t:t.storage}function y(t){return i&&(!t||t===l)}function m(t){return d&&(!t||t===f)}var g={getItem:function(t){if(!t)return null;var e,n=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});if("all"===n)return{cookie:s(u(e=t)),localStorage:s(localStorage.getItem(e)),global:H[e]||null};if(y(n)){var r=localStorage.getItem(t);if(r||n===l)return s(r)}if(m(n)){var o=u(t);if(o||n===f)return s(o)}return H[t]||null},setItem:function(t,e){if(!t||!e)return!1;var n=h(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),r=JSON.stringify(e);if(y(n)){var o=s(localStorage.getItem(t));return localStorage.setItem(t,r),{value:e,oldValue:o,location:l}}if(m(n)){var a=s(u(t));return c(t,r),{value:e,oldValue:a,location:f}}var i=H[t];return{value:H[t]=e,oldValue:i,location:p}},removeItem:function(t){if(!t)return!1;var e=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return y(e)?(localStorage.removeItem(t),l):m(e)?(n(t,"",-1),f):(H[t]=void 0,p)}};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t){return"function"==typeof t}function K(t){return"string"==typeof t}function Q(t){if("object"===v(t)&&null!==t){for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}}function b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var Z="undefined"!=typeof document;function tt(t){var e=function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return Z&&window.location.search.substring(1)}(t);return e?function(t){var e,n=/([^&=]+)=?([^&]*)/g,r={};for(;e=n.exec(t);){var o,a=b(e[1]),i=b(e[2]);"[]"===a.substring(a.length-2)?(a=a.substring(0,a.length-2),(r[a]||(r[a]=[])).push(i)):(o=""===i||i,r[a]=o)}for(var u in r){var c,s=u.split("[");1<s.length&&(c=[],s.forEach(function(t,e){var n=t.replace(/[?[\]\\ ]/g,"");c.push(n)}),function(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var a=e[o];a in t||(t[a]={}),t=t[a]}t[e[r]]=n}(r,c,r[u]),delete r[u])}return r}(e):{}}function et(){for(var t,e,n,r,o=[],a=0;a<256;a++)o[a]=(a<16?"0":"")+a.toString(16);return t=w(),e=w(),n=w(),r=w(),"".concat(o[255&t]+o[t>>8&255]+o[t>>16&255]+o[t>>24&255],"-").concat(o[255&e]).concat(o[e>>8&255],"-").concat(o[e>>16&15|64]).concat(o[e>>24&255],"-").concat(o[63&n|128]).concat(o[n>>8&255],"-").concat(o[n>>16&255]).concat(o[n>>24&255]).concat(o[255&r]).concat(o[r>>8&255]).concat(o[r>>16&255]).concat(o[r>>24&255])}function w(){return 4294967295*Math.random()|0}var S=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var E=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var x=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var nt=function(t){return S(t)||E(t)||x()};function O(t,e){return t(e={exports:{}},e.exports),e.exports}var rt=O(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r});var I=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function k(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var ot=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(n,!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},P="function",j="undefined",_="reducer",A="@@redux/",N=A+"INIT",T=A+Math.random().toString(36),L=function(){return("undefined"==typeof Symbol?"undefined":rt(Symbol))===P&&Symbol.observable||"@@observable"}(),z=" != "+P;function at(t,e,n){if(rt(e)===P&&rt(n)===j&&(n=e,e=void 0),rt(n)!==j){if(rt(n)!==P)throw new Error("enhancer"+z);return n(at)(t,e)}if(rt(t)!==P)throw new Error(_+z);var r=t,o=e,a=[],i=a,u=!1;function c(){i===a&&(i=a.slice())}function s(){return o}function l(e){if(rt(e)!==P)throw new Error("Listener"+z);var n=!0;return c(),i.push(e),function(){var t;n&&(n=!1,c(),t=i.indexOf(e),i.splice(t,1))}}function f(t){if(!Q(t))throw new Error("Act != obj");if(rt(t.type)===j)throw new Error("ActType "+j);if(u)throw new Error("Dispatch in "+_);try{u=!0,o=r(o,t)}finally{u=!1}for(var e=a=i,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),I({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(rt(t)!==P)throw new Error("next "+_+z);r=t,f({type:N})}},L,function(){var n=l;return I({subscribe:function(t){if("object"!==rt(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(o)}return e(),{unsubscribe:n(e)}}},L,function(){return this})})}function it(t){for(var e=Object.keys(t),y={},n=0;n<e.length;n++){var r=e[n];rt(t[r])===P&&(y[r]=t[r])}var m,o,g=Object.keys(y);try{o=y,Object.keys(o).forEach(function(t){var e=o[t],n=e(void 0,{type:N});if(rt(n)===j||rt(e(void 0,{type:T}))===j)throw new Error(_+" "+t+" "+j)})}catch(t){m=t}return function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(m)throw m;for(var o,a,i,u=!1,c={},s=0;s<g.length;s++){var l=g[s],f=y[l],p=n[l],d=f(p,r);if(rt(d)===j){var h=(o=l,i=void 0,"action "+((i=(a=r)&&a.type)&&i.toString()||"?")+_+" "+o+" returns "+j);throw new Error(h)}c[l]=d,u=u||d!==p}return u?c:n}}function ut(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}var ct=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","loadPlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],st=["name","EVENTS","config","loaded"],lt=ct.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var ft="__anon_id",pt="__user_id",dt="__user_traits",M=Object.freeze({ANON_ID:ft,USER_ID:pt,USER_TRAITS:dt}),ht=/^utm_/,yt=/^an_prop_/,mt=/^an_trait_/;var D="analytics",gt="userId",vt="anonymousId",bt="https://lytics.dev/errors/",wt=["enable","disable","load"];function St(t,e){return{userId:e.getItem(pt)||t.an_uid,anonymousId:e.getItem(ft)||t.an_aid||et(),traits:e.getItem(dt)||{}}}var Et=function(t){return"__TEMP__"+t};var xt=O(function(t){var e=function(i){var f,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var a,i,u,c,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new P(r||[]);return s._invoke=(a=t,i=n,u=l,c=d,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===m){if("throw"===t)throw e;return _()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=function t(e,n){var r=e.iterator[n.method];if(r===f){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=f,t(e,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=p(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=f),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,u);if(r){if(r===g)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===d)throw c=m,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=y;var o=p(a,i,u);if("normal"===o.type){if(c=u.done?m:h,o.arg===g)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=m,u.method="throw",u.arg=o.arg)}}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=u;var d="suspendedStart",h="suspendedYield",y="executing",m="completed",g={};function v(){}function c(){}function s(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,S=w&&w(w(j([])));S&&S!==t&&l.call(S,o)&&(b=S);var E=s.prototype=v.prototype=Object.create(b);function x(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function O(c,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var a=p(c[t],c,n);if("throw"!==a.type){var i=a.arg,u=i.value;return u&&"object"==typeof u&&l.call(u,"__await")?s.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(u).then(function(t){i.value=t,r(i)},function(t){return e("throw",t,r,o)})}o(a.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=f,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:f,done:!0}}return((c.prototype=E.constructor=s).constructor=c).displayName=a(s,r,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,a(t,r,"GeneratorFunction")),t.prototype=Object.create(E),t},i.awrap=function(t){return{__await:t}},x(O.prototype),O.prototype[n]=function(){return this},i.AsyncIterator=O,i.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var a=new O(u(t,e,n,r),o);return i.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},x(E),a(E,r,"Generator"),E[o]=function(){return this},E.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=f),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],a=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var i=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(i&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(i){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r,o=n.completion;return"throw"===o.type&&(r=o.arg,k(n)),r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=f),g}},i}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function q(t,e,n,r,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var Ot=function(u){return function(){var t=this,i=arguments;return new Promise(function(e,n){var r=u.apply(t,i);function o(t){q(r,e,n,o,a,"next",t)}function a(t){q(r,e,n,o,a,"throw",t)}o(void 0)})}};function It(o,a,i){return new Promise(function(e,n){return a()?e(o):i<1?n(ot(ot({},o),{},{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)}).then(function(t){return It(o,a,i-10).then(e,n)}));var r})}function kt(u,t,c){var n,e,s=t(),r=u.getState(),l=r.plugins,o=r.context,f=r.queue,p=r.user;!o.offline&&f&&f.actions&&f.actions.length&&((n=f.actions.reduce(function(t,e,n){return l[e.plugin].loaded?(t.process.push(e),t.processIndex.push(n)):(t.requeue.push(e),t.requeueIndex.push(n)),t},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(t){var e,n,r=f.actions[t],o=r.plugin,a=r.payload.type,i=s[o][a];i&&W(i)&&(i({payload:e=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[gt,vt].reduce(function(t,e){return function(t,e,n){if(t.hasOwnProperty(n)&&!t[n]&&e[n])return Object.assign({},t,I({},"".concat(n),e[n]));return t}(t,n,e)},t)}(r.payload,p),config:l[o].config,instance:c}),n="".concat(a,":").concat(o),u.dispatch(ot(ot({},e),{},{type:n,_:{called:n,from:"queueDrain"}})))}),e=f.actions.filter(function(t,e){return!~n.processIndex.indexOf(e)}),f.actions=e))}var R=function(t){if(Array.isArray(t))return t};var V=function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw a}}return n};var C=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var F=function(t,e){return R(t)||V(t,e)||C()};var G=/Start$/,U=/^bootstrap/,$=/^ready/;function Pt(){return B.apply(this,arguments)}function B(){return(B=Ot(xt.mark(function t(e,n,r,o,a){var i,u,c,s,l,f,p,d,h,y,m,g;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=W(n)?n():n,u=e.type,c=u.replace(G,""),e._&&e._.called)return t.abrupt("return",e);t.next=5;break;case 5:return s=r.getState(),l=function(e,t,n){var r=1<arguments.length&&void 0!==t?t:{},o=2<arguments.length&&void 0!==n?n:{};return Object.keys(e).filter(function(t){var e=o.plugins||{};return!1!==e[t]&&(!0===e[t]||!1!==e.all&&(!r[t]||!1!==r[t].enabled))}).map(function(t){return e[t]})}(i,s.plugins,e.options),f=l.map(function(t){return t.name}),p=function(c,s){var t=Nt(c).map(function(t){return At(t,s)});return s.reduce(function(t,e){var n=e.name,r=Nt(c,n).map(function(t){return At(t,s)}),o=F(r,3),a=o[0],i=o[1],u=o[2];return a.length&&(t.beforeNS[n]=a),i.length&&(t.duringNS[n]=i),u.length&&(t.afterNS[n]=u),t},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}})}(u,l),t.next=11,J({action:e,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});case 11:if(Lt(d=t.sent,f.length))return t.abrupt("return",d);t.next=14;break;case 14:if(u!==c){t.next=18;break}h=d,t.next=21;break;case 18:return t.next=20,J({action:ot(ot({},d),{},{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});case 20:h=t.sent;case 21:if(u.match(G))return y="".concat(c,"End"),t.next=25,J({action:ot(ot({},h),{},{type:y}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});t.next=28;break;case 25:m=t.sent,(g=function(r){return!!r.meta&&Object.keys(r.meta).reduce(function(t,e){var n=r.meta[e];return W(n)?n:t},!1)}(m))&&g({payload:m});case 28:return t.abrupt("return",d);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function J(){return X.apply(this,arguments)}function X(){return(X=Ot(xt.mark(function t(e){var m,i,g,n,v,r,b,o,w,a,S,E,u,x,O,I,c,s;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return m=e.data,i=e.action,g=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,a=n.context,S=i.type,E=S.match(G),u=m.exact.map(function(t){return t.pluginName}),E&&(u=r.during.map(function(t){return t.pluginName})),x=function(y,m){return function(t,e,n){var r=e.config,o=e.name,a="".concat(o,".").concat(t.type);n&&(a=n.event);var i,u,c,s,l,f,p,d,h=t.type.match(G)?(c=o,s=a,l=m,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&zt(e)?e:l;if(f&&(!(r=e&&zt(e)?e:[c]).includes(c)||1!==r.length))throw new Error("Method ".concat(s," can only abort ").concat(c," plugin. ").concat(JSON.stringify(r)," input valid"));return ot(ot({},p),{},{abort:{reason:t,plugins:r,caller:s,_:n}})}):(i=t,u=a,function(){throw new Error(i.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(Q(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:y,config:r||{},abort:h}}}(g,u),O=m.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,o=!1;return r.match(/^initialize/)||r.match(/^reset/)||(o=!w[n].loaded),a.offline&&r.match(/^(page|track|identify)/)&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,m.exact.reduce(function(){var r=Ot(xt.mark(function t(e,n,r){var c,o,a;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(o=t.sent,m.namespaced&&m.namespaced[c])return t.next=7,m.namespaced[c].reduce(function(){var r=Ot(xt.mark(function t(e,n,r){var o,a,i,u;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=function(r,o,a){return function(t,e){var n=a||o;return ot(ot({},r),{},{abort:{reason:t,plugins:e||[o],caller:S,from:n}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&W(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return function(t,e){var n=Dt(t);if(n&&n.name===e){var r=Dt(n.method),o=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call themselves","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:g,abort:a(o,c,n.pluginName),config:_t(n.pluginName,w,v),plugins:w});case 9:return i=t.sent,u=Q(i)?i:{},t.abrupt("return",Promise.resolve(ot(ot({},o),u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(i));t.next=11;break;case 7:a=t.sent,o[c]=a,t.next=12;break;case 11:o[c]=i;case 12:return t.abrupt("return",Promise.resolve(o));case 13:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve({}));case 10:return I=t.sent,t.next=13,m.exact.reduce(function(){var r=Ot(xt.mark(function t(e,n,r){var o,a,i,u,c,s,l,f,p,d,h,y;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=m.exact.length===r+1,a=n.pluginName,i=v[a],t.next=5,e;case 5:if(u=t.sent,c=I[a]?I[a]:{},E&&(c=u),Tt(c,a))return jt({data:c,method:S,instance:g,pluginName:a,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(Tt(u,a))return o&&jt({data:u,method:S,instance:g,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(O.hasOwnProperty(a)&&!0===O[a])return b.dispatch({type:"queue",plugin:a,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=x(I[a],v[a]),t.next=20,i[S]({hello:a,abort:s.abort,payload:c,instance:g,config:_t(a,w,v),plugins:w});case 20:return l=t.sent,f=Q(l)?l:{},p=ot(ot({},u),f),Tt(d=I[a],a)?jt({data:d,method:S,instance:g,pluginName:a,store:b}):(h="".concat(S,":").concat(a),(h.match(/:/g)||[]).length<2&&!S.match(U)&&!S.match($)&&(y=E?p:c,g.dispatch(ot(ot({},y),{},{type:h,_:{called:h,from:"submethod"}})))),t.abrupt("return",Promise.resolve(p));case 26:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(i));case 13:if(c=t.sent,S.match(G)||S.match(/^registerPlugin/)||S.match($)||S.match(U)||S.match(/^params/)||S.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(S),c._&&c._.originalAction===S)return t.abrupt("return",c);t.next=18;break;case 18:s=ot(ot({},c),{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Lt(c,m.exact.length)&&!S.match(/End$/)&&(s=ot(ot({},s),{type:c.type+"Aborted"})),b.dispatch(s);case 21:return t.abrupt("return",c);case 22:case"end":return t.stop()}},t)}))).apply(this,arguments)}function jt(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=n+"Aborted"+(r?":"+r:"");t.store.dispatch(ot(ot({},e),{},{type:o,_:{called:o,from:"abort"}}))}function _t(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function At(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Nt(t,e){var n=t.replace(G,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function Tt(t,e){var n=t.abort;return n&&(!0===n||(Mt(n,e)||n&&Mt(n.plugins,e)))}function Lt(t,e){var n=t.abort;if(n){if(!0===n||K(n))return 1;var r=n.plugins;return zt(n)&&n.length===e||zt(r)&&r.length===e}}function zt(t){return Array.isArray(t)}function Mt(t,e){return!(!t||!zt(t))&&t.includes(e)}function Dt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function qt(){return(new Date).getTime()}var Rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Vt=function t(){var i=this;Rt(this,t),I(this,"before",[]),I(this,"after",[]),I(this,"addMiddleware",function(t,e){i[e]=i[e].concat(t)}),I(this,"removeMiddleware",function(e,t){var n=i[t].findIndex(function(t){return t===e});-1!==n&&(i[t]=[].concat(nt(i[t].slice(0,n)),nt(i[t].slice(n+1))))}),I(this,"dynamicMiddlewares",function(a){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=i[a].map(function(t){return t(e)});return ut.apply(void 0,nt(n))(r)(t)}}}})},Ct={};var Ft,Gt=function(t,e){return{type:lt.enablePlugin,name:t,callback:e,_:{originalAction:lt.enablePlugin}}},Ut=function(t,e){return{type:lt.disablePlugin,name:t,callback:e,_:{originalAction:lt.disablePlugin}}};var $t={initialized:!(Ft={}),sessionId:et(),app:null,version:null,debug:!1,offline:!!Z&&!navigator.onLine,os:{name:"na"},userAgent:Z?navigator.userAgent:"node",library:{name:D,version:"0.6.2"},timezone:void 0,locale:void 0,campaign:{},referrer:Ft};function Bt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:$t,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case lt.campaign:return ot(ot({},t),{campaign:o});case lt.offline:return ot(ot({},t),{offline:!0});case lt.online:return ot(ot({},t),{offline:!1});default:return n?t:ot(ot(ot({},$t),t),{initialized:!0})}}var Jt=["plugins","reducers","storage"];function Xt(t){var e=t;try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e}var Yt=/#.*$/;function Ht(t){var e=function(){if(Z)for(var t,e=document.getElementsByTagName("link"),n=0;t=e[n];n++)if("canonical"===t.getAttribute("rel"))return t.getAttribute("href")}();return e?e.match(/\?/)?e:e+t:window.location.href.replace(Yt,"")}var Wt=function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!Z)return e;var n,r=document,o=r.title,a=r.referrer,i=window,u=i.location,c=i.innerWidth,s=i.innerHeight,l=u.hash,f=u.search,p=Ht(f),d={title:o,url:p,path:"/"+((n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(p))&&n[3]?n[3].split("?")[0].replace(Yt,""):""),hash:l,search:f,width:c,height:s};return a&&""!==a&&(d.referrer=a),ot(ot({},d),e)},Kt={last:{},history:[]};function Qt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Kt,e=1<arguments.length?arguments[1]:void 0,n=e.properties,r=e.options,o=e.meta;switch(e.type){case lt.page:var a=Xt(ot({properties:n,meta:o},Object.keys(r).length&&{options:r}));return ot(ot({},t),{last:a,history:t.history.concat(a)});default:return t}}var Zt={last:{},history:[]};function te(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Zt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.meta,o=e.options,a=e.event,i=e.properties;switch(n){case lt.track:var u=Xt(ot(ot({event:a,properties:i},Object.keys(o).length&&{options:o}),{},{meta:r}));return ot(ot({},t),{last:u,history:t.history.concat(u)});default:return t}}var ee={actions:[]};function ne(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:ee,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload;switch(n){case"queue":var o=r&&r.type&&r.type===lt.identify?[e].concat(t.actions):t.actions.concat(e);return ot(ot({},t),{},{actions:o});case"dequeue":return[];default:return t}}function re(){return Array.prototype.slice.call(arguments).reduce(function(t,e){return t||(W(e)?e:t)},!1)}function oe(){var i="__"+D+"__";return H[i]=[],function(a){return function(t,e,n){var r=a(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return H[i].push(e),o(t)}})}}}function ae(){return function(){return ut(ut.apply(null,arguments),oe())}}var ie=function(t,e,n){return{type:lt.setItemStart,timestamp:qt(),key:t,value:e,options:n}},ue=function(t,e){return{type:lt.removeItemStart,timestamp:qt(),key:t,options:e}};function ce(t){function e(){return k}function u(){throw new Error("Abort disabled in listener")}function l(e,n){return function(t){n&&n(t),e(t)}}var a,n,s,f,p,d,r,h,y,i,b,w,S,E,m,o,c,g=0<arguments.length&&void 0!==t?t:{},v=g.reducers||{},x=(g.plugins||[]).reduce(function(t,n){if(W(n))return t.middlewares=t.middlewares.concat(n),t;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error(bt+"1");var e=n.EVENTS?Object.keys(n.EVENTS).map(function(t){return n.EVENTS[t]}):[];if(n.methods){if(wt.includes(n.name))throw new Error(n.name+" is reserved pluginName");t.methods[n.name]=Object.keys(n.methods).reduce(function(t,e){var r;return t[e]=(r=n.methods[e],function(){var n=Array.prototype.slice.call(arguments),t=Array.apply(null,Array(r.length)).map(function(){}).map(function(t,e){if(n[e]||!1===n[e]||null===n[e])return n[e]}).concat(R);return r.apply({instance:R},t)}),t},{}),delete n.methods}var r=Object.keys(n).concat(e),o=new Set(t.events.concat(r));if(t.events=Array.from(o),t.pluginsArray=t.pluginsArray.concat(n),t.plugins[n.name])throw new Error(n.name+" already loaded");return t.plugins[n.name]=n,t.plugins[n.name].loaded||(t.plugins[n.name].loaded=function(){return!0}),t},{plugins:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),O=g.storage?g.storage:{getItem:function(t){return H[t]},setItem:function(t,e){return H[t]=e},removeItem:function(t){return H[t]=void 0}},I=(a=O,function(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&Q(n)&&n[t])return n[t];var o=St({},a)[t];return o||(H[Et(t)]?H[Et(t)]:null)}),k=x.plugins,P=x.events.filter(function(t){return!st.includes(t)}),j=new Set(P.concat(ct).filter(function(t){return!st.includes(t)})),_=Array.from(j).sort(),A=P.sort(),N=new Vt,T=N.addMiddleware,L=N.removeMiddleware,z=N.dynamicMiddlewares,M=tt(),D=St(M,O),q=ot({enable:function(t,e){J.dispatch(Gt(t,e))},disable:function(t,e){J.dispatch(Ut(t,e))},load:function(t){J.dispatch({type:lt.loadPlugin,plugins:t?[t]:Object.keys(e())})}},x.methods),R={identify:function(t,n,r,o){var a=K(t)?t:null,i=Q(t)?t:n,u=r||{},c=R.user(),s=(H[Et(gt)]=a)||i.userId||I(gt,R,i);return new Promise(function(t,e){J.dispatch(ot(ot({type:lt.identifyStart,userId:s,traits:i||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==a&&{previousId:c.id}),{},{meta:{timestamp:qt(),callback:l(t,re(n,r,o))}}))})},track:function(t,n,r,o){var a=Q(t)?t.event:t;if(!a||!K(a))throw new Error("Event missing");var i=Q(t)?t:n||{},u=Q(r)?r:{};return new Promise(function(t,e){J.dispatch({type:lt.trackStart,event:a,properties:i,options:u,userId:I(gt,R,n),anonymousId:I(vt,R,n),meta:{timestamp:qt(),callback:l(t,re(n,r,o))}})})},page:function(n,r,o){var a=Q(n)?n:{},i=Q(r)?r:{};return new Promise(function(t,e){J.dispatch({type:lt.pageStart,properties:Wt(a),options:i,userId:I(gt,R,a),anonymousId:I(vt,R,a),meta:{timestamp:qt(),callback:l(t,re(n,r,o))}})})},user:function(t){if(t===gt||"id"===t)return I(gt,R);var e=R.getState("user");return t?Y(e,t):e},reset:function(n){return new Promise(function(t,e){J.dispatch({type:lt.resetStart,timestamp:qt(),callback:l(t,n)})})},ready:function(t){return R.on(lt.ready,t)},on:function(n,r){if(!n||!W(r))return!1;if(n===lt.bootstrap)throw new Error(".on disabled for "+n);var o=/Start$|Start:/;if("*"===n){var t=function(){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:R,plugins:k}),e(t)}}},e=function(){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:R,plugins:k}),e(t)}}};return T(t,se),T(e,le),function(){L(t,se),L(e,le)}}function a(){return function(e){return function(t){return t.type===n&&r({payload:t,instance:R,plugins:k,abort:u}),e(t)}}}var i=n.match(o)?se:le;return T(a,i),function(){return L(a,i)}},once:function(t,n){if(!t||!W(n))return!1;if(t===lt.bootstrap)throw new Error(".once disabled for "+t);var r=R.on(t,function(t){var e=t.payload;n({payload:e,instance:R,plugins:k,abort:u}),r()});return r},getState:function(t){var e=J.getState();return t?Y(e,t):Object.assign({},e)},dispatch:function(t){var e,n=K(t)?{type:t}:t;if(e=n.type,ct.includes(e))throw new Error("reserved action "+n.type);var r=n.meta||{},o=t._||{},a=ot(ot({},n),{},{meta:ot({timestamp:qt()},r),_:ot({originalAction:n.type},o)});J.dispatch(a)},enablePlugin:q.enable,disablePlugin:q.disable,loadPlugin:q.load,plugins:q,storage:{getItem:O.getItem,setItem:function(t,e,n){J.dispatch(ie(t,e,n))},removeItem:function(t,e){J.dispatch(ue(t,e))}},setAnonymousId:function(t,e){R.storage.setItem(ft,t,e)},events:{all:_,core:ct,plugins:A}},V=x.middlewares.concat([z(se),(w=e,S={all:_,plugins:A},E={},function(v){return function(g){return function(){var e=Ot(xt.mark(function t(e){var n,r,o,a,i,u,c,s,l,f,p,d,h,y,m;return xt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.type,r=e.name,o=e.callback,(a=e).abort)return t.abrupt("return",g(e));t.next=4;break;case 4:if(n!==lt.disablePlugin&&n!==lt.enablePlugin||W(o)&&o(r),n===lt.loadPlugin)return i=w(),u=Object.keys(i).filter(function(t){return e.plugins.includes(t)}).reduce(function(t,e){return t[e]=i[e],t},{}),c={type:lt.initializeStart,plugins:e.plugins},t.next=11,Pt(c,u,b,v,S);t.next=13;break;case 11:return s=t.sent,t.abrupt("return",g(s));case 13:if(n===lt.initializeEnd&&(l=w(),f=Object.keys(l),p=f.filter(function(t){return e.plugins.includes(t)}).map(function(t){return l[t]}),d=[],h=[],y=p.map(function(e){var t=e.loaded,n=e.name;return It(e,t,1e4).then(function(t){E[n]||(v.dispatch({type:lt.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!st.includes(t)})}),E[n]=!0),d=d.concat(n)}).catch(function(t){if(t instanceof Error)throw new Error(t);return h=h.concat(t.name),t})}),Promise.all(y).then(function(t){setTimeout(function(){f.length===y.length&&v.dispatch({type:lt.ready,plugins:d,failed:h})},0)})),n!==lt.bootstrap)return/^ready:([^:]*)$/.test(n)&&setTimeout(function(){return kt(v,w,b)},0),t.next=18,Pt(e,w,b,v,S);t.next=20;break;case 18:return m=t.sent,t.abrupt("return",g(m));case 20:return t.abrupt("return",g(a));case 21:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()}}),(i=O,function(t){return function(a){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===lt.setItem||e===lt.removeItem){if(t.abort)return a(t);e===lt.setItem?i.setItem(n,r,o):i.removeItem(n,o)}return a(t)}}}),(r=(d=b=R).storage,h=r.setItem,y=r.getItem,function(c){return function(u){return function(t){var o,e,n,r,a,i;return t.type===lt.bootstrap&&(o=t.params,e=t.user,y(ft)||h(ft,e.anonymousId),(n=Object.keys(t.params)).length&&(r=o.an_uid,a=o.an_event,i=n.reduce(function(t,e){var n,r;return(e.match(ht)||e.match(/^(d|g)clid/))&&(r="campaign"===(n=e.replace(ht,""))?"name":n,t.campaign[r]=o[e]),e.match(yt)&&(t.props[e.replace(yt,"")]=o[e]),e.match(mt)&&(t.traits[e.replace(mt,"")]=o[e]),t},{campaign:{},props:{},traits:{}}),c.dispatch(ot(ot({type:lt.params,raw:o},i),r?{userId:r}:{})),r&&setTimeout(function(){return d.identify(r,i.traits)},0),a&&setTimeout(function(){return d.track(a,i.props)},0),Object.keys(i.campaign).length&&c.dispatch({type:lt.campaign,campaign:i.campaign}))),u(t)}}}),(n=R.storage,s=n.setItem,f=n.removeItem,p=n.getItem,function(c){return function(u){return function(t){var e,n,r=t.userId,o=t.traits,a=t.options,i=t.callback;return t.type===lt.reset&&([pt,dt,ft].forEach(function(t){return f(t)}),[gt,vt,"traits"].forEach(function(t){H[Et(t)]=void 0}),W(i)&&i()),t.type===lt.identify&&(p(ft)||s(ft,et()),e=p(pt),n=p(dt)||{},e&&e!==r&&c.dispatch({type:lt.userIdChanged,old:{userId:e,traits:n},new:{userId:r,traits:o},options:a}),r&&s(pt,r),o&&s(dt,ot(ot({},n),o))),u(t)}}}),z(le)]),C={context:Bt,user:(o=O,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(r&&r.type===lt.setItemEnd&&r.key===ft)return Object.assign({},n,{anonymousId:r.value});switch(r.type){case lt.identify:return Object.assign({},n,{userId:r.userId,traits:ot(ot({},n.traits),r.traits)});case lt.reset:return[gt,vt,"traits"].forEach(function(t){H[Et(t)]=null}),[pt,ft,dt].forEach(function(t){o.removeItem(t)}),Object.assign({},n,{userId:null,anonymousId:null,traits:{}});default:return n}}),page:Qt,track:te,plugins:(m=e,function(t,e){var n=0<arguments.length&&void 0!==t?t:Ct,r=1<arguments.length?e:void 0,o={};if("initialize:aborted"===r.type)return n;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=r.type.split(":")[1],i=m()[a];return i&&a?(o[a]={enabled:!0,initialized:!i.initialize,loaded:Boolean(i.loaded()),config:i.config||{}},ot(ot({},n),o)):n}if(/^initialize:([^:]*)$/.test(r.type)){var u=r.type.split(":")[1],c=m()[u];return c&&u?(o[u]=ot(ot({},n[u]),{initialized:!0,loaded:Boolean(c.loaded())}),ot(ot({},n),o)):n}if(/^ready:([^:]*)$/.test(r.type))return o[r.name]=ot(ot({},n[r.name]),{loaded:!0}),ot(ot({},n),o);switch(r.type){case lt.disablePlugin:return Array.isArray(r.name)?o=r.name.reduce(function(t,e){return t[e]=ot(ot({},n[e]),{enabled:!1}),t},n):o[r.name]=ot(ot({},n[r.name]),{enabled:!1}),ot(ot({},n),o);case lt.enablePlugin:return Array.isArray(r.name)?o=r.name.reduce(function(t,e){return t[e]=ot(ot({},n[e]),{enabled:!0}),t},n):o[r.name]=ot(ot({},n[r.name]),{enabled:!0}),ot(ot({},n),o);default:return n}}),queue:ne},F=ut,G=ut;Z&&g.debug&&((c=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(F=c({trace:!0,traceLimit:25})),G=function(t){return 0===arguments.length?oe():Q(rt(t))?ae():ae().apply(null,arguments)});var U,$=(U=g,Object.keys(U).reduce(function(t,e){return Jt.includes(e)||(t[e]=U[e]),t},{})),B={context:$,user:D,plugins:x.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded;return t[n]={enabled:!0,initialized:Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},J=at(it(ot(ot({},C),v)),B,G(F(function(){for(var t=arguments.length,c=new Array(t),e=0;e<t;e++)c[e]=arguments[e];return function(u){return function(t,e,n){var r=u(t,e,n),o=r.dispatch,a={getState:r.getState,dispatch:function(t){return o(t)}},i=c.map(function(t){return t(a)}),o=ut.apply(void 0,nt(i))(r.dispatch);return ot(ot({},r),{},{dispatch:o})}}}.apply(void 0,nt(V))))),X=Object.keys(k);return J.dispatch({type:lt.bootstrap,plugins:X,config:$,params:M,user:D}),J.dispatch({type:lt.registerPlugins,plugins:X}),x.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config;n&&W(n)&&n({instance:R,config:r,payload:t});var o=x.pluginsArray.length===e+1;J.dispatch({type:lt.registerPluginType(t.name),name:t.name,plugin:t}),o&&J.dispatch({type:lt.initializeStart,plugins:X})}),R}var se="before",le="after";function fe(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return ce(e(e({},{storage:g}),t))}return t.default=fe,t.init=fe,t.Analytics=fe,t.EVENTS=lt,t.CONSTANTS=M,t}({});

@@ -42,3 +42,3 @@ declare module "analytics" {

* @param {boolean} [config.debug] - Should analytics run in debug mode
* @param {Array.<Object>} [config.plugins] - Array of analytics plugins
* @param {Array.<AnalyticsPlugin>} [config.plugins] - Array of analytics plugins
* @return {AnalyticsInstance} Analytics Instance

@@ -65,3 +65,3 @@ * @example

debug?: boolean;
plugins?: Array<AnalyticsPlugin>;
plugins?: AnalyticsPlugin[];
}): AnalyticsInstance;

@@ -68,0 +68,0 @@

{
"name": "analytics",
"version": "0.5.5",
"version": "0.6.0",
"description": "Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system.",

@@ -58,3 +58,3 @@ "keywords": [

"dependencies": {
"@analytics/core": "^0.6.2",
"@analytics/core": "^0.7.0",
"@analytics/storage-utils": "^0.2.4"

@@ -90,3 +90,3 @@ },

},
"gitHead": "2600a2a1e0d0bb1225329d8498daac8bdf489bcb"
"gitHead": "fcf1831b582f9e2e78c2025f29e57d9ce1ccb86d"
}

@@ -214,3 +214,3 @@ <a href="https://getanalytics.io">

- **[config.debug]** (optional) <code>boolean</code> - Should analytics run in debug mode
- **[config.plugins]** (optional) <code>Array</code>.&lt;<code>Object</code>&gt; - Array of analytics plugins
- **[config.plugins]** (optional) <code>Array</code>.&lt;<a href="https://getanalytics.io/plugins">AnalyticsPlugin</a>&gt; - Array of analytics plugins

@@ -686,2 +686,3 @@ **Example**

- [@analytics/hubspot](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-hubspot) HubSpot plugin for 'analytics' module [npm link](https://www.npmjs.com/package/@analytics/hubspot).
- [@analytics/mixpanel](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-mixpanel) Mixpanel plugin for 'analytics' module [npm link](https://www.npmjs.com/package/@analytics/mixpanel).
- [@analytics/ownstats](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-ownstats) Ownstats integration for 'analytics' module for browser & node [npm link](https://www.npmjs.com/package/@analytics/ownstats).

@@ -691,2 +692,3 @@ - [@analytics/perfumejs](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-perfumejs) Send browser performance metrics to third-party analytics providers [npm link](https://www.npmjs.com/package/@analytics/perfumejs).

- [@analytics/simple-analytics](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics) Simple analytics plugin for 'analytics' module for browser [npm link](https://www.npmjs.com/package/@analytics/simple-analytics).
- [@analytics/snowplow](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-snowplow) Snowplow integration for 'analytics' module for browser & node [npm link](https://www.npmjs.com/package/@analytics/snowplow).
- [@analytics/storage-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage) Storage utilities for saving values in browser [npm link](https://www.npmjs.com/package/@analytics/storage-utils).

@@ -693,0 +695,0 @@ - [analytics-cli](https://github.com/DavidWells/analytics/tree/master/packages/analytics-cli) CLI for `analytics` pkg [npm link](https://www.npmjs.com/package/analytics-cli).

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc