Socket
Socket
Sign inDemoInstall

get-it

Package Overview
Dependencies
Maintainers
1
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-it - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

1

lib-node/index.js

@@ -114,2 +114,3 @@ 'use strict';

loadedMiddleware.push(newMiddleware);
return request;
};

@@ -116,0 +117,0 @@

@@ -116,2 +116,3 @@ 'use strict';

loadedMiddleware.push(newMiddleware);
return request;
};

@@ -118,0 +119,0 @@

2

package.json
{
"name": "get-it",
"version": "2.1.3",
"version": "2.1.4",
"description": "Generic HTTP request library for node and browsers",

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

@@ -5,3 +5,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getIt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

},{"./index":2,"./middleware":11}],2:[function(require,module,exports){
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=n("onResponse",r,t)}catch(e){u=null,s=e}(s=s&&n("onError",s,t))?o.error.publish(s):u&&o.response.publish(u)}var o=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),n=middlewareReducer(t),s={options:n("processOptions",e),channels:o,applyMiddleware:n},u=null,i=o.request.subscribe(function(e){u=httpRequest(e,function(o,n){return r(o,n,e)})});o.abort.subscribe(function(){i(),u&&u.abort()});var a=n("onReturn",o,s);return a===o&&o.request.publish(s),a}var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),n.push(e)},r.clone=function(){return e(n)},o.forEach(r.use),r};
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=o("onResponse",r,t)}catch(e){u=null,s=e}(s=s&&o("onError",s,t))?n.error.publish(s):u&&n.response.publish(u)}var n=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),o=middlewareReducer(t),s={options:o("processOptions",e),channels:n,applyMiddleware:o},u=null,i=n.request.subscribe(function(e){u=httpRequest(e,function(n,o){return r(n,o,e)})});n.abort.subscribe(function(){i(),u&&u.abort()});var a=o("onReturn",n,s);return a===n&&n.request.publish(s),a}var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),o.push(e),r},r.clone=function(){return e(o)},n.forEach(r.use),r};

@@ -8,0 +8,0 @@ },{"./middleware/defaultOptionsProcessor":8,"./request":21,"./util/middlewareReducer":24,"nano-pubsub":34}],3:[function(require,module,exports){

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function e(t,r,n){function o(i,u){if(!r[i]){if(!t[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[i]={exports:{}};t[i][0].call(l.exports,function(e){var r=t[i][1][e];return o(r||e)},l,l.exports,e,t,r,n)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";var n=e("./index");n.middleware=e("./middleware"),t.exports=n},{"./index":2,"./middleware":11}],2:[function(e,t,r){"use strict";var n=e("nano-pubsub"),o=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),u=["request","response","progress","error","abort"],a=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,n){var o=e,i=t;if(!o)try{i=s("onResponse",t,n)}catch(e){i=null,o=e}(o=o&&s("onError",o,n))?r.error.publish(o):i&&r.response.publish(i)}var r=u.reduce(function(e,t){return e[t]=n(),e},{}),s=o(l),a={options:s("processOptions",e),channels:r,applyMiddleware:s},c=null,f=r.request.subscribe(function(e){c=i(e,function(r,n){return t(r,n,e)})});r.abort.subscribe(function(){f(),c&&c.abort()});var p=s("onReturn",r,a);return p===r&&r.request.publish(a),p}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],l=a.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&l.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");a.forEach(function(t){e[t]&&l[t].push(e[t])}),c.push(e)},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":8,"./request":21,"./util/middlewareReducer":24,"nano-pubsub":34}],3:[function(e,t,r){"use strict";var n=e("object-assign"),o=/^\//,s=/\/$/;t.exports=function(e){var t=e.replace(s,"");return{processOptions:function(e){if(/^https?:\/\//i.test(e.url))return e;var r=[t,e.url.replace(o,"")].join("/");return n({},e,{url:r})}}}},{"object-assign":35}],4:[function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},{}],5:[function(e,t,r){"use strict";function n(e){var t=this;if("function"!=typeof e)throw new TypeError("executor must be a function.");var r=null;this.promise=new Promise(function(e){r=e}),e(function(e){t.reason||(t.reason=new o(e),r(t.reason))})}var o=e("./Cancel");n.source=function(){var e=void 0;return{token:new n(function(t){e=t}),cancel:e}},t.exports=n},{"./Cancel":4}],6:[function(e,t,r){"use strict";t.exports=function(e){return!(!e||!e.__CANCEL__)}},{}],7:[function(e,t,r){"use strict";function n(e){return-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?o(e.body):e.body}function o(e){try{var t="string"==typeof e?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch(t){return e}}var s=e("debug");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verbose,r=e.namespace||"get-it",o=s(r),i=e.log||o,u=i===o&&!s.enabled(r),a=0;return{processOptions:function(e){return e.requestId=e.requestId||++a,e},onRequest:function(e){if(u||!e)return e;var r=e.options;return i("[%s] HTTP %s %s",r.requestId,r.method,r.url),t&&r.body&&"string"==typeof r.body&&i("[%s] Request body: %s",r.requestId,r.body),t&&r.headers&&i("[%s] Request headers: %s",r.requestId,JSON.stringify(r.headers,null,2)),e},onResponse:function(e,r){if(u||!e)return e;var o=r.options.requestId;return i("[%s] Response code: %s %s",o,e.statusCode,e.statusMessage),t&&e.body&&i("[%s] Response body: %s",o,n(e)),e},onError:function(e,t){var r=t.options.requestId;return e?(i("[%s] ERROR: %s",r,e.message),e):(i("[%s] Error encountered, but handled by an earlier middleware",r),e)}}}},{debug:28}],8:[function(e,t,r){"use strict";function n(e){function t(e,n){Array.isArray(n)?n.forEach(function(r){return t(e,r)}):r.push([e,n].map(encodeURIComponent).join("="))}var r=[];for(var n in e)a.call(e,n)&&t(n,e[n]);return r.length?r.join("&"):""}function o(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?o(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),u=e("url-parse"),a=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=u(t.url,{},!0);return t.timeout=o(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(n),t}},{"object-assign":35,"url-parse":43}],9:[function(e,t,r){"use strict";var n=e("object-assign");t.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{processOptions:function(r){var o=r.headers||{};return r.headers=t.override?n({},o,e):n({},e,o),r}}}},{"object-assign":35}],10:[function(e,t,r){"use strict";var n=e("create-error-class")("HttpError",function(e,t){this.message=(e.method+"-request to "+e.url+" resulted in HTTP "+e.statusCode+" "+e.statusMessage).trim(),this.response=e,this.request=t.options});t.exports=function(){return{onResponse:function(e,t){if(!(e.statusCode>=400))return e;throw new n(e,t)}}}},{"create-error-class":26}],11:[function(e,t,r){"use strict";r.base=e("./base"),r.debug=e("./debug"),r.jsonRequest=e("./jsonRequest"),r.jsonResponse=e("./jsonResponse"),r.httpErrors=e("./httpErrors"),r.retry=e("./retry"),r.promise=e("./promise"),r.observable=e("./observable"),r.progress=e("./progress"),r.headers=e("./headers"),r.injectResponse=e("./injectResponse")},{"./base":3,"./debug":7,"./headers":9,"./httpErrors":10,"./injectResponse":12,"./jsonRequest":13,"./jsonResponse":14,"./observable":15,"./progress":17,"./promise":18,"./retry":19}],12:[function(e,t,r){"use strict";var n=e("object-assign");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("function"!=typeof e.inject)throw new Error("`injectResponse` middleware requires a `inject` function");return{interceptRequest:function(t,r){var o=e.inject(r,t);if(!o)return t;var s=r.context.options;return n({},{body:"",url:s.url,method:s.method,headers:{},statusCode:200,statusMessage:"OK"},o)}}}},{"object-assign":35}],13:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=e("object-assign"),s=e("is-plain-object"),i=["boolean","string","number"],u=function(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)};t.exports=function(){return{processOptions:function(e){var t=e.body;return t&&!u(t)&&(-1!==i.indexOf(void 0===t?"undefined":n(t))||Array.isArray(t)||s(t)||t&&"function"==typeof t.toJSON)?o({},e,{body:JSON.stringify(e.body),headers:o({},e.headers,{"Content-Type":"application/json"})}):e}}}},{"is-plain-object":32,"object-assign":35}],14:[function(e,t,r){"use strict";function n(e){try{return JSON.parse(e)}catch(e){throw e.message="Failed to parsed response body as JSON: "+e.message,e}}var o=e("object-assign");t.exports=function(){return{onResponse:function(e){var t=e.headers["content-type"];return e.body&&t&&-1!==t.indexOf("application/json")?o({},e,{body:n(e.body)}):e},processOptions:function(e){return o({},e,{headers:o({Accept:"application/json"},e.headers)})}}}},{"object-assign":35}],15:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("object-assign");t.exports=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).implementation||n.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e){return t.error.subscribe(function(t){return e.error(t)}),t.progress.subscribe(function(t){return e.next(o({type:"progress"},t))}),t.response.subscribe(function(t){e.next(o({type:"response"},t)),e.complete()}),t.request.publish(r),function(){return t.abort.publish()}})}}}},{"../util/global":23,"object-assign":35}],16:[function(e,t,r){"use strict";t.exports=function(){return{onRequest:function(e){function t(e){return function(t){var r=t.lengthComputable?t.loaded/t.total*100:-1;n.channels.progress.publish({stage:e,percent:r,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}if("xhr"===e.adapter){var r=e.request,n=e.context;"upload"in r&&"onprogress"in r.upload&&(r.upload.onprogress=t("upload")),"onprogress"in r&&(r.onprogress=t("download"))}}}}},{}],17:[function(e,t,r){"use strict";t.exports=e("./node-progress")},{"./node-progress":16}],18:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("./cancel/Cancel"),s=e("./cancel/CancelToken"),i=e("./cancel/isCancel"),u=function(){var e=n.Promise;if(!e)throw new Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e,n){var o=r.options.cancelToken;o&&o.promise.then(function(e){t.abort.publish(e),n(e)}),t.error.subscribe(n),t.response.subscribe(e),setTimeout(function(){return t.request.publish(r)},0)})}}};u.Cancel=o,u.CancelToken=s,u.isCancel=i,t.exports=u},{"../util/global":23,"./cancel/Cancel":4,"./cancel/CancelToken":5,"./cancel/isCancel":6}],19:[function(e,t,r){"use strict";function n(e){return 100*Math.pow(2,e)+100*Math.random()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=e("object-assign"),i=e("../util/node-shouldRetry"),u=function(e){return null!==e&&"object"===(void 0===e?"undefined":o(e))&&"function"==typeof e.pipe},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxRetries||5,r=e.retryDelay||n,o=e.shouldRetry||i;return{onError:function(e,n){var i=n.options,a=i.maxRetries||t,c=i.shouldRetry||o,l=i.attemptNumber||0;if(u(i.body))return e;if(!c(e,l,i)||l>=a)return e;var f=s({},n,{options:s({},i,{attemptNumber:l+1})});return setTimeout(function(){return n.channels.request.publish(f)},r(l)),null}}};a.shouldRetry=i,t.exports=a},{"../util/node-shouldRetry":22,"object-assign":35}],20:[function(e,t,r){"use strict";var n=e("same-origin"),o=e("parse-headers"),s=window,i=s.XMLHttpRequest||function(){},u="withCredentials"in new i?i:s.XDomainRequest;t.exports=function(e,t){function r(t){O=!0,g.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+d.url:"Connection timed out on request to "+d.url);r.code=t,e.channels.error.publish(r)}function a(){E&&(c(),y.socket=setTimeout(function(){return r("ESOCKETTIMEDOUT")},E.socket))}function c(){(x||g.readyState>=2&&y.connect)&&clearTimeout(y.connect),y.socket&&clearTimeout(y.socket)}function l(){if(!j){c(),j=!0,g=null;var e=new Error("Network error while attempting to reach "+d.url);e.isNetworkError=!0,e.request=d,t(e)}}function f(){var e=g.status,t=g.statusText;if(v&&void 0===e)e=200;else{if(e>12e3&&e<12156)return l();e=1223===g.status?204:g.status,t=1223===g.status?"No Content":t}return{body:g.response||g.responseText,url:d.url,method:d.method,headers:v?{}:o(g.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function p(){x||j||O||(0!==g.status?(c(),j=!0,t(null,f())):l(new Error("Unknown XHR error")))}var d=e.options,h=!n(s.location.href,d.url),y={},b=e.applyMiddleware("interceptRequest",void 0,{adapter:"xhr",context:e});if(b){var m=setTimeout(t,0,null,b);return{abort:function(){return clearTimeout(m)}}}var g=h?new u:new i,v=s.XDomainRequest&&g instanceof s.XDomainRequest,w=d.headers,x=!1,j=!1,O=!1;if(g.onerror=l,g.ontimeout=l,g.onabort=function(){x=!0},g.onprogress=function(){},g[v?"onload":"onreadystatechange"]=function(){a(),x||4!==g.readyState&&!v||0!==g.status&&p()},g.open(d.method,d.url,!0),g.withCredentials=!!d.withCredentials,w&&g.setRequestHeader)for(var q in w)w.hasOwnProperty(q)&&g.setRequestHeader(q,w[q]);else if(w&&v)throw new Error("Headers cannot be set on an XDomainRequest object");d.rawBody&&(g.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:d,adapter:"xhr",request:g,context:e}),g.send(d.body||null);var E=d.timeout;return E&&(y.connect=setTimeout(function(){return r("ETIMEDOUT")},E.connect)),{abort:function(){x=!0,g&&g.abort()}}}},{"parse-headers":36,"same-origin":40}],21:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":20}],22:[function(e,t,r){"use strict";t.exports=function(e){return e.isNetworkError||!1}},{}],23:[function(e,t,r){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:void 0!==e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,r){"use strict";t.exports=function(e){return function(t,r){for(var n=arguments.length,o=Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(o))},r)}}},{}],25:[function(e,t,r){"use strict";t.exports=Error.captureStackTrace||function(e){var t=new Error;Object.defineProperty(e,"stack",{configurable:!0,get:function(){var e=t.stack;return Object.defineProperty(this,"stack",{value:e}),e}})}},{}],26:[function(e,t,r){"use strict";function n(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var o=e("capture-stack-trace");t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected className to be a string");if(/[^0-9a-zA-Z_$]/.test(e))throw new Error("className contains invalid characters");t=t||function(e){this.message=e};var r=function(){Object.defineProperty(this,"name",{configurable:!0,value:e,writable:!0}),o(this,this.constructor),t.apply(this,arguments)};return n(r,Error),r}},{"capture-stack-trace":25}],27:[function(e,t,r){function n(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*f;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=u?Math.round(e/u)+"s":e+"ms"}function s(e){return i(e,l,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,u,"second")||e+" ms"}function i(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var u=1e3,a=60*u,c=60*a,l=24*c,f=365.25*l;t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return n(e);if("number"===r&&!1===isNaN(e))return t.long?s(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],28:[function(e,t,r){(function(n){function o(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))}),e.splice(s,0,n)}},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=o,r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(o())}).call(this,e("_process"))},{"./debug":29,_process:37}],29:[function(e,t,r){function n(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function o(e){function t(){if(t.enabled){var e=t,n=+new Date,o=n-(s||n);e.diff=o,e.prev=s,e.curr=n,s=n;for(var i=new Array(arguments.length),u=0;u<i.length;u++)i[u]=arguments[u];i[0]=r.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;a++;var o=r.formatters[n];if("function"==typeof o){var s=i[a];t=o.call(e,s),i.splice(a,1),a--}return t}),r.formatArgs.call(e,i),(t.log||r.log||console.log.bind(console)).apply(e,i)}}return t.namespace=e,t.enabled=r.enabled(e),t.useColors=r.useColors(),t.color=n(e),"function"==typeof r.init&&r.init(t),t}(r=t.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){r.save(e),r.names=[],r.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&("-"===(e=t[o].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var s},{ms:27}],30:[function(e,t,r){function n(e,t,r){for(var n=0,o=e.length;n<o;n++)a.call(e,n)&&t.call(r,e[n],n,e)}function o(e,t,r){for(var n=0,o=e.length;n<o;n++)t.call(r,e.charAt(n),n,e)}function s(e,t,r){for(var n in e)a.call(e,n)&&t.call(r,e[n],n,e)}var i=e("is-function");t.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===u.call(e)?n(e,t,r):"string"==typeof e?o(e,t,r):s(e,t,r)};var u=Object.prototype.toString,a=Object.prototype.hasOwnProperty},{"is-function":31}],31:[function(e,t,r){t.exports=function(e){var t=n.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var n=Object.prototype.toString},{}],32:[function(e,t,r){"use strict";function n(e){return!0===o(e)&&"[object Object]"===Object.prototype.toString.call(e)}var o=e("isobject");t.exports=function(e){var t,r;return!1!==n(e)&&"function"==typeof(t=e.constructor)&&(r=t.prototype,!1!==n(r)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},{isobject:33}],33:[function(e,t,r){"use strict";t.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},{}],34:[function(e,t,r){t.exports=function(){var e=[];return{subscribe:function(t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},publish:function(){for(var t=0;t<e.length;t++)e[t].apply(null,arguments)}}}},{}],35:[function(e,t,r){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,u,a=n(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var l in r)s.call(r,l)&&(a[l]=r[l]);if(o){u=o(r);for(var f=0;f<u.length;f++)i.call(r,u[f])&&(a[u[f]]=r[u[f]])}}return a}},{}],36:[function(e,t,r){var n=e("trim"),o=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return o(n(e).split("\n"),function(e){var r=e.indexOf(":"),o=n(e.slice(0,r)).toLowerCase(),i=n(e.slice(r+1));void 0===t[o]?t[o]=i:s(t[o])?t[o].push(i):t[o]=[t[o],i]}),t}},{"for-each":30,trim:42}],37:[function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){b&&h&&(b=!1,h.length?y=h.concat(y):m=-1,y.length&&a())}function a(){if(!b){var e=s(u);b=!0;for(var t=y.length;t;){for(h=y,y=[];++m<t;)h&&h[m].run();m=-1,t=y.length}h=null,b=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var f,p,d=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,y=[],b=!1,m=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];y.push(new c(e,t)),1!==y.length||b||s(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],38:[function(e,t,r){"use strict";function n(e){return decodeURIComponent(e.replace(/\+/g," "))}var o=Object.prototype.hasOwnProperty;r.stringify=function(e,t){var r=[];"string"!=typeof(t=t||"")&&(t="?");for(var n in e)o.call(e,n)&&r.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return r.length?t+r.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);o[n(t[1])]=n(t[2]));return o}},{}],39:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],40:[function(e,t,r){"use strict";var n=e("url");t.exports=function(e,t,r){if(e===t)return!0;var o=n.parse(e,!1,!0),s=n.parse(t,!1,!0),i=0|o.port||("https"===o.protocol?443:80),u=0|s.port||("https"===s.protocol?443:80),a={proto:o.protocol===s.protocol,hostname:o.hostname===s.hostname,port:i===u};return a.proto&&a.hostname&&(a.port||r)}},{url:41}],41:[function(e,t,r){"use strict";var n=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:n,parse:function(e){var t=n.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],42:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],43:[function(e,t,r){(function(r){"use strict";function n(e){var t,n={},o=typeof(e=e||r.location||{});if("blob:"===e.protocol)n=new i(unescape(e.pathname),{});else if("string"===o){n=new i(e,{});for(t in p)delete n[t]}else if("object"===o){for(t in e)t in p||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=l.test(e.href))}return n}function o(e){var t=c.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(s=!0),r.splice(n,1),i--);return s&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var c,l,p,d,h,y,b=f.slice(),m=typeof t,g=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=a.parse),t=n(t),c=!(l=o(e||"")).protocol&&!l.slashes,g.slashes=l.slashes||c&&t.slashes,g.protocol=l.protocol||t.protocol||"",e=l.rest,l.slashes||(b[2]=[/(.*)/,"pathname"]);v<b.length;v++)p=(d=b[v])[0],y=d[1],p!==p?g[y]=e:"string"==typeof p?~(h=e.indexOf(p))&&("number"==typeof d[2]?(g[y]=e.slice(0,h),e=e.slice(h+d[2])):(g[y]=e.slice(h),e=e.slice(0,h))):(h=p.exec(e))&&(g[y]=h[1],e=e.slice(0,h.index)),g[y]=g[y]||(c&&d[3]?t[y]||"":""),d[4]&&(g[y]=g[y].toLowerCase());r&&(g.query=r(g.query)),c&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=s(g.pathname,t.pathname)),u(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(d=g.auth.split(":"),g.username=d[0]||"",g.password=d[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}var u=e("requires-port"),a=e("querystringify"),c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};i.prototype={set:function(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||a.parse)(t)),n[e]=t;break;case"port":n[e]=t,u(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":n.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:n[e]=t}for(var o=0;o<f.length;o++){var s=f[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(e){e&&"function"==typeof e||(e=a.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var o=n+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(o+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(o+=r.hash),o}},i.extractProtocol=o,i.location=n,i.qs=a,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:38,"requires-port":39}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function e(t,r,n){function o(i,u){if(!r[i]){if(!t[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[i]={exports:{}};t[i][0].call(l.exports,function(e){var r=t[i][1][e];return o(r||e)},l,l.exports,e,t,r,n)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";var n=e("./index");n.middleware=e("./middleware"),t.exports=n},{"./index":2,"./middleware":11}],2:[function(e,t,r){"use strict";var n=e("nano-pubsub"),o=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),u=["request","response","progress","error","abort"],a=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,n){var o=e,i=t;if(!o)try{i=s("onResponse",t,n)}catch(e){i=null,o=e}(o=o&&s("onError",o,n))?r.error.publish(o):i&&r.response.publish(i)}var r=u.reduce(function(e,t){return e[t]=n(),e},{}),s=o(l),a={options:s("processOptions",e),channels:r,applyMiddleware:s},c=null,f=r.request.subscribe(function(e){c=i(e,function(r,n){return t(r,n,e)})});r.abort.subscribe(function(){f(),c&&c.abort()});var p=s("onReturn",r,a);return p===r&&r.request.publish(a),p}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],l=a.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&l.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return a.forEach(function(t){e[t]&&l[t].push(e[t])}),c.push(e),t},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":8,"./request":21,"./util/middlewareReducer":24,"nano-pubsub":34}],3:[function(e,t,r){"use strict";var n=e("object-assign"),o=/^\//,s=/\/$/;t.exports=function(e){var t=e.replace(s,"");return{processOptions:function(e){if(/^https?:\/\//i.test(e.url))return e;var r=[t,e.url.replace(o,"")].join("/");return n({},e,{url:r})}}}},{"object-assign":35}],4:[function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},{}],5:[function(e,t,r){"use strict";function n(e){var t=this;if("function"!=typeof e)throw new TypeError("executor must be a function.");var r=null;this.promise=new Promise(function(e){r=e}),e(function(e){t.reason||(t.reason=new o(e),r(t.reason))})}var o=e("./Cancel");n.source=function(){var e=void 0;return{token:new n(function(t){e=t}),cancel:e}},t.exports=n},{"./Cancel":4}],6:[function(e,t,r){"use strict";t.exports=function(e){return!(!e||!e.__CANCEL__)}},{}],7:[function(e,t,r){"use strict";function n(e){return-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?o(e.body):e.body}function o(e){try{var t="string"==typeof e?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch(t){return e}}var s=e("debug");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verbose,r=e.namespace||"get-it",o=s(r),i=e.log||o,u=i===o&&!s.enabled(r),a=0;return{processOptions:function(e){return e.requestId=e.requestId||++a,e},onRequest:function(e){if(u||!e)return e;var r=e.options;return i("[%s] HTTP %s %s",r.requestId,r.method,r.url),t&&r.body&&"string"==typeof r.body&&i("[%s] Request body: %s",r.requestId,r.body),t&&r.headers&&i("[%s] Request headers: %s",r.requestId,JSON.stringify(r.headers,null,2)),e},onResponse:function(e,r){if(u||!e)return e;var o=r.options.requestId;return i("[%s] Response code: %s %s",o,e.statusCode,e.statusMessage),t&&e.body&&i("[%s] Response body: %s",o,n(e)),e},onError:function(e,t){var r=t.options.requestId;return e?(i("[%s] ERROR: %s",r,e.message),e):(i("[%s] Error encountered, but handled by an earlier middleware",r),e)}}}},{debug:28}],8:[function(e,t,r){"use strict";function n(e){function t(e,n){Array.isArray(n)?n.forEach(function(r){return t(e,r)}):r.push([e,n].map(encodeURIComponent).join("="))}var r=[];for(var n in e)a.call(e,n)&&t(n,e[n]);return r.length?r.join("&"):""}function o(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?o(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),u=e("url-parse"),a=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=u(t.url,{},!0);return t.timeout=o(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(n),t}},{"object-assign":35,"url-parse":43}],9:[function(e,t,r){"use strict";var n=e("object-assign");t.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{processOptions:function(r){var o=r.headers||{};return r.headers=t.override?n({},o,e):n({},e,o),r}}}},{"object-assign":35}],10:[function(e,t,r){"use strict";var n=e("create-error-class")("HttpError",function(e,t){this.message=(e.method+"-request to "+e.url+" resulted in HTTP "+e.statusCode+" "+e.statusMessage).trim(),this.response=e,this.request=t.options});t.exports=function(){return{onResponse:function(e,t){if(!(e.statusCode>=400))return e;throw new n(e,t)}}}},{"create-error-class":26}],11:[function(e,t,r){"use strict";r.base=e("./base"),r.debug=e("./debug"),r.jsonRequest=e("./jsonRequest"),r.jsonResponse=e("./jsonResponse"),r.httpErrors=e("./httpErrors"),r.retry=e("./retry"),r.promise=e("./promise"),r.observable=e("./observable"),r.progress=e("./progress"),r.headers=e("./headers"),r.injectResponse=e("./injectResponse")},{"./base":3,"./debug":7,"./headers":9,"./httpErrors":10,"./injectResponse":12,"./jsonRequest":13,"./jsonResponse":14,"./observable":15,"./progress":17,"./promise":18,"./retry":19}],12:[function(e,t,r){"use strict";var n=e("object-assign");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("function"!=typeof e.inject)throw new Error("`injectResponse` middleware requires a `inject` function");return{interceptRequest:function(t,r){var o=e.inject(r,t);if(!o)return t;var s=r.context.options;return n({},{body:"",url:s.url,method:s.method,headers:{},statusCode:200,statusMessage:"OK"},o)}}}},{"object-assign":35}],13:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=e("object-assign"),s=e("is-plain-object"),i=["boolean","string","number"],u=function(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)};t.exports=function(){return{processOptions:function(e){var t=e.body;return t&&!u(t)&&(-1!==i.indexOf(void 0===t?"undefined":n(t))||Array.isArray(t)||s(t)||t&&"function"==typeof t.toJSON)?o({},e,{body:JSON.stringify(e.body),headers:o({},e.headers,{"Content-Type":"application/json"})}):e}}}},{"is-plain-object":32,"object-assign":35}],14:[function(e,t,r){"use strict";function n(e){try{return JSON.parse(e)}catch(e){throw e.message="Failed to parsed response body as JSON: "+e.message,e}}var o=e("object-assign");t.exports=function(){return{onResponse:function(e){var t=e.headers["content-type"];return e.body&&t&&-1!==t.indexOf("application/json")?o({},e,{body:n(e.body)}):e},processOptions:function(e){return o({},e,{headers:o({Accept:"application/json"},e.headers)})}}}},{"object-assign":35}],15:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("object-assign");t.exports=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).implementation||n.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e){return t.error.subscribe(function(t){return e.error(t)}),t.progress.subscribe(function(t){return e.next(o({type:"progress"},t))}),t.response.subscribe(function(t){e.next(o({type:"response"},t)),e.complete()}),t.request.publish(r),function(){return t.abort.publish()}})}}}},{"../util/global":23,"object-assign":35}],16:[function(e,t,r){"use strict";t.exports=function(){return{onRequest:function(e){function t(e){return function(t){var r=t.lengthComputable?t.loaded/t.total*100:-1;n.channels.progress.publish({stage:e,percent:r,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}if("xhr"===e.adapter){var r=e.request,n=e.context;"upload"in r&&"onprogress"in r.upload&&(r.upload.onprogress=t("upload")),"onprogress"in r&&(r.onprogress=t("download"))}}}}},{}],17:[function(e,t,r){"use strict";t.exports=e("./node-progress")},{"./node-progress":16}],18:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("./cancel/Cancel"),s=e("./cancel/CancelToken"),i=e("./cancel/isCancel"),u=function(){var e=n.Promise;if(!e)throw new Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e,n){var o=r.options.cancelToken;o&&o.promise.then(function(e){t.abort.publish(e),n(e)}),t.error.subscribe(n),t.response.subscribe(e),setTimeout(function(){return t.request.publish(r)},0)})}}};u.Cancel=o,u.CancelToken=s,u.isCancel=i,t.exports=u},{"../util/global":23,"./cancel/Cancel":4,"./cancel/CancelToken":5,"./cancel/isCancel":6}],19:[function(e,t,r){"use strict";function n(e){return 100*Math.pow(2,e)+100*Math.random()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=e("object-assign"),i=e("../util/node-shouldRetry"),u=function(e){return null!==e&&"object"===(void 0===e?"undefined":o(e))&&"function"==typeof e.pipe},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxRetries||5,r=e.retryDelay||n,o=e.shouldRetry||i;return{onError:function(e,n){var i=n.options,a=i.maxRetries||t,c=i.shouldRetry||o,l=i.attemptNumber||0;if(u(i.body))return e;if(!c(e,l,i)||l>=a)return e;var f=s({},n,{options:s({},i,{attemptNumber:l+1})});return setTimeout(function(){return n.channels.request.publish(f)},r(l)),null}}};a.shouldRetry=i,t.exports=a},{"../util/node-shouldRetry":22,"object-assign":35}],20:[function(e,t,r){"use strict";var n=e("same-origin"),o=e("parse-headers"),s=window,i=s.XMLHttpRequest||function(){},u="withCredentials"in new i?i:s.XDomainRequest;t.exports=function(e,t){function r(t){O=!0,g.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+d.url:"Connection timed out on request to "+d.url);r.code=t,e.channels.error.publish(r)}function a(){E&&(c(),y.socket=setTimeout(function(){return r("ESOCKETTIMEDOUT")},E.socket))}function c(){(x||g.readyState>=2&&y.connect)&&clearTimeout(y.connect),y.socket&&clearTimeout(y.socket)}function l(){if(!j){c(),j=!0,g=null;var e=new Error("Network error while attempting to reach "+d.url);e.isNetworkError=!0,e.request=d,t(e)}}function f(){var e=g.status,t=g.statusText;if(v&&void 0===e)e=200;else{if(e>12e3&&e<12156)return l();e=1223===g.status?204:g.status,t=1223===g.status?"No Content":t}return{body:g.response||g.responseText,url:d.url,method:d.method,headers:v?{}:o(g.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function p(){x||j||O||(0!==g.status?(c(),j=!0,t(null,f())):l(new Error("Unknown XHR error")))}var d=e.options,h=!n(s.location.href,d.url),y={},b=e.applyMiddleware("interceptRequest",void 0,{adapter:"xhr",context:e});if(b){var m=setTimeout(t,0,null,b);return{abort:function(){return clearTimeout(m)}}}var g=h?new u:new i,v=s.XDomainRequest&&g instanceof s.XDomainRequest,w=d.headers,x=!1,j=!1,O=!1;if(g.onerror=l,g.ontimeout=l,g.onabort=function(){x=!0},g.onprogress=function(){},g[v?"onload":"onreadystatechange"]=function(){a(),x||4!==g.readyState&&!v||0!==g.status&&p()},g.open(d.method,d.url,!0),g.withCredentials=!!d.withCredentials,w&&g.setRequestHeader)for(var q in w)w.hasOwnProperty(q)&&g.setRequestHeader(q,w[q]);else if(w&&v)throw new Error("Headers cannot be set on an XDomainRequest object");d.rawBody&&(g.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:d,adapter:"xhr",request:g,context:e}),g.send(d.body||null);var E=d.timeout;return E&&(y.connect=setTimeout(function(){return r("ETIMEDOUT")},E.connect)),{abort:function(){x=!0,g&&g.abort()}}}},{"parse-headers":36,"same-origin":40}],21:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":20}],22:[function(e,t,r){"use strict";t.exports=function(e){return e.isNetworkError||!1}},{}],23:[function(e,t,r){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:void 0!==e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,r){"use strict";t.exports=function(e){return function(t,r){for(var n=arguments.length,o=Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(o))},r)}}},{}],25:[function(e,t,r){"use strict";t.exports=Error.captureStackTrace||function(e){var t=new Error;Object.defineProperty(e,"stack",{configurable:!0,get:function(){var e=t.stack;return Object.defineProperty(this,"stack",{value:e}),e}})}},{}],26:[function(e,t,r){"use strict";function n(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var o=e("capture-stack-trace");t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected className to be a string");if(/[^0-9a-zA-Z_$]/.test(e))throw new Error("className contains invalid characters");t=t||function(e){this.message=e};var r=function(){Object.defineProperty(this,"name",{configurable:!0,value:e,writable:!0}),o(this,this.constructor),t.apply(this,arguments)};return n(r,Error),r}},{"capture-stack-trace":25}],27:[function(e,t,r){function n(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*f;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=u?Math.round(e/u)+"s":e+"ms"}function s(e){return i(e,l,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,u,"second")||e+" ms"}function i(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var u=1e3,a=60*u,c=60*a,l=24*c,f=365.25*l;t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return n(e);if("number"===r&&!1===isNaN(e))return t.long?s(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],28:[function(e,t,r){(function(n){function o(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))}),e.splice(s,0,n)}},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=o,r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(o())}).call(this,e("_process"))},{"./debug":29,_process:37}],29:[function(e,t,r){function n(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function o(e){function t(){if(t.enabled){var e=t,n=+new Date,o=n-(s||n);e.diff=o,e.prev=s,e.curr=n,s=n;for(var i=new Array(arguments.length),u=0;u<i.length;u++)i[u]=arguments[u];i[0]=r.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;a++;var o=r.formatters[n];if("function"==typeof o){var s=i[a];t=o.call(e,s),i.splice(a,1),a--}return t}),r.formatArgs.call(e,i),(t.log||r.log||console.log.bind(console)).apply(e,i)}}return t.namespace=e,t.enabled=r.enabled(e),t.useColors=r.useColors(),t.color=n(e),"function"==typeof r.init&&r.init(t),t}(r=t.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){r.save(e),r.names=[],r.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&("-"===(e=t[o].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var s},{ms:27}],30:[function(e,t,r){function n(e,t,r){for(var n=0,o=e.length;n<o;n++)a.call(e,n)&&t.call(r,e[n],n,e)}function o(e,t,r){for(var n=0,o=e.length;n<o;n++)t.call(r,e.charAt(n),n,e)}function s(e,t,r){for(var n in e)a.call(e,n)&&t.call(r,e[n],n,e)}var i=e("is-function");t.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===u.call(e)?n(e,t,r):"string"==typeof e?o(e,t,r):s(e,t,r)};var u=Object.prototype.toString,a=Object.prototype.hasOwnProperty},{"is-function":31}],31:[function(e,t,r){t.exports=function(e){var t=n.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var n=Object.prototype.toString},{}],32:[function(e,t,r){"use strict";function n(e){return!0===o(e)&&"[object Object]"===Object.prototype.toString.call(e)}var o=e("isobject");t.exports=function(e){var t,r;return!1!==n(e)&&"function"==typeof(t=e.constructor)&&(r=t.prototype,!1!==n(r)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},{isobject:33}],33:[function(e,t,r){"use strict";t.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},{}],34:[function(e,t,r){t.exports=function(){var e=[];return{subscribe:function(t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},publish:function(){for(var t=0;t<e.length;t++)e[t].apply(null,arguments)}}}},{}],35:[function(e,t,r){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,u,a=n(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var l in r)s.call(r,l)&&(a[l]=r[l]);if(o){u=o(r);for(var f=0;f<u.length;f++)i.call(r,u[f])&&(a[u[f]]=r[u[f]])}}return a}},{}],36:[function(e,t,r){var n=e("trim"),o=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return o(n(e).split("\n"),function(e){var r=e.indexOf(":"),o=n(e.slice(0,r)).toLowerCase(),i=n(e.slice(r+1));void 0===t[o]?t[o]=i:s(t[o])?t[o].push(i):t[o]=[t[o],i]}),t}},{"for-each":30,trim:42}],37:[function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){b&&h&&(b=!1,h.length?y=h.concat(y):m=-1,y.length&&a())}function a(){if(!b){var e=s(u);b=!0;for(var t=y.length;t;){for(h=y,y=[];++m<t;)h&&h[m].run();m=-1,t=y.length}h=null,b=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var f,p,d=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,y=[],b=!1,m=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];y.push(new c(e,t)),1!==y.length||b||s(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],38:[function(e,t,r){"use strict";function n(e){return decodeURIComponent(e.replace(/\+/g," "))}var o=Object.prototype.hasOwnProperty;r.stringify=function(e,t){var r=[];"string"!=typeof(t=t||"")&&(t="?");for(var n in e)o.call(e,n)&&r.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return r.length?t+r.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);o[n(t[1])]=n(t[2]));return o}},{}],39:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],40:[function(e,t,r){"use strict";var n=e("url");t.exports=function(e,t,r){if(e===t)return!0;var o=n.parse(e,!1,!0),s=n.parse(t,!1,!0),i=0|o.port||("https"===o.protocol?443:80),u=0|s.port||("https"===s.protocol?443:80),a={proto:o.protocol===s.protocol,hostname:o.hostname===s.hostname,port:i===u};return a.proto&&a.hostname&&(a.port||r)}},{url:41}],41:[function(e,t,r){"use strict";var n=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:n,parse:function(e){var t=n.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],42:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],43:[function(e,t,r){(function(r){"use strict";function n(e){var t,n={},o=typeof(e=e||r.location||{});if("blob:"===e.protocol)n=new i(unescape(e.pathname),{});else if("string"===o){n=new i(e,{});for(t in p)delete n[t]}else if("object"===o){for(t in e)t in p||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=l.test(e.href))}return n}function o(e){var t=c.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(s=!0),r.splice(n,1),i--);return s&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var c,l,p,d,h,y,b=f.slice(),m=typeof t,g=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=a.parse),t=n(t),c=!(l=o(e||"")).protocol&&!l.slashes,g.slashes=l.slashes||c&&t.slashes,g.protocol=l.protocol||t.protocol||"",e=l.rest,l.slashes||(b[2]=[/(.*)/,"pathname"]);v<b.length;v++)p=(d=b[v])[0],y=d[1],p!==p?g[y]=e:"string"==typeof p?~(h=e.indexOf(p))&&("number"==typeof d[2]?(g[y]=e.slice(0,h),e=e.slice(h+d[2])):(g[y]=e.slice(h),e=e.slice(0,h))):(h=p.exec(e))&&(g[y]=h[1],e=e.slice(0,h.index)),g[y]=g[y]||(c&&d[3]?t[y]||"":""),d[4]&&(g[y]=g[y].toLowerCase());r&&(g.query=r(g.query)),c&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=s(g.pathname,t.pathname)),u(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(d=g.auth.split(":"),g.username=d[0]||"",g.password=d[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}var u=e("requires-port"),a=e("querystringify"),c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};i.prototype={set:function(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||a.parse)(t)),n[e]=t;break;case"port":n[e]=t,u(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":n.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:n[e]=t}for(var o=0;o<f.length;o++){var s=f[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(e){e&&"function"==typeof e||(e=a.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var o=n+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(o+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(o+=r.hash),o}},i.extractProtocol=o,i.location=n,i.qs=a,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:38,"requires-port":39}]},{},[1])(1)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getIt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=n("onResponse",r,t)}catch(e){u=null,s=e}(s=s&&n("onError",s,t))?o.error.publish(s):u&&o.response.publish(u)}var o=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),n=middlewareReducer(t),s={options:n("processOptions",e),channels:o,applyMiddleware:n},u=null,i=o.request.subscribe(function(e){u=httpRequest(e,function(o,n){return r(o,n,e)})});o.abort.subscribe(function(){i(),u&&u.abort()});var a=n("onReturn",o,s);return a===o&&o.request.publish(s),a}var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),n.push(e)},r.clone=function(){return e(n)},o.forEach(r.use),r};
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=o("onResponse",r,t)}catch(e){u=null,s=e}(s=s&&o("onError",s,t))?n.error.publish(s):u&&n.response.publish(u)}var n=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),o=middlewareReducer(t),s={options:o("processOptions",e),channels:n,applyMiddleware:o},u=null,i=n.request.subscribe(function(e){u=httpRequest(e,function(n,o){return r(n,o,e)})});n.abort.subscribe(function(){i(),u&&u.abort()});var a=o("onReturn",n,s);return a===n&&n.request.publish(s),a}var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),o.push(e),r},r.clone=function(){return e(o)},n.forEach(r.use),r};

@@ -4,0 +4,0 @@ },{"./middleware/defaultOptionsProcessor":2,"./request":4,"./util/middlewareReducer":5,"nano-pubsub":8}],2:[function(require,module,exports){

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function e(t,r,o){function n(i,a){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!a&&u)return u(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};t[i][0].call(p.exports,function(e){var r=t[i][1][e];return n(r||e)},p,p.exports,e,t,r,o)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<o.length;i++)n(o[i]);return n}({1:[function(e,t,r){"use strict";var o=e("nano-pubsub"),n=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),a=["request","response","progress","error","abort"],u=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,o){var n=e,i=t;if(!n)try{i=s("onResponse",t,o)}catch(e){i=null,n=e}(n=n&&s("onError",n,o))?r.error.publish(n):i&&r.response.publish(i)}var r=a.reduce(function(e,t){return e[t]=o(),e},{}),s=n(p),u={options:s("processOptions",e),channels:r,applyMiddleware:s},c=null,f=r.request.subscribe(function(e){c=i(e,function(r,o){return t(r,o,e)})});r.abort.subscribe(function(){f(),c&&c.abort()});var l=s("onReturn",r,u);return l===r&&r.request.publish(u),l}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],p=u.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&p.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");u.forEach(function(t){e[t]&&p[t].push(e[t])}),c.push(e)},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":2,"./request":4,"./util/middlewareReducer":5,"nano-pubsub":8}],2:[function(e,t,r){"use strict";function o(e){function t(e,o){Array.isArray(o)?o.forEach(function(r){return t(e,r)}):r.push([e,o].map(encodeURIComponent).join("="))}var r=[];for(var o in e)u.call(e,o)&&t(o,e[o]);return r.length?r.join("&"):""}function n(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?n(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),a=e("url-parse"),u=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=a(t.url,{},!0);return t.timeout=n(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(o),t}},{"object-assign":9,"url-parse":16}],3:[function(e,t,r){"use strict";var o=e("same-origin"),n=e("parse-headers"),s=window,i=s.XMLHttpRequest||function(){},a="withCredentials"in new i?i:s.XDomainRequest;t.exports=function(e,t){function r(t){x=!0,b.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+h.url:"Connection timed out on request to "+h.url);r.code=t,e.channels.error.publish(r)}function u(){E&&(c(),y.socket=setTimeout(function(){return r("ESOCKETTIMEDOUT")},E.socket))}function c(){(q||b.readyState>=2&&y.connect)&&clearTimeout(y.connect),y.socket&&clearTimeout(y.socket)}function p(){if(!O){c(),O=!0,b=null;var e=new Error("Network error while attempting to reach "+h.url);e.isNetworkError=!0,e.request=h,t(e)}}function f(){var e=b.status,t=b.statusText;if(v&&void 0===e)e=200;else{if(e>12e3&&e<12156)return p();e=1223===b.status?204:b.status,t=1223===b.status?"No Content":t}return{body:b.response||b.responseText,url:h.url,method:h.method,headers:v?{}:n(b.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function l(){q||O||x||(0!==b.status?(c(),O=!0,t(null,f())):p(new Error("Unknown XHR error")))}var h=e.options,d=!o(s.location.href,h.url),y={},w=e.applyMiddleware("interceptRequest",void 0,{adapter:"xhr",context:e});if(w){var m=setTimeout(t,0,null,w);return{abort:function(){return clearTimeout(m)}}}var b=d?new a:new i,v=s.XDomainRequest&&b instanceof s.XDomainRequest,g=h.headers,q=!1,O=!1,x=!1;if(b.onerror=p,b.ontimeout=p,b.onabort=function(){q=!0},b.onprogress=function(){},b[v?"onload":"onreadystatechange"]=function(){u(),q||4!==b.readyState&&!v||0!==b.status&&l()},b.open(h.method,h.url,!0),b.withCredentials=!!h.withCredentials,g&&b.setRequestHeader)for(var j in g)g.hasOwnProperty(j)&&b.setRequestHeader(j,g[j]);else if(g&&v)throw new Error("Headers cannot be set on an XDomainRequest object");h.rawBody&&(b.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:h,adapter:"xhr",request:b,context:e}),b.send(h.body||null);var E=h.timeout;return E&&(y.connect=setTimeout(function(){return r("ETIMEDOUT")},E.connect)),{abort:function(){q=!0,b&&b.abort()}}}},{"parse-headers":10,"same-origin":13}],4:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":3}],5:[function(e,t,r){"use strict";t.exports=function(e){return function(t,r){for(var o=arguments.length,n=Array(o>2?o-2:0),s=2;s<o;s++)n[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(n))},r)}}},{}],6:[function(e,t,r){function o(e,t,r){for(var o=0,n=e.length;o<n;o++)u.call(e,o)&&t.call(r,e[o],o,e)}function n(e,t,r){for(var o=0,n=e.length;o<n;o++)t.call(r,e.charAt(o),o,e)}function s(e,t,r){for(var o in e)u.call(e,o)&&t.call(r,e[o],o,e)}var i=e("is-function");t.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===a.call(e)?o(e,t,r):"string"==typeof e?n(e,t,r):s(e,t,r)};var a=Object.prototype.toString,u=Object.prototype.hasOwnProperty},{"is-function":7}],7:[function(e,t,r){t.exports=function(e){var t=o.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var o=Object.prototype.toString},{}],8:[function(e,t,r){t.exports=function(){var e=[];return{subscribe:function(t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},publish:function(){for(var t=0;t<e.length;t++)e[t].apply(null,arguments)}}}},{}],9:[function(e,t,r){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,a,u=o(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var p in r)s.call(r,p)&&(u[p]=r[p]);if(n){a=n(r);for(var f=0;f<a.length;f++)i.call(r,a[f])&&(u[a[f]]=r[a[f]])}}return u}},{}],10:[function(e,t,r){var o=e("trim"),n=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return n(o(e).split("\n"),function(e){var r=e.indexOf(":"),n=o(e.slice(0,r)).toLowerCase(),i=o(e.slice(r+1));void 0===t[n]?t[n]=i:s(t[n])?t[n].push(i):t[n]=[t[n],i]}),t}},{"for-each":6,trim:15}],11:[function(e,t,r){"use strict";function o(e){return decodeURIComponent(e.replace(/\+/g," "))}var n=Object.prototype.hasOwnProperty;r.stringify=function(e,t){var r=[];"string"!=typeof(t=t||"")&&(t="?");for(var o in e)n.call(e,o)&&r.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return r.length?t+r.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);n[o(t[1])]=o(t[2]));return n}},{}],12:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],13:[function(e,t,r){"use strict";var o=e("url");t.exports=function(e,t,r){if(e===t)return!0;var n=o.parse(e,!1,!0),s=o.parse(t,!1,!0),i=0|n.port||("https"===n.protocol?443:80),a=0|s.port||("https"===s.protocol?443:80),u={proto:n.protocol===s.protocol,hostname:n.hostname===s.hostname,port:i===a};return u.proto&&u.hostname&&(u.port||r)}},{url:14}],14:[function(e,t,r){"use strict";var o=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:o,parse:function(e){var t=o.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],15:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],16:[function(e,t,r){(function(r){"use strict";function o(e){var t,o={},n=typeof(e=e||r.location||{});if("blob:"===e.protocol)o=new i(unescape(e.pathname),{});else if("string"===n){o=new i(e,{});for(t in l)delete o[t]}else if("object"===n){for(t in e)t in l||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=p.test(e.href))}return o}function n(e){var t=c.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],s=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(s=!0),r.splice(o,1),i--);return s&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var c,p,l,h,d,y,w=f.slice(),m=typeof t,b=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=u.parse),t=o(t),c=!(p=n(e||"")).protocol&&!p.slashes,b.slashes=p.slashes||c&&t.slashes,b.protocol=p.protocol||t.protocol||"",e=p.rest,p.slashes||(w[2]=[/(.*)/,"pathname"]);v<w.length;v++)l=(h=w[v])[0],y=h[1],l!==l?b[y]=e:"string"==typeof l?~(d=e.indexOf(l))&&("number"==typeof h[2]?(b[y]=e.slice(0,d),e=e.slice(d+h[2])):(b[y]=e.slice(d),e=e.slice(0,d))):(d=l.exec(e))&&(b[y]=d[1],e=e.slice(0,d.index)),b[y]=b[y]||(c&&h[3]?t[y]||"":""),h[4]&&(b[y]=b[y].toLowerCase());r&&(b.query=r(b.query)),c&&t.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==t.pathname)&&(b.pathname=s(b.pathname,t.pathname)),a(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(h=b.auth.split(":"),b.username=h[0]||"",b.password=h[1]||""),b.origin=b.protocol&&b.host&&"file:"!==b.protocol?b.protocol+"//"+b.host:"null",b.href=b.toString()}var a=e("requires-port"),u=e("querystringify"),c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,p=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};i.prototype={set:function(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||u.parse)(t)),o[e]=t;break;case"port":o[e]=t,a(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":o.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:o[e]=t}for(var n=0;n<f.length;n++){var s=f[n];s[4]&&(o[s[1]]=o[s[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=u.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var n=o+(r.slashes?"//":"");return r.username&&(n+=r.username,r.password&&(n+=":"+r.password),n+="@"),n+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(n+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(n+=r.hash),n}},i.extractProtocol=n,i.location=o,i.qs=u,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:11,"requires-port":12}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function e(t,r,o){function n(i,a){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!a&&u)return u(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};t[i][0].call(p.exports,function(e){var r=t[i][1][e];return n(r||e)},p,p.exports,e,t,r,o)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<o.length;i++)n(o[i]);return n}({1:[function(e,t,r){"use strict";var o=e("nano-pubsub"),n=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),a=["request","response","progress","error","abort"],u=["processOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,o){var n=e,i=t;if(!n)try{i=s("onResponse",t,o)}catch(e){i=null,n=e}(n=n&&s("onError",n,o))?r.error.publish(n):i&&r.response.publish(i)}var r=a.reduce(function(e,t){return e[t]=o(),e},{}),s=n(p),u={options:s("processOptions",e),channels:r,applyMiddleware:s},c=null,f=r.request.subscribe(function(e){c=i(e,function(r,o){return t(r,o,e)})});r.abort.subscribe(function(){f(),c&&c.abort()});var l=s("onReturn",r,u);return l===r&&r.request.publish(u),l}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],p=u.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&p.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return u.forEach(function(t){e[t]&&p[t].push(e[t])}),c.push(e),t},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":2,"./request":4,"./util/middlewareReducer":5,"nano-pubsub":8}],2:[function(e,t,r){"use strict";function o(e){function t(e,o){Array.isArray(o)?o.forEach(function(r){return t(e,r)}):r.push([e,o].map(encodeURIComponent).join("="))}var r=[];for(var o in e)u.call(e,o)&&t(o,e[o]);return r.length?r.join("&"):""}function n(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?n(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),a=e("url-parse"),u=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=a(t.url,{},!0);return t.timeout=n(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(o),t}},{"object-assign":9,"url-parse":16}],3:[function(e,t,r){"use strict";var o=e("same-origin"),n=e("parse-headers"),s=window,i=s.XMLHttpRequest||function(){},a="withCredentials"in new i?i:s.XDomainRequest;t.exports=function(e,t){function r(t){x=!0,b.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+h.url:"Connection timed out on request to "+h.url);r.code=t,e.channels.error.publish(r)}function u(){E&&(c(),y.socket=setTimeout(function(){return r("ESOCKETTIMEDOUT")},E.socket))}function c(){(q||b.readyState>=2&&y.connect)&&clearTimeout(y.connect),y.socket&&clearTimeout(y.socket)}function p(){if(!O){c(),O=!0,b=null;var e=new Error("Network error while attempting to reach "+h.url);e.isNetworkError=!0,e.request=h,t(e)}}function f(){var e=b.status,t=b.statusText;if(v&&void 0===e)e=200;else{if(e>12e3&&e<12156)return p();e=1223===b.status?204:b.status,t=1223===b.status?"No Content":t}return{body:b.response||b.responseText,url:h.url,method:h.method,headers:v?{}:n(b.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function l(){q||O||x||(0!==b.status?(c(),O=!0,t(null,f())):p(new Error("Unknown XHR error")))}var h=e.options,d=!o(s.location.href,h.url),y={},w=e.applyMiddleware("interceptRequest",void 0,{adapter:"xhr",context:e});if(w){var m=setTimeout(t,0,null,w);return{abort:function(){return clearTimeout(m)}}}var b=d?new a:new i,v=s.XDomainRequest&&b instanceof s.XDomainRequest,g=h.headers,q=!1,O=!1,x=!1;if(b.onerror=p,b.ontimeout=p,b.onabort=function(){q=!0},b.onprogress=function(){},b[v?"onload":"onreadystatechange"]=function(){u(),q||4!==b.readyState&&!v||0!==b.status&&l()},b.open(h.method,h.url,!0),b.withCredentials=!!h.withCredentials,g&&b.setRequestHeader)for(var j in g)g.hasOwnProperty(j)&&b.setRequestHeader(j,g[j]);else if(g&&v)throw new Error("Headers cannot be set on an XDomainRequest object");h.rawBody&&(b.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:h,adapter:"xhr",request:b,context:e}),b.send(h.body||null);var E=h.timeout;return E&&(y.connect=setTimeout(function(){return r("ETIMEDOUT")},E.connect)),{abort:function(){q=!0,b&&b.abort()}}}},{"parse-headers":10,"same-origin":13}],4:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":3}],5:[function(e,t,r){"use strict";t.exports=function(e){return function(t,r){for(var o=arguments.length,n=Array(o>2?o-2:0),s=2;s<o;s++)n[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(n))},r)}}},{}],6:[function(e,t,r){function o(e,t,r){for(var o=0,n=e.length;o<n;o++)u.call(e,o)&&t.call(r,e[o],o,e)}function n(e,t,r){for(var o=0,n=e.length;o<n;o++)t.call(r,e.charAt(o),o,e)}function s(e,t,r){for(var o in e)u.call(e,o)&&t.call(r,e[o],o,e)}var i=e("is-function");t.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===a.call(e)?o(e,t,r):"string"==typeof e?n(e,t,r):s(e,t,r)};var a=Object.prototype.toString,u=Object.prototype.hasOwnProperty},{"is-function":7}],7:[function(e,t,r){t.exports=function(e){var t=o.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var o=Object.prototype.toString},{}],8:[function(e,t,r){t.exports=function(){var e=[];return{subscribe:function(t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},publish:function(){for(var t=0;t<e.length;t++)e[t].apply(null,arguments)}}}},{}],9:[function(e,t,r){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,a,u=o(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var p in r)s.call(r,p)&&(u[p]=r[p]);if(n){a=n(r);for(var f=0;f<a.length;f++)i.call(r,a[f])&&(u[a[f]]=r[a[f]])}}return u}},{}],10:[function(e,t,r){var o=e("trim"),n=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return n(o(e).split("\n"),function(e){var r=e.indexOf(":"),n=o(e.slice(0,r)).toLowerCase(),i=o(e.slice(r+1));void 0===t[n]?t[n]=i:s(t[n])?t[n].push(i):t[n]=[t[n],i]}),t}},{"for-each":6,trim:15}],11:[function(e,t,r){"use strict";function o(e){return decodeURIComponent(e.replace(/\+/g," "))}var n=Object.prototype.hasOwnProperty;r.stringify=function(e,t){var r=[];"string"!=typeof(t=t||"")&&(t="?");for(var o in e)n.call(e,o)&&r.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return r.length?t+r.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);n[o(t[1])]=o(t[2]));return n}},{}],12:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],13:[function(e,t,r){"use strict";var o=e("url");t.exports=function(e,t,r){if(e===t)return!0;var n=o.parse(e,!1,!0),s=o.parse(t,!1,!0),i=0|n.port||("https"===n.protocol?443:80),a=0|s.port||("https"===s.protocol?443:80),u={proto:n.protocol===s.protocol,hostname:n.hostname===s.hostname,port:i===a};return u.proto&&u.hostname&&(u.port||r)}},{url:14}],14:[function(e,t,r){"use strict";var o=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:o,parse:function(e){var t=o.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],15:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],16:[function(e,t,r){(function(r){"use strict";function o(e){var t,o={},n=typeof(e=e||r.location||{});if("blob:"===e.protocol)o=new i(unescape(e.pathname),{});else if("string"===n){o=new i(e,{});for(t in l)delete o[t]}else if("object"===n){for(t in e)t in l||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=p.test(e.href))}return o}function n(e){var t=c.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],s=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(s=!0),r.splice(o,1),i--);return s&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var c,p,l,h,d,y,w=f.slice(),m=typeof t,b=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=u.parse),t=o(t),c=!(p=n(e||"")).protocol&&!p.slashes,b.slashes=p.slashes||c&&t.slashes,b.protocol=p.protocol||t.protocol||"",e=p.rest,p.slashes||(w[2]=[/(.*)/,"pathname"]);v<w.length;v++)l=(h=w[v])[0],y=h[1],l!==l?b[y]=e:"string"==typeof l?~(d=e.indexOf(l))&&("number"==typeof h[2]?(b[y]=e.slice(0,d),e=e.slice(d+h[2])):(b[y]=e.slice(d),e=e.slice(0,d))):(d=l.exec(e))&&(b[y]=d[1],e=e.slice(0,d.index)),b[y]=b[y]||(c&&h[3]?t[y]||"":""),h[4]&&(b[y]=b[y].toLowerCase());r&&(b.query=r(b.query)),c&&t.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==t.pathname)&&(b.pathname=s(b.pathname,t.pathname)),a(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(h=b.auth.split(":"),b.username=h[0]||"",b.password=h[1]||""),b.origin=b.protocol&&b.host&&"file:"!==b.protocol?b.protocol+"//"+b.host:"null",b.href=b.toString()}var a=e("requires-port"),u=e("querystringify"),c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,p=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};i.prototype={set:function(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||u.parse)(t)),o[e]=t;break;case"port":o[e]=t,a(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":o.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:o[e]=t}for(var n=0;n<f.length;n++){var s=f[n];s[4]&&(o[s[1]]=o[s[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=u.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var n=o+(r.slashes?"//":"");return r.username&&(n+=r.username,r.password&&(n+=":"+r.password),n+="@"),n+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(n+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(n+=r.hash),n}},i.extractProtocol=n,i.location=o,i.qs=u,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:11,"requires-port":12}]},{},[1])(1)});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc