Comparing version 0.6.7 to 0.7.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.7.0](https://github.com/DavidWells/analytics/compare/analytics@0.6.7...analytics@0.7.0) (2021-01-26) | ||
### Features | ||
* add AWS pinpoint ([909c950](https://github.com/DavidWells/analytics/commit/909c950)) | ||
## [0.6.7](https://github.com/DavidWells/analytics/compare/analytics@0.6.6...analytics@0.6.7) (2021-01-20) | ||
@@ -8,0 +19,0 @@ |
@@ -1,1 +0,1 @@ | ||
var _analytics=function(t){"use strict";var r=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function o(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e};function J(t,e,n,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:o;return t===o?n:t}function n(t,e,n,r,o,i){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=t+"="+encodeURIComponent(e)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var u=n,c=n;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==i(n)&&(n=parseFloat(n))}catch(t){n=e}return n}var X="object"===("undefined"==typeof self?"undefined":i(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global.global===global&&global||void 0,l="localStorage",f="cookie",p="global",a=!1,d=function(){try{n("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return n("_c_","",-1),t}catch(t){return!1}}();function h(t){return"string"==typeof t?t:t.storage}function y(t){return a&&(!t||t===l)}function g(t){return d&&(!t||t===f)}var m={getItem:function(t){if(!t)return null;var e,n=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});if("all"===n)return{cookie:s(u(e=t)),localStorage:s(localStorage.getItem(e)),global:X[e]||null};if(y(n)){var r=localStorage.getItem(t);if(r||n===l)return s(r)}if(g(n)){var o=u(t);if(o||n===f)return s(o)}return X[t]||null},setItem:function(t,e){if(!t||!e)return!1;var n=h(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),r=JSON.stringify(e);if(y(n)){var o=s(localStorage.getItem(t));return localStorage.setItem(t,r),{value:e,oldValue:o,location:l}}if(g(n)){var i=s(u(t));return c(t,r),{value:e,oldValue:i,location:f}}var a=X[t];return{value:X[t]=e,oldValue:a,location:p}},removeItem:function(t){if(!t)return!1;var e=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return y(e)?(localStorage.removeItem(t),l):g(e)?(n(t,"",-1),f):(X[t]=void 0,p)}};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Y(t){return"function"==typeof t}function H(t){return"string"==typeof t}function W(t){if("object"===v(t)&&null!==t){for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}}function b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var K="undefined"!=typeof document;function Q(t){return function(t){var e,n={},r=/([^&=]+)=?([^&]*)/g;for(;e=r.exec(t);){var o=b(e[1]),i=b(e[2]);"[]"===o.substring(o.length-2)?(o=o.substring(0,o.length-2),(n[o]||(n[o]=[])).push(i)):n[o]=""===i||i}for(var a in n){var u=a.split("[");1<u.length&&(function(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var i=e[o];i in t||(t[i]={}),t=t[i]}t[e[r]]=n}(n,u.map(function(t){return t.replace(/[?[\]\\ ]/g,"")}),n[a]),delete n[a])}return n}(function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return K&&window.location.search.substring(1)}(t))}function Z(){for(var t="",e=0,n=4294967295*Math.random()|0;e++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],o=15&n;t+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),n=e%8==0?4294967295*Math.random()|0:n>>4}return t}var w=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 x=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var S=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var tt=function(t){return w(t)||x(t)||S()};function E(t,e){return t(e={exports:{}},e.exports),e.exports}var et=E(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 O=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 I(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var nt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(n,!0).forEach(function(t){O(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},P="function",k="undefined",_="reducer",j="@@redux/",N=j+"INIT",A=j+Math.random().toString(36),T=function(){return("undefined"==typeof Symbol?"undefined":et(Symbol))===P&&Symbol.observable||"@@observable"}(),L=" != "+P;function rt(t,e,n){if(et(e)===P&&et(n)===k&&(n=e,e=void 0),et(n)!==k){if(et(n)!==P)throw new Error("enhancer"+L);return n(rt)(t,e)}if(et(t)!==P)throw new Error(_+L);var r=t,o=e,i=[],a=i,u=!1;function c(){a===i&&(a=i.slice())}function s(){return o}function l(e){if(et(e)!==P)throw new Error("Listener"+L);var n=!0;return c(),a.push(e),function(){var t;n&&(n=!1,c(),t=a.indexOf(e),a.splice(t,1))}}function f(t){if(!W(t))throw new Error("Act != obj");if(et(t.type)===k)throw new Error("ActType "+k);if(u)throw new Error("Dispatch in "+_);try{u=!0,o=r(o,t)}finally{u=!1}for(var e=i=a,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),O({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(et(t)!==P)throw new Error("next "+_+L);r=t,f({type:N})}},T,function(){var n=l;return O({subscribe:function(t){if("object"!==et(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(o)}return e(),{unsubscribe:n(e)}}},T,function(){return this})})}function ot(t){for(var e=Object.keys(t),y={},n=0;n<e.length;n++){var r=e[n];et(t[r])===P&&(y[r]=t[r])}var g,o,m=Object.keys(y);try{o=y,Object.keys(o).forEach(function(t){var e=o[t],n=e(void 0,{type:N});if(et(n)===k||et(e(void 0,{type:A}))===k)throw new Error(_+" "+t+" "+k)})}catch(t){g=t}return function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(g)throw g;for(var o,i,a,u=!1,c={},s=0;s<m.length;s++){var l=m[s],f=y[l],p=n[l],d=f(p,r);if(et(d)===k){var h=(o=l,a=void 0,"action "+((a=(i=r)&&i.type)&&a.toString()||"?")+_+" "+o+" returns "+k);throw new Error(h)}c[l]=d,u=u||d!==p}return u?c:n}}function it(){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 at=["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"],ut=["name","EVENTS","config","loaded"],ct=at.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var st="__anon_id",lt="__user_id",ft="__user_traits",z=Object.freeze({ANON_ID:st,USER_ID:lt,USER_TRAITS:ft}),pt=/^utm_/,dt=/^an_prop_/,ht=/^an_trait_/;var M="analytics",yt="userId",gt="anonymousId",mt="https://lytics.dev/errors/";function vt(t,e){return{userId:e.getItem(lt)||t.an_uid,anonymousId:e.getItem(st)||t.an_aid||Z(),traits:e.getItem(ft)||{}}}var bt=function(t){return"__TEMP__"+t};var D=E(function(t){var e=function(a){var f,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new k(r||[]);return s._invoke=(i=t,a=n,u=l,c=d,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw e;return j()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=function t(e,n){var r=e.iterator[n.method];if(r===f){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=f,t(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=p(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=f),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,u);if(r){if(r===m)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===d)throw c=g,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=y;var o=p(i,a,u);if("normal"===o.type){if(c=u.done?g:h,o.arg===m)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=g,u.method="throw",u.arg=o.arg)}}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var d="suspendedStart",h="suspendedYield",y="executing",g="completed",m={};function v(){}function c(){}function s(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(_([])));x&&x!==t&&l.call(x,o)&&(b=x);var S=s.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function O(c,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var i=p(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==typeof u&&l.call(u,"__await")?s.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=f,t.done=!0,t};return r.next=r}}return{next:j}}function j(){return{value:f,done:!0}}return((c.prototype=S.constructor=s).constructor=c).displayName=i(s,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,i(t,r,"GeneratorFunction")),t.prototype=Object.create(S),t},a.awrap=function(t){return{__await:t}},E(O.prototype),O.prototype[n]=function(){return this},a.AsyncIterator=O,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new O(u(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(S),i(S,r,"Generator"),S[o]=function(){return this},S.toString=function(){return"[object Generator]"},a.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}},a.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=f),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},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),m},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),P(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r,o=n.completion;return"throw"===o.type&&(r=o.arg,P(n)),r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=f),m}},a}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function q(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var R=function(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){q(r,e,n,o,i,"next",t)}function i(t){q(r,e,n,o,i,"throw",t)}o(void 0)})}},wt={};function V(t,e){wt[t]&&Y(wt[t])&&(wt[t](e),delete wt[t])}function C(o,i,a){return new Promise(function(e,n){return i()?e(o):a<1?n(nt(nt({},o),{},{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)}).then(function(t){return C(o,i,a-10).then(e,n)}));var r})}function F(u,t,c){var n,e,s=t(),r=u.getState(),l=r.plugins,o=r.context,f=r.queue,p=r.user;!o.offline&&f&&f.actions&&f.actions.length&&((n=f.actions.reduce(function(t,e,n){return l[e.plugin].loaded?(t.process.push(e),t.processIndex.push(n)):(t.requeue.push(e),t.requeueIndex.push(n)),t},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(t){var e,n,r=f.actions[t],o=r.plugin,i=r.payload.type,a=s[o][i];a&&Y(a)&&(a({payload:e=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[yt,gt].reduce(function(t,e){return function(t,e,n){if(t.hasOwnProperty(n)&&!t[n]&&e[n])return Object.assign({},t,O({},"".concat(n),e[n]));return t}(t,n,e)},t)}(r.payload,p),config:l[o].config,instance:c}),n="".concat(i,":").concat(o),u.dispatch(nt(nt({},e),{},{type:n,_:{called:n,from:"queueDrain"}})))}),e=f.actions.filter(function(t,e){return!~n.processIndex.indexOf(e)}),f.actions=e))}var G=function(t){if(Array.isArray(t))return t};var U=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n};var $=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var B=function(t,e){return G(t)||U(t,e)||$()};var xt=/Start$/,St=/^bootstrap/,Et=/^ready/;function Ot(){return(Ot=R(D.mark(function t(n,e,r,o,i){var a,u,c,s,l,f,p,d,h,y,g,m;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=Y(e)?e():e,u=n.type,c=u.replace(xt,""),n._&&n._.called)return t.abrupt("return",n);t.next=5;break;case 5:return s=r.getState(),l=function(e,t,n){var r=1<arguments.length&&void 0!==t?t:{},o=2<arguments.length&&void 0!==n?n:{};return Object.keys(e).filter(function(t){var e=o.plugins||{};return"boolean"==typeof e[t]?e[t]:!1!==e.all&&(!r[t]||!1!==r[t].enabled)}).map(function(t){return e[t]})}(a,s.plugins,n.options),u===ct.initializeStart&&n.fromEnable&&(l=Object.keys(s.plugins).filter(function(t){var e=s.plugins[t];return n.plugins.includes(t)&&!e.initialized}).map(function(t){return a[t]})),f=l.map(function(t){return t.name}),p=function(c,s){var t=Nt(c).map(function(t){return jt(t,s)});return s.reduce(function(t,e){var n=e.name,r=Nt(c,n).map(function(t){return jt(t,s)}),o=B(r,3),i=o[0],a=o[1],u=o[2];return i.length&&(t.beforeNS[n]=i),a.length&&(t.duringNS[n]=a),u.length&&(t.afterNS[n]=u),t},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}})}(u,l),t.next=12,It({action:n,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 12:if(Tt(d=t.sent,f.length))return t.abrupt("return",d);t.next=15;break;case 15:if(u!==c){t.next=19;break}h=d,t.next=22;break;case 19:return t.next=21,It({action:nt(nt({},d),{},{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 21:h=t.sent;case 22:if(u.match(xt))return y="".concat(c,"End"),t.next=26,It({action:nt(nt({},h),{},{type:y}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});t.next=29;break;case 26:g=t.sent,(m=function(r){return!!r.meta&&Object.keys(r.meta).reduce(function(t,e){var n=r.meta[e];return Y(n)?n:t},!1)}(g))&&m({payload:g});case 29:return t.abrupt("return",d);case 30:case"end":return t.stop()}},t)}))).apply(this,arguments)}function It(){return Pt.apply(this,arguments)}function Pt(){return(Pt=R(D.mark(function t(e){var g,a,m,n,v,r,b,o,w,i,x,S,u,E,O,I,c,s;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return g=e.data,a=e.action,m=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,i=n.context,x=a.type,S=x.match(xt),u=g.exact.map(function(t){return t.pluginName}),S&&(u=r.during.map(function(t){return t.pluginName})),E=function(y,g){return function(t,e,n){var r=e.config,o=e.name,i="".concat(o,".").concat(t.type);n&&(i=n.event);var a,u,c,s,l,f,p,d,h=t.type.match(xt)?(c=o,s=i,l=g,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&Lt(e)?e:l;if(f&&(!(r=e&&Lt(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 nt(nt({},p),{},{abort:{reason:t,plugins:r,caller:s,_:n}})}):(a=t,u=i,function(){throw new Error(a.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(W(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:y,config:r||{},abort:h}}}(m,u),O=g.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,o=!1;return r.match(/^initialize/)||r.match(/^reset/)||(o=!w[n].loaded),i.offline&&r.match(/^(page|track|identify)/)&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,g.exact.reduce(function(){var r=R(D.mark(function t(e,n,r){var c,o,i;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(o=t.sent,g.namespaced&&g.namespaced[c])return t.next=7,g.namespaced[c].reduce(function(){var r=R(D.mark(function t(e,n,r){var o,i,a,u;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=function(r,o,i){return function(t,e){var n=i||o;return nt(nt({},r),{},{abort:{reason:t,plugins:e||[o],caller:x,from:n}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&Y(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return function(t,e){var n=Mt(t);if(n&&n.name===e){var r=Mt(n.method),o=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call self","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:m,abort:i(o,c,n.pluginName),config:_t(n.pluginName,w,v),plugins:w});case 9:return a=t.sent,u=W(a)?a:{},t.abrupt("return",Promise.resolve(nt(nt({},o),u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));t.next=11;break;case 7:i=t.sent,o[c]=i,t.next=12;break;case 11:o[c]=a;case 12:return t.abrupt("return",Promise.resolve(o));case 13:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve({}));case 10:return I=t.sent,t.next=13,g.exact.reduce(function(){var r=R(D.mark(function t(e,n,r){var o,i,a,u,c,s,l,f,p,d,h,y;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=g.exact.length===r+1,i=n.pluginName,a=v[i],t.next=5,e;case 5:if(u=t.sent,c=I[i]?I[i]:{},S&&(c=u),At(c,i))return kt({data:c,method:x,instance:m,pluginName:i,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(At(u,i))return o&&kt({data:u,method:x,instance:m,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(O.hasOwnProperty(i)&&!0===O[i])return b.dispatch({type:"queue",plugin:i,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=E(I[i],v[i]),t.next=20,a[x]({abort:s.abort,payload:c,instance:m,config:_t(i,w,v),plugins:w});case 20:return l=t.sent,f=W(l)?l:{},p=nt(nt({},u),f),At(d=I[i],i)?kt({data:d,method:x,instance:m,pluginName:i,store:b}):(h="".concat(x,":").concat(i),(h.match(/:/g)||[]).length<2&&!x.match(St)&&!x.match(Et)&&(y=S?p:c,m.dispatch(nt(nt({},y),{},{type:h,_:{called:h,from:"submethod"}})))),t.abrupt("return",Promise.resolve(p));case 26:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));case 13:if(c=t.sent,x.match(xt)||x.match(/^registerPlugin/)||x.match(Et)||x.match(St)||x.match(/^params/)||x.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(x),c._&&c._.originalAction===x)return t.abrupt("return",c);t.next=18;break;case 18:s=nt(nt({},c),{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Tt(c,g.exact.length)&&!x.match(/End$/)&&(s=nt(nt({},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 kt(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=n+"Aborted"+(r?":"+r:"");t.store.dispatch(nt(nt({},e),{},{type:o,_:{called:o,from:"abort"}}))}function _t(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function jt(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Nt(t,e){var n=t.replace(xt,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function At(t,e){var n=t.abort;return n&&(!0===n||(zt(n,e)||n&&zt(n.plugins,e)))}function Tt(t,e){var n=t.abort;if(n){if(!0===n||H(n))return 1;var r=n.plugins;return Lt(n)&&n.length===e||Lt(r)&&r.length===e}}function Lt(t){return Array.isArray(t)}function zt(t,e){return!(!t||!Lt(t))&&t.includes(e)}function Mt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Dt(g,m,v){var b={};return function(y){return function(h){return function(){var e=R(D.mark(function t(n){var e,r,o,i,a,u,c,s,l,f,p,d;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.type,r=n.abort,o=n.plugins,i=n,r)return t.abrupt("return",h(n));t.next=4;break;case 4:if(e===ct.enablePlugin&&y.dispatch({type:ct.initializeStart,plugins:o,disabled:[],fromEnable:!0,ts:n.ts}),e===ct.disablePlugin&&setTimeout(function(){V(n.ts)},0),e===ct.initializeEnd&&(a=m(),u=Object.keys(a),c=u.filter(function(t){return o.includes(t)}).map(function(t){return a[t]}),s=[],l=[],f=n.disabled,p=c.map(function(e){var t=e.loaded,n=e.name;return C(e,t,1e4).then(function(t){return b[n]||(y.dispatch({type:ct.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!ut.includes(t)})}),b[n]=!0),s=s.concat(n),e}).catch(function(t){if(t instanceof Error)throw new Error(t);return l=l.concat(t.name),t})}),Promise.all(p).then(function(t){var e={plugins:s,failed:l,disabled:f};setTimeout(function(){u.length===p.length+f.length&&y.dispatch(nt(nt({},{type:ct.ready}),e)),V(n.ts,e)},0)})),e!==ct.bootstrap)return/^ready:([^:]*)$/.test(e)&&setTimeout(function(){return F(y,m,g)},0),t.next=11,function(t,e,n,r,o){return Ot.apply(this,arguments)}(n,m,g,y,v);t.next=13;break;case 11:return d=t.sent,t.abrupt("return",h(d));case 13:return t.abrupt("return",h(i));case 14:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()}}}function qt(){return(new Date).getTime()}var Rt,Vt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ct=function t(){var a=this;Vt(this,t),O(this,"before",[]),O(this,"after",[]),O(this,"addMiddleware",function(t,e){a[e]=a[e].concat(t)}),O(this,"removeMiddleware",function(e,t){var n=a[t].findIndex(function(t){return t===e});-1!==n&&(a[t]=[].concat(tt(a[t].slice(0,n)),tt(a[t].slice(n+1))))}),O(this,"dynamicMiddlewares",function(i){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=a[i].map(function(t){return t(e)});return it.apply(void 0,tt(n))(r)(t)}}}})};function Ft(t,e){return t.substring(e.length+1,t.length)}function Gt(t,n,r){return t.reduce(function(t,e){return t[e]=nt(nt({},r[e]),{enabled:n}),t},r)}var Ut={initialized:!(Rt={}),sessionId:Z(),app:null,version:null,debug:!1,offline:!!K&&!navigator.onLine,os:{name:"na"},userAgent:K?navigator.userAgent:"node",library:{name:M,version:"0.9.2"},timezone:void 0,locale:void 0,campaign:{},referrer:Rt};function $t(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Ut,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case ct.campaign:return nt(nt({},t),{campaign:o});case ct.offline:return nt(nt({},t),{offline:!0});case ct.online:return nt(nt({},t),{offline:!1});default:return n?t:nt(nt(nt({},Ut),t),{initialized:!0})}}var Bt=["plugins","reducers","storage"];function Jt(t){var e=t;try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e}var Xt=/#.*$/;function Yt(t){var e=function(){if(K)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 Ht=function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!K)return e;var n,r=document,o=r.title,i=r.referrer,a=window,u=a.location,c=a.innerWidth,s=a.innerHeight,l=u.hash,f=u.search,p=Yt(f),d={title:o,url:p,path:"/"+((n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(p))&&n[3]?n[3].split("?")[0].replace(Xt,""):""),hash:l,search:f,width:c,height:s};return i&&""!==i&&(d.referrer=i),nt(nt({},d),e)},Wt={last:{},history:[]};function Kt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Wt,e=1<arguments.length?arguments[1]:void 0,n=e.properties,r=e.options,o=e.meta;switch(e.type){case ct.page:var i=Jt(nt({properties:n,meta:o},Object.keys(r).length&&{options:r}));return nt(nt({},t),{last:i,history:t.history.concat(i)});default:return t}}var Qt={last:{},history:[]};function Zt(){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.meta,o=e.options,i=e.event,a=e.properties;switch(n){case ct.track:var u=Jt(nt(nt({event:i,properties:a},Object.keys(o).length&&{options:o}),{},{meta:r}));return nt(nt({},t),{last:u,history:t.history.concat(u)});default:return t}}var te={actions:[]};function ee(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:te,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload;switch(n){case"queue":var o=r&&r.type&&r.type===ct.identify?[e].concat(t.actions):t.actions.concat(e);return nt(nt({},t),{},{actions:o});case"dequeue":return[];default:return t}}function ne(){return Array.prototype.slice.call(arguments).reduce(function(t,e){return t||(Y(e)?e:t)},!1)}function re(){var a="__"+M+"__";return X[a]=[],function(i){return function(t,e,n){var r=i(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return X[a].push(e),o(t)}})}}}function oe(){return function(){return it(it.apply(null,arguments),re())}}function ie(t){return t?H(t)?[t]:t:[]}var ae=function(t,e,n){return{type:ct.setItemStart,timestamp:qt(),key:t,value:e,options:n}},ue=function(t,e){return{type:ct.removeItemStart,timestamp:qt(),key:t,options:e}};function ce(t){function e(){return S}function u(){throw new Error("Abort disabled in listener")}function l(e,n){return function(t){n&&n(t),e(t)}}var i,n,s,f,p,d,r,h,y,a,g,o,c,m=0<arguments.length&&void 0!==t?t:{},v=m.reducers||{},b=(m.plugins||[]).reduce(function(t,n){if(Y(n))return t.middlewares=t.middlewares.concat(n),t;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error(mt+"1");var e=n.EVENTS?Object.keys(n.EVENTS).map(function(t){return n.EVENTS[t]}):[],r=!(!1===n.enabled),o=!(n.config&&!1===n.config.enabled);t.pluginEnabled[n.name]=r&&o,delete n.enabled,n.methods&&(t.methods[n.name]=Object.keys(n.methods).reduce(function(t,e){var r;return t[e]=(r=n.methods[e],function(){var n=Array.prototype.slice.call(arguments),t=Array.apply(null,Array(r.length)).map(function(){}).map(function(t,e){if(n[e]||!1===n[e]||null===n[e])return n[e]}).concat(z);return r.apply({instance:z},t)}),t},{}),delete n.methods);var i=Object.keys(n).concat(e),a=new Set(t.events.concat(i));if(t.events=Array.from(a),t.pluginsArray=t.pluginsArray.concat(n),t.plugins[n.name])throw new Error(n.name+" already loaded");return t.plugins[n.name]=n,t.plugins[n.name].loaded||(t.plugins[n.name].loaded=function(){return!0}),t},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),w=m.storage?m.storage:{getItem:function(t){return X[t]},setItem:function(t,e){return X[t]=e},removeItem:function(t){return X[t]=void 0}},x=(i=w,function(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&W(n)&&n[t])return n[t];var o=vt({},i)[t];return o||(X[bt(t)]?X[bt(t)]:null)}),S=b.plugins,E=b.events.filter(function(t){return!ut.includes(t)}),O=new Set(E.concat(at).filter(function(t){return!ut.includes(t)})),I=Array.from(O).sort(),P=E.sort(),k=new Ct,_=k.addMiddleware,j=k.removeMiddleware,N=k.dynamicMiddlewares,A=Q(),T=vt(A,w),L=nt({enable:function(e,n){var r=Z();return new Promise(function(t){wt[r]=l(t,n),G.dispatch({type:ct.enablePlugin,plugins:ie(e),ts:r,_:{originalAction:ct.enablePlugin}})})},disable:function(e,n){var r=Z();return new Promise(function(t){wt[r]=l(t,n),G.dispatch({type:ct.disablePlugin,plugins:ie(e),ts:r,_:{originalAction:ct.disablePlugin}})})}},b.methods),z={identify:function(t,n,r,o){var i=H(t)?t:null,a=W(t)?t:n,u=r||{},c=z.user(),s=(X[bt(yt)]=i)||a.userId||x(yt,z,a);return new Promise(function(t,e){G.dispatch(nt(nt({type:ct.identifyStart,userId:s,traits:a||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==i&&{previousId:c.id}),{},{meta:{timestamp:qt(),callback:l(t,ne(n,r,o))}}))})},track:function(t,n,r,o){var i=W(t)?t.event:t;if(!i||!H(i))throw new Error("Event missing");var a=W(t)?t:n||{},u=W(r)?r:{};return new Promise(function(t,e){G.dispatch({type:ct.trackStart,event:i,properties:a,options:u,userId:x(yt,z,n),anonymousId:x(gt,z,n),meta:{timestamp:qt(),callback:l(t,ne(n,r,o))}})})},page:function(n,r,o){var i=W(n)?n:{},a=W(r)?r:{};return new Promise(function(t,e){G.dispatch({type:ct.pageStart,properties:Ht(i),options:a,userId:x(yt,z,i),anonymousId:x(gt,z,i),meta:{timestamp:qt(),callback:l(t,ne(n,r,o))}})})},user:function(t){if(t===yt||"id"===t)return x(yt,z);var e=z.getState("user");return t?J(e,t):e},reset:function(n){return new Promise(function(t,e){G.dispatch({type:ct.resetStart,timestamp:qt(),callback:l(t,n)})})},ready:function(t){return z.on(ct.ready,t)},on:function(n,r){if(!n||!Y(r))return!1;if(n===ct.bootstrap)throw new Error(".on disabled for "+n);var o=/Start$|Start:/;if("*"===n){var t=function(){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:z,plugins:S}),e(t)}}},e=function(){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:z,plugins:S}),e(t)}}};return _(t,se),_(e,le),function(){j(t,se),j(e,le)}}function i(){return function(e){return function(t){return t.type===n&&r({payload:t,instance:z,plugins:S,abort:u}),e(t)}}}var a=n.match(o)?se:le;return _(i,a),function(){return j(i,a)}},once:function(t,n){if(!t||!Y(n))return!1;if(t===ct.bootstrap)throw new Error(".once disabled for "+t);var r=z.on(t,function(t){var e=t.payload;n({payload:e,instance:z,plugins:S,abort:u}),r()});return r},getState:function(t){var e=G.getState();return t?J(e,t):Object.assign({},e)},dispatch:function(t){var e,n=H(t)?{type:t}:t;if(e=n.type,at.includes(e))throw new Error("reserved action "+n.type);var r=n.meta||{},o=t._||{},i=nt(nt({},n),{},{meta:nt({timestamp:qt()},r),_:nt({originalAction:n.type},o)});G.dispatch(i)},enablePlugin:L.enable,disablePlugin:L.disable,plugins:L,storage:{getItem:w.getItem,setItem:function(t,e,n){G.dispatch(ae(t,e,n))},removeItem:function(t,e){G.dispatch(ue(t,e))}},setAnonymousId:function(t,e){z.storage.setItem(st,t,e)},events:{all:I,core:at,plugins:P}},M=b.middlewares.concat([N(se),Dt(z,e,{all:I,plugins:P}),(a=w,function(t){return function(i){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===ct.setItem||e===ct.removeItem){if(t.abort)return i(t);e===ct.setItem?a.setItem(n,r,o):a.removeItem(n,o)}return i(t)}}}),(r=(d=z).storage,h=r.setItem,y=r.getItem,function(c){return function(u){return function(t){var o,e,n,r,i,a;return t.type===ct.bootstrap&&(o=t.params,e=t.user,y(st)||h(st,e.anonymousId),(n=Object.keys(t.params)).length&&(r=o.an_uid,i=o.an_event,a=n.reduce(function(t,e){var n,r;return(e.match(pt)||e.match(/^(d|g)clid/))&&(r="campaign"===(n=e.replace(pt,""))?"name":n,t.campaign[r]=o[e]),e.match(dt)&&(t.props[e.replace(dt,"")]=o[e]),e.match(ht)&&(t.traits[e.replace(ht,"")]=o[e]),t},{campaign:{},props:{},traits:{}}),c.dispatch(nt(nt({type:ct.params,raw:o},a),r?{userId:r}:{})),r&&setTimeout(function(){return d.identify(r,a.traits)},0),i&&setTimeout(function(){return d.track(i,a.props)},0),Object.keys(a.campaign).length&&c.dispatch({type:ct.campaign,campaign:a.campaign}))),u(t)}}}),(n=z.storage,s=n.setItem,f=n.removeItem,p=n.getItem,function(c){return function(u){return function(t){var e,n,r=t.userId,o=t.traits,i=t.options,a=t.callback;return t.type===ct.reset&&([lt,ft,st].forEach(function(t){return f(t)}),[yt,gt,"traits"].forEach(function(t){X[bt(t)]=void 0}),Y(a)&&a()),t.type===ct.identify&&(p(st)||s(st,Z()),e=p(lt),n=p(ft)||{},e&&e!==r&&c.dispatch({type:ct.userIdChanged,old:{userId:e,traits:n},new:{userId:r,traits:o},options:i}),r&&s(lt,r),o&&s(ft,nt(nt({},n),o))),u(t)}}}),N(le)]),D={context:$t,user:(o=w,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length&&void 0!==e?e:{};if(r.type===ct.setItemEnd){if(r.key===st)return nt(nt({},n),{anonymousId:r.value});if(r.key===lt)return nt(nt({},n),{userId:r.value})}switch(r.type){case ct.identify:return Object.assign({},n,{userId:r.userId,traits:nt(nt({},n.traits),r.traits)});case ct.reset:return[yt,gt,"traits"].forEach(function(t){X[bt(t)]=null}),[lt,st,ft].forEach(function(t){o.removeItem(t)}),Object.assign({},n,{userId:null,anonymousId:null,traits:{}});default:return n}}),page:Kt,track:Zt,plugins:(g=e,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0,o={};if("initialize:aborted"===r.type)return n;if(/^registerPlugin:([^:]*)$/.test(r.type)){var i=Ft(r.type,"registerPlugin"),a=g()[i];if(!a||!i)return n;var u=r.enabled;return o[i]={enabled:u,initialized:!!u&&Boolean(!a.initialize),loaded:!!u&&Boolean(a.loaded()),config:a.config||{}},nt(nt({},n),o)}if(/^initialize:([^:]*)$/.test(r.type)){var c=Ft(r.type,ct.initialize),s=g()[c];return s&&c?(o[c]=nt(nt({},n[c]),{initialized:!0,loaded:Boolean(s.loaded())}),nt(nt({},n),o)):n}if(/^ready:([^:]*)$/.test(r.type))return o[r.name]=nt(nt({},n[r.name]),{loaded:!0}),nt(nt({},n),o);switch(r.type){case ct.disablePlugin:return nt(nt({},n),Gt(r.plugins,!1,n));case ct.enablePlugin:return nt(nt({},n),Gt(r.plugins,!0,n));default:return n}}),queue:ee},q=it,R=it;K&&m.debug&&((c=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(q=c({trace:!0,traceLimit:25})),R=function(t){return 0===arguments.length?re():W(et(t))?oe():oe().apply(null,arguments)});var V,C=(V=m,Object.keys(V).reduce(function(t,e){return Bt.includes(e)||(t[e]=V[e]),t},{})),F={context:C,user:T,plugins:b.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded,i=b.pluginEnabled[n];return t[n]={enabled:i,initialized:!!i&&Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},G=rt(ot(nt(nt({},D),v)),F,R(q(function(){for(var t=arguments.length,c=new Array(t),e=0;e<t;e++)c[e]=arguments[e];return function(u){return function(t,e,n){var r=u(t,e,n),o=r.dispatch,i={getState:r.getState,dispatch:function(t){return o(t)}},a=c.map(function(t){return t(i)}),o=it.apply(void 0,tt(a))(r.dispatch);return nt(nt({},r),{},{dispatch:o})}}}.apply(void 0,tt(M))))),U=Object.keys(S);G.dispatch({type:ct.bootstrap,plugins:U,config:C,params:A,user:T});var $=U.filter(function(t){return b.pluginEnabled[t]}),B=U.filter(function(t){return!b.pluginEnabled[t]});return G.dispatch({type:ct.registerPlugins,plugins:U,enabled:b.pluginEnabled}),b.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config,o=t.name;n&&Y(n)&&n({instance:z,config:r,payload:t}),G.dispatch({type:ct.registerPluginType(o),name:o,enabled:b.pluginEnabled[o],plugin:t}),b.pluginsArray.length===e+1&&G.dispatch({type:ct.initializeStart,plugins:$,disabled:B})}),z}var se="before",le="after";function fe(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return ce(e(e({},{storage:m}),t))}return t.default=fe,t.init=fe,t.Analytics=fe,t.EVENTS=ct,t.CONSTANTS=z,t}({}); | ||
var _analytics=function(t){"use strict";var r=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function o(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e};function X(t,e,n,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:o;return t===o?n:t}function n(t,e,n,r,o,i){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=t+"="+encodeURIComponent(e)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var u=n,c=n;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==i(n)&&(n=parseFloat(n))}catch(t){n=e}return n}var Y="object"===("undefined"==typeof self?"undefined":i(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global.global===global&&global||void 0,l="localStorage",f="cookie",p="global",a=!1,d=function(){try{n("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return n("_c_","",-1),t}catch(t){return!1}}();function h(t){return"string"==typeof t?t:t.storage}function y(t){return a&&(!t||t===l)}function g(t){return d&&(!t||t===f)}var m={getItem:function(t){if(!t)return null;var e,n=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});if("all"===n)return{cookie:s(u(e=t)),localStorage:s(localStorage.getItem(e)),global:Y[e]||null};if(y(n)){var r=localStorage.getItem(t);if(r||n===l)return s(r)}if(g(n)){var o=u(t);if(o||n===f)return s(o)}return Y[t]||null},setItem:function(t,e){if(!t||!e)return!1;var n=h(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),r=JSON.stringify(e);if(y(n)){var o=s(localStorage.getItem(t));return localStorage.setItem(t,r),{value:e,oldValue:o,location:l}}if(g(n)){var i=s(u(t));return c(t,r),{value:e,oldValue:i,location:f}}var a=Y[t];return{value:Y[t]=e,oldValue:a,location:p}},removeItem:function(t){if(!t)return!1;var e=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return y(e)?(localStorage.removeItem(t),l):g(e)?(n(t,"",-1),f):(Y[t]=void 0,p)}};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(t){return"function"==typeof t}function W(t){return"string"==typeof t}function K(t){if("object"===v(t)&&null!==t){for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}}function b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var Q="undefined"!=typeof document;function Z(t){return function(t){var e,n={},r=/([^&=]+)=?([^&]*)/g;for(;e=r.exec(t);){var o=b(e[1]),i=b(e[2]);"[]"===o.substring(o.length-2)?(o=o.substring(0,o.length-2),(n[o]||(n[o]=[])).push(i)):n[o]=""===i||i}for(var a in n){var u=a.split("[");1<u.length&&(function(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var i=e[o];i in t||(t[i]={}),t=t[i]}t[e[r]]=n}(n,u.map(function(t){return t.replace(/[?[\]\\ ]/g,"")}),n[a]),delete n[a])}return n}(function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return Q&&window.location.search.substring(1)}(t))}function tt(){for(var t="",e=0,n=4294967295*Math.random()|0;e++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],o=15&n;t+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),n=e%8==0?4294967295*Math.random()|0:n>>4}return t}function w(t,e){return t(e={exports:{}},e.exports),e.exports}var et=w(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 x=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 S=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var E=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var nt=function(t){return x(t)||S(t)||E()};var O=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 I(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var rt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(n,!0).forEach(function(t){O(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},P="function",k="undefined",_="reducer",j="@@redux/",N=j+"INIT",A=j+Math.random().toString(36),T=function(){return("undefined"==typeof Symbol?"undefined":et(Symbol))===P&&Symbol.observable||"@@observable"}(),L=" != "+P;function ot(t,e,n){if(et(e)===P&&et(n)===k&&(n=e,e=void 0),et(n)!==k){if(et(n)!==P)throw new Error("enhancer"+L);return n(ot)(t,e)}if(et(t)!==P)throw new Error(_+L);var r=t,o=e,i=[],a=i,u=!1;function c(){a===i&&(a=i.slice())}function s(){return o}function l(e){if(et(e)!==P)throw new Error("Listener"+L);var n=!0;return c(),a.push(e),function(){var t;n&&(n=!1,c(),t=a.indexOf(e),a.splice(t,1))}}function f(t){if(!K(t))throw new Error("Act != obj");if(et(t.type)===k)throw new Error("ActType "+k);if(u)throw new Error("Dispatch in "+_);try{u=!0,o=r(o,t)}finally{u=!1}for(var e=i=a,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),O({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(et(t)!==P)throw new Error("next "+_+L);r=t,f({type:N})}},T,function(){var n=l;return O({subscribe:function(t){if("object"!==et(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(o)}return e(),{unsubscribe:n(e)}}},T,function(){return this})})}function it(t){for(var e=Object.keys(t),y={},n=0;n<e.length;n++){var r=e[n];et(t[r])===P&&(y[r]=t[r])}var g,o,m=Object.keys(y);try{o=y,Object.keys(o).forEach(function(t){var e=o[t],n=e(void 0,{type:N});if(et(n)===k||et(e(void 0,{type:A}))===k)throw new Error(_+" "+t+" "+k)})}catch(t){g=t}return function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(g)throw g;for(var o,i,a,u=!1,c={},s=0;s<m.length;s++){var l=m[s],f=y[l],p=n[l],d=f(p,r);if(et(d)===k){var h=(o=l,a=void 0,"action "+((a=(i=r)&&i.type)&&a.toString()||"?")+_+" "+o+" returns "+k);throw new Error(h)}c[l]=d,u=u||d!==p}return u?c:n}}function at(){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 ut=["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"],ct=["name","EVENTS","config","loaded"],st=ut.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var lt="__anon_id",ft="__user_id",pt="__user_traits",z=Object.freeze({ANON_ID:lt,USER_ID:ft,USER_TRAITS:pt}),dt=/^utm_/,ht=/^an_prop_/,yt=/^an_trait_/;var M="analytics",gt="userId",mt="anonymousId",vt="https://lytics.dev/errors/";function bt(t,e){return{userId:e.getItem(ft)||t.an_uid,anonymousId:e.getItem(lt)||t.an_aid||tt(),traits:e.getItem(pt)||{}}}var wt=function(t){return"__TEMP__"+t};var D=w(function(t){var e=function(a){var f,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new k(r||[]);return s._invoke=(i=t,a=n,u=l,c=d,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw e;return j()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=function t(e,n){var r=e.iterator[n.method];if(r===f){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=f,t(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=p(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=f),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,u);if(r){if(r===m)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===d)throw c=g,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=y;var o=p(i,a,u);if("normal"===o.type){if(c=u.done?g:h,o.arg===m)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=g,u.method="throw",u.arg=o.arg)}}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var d="suspendedStart",h="suspendedYield",y="executing",g="completed",m={};function v(){}function c(){}function s(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(_([])));x&&x!==t&&l.call(x,o)&&(b=x);var S=s.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function O(c,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var i=p(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==typeof u&&l.call(u,"__await")?s.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=f,t.done=!0,t};return r.next=r}}return{next:j}}function j(){return{value:f,done:!0}}return((c.prototype=S.constructor=s).constructor=c).displayName=i(s,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,i(t,r,"GeneratorFunction")),t.prototype=Object.create(S),t},a.awrap=function(t){return{__await:t}},E(O.prototype),O.prototype[n]=function(){return this},a.AsyncIterator=O,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new O(u(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(S),i(S,r,"Generator"),S[o]=function(){return this},S.toString=function(){return"[object Generator]"},a.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}},a.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=f),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},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),m},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),P(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r,o=n.completion;return"throw"===o.type&&(r=o.arg,P(n)),r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=f),m}},a}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function q(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var R=function(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){q(r,e,n,o,i,"next",t)}function i(t){q(r,e,n,o,i,"throw",t)}o(void 0)})}},xt={};function V(t,e){xt[t]&&H(xt[t])&&(xt[t](e),delete xt[t])}function C(o,i,a){return new Promise(function(e,n){return i()?e(o):a<1?n(rt(rt({},o),{},{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)}).then(function(t){return C(o,i,a-10).then(e,n)}));var r})}function F(u,t,c){var n,e,s=t(),r=u.getState(),l=r.plugins,o=r.context,f=r.queue,p=r.user;!o.offline&&f&&f.actions&&f.actions.length&&((n=f.actions.reduce(function(t,e,n){return l[e.plugin].loaded?(t.process.push(e),t.processIndex.push(n)):(t.requeue.push(e),t.requeueIndex.push(n)),t},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(t){var e,n,r=f.actions[t],o=r.plugin,i=r.payload.type,a=s[o][i];a&&H(a)&&(a({payload:e=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[gt,mt].reduce(function(t,e){return function(t,e,n){if(t.hasOwnProperty(n)&&!t[n]&&e[n])return Object.assign({},t,O({},"".concat(n),e[n]));return t}(t,n,e)},t)}(r.payload,p),config:l[o].config,instance:c}),n="".concat(i,":").concat(o),u.dispatch(rt(rt({},e),{},{type:n,_:{called:n,from:"queueDrain"}})))}),e=f.actions.filter(function(t,e){return!~n.processIndex.indexOf(e)}),f.actions=e))}var G=function(t){if(Array.isArray(t))return t};var U=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n};var $=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var B=function(t,e){return G(t)||U(t,e)||$()};var J=/Start$/,St=/^bootstrap/,Et=/^ready/;function Ot(){return(Ot=R(D.mark(function t(n,e,r,o,i){var a,u,c,s,l,f,p,d,h,y,g,m;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=H(e)?e():e,u=n.type,c=u.replace(J,""),n._&&n._.called)return t.abrupt("return",n);t.next=5;break;case 5:return s=r.getState(),l=function(e,t,n){var r=1<arguments.length&&void 0!==t?t:{},o=2<arguments.length&&void 0!==n?n:{};return Object.keys(e).filter(function(t){var e=o.plugins||{};return"boolean"==typeof e[t]?e[t]:!1!==e.all&&(!r[t]||!1!==r[t].enabled)}).map(function(t){return e[t]})}(a,s.plugins,n.options),u===st.initializeStart&&n.fromEnable&&(l=Object.keys(s.plugins).filter(function(t){var e=s.plugins[t];return n.plugins.includes(t)&&!e.initialized}).map(function(t){return a[t]})),f=l.map(function(t){return t.name}),p=function(c,s){var t=Nt(c).map(function(t){return jt(t,s)});return s.reduce(function(t,e){var n=e.name,r=Nt(c,n).map(function(t){return jt(t,s)}),o=B(r,3),i=o[0],a=o[1],u=o[2];return i.length&&(t.beforeNS[n]=i),a.length&&(t.duringNS[n]=a),u.length&&(t.afterNS[n]=u),t},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}})}(u,l),t.next=12,It({action:n,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 12:if(Tt(d=t.sent,f.length))return t.abrupt("return",d);t.next=15;break;case 15:if(u!==c){t.next=19;break}h=d,t.next=22;break;case 19:return t.next=21,It({action:rt(rt({},d),{},{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 21:h=t.sent;case 22:if(u.match(J))return y="".concat(c,"End"),t.next=26,It({action:rt(rt({},h),{},{type:y}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});t.next=29;break;case 26:g=t.sent,(m=function(r){return!!r.meta&&Object.keys(r.meta).reduce(function(t,e){var n=r.meta[e];return H(n)?n:t},!1)}(g))&&m({payload:g});case 29:return t.abrupt("return",d);case 30:case"end":return t.stop()}},t)}))).apply(this,arguments)}function It(){return Pt.apply(this,arguments)}function Pt(){return(Pt=R(D.mark(function t(e){var g,a,m,n,v,r,b,o,w,i,x,S,u,E,O,I,c,s;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return g=e.data,a=e.action,m=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,i=n.context,x=a.type,S=x.match(J),u=g.exact.map(function(t){return t.pluginName}),S&&(u=r.during.map(function(t){return t.pluginName})),E=function(y,g){return function(t,e,n){var r=e.config,o=e.name,i="".concat(o,".").concat(t.type);n&&(i=n.event);var a,u,c,s,l,f,p,d,h=t.type.match(J)?(c=o,s=i,l=g,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&Lt(e)?e:l;if(f&&(!(r=e&&Lt(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 rt(rt({},p),{},{abort:{reason:t,plugins:r,caller:s,_:n}})}):(a=t,u=i,function(){throw new Error(a.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(K(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:y,config:r||{},abort:h}}}(m,u),O=g.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,o=!1;return r.match(/^initialize/)||r.match(/^reset/)||(o=!w[n].loaded),i.offline&&r.match(/^(page|track|identify)/)&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,g.exact.reduce(function(){var r=R(D.mark(function t(e,n,r){var c,o,i;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(o=t.sent,g.namespaced&&g.namespaced[c])return t.next=7,g.namespaced[c].reduce(function(){var r=R(D.mark(function t(e,n,r){var o,i,a,u;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=function(r,o,i){return function(t,e){var n=i||o;return rt(rt({},r),{},{abort:{reason:t,plugins:e||[o],caller:x,from:n}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&H(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return function(t,e){var n=Mt(t);if(n&&n.name===e){var r=Mt(n.method),o=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call self","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:m,abort:i(o,c,n.pluginName),config:_t(n.pluginName,w,v),plugins:w});case 9:return a=t.sent,u=K(a)?a:{},t.abrupt("return",Promise.resolve(rt(rt({},o),u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));t.next=11;break;case 7:i=t.sent,o[c]=i,t.next=12;break;case 11:o[c]=a;case 12:return t.abrupt("return",Promise.resolve(o));case 13:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve({}));case 10:return I=t.sent,t.next=13,g.exact.reduce(function(){var r=R(D.mark(function t(e,n,r){var o,i,a,u,c,s,l,f,p,d,h,y;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=g.exact.length===r+1,i=n.pluginName,a=v[i],t.next=5,e;case 5:if(u=t.sent,c=I[i]?I[i]:{},S&&(c=u),At(c,i))return kt({data:c,method:x,instance:m,pluginName:i,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(At(u,i))return o&&kt({data:u,method:x,instance:m,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(O.hasOwnProperty(i)&&!0===O[i])return b.dispatch({type:"queue",plugin:i,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=E(I[i],v[i]),t.next=20,a[x]({abort:s.abort,payload:c,instance:m,config:_t(i,w,v),plugins:w});case 20:return l=t.sent,f=K(l)?l:{},p=rt(rt({},u),f),At(d=I[i],i)?kt({data:d,method:x,instance:m,pluginName:i,store:b}):(h="".concat(x,":").concat(i),(h.match(/:/g)||[]).length<2&&!x.match(St)&&!x.match(Et)&&(y=S?p:c,m.dispatch(rt(rt({},y),{},{type:h,_:{called:h,from:"submethod"}})))),t.abrupt("return",Promise.resolve(p));case 26:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));case 13:if(c=t.sent,x.match(J)||x.match(/^registerPlugin/)||x.match(Et)||x.match(St)||x.match(/^params/)||x.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(x),c._&&c._.originalAction===x)return t.abrupt("return",c);t.next=18;break;case 18:s=rt(rt({},c),{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Tt(c,g.exact.length)&&!x.match(/End$/)&&(s=rt(rt({},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 kt(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=n+"Aborted"+(r?":"+r:"");t.store.dispatch(rt(rt({},e),{},{type:o,_:{called:o,from:"abort"}}))}function _t(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function jt(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Nt(t,e){var n=t.replace(J,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function At(t,e){var n=t.abort;return n&&(!0===n||(zt(n,e)||n&&zt(n.plugins,e)))}function Tt(t,e){var n=t.abort;if(n){if(!0===n||W(n))return 1;var r=n.plugins;return Lt(n)&&n.length===e||Lt(r)&&r.length===e}}function Lt(t){return Array.isArray(t)}function zt(t,e){return!(!t||!Lt(t))&&t.includes(e)}function Mt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Dt(g,m,v){var b={};return function(y){return function(h){return function(){var e=R(D.mark(function t(n){var e,r,o,i,a,u,c,s,l,f,p,d;return D.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.type,r=n.abort,o=n.plugins,i=n,r)return t.abrupt("return",h(n));t.next=4;break;case 4:if(e===st.enablePlugin&&y.dispatch({type:st.initializeStart,plugins:o,disabled:[],fromEnable:!0,ts:n.ts}),e===st.disablePlugin&&setTimeout(function(){V(n.ts)},0),e===st.initializeEnd&&(a=m(),u=Object.keys(a),c=u.filter(function(t){return o.includes(t)}).map(function(t){return a[t]}),s=[],l=[],f=n.disabled,p=c.map(function(e){var t=e.loaded,n=e.name;return C(e,t,1e4).then(function(t){return b[n]||(y.dispatch({type:st.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!ct.includes(t)})}),b[n]=!0),s=s.concat(n),e}).catch(function(t){if(t instanceof Error)throw new Error(t);return l=l.concat(t.name),t})}),Promise.all(p).then(function(t){var e={plugins:s,failed:l,disabled:f};setTimeout(function(){u.length===p.length+f.length&&y.dispatch(rt(rt({},{type:st.ready}),e)),V(n.ts,e)},0)})),e!==st.bootstrap)return/^ready:([^:]*)$/.test(e)&&setTimeout(function(){return F(y,m,g)},0),t.next=11,function(t,e,n,r,o){return Ot.apply(this,arguments)}(n,m,g,y,v);t.next=13;break;case 11:return d=t.sent,t.abrupt("return",h(d));case 13:return t.abrupt("return",h(i));case 14:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()}}}var qt,Rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Vt=function t(){var a=this;Rt(this,t),O(this,"before",[]),O(this,"after",[]),O(this,"addMiddleware",function(t,e){a[e]=a[e].concat(t)}),O(this,"removeMiddleware",function(e,t){var n=a[t].findIndex(function(t){return t===e});-1!==n&&(a[t]=[].concat(nt(a[t].slice(0,n)),nt(a[t].slice(n+1))))}),O(this,"dynamicMiddlewares",function(i){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=a[i].map(function(t){return t(e)});return at.apply(void 0,nt(n))(r)(t)}}}})};function Ct(t,e){return t.substring(e.length+1,t.length)}function Ft(t,n,r){return t.reduce(function(t,e){return t[e]=rt(rt({},r[e]),{enabled:n}),t},r)}var Gt={initialized:!(qt={}),sessionId:tt(),app:null,version:null,debug:!1,offline:!!Q&&!navigator.onLine,os:{name:"na"},userAgent:Q?navigator.userAgent:"node",library:{name:M,version:"0.9.3"},timezone:void 0,locale:void 0,campaign:{},referrer:qt};function Ut(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Gt,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case st.campaign:return rt(rt({},t),{campaign:o});case st.offline:return rt(rt({},t),{offline:!0});case st.online:return rt(rt({},t),{offline:!1});default:return n?t:rt(rt(rt({},Gt),t),{initialized:!0})}}var $t=["plugins","reducers","storage"];function Bt(t){var e=t;try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e}var Jt=/#.*$/;function Xt(t){var e=function(){if(Q)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(Jt,"")}var Yt=function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!Q)return e;var n,r=document,o=r.title,i=r.referrer,a=window,u=a.location,c=a.innerWidth,s=a.innerHeight,l=u.hash,f=u.search,p=Xt(f),d={title:o,url:p,path:"/"+((n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(p))&&n[3]?n[3].split("?")[0].replace(Jt,""):""),hash:l,search:f,width:c,height:s};return i&&""!==i&&(d.referrer=i),rt(rt({},d),e)},Ht={last:{},history:[]};function Wt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Ht,e=1<arguments.length?arguments[1]:void 0,n=e.properties,r=e.options,o=e.meta;switch(e.type){case st.page:var i=Bt(rt({properties:n,meta:o},Object.keys(r).length&&{options:r}));return rt(rt({},t),{last:i,history:t.history.concat(i)});default:return t}}var Kt={last:{},history:[]};function Qt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Kt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.meta,o=e.options,i=e.event,a=e.properties;switch(n){case st.track:var u=Bt(rt(rt({event:i,properties:a},Object.keys(o).length&&{options:o}),{},{meta:r}));return rt(rt({},t),{last:u,history:t.history.concat(u)});default:return t}}var Zt={actions:[]};function te(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Zt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload;switch(n){case"queue":var o=r&&r.type&&r.type===st.identify?[e].concat(t.actions):t.actions.concat(e);return rt(rt({},t),{},{actions:o});case"dequeue":return[];default:return t}}function ee(){var a="__"+M+"__";return Y[a]=[],function(i){return function(t,e,n){var r=i(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return Y[a].push(e),o(t)}})}}}function ne(){return function(){return at(at.apply(null,arguments),ee())}}function re(t){return t?W(t)?[t]:t:[]}function oe(t){function e(){return s}function u(){throw new Error("Abort disabled inListener")}function o(e,n){return function(t){n&&n(t),e(t)}}var i,n=0<arguments.length&&void 0!==t?t:{},r=n.reducers||{},a=(n.plugins||[]).reduce(function(t,n){if(H(n))return t.middlewares=t.middlewares.concat(n),t;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error(vt+"1");var e=n.EVENTS?Object.keys(n.EVENTS).map(function(t){return n.EVENTS[t]}):[],r=!(!1===n.enabled),o=!(n.config&&!1===n.config.enabled);t.pluginEnabled[n.name]=r&&o,delete n.enabled,n.methods&&(t.methods[n.name]=Object.keys(n.methods).reduce(function(t,e){var r;return t[e]=(r=n.methods[e],function(){var n=Array.prototype.slice.call(arguments),t=Array.apply(null,Array(r.length)).map(function(){}).map(function(t,e){if(n[e]||!1===n[e]||null===n[e])return n[e]}).concat(M);return r.apply({instance:M},t)}),t},{}),delete n.methods);var i=Object.keys(n).concat(e),a=new Set(t.events.concat(i));if(t.events=Array.from(a),t.pluginsArray=t.pluginsArray.concat(n),t.plugins[n.name])throw new Error(n.name+" alreadyLoaded");return t.plugins[n.name]=n,t.plugins[n.name].loaded||(t.plugins[n.name].loaded=function(){return!0}),t},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),c=n.storage?n.storage:{getItem:function(t){return Y[t]},setItem:function(t,e){return Y[t]=e},removeItem:function(t){return Y[t]=void 0}},l=(i=c,function(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&K(n)&&n[t])return n[t];var o=bt({},i)[t];return o||(Y[wt(t)]?Y[wt(t)]:null)}),s=a.plugins,f=a.events.filter(function(t){return!ct.includes(t)}),p=new Set(f.concat(ut).filter(function(t){return!ct.includes(t)})),d=Array.from(p).sort(),h=f.sort(),y=new Vt,g=y.addMiddleware,m=y.removeMiddleware,v=y.dynamicMiddlewares;function b(t,e){return rt({rid:tt(),ts:(new Date).getTime()},t?{callback:o(t,function(){return Array.prototype.slice.call(arguments).reduce(function(t,e){return t||(H(e)?e:t)},!1)}.apply(void 0,nt(e)))}:{})}var w,x,S,E,O,I,P,k,_,j,N,A,T=Z(),L=bt(T,c),z=rt({enable:function(e,n){var r=tt();return new Promise(function(t){xt[r]=o(t,n),U.dispatch({type:st.enablePlugin,plugins:re(e),ts:r,_:{originalAction:st.enablePlugin}})})},disable:function(e,n){var r=tt();return new Promise(function(t){xt[r]=o(t,n),U.dispatch({type:st.disablePlugin,plugins:re(e),ts:r,_:{originalAction:st.disablePlugin}})})}},a.methods),M={identify:function(t,n,r,o){var i=W(t)?t:null,a=K(t)?t:n,u=r||{},c=M.user(),s=(Y[wt(gt)]=i)||a.userId||l(gt,M,a);return new Promise(function(t,e){U.dispatch(rt(rt({type:st.identifyStart,userId:s,traits:a||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==i&&{previousId:c.id}),{},{meta:b(t,[n,r,o])}))})},track:function(t,n,r,o){var i=K(t)?t.event:t;if(!i||!W(i))throw new Error("EventMissing");var a=K(t)?t:n||{},u=K(r)?r:{};return new Promise(function(t,e){U.dispatch({type:st.trackStart,event:i,properties:a,options:u,userId:l(gt,M,n),anonymousId:l(mt,M,n),meta:b(t,[n,r,o])})})},page:function(n,r,o){var i=K(n)?n:{},a=K(r)?r:{};return new Promise(function(t,e){U.dispatch({type:st.pageStart,properties:Yt(i),options:a,userId:l(gt,M,i),anonymousId:l(mt,M,i),meta:b(t,[n,r,o])})})},user:function(t){if(t===gt||"id"===t)return l(gt,M);var e=M.getState("user");return t?X(e,t):e},reset:function(n){return new Promise(function(t,e){U.dispatch({type:st.resetStart,callback:o(t,n),meta:b()})})},ready:function(t){return M.on(st.ready,t)},on:function(n,r){if(!n||!H(r))return!1;if(n===st.bootstrap)throw new Error(".on disabled for "+n);var o=/Start$|Start:/;if("*"===n){var t=function(){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:M,plugins:s}),e(t)}}},e=function(){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:M,plugins:s}),e(t)}}};return g(t,ie),g(e,ae),function(){m(t,ie),m(e,ae)}}function i(){return function(e){return function(t){return t.type===n&&r({payload:t,instance:M,plugins:s,abort:u}),e(t)}}}var a=n.match(o)?ie:ae;return g(i,a),function(){return m(i,a)}},once:function(t,n){if(!t||!H(n))return!1;if(t===st.bootstrap)throw new Error(".once disabled for "+t);var r=M.on(t,function(t){var e=t.payload;n({payload:e,instance:M,plugins:s,abort:u}),r()});return r},getState:function(t){var e=U.getState();return t?X(e,t):Object.assign({},e)},dispatch:function(t){var e,n=W(t)?{type:t}:t;if(e=n.type,ut.includes(e))throw new Error("reserved action "+n.type);var r=n.meta||{},o=t._||{},i=rt(rt({},n),{},{meta:rt(rt({},b()),r),_:rt({originalAction:n.type},o)});U.dispatch(i)},enablePlugin:z.enable,disablePlugin:z.disable,plugins:z,storage:{getItem:c.getItem,setItem:function(t,e,n){U.dispatch({type:st.setItemStart,key:t,value:e,options:n,meta:b()})},removeItem:function(t,e){U.dispatch({type:st.removeItemStart,key:t,options:e,meta:b()})}},setAnonymousId:function(t,e){M.storage.setItem(lt,t,e)},events:{all:d,core:ut,plugins:h}},D=a.middlewares.concat([v(ie),Dt(M,e,{all:d,plugins:h}),(_=c,function(t){return function(i){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===st.setItem||e===st.removeItem){if(t.abort)return i(t);e===st.setItem?_.setItem(n,r,o):_.removeItem(n,o)}return i(t)}}}),(I=(O=M).storage,P=I.setItem,k=I.getItem,function(c){return function(u){return function(t){var o,e,n,r,i,a;return t.type===st.bootstrap&&(o=t.params,e=t.user,k(lt)||P(lt,e.anonymousId),(n=Object.keys(t.params)).length&&(r=o.an_uid,i=o.an_event,a=n.reduce(function(t,e){var n,r;return(e.match(dt)||e.match(/^(d|g)clid/))&&(r="campaign"===(n=e.replace(dt,""))?"name":n,t.campaign[r]=o[e]),e.match(ht)&&(t.props[e.replace(ht,"")]=o[e]),e.match(yt)&&(t.traits[e.replace(yt,"")]=o[e]),t},{campaign:{},props:{},traits:{}}),c.dispatch(rt(rt({type:st.params,raw:o},a),r?{userId:r}:{})),r&&setTimeout(function(){return O.identify(r,a.traits)},0),i&&setTimeout(function(){return O.track(i,a.props)},0),Object.keys(a.campaign).length&&c.dispatch({type:st.campaign,campaign:a.campaign}))),u(t)}}}),(w=M.storage,x=w.setItem,S=w.removeItem,E=w.getItem,function(c){return function(u){return function(t){var e,n,r=t.userId,o=t.traits,i=t.options,a=t.callback;return t.type===st.reset&&([ft,pt,lt].forEach(function(t){return S(t)}),[gt,mt,"traits"].forEach(function(t){Y[wt(t)]=void 0}),H(a)&&a()),t.type===st.identify&&(E(lt)||x(lt,tt()),e=E(ft),n=E(pt)||{},e&&e!==r&&c.dispatch({type:st.userIdChanged,old:{userId:e,traits:n},new:{userId:r,traits:o},options:i}),r&&x(ft,r),o&&x(pt,rt(rt({},n),o))),u(t)}}}),v(ae)]),q={context:Ut,user:(N=c,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length&&void 0!==e?e:{};if(r.type===st.setItemEnd){if(r.key===lt)return rt(rt({},n),{anonymousId:r.value});if(r.key===ft)return rt(rt({},n),{userId:r.value})}switch(r.type){case st.identify:return Object.assign({},n,{userId:r.userId,traits:rt(rt({},n.traits),r.traits)});case st.reset:return[gt,mt,"traits"].forEach(function(t){Y[wt(t)]=null}),[ft,lt,pt].forEach(function(t){N.removeItem(t)}),Object.assign({},n,{userId:null,anonymousId:null,traits:{}});default:return n}}),page:Wt,track:Qt,plugins:(j=e,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0,o={};if("initialize:aborted"===r.type)return n;if(/^registerPlugin:([^:]*)$/.test(r.type)){var i=Ct(r.type,"registerPlugin"),a=j()[i];if(!a||!i)return n;var u=r.enabled;return o[i]={enabled:u,initialized:!!u&&Boolean(!a.initialize),loaded:!!u&&Boolean(a.loaded()),config:a.config||{}},rt(rt({},n),o)}if(/^initialize:([^:]*)$/.test(r.type)){var c=Ct(r.type,st.initialize),s=j()[c];return s&&c?(o[c]=rt(rt({},n[c]),{initialized:!0,loaded:Boolean(s.loaded())}),rt(rt({},n),o)):n}if(/^ready:([^:]*)$/.test(r.type))return o[r.name]=rt(rt({},n[r.name]),{loaded:!0}),rt(rt({},n),o);switch(r.type){case st.disablePlugin:return rt(rt({},n),Ft(r.plugins,!1,n));case st.enablePlugin:return rt(rt({},n),Ft(r.plugins,!0,n));default:return n}}),queue:te},R=at,V=at;Q&&n.debug&&((A=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(R=A({trace:!0,traceLimit:25})),V=function(t){return 0===arguments.length?ee():K(et(t))?ne():ne().apply(null,arguments)});var C,F=(C=n,Object.keys(C).reduce(function(t,e){return $t.includes(e)||(t[e]=C[e]),t},{})),G={context:F,user:L,plugins:a.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded,i=a.pluginEnabled[n];return t[n]={enabled:i,initialized:!!i&&Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},U=ot(it(rt(rt({},q),r)),G,V(R(function(){for(var t=arguments.length,c=new Array(t),e=0;e<t;e++)c[e]=arguments[e];return function(u){return function(t,e,n){var r=u(t,e,n),o=r.dispatch,i={getState:r.getState,dispatch:function(t){return o(t)}},a=c.map(function(t){return t(i)}),o=at.apply(void 0,nt(a))(r.dispatch);return rt(rt({},r),{},{dispatch:o})}}}.apply(void 0,nt(D))))),$=Object.keys(s);U.dispatch({type:st.bootstrap,plugins:$,config:F,params:T,user:L});var B=$.filter(function(t){return a.pluginEnabled[t]}),J=$.filter(function(t){return!a.pluginEnabled[t]});return U.dispatch({type:st.registerPlugins,plugins:$,enabled:a.pluginEnabled}),a.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config,o=t.name;n&&H(n)&&n({instance:M,config:r,payload:t}),U.dispatch({type:st.registerPluginType(o),name:o,enabled:a.pluginEnabled[o],plugin:t}),a.pluginsArray.length===e+1&&U.dispatch({type:st.initializeStart,plugins:B,disabled:J})}),M}var ie="before",ae="after";function ue(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return oe(e(e({},{storage:m}),t))}return t.default=ue,t.init=ue,t.Analytics=ue,t.EVENTS=st,t.CONSTANTS=z,t}({}); |
{ | ||
"name": "analytics", | ||
"version": "0.6.7", | ||
"version": "0.7.0", | ||
"description": "Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system.", | ||
@@ -58,3 +58,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@analytics/core": "^0.9.3", | ||
"@analytics/core": "^0.10.0", | ||
"@analytics/storage-utils": "^0.2.4" | ||
@@ -90,3 +90,3 @@ }, | ||
}, | ||
"gitHead": "c7b75d6f778c76bf4f0b9502115a1092274b1d90" | ||
"gitHead": "0295f5139bb0c73d85bfcb0f9d10e5739c51bcb4" | ||
} |
@@ -685,2 +685,3 @@ <a href="https://getanalytics.io"> | ||
<!-- AUTO-GENERATED-CONTENT:START (PLUGINS) --> | ||
- [@analytics/aws-pinpoint](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-aws-pinpoint) AWS Pinpoint integration for 'analytics' module [npm link](https://www.npmjs.com/package/@analytics/aws-pinpoint). | ||
- [@analytics/cookie-utils](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-cookie) Cookie helper functions [npm link](https://www.npmjs.com/package/@analytics/cookie-utils). | ||
@@ -687,0 +688,0 @@ - [@analytics/core](https://github.com/DavidWells/analytics/tree/master/packages/analytics-core) Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system. [npm link](https://www.npmjs.com/package/@analytics/core). |
Sorry, the diff of this file is too big to display
278647
971
5146
+ Added@analytics/core@0.10.23(transitive)
+ Addedanalytics-utils@1.0.14(transitive)
- Removed@analytics/core@0.9.3(transitive)
- Removedanalytics-utils@0.4.8(transitive)
Updated@analytics/core@^0.10.0