Socket
Socket
Sign inDemoInstall

bullet-train-client

Package Overview
Dependencies
0
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.84 to 0.0.90

index.js.map

2

index.js

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

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=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){i=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=n(3),a=(r=o)&&r.__esModule?r:{default:r};var u={getItem:function(t,e){return u.multiGet([t]).then((function(t){return t[0][1]})).then((function(t){return e&&e(null,t),t})).catch((function(t){return e&&e(t,null),t}))},setItem:function(t,e,n){return u.multiSet([[t,e]]).then((function(t){return n&&n(null,t),t})).catch((function(t){return n&&n(t,null),t}))},getAllKeys:function(t){return Promise.resolve(Object.keys(localStorage)).then((function(e){return t&&t(null,e),e})).catch((function(e){return t&&t(e,null),e}))},removeItem:function(t,e){return u.multiRemove([t]).then((function(){e&&e(null)})).catch((function(t){e&&e(t,null)}))},clear:function(){return new Promise((function(t){window.localStorage.clear(),t()}))},mergeItem:function(t,e){return u.multiMerge([[t,e]])},multiGet:function(t){return new Promise((function(e){e(t.reduce((function(t,e){return t.concat([[e,localStorage.getItem(e)]])}),[]))}))},multiSet:function(t){return new Promise((function(e,n){var r=[];return t.forEach((function(t){var e=i(t,2),n=e[0],o=e[1];try{localStorage.setItem(n,o)}catch(t){r.push(t)}})),r.length>0?n(r):e()}))},multiMerge:function(t){return new Promise((function(e,n){var r=[];return t.forEach((function(t){var e=i(t,2),n=e[0],o=e[1],u=localStorage.getItem(n);if(u)try{localStorage.setItem(n,JSON.stringify((0,a.default)(JSON.parse(u),JSON.parse(o))))}catch(t){r.push(t)}})),r.length>0?n(r):e()}))},multiRemove:function(t){return new Promise((function(e){t.forEach((function(t){return window.localStorage.removeItem(t)})),e()}))},flushGetRequests:function(){console.warn("AsyncStorage.flushGetRequests: Not supported on `web`")}};e.default=u},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r),o=n(2).default,a=n(5)({AsyncStorage:i.a,fetch:o});"undefined"!=typeof window&&(window.bulletTrain=a),e.default=a},function(t,e,n){"use strict";n.r(e),e.default=function(t,e){return e=e||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],u={},c=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:c,headers:{keys:function(){return o},entries:function(){return a},get:function(t){return u[t.toLowerCase()]},has:function(t){return t.toLowerCase()in u}}}};for(var s in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),a.push([e,n]),u[e]=u[e]?u[e]+","+n:n})),n(c())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(s,e.headers[s]);i.send(e.body||null)}))}},function(t,e,n){(function(t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,u="[object Arguments]",c="[object AsyncFunction]",s="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",v="[object Proxy]",p="[object Undefined]",d=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[u]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[s]=g["[object Map]"]=g["[object Number]"]=g[h]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var b="object"==typeof global&&global&&global.Object===Object&&global,_="object"==typeof self&&self&&self.Object===Object&&self,m=b||_||Function("return this")(),j=e&&!e.nodeType&&e,w=j&&"object"==typeof t&&t&&!t.nodeType&&t,O=w&&w.exports===j,S=O&&b.process,P=function(){try{var t=w&&w.require&&w.require("util").types;return t||S&&S.binding&&S.binding("util")}catch(t){}}(),A=P&&P.isTypedArray;function I(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var x,T,k,F=Array.prototype,z=Function.prototype,C=Object.prototype,E=m["__core-js_shared__"],N=z.toString,J=C.hasOwnProperty,L=(x=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",M=C.toString,R=N.call(Object),D=RegExp("^"+N.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=O?m.Buffer:void 0,$=m.Symbol,B=m.Uint8Array,G=U?U.allocUnsafe:void 0,q=(T=Object.getPrototypeOf,k=Object,function(t){return T(k(t))}),H=Object.create,V=C.propertyIsEnumerable,K=F.splice,W=$?$.toStringTag:void 0,X=function(){try{var t=jt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=U?U.isBuffer:void 0,Y=Math.max,Z=Date.now,tt=jt(m,"Map"),et=jt(Object,"create"),nt=function(){function t(){}return function(e){if(!Ct(e))return{};if(H)return H(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function rt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function at(t){var e=this.__data__=new it(t);this.size=e.size}function ut(t,e){var n=xt(t),r=!n&&It(t),i=!n&&!r&&kt(t),o=!n&&!r&&!i&&Nt(t),a=n||r||i||o,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=u.length;for(var s in t)!e&&!J.call(t,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||wt(s,c))||u.push(s);return u}function ct(t,e,n){(void 0===n||At(t[e],n))&&(void 0!==n||e in t)||ft(t,e,n)}function st(t,e,n){var r=t[e];J.call(t,e)&&At(r,n)&&(void 0!==n||e in t)||ft(t,e,n)}function lt(t,e){for(var n=t.length;n--;)if(At(t[n][0],e))return n;return-1}function ft(t,e,n){"__proto__"==e&&X?X(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}rt.prototype.clear=function(){this.__data__=et?et(null):{},this.size=0},rt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rt.prototype.get=function(t){var e=this.__data__;if(et){var n=e[t];return n===r?void 0:n}return J.call(e,t)?e[t]:void 0},rt.prototype.has=function(t){var e=this.__data__;return et?void 0!==e[t]:J.call(e,t)},rt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=et&&void 0===e?r:e,this},it.prototype.clear=function(){this.__data__=[],this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=lt(e,t);return!(n<0)&&(n==e.length-1?e.pop():K.call(e,n,1),--this.size,!0)},it.prototype.get=function(t){var e=this.__data__,n=lt(e,t);return n<0?void 0:e[n][1]},it.prototype.has=function(t){return lt(this.__data__,t)>-1},it.prototype.set=function(t,e){var n=this.__data__,r=lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new rt,map:new(tt||it),string:new rt}},ot.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return mt(this,t).get(t)},ot.prototype.has=function(t){return mt(this,t).has(t)},ot.prototype.set=function(t,e){var n=mt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.clear=function(){this.__data__=new it,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var i=r.__data__;if(!tt||i.length<n-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new ot(i)}return r.set(t,e),this.size=r.size,this};var ht,vt=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var u=o[ht?a:++r];if(!1===e(i[u],u,i))break}return t};function pt(t){return null==t?void 0===t?p:f:W&&W in Object(t)?function(t){var e=J.call(t,W),n=t[W];try{t[W]=void 0;var r=!0}catch(t){}var i=M.call(t);r&&(e?t[W]=n:delete t[W]);return i}(t):function(t){return M.call(t)}(t)}function dt(t){return Et(t)&&pt(t)==u}function yt(t){return!(!Ct(t)||function(t){return!!L&&L in t}(t))&&(Ft(t)?D:d).test(function(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function gt(t){if(!Ct(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Ot(t),n=[];for(var r in t)("constructor"!=r||!e&&J.call(t,r))&&n.push(r);return n}function bt(t,e,n,r,i){t!==e&&vt(e,(function(o,a){if(i||(i=new at),Ct(o))!function(t,e,n,r,i,o,a){var u=St(t,n),c=St(e,n),s=a.get(c);if(s)return void ct(t,n,s);var l=o?o(u,c,n+"",t,e,a):void 0,f=void 0===l;if(f){var v=xt(c),p=!v&&kt(c),d=!v&&!p&&Nt(c);l=c,v||p||d?xt(u)?l=u:Et(m=u)&&Tt(m)?l=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(u):p?(f=!1,l=function(t,e){if(e)return t.slice();var n=t.length,r=G?G(n):new t.constructor(n);return t.copy(r),r}(c,!0)):d?(f=!1,y=c,g=!0?(b=y.buffer,_=new b.constructor(b.byteLength),new B(_).set(new B(b)),_):y.buffer,l=new y.constructor(g,y.byteOffset,y.length)):l=[]:function(t){if(!Et(t)||pt(t)!=h)return!1;var e=q(t);if(null===e)return!0;var n=J.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==R}(c)||It(c)?(l=u,It(u)?l=function(t){return function(t,e,n,r){var i=!n;n||(n={});var o=-1,a=e.length;for(;++o<a;){var u=e[o],c=r?r(n[u],t[u],u,n,t):void 0;void 0===c&&(c=t[u]),i?ft(n,u,c):st(n,u,c)}return n}(t,Jt(t))}(u):Ct(u)&&!Ft(u)||(l=function(t){return"function"!=typeof t.constructor||Ot(t)?{}:nt(q(t))}(c))):f=!1}var y,g,b,_;var m;f&&(a.set(c,l),i(l,c,r,o,a),a.delete(c));ct(t,n,l)}(t,e,a,n,bt,r,i);else{var u=r?r(St(t,a),o,a+"",t,e,i):void 0;void 0===u&&(u=o),ct(t,a,u)}}),Jt)}function _t(t,e){return Pt(function(t,e,n){return e=Y(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Y(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=r[i];return u[e]=n(a),I(t,this,u)}}(t,e,Rt),t+"")}function mt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function jt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return yt(n)?n:void 0}function wt(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&y.test(t))&&t>-1&&t%1==0&&t<e}function Ot(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||C)}function St(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Pt=function(t){var e=0,n=0;return function(){var r=Z(),a=o-(r-n);if(n=r,a>0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(X?function(t,e){return X(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Rt);function At(t,e){return t===e||t!=t&&e!=e}var It=dt(function(){return arguments}())?dt:function(t){return Et(t)&&J.call(t,"callee")&&!V.call(t,"callee")},xt=Array.isArray;function Tt(t){return null!=t&&zt(t.length)&&!Ft(t)}var kt=Q||function(){return!1};function Ft(t){if(!Ct(t))return!1;var e=pt(t);return e==s||e==l||e==c||e==v}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ct(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var Nt=A?function(t){return function(e){return t(e)}}(A):function(t){return Et(t)&&zt(t.length)&&!!g[pt(t)]};function Jt(t){return Tt(t)?ut(t,!0):gt(t)}var Lt,Mt=(Lt=function(t,e,n){bt(t,e,n)},_t((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=Lt.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(t,e,n){if(!Ct(n))return!1;var r=typeof e;return!!("number"==r?Tt(n)&&wt(e,n.length):"string"==r&&e in n)&&At(n[e],t)}(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var a=e[n];a&&Lt(t,a,n,i)}return t})));function Rt(t){return t}t.exports=Mt}).call(this,n(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i,o,a="https://api.bullet-train.io/api/v1/",u=function(){function t(e){var n=this;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),r(this,"getJSON",(function(t,e,r){var o={method:e||"GET",body:r,headers:{"x-environment-key":n.environmentID}};return"GET"!==e&&(o.headers["Content-Type"]="application/json; charset=utf-8"),i(t,o).then((function(t){return 200<=t.status&&300>t.status?t:t.text().then((function(t){var e=t;try{e=JSON.parse(t)}catch(t){}return Promise.reject(e)}))})).then((function(t){return t.json()}))})),r(this,"getFlags",(function(t,e){var r=n.onChange,i=n.onError,o=n.identity,a=n.api,u=(n.disableCache,!1),c=function(t,e){var i=t.flags,o=t.traits,a={},u={};if(o=o||[],(i=i||[]).forEach((function(t){a[t.feature.name.toLowerCase().replace(/ /g,"_")]={enabled:t.enabled,value:t.feature_state_value}})),o.forEach((function(t){u[t.trait_key.toLowerCase().replace(/ /g,"_")]=t.trait_value})),n.oldFlags=a,n.flags=a,n.traits=u,e){var c={};e.map((function(t){c[t.name]=t})),n.segments=c}r&&r(n.oldFlags,{isFromServer:!0})};return o?Promise.all([n.getJSON(a+"identities/?identifier="+encodeURIComponent(o))]).then((function(t){c(t[0],t[1])})).catch((function(t){var e=t.message;i&&i({message:e})})):Promise.all([n.getJSON(a+"flags/")]).then((function(e){c({flags:e[0]},null),t&&!u&&(u=!0,t())})).catch((function(t){e&&!u&&(u=!0,e(t)),i&&i(t)}))})),r(this,"getValue",(function(t){var e=n.flags&&n.flags[t],r=null;return e&&(r=e.value),r})),r(this,"getTrait",(function(t){return n.traits&&n.traits[t]})),r(this,"setTrait",(function(t,e){var r=n.getJSON,i=n.identity,o=n.api;return r("".concat(o,"traits/"),"POST",JSON.stringify({identity:{identifier:i},trait_key:t,trait_value:e})).then(n.getFlags)})),r(this,"incrementTrait",(function(t,e){var r=n.getJSON,i=n.identity,o=n.api;return r("".concat(o,"traits/increment-value/"),"POST",JSON.stringify({trait_key:t,increment_by:e,identifier:i})).then(n.getFlags)})),r(this,"hasFeature",(function(t){var e=n.flags&&n.flags[t],r=!1;return e&&e.enabled&&(r=!0),r})),i=e.fetch?e.fetch:global.fetch,o=e.AsyncStorage}return function(t,e,r){e&&n(t.prototype,e),r&&n(t,r)}(t,[{key:"init",value:function(t){var e=this,n=t.environmentID,r=t.api,i=void 0===r?a:r,u=t.onChange,c=t.disableCache,s=t.onError,l=t.defaultFlags,f=t.preventFetch,h=t.state;return new Promise((function(t,r){if(e.environmentID=n,e.api=i,e.interval=null,e.disableCache=c,e.onChange=u,e.onError=s,e.flags=Object.assign({},l)||{},e.initialised=!0,e.setState(h),!n)throw r("Please specify a environment id"),"Please specify a environment id";c||o.getItem("BULLET_TRAIN_DB",(function(n,i){e.flags=i?JSON.parse(i):l,e.flags&&e.onChange&&e.onChange(null,{isFromServer:!1}),f||e.getFlags(t,r)}))}))}},{key:"getAllFlags",value:function(){return this.flags}},{key:"identify",value:function(t){this.identity=t,this.initialised&&!this.interval&&this.getFlags()}},{key:"getState",value:function(){return{api:this.api,environmentID:this.environmentID,flags:this.flags,identity:this.identity,segments:this.segments,traits:this.traits}}},{key:"setState",value:function(t){t&&(this.initialised=!0,this.api=t.api||this.api||a,this.environmentID=t.environmentID||this.environmentID,this.flags=t.flags||this.flags,this.identity=t.identity||this.identity,this.segments=t.segments||this.segments,this.traits=t.traits||this.traits)}},{key:"logout",value:function(){this.identity=null,this.segments=null,this.traits=null,this.initialised&&!this.interval&&this.getFlags()}},{key:"startListening",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1e3;this.interval||(this.interval=setInterval(this.getFlags,t))}},{key:"getSegments",value:function(){}},{key:"stopListening",value:function(){clearInterval(this.interval)}}]),t}();t.exports=function(t){var e=t.fetch,n=t.AsyncStorage;return new u({fetch:e,AsyncStorage:n})}}])}));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=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){i=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=n(3),a=(r=o)&&r.__esModule?r:{default:r};var u={getItem:function(t,e){return u.multiGet([t]).then((function(t){return t[0][1]})).then((function(t){return e&&e(null,t),t})).catch((function(t){return e&&e(t,null),t}))},setItem:function(t,e,n){return u.multiSet([[t,e]]).then((function(t){return n&&n(null,t),t})).catch((function(t){return n&&n(t,null),t}))},getAllKeys:function(t){return Promise.resolve(Object.keys(localStorage)).then((function(e){return t&&t(null,e),e})).catch((function(e){return t&&t(e,null),e}))},removeItem:function(t,e){return u.multiRemove([t]).then((function(){e&&e(null)})).catch((function(t){e&&e(t,null)}))},clear:function(){return new Promise((function(t){window.localStorage.clear(),t()}))},mergeItem:function(t,e){return u.multiMerge([[t,e]])},multiGet:function(t){return new Promise((function(e){e(t.reduce((function(t,e){return t.concat([[e,localStorage.getItem(e)]])}),[]))}))},multiSet:function(t){return new Promise((function(e,n){var r=[];return t.forEach((function(t){var e=i(t,2),n=e[0],o=e[1];try{localStorage.setItem(n,o)}catch(t){r.push(t)}})),r.length>0?n(r):e()}))},multiMerge:function(t){return new Promise((function(e,n){var r=[];return t.forEach((function(t){var e=i(t,2),n=e[0],o=e[1],u=localStorage.getItem(n);if(u)try{localStorage.setItem(n,JSON.stringify((0,a.default)(JSON.parse(u),JSON.parse(o))))}catch(t){r.push(t)}})),r.length>0?n(r):e()}))},multiRemove:function(t){return new Promise((function(e){t.forEach((function(t){return window.localStorage.removeItem(t)})),e()}))},flushGetRequests:function(){console.warn("AsyncStorage.flushGetRequests: Not supported on `web`")}};e.default=u},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r),o=n(2).default,a=n(5)({AsyncStorage:i.a,fetch:o});"undefined"!=typeof window&&(window.bulletTrain=a),e.default=a},function(t,e,n){"use strict";n.r(e),e.default=function(t,e){return e=e||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],u={},c=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:c,headers:{keys:function(){return o},entries:function(){return a},get:function(t){return u[t.toLowerCase()]},has:function(t){return t.toLowerCase()in u}}}};for(var s in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),a.push([e,n]),u[e]=u[e]?u[e]+","+n:n})),n(c())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(s,e.headers[s]);i.send(e.body||null)}))}},function(t,e,n){(function(t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,u="[object Arguments]",c="[object AsyncFunction]",s="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",v="[object Proxy]",p="[object Undefined]",g=/^\[object .+?Constructor\]$/,d=/^(?:0|[1-9]\d*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[u]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y[s]=y["[object Map]"]=y["[object Number]"]=y[h]=y["[object RegExp]"]=y["[object Set]"]=y["[object String]"]=y["[object WeakMap]"]=!1;var b="object"==typeof global&&global&&global.Object===Object&&global,_="object"==typeof self&&self&&self.Object===Object&&self,m=b||_||Function("return this")(),j=e&&!e.nodeType&&e,S=j&&"object"==typeof t&&t&&!t.nodeType&&t,w=S&&S.exports===j,O=w&&b.process,P=function(){try{var t=S&&S.require&&S.require("util").types;return t||O&&O.binding&&O.binding("util")}catch(t){}}(),A=P&&P.isTypedArray;function I(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var T,x,F,k=Array.prototype,E=Function.prototype,L=Object.prototype,z=m["__core-js_shared__"],N=E.toString,C=L.hasOwnProperty,R=(T=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",D=L.toString,J=N.call(Object),M=RegExp("^"+N.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=w?m.Buffer:void 0,B=m.Symbol,$=m.Uint8Array,G=U?U.allocUnsafe:void 0,q=(x=Object.getPrototypeOf,F=Object,function(t){return x(F(t))}),H=Object.create,V=L.propertyIsEnumerable,K=k.splice,W=B?B.toStringTag:void 0,X=function(){try{var t=jt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=U?U.isBuffer:void 0,Y=Math.max,Z=Date.now,tt=jt(m,"Map"),et=jt(Object,"create"),nt=function(){function t(){}return function(e){if(!Lt(e))return{};if(H)return H(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function rt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function at(t){var e=this.__data__=new it(t);this.size=e.size}function ut(t,e){var n=Tt(t),r=!n&&It(t),i=!n&&!r&&Ft(t),o=!n&&!r&&!i&&Nt(t),a=n||r||i||o,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=u.length;for(var s in t)!e&&!C.call(t,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||St(s,c))||u.push(s);return u}function ct(t,e,n){(void 0===n||At(t[e],n))&&(void 0!==n||e in t)||ft(t,e,n)}function st(t,e,n){var r=t[e];C.call(t,e)&&At(r,n)&&(void 0!==n||e in t)||ft(t,e,n)}function lt(t,e){for(var n=t.length;n--;)if(At(t[n][0],e))return n;return-1}function ft(t,e,n){"__proto__"==e&&X?X(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}rt.prototype.clear=function(){this.__data__=et?et(null):{},this.size=0},rt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rt.prototype.get=function(t){var e=this.__data__;if(et){var n=e[t];return n===r?void 0:n}return C.call(e,t)?e[t]:void 0},rt.prototype.has=function(t){var e=this.__data__;return et?void 0!==e[t]:C.call(e,t)},rt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=et&&void 0===e?r:e,this},it.prototype.clear=function(){this.__data__=[],this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=lt(e,t);return!(n<0)&&(n==e.length-1?e.pop():K.call(e,n,1),--this.size,!0)},it.prototype.get=function(t){var e=this.__data__,n=lt(e,t);return n<0?void 0:e[n][1]},it.prototype.has=function(t){return lt(this.__data__,t)>-1},it.prototype.set=function(t,e){var n=this.__data__,r=lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new rt,map:new(tt||it),string:new rt}},ot.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return mt(this,t).get(t)},ot.prototype.has=function(t){return mt(this,t).has(t)},ot.prototype.set=function(t,e){var n=mt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.clear=function(){this.__data__=new it,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var i=r.__data__;if(!tt||i.length<n-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new ot(i)}return r.set(t,e),this.size=r.size,this};var ht,vt=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var u=o[ht?a:++r];if(!1===e(i[u],u,i))break}return t};function pt(t){return null==t?void 0===t?p:f:W&&W in Object(t)?function(t){var e=C.call(t,W),n=t[W];try{t[W]=void 0;var r=!0}catch(t){}var i=D.call(t);r&&(e?t[W]=n:delete t[W]);return i}(t):function(t){return D.call(t)}(t)}function gt(t){return zt(t)&&pt(t)==u}function dt(t){return!(!Lt(t)||function(t){return!!R&&R in t}(t))&&(kt(t)?M:g).test(function(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function yt(t){if(!Lt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=wt(t),n=[];for(var r in t)("constructor"!=r||!e&&C.call(t,r))&&n.push(r);return n}function bt(t,e,n,r,i){t!==e&&vt(e,(function(o,a){if(i||(i=new at),Lt(o))!function(t,e,n,r,i,o,a){var u=Ot(t,n),c=Ot(e,n),s=a.get(c);if(s)return void ct(t,n,s);var l=o?o(u,c,n+"",t,e,a):void 0,f=void 0===l;if(f){var v=Tt(c),p=!v&&Ft(c),g=!v&&!p&&Nt(c);l=c,v||p||g?Tt(u)?l=u:zt(m=u)&&xt(m)?l=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(u):p?(f=!1,l=function(t,e){if(e)return t.slice();var n=t.length,r=G?G(n):new t.constructor(n);return t.copy(r),r}(c,!0)):g?(f=!1,d=c,y=!0?(b=d.buffer,_=new b.constructor(b.byteLength),new $(_).set(new $(b)),_):d.buffer,l=new d.constructor(y,d.byteOffset,d.length)):l=[]:function(t){if(!zt(t)||pt(t)!=h)return!1;var e=q(t);if(null===e)return!0;var n=C.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==J}(c)||It(c)?(l=u,It(u)?l=function(t){return function(t,e,n,r){var i=!n;n||(n={});var o=-1,a=e.length;for(;++o<a;){var u=e[o],c=r?r(n[u],t[u],u,n,t):void 0;void 0===c&&(c=t[u]),i?ft(n,u,c):st(n,u,c)}return n}(t,Ct(t))}(u):Lt(u)&&!kt(u)||(l=function(t){return"function"!=typeof t.constructor||wt(t)?{}:nt(q(t))}(c))):f=!1}var d,y,b,_;var m;f&&(a.set(c,l),i(l,c,r,o,a),a.delete(c));ct(t,n,l)}(t,e,a,n,bt,r,i);else{var u=r?r(Ot(t,a),o,a+"",t,e,i):void 0;void 0===u&&(u=o),ct(t,a,u)}}),Ct)}function _t(t,e){return Pt(function(t,e,n){return e=Y(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Y(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=r[i];return u[e]=n(a),I(t,this,u)}}(t,e,Jt),t+"")}function mt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function jt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return dt(n)?n:void 0}function St(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&d.test(t))&&t>-1&&t%1==0&&t<e}function wt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||L)}function Ot(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Pt=function(t){var e=0,n=0;return function(){var r=Z(),a=o-(r-n);if(n=r,a>0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(X?function(t,e){return X(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Jt);function At(t,e){return t===e||t!=t&&e!=e}var It=gt(function(){return arguments}())?gt:function(t){return zt(t)&&C.call(t,"callee")&&!V.call(t,"callee")},Tt=Array.isArray;function xt(t){return null!=t&&Et(t.length)&&!kt(t)}var Ft=Q||function(){return!1};function kt(t){if(!Lt(t))return!1;var e=pt(t);return e==s||e==l||e==c||e==v}function Et(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Lt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return null!=t&&"object"==typeof t}var Nt=A?function(t){return function(e){return t(e)}}(A):function(t){return zt(t)&&Et(t.length)&&!!y[pt(t)]};function Ct(t){return xt(t)?ut(t,!0):yt(t)}var Rt,Dt=(Rt=function(t,e,n){bt(t,e,n)},_t((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=Rt.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(t,e,n){if(!Lt(n))return!1;var r=typeof e;return!!("number"==r?xt(n)&&St(e,n.length):"string"==r&&e in n)&&At(n[e],t)}(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var a=e[n];a&&Rt(t,a,n,i)}return t})));function Jt(t){return t}t.exports=Dt}).call(this,n(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i,o,a="https://api.bullet-train.io/api/v1/",u=function(){function t(e){var n=this;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),r(this,"getJSON",(function(t,e,r){var o={method:e||"GET",body:r,headers:{"x-environment-key":n.environmentID}};return"GET"!==e&&(o.headers["Content-Type"]="application/json; charset=utf-8"),i(t,o).then((function(t){return 200<=t.status&&300>t.status?t:t.text().then((function(t){var e=t;try{e=JSON.parse(t)}catch(t){}return Promise.reject(e)}))})).then((function(t){return t.json()}))})),r(this,"getFlags",(function(t,e){var r=n.onChange,i=n.onError,o=n.identity,a=n.api,u=(n.disableCache,!1),c=function(t,e){var i=t.flags,o=t.traits,a={},u={};if(o=o||[],(i=i||[]).forEach((function(t){a[t.feature.name.toLowerCase().replace(/ /g,"_")]={enabled:t.enabled,value:t.feature_state_value}})),o.forEach((function(t){u[t.trait_key.toLowerCase().replace(/ /g,"_")]=t.trait_value})),n.oldFlags=a,n.flags=a,n.traits=u,e){var c={};e.map((function(t){c[t.name]=t})),n.segments=c}n.updateStorage(),r&&r(n.oldFlags,{isFromServer:!0})};return o?Promise.all([n.getJSON(a+"identities/?identifier="+encodeURIComponent(o))]).then((function(t){c(t[0],t[1])})).catch((function(t){var e=t.message;i&&i({message:e})})):Promise.all([n.getJSON(a+"flags/")]).then((function(e){c({flags:e[0]},null),t&&!u&&(u=!0,t())})).catch((function(t){e&&!u&&(u=!0,e(t)),i&&i(t)}))})),r(this,"getValue",(function(t){var e=n.flags&&n.flags[t],r=null;return e&&(r=e.value),r})),r(this,"getTrait",(function(t){return n.traits&&n.traits[t]})),r(this,"setTrait",(function(t,e){var r=n.getJSON,i=n.identity,o=n.api;return r("".concat(o,"traits/"),"POST",JSON.stringify({identity:{identifier:i},trait_key:t,trait_value:e})).then(n.getFlags)})),r(this,"incrementTrait",(function(t,e){var r=n.getJSON,i=n.identity,o=n.api;return r("".concat(o,"traits/increment-value/"),"POST",JSON.stringify({trait_key:t,increment_by:e,identifier:i})).then(n.getFlags)})),r(this,"hasFeature",(function(t){var e=n.flags&&n.flags[t],r=!1;return e&&e.enabled&&(r=!0),r})),i=e.fetch?e.fetch:global.fetch,o=e.AsyncStorage}return function(t,e,r){e&&n(t.prototype,e),r&&n(t,r)}(t,[{key:"init",value:function(t){var e=this,n=t.environmentID,r=t.api,i=void 0===r?a:r,u=t.onChange,c=t.cacheFlags,s=t.onError,l=t.defaultFlags,f=t.preventFetch,h=t.enableLogs,v=t.AsyncStorage,p=t.state;return new Promise((function(t,r){if(e.environmentID=n,e.api=i,e.interval=null,e.onChange=u,e.onError=s,e.enableLogs=h,e.flags=Object.assign({},l)||{},e.initialised=!0,e.timer=e.enableLogs?(new Date).valueOf():null,v&&(o=v),e.cacheFlags=void 0!==o&&c,e.setState(p),!n)throw r("Please specify a environment id"),"Please specify a environment id";c?o.getItem("BULLET_TRAIN_DB",(function(n,i){if(i)try{var o=JSON.parse(i);e.setState(o),e.log("Retrieved flags from cache",o),e.flags?(e.onChange&&e.onChange(null,{isFromServer:!1}),t(),e.getFlags(Promise.resolve,Promise.reject)):e.getFlags(t,r)}catch(t){e.log("Exception fetching cached logs",t)}})):!f&&e.getFlags(t,r)}))}},{key:"getAllFlags",value:function(){return this.flags}},{key:"identify",value:function(t){this.identity=t,this.initialised&&!this.interval&&this.getFlags()}},{key:"getState",value:function(){return{api:this.api,environmentID:this.environmentID,flags:this.flags,identity:this.identity,segments:this.segments,traits:this.traits}}},{key:"setState",value:function(t){t&&(this.initialised=!0,this.api=t.api||this.api||a,this.environmentID=t.environmentID||this.environmentID,this.flags=t.flags||this.flags,this.identity=t.identity||this.identity,this.segments=t.segments||this.segments,this.traits=t.traits||this.traits)}},{key:"log",value:function(){if(this.enableLogs){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];console.log.apply(this,["BULLET TRAIN:",(new Date).valueOf()-this.timer,"ms"].concat(e))}}},{key:"updateStorage",value:function(){if(this.cacheFlags){var t=JSON.stringify(this.getState());this.log("Setting storage",t),o.setItem("BULLET_TRAIN_DB",t)}}},{key:"logout",value:function(){this.identity=null,this.segments=null,this.traits=null,this.initialised&&!this.interval&&this.getFlags()}},{key:"startListening",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1e3;this.interval||(this.interval=setInterval(this.getFlags,t))}},{key:"getSegments",value:function(){}},{key:"stopListening",value:function(){clearInterval(this.interval)}}]),t}();t.exports=function(t){var e=t.fetch,n=t.AsyncStorage;return new u({fetch:e,AsyncStorage:n})}}])}));

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

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){e.exports=require("stream")},function(e,t){e.exports=require("zlib")},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("https")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var s,u=e[Symbol.iterator]();!(n=(s=u.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=r(9),s=(n=i)&&n.__esModule?n:{default:n};var u={getItem:function(e,t){return u.multiGet([e]).then((function(e){return e[0][1]})).then((function(e){return t&&t(null,e),e})).catch((function(e){return t&&t(e,null),e}))},setItem:function(e,t,r){return u.multiSet([[e,t]]).then((function(e){return r&&r(null,e),e})).catch((function(e){return r&&r(e,null),e}))},getAllKeys:function(e){return Promise.resolve(Object.keys(localStorage)).then((function(t){return e&&e(null,t),t})).catch((function(t){return e&&e(t,null),t}))},removeItem:function(e,t){return u.multiRemove([e]).then((function(){t&&t(null)})).catch((function(e){t&&t(e,null)}))},clear:function(){return new Promise((function(e){window.localStorage.clear(),e()}))},mergeItem:function(e,t){return u.multiMerge([[e,t]])},multiGet:function(e){return new Promise((function(t){t(e.reduce((function(e,t){return e.concat([[t,localStorage.getItem(t)]])}),[]))}))},multiSet:function(e){return new Promise((function(t,r){var n=[];return e.forEach((function(e){var t=o(e,2),r=t[0],i=t[1];try{localStorage.setItem(r,i)}catch(e){n.push(e)}})),n.length>0?r(n):t()}))},multiMerge:function(e){return new Promise((function(t,r){var n=[];return e.forEach((function(e){var t=o(e,2),r=t[0],i=t[1],u=localStorage.getItem(r);if(u)try{localStorage.setItem(r,JSON.stringify((0,s.default)(JSON.parse(u),JSON.parse(i))))}catch(e){n.push(e)}})),n.length>0?r(n):t()}))},multiRemove:function(e){return new Promise((function(t){e.forEach((function(e){return window.localStorage.removeItem(e)})),t()}))},flushGetRequests:function(){console.warn("AsyncStorage.flushGetRequests: Not supported on `web`")}};t.default=u},function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),i=r(7).default;"undefined"==typeof window&&(i=r(8).default);var s=r(11)({AsyncStorage:o.a,fetch:i});"undefined"!=typeof window&&(window.bulletTrain=s),t.default=s},function(e,t,r){"use strict";r.r(t),t.default=function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],s=[],u={},a=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:a,headers:{keys:function(){return i},entries:function(){return s},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){i.push(t=t.toLowerCase()),s.push([t,r]),u[t]=u[t]?u[t]+","+r:r})),r(a())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"Headers",(function(){return A})),r.d(t,"Request",(function(){return M})),r.d(t,"Response",(function(){return R})),r.d(t,"FetchError",(function(){return h}));var n=r(0),o=r(3),i=r(2),s=r(4),u=r(1);const a=n.Readable,c=Symbol("buffer"),l=Symbol("type");class f{constructor(){this[l]="";const e=arguments[0],t=arguments[1],r=[];let n=0;if(e){const t=e,o=Number(t.length);for(let e=0;e<o;e++){const o=t[e];let i;n+=(i=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof f?o[c]:Buffer.from("string"==typeof o?o:String(o))).length,r.push(i)}}this[c]=Buffer.concat(r);let o=t&&void 0!==t.type&&String(t.type).toLowerCase();o&&!/[^\u0020-\u007E]/.test(o)&&(this[l]=o)}get size(){return this[c].length}get type(){return this[l]}text(){return Promise.resolve(this[c].toString())}arrayBuffer(){const e=this[c],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new a;return e._read=function(){},e.push(this[c]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let n,o;n=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),o=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const i=Math.max(o-n,0),s=this[c].slice(n,n+i),u=new f([],{type:arguments[2]});return u[c]=s,u}}function h(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let p;Object.defineProperties(f.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(f.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),h.prototype=Object.create(Error.prototype),h.prototype.constructor=h,h.prototype.name="FetchError";try{p=require("encoding").convert}catch(e){}const d=Symbol("Body internals"),y=n.PassThrough;function b(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let i=void 0===o?0:o;var s=r.timeout;let u=void 0===s?0:s;null==e?e=null:m(e)?e=Buffer.from(e.toString()):v(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof n||(e=Buffer.from(String(e)))),this[d]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=u,e instanceof n&&e.on("error",(function(e){const r="AbortError"===e.name?e:new h(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[d].error=r}))}function g(){var e=this;if(this[d].disturbed)return b.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[d].disturbed=!0,this[d].error)return b.Promise.reject(this[d].error);let t=this.body;if(null===t)return b.Promise.resolve(Buffer.alloc(0));if(v(t)&&(t=t.stream()),Buffer.isBuffer(t))return b.Promise.resolve(t);if(!(t instanceof n))return b.Promise.resolve(Buffer.alloc(0));let r=[],o=0,i=!1;return new b.Promise((function(n,s){let u;e.timeout&&(u=setTimeout((function(){i=!0,s(new h(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(i=!0,s(t)):s(new h(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!i&&null!==t){if(e.size&&o+t.length>e.size)return i=!0,void s(new h(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!i){clearTimeout(u);try{n(Buffer.concat(r,o))}catch(t){s(new h(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function m(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function v(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function w(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof n&&"function"!=typeof o.getBoundary&&(t=new y,r=new y,o.pipe(t),o.pipe(r),e[d].body=t,o=r),o}function _(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":m(e)?"application/x-www-form-urlencoded;charset=UTF-8":v(e)?e.type||null:Buffer.isBuffer(e)?null:"[object ArrayBuffer]"===Object.prototype.toString.call(e)?null:ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof n?null:"text/plain;charset=UTF-8"}function j(e){const t=e.body;return null===t?0:v(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}b.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return g.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return g.call(this).then((function(t){return Object.assign(new f([],{type:e.toLowerCase()}),{[c]:t})}))},json(){var e=this;return g.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return b.Promise.reject(new h(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return g.call(this).then((function(e){return e.toString()}))},buffer(){return g.call(this)},textConverted(){var e=this;return g.call(this).then((function(t){return function(e,t){if("function"!=typeof p)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let n,o,i="utf-8";r&&(n=/charset=([^;]*)/i.exec(r));o=e.slice(0,1024).toString(),!n&&o&&(n=/<meta.+?charset=(['"])(.+?)\1/i.exec(o));!n&&o&&(n=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(o))&&(n=/charset=(.*)/i.exec(n.pop()));!n&&o&&(n=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(o));n&&("gb2312"!==(i=n.pop())&&"gbk"!==i||(i="gb18030"));return p(e,"UTF-8",i).toString()}(t,e.headers)}))}},Object.defineProperties(b.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),b.mixIn=function(e){for(const t of Object.getOwnPropertyNames(b.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(b.prototype,t);Object.defineProperty(e,t,r)}},b.Promise=global.Promise;const S=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,O=/[^\t\x20-\x7e\x80-\xff]/;function T(e){if(e=`${e}`,S.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function P(e){if(e=`${e}`,O.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function x(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const E=Symbol("map");class A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[E]=Object.create(null),e instanceof A){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){T(e=`${e}`);const t=x(this[E],e);return void 0===t?null:this[E][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=B(this),n=0;for(;n<r.length;){var o=r[n];const i=o[0],s=o[1];e.call(t,s,i,this),r=B(this),n++}}set(e,t){t=`${t}`,T(e=`${e}`),P(t);const r=x(this[E],e);this[E][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,T(e=`${e}`),P(t);const r=x(this[E],e);void 0!==r?this[E][r].push(t):this[E][e]=[t]}has(e){return T(e=`${e}`),void 0!==x(this[E],e)}delete(e){T(e=`${e}`);const t=x(this[E],e);void 0!==t&&delete this[E][t]}raw(){return this[E]}keys(){return k(this,"key")}values(){return k(this,"value")}[Symbol.iterator](){return k(this,"key+value")}}function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[E]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[E][t].join(", ")}:function(t){return[t.toLowerCase(),e[E][t].join(", ")]})}A.prototype.entries=A.prototype[Symbol.iterator],Object.defineProperty(A.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(A.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const C=Symbol("internal");function k(e,t){const r=Object.create($);return r[C]={target:e,kind:t,index:0},r}const $=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==$)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[C];const t=e.target,r=e.kind,n=e.index,o=B(t,r);return n>=o.length?{value:void 0,done:!0}:(this[C].index=n+1,{value:o[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function z(e){const t=Object.assign({__proto__:null},e[E]),r=x(e[E],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty($,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const L=Symbol("Response internals"),I=o.STATUS_CODES;class R{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b.call(this,e,t);const r=t.status||200,n=new A(t.headers);if(null!=e&&!n.has("Content-Type")){const t=_(e);t&&n.append("Content-Type",t)}this[L]={url:t.url,status:r,statusText:t.statusText||I[r],headers:n,counter:t.counter}}get url(){return this[L].url||""}get status(){return this[L].status}get ok(){return this[L].status>=200&&this[L].status<300}get redirected(){return this[L].counter>0}get statusText(){return this[L].statusText}get headers(){return this[L].headers}clone(){return new R(w(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}b.mixIn(R.prototype),Object.defineProperties(R.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(R.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const F=Symbol("Request internals"),U=i.parse,q=i.format,N="destroy"in n.Readable.prototype;function D(e){return"object"==typeof e&&"object"==typeof e[F]}class M{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};D(e)?t=U(e.url):(t=e&&e.href?U(e.href):U(`${e}`),e={});let n=r.method||e.method||"GET";if(n=n.toUpperCase(),(null!=r.body||D(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=r.body?r.body:D(e)&&null!==e.body?w(e):null;b.call(this,o,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const i=new A(r.headers||e.headers||{});if(null!=o&&!i.has("Content-Type")){const e=_(o);e&&i.append("Content-Type",e)}let s=D(e)?e.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[F]={method:n,redirect:r.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[F].method}get url(){return q(this[F].parsedURL)}get headers(){return this[F].headers}get redirect(){return this[F].redirect}get signal(){return this[F].signal}clone(){return new M(this)}}function H(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}b.mixIn(M.prototype),Object.defineProperty(M.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(M.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),H.prototype=Object.create(Error.prototype),H.prototype.constructor=H,H.prototype.name="AbortError";const J=n.PassThrough,G=i.resolve;function V(e,t){if(!V.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return b.Promise=V.Promise,new V.Promise((function(r,i){const a=new M(e,t),c=function(e){const t=e[F].parsedURL,r=new A(e[F].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof n.Readable&&!N)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=j(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:z(r),agent:i})}(a),l=("https:"===c.protocol?s:o).request,f=a.signal;let p=null;const d=function(){let e=new H("The user aborted a request.");i(e),a.body&&a.body instanceof n.Readable&&a.body.destroy(e),p&&p.body&&p.body.emit("error",e)};if(f&&f.aborted)return void d();const y=function(){d(),m()},b=l(c);let g;function m(){b.abort(),f&&f.removeEventListener("abort",y),clearTimeout(g)}f&&f.addEventListener("abort",y),a.timeout&&b.once("socket",(function(e){g=setTimeout((function(){i(new h(`network timeout at: ${a.url}`,"request-timeout")),m()}),a.timeout)})),b.on("error",(function(e){i(new h(`request to ${a.url} failed, reason: ${e.message}`,"system",e)),m()})),b.on("response",(function(e){clearTimeout(g);const t=function(e){const t=new A;for(const r of Object.keys(e))if(!S.test(r))if(Array.isArray(e[r]))for(const n of e[r])O.test(n)||(void 0===t[E][r]?t[E][r]=[n]:t[E][r].push(n));else O.test(e[r])||(t[E][r]=[e[r]]);return t}(e.headers);if(V.isRedirect(e.statusCode)){const n=t.get("Location"),o=null===n?null:G(a.url,n);switch(a.redirect){case"error":return i(new h(`redirect mode is set to error: ${a.url}`,"no-redirect")),void m();case"manual":if(null!==o)try{t.set("Location",o)}catch(e){i(e)}break;case"follow":if(null===o)break;if(a.counter>=a.follow)return i(new h(`maximum redirect reached at: ${a.url}`,"max-redirect")),void m();const n={headers:new A(a.headers),follow:a.follow,counter:a.counter+1,agent:a.agent,compress:a.compress,method:a.method,body:a.body,signal:a.signal,timeout:a.timeout};return 303!==e.statusCode&&a.body&&null===j(a)?(i(new h("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void m()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==a.method)||(n.method="GET",n.body=void 0,n.headers.delete("content-length")),r(V(new M(o,n))),void m())}}e.once("end",(function(){f&&f.removeEventListener("abort",y)}));let n=e.pipe(new J);const o={url:a.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:a.size,timeout:a.timeout,counter:a.counter},s=t.get("Content-Encoding");if(!a.compress||"HEAD"===a.method||null===s||204===e.statusCode||304===e.statusCode)return p=new R(n,o),void r(p);const c={flush:u.Z_SYNC_FLUSH,finishFlush:u.Z_SYNC_FLUSH};if("gzip"==s||"x-gzip"==s)return n=n.pipe(u.createGunzip(c)),p=new R(n,o),void r(p);if("deflate"!=s&&"x-deflate"!=s){if("br"==s&&"function"==typeof u.createBrotliDecompress)return n=n.pipe(u.createBrotliDecompress()),p=new R(n,o),void r(p);p=new R(n,o),r(p)}else{e.pipe(new J).once("data",(function(e){n=8==(15&e[0])?n.pipe(u.createInflate()):n.pipe(u.createInflateRaw()),p=new R(n,o),r(p)}))}})),function(e,t){const r=t.body;null===r?e.end():v(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(b,a)}))}V.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},V.Promise=global.Promise,t.default=V},function(e,t,r){(function(e){var r=200,n="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,u="[object Arguments]",a="[object AsyncFunction]",c="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",p="[object Proxy]",d="[object Undefined]",y=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[u]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[c]=g["[object Map]"]=g["[object Number]"]=g[h]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,w=m||v||Function("return this")(),_=t&&!t.nodeType&&t,j=_&&"object"==typeof e&&e&&!e.nodeType&&e,S=j&&j.exports===_,O=S&&m.process,T=function(){try{var e=j&&j.require&&j.require("util").types;return e||O&&O.binding&&O.binding("util")}catch(e){}}(),P=T&&T.isTypedArray;function x(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var E,A,B,C=Array.prototype,k=Function.prototype,$=Object.prototype,z=w["__core-js_shared__"],L=k.toString,I=$.hasOwnProperty,R=(E=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",F=$.toString,U=L.call(Object),q=RegExp("^"+L.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=S?w.Buffer:void 0,D=w.Symbol,M=w.Uint8Array,H=N?N.allocUnsafe:void 0,J=(A=Object.getPrototypeOf,B=Object,function(e){return A(B(e))}),G=Object.create,V=$.propertyIsEnumerable,K=C.splice,Z=D?D.toStringTag:void 0,Y=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=N?N.isBuffer:void 0,X=Math.max,Q=Date.now,ee=_e(w,"Map"),te=_e(Object,"create"),re=function(){function e(){}return function(t){if(!$e(t))return{};if(G)return G(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function se(e){var t=this.__data__=new oe(e);this.size=t.size}function ue(e,t){var r=Ee(e),n=!r&&xe(e),o=!r&&!n&&Be(e),i=!r&&!n&&!o&&Le(e),s=r||n||o||i,u=s?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],a=u.length;for(var c in e)!t&&!I.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||je(c,a))||u.push(c);return u}function ae(e,t,r){(void 0===r||Pe(e[t],r))&&(void 0!==r||t in e)||fe(e,t,r)}function ce(e,t,r){var n=e[t];I.call(e,t)&&Pe(n,r)&&(void 0!==r||t in e)||fe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1}function fe(e,t,r){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===n?void 0:r}return I.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:I.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?n:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0)&&(r==t.length-1?t.pop():K.call(t,r,1),--this.size,!0)},oe.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ie.prototype.delete=function(e){var t=we(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return we(this,e).get(e)},ie.prototype.has=function(e){return we(this,e).has(e)},ie.prototype.set=function(e,t){var r=we(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},se.prototype.clear=function(){this.__data__=new oe,this.size=0},se.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||o.length<r-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ie(o)}return n.set(e,t),this.size=n.size,this};var he,pe=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),s=i.length;s--;){var u=i[he?s:++n];if(!1===t(o[u],u,o))break}return e};function de(e){return null==e?void 0===e?d:f:Z&&Z in Object(e)?function(e){var t=I.call(e,Z),r=e[Z];try{e[Z]=void 0;var n=!0}catch(e){}var o=F.call(e);n&&(t?e[Z]=r:delete e[Z]);return o}(e):function(e){return F.call(e)}(e)}function ye(e){return ze(e)&&de(e)==u}function be(e){return!(!$e(e)||function(e){return!!R&&R in e}(e))&&(Ce(e)?q:y).test(function(e){if(null!=e){try{return L.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!$e(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Se(e),r=[];for(var n in e)("constructor"!=n||!t&&I.call(e,n))&&r.push(n);return r}function me(e,t,r,n,o){e!==t&&pe(t,(function(i,s){if(o||(o=new se),$e(i))!function(e,t,r,n,o,i,s){var u=Oe(e,r),a=Oe(t,r),c=s.get(a);if(c)return void ae(e,r,c);var l=i?i(u,a,r+"",e,t,s):void 0,f=void 0===l;if(f){var p=Ee(a),d=!p&&Be(a),y=!p&&!d&&Le(a);l=a,p||d||y?Ee(u)?l=u:ze(w=u)&&Ae(w)?l=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(u):d?(f=!1,l=function(e,t){if(t)return e.slice();var r=e.length,n=H?H(r):new e.constructor(r);return e.copy(n),n}(a,!0)):y?(f=!1,b=a,g=!0?(m=b.buffer,v=new m.constructor(m.byteLength),new M(v).set(new M(m)),v):b.buffer,l=new b.constructor(g,b.byteOffset,b.length)):l=[]:function(e){if(!ze(e)||de(e)!=h)return!1;var t=J(e);if(null===t)return!0;var r=I.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&L.call(r)==U}(a)||xe(a)?(l=u,xe(u)?l=function(e){return function(e,t,r,n){var o=!r;r||(r={});var i=-1,s=t.length;for(;++i<s;){var u=t[i],a=n?n(r[u],e[u],u,r,e):void 0;void 0===a&&(a=e[u]),o?fe(r,u,a):ce(r,u,a)}return r}(e,Ie(e))}(u):$e(u)&&!Ce(u)||(l=function(e){return"function"!=typeof e.constructor||Se(e)?{}:re(J(e))}(a))):f=!1}var b,g,m,v;var w;f&&(s.set(a,l),o(l,a,n,i,s),s.delete(a));ae(e,r,l)}(e,t,s,r,me,n,o);else{var u=n?n(Oe(e,s),i,s+"",e,t,o):void 0;void 0===u&&(u=i),ae(e,s,u)}}),Ie)}function ve(e,t){return Te(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=X(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=n[o];return u[t]=r(s),x(e,this,u)}}(e,t,Ue),e+"")}function we(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function _e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return be(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?s:t)&&("number"==r||"symbol"!=r&&b.test(e))&&e>-1&&e%1==0&&e<t}function Se(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$)}function Oe(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Te=function(e){var t=0,r=0;return function(){var n=Q(),s=i-(n-r);if(r=n,s>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Y?function(e,t){return Y(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:Ue);function Pe(e,t){return e===t||e!=e&&t!=t}var xe=ye(function(){return arguments}())?ye:function(e){return ze(e)&&I.call(e,"callee")&&!V.call(e,"callee")},Ee=Array.isArray;function Ae(e){return null!=e&&ke(e.length)&&!Ce(e)}var Be=W||function(){return!1};function Ce(e){if(!$e(e))return!1;var t=de(e);return t==c||t==l||t==a||t==p}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function $e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ze(e){return null!=e&&"object"==typeof e}var Le=P?function(e){return function(t){return e(t)}}(P):function(e){return ze(e)&&ke(e.length)&&!!g[de(e)]};function Ie(e){return Ae(e)?ue(e,!0):ge(e)}var Re,Fe=(Re=function(e,t,r){me(e,t,r)},ve((function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(e,t,r){if(!$e(r))return!1;var n=typeof t;return!!("number"==n?Ae(r)&&je(t,r.length):"string"==n&&t in r)&&Pe(r[t],e)}(t[0],t[1],i)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var s=t[r];s&&Re(e,s,r,o)}return e})));function Ue(e){return e}e.exports=Fe}).call(this,r(10)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){function r(e,t){for(var r,n=0;n<t.length;n++)(r=t[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,i,s="https://api.bullet-train.io/api/v1/",u=function(){function e(t){var r=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),n(this,"getJSON",(function(e,t,n){var i={method:t||"GET",body:n,headers:{"x-environment-key":r.environmentID}};return"GET"!==t&&(i.headers["Content-Type"]="application/json; charset=utf-8"),o(e,i).then((function(e){return 200<=e.status&&300>e.status?e:e.text().then((function(e){var t=e;try{t=JSON.parse(e)}catch(e){}return Promise.reject(t)}))})).then((function(e){return e.json()}))})),n(this,"getFlags",(function(e,t){var n=r.onChange,o=r.onError,i=r.identity,s=r.api,u=(r.disableCache,!1),a=function(e,t){var o=e.flags,i=e.traits,s={},u={};if(i=i||[],(o=o||[]).forEach((function(e){s[e.feature.name.toLowerCase().replace(/ /g,"_")]={enabled:e.enabled,value:e.feature_state_value}})),i.forEach((function(e){u[e.trait_key.toLowerCase().replace(/ /g,"_")]=e.trait_value})),r.oldFlags=s,r.flags=s,r.traits=u,t){var a={};t.map((function(e){a[e.name]=e})),r.segments=a}n&&n(r.oldFlags,{isFromServer:!0})};return i?Promise.all([r.getJSON(s+"identities/?identifier="+encodeURIComponent(i))]).then((function(e){a(e[0],e[1])})).catch((function(e){var t=e.message;o&&o({message:t})})):Promise.all([r.getJSON(s+"flags/")]).then((function(t){a({flags:t[0]},null),e&&!u&&(u=!0,e())})).catch((function(e){t&&!u&&(u=!0,t(e)),o&&o(e)}))})),n(this,"getValue",(function(e){var t=r.flags&&r.flags[e],n=null;return t&&(n=t.value),n})),n(this,"getTrait",(function(e){return r.traits&&r.traits[e]})),n(this,"setTrait",(function(e,t){var n=r.getJSON,o=r.identity,i=r.api;return n("".concat(i,"traits/"),"POST",JSON.stringify({identity:{identifier:o},trait_key:e,trait_value:t})).then(r.getFlags)})),n(this,"incrementTrait",(function(e,t){var n=r.getJSON,o=r.identity,i=r.api;return n("".concat(i,"traits/increment-value/"),"POST",JSON.stringify({trait_key:e,increment_by:t,identifier:o})).then(r.getFlags)})),n(this,"hasFeature",(function(e){var t=r.flags&&r.flags[e],n=!1;return t&&t.enabled&&(n=!0),n})),o=t.fetch?t.fetch:global.fetch,i=t.AsyncStorage}return function(e,t,n){t&&r(e.prototype,t),n&&r(e,n)}(e,[{key:"init",value:function(e){var t=this,r=e.environmentID,n=e.api,o=void 0===n?s:n,u=e.onChange,a=e.disableCache,c=e.onError,l=e.defaultFlags,f=e.preventFetch,h=e.state;return new Promise((function(e,n){if(t.environmentID=r,t.api=o,t.interval=null,t.disableCache=a,t.onChange=u,t.onError=c,t.flags=Object.assign({},l)||{},t.initialised=!0,t.setState(h),!r)throw n("Please specify a environment id"),"Please specify a environment id";a||i.getItem("BULLET_TRAIN_DB",(function(r,o){t.flags=o?JSON.parse(o):l,t.flags&&t.onChange&&t.onChange(null,{isFromServer:!1}),f||t.getFlags(e,n)}))}))}},{key:"getAllFlags",value:function(){return this.flags}},{key:"identify",value:function(e){this.identity=e,this.initialised&&!this.interval&&this.getFlags()}},{key:"getState",value:function(){return{api:this.api,environmentID:this.environmentID,flags:this.flags,identity:this.identity,segments:this.segments,traits:this.traits}}},{key:"setState",value:function(e){e&&(this.initialised=!0,this.api=e.api||this.api||s,this.environmentID=e.environmentID||this.environmentID,this.flags=e.flags||this.flags,this.identity=e.identity||this.identity,this.segments=e.segments||this.segments,this.traits=e.traits||this.traits)}},{key:"logout",value:function(){this.identity=null,this.segments=null,this.traits=null,this.initialised&&!this.interval&&this.getFlags()}},{key:"startListening",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1e3;this.interval||(this.interval=setInterval(this.getFlags,e))}},{key:"getSegments",value:function(){}},{key:"stopListening",value:function(){clearInterval(this.interval)}}]),e}();e.exports=function(e){var t=e.fetch,r=e.AsyncStorage;return new u({fetch:t,AsyncStorage:r})}}])}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){e.exports=require("stream")},function(e,t){e.exports=require("zlib")},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("https")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=r(9),s=(n=i)&&n.__esModule?n:{default:n};var a={getItem:function(e,t){return a.multiGet([e]).then((function(e){return e[0][1]})).then((function(e){return t&&t(null,e),e})).catch((function(e){return t&&t(e,null),e}))},setItem:function(e,t,r){return a.multiSet([[e,t]]).then((function(e){return r&&r(null,e),e})).catch((function(e){return r&&r(e,null),e}))},getAllKeys:function(e){return Promise.resolve(Object.keys(localStorage)).then((function(t){return e&&e(null,t),t})).catch((function(t){return e&&e(t,null),t}))},removeItem:function(e,t){return a.multiRemove([e]).then((function(){t&&t(null)})).catch((function(e){t&&t(e,null)}))},clear:function(){return new Promise((function(e){window.localStorage.clear(),e()}))},mergeItem:function(e,t){return a.multiMerge([[e,t]])},multiGet:function(e){return new Promise((function(t){t(e.reduce((function(e,t){return e.concat([[t,localStorage.getItem(t)]])}),[]))}))},multiSet:function(e){return new Promise((function(t,r){var n=[];return e.forEach((function(e){var t=o(e,2),r=t[0],i=t[1];try{localStorage.setItem(r,i)}catch(e){n.push(e)}})),n.length>0?r(n):t()}))},multiMerge:function(e){return new Promise((function(t,r){var n=[];return e.forEach((function(e){var t=o(e,2),r=t[0],i=t[1],a=localStorage.getItem(r);if(a)try{localStorage.setItem(r,JSON.stringify((0,s.default)(JSON.parse(a),JSON.parse(i))))}catch(e){n.push(e)}})),n.length>0?r(n):t()}))},multiRemove:function(e){return new Promise((function(t){e.forEach((function(e){return window.localStorage.removeItem(e)})),t()}))},flushGetRequests:function(){console.warn("AsyncStorage.flushGetRequests: Not supported on `web`")}};t.default=a},function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),i=r(7).default;"undefined"==typeof window&&(i=r(8).default);var s=r(11)({AsyncStorage:o.a,fetch:i});"undefined"!=typeof window&&(window.bulletTrain=s),t.default=s},function(e,t,r){"use strict";r.r(t),t.default=function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],s=[],a={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){i.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"Headers",(function(){return A})),r.d(t,"Request",(function(){return M})),r.d(t,"Response",(function(){return R})),r.d(t,"FetchError",(function(){return h}));var n=r(0),o=r(3),i=r(2),s=r(4),a=r(1);const u=n.Readable,c=Symbol("buffer"),l=Symbol("type");class f{constructor(){this[l]="";const e=arguments[0],t=arguments[1],r=[];let n=0;if(e){const t=e,o=Number(t.length);for(let e=0;e<o;e++){const o=t[e];let i;n+=(i=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof f?o[c]:Buffer.from("string"==typeof o?o:String(o))).length,r.push(i)}}this[c]=Buffer.concat(r);let o=t&&void 0!==t.type&&String(t.type).toLowerCase();o&&!/[^\u0020-\u007E]/.test(o)&&(this[l]=o)}get size(){return this[c].length}get type(){return this[l]}text(){return Promise.resolve(this[c].toString())}arrayBuffer(){const e=this[c],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new u;return e._read=function(){},e.push(this[c]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let n,o;n=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),o=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const i=Math.max(o-n,0),s=this[c].slice(n,n+i),a=new f([],{type:arguments[2]});return a[c]=s,a}}function h(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let p;Object.defineProperties(f.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(f.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),h.prototype=Object.create(Error.prototype),h.prototype.constructor=h,h.prototype.name="FetchError";try{p=require("encoding").convert}catch(e){}const d=Symbol("Body internals"),y=n.PassThrough;function b(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let i=void 0===o?0:o;var s=r.timeout;let a=void 0===s?0:s;null==e?e=null:m(e)?e=Buffer.from(e.toString()):v(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof n||(e=Buffer.from(String(e)))),this[d]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=a,e instanceof n&&e.on("error",(function(e){const r="AbortError"===e.name?e:new h(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[d].error=r}))}function g(){var e=this;if(this[d].disturbed)return b.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[d].disturbed=!0,this[d].error)return b.Promise.reject(this[d].error);let t=this.body;if(null===t)return b.Promise.resolve(Buffer.alloc(0));if(v(t)&&(t=t.stream()),Buffer.isBuffer(t))return b.Promise.resolve(t);if(!(t instanceof n))return b.Promise.resolve(Buffer.alloc(0));let r=[],o=0,i=!1;return new b.Promise((function(n,s){let a;e.timeout&&(a=setTimeout((function(){i=!0,s(new h(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(i=!0,s(t)):s(new h(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!i&&null!==t){if(e.size&&o+t.length>e.size)return i=!0,void s(new h(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!i){clearTimeout(a);try{n(Buffer.concat(r,o))}catch(t){s(new h(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function m(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function v(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function w(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof n&&"function"!=typeof o.getBoundary&&(t=new y,r=new y,o.pipe(t),o.pipe(r),e[d].body=t,o=r),o}function _(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":m(e)?"application/x-www-form-urlencoded;charset=UTF-8":v(e)?e.type||null:Buffer.isBuffer(e)?null:"[object ArrayBuffer]"===Object.prototype.toString.call(e)?null:ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof n?null:"text/plain;charset=UTF-8"}function j(e){const t=e.body;return null===t?0:v(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}b.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return g.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return g.call(this).then((function(t){return Object.assign(new f([],{type:e.toLowerCase()}),{[c]:t})}))},json(){var e=this;return g.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return b.Promise.reject(new h(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return g.call(this).then((function(e){return e.toString()}))},buffer(){return g.call(this)},textConverted(){var e=this;return g.call(this).then((function(t){return function(e,t){if("function"!=typeof p)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let n,o,i="utf-8";r&&(n=/charset=([^;]*)/i.exec(r));o=e.slice(0,1024).toString(),!n&&o&&(n=/<meta.+?charset=(['"])(.+?)\1/i.exec(o));!n&&o&&(n=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(o))&&(n=/charset=(.*)/i.exec(n.pop()));!n&&o&&(n=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(o));n&&("gb2312"!==(i=n.pop())&&"gbk"!==i||(i="gb18030"));return p(e,"UTF-8",i).toString()}(t,e.headers)}))}},Object.defineProperties(b.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),b.mixIn=function(e){for(const t of Object.getOwnPropertyNames(b.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(b.prototype,t);Object.defineProperty(e,t,r)}},b.Promise=global.Promise;const S=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,O=/[^\t\x20-\x7e\x80-\xff]/;function T(e){if(e=`${e}`,S.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function P(e){if(e=`${e}`,O.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function x(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const E=Symbol("map");class A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[E]=Object.create(null),e instanceof A){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){T(e=`${e}`);const t=x(this[E],e);return void 0===t?null:this[E][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=B(this),n=0;for(;n<r.length;){var o=r[n];const i=o[0],s=o[1];e.call(t,s,i,this),r=B(this),n++}}set(e,t){t=`${t}`,T(e=`${e}`),P(t);const r=x(this[E],e);this[E][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,T(e=`${e}`),P(t);const r=x(this[E],e);void 0!==r?this[E][r].push(t):this[E][e]=[t]}has(e){return T(e=`${e}`),void 0!==x(this[E],e)}delete(e){T(e=`${e}`);const t=x(this[E],e);void 0!==t&&delete this[E][t]}raw(){return this[E]}keys(){return L(this,"key")}values(){return L(this,"value")}[Symbol.iterator](){return L(this,"key+value")}}function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[E]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[E][t].join(", ")}:function(t){return[t.toLowerCase(),e[E][t].join(", ")]})}A.prototype.entries=A.prototype[Symbol.iterator],Object.defineProperty(A.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(A.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const k=Symbol("internal");function L(e,t){const r=Object.create(C);return r[k]={target:e,kind:t,index:0},r}const C=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==C)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[k];const t=e.target,r=e.kind,n=e.index,o=B(t,r);return n>=o.length?{value:void 0,done:!0}:(this[k].index=n+1,{value:o[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function $(e){const t=Object.assign({__proto__:null},e[E]),r=x(e[E],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(C,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const z=Symbol("Response internals"),I=o.STATUS_CODES;class R{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b.call(this,e,t);const r=t.status||200,n=new A(t.headers);if(null!=e&&!n.has("Content-Type")){const t=_(e);t&&n.append("Content-Type",t)}this[z]={url:t.url,status:r,statusText:t.statusText||I[r],headers:n,counter:t.counter}}get url(){return this[z].url||""}get status(){return this[z].status}get ok(){return this[z].status>=200&&this[z].status<300}get redirected(){return this[z].counter>0}get statusText(){return this[z].statusText}get headers(){return this[z].headers}clone(){return new R(w(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}b.mixIn(R.prototype),Object.defineProperties(R.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(R.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const F=Symbol("Request internals"),U=i.parse,N=i.format,q="destroy"in n.Readable.prototype;function D(e){return"object"==typeof e&&"object"==typeof e[F]}class M{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};D(e)?t=U(e.url):(t=e&&e.href?U(e.href):U(`${e}`),e={});let n=r.method||e.method||"GET";if(n=n.toUpperCase(),(null!=r.body||D(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=r.body?r.body:D(e)&&null!==e.body?w(e):null;b.call(this,o,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const i=new A(r.headers||e.headers||{});if(null!=o&&!i.has("Content-Type")){const e=_(o);e&&i.append("Content-Type",e)}let s=D(e)?e.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[F]={method:n,redirect:r.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[F].method}get url(){return N(this[F].parsedURL)}get headers(){return this[F].headers}get redirect(){return this[F].redirect}get signal(){return this[F].signal}clone(){return new M(this)}}function H(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}b.mixIn(M.prototype),Object.defineProperty(M.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(M.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),H.prototype=Object.create(Error.prototype),H.prototype.constructor=H,H.prototype.name="AbortError";const J=n.PassThrough,G=i.resolve;function V(e,t){if(!V.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return b.Promise=V.Promise,new V.Promise((function(r,i){const u=new M(e,t),c=function(e){const t=e[F].parsedURL,r=new A(e[F].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof n.Readable&&!q)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=j(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:$(r),agent:i})}(u),l=("https:"===c.protocol?s:o).request,f=u.signal;let p=null;const d=function(){let e=new H("The user aborted a request.");i(e),u.body&&u.body instanceof n.Readable&&u.body.destroy(e),p&&p.body&&p.body.emit("error",e)};if(f&&f.aborted)return void d();const y=function(){d(),m()},b=l(c);let g;function m(){b.abort(),f&&f.removeEventListener("abort",y),clearTimeout(g)}f&&f.addEventListener("abort",y),u.timeout&&b.once("socket",(function(e){g=setTimeout((function(){i(new h(`network timeout at: ${u.url}`,"request-timeout")),m()}),u.timeout)})),b.on("error",(function(e){i(new h(`request to ${u.url} failed, reason: ${e.message}`,"system",e)),m()})),b.on("response",(function(e){clearTimeout(g);const t=function(e){const t=new A;for(const r of Object.keys(e))if(!S.test(r))if(Array.isArray(e[r]))for(const n of e[r])O.test(n)||(void 0===t[E][r]?t[E][r]=[n]:t[E][r].push(n));else O.test(e[r])||(t[E][r]=[e[r]]);return t}(e.headers);if(V.isRedirect(e.statusCode)){const n=t.get("Location"),o=null===n?null:G(u.url,n);switch(u.redirect){case"error":return i(new h(`redirect mode is set to error: ${u.url}`,"no-redirect")),void m();case"manual":if(null!==o)try{t.set("Location",o)}catch(e){i(e)}break;case"follow":if(null===o)break;if(u.counter>=u.follow)return i(new h(`maximum redirect reached at: ${u.url}`,"max-redirect")),void m();const n={headers:new A(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout};return 303!==e.statusCode&&u.body&&null===j(u)?(i(new h("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void m()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==u.method)||(n.method="GET",n.body=void 0,n.headers.delete("content-length")),r(V(new M(o,n))),void m())}}e.once("end",(function(){f&&f.removeEventListener("abort",y)}));let n=e.pipe(new J);const o={url:u.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:u.size,timeout:u.timeout,counter:u.counter},s=t.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===s||204===e.statusCode||304===e.statusCode)return p=new R(n,o),void r(p);const c={flush:a.Z_SYNC_FLUSH,finishFlush:a.Z_SYNC_FLUSH};if("gzip"==s||"x-gzip"==s)return n=n.pipe(a.createGunzip(c)),p=new R(n,o),void r(p);if("deflate"!=s&&"x-deflate"!=s){if("br"==s&&"function"==typeof a.createBrotliDecompress)return n=n.pipe(a.createBrotliDecompress()),p=new R(n,o),void r(p);p=new R(n,o),r(p)}else{e.pipe(new J).once("data",(function(e){n=8==(15&e[0])?n.pipe(a.createInflate()):n.pipe(a.createInflateRaw()),p=new R(n,o),r(p)}))}})),function(e,t){const r=t.body;null===r?e.end():v(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(b,u)}))}V.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},V.Promise=global.Promise,t.default=V},function(e,t,r){(function(e){var r=200,n="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",u="[object AsyncFunction]",c="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",p="[object Proxy]",d="[object Undefined]",y=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[a]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[c]=g["[object Map]"]=g["[object Number]"]=g[h]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,w=m||v||Function("return this")(),_=t&&!t.nodeType&&t,j=_&&"object"==typeof e&&e&&!e.nodeType&&e,S=j&&j.exports===_,O=S&&m.process,T=function(){try{var e=j&&j.require&&j.require("util").types;return e||O&&O.binding&&O.binding("util")}catch(e){}}(),P=T&&T.isTypedArray;function x(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var E,A,B,k=Array.prototype,L=Function.prototype,C=Object.prototype,$=w["__core-js_shared__"],z=L.toString,I=C.hasOwnProperty,R=(E=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",F=C.toString,U=z.call(Object),N=RegExp("^"+z.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),q=S?w.Buffer:void 0,D=w.Symbol,M=w.Uint8Array,H=q?q.allocUnsafe:void 0,J=(A=Object.getPrototypeOf,B=Object,function(e){return A(B(e))}),G=Object.create,V=C.propertyIsEnumerable,K=k.splice,Z=D?D.toStringTag:void 0,Y=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=q?q.isBuffer:void 0,X=Math.max,Q=Date.now,ee=_e(w,"Map"),te=_e(Object,"create"),re=function(){function e(){}return function(t){if(!Ce(t))return{};if(G)return G(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function se(e){var t=this.__data__=new oe(e);this.size=t.size}function ae(e,t){var r=Ee(e),n=!r&&xe(e),o=!r&&!n&&Be(e),i=!r&&!n&&!o&&ze(e),s=r||n||o||i,a=s?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=a.length;for(var c in e)!t&&!I.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||je(c,u))||a.push(c);return a}function ue(e,t,r){(void 0===r||Pe(e[t],r))&&(void 0!==r||t in e)||fe(e,t,r)}function ce(e,t,r){var n=e[t];I.call(e,t)&&Pe(n,r)&&(void 0!==r||t in e)||fe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1}function fe(e,t,r){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===n?void 0:r}return I.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:I.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?n:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0)&&(r==t.length-1?t.pop():K.call(t,r,1),--this.size,!0)},oe.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ie.prototype.delete=function(e){var t=we(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return we(this,e).get(e)},ie.prototype.has=function(e){return we(this,e).has(e)},ie.prototype.set=function(e,t){var r=we(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},se.prototype.clear=function(){this.__data__=new oe,this.size=0},se.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||o.length<r-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ie(o)}return n.set(e,t),this.size=n.size,this};var he,pe=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),s=i.length;s--;){var a=i[he?s:++n];if(!1===t(o[a],a,o))break}return e};function de(e){return null==e?void 0===e?d:f:Z&&Z in Object(e)?function(e){var t=I.call(e,Z),r=e[Z];try{e[Z]=void 0;var n=!0}catch(e){}var o=F.call(e);n&&(t?e[Z]=r:delete e[Z]);return o}(e):function(e){return F.call(e)}(e)}function ye(e){return $e(e)&&de(e)==a}function be(e){return!(!Ce(e)||function(e){return!!R&&R in e}(e))&&(ke(e)?N:y).test(function(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!Ce(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Se(e),r=[];for(var n in e)("constructor"!=n||!t&&I.call(e,n))&&r.push(n);return r}function me(e,t,r,n,o){e!==t&&pe(t,(function(i,s){if(o||(o=new se),Ce(i))!function(e,t,r,n,o,i,s){var a=Oe(e,r),u=Oe(t,r),c=s.get(u);if(c)return void ue(e,r,c);var l=i?i(a,u,r+"",e,t,s):void 0,f=void 0===l;if(f){var p=Ee(u),d=!p&&Be(u),y=!p&&!d&&ze(u);l=u,p||d||y?Ee(a)?l=a:$e(w=a)&&Ae(w)?l=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(a):d?(f=!1,l=function(e,t){if(t)return e.slice();var r=e.length,n=H?H(r):new e.constructor(r);return e.copy(n),n}(u,!0)):y?(f=!1,b=u,g=!0?(m=b.buffer,v=new m.constructor(m.byteLength),new M(v).set(new M(m)),v):b.buffer,l=new b.constructor(g,b.byteOffset,b.length)):l=[]:function(e){if(!$e(e)||de(e)!=h)return!1;var t=J(e);if(null===t)return!0;var r=I.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&z.call(r)==U}(u)||xe(u)?(l=a,xe(a)?l=function(e){return function(e,t,r,n){var o=!r;r||(r={});var i=-1,s=t.length;for(;++i<s;){var a=t[i],u=n?n(r[a],e[a],a,r,e):void 0;void 0===u&&(u=e[a]),o?fe(r,a,u):ce(r,a,u)}return r}(e,Ie(e))}(a):Ce(a)&&!ke(a)||(l=function(e){return"function"!=typeof e.constructor||Se(e)?{}:re(J(e))}(u))):f=!1}var b,g,m,v;var w;f&&(s.set(u,l),o(l,u,n,i,s),s.delete(u));ue(e,r,l)}(e,t,s,r,me,n,o);else{var a=n?n(Oe(e,s),i,s+"",e,t,o):void 0;void 0===a&&(a=i),ue(e,s,a)}}),Ie)}function ve(e,t){return Te(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=X(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=r(s),x(e,this,a)}}(e,t,Ue),e+"")}function we(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function _e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return be(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?s:t)&&("number"==r||"symbol"!=r&&b.test(e))&&e>-1&&e%1==0&&e<t}function Se(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function Oe(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Te=function(e){var t=0,r=0;return function(){var n=Q(),s=i-(n-r);if(r=n,s>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Y?function(e,t){return Y(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:Ue);function Pe(e,t){return e===t||e!=e&&t!=t}var xe=ye(function(){return arguments}())?ye:function(e){return $e(e)&&I.call(e,"callee")&&!V.call(e,"callee")},Ee=Array.isArray;function Ae(e){return null!=e&&Le(e.length)&&!ke(e)}var Be=W||function(){return!1};function ke(e){if(!Ce(e))return!1;var t=de(e);return t==c||t==l||t==u||t==p}function Le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Ce(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function $e(e){return null!=e&&"object"==typeof e}var ze=P?function(e){return function(t){return e(t)}}(P):function(e){return $e(e)&&Le(e.length)&&!!g[de(e)]};function Ie(e){return Ae(e)?ae(e,!0):ge(e)}var Re,Fe=(Re=function(e,t,r){me(e,t,r)},ve((function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(e,t,r){if(!Ce(r))return!1;var n=typeof t;return!!("number"==n?Ae(r)&&je(t,r.length):"string"==n&&t in r)&&Pe(r[t],e)}(t[0],t[1],i)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var s=t[r];s&&Re(e,s,r,o)}return e})));function Ue(e){return e}e.exports=Fe}).call(this,r(10)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){function r(e,t){for(var r,n=0;n<t.length;n++)(r=t[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,i,s="https://api.bullet-train.io/api/v1/",a=function(){function e(t){var r=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),n(this,"getJSON",(function(e,t,n){var i={method:t||"GET",body:n,headers:{"x-environment-key":r.environmentID}};return"GET"!==t&&(i.headers["Content-Type"]="application/json; charset=utf-8"),o(e,i).then((function(e){return 200<=e.status&&300>e.status?e:e.text().then((function(e){var t=e;try{t=JSON.parse(e)}catch(e){}return Promise.reject(t)}))})).then((function(e){return e.json()}))})),n(this,"getFlags",(function(e,t){var n=r.onChange,o=r.onError,i=r.identity,s=r.api,a=(r.disableCache,!1),u=function(e,t){var o=e.flags,i=e.traits,s={},a={};if(i=i||[],(o=o||[]).forEach((function(e){s[e.feature.name.toLowerCase().replace(/ /g,"_")]={enabled:e.enabled,value:e.feature_state_value}})),i.forEach((function(e){a[e.trait_key.toLowerCase().replace(/ /g,"_")]=e.trait_value})),r.oldFlags=s,r.flags=s,r.traits=a,t){var u={};t.map((function(e){u[e.name]=e})),r.segments=u}r.updateStorage(),n&&n(r.oldFlags,{isFromServer:!0})};return i?Promise.all([r.getJSON(s+"identities/?identifier="+encodeURIComponent(i))]).then((function(e){u(e[0],e[1])})).catch((function(e){var t=e.message;o&&o({message:t})})):Promise.all([r.getJSON(s+"flags/")]).then((function(t){u({flags:t[0]},null),e&&!a&&(a=!0,e())})).catch((function(e){t&&!a&&(a=!0,t(e)),o&&o(e)}))})),n(this,"getValue",(function(e){var t=r.flags&&r.flags[e],n=null;return t&&(n=t.value),n})),n(this,"getTrait",(function(e){return r.traits&&r.traits[e]})),n(this,"setTrait",(function(e,t){var n=r.getJSON,o=r.identity,i=r.api;return n("".concat(i,"traits/"),"POST",JSON.stringify({identity:{identifier:o},trait_key:e,trait_value:t})).then(r.getFlags)})),n(this,"incrementTrait",(function(e,t){var n=r.getJSON,o=r.identity,i=r.api;return n("".concat(i,"traits/increment-value/"),"POST",JSON.stringify({trait_key:e,increment_by:t,identifier:o})).then(r.getFlags)})),n(this,"hasFeature",(function(e){var t=r.flags&&r.flags[e],n=!1;return t&&t.enabled&&(n=!0),n})),o=t.fetch?t.fetch:global.fetch,i=t.AsyncStorage}return function(e,t,n){t&&r(e.prototype,t),n&&r(e,n)}(e,[{key:"init",value:function(e){var t=this,r=e.environmentID,n=e.api,o=void 0===n?s:n,a=e.onChange,u=e.cacheFlags,c=e.onError,l=e.defaultFlags,f=e.preventFetch,h=e.enableLogs,p=e.AsyncStorage,d=e.state;return new Promise((function(e,n){if(t.environmentID=r,t.api=o,t.interval=null,t.onChange=a,t.onError=c,t.enableLogs=h,t.flags=Object.assign({},l)||{},t.initialised=!0,t.timer=t.enableLogs?(new Date).valueOf():null,p&&(i=p),t.cacheFlags=void 0!==i&&u,t.setState(d),!r)throw n("Please specify a environment id"),"Please specify a environment id";u?i.getItem("BULLET_TRAIN_DB",(function(r,o){if(o)try{var i=JSON.parse(o);t.setState(i),t.log("Retrieved flags from cache",i),t.flags?(t.onChange&&t.onChange(null,{isFromServer:!1}),e(),t.getFlags(Promise.resolve,Promise.reject)):t.getFlags(e,n)}catch(e){t.log("Exception fetching cached logs",e)}})):!f&&t.getFlags(e,n)}))}},{key:"getAllFlags",value:function(){return this.flags}},{key:"identify",value:function(e){this.identity=e,this.initialised&&!this.interval&&this.getFlags()}},{key:"getState",value:function(){return{api:this.api,environmentID:this.environmentID,flags:this.flags,identity:this.identity,segments:this.segments,traits:this.traits}}},{key:"setState",value:function(e){e&&(this.initialised=!0,this.api=e.api||this.api||s,this.environmentID=e.environmentID||this.environmentID,this.flags=e.flags||this.flags,this.identity=e.identity||this.identity,this.segments=e.segments||this.segments,this.traits=e.traits||this.traits)}},{key:"log",value:function(){if(this.enableLogs){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log.apply(this,["BULLET TRAIN:",(new Date).valueOf()-this.timer,"ms"].concat(t))}}},{key:"updateStorage",value:function(){if(this.cacheFlags){var e=JSON.stringify(this.getState());this.log("Setting storage",e),i.setItem("BULLET_TRAIN_DB",e)}}},{key:"logout",value:function(){this.identity=null,this.segments=null,this.traits=null,this.initialised&&!this.interval&&this.getFlags()}},{key:"startListening",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1e3;this.interval||(this.interval=setInterval(this.getFlags,e))}},{key:"getSegments",value:function(){}},{key:"stopListening",value:function(){clearInterval(this.interval)}}]),e}();e.exports=function(e){var t=e.fetch,r=e.AsyncStorage;return new a({fetch:t,AsyncStorage:r})}}])}));

@@ -80,3 +80,3 @@ !function (e, t) {

try {
for (var s, u = e[Symbol.iterator](); !(n = (s = u.next()).done) && (r.push(s.value), !t || r.length !== t); n = !0);
for (var s, a = e[Symbol.iterator](); !(n = (s = a.next()).done) && (r.push(s.value), !t || r.length !== t); n = !0);
} catch (e) {

@@ -86,3 +86,3 @@ o = !0, i = e;

try {
!n && u.return && u.return();
!n && a.return && a.return();
} finally {

@@ -102,5 +102,5 @@ if (o) throw i;

var u = {
var a = {
getItem: function (e, t) {
return u.multiGet([e]).then(function (e) {
return a.multiGet([e]).then(function (e) {
return e[0][1];

@@ -114,3 +114,3 @@ }).then(function (e) {

setItem: function (e, t, r) {
return u.multiSet([[e, t]]).then(function (e) {
return a.multiSet([[e, t]]).then(function (e) {
return r && r(null, e), e;

@@ -129,3 +129,3 @@ }).catch(function (e) {

removeItem: function (e, t) {
return u.multiRemove([e]).then(function () {
return a.multiRemove([e]).then(function () {
t && t(null);

@@ -142,3 +142,3 @@ }).catch(function (e) {

mergeItem: function (e, t) {
return u.multiMerge([[e, t]]);
return a.multiMerge([[e, t]]);
},

@@ -175,5 +175,5 @@ multiGet: function (e) {

i = t[1],
u = localStorage.getItem(r);
if (u) try {
localStorage.setItem(r, JSON.stringify((0, s.default)(JSON.parse(u), JSON.parse(i))));
a = localStorage.getItem(r);
if (a) try {
localStorage.setItem(r, JSON.stringify((0, s.default)(JSON.parse(a), JSON.parse(i))));
} catch (e) {

@@ -196,3 +196,3 @@ n.push(e);

};
t.default = u;
t.default = a;
}, function (e, t, r) {

@@ -219,4 +219,4 @@ "use strict";

s = [],
u = {},
a = function () {
a = {},
u = function () {
return {

@@ -236,3 +236,3 @@ ok: 2 == (o.status / 100 | 0),

},
clone: a,
clone: u,
headers: {

@@ -246,6 +246,6 @@ keys: function () {

get: function (e) {
return u[e.toLowerCase()];
return a[e.toLowerCase()];
},
has: function (e) {
return e.toLowerCase() in u;
return e.toLowerCase() in a;
}

@@ -258,4 +258,4 @@ }

o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function (e, t, r) {
i.push(t = t.toLowerCase()), s.push([t, r]), u[t] = u[t] ? u[t] + "," + r : r;
}), r(a());
i.push(t = t.toLowerCase()), s.push([t, r]), a[t] = a[t] ? a[t] + "," + r : r;
}), r(u());
}, o.onerror = n, o.withCredentials = "include" == t.credentials, t.headers) o.setRequestHeader(c, t.headers[c]);

@@ -282,4 +282,4 @@

s = r(4),
u = r(1);
const a = n.Readable,
a = r(1);
const u = n.Readable,
c = Symbol("buffer"),

@@ -331,3 +331,3 @@ l = Symbol("type");

stream() {
const e = new a();
const e = new u();
return e._read = function () {}, e.push(this[c]), e.push(null), e;

@@ -348,6 +348,6 @@ }

s = this[c].slice(n, n + i),
u = new f([], {
a = new f([], {
type: arguments[2]
});
return u[c] = s, u;
return a[c] = s, a;
}

@@ -392,3 +392,3 @@

var s = r.timeout;
let u = void 0 === s ? 0 : s;
let a = void 0 === s ? 0 : s;
null == e ? e = null : m(e) ? e = Buffer.from(e.toString()) : v(e) || Buffer.isBuffer(e) || ("[object ArrayBuffer]" === Object.prototype.toString.call(e) ? e = Buffer.from(e) : ArrayBuffer.isView(e) ? e = Buffer.from(e.buffer, e.byteOffset, e.byteLength) : e instanceof n || (e = Buffer.from(String(e)))), this[d] = {

@@ -398,3 +398,3 @@ body: e,

error: null
}, this.size = i, this.timeout = u, e instanceof n && e.on("error", function (e) {
}, this.size = i, this.timeout = a, e instanceof n && e.on("error", function (e) {
const r = "AbortError" === e.name ? e : new h(`Invalid response body while trying to fetch ${t.url}: ${e.message}`, "system", e);

@@ -417,4 +417,4 @@ t[d].error = r;

return new b.Promise(function (n, s) {
let u;
e.timeout && (u = setTimeout(function () {
let a;
e.timeout && (a = setTimeout(function () {
i = !0, s(new h(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`, "body-timeout"));

@@ -430,3 +430,3 @@ }, e.timeout)), t.on("error", function (t) {

if (!i) {
clearTimeout(u);
clearTimeout(a);

@@ -659,11 +659,11 @@ try {

keys() {
return k(this, "key");
return L(this, "key");
}
values() {
return k(this, "value");
return L(this, "value");
}
[Symbol.iterator]() {
return k(this, "key+value");
return L(this, "key+value");
}

@@ -718,7 +718,7 @@

});
const C = Symbol("internal");
const k = Symbol("internal");
function k(e, t) {
const r = Object.create($);
return r[C] = {
function L(e, t) {
const r = Object.create(C);
return r[k] = {
target: e,

@@ -730,6 +730,6 @@ kind: t,

const $ = Object.setPrototypeOf({
const C = Object.setPrototypeOf({
next() {
if (!this || Object.getPrototypeOf(this) !== $) throw new TypeError("Value of `this` is not a HeadersIterator");
var e = this[C];
if (!this || Object.getPrototypeOf(this) !== C) throw new TypeError("Value of `this` is not a HeadersIterator");
var e = this[k];
const t = e.target,

@@ -742,3 +742,3 @@ r = e.kind,

done: !0
} : (this[C].index = n + 1, {
} : (this[k].index = n + 1, {
value: o[n],

@@ -751,3 +751,3 @@ done: !1

function z(e) {
function $(e) {
const t = Object.assign({

@@ -760,3 +760,3 @@ __proto__: null

Object.defineProperty($, Symbol.toStringTag, {
Object.defineProperty(C, Symbol.toStringTag, {
value: "HeadersIterator",

@@ -767,3 +767,3 @@ writable: !1,

});
const L = Symbol("Response internals"),
const z = Symbol("Response internals"),
I = o.STATUS_CODES;

@@ -785,3 +785,3 @@

this[L] = {
this[z] = {
url: t.url,

@@ -796,23 +796,23 @@ status: r,

get url() {
return this[L].url || "";
return this[z].url || "";
}
get status() {
return this[L].status;
return this[z].status;
}
get ok() {
return this[L].status >= 200 && this[L].status < 300;
return this[z].status >= 200 && this[z].status < 300;
}
get redirected() {
return this[L].counter > 0;
return this[z].counter > 0;
}
get statusText() {
return this[L].statusText;
return this[z].statusText;
}
get headers() {
return this[L].headers;
return this[z].headers;
}

@@ -863,4 +863,4 @@

U = i.parse,
q = i.format,
N = "destroy" in n.Readable.prototype;
N = i.format,
q = "destroy" in n.Readable.prototype;

@@ -910,3 +910,3 @@ function D(e) {

get url() {
return q(this[F].parsedURL);
return N(this[F].parsedURL);
}

@@ -967,3 +967,3 @@

return b.Promise = V.Promise, new V.Promise(function (r, i) {
const a = new M(e, t),
const u = new M(e, t),
c = function (e) {

@@ -974,3 +974,3 @@ const t = e[F].parsedURL,

if (!/^https?:$/.test(t.protocol)) throw new TypeError("Only HTTP(S) protocols are supported");
if (e.signal && e.body instanceof n.Readable && !N) throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");
if (e.signal && e.body instanceof n.Readable && !q) throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");
let o = null;

@@ -987,8 +987,8 @@

method: e.method,
headers: z(r),
headers: $(r),
agent: i
});
}(a),
}(u),
l = ("https:" === c.protocol ? s : o).request,
f = a.signal;
f = u.signal;

@@ -999,3 +999,3 @@ let p = null;

let e = new H("The user aborted a request.");
i(e), a.body && a.body instanceof n.Readable && a.body.destroy(e), p && p.body && p.body.emit("error", e);
i(e), u.body && u.body instanceof n.Readable && u.body.destroy(e), p && p.body && p.body.emit("error", e);
};

@@ -1016,8 +1016,8 @@

f && f.addEventListener("abort", y), a.timeout && b.once("socket", function (e) {
f && f.addEventListener("abort", y), u.timeout && b.once("socket", function (e) {
g = setTimeout(function () {
i(new h(`network timeout at: ${a.url}`, "request-timeout")), m();
}, a.timeout);
i(new h(`network timeout at: ${u.url}`, "request-timeout")), m();
}, u.timeout);
}), b.on("error", function (e) {
i(new h(`request to ${a.url} failed, reason: ${e.message}`, "system", e)), m();
i(new h(`request to ${u.url} failed, reason: ${e.message}`, "system", e)), m();
}), b.on("response", function (e) {

@@ -1036,7 +1036,7 @@ clearTimeout(g);

const n = t.get("Location"),
o = null === n ? null : G(a.url, n);
o = null === n ? null : G(u.url, n);
switch (a.redirect) {
switch (u.redirect) {
case "error":
return i(new h(`redirect mode is set to error: ${a.url}`, "no-redirect")), void m();
return i(new h(`redirect mode is set to error: ${u.url}`, "no-redirect")), void m();

@@ -1053,15 +1053,15 @@ case "manual":

if (null === o) break;
if (a.counter >= a.follow) return i(new h(`maximum redirect reached at: ${a.url}`, "max-redirect")), void m();
if (u.counter >= u.follow) return i(new h(`maximum redirect reached at: ${u.url}`, "max-redirect")), void m();
const n = {
headers: new A(a.headers),
follow: a.follow,
counter: a.counter + 1,
agent: a.agent,
compress: a.compress,
method: a.method,
body: a.body,
signal: a.signal,
timeout: a.timeout
headers: new A(u.headers),
follow: u.follow,
counter: u.counter + 1,
agent: u.agent,
compress: u.compress,
method: u.method,
body: u.body,
signal: u.signal,
timeout: u.timeout
};
return 303 !== e.statusCode && a.body && null === j(a) ? (i(new h("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), void m()) : (303 !== e.statusCode && (301 !== e.statusCode && 302 !== e.statusCode || "POST" !== a.method) || (n.method = "GET", n.body = void 0, n.headers.delete("content-length")), r(V(new M(o, n))), void m());
return 303 !== e.statusCode && u.body && null === j(u) ? (i(new h("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), void m()) : (303 !== e.statusCode && (301 !== e.statusCode && 302 !== e.statusCode || "POST" !== u.method) || (n.method = "GET", n.body = void 0, n.headers.delete("content-length")), r(V(new M(o, n))), void m());
}

@@ -1075,24 +1075,24 @@ }

const o = {
url: a.url,
url: u.url,
status: e.statusCode,
statusText: e.statusMessage,
headers: t,
size: a.size,
timeout: a.timeout,
counter: a.counter
size: u.size,
timeout: u.timeout,
counter: u.counter
},
s = t.get("Content-Encoding");
if (!a.compress || "HEAD" === a.method || null === s || 204 === e.statusCode || 304 === e.statusCode) return p = new R(n, o), void r(p);
if (!u.compress || "HEAD" === u.method || null === s || 204 === e.statusCode || 304 === e.statusCode) return p = new R(n, o), void r(p);
const c = {
flush: u.Z_SYNC_FLUSH,
finishFlush: u.Z_SYNC_FLUSH
flush: a.Z_SYNC_FLUSH,
finishFlush: a.Z_SYNC_FLUSH
};
if ("gzip" == s || "x-gzip" == s) return n = n.pipe(u.createGunzip(c)), p = new R(n, o), void r(p);
if ("gzip" == s || "x-gzip" == s) return n = n.pipe(a.createGunzip(c)), p = new R(n, o), void r(p);
if ("deflate" != s && "x-deflate" != s) {
if ("br" == s && "function" == typeof u.createBrotliDecompress) return n = n.pipe(u.createBrotliDecompress()), p = new R(n, o), void r(p);
if ("br" == s && "function" == typeof a.createBrotliDecompress) return n = n.pipe(a.createBrotliDecompress()), p = new R(n, o), void r(p);
p = new R(n, o), r(p);
} else {
e.pipe(new J()).once("data", function (e) {
n = 8 == (15 & e[0]) ? n.pipe(u.createInflate()) : n.pipe(u.createInflateRaw()), p = new R(n, o), r(p);
n = 8 == (15 & e[0]) ? n.pipe(a.createInflate()) : n.pipe(a.createInflateRaw()), p = new R(n, o), r(p);
});

@@ -1103,3 +1103,3 @@ }

null === r ? e.end() : v(r) ? r.stream().pipe(e) : Buffer.isBuffer(r) ? (e.write(r), e.end()) : r.pipe(e);
}(b, a);
}(b, u);
});

@@ -1118,4 +1118,4 @@ }

s = 9007199254740991,
u = "[object Arguments]",
a = "[object AsyncFunction]",
a = "[object Arguments]",
u = "[object AsyncFunction]",
c = "[object Function]",

@@ -1130,3 +1130,3 @@ l = "[object GeneratorFunction]",

g = {};
g["[object Float32Array]"] = g["[object Float64Array]"] = g["[object Int8Array]"] = g["[object Int16Array]"] = g["[object Int32Array]"] = g["[object Uint8Array]"] = g["[object Uint8ClampedArray]"] = g["[object Uint16Array]"] = g["[object Uint32Array]"] = !0, g[u] = g["[object Array]"] = g["[object ArrayBuffer]"] = g["[object Boolean]"] = g["[object DataView]"] = g["[object Date]"] = g["[object Error]"] = g[c] = g["[object Map]"] = g["[object Number]"] = g[h] = g["[object RegExp]"] = g["[object Set]"] = g["[object String]"] = g["[object WeakMap]"] = !1;
g["[object Float32Array]"] = g["[object Float64Array]"] = g["[object Int8Array]"] = g["[object Int16Array]"] = g["[object Int32Array]"] = g["[object Uint8Array]"] = g["[object Uint8ClampedArray]"] = g["[object Uint16Array]"] = g["[object Uint32Array]"] = !0, g[a] = g["[object Array]"] = g["[object ArrayBuffer]"] = g["[object Boolean]"] = g["[object DataView]"] = g["[object Date]"] = g["[object Error]"] = g[c] = g["[object Map]"] = g["[object Number]"] = g[h] = g["[object RegExp]"] = g["[object Set]"] = g["[object String]"] = g["[object WeakMap]"] = !1;

@@ -1170,16 +1170,16 @@ var m = "object" == typeof global && global && global.Object === Object && global,

B,
C = Array.prototype,
k = Function.prototype,
$ = Object.prototype,
z = w["__core-js_shared__"],
L = k.toString,
I = $.hasOwnProperty,
R = (E = /[^.]+$/.exec(z && z.keys && z.keys.IE_PROTO || "")) ? "Symbol(src)_1." + E : "",
F = $.toString,
U = L.call(Object),
q = RegExp("^" + L.call(I).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
N = S ? w.Buffer : void 0,
k = Array.prototype,
L = Function.prototype,
C = Object.prototype,
$ = w["__core-js_shared__"],
z = L.toString,
I = C.hasOwnProperty,
R = (E = /[^.]+$/.exec($ && $.keys && $.keys.IE_PROTO || "")) ? "Symbol(src)_1." + E : "",
F = C.toString,
U = z.call(Object),
N = RegExp("^" + z.call(I).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
q = S ? w.Buffer : void 0,
D = w.Symbol,
M = w.Uint8Array,
H = N ? N.allocUnsafe : void 0,
H = q ? q.allocUnsafe : void 0,
J = (A = Object.getPrototypeOf, B = Object, function (e) {

@@ -1189,4 +1189,4 @@ return A(B(e));

G = Object.create,
V = $.propertyIsEnumerable,
K = C.splice,
V = C.propertyIsEnumerable,
K = k.splice,
Z = D ? D.toStringTag : void 0,

@@ -1200,3 +1200,3 @@ Y = function () {

}(),
W = N ? N.isBuffer : void 0,
W = q ? q.isBuffer : void 0,
X = Math.max,

@@ -1210,3 +1210,3 @@ Q = Date.now,

return function (t) {
if (!$e(t)) return {};
if (!Ce(t)) return {};
if (G) return G(t);

@@ -1254,9 +1254,9 @@ e.prototype = t;

function ue(e, t) {
function ae(e, t) {
var r = Ee(e),
n = !r && xe(e),
o = !r && !n && Be(e),
i = !r && !n && !o && Le(e),
i = !r && !n && !o && ze(e),
s = r || n || o || i,
u = s ? function (e, t) {
a = s ? function (e, t) {
for (var r = -1, n = Array(e); ++r < e;) n[r] = t(r);

@@ -1266,10 +1266,10 @@

}(e.length, String) : [],
a = u.length;
u = a.length;
for (var c in e) !t && !I.call(e, c) || s && ("length" == c || o && ("offset" == c || "parent" == c) || i && ("buffer" == c || "byteLength" == c || "byteOffset" == c) || je(c, a)) || u.push(c);
for (var c in e) !t && !I.call(e, c) || s && ("length" == c || o && ("offset" == c || "parent" == c) || i && ("buffer" == c || "byteLength" == c || "byteOffset" == c) || je(c, u)) || a.push(c);
return u;
return a;
}
function ae(e, t, r) {
function ue(e, t, r) {
(void 0 === r || Pe(e[t], r)) && (void 0 !== r || t in e) || fe(e, t, r);

@@ -1376,4 +1376,4 @@ }

for (var n = -1, o = Object(e), i = r(e), s = i.length; s--;) {
var u = i[he ? s : ++n];
if (!1 === t(o[u], u, o)) break;
var a = i[he ? s : ++n];
if (!1 === t(o[a], a, o)) break;
}

@@ -1403,12 +1403,12 @@

function ye(e) {
return ze(e) && de(e) == u;
return $e(e) && de(e) == a;
}
function be(e) {
return !(!$e(e) || function (e) {
return !(!Ce(e) || function (e) {
return !!R && R in e;
}(e)) && (Ce(e) ? q : y).test(function (e) {
}(e)) && (ke(e) ? N : y).test(function (e) {
if (null != e) {
try {
return L.call(e);
return z.call(e);
} catch (e) {}

@@ -1426,3 +1426,3 @@

function ge(e) {
if (!$e(e)) return function (e) {
if (!Ce(e)) return function (e) {
var t = [];

@@ -1442,15 +1442,15 @@ if (null != e) for (var r in Object(e)) t.push(r);

e !== t && pe(t, function (i, s) {
if (o || (o = new se()), $e(i)) !function (e, t, r, n, o, i, s) {
var u = Oe(e, r),
a = Oe(t, r),
c = s.get(a);
if (c) return void ae(e, r, c);
var l = i ? i(u, a, r + "", e, t, s) : void 0,
if (o || (o = new se()), Ce(i)) !function (e, t, r, n, o, i, s) {
var a = Oe(e, r),
u = Oe(t, r),
c = s.get(u);
if (c) return void ue(e, r, c);
var l = i ? i(a, u, r + "", e, t, s) : void 0,
f = void 0 === l;
if (f) {
var p = Ee(a),
d = !p && Be(a),
y = !p && !d && Le(a);
l = a, p || d || y ? Ee(u) ? l = u : ze(w = u) && Ae(w) ? l = function (e, t) {
var p = Ee(u),
d = !p && Be(u),
y = !p && !d && ze(u);
l = u, p || d || y ? Ee(a) ? l = a : $e(w = a) && Ae(w) ? l = function (e, t) {
var r = -1,

@@ -1463,3 +1463,3 @@ n = e.length;

return t;
}(u) : d ? (f = !1, l = function (e, t) {
}(a) : d ? (f = !1, l = function (e, t) {
if (t) return e.slice();

@@ -1469,9 +1469,9 @@ var r = e.length,

return e.copy(n), n;
}(a, !0)) : y ? (f = !1, b = a, g = !0 ? (m = b.buffer, v = new m.constructor(m.byteLength), new M(v).set(new M(m)), v) : b.buffer, l = new b.constructor(g, b.byteOffset, b.length)) : l = [] : function (e) {
if (!ze(e) || de(e) != h) return !1;
}(u, !0)) : y ? (f = !1, b = u, g = !0 ? (m = b.buffer, v = new m.constructor(m.byteLength), new M(v).set(new M(m)), v) : b.buffer, l = new b.constructor(g, b.byteOffset, b.length)) : l = [] : function (e) {
if (!$e(e) || de(e) != h) return !1;
var t = J(e);
if (null === t) return !0;
var r = I.call(t, "constructor") && t.constructor;
return "function" == typeof r && r instanceof r && L.call(r) == U;
}(a) || xe(a) ? (l = u, xe(u) ? l = function (e) {
return "function" == typeof r && r instanceof r && z.call(r) == U;
}(u) || xe(u) ? (l = a, xe(a) ? l = function (e) {
return function (e, t, r, n) {

@@ -1484,5 +1484,5 @@ var o = !r;

for (; ++i < s;) {
var u = t[i],
a = n ? n(r[u], e[u], u, r, e) : void 0;
void 0 === a && (a = e[u]), o ? fe(r, u, a) : ce(r, u, a);
var a = t[i],
u = n ? n(r[a], e[a], a, r, e) : void 0;
void 0 === u && (u = e[a]), o ? fe(r, a, u) : ce(r, a, u);
}

@@ -1492,5 +1492,5 @@

}(e, Ie(e));
}(u) : $e(u) && !Ce(u) || (l = function (e) {
}(a) : Ce(a) && !ke(a) || (l = function (e) {
return "function" != typeof e.constructor || Se(e) ? {} : re(J(e));
}(a))) : f = !1;
}(u))) : f = !1;
}

@@ -1500,7 +1500,7 @@

var w;
f && (s.set(a, l), o(l, a, n, i, s), s.delete(a));
ae(e, r, l);
f && (s.set(u, l), o(l, u, n, i, s), s.delete(u));
ue(e, r, l);
}(e, t, s, r, me, n, o);else {
var u = n ? n(Oe(e, s), i, s + "", e, t, o) : void 0;
void 0 === u && (u = i), ae(e, s, u);
var a = n ? n(Oe(e, s), i, s + "", e, t, o) : void 0;
void 0 === a && (a = i), ue(e, s, a);
}

@@ -1517,5 +1517,5 @@ }, Ie);

for (var u = Array(t + 1); ++o < t;) u[o] = n[o];
for (var a = Array(t + 1); ++o < t;) a[o] = n[o];
return u[t] = r(s), x(e, this, u);
return a[t] = r(s), x(e, this, a);
};

@@ -1547,3 +1547,3 @@ }(e, t, Ue), e + "");

var t = e && e.constructor;
return e === ("function" == typeof t && t.prototype || $);
return e === ("function" == typeof t && t.prototype || C);
}

@@ -1587,3 +1587,3 @@

}()) ? ye : function (e) {
return ze(e) && I.call(e, "callee") && !V.call(e, "callee");
return $e(e) && I.call(e, "callee") && !V.call(e, "callee");
},

@@ -1593,3 +1593,3 @@ Ee = Array.isArray;

function Ae(e) {
return null != e && ke(e.length) && !Ce(e);
return null != e && Le(e.length) && !ke(e);
}

@@ -1601,13 +1601,13 @@

function Ce(e) {
if (!$e(e)) return !1;
function ke(e) {
if (!Ce(e)) return !1;
var t = de(e);
return t == c || t == l || t == a || t == p;
return t == c || t == l || t == u || t == p;
}
function ke(e) {
function Le(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <= s;
}
function $e(e) {
function Ce(e) {
var t = typeof e;

@@ -1617,7 +1617,7 @@ return null != e && ("object" == t || "function" == t);

function ze(e) {
function $e(e) {
return null != e && "object" == typeof e;
}
var Le = P ? function (e) {
var ze = P ? function (e) {
return function (t) {

@@ -1627,7 +1627,7 @@ return e(t);

}(P) : function (e) {
return ze(e) && ke(e.length) && !!g[de(e)];
return $e(e) && Le(e.length) && !!g[de(e)];
};
function Ie(e) {
return Ae(e) ? ue(e, !0) : ge(e);
return Ae(e) ? ae(e, !0) : ge(e);
}

@@ -1645,3 +1645,3 @@

for (o = Re.length > 3 && "function" == typeof o ? (n--, o) : void 0, i && function (e, t, r) {
if (!$e(r)) return !1;
if (!Ce(r)) return !1;
var n = typeof t;

@@ -1694,3 +1694,3 @@ return !!("number" == n ? Ae(r) && je(t, r.length) : "string" == n && (t in r)) && Pe(r[t], e);

s = "https://api.bullet-train.io/api/v1/",
u = function () {
a = function () {
function e(t) {

@@ -1726,8 +1726,8 @@ var r = this;

s = r.api,
u = (r.disableCache, !1),
a = function (e, t) {
a = (r.disableCache, !1),
u = function (e, t) {
var o = e.flags,
i = e.traits,
s = {},
u = {};
a = {};

@@ -1740,11 +1740,11 @@ if (i = i || [], (o = o || []).forEach(function (e) {

}), i.forEach(function (e) {
u[e.trait_key.toLowerCase().replace(/ /g, "_")] = e.trait_value;
}), r.oldFlags = s, r.flags = s, r.traits = u, t) {
var a = {};
a[e.trait_key.toLowerCase().replace(/ /g, "_")] = e.trait_value;
}), r.oldFlags = s, r.flags = s, r.traits = a, t) {
var u = {};
t.map(function (e) {
a[e.name] = e;
}), r.segments = a;
u[e.name] = e;
}), r.segments = u;
}
n && n(r.oldFlags, {
r.updateStorage(), n && n(r.oldFlags, {
isFromServer: !0

@@ -1755,3 +1755,3 @@ });

return i ? Promise.all([r.getJSON(s + "identities/?identifier=" + encodeURIComponent(i))]).then(function (e) {
a(e[0], e[1]);
u(e[0], e[1]);
}).catch(function (e) {

@@ -1763,7 +1763,7 @@ var t = e.message;

}) : Promise.all([r.getJSON(s + "flags/")]).then(function (t) {
a({
u({
flags: t[0]
}, null), e && !u && (u = !0, e());
}, null), e && !a && (a = !0, e());
}).catch(function (e) {
t && !u && (u = !0, t(e)), o && o(e);
t && !a && (a = !0, t(e)), o && o(e);
});

@@ -1812,15 +1812,22 @@ }), n(this, "getValue", function (e) {

o = void 0 === n ? s : n,
u = e.onChange,
a = e.disableCache,
a = e.onChange,
u = e.cacheFlags,
c = e.onError,
l = e.defaultFlags,
f = e.preventFetch,
h = e.state;
h = e.enableLogs,
p = e.AsyncStorage,
d = e.state;
return new Promise(function (e, n) {
if (t.environmentID = r, t.api = o, t.interval = null, t.disableCache = a, t.onChange = u, t.onError = c, t.flags = Object.assign({}, l) || {}, t.initialised = !0, t.setState(h), !r) throw n("Please specify a environment id"), "Please specify a environment id";
a || i.getItem("BULLET_TRAIN_DB", function (r, o) {
t.flags = o ? JSON.parse(o) : l, t.flags && t.onChange && t.onChange(null, {
isFromServer: !1
}), f || t.getFlags(e, n);
});
if (t.environmentID = r, t.api = o, t.interval = null, t.onChange = a, t.onError = c, t.enableLogs = h, t.flags = Object.assign({}, l) || {}, t.initialised = !0, t.timer = t.enableLogs ? new Date().valueOf() : null, p && (i = p), t.cacheFlags = void 0 !== i && u, t.setState(d), !r) throw n("Please specify a environment id"), "Please specify a environment id";
u ? i.getItem("BULLET_TRAIN_DB", function (r, o) {
if (o) try {
var i = JSON.parse(o);
t.setState(i), t.log("Retrieved flags from cache", i), t.flags ? (t.onChange && t.onChange(null, {
isFromServer: !1
}), e(), t.getFlags(Promise.resolve, Promise.reject)) : t.getFlags(e, n);
} catch (e) {
t.log("Exception fetching cached logs", e);
}
}) : !f && t.getFlags(e, n);
});

@@ -1856,2 +1863,19 @@ }

}, {
key: "log",
value: function () {
if (this.enableLogs) {
for (var e = arguments.length, t = Array(e), r = 0; r < e; r++) t[r] = arguments[r];
console.log.apply(this, ["BULLET TRAIN:", new Date().valueOf() - this.timer, "ms"].concat(t));
}
}
}, {
key: "updateStorage",
value: function () {
if (this.cacheFlags) {
var e = JSON.stringify(this.getState());
this.log("Setting storage", e), i.setItem("BULLET_TRAIN_DB", e);
}
}
}, {
key: "logout",

@@ -1881,3 +1905,3 @@ value: function () {

r = e.AsyncStorage;
return new u({
return new a({
fetch: t,

@@ -1884,0 +1908,0 @@ AsyncStorage: r

{
"name": "bullet-train-client",
"version": "0.0.84",
"version": "0.0.90",
"description": "Feature flagging to support continuous development",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -27,2 +27,3 @@ <img width="100%" src="https://raw.githubusercontent.com/SolidStateGroup/bullet-train-frontend/master/hero.png"/>

environmentID:"<YOUR_ENVIRONMENT_KEY>",
cacheFlags: true,
onChange: (oldFlags,params)=>{ //Occurs whenever flags are changed

@@ -57,4 +58,5 @@

| ```onError``` | Callback function on failure to retrieve flags. ``` (error)=>{...} ``` | | null
| ```cacheFlags``` | Any time flags are retrieved they will be cached, flags and identities will then be retrieved from local storage before hitting the API ``` | | null
| ```enableLogs``` | Enables logging for key bullet train events ``` | | null
| ```defaultFlags``` | Allows you define default features, these will all be overridden on first retrieval of features. | | null
| ```disableCache``` | If you want to disable local storage of feature flags. | | false
| ```api``` | Use this property to define where you're getting feature flags from, e.g. if you're self hosting. | | https://featureflagger.3qqe.flynnhub.com/api/

@@ -61,0 +63,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc