-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrealworld.min.js
1 lines (1 loc) · 31.4 KB
/
realworld.min.js
1
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).RealWorld=t()}}(function(){return function t(e,r,n){function o(u,s){if(!r[u]){if(!e[u]){var f="function"==typeof require&&require;if(!s&&f)return f(u,!0);if(i)return i(u,!0);var a=new Error("Cannot find module '"+u+"'");throw a.code="MODULE_NOT_FOUND",a}var h=r[u]={exports:{}};e[u][0].call(h.exports,function(t){var r=e[u][1][t];return o(r||t)},h,h.exports,t,e,r,n)}return r[u].exports}for(var i="function"==typeof require&&require,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(t,e,r){function n(t){if(!(this instanceof n))return new n(t);t||(t={}),this.token=t.token||null,this.apiRoot=t.apiRoot||"https://conduit.productionready.io/api"}var o=t("nets"),i=t("xtend");e.exports.base="https://conduit.productionready.io/api",e.exports=n;var u={json:!0},s=function(t,e){return"limit="+t+"&offset="+(e?e*t:0)};n.prototype._useToken=function(){if(this.token)return i(u,{headers:{Authorization:"Token "+this.token}})};var f=encodeURIComponent;n.prototype._getRequest=function(t,e){o(i(u,this._useToken(),{method:"GET",url:""+this.apiRoot+t}),e)},n.prototype._postRequest=function(t,e,r){o(i(u,this._useToken(),{method:"POST",url:""+this.apiRoot+t,body:e}),r)},n.prototype._putRequest=function(t,e,r){o(i(u,this._useToken(),{method:"PUT",url:""+this.apiRoot+t,body:e}),r)},n.prototype._delRequest=function(t,e){o(i(u,this._useToken(),{method:"DELETE",url:""+this.apiRoot+t}),e)},n.prototype.login=function(t,e){"function"==typeof t&&(e=t,t={}),t.email&&t.password?this._postRequest("/users/#",{user:{email:t.email,password:t.password}},e):e(new Error("Must supply username and password"))},n.prototype.register=function(t,e){"function"==typeof t&&(e=t,t={}),t.username&&t.email&&t.password?this._postRequest("/users",{user:{username:t.username,email:t.email,password:t.password}},e):e(new Error("Must supply a username, email, and password"))},n.prototype.getUser=function(t){this._getRequest("/user",t)},n.prototype.updateUser=function(t,e){"function"==typeof t&&(e=t,t={}),this._putRequest("/user",{user:t},e)},n.prototype.getProfile=function(t,e){this._getRequest("/profiles/"+t,e)},n.prototype.followUser=function(t,e){this._postRequest("/profiles/"+t+"/follow",{},e)},n.prototype.unFollowUser=function(t,e){this._delRequest("/profiles/"+t+"/follow",e)},n.prototype.listAllArticles=function(t,e){"function"==typeof t&&(e=t,t=null),this._getRequest("/articles?"+s(20,t),e)},n.prototype.listArticlesByTag=function(t,e,r){"function"==typeof e&&(r=e,e=null),this._getRequest("/articles?tag="+f(t)+"&"+s(10,e),r)},n.prototype.listArticlesByAuthor=function(t,e,r){"function"==typeof e&&(r=e,e=null),this._getRequest("/articles?author="+f(t)+"&"+s(5,e),r)},n.prototype.listArticlesByAuthorFavorites=function(t,e,r){"function"==typeof e&&(r=e,e=null),this._getRequest("/articles?favorited="+f(t)+"&"+s(20,e),r)},n.prototype.feedArticles=function(t,e){"function"==typeof t&&(e=t,t=null),this._getRequest("/articles/feed?"+s(10,t),e)},n.prototype.getArticle=function(t,e){this._getRequest("/articles/"+t,e)},n.prototype.createArticle=function(t,e){"function"==typeof t&&(e=t,t={}),this._postRequest("/articles",{article:t},e)},n.prototype.updateArticle=function(t,e,r){"function"==typeof e&&(r=e,e={}),this._putRequest("/articles/"+t,{article:e},r)},n.prototype.deleteArticle=function(t,e){this._delRequest("/articles/"+t,e)},n.prototype.addComment=function(t,e,r){"function"==typeof e&&(r=e,e={}),this._postRequest("/articles/"+t+"/comments",{comment:e},r)},n.prototype.getComments=function(t,e){this._getRequest("/articles/"+t+"/comments",e)},n.prototype.deleteComment=function(t,e,r){this._delRequest("/articles/"+t+"/comments/"+e,r)},n.prototype.favoriteArticle=function(t,e){this._postRequest("/articles/"+t+"/favorite",{},e)},n.prototype.unFavoriteArticle=function(t,e){this._delRequest("/articles/"+t+"/favorite",e)},n.prototype.getTags=function(t){this._getRequest("/tags",t)},n.prototype.setToken=function(t){this.token=t}},{nets:9,xtend:13}],2:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function i(t,e,r){for(var n,i=[],u=e;u<r;u+=3)n=(t[u]<<16)+(t[u+1]<<8)+t[u+2],i.push(o(n));return i.join("")}r.byteLength=function(t){return 3*t.length/4-n(t)},r.toByteArray=function(t){var e,r,o,i,u,a=t.length;i=n(t),u=new f(3*a/4-i),r=i>0?a-4:a;var h=0;for(e=0;e<r;e+=4)o=s[t.charCodeAt(e)]<<18|s[t.charCodeAt(e+1)]<<12|s[t.charCodeAt(e+2)]<<6|s[t.charCodeAt(e+3)],u[h++]=o>>16&255,u[h++]=o>>8&255,u[h++]=255&o;return 2===i?(o=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,u[h++]=255&o):1===i&&(o=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,u[h++]=o>>8&255,u[h++]=255&o),u},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o="",s=[],f=0,a=r-n;f<a;f+=16383)s.push(i(t,f,f+16383>a?a:f+16383));return 1===n?(e=t[r-1],o+=u[e>>2],o+=u[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=u[e>>10],o+=u[e>>4&63],o+=u[e<<2&63],o+="="),s.push(o),s.join("")};for(var u=[],s=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,c=a.length;h<c;++h)u[h]=a[h],s[a.charCodeAt(h)]=h;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function u(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){g&&y&&(g=!1,y.length?d=y.concat(d):w=-1,d.length&&f())}function f(){if(!g){var t=i(s);g=!0;for(var e=d.length;e;){for(y=d,d=[];++w<e;)y&&y[w].run();w=-1,e=d.length}y=null,g=!1,u(t)}}function a(t,e){this.fun=t,this.array=e}function h(){}var c,p,l=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var y,d=[],g=!1,w=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new a(t,e)),1!==d.length||g||i(f)},a.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=h,l.addListener=h,l.once=h,l.off=h,l.removeListener=h,l.removeAllListeners=h,l.emit=h,l.prependListener=h,l.prependOnceListener=h,l.listeners=function(t){return[]},l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],4:[function(t,e,r){"use strict";function n(t){if(t>W)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(t)}return i(t,e,r)}function i(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return z(t)?c(t,e,r):"string"==typeof t?a(t,e):p(t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,e,r){return u(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function f(t){return u(t),n(t<0?0:0|l(t))}function a(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(t,e),i=n(r),u=i.write(t,e);return u!==r&&(i=i.slice(0,u)),i}function h(t){for(var e=t.length<0?0:0|l(t.length),r=n(e),o=0;o<e;o+=1)r[o]=255&t[o];return r}function c(t,e,r){if(e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),n.__proto__=o.prototype,n}function p(t){if(o.isBuffer(t)){var e=0|l(t.length),r=n(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(Y(t)||"length"in t)return"number"!=typeof t.length||G(t.length)?n(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(t){if(t>=W)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W.toString(16)+" bytes");return 0|t}function y(t,e){if(o.isBuffer(t))return t.length;if(Y(t)||z(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return P(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return U(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,G(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){function i(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,s/=2,f/=2,r/=2}var a;if(o){var h=-1;for(a=r;a<s;a++)if(i(t,a)===i(e,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===f)return h*u}else-1!==h&&(a-=a-h),h=-1}else for(r+f>s&&(r=s-f),a=r;a>=0;a--){for(var c=!0,p=0;p<f;p++)if(i(t,a+p)!==i(e,p)){c=!1;break}if(c)return a}return-1}function m(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var s=parseInt(e.substr(2*u,2),16);if(G(s))return u;t[r+u]=s}return u}function b(t,e,r,n){return F(P(e,t.length-r),t,r,n)}function E(t,e,r,n){return F(D(e),t,r,n)}function A(t,e,r,n){return E(t,e,r,n)}function R(t,e,r,n){return F(H(e),t,r,n)}function T(t,e,r,n){return F(N(e,t.length-r),t,r,n)}function _(t,e,r){return 0===e&&r===t.length?J.fromByteArray(t):J.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],u=null,s=i>239?4:i>223?3:i>191?2:1;if(o+s<=r){var f,a,h,c;switch(s){case 1:i<128&&(u=i);break;case 2:128==(192&(f=t[o+1]))&&(c=(31&i)<<6|63&f)>127&&(u=c);break;case 3:f=t[o+1],a=t[o+2],128==(192&f)&&128==(192&a)&&(c=(15&i)<<12|(63&f)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:f=t[o+1],a=t[o+2],h=t[o+3],128==(192&f)&&128==(192&a)&&128==(192&h)&&(c=(15&i)<<18|(63&f)<<12|(63&a)<<6|63&h)>65535&&c<1114112&&(u=c)}}null===u?(u=65533,s=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=s}return q(n)}function q(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Z));return r}function U(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function L(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=X(t[i]);return o}function C(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,u){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<u)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function k(t,e,r,n,o){return e=+e,r>>>=0,o||S(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),V.write(t,e,r,n,23,4),r+4}function O(t,e,r,n,o){return e=+e,r>>>=0,o||S(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),V.write(t,e,r,n,52,8),r+8}function j(t){if((t=t.trim().replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function X(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function D(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function N(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}function H(t){return J.toByteArray(j(t))}function F(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function z(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function Y(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function G(t){return t!==t}var J=t("base64-js"),V=t("ieee754");r.Buffer=o,r.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},r.INSPECT_MAX_BYTES=50;var W=2147483647;r.kMaxLength=W,o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(t,e,r){return i(t,e,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(t,e,r){return s(t,e,r)},o.allocUnsafe=function(t){return f(t)},o.allocUnsafeSlow=function(t){return f(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,u=Math.min(r,n);i<u;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var u=t[r];if(!o.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,i),i+=u.length}return n},o.byteLength=y,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?B(this,0,t):d.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t,e,r,n,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var u=i-n,s=r-e,f=Math.min(u,s),a=this.slice(n,i),h=t.slice(e,r),c=0;c<f;++c)if(a[c]!==h[c]){u=a[c],s=h[c];break}return u<s?-1:s<u?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return R(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;o.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=o.prototype,n},o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),V.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),V.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),V.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),V.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=0,u=1,s=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/u>>0)-s&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=r-1,u=1,s=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/u>>0)-s&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var u;if("number"==typeof t)for(u=e;u<r;++u)this[u]=t;else{var s=o.isBuffer(t)?t:new o(t,n),f=s.length;for(u=0;u<r-e;++u)this[u+e]=s[u%f]}return this};var $=/[^+/0-9A-Za-z-_]/g},{"base64-js":2,ieee754:7}],5:[function(t,e,r){function n(t,e,r){for(var n=0,o=t.length;n<o;n++)f.call(t,n)&&e.call(r,t[n],n,t)}function o(t,e,r){for(var n=0,o=t.length;n<o;n++)e.call(r,t.charAt(n),n,t)}function i(t,e,r){for(var n in t)f.call(t,n)&&e.call(r,t[n],n,t)}var u=t("is-function");e.exports=function(t,e,r){if(!u(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===s.call(t)?n(t,e,r):"string"==typeof t?o(t,e,r):i(t,e,r)};var s=Object.prototype.toString,f=Object.prototype.hasOwnProperty},{"is-function":8}],6:[function(t,e,r){(function(t){var r;r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(t,e,r){r.read=function(t,e,r,n,o){var i,u,s=8*o-n-1,f=(1<<s)-1,a=f>>1,h=-7,c=r?o-1:0,p=r?-1:1,l=t[e+c];for(c+=p,i=l&(1<<-h)-1,l>>=-h,h+=s;h>0;i=256*i+t[e+c],c+=p,h-=8);for(u=i&(1<<-h)-1,i>>=-h,h+=n;h>0;u=256*u+t[e+c],c+=p,h-=8);if(0===i)i=1-a;else{if(i===f)return u?NaN:1/0*(l?-1:1);u+=Math.pow(2,n),i-=a}return(l?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,e,r,n,o,i){var u,s,f,a=8*i-o-1,h=(1<<a)-1,c=h>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),(e+=u+c>=1?p/f:p*Math.pow(2,1-c))*f>=2&&(u++,f/=2),u+c>=h?(s=0,u=h):u+c>=1?(s=(e*f-1)*Math.pow(2,o),u+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,o),u=0));o>=8;t[r+l]=255&s,l+=y,s/=256,o-=8);for(u=u<<o|s,a+=o;a>0;t[r+l]=255&u,l+=y,u/=256,a-=8);t[r+l-y]|=128*d}},{}],8:[function(t,e,r){e.exports=function(t){var e=n.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var n=Object.prototype.toString},{}],9:[function(t,e,r){(function(r,n){var o=t("request");e.exports=function(t,e){if("string"==typeof t&&(t={uri:t}),t.hasOwnProperty("encoding")||(t.encoding=null),r.browser&&!t.hasOwnProperty("json")&&null===t.encoding){t.responseType="arraybuffer";var i=e;e=function(t,e,r){r&&(r=new n(new Uint8Array(r))),i(t,e,r)}}return o(t,e)}}).call(this,t("_process"),t("buffer").Buffer)},{_process:3,buffer:4,request:12}],10:[function(t,e,r){var n=t("trim"),o=t("for-each"),i=function(t){return"[object Array]"===Object.prototype.toString.call(t)};e.exports=function(t){if(!t)return{};var e={};return o(n(t).split("\n"),function(t){var r=t.indexOf(":"),o=n(t.slice(0,r)).toLowerCase(),u=n(t.slice(r+1));void 0===e[o]?e[o]=u:i(e[o])?e[o].push(u):e[o]=[e[o],u]}),e}},{"for-each":5,trim:11}],11:[function(t,e,r){(r=e.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],12:[function(t,e,r){"use strict";function n(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function o(t,e,r){var n=t;return a(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=c(e,{uri:t}),n.callback=r,n}function i(t,e,r){return e=o(t,e,r),u(e)}function u(t){function e(){var t=void 0;if(t=a.response?a.response:a.responseText||s(a),m)try{t=JSON.parse(t)}catch(t){}return t}function r(t){return clearTimeout(l),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,f(t,b)}function o(){if(!p){var r;clearTimeout(l),r=t.useXDR&&void 0===a.status?200:1223===a.status?204:a.status;var n=b,o=null;return 0!==r?(n={body:e(),statusCode:r,method:d,headers:{},url:y,rawRequest:a},a.getAllResponseHeaders&&(n.headers=h(a.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),f(o,n,n.body)}}if(void 0===t.callback)throw new Error("callback argument missing");var u=!1,f=function(e,r,n){u||(u=!0,t.callback(e,r,n))},a=t.xhr||null;a||(a=t.cors||t.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var c,p,l,y=a.url=t.uri||t.url,d=a.method=t.method||"GET",g=t.body||t.data,w=a.headers=t.headers||{},v=!!t.sync,m=!1,b={body:void 0,headers:{},statusCode:0,method:d,url:y,rawRequest:a};if("json"in t&&!1!==t.json&&(m=!0,w.accept||w.Accept||(w.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(w["content-type"]||w["Content-Type"]||(w["Content-Type"]="application/json"),g=JSON.stringify(!0===t.json?g:t.json))),a.onreadystatechange=function(){4===a.readyState&&setTimeout(o,0)},a.onload=o,a.onerror=r,a.onprogress=function(){},a.onabort=function(){p=!0},a.ontimeout=r,a.open(d,y,!v,t.username,t.password),v||(a.withCredentials=!!t.withCredentials),!v&&t.timeout>0&&(l=setTimeout(function(){if(!p){p=!0,a.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",r(t)}},t.timeout)),a.setRequestHeader)for(c in w)w.hasOwnProperty(c)&&a.setRequestHeader(c,w[c]);else if(t.headers&&!n(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(a.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(a),a.send(g||null),a}function s(t){if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}var f=t("global/window"),a=t("is-function"),h=t("parse-headers"),c=t("xtend");e.exports=i,i.XMLHttpRequest=f.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:f.XDomainRequest,function(t,e){for(var r=0;r<t.length;r++)e(t[r])}(["get","put","post","patch","head","delete"],function(t){i["delete"===t?"del":t]=function(e,r,n){return r=o(e,r,n),r.method=t.toUpperCase(),u(r)}})},{"global/window":6,"is-function":8,"parse-headers":10,xtend:13}],13:[function(t,e,r){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var o in r)n.call(r,o)&&(t[o]=r[o])}return t};var n=Object.prototype.hasOwnProperty},{}]},{},[1])(1)});