forked from arangodb/arangojs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharangojs.min.js
2 lines (2 loc) · 61.1 KB
/
arangojs.min.js
1
2
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.arangojs=e():t.arangojs=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}var r=n(25),i=o(r),a=n(23),s=o(a);t.exports=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return new(Function.prototype.bind.apply(i["default"],[null].concat(e)))},t.exports.Database=i["default"],t.exports.aqlQuery=t.exports.aql=s["default"]},function(t,e){"use strict";function n(t){var e=o.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)}t.exports=n;var o=Object.prototype.toString},function(t,e,n){"use strict";e.decode=e.parse=n(12),e.encode=e.stringify=n(13)},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){var n=e.type===h.EDGE_COLLECTION?d:y;return new n(t,e.name)}Object.defineProperty(e,"__esModule",{value:!0}),e._types=e._BaseCollection=e.DocumentCollection=e.EdgeCollection=e.types=void 0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();e["default"]=s;var l=n(4),f=o(l),h=e.types={DOCUMENT_COLLECTION:2,EDGE_COLLECTION:3},p=function(){function t(e,n){a(this,t),this.name=n,this._urlPrefix="/collection/"+n+"/",this._idPrefix=n+"/",this._connection=e,this._api=this._connection.route("/_api"),this._connection.arangoMajor>=3&&(this.first=void 0,this.last=void 0,this.createCapConstraint=void 0)}return c(t,[{key:"_documentHandle",value:function(t){if("string"!=typeof t){if(t._id)return t._id;if(t._key)return this._idPrefix+t._key;throw new Error("Document handle must be a document or string")}return t.indexOf("/")===-1?this._idPrefix+t:t}},{key:"_indexHandle",value:function(t){if("string"!=typeof t){if(t.id)return t.id;throw new Error("Document handle must be a document or string")}return t.indexOf("/")===-1?this._idPrefix+t:t}},{key:"_get",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.get(this._urlPrefix+t,e,function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"_put",value:function(t,e,n){var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.put(this._urlPrefix+t,e,function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"get",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/collection/"+this.name,function(t,e){return t?o(t):o(null,e.body)}),n}},{key:"create",value:function(t,e){"function"==typeof t&&(e=t,t=void 0);var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.post("/collection",u({},t,{name:this.name,type:this.type}),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"properties",value:function(t){return this._get("properties",t)}},{key:"count",value:function(t){return this._get("count",t)}},{key:"figures",value:function(t){return this._get("figures",t)}},{key:"revision",value:function(t){return this._get("revision",t)}},{key:"checksum",value:function(t,e){return this._get("checksum",t,e)}},{key:"load",value:function(t,e){return"function"==typeof t&&(e=t,t=void 0),this._put("load","boolean"==typeof t?{count:t}:void 0,e)}},{key:"unload",value:function(t){return this._put("unload",void 0,t)}},{key:"setProperties",value:function(t,e){return this._put("properties",t,e)}},{key:"rename",value:function(t,e){var n=this,o=this._connection.promisify(e),r=o.promise,i=o.callback;return this._api.put(this._urlPrefix+"rename",{name:t},function(e,o){e?i(e):(n.name=t,n._idPrefix=t+"/",n._urlPrefix="/collection/"+t+"/",i(null,o.body))}),r}},{key:"rotate",value:function(t){return this._put("rotate",void 0,t)}},{key:"truncate",value:function(t){return this._put("truncate",void 0,t)}},{key:"drop",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api["delete"]("/collection/"+this.name,function(t,e){return t?o(t):o(null,e.body)}),n}},{key:"replace",value:function(t,e,n,o){"function"==typeof n&&(o=n,n=void 0),"string"==typeof n&&(n={rev:n});var r=this._connection.promisify(o),i=r.promise,a=r.callback,s=n&&n.rev,u=s&&this._connection.arangoMajor>=3?{"if-match":s}:void 0;return this._api.put(this._documentPath(t),e,n,u,function(t,e){return t?a(t):a(null,e.body)}),i}},{key:"update",value:function(t,e,n,o){"function"==typeof n&&(o=n,n=void 0),"string"==typeof n&&(n={rev:n});var r=this._connection.promisify(o),i=r.promise,a=r.callback,s=n&&n.rev,u=s&&this._connection.arangoMajor>=3?{"if-match":s}:void 0;return this._api.patch(this._documentPath(t),e,n,u,function(t,e){return t?a(t):a(null,e.body)}),i}},{key:"remove",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0),"string"==typeof e&&(e={rev:e});var o=this._connection.promisify(n),r=o.promise,i=o.callback,a=e&&e.rev,s=a&&this._connection.arangoMajor>=3?{"if-match":a}:void 0;return this._api["delete"](this._documentPath(t),e,s,function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"list",value:function(t,e){"function"==typeof t&&(e=t,t=void 0),t||(t="id");var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._connection.arangoMajor<3?this._api.get("/document",{type:t,collection:this.name},function(t,e){return t?r(t):r(null,e.body.documents)}):this._api.put("/simple/all-keys",{type:t,collection:this.name},function(t,e){return r(t?t:e.body.result)}),o}},{key:"all",value:function(t,e){var n=this;"function"==typeof t&&(e=t,t=void 0);var o=this._connection.promisify(e),r=o.promise,i=o.callback;return this._api.put("/simple/all",u({},t,{collection:this.name}),function(t,e){return t?i(t):i(null,new f["default"](n._connection,e.body))}),r}},{key:"any",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.put("/simple/any",{collection:this.name},function(t,e){return t?o(t):o(null,e.body.document)}),n}},{key:"first",value:function(t,e){"function"==typeof t&&(e=t,t=void 0),"number"==typeof t&&(t={count:t});var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.put("/simple/first",u({},t,{collection:this.name}),function(t,e){return t?r(t):r(null,e.body.result)}),o}},{key:"last",value:function(t,e){"function"==typeof t&&(e=t,t=void 0),"number"==typeof t&&(t={count:t});var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.put("/simple/last",u({},t,{collection:this.name}),function(t,e){return t?r(t):r(null,e.body.result)}),o}},{key:"byExample",value:function(t,e,n){var o=this;"function"==typeof e&&(n=e,e=void 0);var r=this._connection.promisify(n),i=r.promise,a=r.callback;return this._api.put("/simple/by-example",u({},e,{example:t,collection:this.name}),function(t,e){return t?a(t):a(null,new f["default"](o._connection,e.body))}),i}},{key:"firstExample",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.put("/simple/first-example",{example:t,collection:this.name},function(t,e){return t?r(t):r(null,e.body.document)}),o}},{key:"removeByExample",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.put("/simple/remove-by-example",u({},e,{example:t,collection:this.name}),function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"replaceByExample",value:function(t,e,n,o){"function"==typeof n&&(o=n,n=void 0);var r=this._connection.promisify(o),i=r.promise,a=r.callback;return this._api.put("/simple/replace-by-example",u({},n,{example:t,newValue:e,collection:this.name}),function(t,e){return t?a(t):a(null,e.body)}),i}},{key:"updateByExample",value:function(t,e,n,o){"function"==typeof n&&(o=n,n=void 0);var r=this._connection.promisify(o),i=r.promise,a=r.callback;return this._api.put("/simple/update-by-example",u({},n,{example:t,newValue:e,collection:this.name}),function(t,e){return t?a(t):a(null,e.body)}),i}},{key:"lookupByKeys",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.put("/simple/lookup-by-keys",{keys:t,collection:this.name},function(t,e){return t?r(t):r(null,e.body.documents)}),o}},{key:"removeByKeys",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.put("/simple/remove-by-keys",u({},e,{keys:t,collection:this.name}),function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"import",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.request({method:"POST",path:"/import",body:t,ld:Boolean(!e||"array"!==e.type),qs:u({type:"auto"},e,{collection:this.name})},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"indexes",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/index",{collection:this.name},function(t,e){return t?o(t):o(null,e.body.indexes)}),n}},{key:"index",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.get("/index/"+this._indexHandle(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"createIndex",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.post("/index",t,{collection:this.name},function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"dropIndex",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api["delete"]("/index/"+this._indexHandle(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"createCapConstraint",value:function(t,e){"number"==typeof t&&(t={size:t});var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.post("/index",u({},t,{type:"cap"}),{collection:this.name},function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"createHashIndex",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0),"string"==typeof t&&(t=[t]),"boolean"==typeof e&&(e={unique:e});var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/index",u({unique:!1},e,{type:"hash",fields:t}),{collection:this.name},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"createSkipList",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0),"string"==typeof t&&(t=[t]),"boolean"==typeof e&&(e={unique:e});var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/index",u({unique:!1},e,{type:"skiplist",fields:t}),{collection:this.name},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"createGeoIndex",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0),"string"==typeof t&&(t=[t]);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/index",u({},e,{fields:t,type:"geo"}),{collection:this.name},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"createFulltextIndex",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0),"string"==typeof t&&(t=[t]),e&&(e=Number(e));var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/index",{fields:t,minLength:e,type:"fulltext"},{collection:this.name},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"fulltext",value:function(t,e,n,o){var r=this;"function"==typeof n&&(o=n,n=void 0),n||(n={}),n.index&&(n.index=this._indexHandle(n.index));var i=this._connection.promisify(o),a=i.promise,s=i.callback;return this._api.put("/simple/fulltext",u({},n,{attribute:t,query:e,collection:this.name}),function(t,e){return t?s(t):s(null,new f["default"](r._connection,e.body))}),a}}]),t}();p.prototype.isArangoCollection=!0;var y=function(t){function e(){var t;a(this,e);for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=r(this,(t=Object.getPrototypeOf(e)).call.apply(t,[this].concat(o)));return s.type=h.DOCUMENT_COLLECTION,s}return i(e,t),c(e,[{key:"_documentPath",value:function(t){return"/document/"+this._documentHandle(t)}},{key:"document",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.get(this._documentPath(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"save",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.post("/document",t,{collection:this.name},function(t,e){return t?r(t):r(null,e.body)}),o}}]),e}(p),d=function(t){function e(){var t;a(this,e);for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=r(this,(t=Object.getPrototypeOf(e)).call.apply(t,[this].concat(o)));return s.type=h.EDGE_COLLECTION,s}return i(e,t),c(e,[{key:"_documentPath",value:function(t){return this._connection.arangoMajor<3?"edge/"+this._documentHandle(t):"document/"+this._documentHandle(t)}},{key:"edge",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.get(this._documentPath(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"save",value:function(t,e,n,o){"function"==typeof e?(o=e,e=void 0):e&&(t._from=this._documentHandle(e),t._to=this._documentHandle(n));var r=this._connection.promisify(o),i=r.promise,a=r.callback;return this._connection.arangoMajor<3?this._api.post("/edge",t,{collection:this.name,from:t._from,to:t._to},function(t,e){return t?a(t):a(null,e.body)}):this._api.post("/document",t,{collection:this.name},function(t,e){return t?a(t):a(null,e.body)}),i}},{key:"_edges",value:function(t,e,n){var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.get("/edges/"+this.name,{direction:e,vertex:this._documentHandle(t)},function(t,e){return t?i(t):i(null,e.body.edges)}),r}},{key:"edges",value:function(t,e){return this._edges(t,void 0,e)}},{key:"inEdges",value:function(t,e){return this._edges(t,"in",e)}},{key:"outEdges",value:function(t,e){return this._edges(t,"out",e)}},{key:"traversal",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/traversal",u({},e,{startVertex:t,edgeCollection:this.name}),function(t,e){return t?i(t):i(null,e.body.result)}),r}}]),e}(p);e.EdgeCollection=d,e.DocumentCollection=y,e._BaseCollection=p,e._types=h},function(t,e){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),i=function(){function t(e,n){o(this,t),this.extra=n.extra,this._connection=e,this._api=this._connection.route("/_api"),this._result=n.result,this._hasMore=Boolean(n.hasMore),this._id=n.id,this.count=n.count}return r(t,[{key:"_drain",value:function(t){var e=this,n=this._connection.promisify(t),o=n.promise,r=n.callback;return this._more(function(n){return n?r(n):e._hasMore?e._drain(t):r(null,e)}),o}},{key:"_more",value:function(t){var e=this;this._hasMore?this._api.put("/cursor/"+this._id,function(o,r){if(o)t(o);else{var i;(i=e._result).push.apply(i,n(r.body.result)),e._hasMore=r.body.hasMore,t(null,e)}}):t(null,this)}},{key:"all",value:function(t){var e=this,n=this._connection.promisify(t),o=n.promise,r=n.callback;return this._drain(function(t){if(t)r(t);else{for(var n=[];e._result.length;)n.push(e._result.shift());r(null,n)}}),o}},{key:"next",value:function e(t){var n=this,o=this._connection.promisify(t),r=o.promise,i=o.callback,e=function(){var t=n._result.shift();i(null,t)};return this._result.length?e():this._hasMore?this._more(function(t){return t?i(t):e()}):i(null),r}},{key:"hasNext",value:function(){return Boolean(this._hasMore||this._result.length)}},{key:"each",value:function(t,e){var n=this,o=this._connection.promisify(e),r=o.promise,i=o.callback,a=0,s=function u(){try{for(var e=void 0;n._result.length&&(e=t(n._result.shift(),a,n),a++,e!==!1););n._hasMore&&e!==!1?n._more(function(t){return t?i(t):u()}):i(null,e)}catch(o){i(o)}};return s(),r}},{key:"every",value:function(t,e){var n=this,o=this._connection.promisify(e),r=o.promise,i=o.callback,a=0,s=function u(){try{for(var e=!0;n._result.length&&(e=t(n._result.shift(),a,n),a++,e););n._hasMore&&e?n._more(function(t){return t?i(t):u()}):i(null,Boolean(e))}catch(o){i(o)}};return s(),r}},{key:"some",value:function(t,e){var n=this,o=this._connection.promisify(e),r=o.promise,i=o.callback,a=0,s=function u(){try{for(var e=!1;n._result.length&&(e=t(n._result.shift(),a,n),a++,!e););!n._hasMore||e?i(null,Boolean(e)):n._more(function(t){return t?i(t):u()})}catch(o){i(o)}};return s(),r}},{key:"map",value:function(t,e){var n=this,o=this._connection.promisify(e),r=o.promise,i=o.callback,a=0,s=[],u=function c(){try{for(;n._result.length;)s.push(t(n._result.shift(),a,n)),a++;n._hasMore?n._more(function(t){return t?i(t):c()}):i(null,s)}catch(e){i(e)}};return u(),r}},{key:"reduce",value:function(t,e,n){var o=this;"function"==typeof e&&(n=e,e=void 0);var r=0,i=this._connection.promisify(n),a=i.promise,s=i.callback,u=function c(){try{for(;o._result.length;)e=t(e,o._result.shift(),r,o),r++;o._hasMore?o._more(function(t){return t?s(t):c()}):s(null,e)}catch(n){s(n)}};return void 0!==e?u():this._result.length>1?(e=this._result.shift(),r=1,u()):this._more(function(t){t?s(t):(e=o._result.shift(),r=1,u())}),a}}]),t}();e["default"]=i},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":a(e))&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function i(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0];n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return Object.defineProperty(r,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:r.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(r,r.constructor),o(r)):(Object.defineProperty(r,"stack",{configurable:!0,enumerable:!1,value:new Error(t).stack,writable:!0}),r)}return r(e,t),e}(i(Error));e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";function o(t,e,n){if(!s(e))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===u.call(t)?r(t,e,n):"string"==typeof t?i(t,e,n):a(t,e,n)}function r(t,e,n){for(var o=0,r=t.length;o<r;o++)c.call(t,o)&&e.call(n,t[o],o,t)}function i(t,e,n){for(var o=0,r=t.length;o<r;o++)e.call(n,t.charAt(o),o,t)}function a(t,e,n){for(var o in t)c.call(t,o)&&e.call(n,t[o],o,t)}var s=n(1);t.exports=o;var u=Object.prototype.toString,c=Object.prototype.hasOwnProperty},function(t,e){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(e,function(){return this}())},function(t,e,n){"use strict";function o(){for(var t,e,n=500,r={},i=0;i<arguments.length;i++){var a=arguments[i];if(a instanceof Error)t=a,n=t.status||t.statusCode||n;else switch("undefined"==typeof a?"undefined":c(a)){case"string":e=a;break;case"number":n=a;break;case"object":r=a}}"number"==typeof n&&f[n]||(n=500);var s=o[n];t||(t=s?new s(e):new Error(e||f[n]),Error.captureStackTrace(t,o)),s&&t instanceof s||(t.expose=n<500,t.status=t.statusCode=n);for(var u in r)"status"!==u&&"statusCode"!==u&&(t[u]=r[u]);return t}function r(){function t(){throw new TypeError("cannot construct abstract class")}return h(t,Error),t}function i(t,e,n){function o(t){var e=new Error(null!=t?t:f[n]);return Error.captureStackTrace(e,o),l(e,o.prototype),Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,value:r,writable:!0}),e}var r=e.match(/Error$/)?e:e+"Error";return h(o,t),o.prototype.status=n,o.prototype.statusCode=n,o.prototype.expose=!0,o}function a(t,e,n){function o(t){var e=new Error(null!=t?t:f[n]);return Error.captureStackTrace(e,o),l(e,o.prototype),Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,value:r,writable:!0}),e}var r=e.match(/Error$/)?e:e+"Error";return h(o,t),o.prototype.status=n,o.prototype.statusCode=n,o.prototype.expose=!1,o}function s(t,e,n){e.forEach(function(e){var o,r=u(f[e]);switch(String(e).charAt(0)){case"4":o=i(n,r,e);break;case"5":o=a(n,r,e)}o&&(t[e]=o,t[r]=o)}),t["I'mateapot"]=t.ImATeapot}function u(t){return t.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},l=n(14),f=n(15),h=n(10);t.exports=o,t.exports.HttpError=r(),s(t.exports,f.codes,t.exports.HttpError)},function(t,e){"use strict";"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";var o=n(16),r=n(7),i=function(t){return"[object Array]"===Object.prototype.toString.call(t)};t.exports=function(t){if(!t)return{};var e={};return r(o(t).split("\n"),function(t){var n=t.indexOf(":"),r=o(t.slice(0,n)).toLowerCase(),a=o(t.slice(n+1));"undefined"==typeof e[r]?e[r]=a:i(e[r])?e[r].push(a):e[r]=[e[r],a]}),e}},function(t,e){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,o,r){e=e||"&",o=o||"=";var i={};if("string"!=typeof t||0===t.length)return i;var a=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var u=t.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var l,f,h,p,y=t[c].replace(a,"%20"),d=y.indexOf(o);d>=0?(l=y.substr(0,d),f=y.substr(d+1)):(l=y,f=""),h=decodeURIComponent(l),p=decodeURIComponent(f),n(i,h)?Array.isArray(i[h])?i[h].push(p):i[h]=[i[h],p]:i[h]=p}return i}},function(t,e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=function(t){switch("undefined"==typeof t?"undefined":n(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"===("undefined"==typeof t?"undefined":n(t))?Object.keys(t).map(function(n){var i=encodeURIComponent(o(n))+r;return Array.isArray(t[n])?t[n].map(function(t){return i+encodeURIComponent(o(t))}).join(e):i+encodeURIComponent(o(t[n]))}).join(e):i?encodeURIComponent(o(i))+r+encodeURIComponent(o(t)):""}},function(t,e){"use strict";function n(t,e){t.__proto__=e}function o(t,e){for(var n in e)t[n]=e[n]}t.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?n:o)},function(t,e,n){"use strict";function o(t,e){var n=[];return Object.keys(e).forEach(function(o){var r=e[o],i=Number(o);t[i]=r,t[r]=i,t[r.toLowerCase()]=i,n.push(i)}),n}function r(t){if("number"==typeof t){if(!r[t])throw new Error("invalid status code: "+t);return t}if("string"!=typeof t)throw new TypeError("code must be a number or string");var e=parseInt(t,10);if(!isNaN(e)){if(!r[e])throw new Error("invalid status code: "+e);return e}if(e=r[t.toLowerCase()],!e)throw new Error('invalid status message: "'+t+'"');return e}var i=n(32);t.exports=r,r.codes=o(r,i),r.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},r.empty={204:!0,205:!0,304:!0},r.retry={502:!0,503:!0,504:!0}},function(t,e){"use strict";function n(t){return t.replace(/^\s*|\s*$/g,"")}e=t.exports=n,e.left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}},function(t,e,n){var o;(function(t,r){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(a){function s(t){throw RangeError(L[t])}function u(t,e){for(var n=t.length,o=[];n--;)o[n]=e(t[n]);return o}function c(t,e){var n=t.split("@"),o="";n.length>1&&(o=n[0]+"@",t=n[1]),t=t.replace(N,".");var r=t.split("."),i=u(r,e).join(".");return o+i}function l(t){for(var e,n,o=[],r=0,i=t.length;r<i;)e=t.charCodeAt(r++),e>=55296&&e<=56319&&r<i?(n=t.charCodeAt(r++),56320==(64512&n)?o.push(((1023&e)<<10)+(1023&n)+65536):(o.push(e),r--)):o.push(e);return o}function f(t){return u(t,function(t){var e="";return t>65535&&(t-=65536,e+=U(t>>>10&1023|55296),t=56320|1023&t),e+=U(t)}).join("")}function h(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:j}function p(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function y(t,e,n){var o=0;for(t=n?H(t/q):t>>1,t+=H(t/e);t>I*P>>1;o+=j)t=H(t/I);return H(o+(I+1)*t/(t+C))}function d(t){var e,n,o,r,i,a,u,c,l,p,d=[],m=t.length,v=0,b=M,_=A;for(n=t.lastIndexOf(T),n<0&&(n=0),o=0;o<n;++o)t.charCodeAt(o)>=128&&s("not-basic"),d.push(t.charCodeAt(o));for(r=n>0?n+1:0;r<m;){for(i=v,a=1,u=j;r>=m&&s("invalid-input"),c=h(t.charCodeAt(r++)),(c>=j||c>H((O-v)/a))&&s("overflow"),v+=c*a,l=u<=_?E:u>=_+P?P:u-_,!(c<l);u+=j)p=j-l,a>H(O/p)&&s("overflow"),a*=p;e=d.length+1,_=y(v-i,e,0==i),H(v/e)>O-b&&s("overflow"),b+=H(v/e),v%=e,d.splice(v++,0,b)}return f(d)}function m(t){var e,n,o,r,i,a,u,c,f,h,d,m,v,b,_,g=[];for(t=l(t),m=t.length,e=M,n=0,i=A,a=0;a<m;++a)d=t[a],d<128&&g.push(U(d));for(o=r=g.length,r&&g.push(T);o<m;){for(u=O,a=0;a<m;++a)d=t[a],d>=e&&d<u&&(u=d);for(v=o+1,u-e>H((O-n)/v)&&s("overflow"),n+=(u-e)*v,e=u,a=0;a<m;++a)if(d=t[a],d<e&&++n>O&&s("overflow"),d==e){for(c=n,f=j;h=f<=i?E:f>=i+P?P:f-i,!(c<h);f+=j)_=c-h,b=j-h,g.push(U(p(h+_%b,0))),c=H(_/b);g.push(U(p(c,0))),i=y(n,v,o==r),n=0,++o}++n,++e}return g.join("")}function v(t){return c(t,function(t){return S.test(t)?d(t.slice(4).toLowerCase()):t})}function b(t){return c(t,function(t){return R.test(t)?"xn--"+m(t):t})}var _="object"==i(e)&&e&&!e.nodeType&&e,g="object"==i(t)&&t&&!t.nodeType&&t,k="object"==("undefined"==typeof r?"undefined":i(r))&&r;k.global!==k&&k.window!==k&&k.self!==k||(a=k);var w,x,O=2147483647,j=36,E=1,P=26,C=38,q=700,A=72,M=128,T="-",S=/^xn--/,R=/[^\x20-\x7E]/,N=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=j-E,H=Math.floor,U=String.fromCharCode;if(w={version:"1.3.2",ucs2:{decode:l,encode:f},decode:d,encode:m,toASCII:b,toUnicode:v},"object"==i(n(5))&&n(5))o=function(){return w}.call(e,n,e,t),!(void 0!==o&&(t.exports=o));else if(_&&g)if(t.exports==_)g.exports=w;else for(x in w)w.hasOwnProperty(x)&&(_[x]=w[x]);else a.punycode=w}(void 0)}).call(e,n(20)(t),function(){return this}())},function(t,e,n){"use strict";function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function r(t,e,n){if(t&&c(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}function i(t){return u(t)&&(t=r(t)),t instanceof o?t.format():o.prototype.format.call(t)}function a(t,e){return r(t,!1,!0).resolve(e)}function s(t,e){return t?r(t,!1,!0).resolveObject(e):e}function u(t){return"string"==typeof t}function c(t){return"object"===("undefined"==typeof t?"undefined":h(t))&&null!==t}function l(t){return null===t}function f(t){return null==t}var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},p=n(17);e.parse=r,e.resolve=a,e.resolveObject=s,e.format=i,e.Url=o;var y=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,m=["<",">",'"',"`"," ","\r","\n","\t"],v=["{","}","|","\\","^","`"].concat(m),b=["'"].concat(v),_=["%","/","?",";","#"].concat(b),g=["/","?","#"],k=255,w=/^[a-z0-9A-Z_-]{0,63}$/,x=/^([a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},j={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},P=n(2);o.prototype.parse=function(t,e,n){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+("undefined"==typeof t?"undefined":h(t)));var o=t;o=o.trim();var r=y.exec(o);if(r){r=r[0];var i=r.toLowerCase();this.protocol=i,o=o.substr(r.length)}if(n||r||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var a="//"===o.substr(0,2);!a||r&&j[r]||(o=o.substr(2),this.slashes=!0)}if(!j[r]&&(a||r&&!E[r])){for(var s=-1,c=0;c<g.length;c++){var l=o.indexOf(g[c]);l!==-1&&(s===-1||l<s)&&(s=l)}var f,d;d=s===-1?o.lastIndexOf("@"):o.lastIndexOf("@",s),d!==-1&&(f=o.slice(0,d),o=o.slice(d+1),this.auth=decodeURIComponent(f)),s=-1;for(var c=0;c<_.length;c++){var l=o.indexOf(_[c]);l!==-1&&(s===-1||l<s)&&(s=l)}s===-1&&(s=o.length),this.host=o.slice(0,s),o=o.slice(s),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var v=this.hostname.split(/\./),c=0,C=v.length;c<C;c++){var q=v[c];if(q&&!q.match(w)){for(var A="",M=0,T=q.length;M<T;M++)A+=q.charCodeAt(M)>127?"x":q[M];if(!A.match(w)){var S=v.slice(0,c),R=v.slice(c+1),N=q.match(x);N&&(S.push(N[1]),R.unshift(N[2])),R.length&&(o="/"+R.join(".")+o),this.hostname=S.join(".");break}}}if(this.hostname.length>k?this.hostname="":this.hostname=this.hostname.toLowerCase(),!m){for(var L=this.hostname.split("."),I=[],c=0;c<L.length;++c){var H=L[c];I.push(H.match(/[^A-Za-z0-9_-]/)?"xn--"+p.encode(H):H)}this.hostname=I.join(".")}var U=this.port?":"+this.port:"",D=this.hostname||"";
this.host=D+U,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!O[i])for(var c=0,C=b.length;c<C;c++){var B=b[c],F=encodeURIComponent(B);F===B&&(F=escape(B)),o=o.split(B).join(F)}var X=o.indexOf("#");X!==-1&&(this.hash=o.substr(X),o=o.slice(0,X));var V=o.indexOf("?");if(V!==-1?(this.search=o.substr(V),this.query=o.substr(V+1),e&&(this.query=P.parse(this.query)),o=o.slice(0,V)):e&&(this.search="",this.query={}),o&&(this.pathname=o),E[i]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",H=this.search||"";this.path=U+H}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",o=this.hash||"",r=!1,i="";this.host?r=t+this.host:this.hostname&&(r=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(i=P.stringify(this.query));var a=this.search||i&&"?"+i||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||E[e])&&r!==!1?(r="//"+(r||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):r||(r=""),o&&"#"!==o.charAt(0)&&(o="#"+o),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),a=a.replace("#","%23"),e+r+n+a+o},o.prototype.resolve=function(t){return this.resolveObject(r(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(u(t)){var e=new o;e.parse(t,!1,!0),t=e}var n=new o;if(Object.keys(this).forEach(function(t){n[t]=this[t]},this),n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(n[e]=t[e])}),E[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(t.protocol&&t.protocol!==n.protocol){if(!E[t.protocol])return Object.keys(t).forEach(function(e){n[e]=t[e]}),n.href=n.format(),n;if(n.protocol=t.protocol,t.host||j[t.protocol])n.pathname=t.pathname;else{for(var r=(t.pathname||"").split("/");r.length&&!(t.host=r.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var i=n.pathname||"",a=n.search||"";n.path=i+a}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var s=n.pathname&&"/"===n.pathname.charAt(0),c=t.host||t.pathname&&"/"===t.pathname.charAt(0),h=c||s||n.host&&t.pathname,p=h,y=n.pathname&&n.pathname.split("/")||[],r=t.pathname&&t.pathname.split("/")||[],d=n.protocol&&!E[n.protocol];if(d&&(n.hostname="",n.port=null,n.host&&(""===y[0]?y[0]=n.host:y.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===r[0]?r[0]=t.host:r.unshift(t.host)),t.host=null),h=h&&(""===r[0]||""===y[0])),c)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,y=r;else if(r.length)y||(y=[]),y.pop(),y=y.concat(r),n.search=t.search,n.query=t.query;else if(!f(t.search)){if(d){n.hostname=n.host=y.shift();var m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return n.search=t.search,n.query=t.query,l(n.pathname)&&l(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!y.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var v=y.slice(-1)[0],b=(n.host||t.host)&&("."===v||".."===v)||""===v,_=0,g=y.length;g>=0;g--)v=y[g],"."==v?y.splice(g,1):".."===v?(y.splice(g,1),_++):_&&(y.splice(g,1),_--);if(!h&&!p)for(;_--;_)y.unshift("..");!h||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),b&&"/"!==y.join("/").substr(-1)&&y.push("");var k=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(d){n.hostname=n.host=k?"":y.length?y.shift():"";var m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return h=h||n.host&&y.length,h&&!k&&y.unshift(""),y.length?n.pathname=y.join("/"):(n.pathname=null,n.path=null),l(n.pathname)&&l(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=d.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e){"use strict";t.exports=function(t){return~-encodeURI(t).split(/%..|./).length}},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function o(t,e){for(var n=0;n<t.length;n++)e(t[n])}function r(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function i(t,e,n){var o=t;return f(e)?(n=e,"string"==typeof t&&(o={uri:t})):o=p(e,{uri:t}),o.callback=n,o}function a(t,e,n){return e=i(t,e,n),s(e)}function s(t){function e(){4===f.readyState&&i()}function n(){var t=void 0;if(t=f.response?f.response:f.responseText||u(f),k)try{t=JSON.parse(t)}catch(e){}return t}function o(t){clearTimeout(d),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,s(t,l),s=c}function i(){if(!y){var e;clearTimeout(d),e=t.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var o=l,r=null;0!==e?(o={body:n(),statusCode:e,method:v,headers:{},url:m,rawRequest:f},f.getAllResponseHeaders&&(o.headers=h(f.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),s(r,o,o.body),s=c}}var s=t.callback;if("undefined"==typeof s)throw new Error("callback argument missing");var l={body:void 0,headers:{},statusCode:0,method:v,url:m,rawRequest:f},f=t.xhr||null;f||(f=t.cors||t.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var p,y,d,m=f.url=t.uri||t.url,v=f.method=t.method||"GET",b=t.body||t.data||null,_=f.headers=t.headers||{},g=!!t.sync,k=!1;if("json"in t&&(k=!0,_.accept||_.Accept||(_.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),b=JSON.stringify(t.json))),f.onreadystatechange=e,f.onload=i,f.onerror=o,f.onprogress=function(){},f.ontimeout=o,f.open(v,m,!g,t.username,t.password),g||(f.withCredentials=!!t.withCredentials),!g&&t.timeout>0&&(d=setTimeout(function(){y=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",o(t)},t.timeout)),f.setRequestHeader)for(p in _)_.hasOwnProperty(p)&&f.setRequestHeader(p,_[p]);else if(t.headers&&!r(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(b),f}function u(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function c(){}var l=n(8),f=n(1),h=n(11),p=n(22);t.exports=a,a.XMLHttpRequest=l.XMLHttpRequest||c,a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:l.XDomainRequest,o(["get","put","post","patch","head","delete"],function(t){a["delete"===t?"del":t]=function(e,n,o){return n=i(e,n,o),n.method=t.toUpperCase(),s(n)}})},function(t,e){"use strict";function n(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var r in n)o.call(n,r)&&(t[r]=n[r])}return t}t.exports=n;var o=Object.prototype.hasOwnProperty},function(t,e){"use strict";function n(t){for(var e={},n=[],o=t[0],r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];for(var s=0;s<i.length;s++){var u=i[s],c=u;if(u&&"function"==typeof u.toAQL)o+=""+u.toAQL()+t[s+1];else{var l=n.indexOf(u),f=l!==-1,h="value"+(f?l:n.length);u&&u.isArangoCollection&&(h="@"+h,c=u.name),f||(n.push(u),e[h]=c),o+="@"+h+t[s+1]}}return{query:o,bindVars:e}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),u=n(30),c=o(u),l=n(9),f=o(l),h=n(2),p=o(h),y=n(31),d=o(y),m=n(26),v=o(m),b=n(28),_=o(b),g=n(19),k=/\/(json|javascript)(\W|$)/,w=function(){function t(e){r(this,t),"string"==typeof e&&(e={url:e}),this.config=a({},t.defaults,e),this.config.agentOptions=a({},t.agentDefaults,this.config.agentOptions),this.config.headers||(this.config.headers={}),this.config.headers["x-arango-version"]||(this.config.headers["x-arango-version"]=this.config.arangoVersion),this.arangoMajor=Math.floor(this.config.arangoVersion/1e4),this._request=(0,d["default"])(this.config.url,this.config.agentOptions,this.config.agent),this._databasePath="/_db/"+this.config.databaseName,this.promisify=(0,c["default"])(this.config.promise)}return s(t,[{key:"_buildUrl",value:function(t){var e="",n=void 0;return t.absolutePath||(e=this._databasePath,t.basePath&&(e+=t.basePath)),t.path&&(e+=t.path),t.qs&&(n="string"==typeof t.qs?"?"+t.qs:"?"+p["default"].stringify(t.qs)),n?{pathname:e,search:n}:{pathname:e}}},{key:"route",value:function(t,e){return new _["default"](this,t,e)}},{key:"request",value:function(t,e){var n=this.promisify(e),o=n.promise,r=n.callback,a="text/plain",s=t.body;s&&("object"===("undefined"==typeof s?"undefined":i(s))?t.ld?(s=s.map(function(t){return JSON.stringify(t)}).join("\r\n")+"\r\n",a="application/x-ldjson"):(s=JSON.stringify(s),a="application/json"):s=String(s)),t.headers.hasOwnProperty("content-type")||(t.headers["content-type"]=a),"undefined"!=typeof window||t.headers.hasOwnProperty("content-length")||(t.headers["content-length"]=s?g(s,"utf-8"):0);var u=!0,c=!1,l=void 0;try{for(var h,p=Object.keys(this.config.headers)[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var y=h.value;t.headers.hasOwnProperty(y)||(t.headers[y]=this.config.headers[y])}}catch(d){c=!0,l=d}finally{try{!u&&p["return"]&&p["return"]()}finally{if(c)throw l}}return this._request({url:this._buildUrl(t),headers:t.headers,method:t.method,body:s},function(t,e){if(t)r(t);else{if(e.rawBody=e.body,e.headers["content-type"].match(k))try{e.body=JSON.parse(e.rawBody)}catch(n){return n.response=e,r(n)}e.body&&e.body.error&&e.body.hasOwnProperty("code")&&e.body.hasOwnProperty("errorMessage")&&e.body.hasOwnProperty("errorNum")?(t=new v["default"](e.body),t.response=e,r(t)):e.statusCode>=400?(t=(0,f["default"])(e.statusCode),t.response=e,r(t)):r(null,e)}}),o}}]),t}();e["default"]=w,w.defaults={url:"http://localhost:8529",databaseName:"_system",arangoVersion:3e4},w.agentDefaults={maxSockets:3,keepAlive:!0,keepAliveMsecs:1e3}},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),s=n(29),u=o(s),c=n(24),l=o(c),f=n(4),h=o(f),p=n(27),y=o(p),d=n(3),m=o(d),v=function(){function t(e){r(this,t),this._connection=new l["default"](e),this._api=this._connection.route("/_api"),this.name=this._connection.config.databaseName}return a(t,[{key:"route",value:function(t,e){return this._connection.route(t,e)}},{key:"useDatabase",value:function(t){return this._connection.config.databaseName=t,this._connection._databasePath="/_db/"+t,this.name=t,this}},{key:"get",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/database/current",function(t,e){return t?o(t):o(null,e.body.result)}),n}},{key:"createDatabase",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/database",{users:e,name:t},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"listDatabases",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/database",function(t,e){return t?o(t):o(null,e.body.result)}),n}},{key:"listUserDatabases",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/database/user",function(t,e){return t?o(t):o(null,e.body.result)}),n}},{key:"dropDatabase",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api["delete"]("/database/"+t,function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"collection",value:function(t){return new d.DocumentCollection(this._connection,t)}},{key:"edgeCollection",value:function(t){return new d.EdgeCollection(this._connection,t)}},{key:"listCollections",value:function(t,e){"function"==typeof t&&(e=t,t=void 0);var n=this._connection.promisify(e),o=n.promise,r=n.callback;"boolean"!=typeof t&&(t=!0);var i=this._connection.arangoMajor<3?"collections":"result";return this._api.get("/collection",{excludeSystem:t},function(t,e){return t?r(t):r(null,e.body[i])}),o}},{key:"collections",value:function(t,e){var n=this;"function"==typeof t&&(e=t,t=void 0);var o=this._connection.promisify(e),r=o.promise,i=o.callback;return this.listCollections(t,function(t,e){return t?i(t):i(null,e.map(function(t){return(0,m["default"])(n._connection,t)}))}),r}},{key:"truncate",value:function(t,e){var n=this;"function"==typeof t&&(e=t,t=void 0);var o=this._connection.promisify(e),r=o.promise,i=o.callback;return this.listCollections(t,function(t,e){return t?i(t):(0,u["default"])(e.map(function(t){return function(e){return n._api.put("/collection/"+t.name+"/truncate",function(t,n){return t?e(t):e(null,n.body)})}}),i)}),r}},{key:"graph",value:function(t){return new y["default"](this._connection,t)}},{key:"listGraphs",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/gharial",function(t,e){return t?o(t):o(null,e.body.graphs)}),n}},{key:"graphs",value:function(t){var e=this,n=this._connection.promisify(t),o=n.promise,r=n.callback;return this.listGraphs(function(t,n){return t?r(t):r(null,n.map(function(t){return e.graph(t._key)}))}),o}},{key:"transaction",value:function(t,e,n,o,r){"function"==typeof o&&(r=o,o=void 0),"function"==typeof n&&(r=n,n=void 0),"number"==typeof n&&(o=n,n=void 0),("string"==typeof t||Array.isArray(t))&&(t={write:t});var i=this._connection.promisify(r),a=i.promise,s=i.callback;return this._api.post("/transaction",{collections:t,action:e,params:n,lockTimeout:o},function(t,e){return t?s(t):s(null,e.body.result)}),a}},{key:"query",value:function(t,e,n,o){var r=this;"function"==typeof n&&(o=n,n=void 0),"function"==typeof e&&(o=e,e=void 0);var a=this._connection.promisify(o),s=a.promise,u=a.callback;return t&&t.query&&(n||(n=e),e=t.bindVars,t=t.query),t&&"function"==typeof t.toAQL&&(t=t.toAQL()),this._api.post("/cursor",i({},n,{query:t,bindVars:e}),function(t,e){return t?u(t):u(null,new h["default"](r._connection,e.body))}),s}},{key:"listFunctions",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._api.get("/aqlfunction",function(t,e){return t?o(t):o(null,e.body)}),n}},{key:"createFunction",value:function(t,e,n){var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/aqlfunction",{name:t,code:e},function(t,e){return t?i(t):i(null,e.body)}),r}},{key:"dropFunction",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api["delete"]("/aqlfunction/"+t,{group:Boolean(e)},function(t,e){return t?i(t):i(null,e.body)}),r}}]),t}();e["default"]=v},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(6),u=o(s),c=function(t){function e(t){r(this,e);var n=i(this,Object.getPrototypeOf(e).call(this));n.message=t.errorMessage,n.errorNum=t.errorNum,n.code=t.code;var o=new Error(n.message);return o.name=n.name,o.fileName&&(n.fileName=o.fileName),o.lineNumber&&(n.lineNumber=o.lineNumber),o.columnNumber&&(n.columnNumber=o.columnNumber),o.stack&&(n.stack=o.stack),o.description&&(n.description=o.description),o.number&&(n.number=o.number),n}return a(e,t),e}(u["default"]);e["default"]=c,c.prototype.name="ArangoError",c.prototype.isArangoError=!0},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.EdgeCollection=e.VertexCollection=void 0;var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),u=n(3),c=function(t){function e(t,n,i){o(this,e);var a=r(this,Object.getPrototypeOf(e).call(this,t,n));return a.type=u._types.DOCUMENT_COLLECTION,a.graph=i,a._gharial=a._api.route("/gharial/"+a.graph.name+"/vertex"),a}return i(e,t),s(e,[{key:"_documentPath",value:function(t){return"/document/"+this._documentHandle(t)}},{key:"remove",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial["delete"]("/"+this._documentHandle(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"vertex",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial.get("/"+this._documentHandle(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"save",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial.post(this.name,t,function(t,e){return t?r(t):r(null,e.body)}),o}}]),e}(u._BaseCollection),l=function(t){function e(t,n,i){o(this,e);var a=r(this,Object.getPrototypeOf(e).call(this,t,n));return a.type=u._types.EDGE_COLLECTION,a.graph=i,a._gharial=a._api.route("/gharial/"+a.graph.name+"/edge"),a}return i(e,t),s(e,[{key:"remove",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial["delete"]("/"+this._documentHandle(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"edge",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial.get("/"+this._documentHandle(t),function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"save",value:function(t,e,n,o){"function"==typeof e?(o=e,e=void 0):e&&(t._from=this._documentHandle(e),t._to=this._documentHandle(n));var r=this._connection.promisify(o),i=r.promise,a=r.callback;return this._gharial.post(this.name,t,function(t,e){return t?a(t):a(null,e.body)}),i}}]),e}(u.EdgeCollection),f=function(){function t(e,n){o(this,t),this.name=n,this._connection=e,this._api=this._connection.route("/_api"),this._gharial=this._api.route("/gharial/"+this.name)}return s(t,[{key:"get",value:function(t){var e=this._connection.promisify(t),n=e.promise,o=e.callback;return this._gharial.get(function(t,e){return t?o(t):o(null,e.body.graph)}),n}},{key:"create",value:function(t,e){"function"==typeof t&&(e=t,t=void 0);var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._api.post("/gharial",a({},t,{name:this.name}),function(t,e){return t?r(t):r(null,e.body.graph)}),o}},{key:"drop",value:function(t,e){"function"==typeof t&&(e=t,t=void 0),"boolean"!=typeof t&&(t=!1);var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial["delete"]({dropCollections:t},function(t,e){return t?r(t):r(null,e.body)}),o}},{key:"vertexCollection",value:function(t){return new c(this._connection,t,this)}},{key:"addVertexCollection",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial.post("/vertex",{collection:t},function(t,e){return t?r(t):r(null,e.body.graph)}),o}},{key:"removeVertexCollection",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return"boolean"!=typeof e&&(e=!1),this._gharial["delete"]("/vertex/"+t,{dropCollection:e},function(t,e){return t?i(t):i(null,e.body.graph)}),r}},{key:"edgeCollection",value:function(t){return new l(this._connection,t,this)}},{key:"addEdgeDefinition",value:function(t,e){var n=this._connection.promisify(e),o=n.promise,r=n.callback;return this._gharial.post("/edge",t,function(t,e){return t?r(t):r(null,e.body.graph)}),o}},{key:"replaceEdgeDefinition",value:function(t,e,n){var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._gharial.put("/edge/"+t,e,function(t,e){return t?i(t):i(null,e.body.graph)}),r}},{key:"removeEdgeDefinition",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return"boolean"!=typeof e&&(e=!1),this._gharial["delete"]("edge/"+t,{dropCollection:e},function(t,e){return t?i(t):i(null,e.body.graph)}),r}},{key:"traversal",value:function(t,e,n){"function"==typeof e&&(n=e,e=void 0);var o=this._connection.promisify(n),r=o.promise,i=o.callback;return this._api.post("/traversal",a({},e,{startVertex:t,graphName:this.name}),function(t,e){return t?i(t):i(null,e.body.result)}),r}}]),t}();e["default"]=f,e.VertexCollection=c,e.EdgeCollection=l},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),i=function(){function t(e,o,r){n(this,t),this._connection=e,this._path=o||"",this._headers=r}return r(t,[{key:"route",value:function(e,n){return e?"/"!==e.charAt(0)&&(e="/"+e):e="",new t(this._connection,this._path+e,o({},this._headers,n))}},{key:"request",value:function(t,e){return t=o({},t),t.basePath=this._path,t.headers=o({},this._headers,t.headers),t.method=t.method?t.method.toUpperCase():"GET",this._connection.request(t,e)}},{key:"get",value:function(t,e,n,r){return"string"!=typeof t&&(r=e,e=t,t=void 0),"function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=void 0),t?this._path&&"/"!==t.charAt(0)&&(t="/"+t):t="",n=n?o({},this._headers,n):o({},this._headers),this._connection.request({basePath:this._path,path:t,qs:e,headers:n,method:"GET"},r)}},{key:"post",value:function(t,e,n,r,i){return"string"!=typeof t&&(i=n,n=e,e=t,t=void 0),"function"==typeof n&&(i=n,n=void 0),"function"==typeof e&&(i=e,e=void 0),"function"==typeof r&&(i=r,r=void 0),t?this._path&&"/"!==t.charAt(0)&&(t="/"+t):t="",r=r?o({},this._headers,r):o({},this._headers),this._connection.request({basePath:this._path,path:t,body:e,qs:n,headers:r,method:"POST"},i)}},{key:"put",value:function(t,e,n,r,i){return"string"!=typeof t&&(i=e,e=n,n=t,t=void 0),"function"==typeof n&&(i=n,n=void 0),"function"==typeof e&&(i=e,e=void 0),"function"==typeof r&&(i=r,r=void 0),t?this._path&&"/"!==t.charAt(0)&&(t="/"+t):t="",r=r?o({},this._headers,r):o({},this._headers),this._connection.request({basePath:this._path,path:t,body:e,qs:n,headers:r,method:"PUT"},i)}},{key:"patch",value:function(t,e,n,r,i){return"string"!=typeof t&&(i=e,e=n,n=t,t=void 0),"function"==typeof n&&(i=n,n=void 0),"function"==typeof e&&(i=e,e=void 0),"function"==typeof r&&(i=r,r=void 0),t?this._path&&"/"!==t.charAt(0)&&(t="/"+t):t="",r=r?o({},this._headers,r):o({},this._headers),this._connection.request({basePath:this._path,path:t,body:e,qs:n,headers:r,method:"PATCH"},i)}},{key:"delete",value:function(t,e,n,r){return"string"!=typeof t&&(r=e,e=t,t=void 0),"function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=void 0),t?this._path&&"/"!==t.charAt(0)&&(t="/"+t):t="",n=n?o({},this._headers,n):o({},this._headers),this._connection.request({basePath:this._path,path:t,qs:e,headers:n,method:"DELETE"},r)}},{key:"head",value:function(t,e,n,r){return"string"!=typeof t&&(r=e,e=t,t=void 0),"function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=void 0),t?this._path&&"/"!==t.charAt(0)&&(t="/"+t):t="",n=n?o({},this._headers,n):o({},this._headers),this._connection.request({basePath:this._path,path:t,qs:e,headers:n,method:"HEAD"},r)}}]),t}();e["default"]=i},function(t,e){"use strict";function n(t,e){var n=[],o=t.length,r=!1;if(0===t.length)return e(null,n);var i=function(t){return function(i,a){if(o-=1,i||(n[t]=a),!r){if(i)e(i);else{if(0!==o)return;n.every(function(t){return void 0===t})?e(null):e(null,n)}r=!0}}};t.forEach(function(t,e){return t(i(e))})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){(function(t){"use strict";function n(e){return e===!1?function(t){return{callback:t||o}}:function(n){function r(t,e){n=function(n,o){n?e(n):t(o)}}if(n||!e&&!t.Promise)return{callback:n||o};var i=e?new e(r):new t.Promise(r);return{callback:n,promise:i}}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n;var o=function(){}}).call(e,function(){return this}())},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];if(!t&&!e)return"";for(var n="/"===t.charAt(0),o="/"===e.charAt(e.length-1),r=(t+"/"+e).split("/").filter(Boolean),i=0;i<r.length;i++){var a=r[i];".."===a?(r.splice(i-1,2),i--):"."===a&&(r.splice(i,1),i--)}var s=r.join("/");return n&&(s="/"+s),o&&(s+="/"),s}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};e["default"]=function(t,e){function n(){if(f.length&&!(p>=h)){var t=f.shift();p+=1,t(function(){p-=1,n()})}}e||(e={});var o=(0,u.parse)(t),a=o.auth?o.auth.indexOf(":"):-1,c=a!==-1?o.auth.slice(0,a):o.auth||void 0,l=a!==-1?o.auth.slice(a+1):o.auth?"":void 0;delete o.auth;var f=[],h="number"==typeof e.maxSockets?2*e.maxSockets:1/0,p=0;return function(t,a){var h=t.method,p=t.url,y=t.headers,d=t.body;"string"!=typeof c||y.authorization||(y.authorization="Basic "+window.btoa(c+":"+(l||"")));var m=i({},o,{pathname:p.pathname?o.pathname?r(o.pathname,p.pathname):p.pathname:o.pathname,search:p.search?o.search?o.search+"&"+p.search.slice(1):p.search:o.search});f.push(function(t){var n=function(){n=function(){},t(),a.apply(void 0,arguments)},o=(0,s["default"])(i({responseType:"text"},e,{url:(0,u.format)(m),body:d,method:h,headers:y}),function(t,e){t?(t.request=o,n(t)):n(null,e)})}),n()}};var a=n(21),s=o(a),u=n(18)},function(t,e){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"(Unused)",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}}])});