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.8.14 to 0.8.15

8

CHANGELOG.md

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

## [0.8.15](https://github.com/DavidWells/analytics/compare/analytics@0.8.14...analytics@0.8.15) (2024-12-11)
**Note:** Version bump only for package analytics
## [0.8.14](https://github.com/DavidWells/analytics/compare/analytics@0.8.13...analytics@0.8.14) (2024-07-29)

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

16

dist/analytics.js

@@ -171,10 +171,14 @@ var _analytics = (function (exports) {

i = n$1(r[2]);
"[]" === a.substring(a.length - 2) ? (t[a = a.substring(0, a.length - 2)] || (t[a] = [])).push(i) : t[a] = "" === i || i;
if ("[]" === a.substring(a.length - 2)) {
var u = t[a = a.substring(0, a.length - 2)] || (t[a] = []);
t[a] = Array.isArray(u) ? u : [], t[a].push(i);
} else t[a] = "" === i || i;
}
for (var u in t) {
var c = u.split("[");
c.length > 1 && (m(t, c.map(function (e) {
for (var c in t) {
var l = c.split("[");
l.length > 1 && (m(t, l.map(function (e) {
return e.replace(/[?[\]\\ ]/g, "");
}), t[u]), delete t[u]);
}), t[c]), delete t[c]);
}

@@ -1374,3 +1378,3 @@

name: "analytics",
version: "0.12.14"
version: "0.12.15"
},

@@ -1377,0 +1381,0 @@ timezone: void 0,

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

var _analytics=function(e){"use strict";function t(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function n(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function J(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var r="undefined",i="object",o="any",a="*",u="__",c="undefined"!=typeof process?process:{},F=(c.env&&c.env.NODE_ENV,"undefined"!=typeof document);function s(e,t){return t.charAt(0)[e]()+t.slice(1)}null!=c.versions&&c.versions.node,F&&"nodejs"===window.name||"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var l=s.bind(null,"toUpperCase"),f=s.bind(null,"toLowerCase");function d(e){return y(e)?l("null"):"object"==typeof e?C((t=e).constructor)?t.constructor.name:null:Object.prototype.toString.call(e).slice(8,-1);var t}function p(e,t){void 0===t&&(t=!0);e=d(e);return t?f(e):e}function g(e,t){return typeof t===e}var C=g.bind(null,"function"),H=g.bind(null,"string"),m=g.bind(null,"undefined"),I=g.bind(null,"boolean");function y(e){return null===e}function D(e){if((t=e)&&("object"==typeof t||null!==t)){for(var t,n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}}function v(e){return e instanceof Error||H(e.message)&&e.constructor&&("number"===p(e=e.constructor.stackTraceLimit)&&!isNaN(e))}function h(e,t){if("object"!=typeof t||y(t))return!1;if(t instanceof e)return!0;var n=p(new e(""));if(v(t))for(;t;){if(p(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}function b(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?(void 0===(t=t)&&(t=""),(e=e)&&e.nodeName===t.toUpperCase()):n}function w(){[].slice.call(arguments,1);return 1}function X(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function W(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+="-"==r||"4"==r?r:("x"==r?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}g.bind(null,"symbol"),h.bind(null,TypeError),h.bind(null,SyntaxError),w(b,"form"),w(b,"button"),w(b,"input"),w(b,"select");var S="global",P=u+"global"+u,E=typeof self==i&&self.self===self&&self||typeof global==i&&global.global===global&&global||void 0;function G(e){return E[P][e]}function K(e,t){return E[P][e]=t}function Q(e){delete E[P][e]}function O(e,t,n){var r,i;try{j(e)&&(i=(r=window[e])[t].bind(r))}catch(e){}return i||n}E[P]||(E[P]={});var x={};function j(t){if(typeof x[t]!=r)return x[t];try{var e=window[t];e.setItem(r,r),e.removeItem(r)}catch(e){return x[t]=!1}return x[t]=!0}function U(){return(U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var q="function",R="undefined",Y="@@redux/"+Math.random().toString(36),N=function(){return typeof Symbol===q&&Symbol.observable||"@@observable"}(),_=" != "+q;function Z(e,t,n){if(typeof t===q&&typeof n===R&&(n=t,t=void 0),typeof n!==R){if(typeof n!==q)throw new Error("enhancer"+_);return n(Z)(e,t)}if(typeof e!==q)throw new Error("reducer"+_);var r=e,i=t,o=[],a=o,u=!1;function c(){a===o&&(a=o.slice())}function l(){return i}function f(t){if(typeof t!==q)throw new Error("Listener"+_);var n=!0;return c(),a.push(t),function(){var e;n&&(n=!1,c(),e=a.indexOf(t),a.splice(e,1))}}function s(e){if(!D(e))throw new Error("Act != obj");if(typeof e.type===R)throw new Error("ActType "+R);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=r(i,e)}finally{u=!1}for(var t=o=a,n=0;n<t.length;n++)(0,t[n])();return e}return s({type:"@@redux/INIT"}),(n={dispatch:s,subscribe:f,getState:l,replaceReducer:function(e){if(typeof e!==q)throw new Error("next reducer"+_);r=e,s({type:"@@redux/INIT"})}})[N]=function(){var e,n=f;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Observer != obj");function t(){e.next&&e.next(l())}return t(),{unsubscribe:n(t)}}})[N]=function(){return this},e},n}function ee(){var e=[].slice.call(arguments);return 0===e.length?function(e){return e}:1===e.length?e[0]:e.reduce(function(e,t){return function(){return e(t.apply(void 0,[].slice.call(arguments)))}})}var V=u+"anon_id",L=u+"user_id",te=u+"user_traits",c={__proto__:null,ANON_ID:V,USER_ID:L,USER_TRAITS:te},$="userId",ne="anonymousId",re=["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","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ie=["name","EVENTS","config","loaded"],B=re.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),oe=/^utm_/,ae=/^an_prop_/,ue=/^an_trait_/;function ce(e){return{userId:e.getItem(L),anonymousId:e.getItem(V),traits:e.getItem(te)}}var se=function(e){return u+"TEMP"+u+e};var k={};function A(e,t){k[e]&&C(k[e])&&(k[e](t),delete k[e])}function T(e){return{abort:e}}function M(e){var p,m,r=e.data,i=e.action,l=e.instance,t=e.state,f=e.allPlugins,n=e.allMatches,c=e.store,o=e.EVENTS;try{var d=t.plugins,a=t.context,g=i.type,s=g.match(z),u=r.exact.map(function(e){return e.pluginName}),y=(s&&(u=n.during.map(function(e){return e.pluginName})),p=l,m=u,function(e,t,n){var r,i,o,a,l,u,f,c,d=t.config,t=t.name,s=t+"."+e.type,t=(n&&(s=n.event),e.type.match(z)?(o=t,a=s,l=m,u=n,f=e,function(e,t){var n=u?u.name:o,r=t&&he(t)?t:l;if(u&&(!(r=t&&he(t)?t:[o]).includes(o)||1!==r.length))throw new Error("Method "+a+" can only abort "+o+" plugin. "+JSON.stringify(r)+" input valid");return U({},f,{abort:{reason:e,plugins:r,caller:a,_:n}})}):(r=e,i=s,function(){throw new Error(r.type+" action not cancellable. Remove abort in "+i)}));return{payload:(c=e,Object.keys(c).reduce(function(e,t){return"type"===t||(e[t]=D(c[t])?Object.assign({},c[t]):c[t]),e},{})),instance:p,config:d||{},abort:t}}),v=r.exact.reduce(function(e,t){var n=t.pluginName,t=t.methodName,r=!1;return t.match(/^initialize/)||t.match(/^reset/)||(r=!d[n].loaded),a.offline&&t.match(/^(page|track|identify)/)&&(r=!0),e[""+n]=r,e},{});return Promise.resolve(r.exact.reduce(function(e,t,n){try{var s=t.pluginName;return Promise.resolve(e).then(function(t){function e(){return Promise.resolve(t)}var n=r.namespaced&&r.namespaced[s]?Promise.resolve(r.namespaced[s].reduce(function(e,c,t){try{return Promise.resolve(e).then(function(t){{if(c.method&&C(c.method)){var e=c.methodName,n=c.pluginName,r,i=Ie(e);if(i&&i.name===n)throw r=Ie(i.method),new Error([n+" plugin is calling method "+e,"Plugins cant call self","Use "+i.method+" "+(r?"or "+r.method:"")+" in "+n+" plugin insteadof "+e].join("\n"));return Promise.resolve(c.method({payload:t,instance:l,abort:(o=t,a=s,u=c.pluginName,function(e,t){return U({},o,{abort:{reason:e,plugins:t||[a],caller:g,from:u||a}})}),config:pe(c.pluginName,d,f),plugins:d})).then(function(e){e=D(e)?e:{};return Promise.resolve(U({},t,e))})}return t}var o,a,u})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){t[s]=e}):void(t[s]=i);return n&&n.then?n.then(e):e()})}catch(e){return Promise.reject(e)}},Promise.resolve({}))).then(function(u){return Promise.resolve(r.exact.reduce(function(e,t,n){try{var i=r.exact.length===n+1,o=t.pluginName,a=f[o];return Promise.resolve(e).then(function(n){var r=u[o]||{};if(ye(r=s?n:r,o))return de({data:r,method:g,instance:l,pluginName:o,store:c}),Promise.resolve(n);if(ye(n,o))return i&&de({data:n,method:g,instance:l,store:c}),Promise.resolve(n);if(v.hasOwnProperty(o)&&!0===v[o])return c.dispatch({type:"queue",plugin:o,payload:r,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(n);var e=y(u[o],f[o]);return Promise.resolve(a[g]({abort:e.abort,payload:r,instance:l,config:pe(o,d,f),plugins:d})).then(function(e){var e=D(e)?e:{},e=U({},n,e),t=u[o];return ye(t,o)?de({data:t,method:g,instance:l,pluginName:o,store:c}):((t=g+":"+o).match(/:/g)||[]).length<2&&!g.match(le)&&!g.match(fe)&&l.dispatch(U({},s?e:r,{type:t,_:{called:t,from:"submethod"}})),Promise.resolve(e)})})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){if(!(g.match(z)||g.match(/^registerPlugin/)||g.match(fe)||g.match(le)||g.match(/^params/)||g.match(/^userIdChanged/))){if(o.plugins.includes(g),e._&&e._.originalAction===g)return e;var t=U({},e,{_:{originalAction:e.type,called:e.type,from:"engineEnd"}});ve(e,r.exact.length)&&!g.match(/End$/)&&(t=U({},t,{type:e.type+"Aborted"})),c.dispatch(t)}return e})})}catch(e){return Promise.reject(e)}}var z=/Start$/,le=/^bootstrap/,fe=/^ready/;function de(e){var t=e.pluginName,t=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(U({},e.data,{type:t,_:{called:t,from:"abort"}}))}function pe(e,t,n){t=t[e]||n[e];return t&&t.config?t.config:{}}function ge(n,e){return e.reduce(function(e,t){return t[n]?e.concat({methodName:n,pluginName:t.name,method:t[n]}):e},[])}function me(e,t){var n=e.replace(z,""),t=t?":"+t:"";return[e+t,n+t,n+"End"+t]}function ye(e,t){e=e.abort;return e&&(!0===e||be(e,t)||e&&be(e.plugins,t))}function ve(e,t){e=e.abort;if(e){if(!0===e||H(e))return 1;var n=e.plugins;return he(e)&&e.length===t||he(n)&&n.length===t}}function he(e){return Array.isArray(e)}function be(e,t){return!(!e||!he(e))&&e.includes(t)}function Ie(e){e=e.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function we(y,v,h){var b={};return function(m){return function(g){return function(e){try{var t,n,r,l,i,o,a,u,f=function(e){return t?e:g(p)},c=e.type,d=e.plugins,p=e;if(e.abort)return Promise.resolve(g(e));c===B.enablePlugin&&m.dispatch({type:B.initializeStart,plugins:d,disabled:[],fromEnable:!0,meta:e.meta}),c===B.disablePlugin&&setTimeout(function(){return A(e.meta.rid,{payload:e})},0),c===B.initializeEnd&&(n=v(),l=(r=Object.keys(n)).filter(function(e){return d.includes(e)}).map(function(e){return n[e]}),i=[],o=[],a=e.disabled,u=l.map(function(t){var e=t.loaded,n=t.name,r=t.config;return function r(i,o,a){return new Promise(function(t,n){return o()?t(i):a<1?n(U({},i,{queue:!0})):new Promise(function(e){return setTimeout(e,10)}).then(function(e){return r(i,o,a-10).then(t,n)})})}(t,function(){return e({config:r})},1e4).then(function(e){return b[n]||(m.dispatch({type:B.pluginReadyType(n),name:n,events:Object.keys(t).filter(function(e){return!ie.includes(e)})}),b[n]=!0),i=i.concat(n),t}).catch(function(e){if(e instanceof Error)throw new Error(e);return o=o.concat(e.name),e})}),Promise.all(u).then(function(e){var t={plugins:i,failed:o,disabled:a};setTimeout(function(){r.length===u.length+a.length&&m.dispatch(U({},{type:B.ready},t))},0)}));var s=function(){if(c!==B.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){var c,s,n,l,f,e,d,p,g;c=m,s=y,l={},f=v(),e=c.getState(),d=e.plugins,p=e.queue,g=e.user,!e.context.offline&&p&&p.actions&&p.actions.length&&((n=p.actions.reduce(function(e,t,n){return d[t.plugin].loaded?(e.process.push(t),e.processIndex.push(n)):(e.requeue.push(t),e.requeueIndex.push(n)),e},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(e){var t,n,r,i,e=p.actions[e],o=e.plugin,a=e.payload.type,u=f[o][a];u&&C(u)&&(void 0===(r=e.payload)&&(r={}),void 0===(i=g)&&(i={}),e=[$,ne].reduce(function(e,t){return r.hasOwnProperty(t)&&i[t]&&i[t]!==r[t]&&(e[t]=i[t]),e},r),!(n=l[e.meta.rid])&&(t=u({payload:e,config:d[o].config,instance:s,abort:T}))&&D(t)&&t.abort?l[e.meta.rid]=!0:n||c.dispatch(U({},e,{type:u=a+":"+o,_:{called:u,from:"queueDrain"}})))}),e=p.actions.filter(function(e,t){return!~n.processIndex.indexOf(t)}),p.actions=e))},0),Promise.resolve(function(n,e,i,l,f){try{var o=C(e)?e():e,a=n.type,d=a.replace(z,"");if(n._&&n._.called)return Promise.resolve(n);var u=i.getState(),p=(y=o,void 0===(r=u.plugins)&&(r={}),void 0===(v=n.options)&&(v={}),Object.keys(y).filter(function(e){var t=v.plugins||{};return I(t[e])?t[e]:!1!==t.all&&(!r[e]||!1!==r[e].enabled)}).map(function(e){return y[e]})),g=(p=a===B.initializeStart&&n.fromEnable?Object.keys(u.plugins).filter(function(e){var t=u.plugins[e];return n.plugins.includes(e)&&!t.initialized}).map(function(e){return o[e]}):p).map(function(e){return e.name}),c=(s=p,t=me(m=a).map(function(e){return ge(e,s)}),s.reduce(function(e,t){var t=t.name,n=me(m,t).map(function(e){return ge(e,s)}),r=n[0],i=n[1],n=n[2];return r.length&&(e.beforeNS[t]=r),i.length&&(e.duringNS[t]=i),n.length&&(e.afterNS[t]=n),e},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}}));return Promise.resolve(M({action:n,data:{exact:c.before,namespaced:c.beforeNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(t){function e(){var e=function(){if(a.match(z))return Promise.resolve(M({action:U({},n,{type:d+"End"}),data:{exact:c.after,namespaced:c.afterNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){e.meta&&e.meta.hasCallback&&A(e.meta.rid,{payload:e})})}();return e&&e.then?e.then(function(){return t}):t}if(ve(t,g.length))return t;var n,r=a!==d?Promise.resolve(M({action:U({},t,{type:d}),data:{exact:c.during,namespaced:c.duringNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){n=e}):void(n=t);return r&&r.then?r.then(e):e()})}catch(n){return Promise.reject(n)}var m,s,t,y,r,v}(e,v,y,m,h)).then(function(e){return t=1,g(e)})}();return Promise.resolve(s&&s.then?s.then(f):f(s))}catch(e){return Promise.reject(e)}}}}}var Se=function(){var a=this;this.before=[],this.after=[],this.addMiddleware=function(e,t){a[t]=a[t].concat(e)},this.removeMiddleware=function(t,e){var n=a[e].findIndex(function(e){return e===t});-1!==n&&(a[e]=[].concat(a[e].slice(0,n),a[e].slice(n+1)))},this.dynamicMiddlewares=function(o){return function(i){return function(r){return function(e){var t={getState:i.getState,dispatch:function(e){return i.dispatch(e)}},n=a[o].map(function(e){return e(t)});return ee.apply(void 0,n)(r)(e)}}}}};function Pe(e,t){return e.substring(t.length+1,e.length)}function Ee(e,n,r){return e.reduce(function(e,t){return e[t]=U({},r[t],{enabled:n}),e},r)}function Oe(e){try{return JSON.parse(JSON.stringify(e))}catch(e){}return e}var xe={last:{},history:[]};function je(e,t){void 0===e&&(e=xe);var n=t.options,r=t.meta;return t.type===B.track?(t=Oe(U({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r})),U({},e,{last:t,history:e.history.concat(t)})):e}var Ne={actions:[]};function _e(e,t){void 0===e&&(e=Ne);var n=t.payload;switch(t.type){case"queue":var r=n&&n.type&&n.type===B.identify?[t].concat(e.actions):e.actions.concat(t);return U({},e,{actions:r});case"dequeue":return[];default:return e}}var ke=/#.*$/;var Ae=function(e){if(void 0===e&&(e={}),!F)return e;var t,n=document,r=n.title,n=n.referrer,i=window,o=i.location,a=i.innerWidth,i=i.innerHeight,u=o.hash,o=o.search,c=(t=o,(c=function(){if(F)for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}())?c.match(/\?/)?c:c+t:window.location.href.replace(ke,"")),r={title:r,url:c,path:"/"+((t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t=c))&&t[3]?t[3].split("?")[0].replace(ke,""):""),hash:u,search:o,width:a,height:i};return n&&""!==n&&(r.referrer=n),U({},r,e)},Te={last:{},history:[]};function Me(e,t){void 0===e&&(e=Te);var n=t.options;return t.type===B.page?(t=Oe(U({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n})),U({},e,{last:t,history:e.history.concat(t)})):e}var i={},ze={initialized:!1,sessionId:W(),app:null,version:null,debug:!1,offline:!!F&&!navigator.onLine,os:{name:"na"},userAgent:F?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.14"},timezone:void 0,locale:void 0,campaign:{},referrer:i};function Ce(e,t){var n=(e=void 0===e?ze:e).initialized,r=t.campaign;switch(t.type){case B.campaign:return U({},e,{campaign:r});case B.offline:return U({},e,{offline:!0});case B.online:return U({},e,{offline:!1});default:return n?e:U({},ze,e,{initialized:!0})}}var De=["plugins","reducers","storage"];function Ue(){return K("analytics",[]),function(i){return function(e,t,n){var e=i(e,t,n),r=e.dispatch;return Object.assign(e,{dispatch:function(e){return E[P].analytics.push(e.action||e),r(e)}})}}}function qe(){return function(){return ee(ee.apply(null,arguments),Ue())}}function Re(e){return e?"array"===p(e)?e:[e]:[]}function Ve(e,t,n){void 0===e&&(e={});var r,i,o=W();return t&&(k[o]=(r=t,i=function(e){for(var t,n=e||Array.prototype.slice.call(arguments),r=0;r<n.length;r++)if(C(n[r])){t=n[r];break}return t}(n),function(e){i&&i(e),r(e)})),U({},e,{rid:o,ts:(new Date).getTime()},t?{hasCallback:!0}:{})}function Le(e){function o(){return u}function c(){throw new Error("Abort disabled inListener")}var d,p,g,m,y,v,h,b,I,w=(e=void 0===e?{}:e).reducers||{},S=e.initialUser||{},a=(e.plugins||[]).reduce(function(e,n){if(C(n))return e.middlewares=e.middlewares.concat(n),e;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error("https://lytics.dev/errors/1");n.config||(n.config={});var t=n.EVENTS?Object.keys(n.EVENTS).map(function(e){return n.EVENTS[e]}):[],t=(e.pluginEnabled[n.name]=!(!1===n.enabled||!1===n.config.enabled),delete n.enabled,n.methods&&(e.methods[n.name]=Object.keys(n.methods).reduce(function(e,t){var r;return e[t]=(r=n.methods[t],function(){for(var e=Array.prototype.slice.call(arguments),t=new Array(r.length),n=0;n<e.length;n++)t[n]=e[n];return t[t.length]=l,r.apply({instance:l},t)}),e},{}),delete n.methods),Object.keys(n).concat(t)),t=new Set(e.events.concat(t));if(e.events=Array.from(t),e.pluginsArray=e.pluginsArray.concat(n),e.plugins[n.name])throw new Error(n.name+"AlreadyLoaded");return e.plugins[n.name]=n,e.plugins[n.name].loaded||(e.plugins[n.name].loaded=function(){return!0}),e},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),t=e.storage||{getItem:G,setItem:K,removeItem:Q},s=(d=t,function(e,t,n){return t.getState("user")[e]||(n&&D(n)&&n[e]?n[e]:ce(d)[e]||G(se(e))||null)}),u=a.plugins,P=a.events.filter(function(e){return!ie.includes(e)}).sort(),n=new Set(P.concat(re).filter(function(e){return!ie.includes(e)})),n=Array.from(n).sort(),r=new Se,E=r.addMiddleware,O=r.removeMiddleware,r=r.dynamicMiddlewares,i=function(e){for(var t,l=e?(e=e.match(/\?(.*)/))&&e[1]?e[1].split("#")[0]:"":F&&window.location.search.substring(1),n=Object.create(null),f=/([^&=]+)=?([^&]*)/g;i=f.exec(l);){var r=X(i[1]),i=X(i[2]);"[]"===r.substring(r.length-2)?(n[r=r.substring(0,r.length-2)]||(n[r]=[])).push(i):n[r]=""===i||i}for(t in n){var d=t.split("[");if(1<d.length){{o=void 0;a=void 0;p=void 0;u=void 0;c=void 0;s=void 0;var o=n;var a=d.map(function(e){return e.replace(/[?[\]\\ ]/g,"")});var p=n[t];for(var u=a.length-1,c=0;c<u;++c){var s=a[c];if("__proto__"===s||"constructor"===s)break;s in o||(o[s]={}),o=o[s]}o[a[u]]=p}delete n[t]}}return n}(),x=ce(t),j=U({},x,S,i.an_uid?{userId:i.an_uid}:{},i.an_aid?{anonymousId:i.an_aid}:{}),N=(j.anonymousId||(j.anonymousId=W()),U({enable:function(t,n){return new Promise(function(e){f.dispatch({type:B.enablePlugin,plugins:Re(t),_:{originalAction:B.enablePlugin}},e,[n])})},disable:function(t,n){return new Promise(function(e){f.dispatch({type:B.disablePlugin,plugins:Re(t),_:{originalAction:B.disablePlugin}},e,[n])})}},a.methods)),_=!1,l={identify:function(e,t,n,r){try{var i=H(e)?e:null,o=D(e)?e:t,a=n||{},u=l.user(),c=(K(se($),i),i||o.userId||s($,l,o));return Promise.resolve(new Promise(function(e){f.dispatch(U({type:B.identifyStart,userId:c,traits:o||{},options:a,anonymousId:u.anonymousId},u.id&&u.id!==i&&{previousId:u.id}),e,[t,n,r])}))}catch(e){return Promise.reject(e)}},track:function(e,t,n,r){try{var i=D(e)?e.event:e;if(!i||!H(i))throw new Error("EventMissing");var o=D(e)?e:t||{},a=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.trackStart,event:i,properties:o,options:a,userId:s($,l,t),anonymousId:s(ne,l,t)},e,[t,n,r])}))}catch(e){return Promise.reject(e)}},page:function(t,n,r){try{var i=D(t)?t:{},o=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.pageStart,properties:Ae(i),options:o,userId:s($,l,i),anonymousId:s(ne,l,i)},e,[t,n,r])}))}catch(t){return Promise.reject(t)}},user:function(e){if(e===$||"id"===e)return s($,l);if(e===ne||"anonId"===e)return s(ne,l);var t=l.getState("user");return e?J(t,e):t},reset:function(t){return new Promise(function(e){f.dispatch({type:B.resetStart},e,t)})},ready:function(t){return _&&t({plugins:N,instance:l}),l.on(B.ready,function(e){t(e),_=!0})},on:function(n,r){if(!n||!C(r))return!1;if(n===B.bootstrap)throw new Error(".on disabled for "+n);var e,t,i=/Start$|Start:/;if("*"===n)return t=function(e){return function(t){return function(e){return e.type.match(i)||r({payload:e,instance:l,plugins:u}),t(e)}}},E(e=function(e){return function(t){return function(e){return e.type.match(i)&&r({payload:e,instance:l,plugins:u}),t(e)}}},$e),E(t,Be),function(){O(e,$e),O(t,Be)};function o(e){return function(t){return function(e){return e.type===n&&r({payload:e,instance:l,plugins:u,abort:c}),t(e)}}}var a=n.match(i)?$e:Be;return E(o,a),function(){return O(o,a)}},once:function(e,t){if(!e||!C(t))return!1;if(e===B.bootstrap)throw new Error(".once disabled for "+e);var n=l.on(e,function(e){t({payload:e.payload,instance:l,plugins:u,abort:c}),n()});return n},getState:function(e){var t=f.getState();return e?J(t,e):Object.assign({},t)},dispatch:function(e){var t=H(e)?{type:e}:e;if(re.includes(t.type))throw new Error("reserved action "+t.type);t=U({},t,{_:U({originalAction:t.type},e._||{})});f.dispatch(t)},enablePlugin:N.enable,disablePlugin:N.disable,plugins:N,storage:{getItem:t.getItem,setItem:function(e,t,n){f.dispatch({type:B.setItemStart,key:e,value:t,options:n})},removeItem:function(e,t){f.dispatch({type:B.removeItemStart,key:e,options:t})}},setAnonymousId:function(e,t){l.storage.setItem(V,e,t)},events:{core:re,plugins:P}},P=a.middlewares.concat([function(e){return function(t){return function(e){return e.meta||(e.meta=Ve()),t(e)}}},r($e),we(l,o,{all:n,plugins:P}),(I=t,function(e){return function(o){return function(e){var t=e.type,n=e.key,r=e.value,i=e.options;if(t===B.setItem||t===B.removeItem){if(e.abort)return o(e);t===B.setItem?I.setItem(n,r,i):I.removeItem(n,i)}return o(e)}}}),(b=(h=l).storage.setItem,function(l){return function(s){return function(e){var r,t,n,i,o,a,u,c;return e.type===B.bootstrap&&(r=e.params,o=e.user,t=e.persistedUser,n=e.initialUser,i=t.userId===o.userId,t.anonymousId!==o.anonymousId&&b(V,o.anonymousId),i||b(L,o.userId),n.traits&&b(te,U({},i&&t.traits?t.traits:{},n.traits)),(o=Object.keys(e.params)).length&&(a=r.an_uid,u=r.an_event,c=o.reduce(function(e,t){var n;return(t.match(oe)||t.match(/^(d|g)clid/))&&(n=t.replace(oe,""),e.campaign["campaign"===n?"name":n]=r[t]),t.match(ae)&&(e.props[t.replace(ae,"")]=r[t]),t.match(ue)&&(e.traits[t.replace(ue,"")]=r[t]),e},{campaign:{},props:{},traits:{}}),l.dispatch(U({type:B.params,raw:r},c,a?{userId:a}:{})),a&&setTimeout(function(){return h.identify(a,c.traits)},0),u&&setTimeout(function(){return h.track(u,c.props)},0),Object.keys(c.campaign).length&&l.dispatch({type:B.campaign,campaign:c.campaign}))),s(e)}}}),(m=(n=(n=l).storage).setItem,y=n.removeItem,v=n.getItem,function(u){return function(a){return function(e){var t,n,r=e.userId,i=e.traits,o=e.options;return e.type===B.reset&&([L,te,V].forEach(function(e){y(e)}),[$,ne,"traits"].forEach(function(e){Q(se(e))})),e.type===B.identify&&(v(V)||m(V,W()),t=v(L),n=v(te)||{},t&&t!==r&&u.dispatch({type:B.userIdChanged,old:{userId:t,traits:n},new:{userId:r,traits:i},options:o}),r&&m(L,r),i&&m(te,U({},n,i))),a(e)}}}),r(Be)]),n={context:Ce,user:(g=t,function(e,t){if(void 0===e&&(e={}),(t=void 0===t?{}:t).type===B.setItemEnd){if(t.key===V)return U({},e,{anonymousId:t.value});if(t.key===L)return U({},e,{userId:t.value})}switch(t.type){case B.identify:return Object.assign({},e,{userId:t.userId,traits:U({},e.traits,t.traits)});case B.reset:return[L,V,te].forEach(function(e){g.removeItem(e)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}),page:Me,track:je,plugins:(p=o,function(e,t){void 0===e&&(e={});var n={};if("initialize:aborted"===t.type)return e;if(/^registerPlugin:([^:]*)$/.test(t.type)){var r=Pe(t.type,"registerPlugin"),i=p()[r];if(!i||!r)return e;var o=t.enabled,a=i.config;return n[r]={enabled:o,initialized:!!o&&Boolean(!i.initialize),loaded:!!o&&Boolean(i.loaded({config:a})),config:a},U({},e,n)}if(/^initialize:([^:]*)$/.test(t.type))return r=Pe(t.type,B.initialize),(o=p()[r])&&r?(n[r]=U({},e[r],{initialized:!0,loaded:Boolean(o.loaded({config:o.config}))}),U({},e,n)):e;if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=U({},e[t.name],{loaded:!0}),U({},e,n);switch(t.type){case B.disablePlugin:return U({},e,Ee(t.plugins,!1,e));case B.enablePlugin:return U({},e,Ee(t.plugins,!0,e));default:return e}}),queue:_e},r=ee,t=ee;F&&e.debug&&((T=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(r=T({trace:!0,traceLimit:25})),t=function(){return 0===arguments.length?Ue():D(typeof arguments[0])?qe():qe().apply(null,arguments)});A=e;var k,A,T=Object.keys(A).reduce(function(e,t){return De.includes(t)||(e[t]=A[t]),e},{}),e={context:T,user:j,plugins:a.pluginsArray.reduce(function(e,t){var n=t.name,r=t.config,i=t.loaded,o=a.pluginEnabled[n];return e[n]={enabled:o,initialized:!!o&&Boolean(!t.initialize),loaded:Boolean(i({config:r})),config:r},e},{})},f=Z(function(e){for(var t=Object.keys(e),l={},n=0;n<t.length;n++){var r=t[n];typeof e[r]===q&&(l[r]=e[r])}var f,i,d=Object.keys(l);try{i=l,Object.keys(i).forEach(function(e){var t=i[e];if(typeof t(void 0,{type:"@@redux/INIT"})===R||typeof t(void 0,{type:Y})===R)throw new Error("reducer "+e+" "+R)})}catch(e){f=e}return function(e,t){if(void 0===e&&(e={}),f)throw f;for(var n,r=!1,i={},o=0;o<d.length;o++){var a,u=d[o],c=e[u],s=(0,l[u])(c,t);if(typeof s===R)throw n=u,a="action "+((a=(a=t)&&a.type)&&a.toString()||"?")+"reducer "+n+" returns "+R,new Error(a);i[u]=s,r=r||s!==c}return r?i:e}}(U({},n,w)),e,t(r(function(){var a=arguments;return function(o){return function(e,t,n){var e=o(e,t,n),r=e.dispatch,i={getState:e.getState,dispatch:function(e){return r(e)}},t=[].slice.call(a).map(function(e){return e(i)});return U({},e,{dispatch:r=ee.apply(void 0,t)(e.dispatch)})}}}.apply(void 0,P)))),n=(f.dispatch=(k=f.dispatch,function(e,t,n){e=U({},e,{meta:Ve(e.meta,t,Re(n))});return k.apply(null,[e])}),Object.keys(u)),M=(f.dispatch({type:B.bootstrap,plugins:n,config:T,params:i,user:j,initialUser:S,persistedUser:x}),n.filter(function(e){return a.pluginEnabled[e]})),z=n.filter(function(e){return!a.pluginEnabled[e]});return f.dispatch({type:B.registerPlugins,plugins:n,enabled:a.pluginEnabled}),a.pluginsArray.map(function(e,t){var n=e.bootstrap,r=e.config,i=e.name;n&&C(n)&&n({instance:l,config:r,payload:e}),f.dispatch({type:B.registerPluginType(i),name:i,enabled:a.pluginEnabled[i],plugin:e}),a.pluginsArray.length===t+1&&f.dispatch({type:B.initializeStart,plugins:M,disabled:z})}),l}var $e="before",Be="after",Je="cookie",Fe=Ge(),He=Ke,Xe=Ke;function We(e){return Fe?Ke(e,"",-1):Q(e)}function Ge(){if(void 0!==Fe)return Fe;var e="cookiecookie";try{Ke(e,e),Fe=-1!==document.cookie.indexOf(e),We(e)}catch(e){Fe=!1}return Fe}function Ke(e,t,n,r,i,o){var a;if("undefined"!=typeof window)return a=1<arguments.length,!1===Fe&&(a?K(e,t):G(e)),a?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}var Qe="localStorage",i=j.bind(null,"localStorage"),Ye=(O("localStorage","getItem",G),O("localStorage","setItem",K),O("localStorage","removeItem",Q),"sessionStorage"),Ze=j.bind(null,"sessionStorage");function et(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(D(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}O("sessionStorage","getItem",G),O("sessionStorage","setItem",K),O("sessionStorage","removeItem",Q);var tt=i(),nt=Ze(),rt=Ge();function it(e,t){if(e){var t=ot(t),n=!st(t),r=at(t)?et(localStorage.getItem(e)):void 0;if(n&&!m(r))return r;var i=ut(t)?et(He(e)):void 0;if(n&&i)return i;t=ct(t)?et(sessionStorage.getItem(e)):void 0;if(n&&t)return t;e=G(e);return n?e:{localStorage:r,sessionStorage:t,cookie:i,global:e}}}function ot(e){return e?H(e)?e:e.storage:o}function at(e){return tt&&lt(e,Qe)}function ut(e){return rt&&lt(e,Je)}function ct(e){return nt&&lt(e,Ye)}function st(e){return e===a||"all"===e}function lt(e,t){return e===o||e===t||st(e)}function ft(e,t,n){return{location:e,current:t,previous:n}}var dt={setItem:function(e,t,n){var r,i,o;if(e&&!m(t))return r={},n=ot(n),i=JSON.stringify(t),o=!st(n),at(n)&&(r[Qe]=ft(Qe,t,et(localStorage.getItem(e))),localStorage.setItem(e,i),o)?r[Qe]:ut(n)&&(r[Je]=ft(Je,t,et(He(e))),Xe(e,i),o)?r[Je]:ct(n)&&(r[Ye]=ft(Ye,t,et(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?r[Ye]:(r[S]=ft(S,t,G(e)),K(e,t),o?r[S]:r)},getItem:it,removeItem:function(e,t){var n,r;if(e)return t=ot(t),n=it(e,a),r={},!m(n.localStorage)&&at(t)&&(localStorage.removeItem(e),r[Qe]=n.localStorage),!m(n.cookie)&&ut(t)&&(We(e),r[Je]=n.cookie),!m(n.sessionStorage)&&ct(t)&&(sessionStorage.removeItem(e),r[Ye]=n.sessionStorage),!m(n.global)&&lt(t,S)&&(Q(e),r[S]=n.global),r}};function pt(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Le(n(n({},{storage:dt}),e))}return e.Analytics=pt,e.CONSTANTS=c,e.EVENTS=B,e.default=pt,e.init=pt,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var _analytics=function(e){"use strict";function t(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function n(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function J(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var r="undefined",i="object",o="any",a="*",u="__",c="undefined"!=typeof process?process:{},F=(c.env&&c.env.NODE_ENV,"undefined"!=typeof document);function s(e,t){return t.charAt(0)[e]()+t.slice(1)}null!=c.versions&&c.versions.node,F&&"nodejs"===window.name||"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var l=s.bind(null,"toUpperCase"),f=s.bind(null,"toLowerCase");function d(e){return y(e)?l("null"):"object"==typeof e?C((t=e).constructor)?t.constructor.name:null:Object.prototype.toString.call(e).slice(8,-1);var t}function p(e,t){void 0===t&&(t=!0);e=d(e);return t?f(e):e}function g(e,t){return typeof t===e}var C=g.bind(null,"function"),H=g.bind(null,"string"),m=g.bind(null,"undefined"),I=g.bind(null,"boolean");function y(e){return null===e}function D(e){if((t=e)&&("object"==typeof t||null!==t)){for(var t,n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}}function v(e){return e instanceof Error||H(e.message)&&e.constructor&&("number"===p(e=e.constructor.stackTraceLimit)&&!isNaN(e))}function h(e,t){if("object"!=typeof t||y(t))return!1;if(t instanceof e)return!0;var n=p(new e(""));if(v(t))for(;t;){if(p(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}function b(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?(void 0===(t=t)&&(t=""),(e=e)&&e.nodeName===t.toUpperCase()):n}function w(){[].slice.call(arguments,1);return 1}function X(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function W(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+="-"==r||"4"==r?r:("x"==r?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}g.bind(null,"symbol"),h.bind(null,TypeError),h.bind(null,SyntaxError),w(b,"form"),w(b,"button"),w(b,"input"),w(b,"select");var S="global",P=u+"global"+u,E=typeof self==i&&self.self===self&&self||typeof global==i&&global.global===global&&global||void 0;function G(e){return E[P][e]}function K(e,t){return E[P][e]=t}function Q(e){delete E[P][e]}function O(e,t,n){var r,i;try{j(e)&&(i=(r=window[e])[t].bind(r))}catch(e){}return i||n}E[P]||(E[P]={});var x={};function j(t){if(typeof x[t]!=r)return x[t];try{var e=window[t];e.setItem(r,r),e.removeItem(r)}catch(e){return x[t]=!1}return x[t]=!0}function U(){return(U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var q="function",R="undefined",Y="@@redux/"+Math.random().toString(36),N=function(){return typeof Symbol===q&&Symbol.observable||"@@observable"}(),_=" != "+q;function Z(e,t,n){if(typeof t===q&&typeof n===R&&(n=t,t=void 0),typeof n!==R){if(typeof n!==q)throw new Error("enhancer"+_);return n(Z)(e,t)}if(typeof e!==q)throw new Error("reducer"+_);var r=e,i=t,o=[],a=o,u=!1;function c(){a===o&&(a=o.slice())}function l(){return i}function f(t){if(typeof t!==q)throw new Error("Listener"+_);var n=!0;return c(),a.push(t),function(){var e;n&&(n=!1,c(),e=a.indexOf(t),a.splice(e,1))}}function s(e){if(!D(e))throw new Error("Act != obj");if(typeof e.type===R)throw new Error("ActType "+R);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=r(i,e)}finally{u=!1}for(var t=o=a,n=0;n<t.length;n++)(0,t[n])();return e}return s({type:"@@redux/INIT"}),(n={dispatch:s,subscribe:f,getState:l,replaceReducer:function(e){if(typeof e!==q)throw new Error("next reducer"+_);r=e,s({type:"@@redux/INIT"})}})[N]=function(){var e,n=f;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Observer != obj");function t(){e.next&&e.next(l())}return t(),{unsubscribe:n(t)}}})[N]=function(){return this},e},n}function ee(){var e=[].slice.call(arguments);return 0===e.length?function(e){return e}:1===e.length?e[0]:e.reduce(function(e,t){return function(){return e(t.apply(void 0,[].slice.call(arguments)))}})}var V=u+"anon_id",L=u+"user_id",te=u+"user_traits",c={__proto__:null,ANON_ID:V,USER_ID:L,USER_TRAITS:te},$="userId",ne="anonymousId",re=["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","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ie=["name","EVENTS","config","loaded"],B=re.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),oe=/^utm_/,ae=/^an_prop_/,ue=/^an_trait_/;function ce(e){return{userId:e.getItem(L),anonymousId:e.getItem(V),traits:e.getItem(te)}}var se=function(e){return u+"TEMP"+u+e};var k={};function A(e,t){k[e]&&C(k[e])&&(k[e](t),delete k[e])}function T(e){return{abort:e}}function M(e){var p,m,r=e.data,i=e.action,l=e.instance,t=e.state,f=e.allPlugins,n=e.allMatches,c=e.store,o=e.EVENTS;try{var d=t.plugins,a=t.context,g=i.type,s=g.match(z),u=r.exact.map(function(e){return e.pluginName}),y=(s&&(u=n.during.map(function(e){return e.pluginName})),p=l,m=u,function(e,t,n){var r,i,o,a,l,u,f,c,d=t.config,t=t.name,s=t+"."+e.type,t=(n&&(s=n.event),e.type.match(z)?(o=t,a=s,l=m,u=n,f=e,function(e,t){var n=u?u.name:o,r=t&&he(t)?t:l;if(u&&(!(r=t&&he(t)?t:[o]).includes(o)||1!==r.length))throw new Error("Method "+a+" can only abort "+o+" plugin. "+JSON.stringify(r)+" input valid");return U({},f,{abort:{reason:e,plugins:r,caller:a,_:n}})}):(r=e,i=s,function(){throw new Error(r.type+" action not cancellable. Remove abort in "+i)}));return{payload:(c=e,Object.keys(c).reduce(function(e,t){return"type"===t||(e[t]=D(c[t])?Object.assign({},c[t]):c[t]),e},{})),instance:p,config:d||{},abort:t}}),v=r.exact.reduce(function(e,t){var n=t.pluginName,t=t.methodName,r=!1;return t.match(/^initialize/)||t.match(/^reset/)||(r=!d[n].loaded),a.offline&&t.match(/^(page|track|identify)/)&&(r=!0),e[""+n]=r,e},{});return Promise.resolve(r.exact.reduce(function(e,t,n){try{var s=t.pluginName;return Promise.resolve(e).then(function(t){function e(){return Promise.resolve(t)}var n=r.namespaced&&r.namespaced[s]?Promise.resolve(r.namespaced[s].reduce(function(e,c,t){try{return Promise.resolve(e).then(function(t){{if(c.method&&C(c.method)){var e=c.methodName,n=c.pluginName,r,i=Ie(e);if(i&&i.name===n)throw r=Ie(i.method),new Error([n+" plugin is calling method "+e,"Plugins cant call self","Use "+i.method+" "+(r?"or "+r.method:"")+" in "+n+" plugin insteadof "+e].join("\n"));return Promise.resolve(c.method({payload:t,instance:l,abort:(o=t,a=s,u=c.pluginName,function(e,t){return U({},o,{abort:{reason:e,plugins:t||[a],caller:g,from:u||a}})}),config:pe(c.pluginName,d,f),plugins:d})).then(function(e){e=D(e)?e:{};return Promise.resolve(U({},t,e))})}return t}var o,a,u})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){t[s]=e}):void(t[s]=i);return n&&n.then?n.then(e):e()})}catch(e){return Promise.reject(e)}},Promise.resolve({}))).then(function(u){return Promise.resolve(r.exact.reduce(function(e,t,n){try{var i=r.exact.length===n+1,o=t.pluginName,a=f[o];return Promise.resolve(e).then(function(n){var r=u[o]||{};if(ye(r=s?n:r,o))return de({data:r,method:g,instance:l,pluginName:o,store:c}),Promise.resolve(n);if(ye(n,o))return i&&de({data:n,method:g,instance:l,store:c}),Promise.resolve(n);if(v.hasOwnProperty(o)&&!0===v[o])return c.dispatch({type:"queue",plugin:o,payload:r,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(n);var e=y(u[o],f[o]);return Promise.resolve(a[g]({abort:e.abort,payload:r,instance:l,config:pe(o,d,f),plugins:d})).then(function(e){var e=D(e)?e:{},e=U({},n,e),t=u[o];return ye(t,o)?de({data:t,method:g,instance:l,pluginName:o,store:c}):((t=g+":"+o).match(/:/g)||[]).length<2&&!g.match(le)&&!g.match(fe)&&l.dispatch(U({},s?e:r,{type:t,_:{called:t,from:"submethod"}})),Promise.resolve(e)})})}catch(e){return Promise.reject(e)}},Promise.resolve(i))).then(function(e){if(!(g.match(z)||g.match(/^registerPlugin/)||g.match(fe)||g.match(le)||g.match(/^params/)||g.match(/^userIdChanged/))){if(o.plugins.includes(g),e._&&e._.originalAction===g)return e;var t=U({},e,{_:{originalAction:e.type,called:e.type,from:"engineEnd"}});ve(e,r.exact.length)&&!g.match(/End$/)&&(t=U({},t,{type:e.type+"Aborted"})),c.dispatch(t)}return e})})}catch(e){return Promise.reject(e)}}var z=/Start$/,le=/^bootstrap/,fe=/^ready/;function de(e){var t=e.pluginName,t=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(U({},e.data,{type:t,_:{called:t,from:"abort"}}))}function pe(e,t,n){t=t[e]||n[e];return t&&t.config?t.config:{}}function ge(n,e){return e.reduce(function(e,t){return t[n]?e.concat({methodName:n,pluginName:t.name,method:t[n]}):e},[])}function me(e,t){var n=e.replace(z,""),t=t?":"+t:"";return[e+t,n+t,n+"End"+t]}function ye(e,t){e=e.abort;return e&&(!0===e||be(e,t)||e&&be(e.plugins,t))}function ve(e,t){e=e.abort;if(e){if(!0===e||H(e))return 1;var n=e.plugins;return he(e)&&e.length===t||he(n)&&n.length===t}}function he(e){return Array.isArray(e)}function be(e,t){return!(!e||!he(e))&&e.includes(t)}function Ie(e){e=e.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function we(y,v,h){var b={};return function(m){return function(g){return function(e){try{var t,n,r,l,i,o,a,u,f=function(e){return t?e:g(p)},c=e.type,d=e.plugins,p=e;if(e.abort)return Promise.resolve(g(e));c===B.enablePlugin&&m.dispatch({type:B.initializeStart,plugins:d,disabled:[],fromEnable:!0,meta:e.meta}),c===B.disablePlugin&&setTimeout(function(){return A(e.meta.rid,{payload:e})},0),c===B.initializeEnd&&(n=v(),l=(r=Object.keys(n)).filter(function(e){return d.includes(e)}).map(function(e){return n[e]}),i=[],o=[],a=e.disabled,u=l.map(function(t){var e=t.loaded,n=t.name,r=t.config;return function r(i,o,a){return new Promise(function(t,n){return o()?t(i):a<1?n(U({},i,{queue:!0})):new Promise(function(e){return setTimeout(e,10)}).then(function(e){return r(i,o,a-10).then(t,n)})})}(t,function(){return e({config:r})},1e4).then(function(e){return b[n]||(m.dispatch({type:B.pluginReadyType(n),name:n,events:Object.keys(t).filter(function(e){return!ie.includes(e)})}),b[n]=!0),i=i.concat(n),t}).catch(function(e){if(e instanceof Error)throw new Error(e);return o=o.concat(e.name),e})}),Promise.all(u).then(function(e){var t={plugins:i,failed:o,disabled:a};setTimeout(function(){r.length===u.length+a.length&&m.dispatch(U({},{type:B.ready},t))},0)}));var s=function(){if(c!==B.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){var c,s,n,l,f,e,d,p,g;c=m,s=y,l={},f=v(),e=c.getState(),d=e.plugins,p=e.queue,g=e.user,!e.context.offline&&p&&p.actions&&p.actions.length&&((n=p.actions.reduce(function(e,t,n){return d[t.plugin].loaded?(e.process.push(t),e.processIndex.push(n)):(e.requeue.push(t),e.requeueIndex.push(n)),e},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(e){var t,n,r,i,e=p.actions[e],o=e.plugin,a=e.payload.type,u=f[o][a];u&&C(u)&&(void 0===(r=e.payload)&&(r={}),void 0===(i=g)&&(i={}),e=[$,ne].reduce(function(e,t){return r.hasOwnProperty(t)&&i[t]&&i[t]!==r[t]&&(e[t]=i[t]),e},r),!(n=l[e.meta.rid])&&(t=u({payload:e,config:d[o].config,instance:s,abort:T}))&&D(t)&&t.abort?l[e.meta.rid]=!0:n||c.dispatch(U({},e,{type:u=a+":"+o,_:{called:u,from:"queueDrain"}})))}),e=p.actions.filter(function(e,t){return!~n.processIndex.indexOf(t)}),p.actions=e))},0),Promise.resolve(function(n,e,i,l,f){try{var o=C(e)?e():e,a=n.type,d=a.replace(z,"");if(n._&&n._.called)return Promise.resolve(n);var u=i.getState(),p=(y=o,void 0===(r=u.plugins)&&(r={}),void 0===(v=n.options)&&(v={}),Object.keys(y).filter(function(e){var t=v.plugins||{};return I(t[e])?t[e]:!1!==t.all&&(!r[e]||!1!==r[e].enabled)}).map(function(e){return y[e]})),g=(p=a===B.initializeStart&&n.fromEnable?Object.keys(u.plugins).filter(function(e){var t=u.plugins[e];return n.plugins.includes(e)&&!t.initialized}).map(function(e){return o[e]}):p).map(function(e){return e.name}),c=(s=p,t=me(m=a).map(function(e){return ge(e,s)}),s.reduce(function(e,t){var t=t.name,n=me(m,t).map(function(e){return ge(e,s)}),r=n[0],i=n[1],n=n[2];return r.length&&(e.beforeNS[t]=r),i.length&&(e.duringNS[t]=i),n.length&&(e.afterNS[t]=n),e},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}}));return Promise.resolve(M({action:n,data:{exact:c.before,namespaced:c.beforeNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(t){function e(){var e=function(){if(a.match(z))return Promise.resolve(M({action:U({},n,{type:d+"End"}),data:{exact:c.after,namespaced:c.afterNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){e.meta&&e.meta.hasCallback&&A(e.meta.rid,{payload:e})})}();return e&&e.then?e.then(function(){return t}):t}if(ve(t,g.length))return t;var n,r=a!==d?Promise.resolve(M({action:U({},t,{type:d}),data:{exact:c.during,namespaced:c.duringNS},state:u,allPlugins:o,allMatches:c,instance:i,store:l,EVENTS:f})).then(function(e){n=e}):void(n=t);return r&&r.then?r.then(e):e()})}catch(n){return Promise.reject(n)}var m,s,t,y,r,v}(e,v,y,m,h)).then(function(e){return t=1,g(e)})}();return Promise.resolve(s&&s.then?s.then(f):f(s))}catch(e){return Promise.reject(e)}}}}}var Se=function(){var a=this;this.before=[],this.after=[],this.addMiddleware=function(e,t){a[t]=a[t].concat(e)},this.removeMiddleware=function(t,e){var n=a[e].findIndex(function(e){return e===t});-1!==n&&(a[e]=[].concat(a[e].slice(0,n),a[e].slice(n+1)))},this.dynamicMiddlewares=function(o){return function(i){return function(r){return function(e){var t={getState:i.getState,dispatch:function(e){return i.dispatch(e)}},n=a[o].map(function(e){return e(t)});return ee.apply(void 0,n)(r)(e)}}}}};function Pe(e,t){return e.substring(t.length+1,e.length)}function Ee(e,n,r){return e.reduce(function(e,t){return e[t]=U({},r[t],{enabled:n}),e},r)}function Oe(e){try{return JSON.parse(JSON.stringify(e))}catch(e){}return e}var xe={last:{},history:[]};function je(e,t){void 0===e&&(e=xe);var n=t.options,r=t.meta;return t.type===B.track?(t=Oe(U({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r})),U({},e,{last:t,history:e.history.concat(t)})):e}var Ne={actions:[]};function _e(e,t){void 0===e&&(e=Ne);var n=t.payload;switch(t.type){case"queue":var r=n&&n.type&&n.type===B.identify?[t].concat(e.actions):e.actions.concat(t);return U({},e,{actions:r});case"dequeue":return[];default:return e}}var ke=/#.*$/;var Ae=function(e){if(void 0===e&&(e={}),!F)return e;var t,n=document,r=n.title,n=n.referrer,i=window,o=i.location,a=i.innerWidth,i=i.innerHeight,u=o.hash,o=o.search,c=(t=o,(c=function(){if(F)for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}())?c.match(/\?/)?c:c+t:window.location.href.replace(ke,"")),r={title:r,url:c,path:"/"+((t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t=c))&&t[3]?t[3].split("?")[0].replace(ke,""):""),hash:u,search:o,width:a,height:i};return n&&""!==n&&(r.referrer=n),U({},r,e)},Te={last:{},history:[]};function Me(e,t){void 0===e&&(e=Te);var n=t.options;return t.type===B.page?(t=Oe(U({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n})),U({},e,{last:t,history:e.history.concat(t)})):e}var i={},ze={initialized:!1,sessionId:W(),app:null,version:null,debug:!1,offline:!!F&&!navigator.onLine,os:{name:"na"},userAgent:F?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.15"},timezone:void 0,locale:void 0,campaign:{},referrer:i};function Ce(e,t){var n=(e=void 0===e?ze:e).initialized,r=t.campaign;switch(t.type){case B.campaign:return U({},e,{campaign:r});case B.offline:return U({},e,{offline:!0});case B.online:return U({},e,{offline:!1});default:return n?e:U({},ze,e,{initialized:!0})}}var De=["plugins","reducers","storage"];function Ue(){return K("analytics",[]),function(i){return function(e,t,n){var e=i(e,t,n),r=e.dispatch;return Object.assign(e,{dispatch:function(e){return E[P].analytics.push(e.action||e),r(e)}})}}}function qe(){return function(){return ee(ee.apply(null,arguments),Ue())}}function Re(e){return e?"array"===p(e)?e:[e]:[]}function Ve(e,t,n){void 0===e&&(e={});var r,i,o=W();return t&&(k[o]=(r=t,i=function(e){for(var t,n=e||Array.prototype.slice.call(arguments),r=0;r<n.length;r++)if(C(n[r])){t=n[r];break}return t}(n),function(e){i&&i(e),r(e)})),U({},e,{rid:o,ts:(new Date).getTime()},t?{hasCallback:!0}:{})}function Le(e){function o(){return u}function c(){throw new Error("Abort disabled inListener")}var d,p,g,m,y,v,h,b,I,w=(e=void 0===e?{}:e).reducers||{},S=e.initialUser||{},a=(e.plugins||[]).reduce(function(e,n){if(C(n))return e.middlewares=e.middlewares.concat(n),e;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error("https://lytics.dev/errors/1");n.config||(n.config={});var t=n.EVENTS?Object.keys(n.EVENTS).map(function(e){return n.EVENTS[e]}):[],t=(e.pluginEnabled[n.name]=!(!1===n.enabled||!1===n.config.enabled),delete n.enabled,n.methods&&(e.methods[n.name]=Object.keys(n.methods).reduce(function(e,t){var r;return e[t]=(r=n.methods[t],function(){for(var e=Array.prototype.slice.call(arguments),t=new Array(r.length),n=0;n<e.length;n++)t[n]=e[n];return t[t.length]=l,r.apply({instance:l},t)}),e},{}),delete n.methods),Object.keys(n).concat(t)),t=new Set(e.events.concat(t));if(e.events=Array.from(t),e.pluginsArray=e.pluginsArray.concat(n),e.plugins[n.name])throw new Error(n.name+"AlreadyLoaded");return e.plugins[n.name]=n,e.plugins[n.name].loaded||(e.plugins[n.name].loaded=function(){return!0}),e},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),t=e.storage||{getItem:G,setItem:K,removeItem:Q},s=(d=t,function(e,t,n){return t.getState("user")[e]||(n&&D(n)&&n[e]?n[e]:ce(d)[e]||G(se(e))||null)}),u=a.plugins,P=a.events.filter(function(e){return!ie.includes(e)}).sort(),n=new Set(P.concat(re).filter(function(e){return!ie.includes(e)})),n=Array.from(n).sort(),r=new Se,E=r.addMiddleware,O=r.removeMiddleware,r=r.dynamicMiddlewares,i=function(e){for(var t,l=e?(e=e.match(/\?(.*)/))&&e[1]?e[1].split("#")[0]:"":F&&window.location.search.substring(1),n=Object.create(null),f=/([^&=]+)=?([^&]*)/g;o=f.exec(l);){var r,i=X(o[1]),o=X(o[2]);"[]"===i.substring(i.length-2)?(r=n[i=i.substring(0,i.length-2)]||(n[i]=[]),n[i]=Array.isArray(r)?r:[],n[i].push(o)):n[i]=""===o||o}for(t in n){var d=t.split("[");if(1<d.length){{a=void 0;u=void 0;p=void 0;g=void 0;c=void 0;s=void 0;var a=n;var u=d.map(function(e){return e.replace(/[?[\]\\ ]/g,"")});var p=n[t];for(var g=u.length-1,c=0;c<g;++c){var s=u[c];if("__proto__"===s||"constructor"===s)break;s in a||(a[s]={}),a=a[s]}a[u[g]]=p}delete n[t]}}return n}(),x=ce(t),j=U({},x,S,i.an_uid?{userId:i.an_uid}:{},i.an_aid?{anonymousId:i.an_aid}:{}),N=(j.anonymousId||(j.anonymousId=W()),U({enable:function(t,n){return new Promise(function(e){f.dispatch({type:B.enablePlugin,plugins:Re(t),_:{originalAction:B.enablePlugin}},e,[n])})},disable:function(t,n){return new Promise(function(e){f.dispatch({type:B.disablePlugin,plugins:Re(t),_:{originalAction:B.disablePlugin}},e,[n])})}},a.methods)),_=!1,l={identify:function(e,t,n,r){try{var i=H(e)?e:null,o=D(e)?e:t,a=n||{},u=l.user(),c=(K(se($),i),i||o.userId||s($,l,o));return Promise.resolve(new Promise(function(e){f.dispatch(U({type:B.identifyStart,userId:c,traits:o||{},options:a,anonymousId:u.anonymousId},u.id&&u.id!==i&&{previousId:u.id}),e,[t,n,r])}))}catch(e){return Promise.reject(e)}},track:function(e,t,n,r){try{var i=D(e)?e.event:e;if(!i||!H(i))throw new Error("EventMissing");var o=D(e)?e:t||{},a=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.trackStart,event:i,properties:o,options:a,userId:s($,l,t),anonymousId:s(ne,l,t)},e,[t,n,r])}))}catch(e){return Promise.reject(e)}},page:function(t,n,r){try{var i=D(t)?t:{},o=D(n)?n:{};return Promise.resolve(new Promise(function(e){f.dispatch({type:B.pageStart,properties:Ae(i),options:o,userId:s($,l,i),anonymousId:s(ne,l,i)},e,[t,n,r])}))}catch(t){return Promise.reject(t)}},user:function(e){if(e===$||"id"===e)return s($,l);if(e===ne||"anonId"===e)return s(ne,l);var t=l.getState("user");return e?J(t,e):t},reset:function(t){return new Promise(function(e){f.dispatch({type:B.resetStart},e,t)})},ready:function(t){return _&&t({plugins:N,instance:l}),l.on(B.ready,function(e){t(e),_=!0})},on:function(n,r){if(!n||!C(r))return!1;if(n===B.bootstrap)throw new Error(".on disabled for "+n);var e,t,i=/Start$|Start:/;if("*"===n)return t=function(e){return function(t){return function(e){return e.type.match(i)||r({payload:e,instance:l,plugins:u}),t(e)}}},E(e=function(e){return function(t){return function(e){return e.type.match(i)&&r({payload:e,instance:l,plugins:u}),t(e)}}},$e),E(t,Be),function(){O(e,$e),O(t,Be)};function o(e){return function(t){return function(e){return e.type===n&&r({payload:e,instance:l,plugins:u,abort:c}),t(e)}}}var a=n.match(i)?$e:Be;return E(o,a),function(){return O(o,a)}},once:function(e,t){if(!e||!C(t))return!1;if(e===B.bootstrap)throw new Error(".once disabled for "+e);var n=l.on(e,function(e){t({payload:e.payload,instance:l,plugins:u,abort:c}),n()});return n},getState:function(e){var t=f.getState();return e?J(t,e):Object.assign({},t)},dispatch:function(e){var t=H(e)?{type:e}:e;if(re.includes(t.type))throw new Error("reserved action "+t.type);t=U({},t,{_:U({originalAction:t.type},e._||{})});f.dispatch(t)},enablePlugin:N.enable,disablePlugin:N.disable,plugins:N,storage:{getItem:t.getItem,setItem:function(e,t,n){f.dispatch({type:B.setItemStart,key:e,value:t,options:n})},removeItem:function(e,t){f.dispatch({type:B.removeItemStart,key:e,options:t})}},setAnonymousId:function(e,t){l.storage.setItem(V,e,t)},events:{core:re,plugins:P}},P=a.middlewares.concat([function(e){return function(t){return function(e){return e.meta||(e.meta=Ve()),t(e)}}},r($e),we(l,o,{all:n,plugins:P}),(I=t,function(e){return function(o){return function(e){var t=e.type,n=e.key,r=e.value,i=e.options;if(t===B.setItem||t===B.removeItem){if(e.abort)return o(e);t===B.setItem?I.setItem(n,r,i):I.removeItem(n,i)}return o(e)}}}),(b=(h=l).storage.setItem,function(l){return function(s){return function(e){var r,t,n,i,o,a,u,c;return e.type===B.bootstrap&&(r=e.params,o=e.user,t=e.persistedUser,n=e.initialUser,i=t.userId===o.userId,t.anonymousId!==o.anonymousId&&b(V,o.anonymousId),i||b(L,o.userId),n.traits&&b(te,U({},i&&t.traits?t.traits:{},n.traits)),(o=Object.keys(e.params)).length&&(a=r.an_uid,u=r.an_event,c=o.reduce(function(e,t){var n;return(t.match(oe)||t.match(/^(d|g)clid/))&&(n=t.replace(oe,""),e.campaign["campaign"===n?"name":n]=r[t]),t.match(ae)&&(e.props[t.replace(ae,"")]=r[t]),t.match(ue)&&(e.traits[t.replace(ue,"")]=r[t]),e},{campaign:{},props:{},traits:{}}),l.dispatch(U({type:B.params,raw:r},c,a?{userId:a}:{})),a&&setTimeout(function(){return h.identify(a,c.traits)},0),u&&setTimeout(function(){return h.track(u,c.props)},0),Object.keys(c.campaign).length&&l.dispatch({type:B.campaign,campaign:c.campaign}))),s(e)}}}),(m=(n=(n=l).storage).setItem,y=n.removeItem,v=n.getItem,function(u){return function(a){return function(e){var t,n,r=e.userId,i=e.traits,o=e.options;return e.type===B.reset&&([L,te,V].forEach(function(e){y(e)}),[$,ne,"traits"].forEach(function(e){Q(se(e))})),e.type===B.identify&&(v(V)||m(V,W()),t=v(L),n=v(te)||{},t&&t!==r&&u.dispatch({type:B.userIdChanged,old:{userId:t,traits:n},new:{userId:r,traits:i},options:o}),r&&m(L,r),i&&m(te,U({},n,i))),a(e)}}}),r(Be)]),n={context:Ce,user:(g=t,function(e,t){if(void 0===e&&(e={}),(t=void 0===t?{}:t).type===B.setItemEnd){if(t.key===V)return U({},e,{anonymousId:t.value});if(t.key===L)return U({},e,{userId:t.value})}switch(t.type){case B.identify:return Object.assign({},e,{userId:t.userId,traits:U({},e.traits,t.traits)});case B.reset:return[L,V,te].forEach(function(e){g.removeItem(e)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}),page:Me,track:je,plugins:(p=o,function(e,t){void 0===e&&(e={});var n={};if("initialize:aborted"===t.type)return e;if(/^registerPlugin:([^:]*)$/.test(t.type)){var r=Pe(t.type,"registerPlugin"),i=p()[r];if(!i||!r)return e;var o=t.enabled,a=i.config;return n[r]={enabled:o,initialized:!!o&&Boolean(!i.initialize),loaded:!!o&&Boolean(i.loaded({config:a})),config:a},U({},e,n)}if(/^initialize:([^:]*)$/.test(t.type))return r=Pe(t.type,B.initialize),(o=p()[r])&&r?(n[r]=U({},e[r],{initialized:!0,loaded:Boolean(o.loaded({config:o.config}))}),U({},e,n)):e;if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=U({},e[t.name],{loaded:!0}),U({},e,n);switch(t.type){case B.disablePlugin:return U({},e,Ee(t.plugins,!1,e));case B.enablePlugin:return U({},e,Ee(t.plugins,!0,e));default:return e}}),queue:_e},r=ee,t=ee;F&&e.debug&&((T=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(r=T({trace:!0,traceLimit:25})),t=function(){return 0===arguments.length?Ue():D(typeof arguments[0])?qe():qe().apply(null,arguments)});A=e;var k,A,T=Object.keys(A).reduce(function(e,t){return De.includes(t)||(e[t]=A[t]),e},{}),e={context:T,user:j,plugins:a.pluginsArray.reduce(function(e,t){var n=t.name,r=t.config,i=t.loaded,o=a.pluginEnabled[n];return e[n]={enabled:o,initialized:!!o&&Boolean(!t.initialize),loaded:Boolean(i({config:r})),config:r},e},{})},f=Z(function(e){for(var t=Object.keys(e),l={},n=0;n<t.length;n++){var r=t[n];typeof e[r]===q&&(l[r]=e[r])}var f,i,d=Object.keys(l);try{i=l,Object.keys(i).forEach(function(e){var t=i[e];if(typeof t(void 0,{type:"@@redux/INIT"})===R||typeof t(void 0,{type:Y})===R)throw new Error("reducer "+e+" "+R)})}catch(e){f=e}return function(e,t){if(void 0===e&&(e={}),f)throw f;for(var n,r=!1,i={},o=0;o<d.length;o++){var a,u=d[o],c=e[u],s=(0,l[u])(c,t);if(typeof s===R)throw n=u,a="action "+((a=(a=t)&&a.type)&&a.toString()||"?")+"reducer "+n+" returns "+R,new Error(a);i[u]=s,r=r||s!==c}return r?i:e}}(U({},n,w)),e,t(r(function(){var a=arguments;return function(o){return function(e,t,n){var e=o(e,t,n),r=e.dispatch,i={getState:e.getState,dispatch:function(e){return r(e)}},t=[].slice.call(a).map(function(e){return e(i)});return U({},e,{dispatch:r=ee.apply(void 0,t)(e.dispatch)})}}}.apply(void 0,P)))),n=(f.dispatch=(k=f.dispatch,function(e,t,n){e=U({},e,{meta:Ve(e.meta,t,Re(n))});return k.apply(null,[e])}),Object.keys(u)),M=(f.dispatch({type:B.bootstrap,plugins:n,config:T,params:i,user:j,initialUser:S,persistedUser:x}),n.filter(function(e){return a.pluginEnabled[e]})),z=n.filter(function(e){return!a.pluginEnabled[e]});return f.dispatch({type:B.registerPlugins,plugins:n,enabled:a.pluginEnabled}),a.pluginsArray.map(function(e,t){var n=e.bootstrap,r=e.config,i=e.name;n&&C(n)&&n({instance:l,config:r,payload:e}),f.dispatch({type:B.registerPluginType(i),name:i,enabled:a.pluginEnabled[i],plugin:e}),a.pluginsArray.length===t+1&&f.dispatch({type:B.initializeStart,plugins:M,disabled:z})}),l}var $e="before",Be="after",Je="cookie",Fe=Ge(),He=Ke,Xe=Ke;function We(e){return Fe?Ke(e,"",-1):Q(e)}function Ge(){if(void 0!==Fe)return Fe;var e="cookiecookie";try{Ke(e,e),Fe=-1!==document.cookie.indexOf(e),We(e)}catch(e){Fe=!1}return Fe}function Ke(e,t,n,r,i,o){var a;if("undefined"!=typeof window)return a=1<arguments.length,!1===Fe&&(a?K(e,t):G(e)),a?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}var Qe="localStorage",i=j.bind(null,"localStorage"),Ye=(O("localStorage","getItem",G),O("localStorage","setItem",K),O("localStorage","removeItem",Q),"sessionStorage"),Ze=j.bind(null,"sessionStorage");function et(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(D(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}O("sessionStorage","getItem",G),O("sessionStorage","setItem",K),O("sessionStorage","removeItem",Q);var tt=i(),nt=Ze(),rt=Ge();function it(e,t){if(e){var t=ot(t),n=!st(t),r=at(t)?et(localStorage.getItem(e)):void 0;if(n&&!m(r))return r;var i=ut(t)?et(He(e)):void 0;if(n&&i)return i;t=ct(t)?et(sessionStorage.getItem(e)):void 0;if(n&&t)return t;e=G(e);return n?e:{localStorage:r,sessionStorage:t,cookie:i,global:e}}}function ot(e){return e?H(e)?e:e.storage:o}function at(e){return tt&&lt(e,Qe)}function ut(e){return rt&&lt(e,Je)}function ct(e){return nt&&lt(e,Ye)}function st(e){return e===a||"all"===e}function lt(e,t){return e===o||e===t||st(e)}function ft(e,t,n){return{location:e,current:t,previous:n}}var dt={setItem:function(e,t,n){var r,i,o;if(e&&!m(t))return r={},n=ot(n),i=JSON.stringify(t),o=!st(n),at(n)&&(r[Qe]=ft(Qe,t,et(localStorage.getItem(e))),localStorage.setItem(e,i),o)?r[Qe]:ut(n)&&(r[Je]=ft(Je,t,et(He(e))),Xe(e,i),o)?r[Je]:ct(n)&&(r[Ye]=ft(Ye,t,et(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?r[Ye]:(r[S]=ft(S,t,G(e)),K(e,t),o?r[S]:r)},getItem:it,removeItem:function(e,t){var n,r;if(e)return t=ot(t),n=it(e,a),r={},!m(n.localStorage)&&at(t)&&(localStorage.removeItem(e),r[Qe]=n.localStorage),!m(n.cookie)&&ut(t)&&(We(e),r[Je]=n.cookie),!m(n.sessionStorage)&&ct(t)&&(sessionStorage.removeItem(e),r[Ye]=n.sessionStorage),!m(n.global)&&lt(t,S)&&(Q(e),r[S]=n.global),r}};function pt(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Le(n(n({},{storage:dt}),e))}return e.Analytics=pt,e.CONSTANTS=c,e.EVENTS=B,e.default=pt,e.init=pt,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
{
"name": "analytics",
"version": "0.8.14",
"version": "0.8.15",
"description": "Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system.",

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

"dependencies": {
"@analytics/core": "^0.12.15",
"@analytics/core": "^0.12.16",
"@analytics/storage-utils": "^0.4.2"

@@ -95,3 +95,3 @@ },

},
"gitHead": "a6c46a380a929727db44a6041960823ce00b5150"
"gitHead": "a9e0fdc6c9c264228a4a14ef8a1a2153f7a5b736"
}
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