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.3.4 to 0.3.5

lib/types.d.ts

8

CHANGELOG.md

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

## [0.3.5](https://github.com/DavidWells/analytics/compare/analytics@0.3.4...analytics@0.3.5) (2020-04-21)
**Note:** Version bump only for package analytics
## [0.3.4](https://github.com/DavidWells/analytics/compare/analytics@0.3.3...analytics@0.3.4) (2020-04-16)

@@ -8,0 +16,0 @@

2

dist/analytics.min.js

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

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

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

"clean": "rimraf lib dist && mkdirp lib dist",
"prebuild": "npm run clean",
"prebuild": "npm run clean && npm run types",
"types": "../../node_modules/.bin/jsdoc -t ../../node_modules/tsd-jsdoc/dist -r ./src/ -d temp-types && node scripts/types.js",

@@ -59,3 +59,3 @@ "build": "node ../../scripts/build/index.js",

"dependencies": {
"analytics-utils": "^0.2.0"
"analytics-utils": "^0.2.1"
},

@@ -90,3 +90,3 @@ "ava": {

},
"gitHead": "f73593599a07304a54a8df833223d658e655476e"
"gitHead": "87459c32ebb46f245634869ef90393b0bdc26bf9"
}

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

![npm](https://img.shields.io/npm/dw/analytics?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/analytics?style=flat-square)
![npm](https://img.shields.io/npm/dw/analytics?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/analytics?style=flat-square) ![GitHub](https://img.shields.io/github/license/davidwells/analytics?style=flat-square)

@@ -60,2 +60,3 @@ A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors. Designed to work with any [third-party analytics tool](https://getanalytics.io/plugins/).

- [x] Works offline
- [x] TypeScript support

@@ -806,2 +807,8 @@ ## Why

## TypeScript support
Types for analytics and plugins are generated from [JSDoc blocks](https://jsdoc.app/) in the code base via the [tsd-jsdoc](https://www.npmjs.com/package/tsd-jsdoc) package.
We are always looking to improve type support & improve the DX of users. If you see something that can be improved let us know in an issue!
# Contributing

@@ -808,0 +815,0 @@

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

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

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

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

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