UNPKG

76.5 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.to-string'), require('core-js/modules/es.promise'), require('core-js/modules/es.symbol'), require('core-js/modules/es.symbol.description'), require('core-js/modules/es.symbol.async-iterator'), require('core-js/modules/es.symbol.iterator'), require('core-js/modules/es.symbol.to-string-tag'), require('core-js/modules/es.array.for-each'), require('core-js/modules/es.array.iterator'), require('core-js/modules/es.array.reverse'), require('core-js/modules/es.array.slice'), require('core-js/modules/es.date.to-string'), require('core-js/modules/es.function.name'), require('core-js/modules/es.json.to-string-tag'), require('core-js/modules/es.math.to-string-tag'), require('core-js/modules/es.object.create'), require('core-js/modules/es.object.get-prototype-of'), require('core-js/modules/es.object.set-prototype-of'), require('core-js/modules/es.regexp.to-string'), require('core-js/modules/es.string.iterator'), require('core-js/modules/web.dom-collections.for-each'), require('core-js/modules/web.dom-collections.iterator'), require('axios'), require('core-js/modules/es.array.is-array'), require('core-js/modules/es.array.map'), require('core-js/modules/es.array.splice'), require('core-js/modules/es.regexp.constructor'), require('core-js/modules/es.regexp.exec'), require('core-js/modules/es.string.replace'), require('core-js/modules/es.object.entries')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.to-string', 'core-js/modules/es.promise', 'core-js/modules/es.symbol', 'core-js/modules/es.symbol.description', 'core-js/modules/es.symbol.async-iterator', 'core-js/modules/es.symbol.iterator', 'core-js/modules/es.symbol.to-string-tag', 'core-js/modules/es.array.for-each', 'core-js/modules/es.array.iterator', 'core-js/modules/es.array.reverse', 'core-js/modules/es.array.slice', 'core-js/modules/es.date.to-string', 'core-js/modules/es.function.name', 'core-js/modules/es.json.to-string-tag', 'core-js/modules/es.math.to-string-tag', 'core-js/modules/es.object.create', 'core-js/modules/es.object.get-prototype-of', 'core-js/modules/es.object.set-prototype-of', 'core-js/modules/es.regexp.to-string', 'core-js/modules/es.string.iterator', 'core-js/modules/web.dom-collections.for-each', 'core-js/modules/web.dom-collections.iterator', 'axios', 'core-js/modules/es.array.is-array', 'core-js/modules/es.array.map', 'core-js/modules/es.array.splice', 'core-js/modules/es.regexp.constructor', 'core-js/modules/es.regexp.exec', 'core-js/modules/es.string.replace', 'core-js/modules/es.object.entries'], factory) :
4 (global = global || self, factory(global.CSREST = {}, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.axios));
5}(this, (function (exports, es_object_toString, es_promise, es_symbol, es_symbol_description, es_symbol_asyncIterator, es_symbol_iterator, es_symbol_toStringTag, es_array_forEach, es_array_iterator, es_array_reverse, es_array_slice, es_date_toString, es_function_name, es_json_toStringTag, es_math_toStringTag, es_object_create, es_object_getPrototypeOf, es_object_setPrototypeOf, es_regexp_toString, es_string_iterator, web_domCollections_forEach, web_domCollections_iterator, axios) { 'use strict';
6
7 axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
8
9 function _typeof(obj) {
10 "@babel/helpers - typeof";
11
12 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
13 _typeof = function (obj) {
14 return typeof obj;
15 };
16 } else {
17 _typeof = function (obj) {
18 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
19 };
20 }
21
22 return _typeof(obj);
23 }
24
25 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
26 try {
27 var info = gen[key](arg);
28 var value = info.value;
29 } catch (error) {
30 reject(error);
31 return;
32 }
33
34 if (info.done) {
35 resolve(value);
36 } else {
37 Promise.resolve(value).then(_next, _throw);
38 }
39 }
40
41 function _asyncToGenerator(fn) {
42 return function () {
43 var self = this,
44 args = arguments;
45 return new Promise(function (resolve, reject) {
46 var gen = fn.apply(self, args);
47
48 function _next(value) {
49 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
50 }
51
52 function _throw(err) {
53 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
54 }
55
56 _next(undefined);
57 });
58 };
59 }
60
61 function _classCallCheck(instance, Constructor) {
62 if (!(instance instanceof Constructor)) {
63 throw new TypeError("Cannot call a class as a function");
64 }
65 }
66
67 function _defineProperties(target, props) {
68 for (var i = 0; i < props.length; i++) {
69 var descriptor = props[i];
70 descriptor.enumerable = descriptor.enumerable || false;
71 descriptor.configurable = true;
72 if ("value" in descriptor) descriptor.writable = true;
73 Object.defineProperty(target, descriptor.key, descriptor);
74 }
75 }
76
77 function _createClass(Constructor, protoProps, staticProps) {
78 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
79 if (staticProps) _defineProperties(Constructor, staticProps);
80 return Constructor;
81 }
82
83 function _defineProperty(obj, key, value) {
84 if (key in obj) {
85 Object.defineProperty(obj, key, {
86 value: value,
87 enumerable: true,
88 configurable: true,
89 writable: true
90 });
91 } else {
92 obj[key] = value;
93 }
94
95 return obj;
96 }
97
98 function ownKeys(object, enumerableOnly) {
99 var keys = Object.keys(object);
100
101 if (Object.getOwnPropertySymbols) {
102 var symbols = Object.getOwnPropertySymbols(object);
103 if (enumerableOnly) symbols = symbols.filter(function (sym) {
104 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
105 });
106 keys.push.apply(keys, symbols);
107 }
108
109 return keys;
110 }
111
112 function _objectSpread2(target) {
113 for (var i = 1; i < arguments.length; i++) {
114 var source = arguments[i] != null ? arguments[i] : {};
115
116 if (i % 2) {
117 ownKeys(Object(source), true).forEach(function (key) {
118 _defineProperty(target, key, source[key]);
119 });
120 } else if (Object.getOwnPropertyDescriptors) {
121 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
122 } else {
123 ownKeys(Object(source)).forEach(function (key) {
124 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
125 });
126 }
127 }
128
129 return target;
130 }
131
132 function _slicedToArray(arr, i) {
133 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
134 }
135
136 function _arrayWithHoles(arr) {
137 if (Array.isArray(arr)) return arr;
138 }
139
140 function _iterableToArrayLimit(arr, i) {
141 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
142 var _arr = [];
143 var _n = true;
144 var _d = false;
145 var _e = undefined;
146
147 try {
148 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
149 _arr.push(_s.value);
150
151 if (i && _arr.length === i) break;
152 }
153 } catch (err) {
154 _d = true;
155 _e = err;
156 } finally {
157 try {
158 if (!_n && _i["return"] != null) _i["return"]();
159 } finally {
160 if (_d) throw _e;
161 }
162 }
163
164 return _arr;
165 }
166
167 function _unsupportedIterableToArray(o, minLen) {
168 if (!o) return;
169 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
170 var n = Object.prototype.toString.call(o).slice(8, -1);
171 if (n === "Object" && o.constructor) n = o.constructor.name;
172 if (n === "Map" || n === "Set") return Array.from(n);
173 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
174 }
175
176 function _arrayLikeToArray(arr, len) {
177 if (len == null || len > arr.length) len = arr.length;
178
179 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
180
181 return arr2;
182 }
183
184 function _nonIterableRest() {
185 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
186 }
187
188 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
189
190 function createCommonjsModule(fn, module) {
191 return module = { exports: {} }, fn(module, module.exports), module.exports;
192 }
193
194 var runtime_1 = createCommonjsModule(function (module) {
195 /**
196 * Copyright (c) 2014-present, Facebook, Inc.
197 *
198 * This source code is licensed under the MIT license found in the
199 * LICENSE file in the root directory of this source tree.
200 */
201 var runtime = function (exports) {
202
203 var Op = Object.prototype;
204 var hasOwn = Op.hasOwnProperty;
205 var undefined$1; // More compressible than void 0.
206
207 var $Symbol = typeof Symbol === "function" ? Symbol : {};
208 var iteratorSymbol = $Symbol.iterator || "@@iterator";
209 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
210 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
211
212 function wrap(innerFn, outerFn, self, tryLocsList) {
213 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
214 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
215 var generator = Object.create(protoGenerator.prototype);
216 var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
217 // .throw, and .return methods.
218
219 generator._invoke = makeInvokeMethod(innerFn, self, context);
220 return generator;
221 }
222
223 exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
224 // record like context.tryEntries[i].completion. This interface could
225 // have been (and was previously) designed to take a closure to be
226 // invoked without arguments, but in all the cases we care about we
227 // already have an existing method we want to call, so there's no need
228 // to create a new function object. We can even get away with assuming
229 // the method takes exactly one argument, since that happens to be true
230 // in every case, so we don't have to touch the arguments object. The
231 // only additional allocation required is the completion record, which
232 // has a stable shape and so hopefully should be cheap to allocate.
233
234 function tryCatch(fn, obj, arg) {
235 try {
236 return {
237 type: "normal",
238 arg: fn.call(obj, arg)
239 };
240 } catch (err) {
241 return {
242 type: "throw",
243 arg: err
244 };
245 }
246 }
247
248 var GenStateSuspendedStart = "suspendedStart";
249 var GenStateSuspendedYield = "suspendedYield";
250 var GenStateExecuting = "executing";
251 var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
252 // breaking out of the dispatch switch statement.
253
254 var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
255 // .constructor.prototype properties for functions that return Generator
256 // objects. For full spec compliance, you may wish to configure your
257 // minifier not to mangle the names of these two functions.
258
259 function Generator() {}
260
261 function GeneratorFunction() {}
262
263 function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
264 // don't natively support it.
265
266
267 var IteratorPrototype = {};
268
269 IteratorPrototype[iteratorSymbol] = function () {
270 return this;
271 };
272
273 var getProto = Object.getPrototypeOf;
274 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
275
276 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
277 // This environment has a native %IteratorPrototype%; use it instead
278 // of the polyfill.
279 IteratorPrototype = NativeIteratorPrototype;
280 }
281
282 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
283 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
284 GeneratorFunctionPrototype.constructor = GeneratorFunction;
285 GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
286 // Iterator interface in terms of a single ._invoke method.
287
288 function defineIteratorMethods(prototype) {
289 ["next", "throw", "return"].forEach(function (method) {
290 prototype[method] = function (arg) {
291 return this._invoke(method, arg);
292 };
293 });
294 }
295
296 exports.isGeneratorFunction = function (genFun) {
297 var ctor = typeof genFun === "function" && genFun.constructor;
298 return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
299 // do is to check its .name property.
300 (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
301 };
302
303 exports.mark = function (genFun) {
304 if (Object.setPrototypeOf) {
305 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
306 } else {
307 genFun.__proto__ = GeneratorFunctionPrototype;
308
309 if (!(toStringTagSymbol in genFun)) {
310 genFun[toStringTagSymbol] = "GeneratorFunction";
311 }
312 }
313
314 genFun.prototype = Object.create(Gp);
315 return genFun;
316 }; // Within the body of any async function, `await x` is transformed to
317 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
318 // `hasOwn.call(value, "__await")` to determine if the yielded value is
319 // meant to be awaited.
320
321
322 exports.awrap = function (arg) {
323 return {
324 __await: arg
325 };
326 };
327
328 function AsyncIterator(generator, PromiseImpl) {
329 function invoke(method, arg, resolve, reject) {
330 var record = tryCatch(generator[method], generator, arg);
331
332 if (record.type === "throw") {
333 reject(record.arg);
334 } else {
335 var result = record.arg;
336 var value = result.value;
337
338 if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
339 return PromiseImpl.resolve(value.__await).then(function (value) {
340 invoke("next", value, resolve, reject);
341 }, function (err) {
342 invoke("throw", err, resolve, reject);
343 });
344 }
345
346 return PromiseImpl.resolve(value).then(function (unwrapped) {
347 // When a yielded Promise is resolved, its final value becomes
348 // the .value of the Promise<{value,done}> result for the
349 // current iteration.
350 result.value = unwrapped;
351 resolve(result);
352 }, function (error) {
353 // If a rejected Promise was yielded, throw the rejection back
354 // into the async generator function so it can be handled there.
355 return invoke("throw", error, resolve, reject);
356 });
357 }
358 }
359
360 var previousPromise;
361
362 function enqueue(method, arg) {
363 function callInvokeWithMethodAndArg() {
364 return new PromiseImpl(function (resolve, reject) {
365 invoke(method, arg, resolve, reject);
366 });
367 }
368
369 return previousPromise = // If enqueue has been called before, then we want to wait until
370 // all previous Promises have been resolved before calling invoke,
371 // so that results are always delivered in the correct order. If
372 // enqueue has not been called before, then it is important to
373 // call invoke immediately, without waiting on a callback to fire,
374 // so that the async generator function has the opportunity to do
375 // any necessary setup in a predictable way. This predictability
376 // is why the Promise constructor synchronously invokes its
377 // executor callback, and why async functions synchronously
378 // execute code before the first await. Since we implement simple
379 // async functions in terms of async generators, it is especially
380 // important to get this right, even though it requires care.
381 previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
382 // invocations of the iterator.
383 callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
384 } // Define the unified helper method that is used to implement .next,
385 // .throw, and .return (see defineIteratorMethods).
386
387
388 this._invoke = enqueue;
389 }
390
391 defineIteratorMethods(AsyncIterator.prototype);
392
393 AsyncIterator.prototype[asyncIteratorSymbol] = function () {
394 return this;
395 };
396
397 exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
398 // AsyncIterator objects; they just return a Promise for the value of
399 // the final result produced by the iterator.
400
401 exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
402 if (PromiseImpl === void 0) PromiseImpl = Promise;
403 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
404 return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
405 : iter.next().then(function (result) {
406 return result.done ? result.value : iter.next();
407 });
408 };
409
410 function makeInvokeMethod(innerFn, self, context) {
411 var state = GenStateSuspendedStart;
412 return function invoke(method, arg) {
413 if (state === GenStateExecuting) {
414 throw new Error("Generator is already running");
415 }
416
417 if (state === GenStateCompleted) {
418 if (method === "throw") {
419 throw arg;
420 } // Be forgiving, per 25.3.3.3.3 of the spec:
421 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
422
423
424 return doneResult();
425 }
426
427 context.method = method;
428 context.arg = arg;
429
430 while (true) {
431 var delegate = context.delegate;
432
433 if (delegate) {
434 var delegateResult = maybeInvokeDelegate(delegate, context);
435
436 if (delegateResult) {
437 if (delegateResult === ContinueSentinel) continue;
438 return delegateResult;
439 }
440 }
441
442 if (context.method === "next") {
443 // Setting context._sent for legacy support of Babel's
444 // function.sent implementation.
445 context.sent = context._sent = context.arg;
446 } else if (context.method === "throw") {
447 if (state === GenStateSuspendedStart) {
448 state = GenStateCompleted;
449 throw context.arg;
450 }
451
452 context.dispatchException(context.arg);
453 } else if (context.method === "return") {
454 context.abrupt("return", context.arg);
455 }
456
457 state = GenStateExecuting;
458 var record = tryCatch(innerFn, self, context);
459
460 if (record.type === "normal") {
461 // If an exception is thrown from innerFn, we leave state ===
462 // GenStateExecuting and loop back for another invocation.
463 state = context.done ? GenStateCompleted : GenStateSuspendedYield;
464
465 if (record.arg === ContinueSentinel) {
466 continue;
467 }
468
469 return {
470 value: record.arg,
471 done: context.done
472 };
473 } else if (record.type === "throw") {
474 state = GenStateCompleted; // Dispatch the exception by looping back around to the
475 // context.dispatchException(context.arg) call above.
476
477 context.method = "throw";
478 context.arg = record.arg;
479 }
480 }
481 };
482 } // Call delegate.iterator[context.method](context.arg) and handle the
483 // result, either by returning a { value, done } result from the
484 // delegate iterator, or by modifying context.method and context.arg,
485 // setting context.delegate to null, and returning the ContinueSentinel.
486
487
488 function maybeInvokeDelegate(delegate, context) {
489 var method = delegate.iterator[context.method];
490
491 if (method === undefined$1) {
492 // A .throw or .return when the delegate iterator has no .throw
493 // method always terminates the yield* loop.
494 context.delegate = null;
495
496 if (context.method === "throw") {
497 // Note: ["return"] must be used for ES3 parsing compatibility.
498 if (delegate.iterator["return"]) {
499 // If the delegate iterator has a return method, give it a
500 // chance to clean up.
501 context.method = "return";
502 context.arg = undefined$1;
503 maybeInvokeDelegate(delegate, context);
504
505 if (context.method === "throw") {
506 // If maybeInvokeDelegate(context) changed context.method from
507 // "return" to "throw", let that override the TypeError below.
508 return ContinueSentinel;
509 }
510 }
511
512 context.method = "throw";
513 context.arg = new TypeError("The iterator does not provide a 'throw' method");
514 }
515
516 return ContinueSentinel;
517 }
518
519 var record = tryCatch(method, delegate.iterator, context.arg);
520
521 if (record.type === "throw") {
522 context.method = "throw";
523 context.arg = record.arg;
524 context.delegate = null;
525 return ContinueSentinel;
526 }
527
528 var info = record.arg;
529
530 if (!info) {
531 context.method = "throw";
532 context.arg = new TypeError("iterator result is not an object");
533 context.delegate = null;
534 return ContinueSentinel;
535 }
536
537 if (info.done) {
538 // Assign the result of the finished delegate to the temporary
539 // variable specified by delegate.resultName (see delegateYield).
540 context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
541
542 context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
543 // exception, let the outer generator proceed normally. If
544 // context.method was "next", forget context.arg since it has been
545 // "consumed" by the delegate iterator. If context.method was
546 // "return", allow the original .return call to continue in the
547 // outer generator.
548
549 if (context.method !== "return") {
550 context.method = "next";
551 context.arg = undefined$1;
552 }
553 } else {
554 // Re-yield the result returned by the delegate method.
555 return info;
556 } // The delegate iterator is finished, so forget it and continue with
557 // the outer generator.
558
559
560 context.delegate = null;
561 return ContinueSentinel;
562 } // Define Generator.prototype.{next,throw,return} in terms of the
563 // unified ._invoke helper method.
564
565
566 defineIteratorMethods(Gp);
567 Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
568 // @@iterator function is called on it. Some browsers' implementations of the
569 // iterator prototype chain incorrectly implement this, causing the Generator
570 // object to not be returned from this call. This ensures that doesn't happen.
571 // See https://github.com/facebook/regenerator/issues/274 for more details.
572
573 Gp[iteratorSymbol] = function () {
574 return this;
575 };
576
577 Gp.toString = function () {
578 return "[object Generator]";
579 };
580
581 function pushTryEntry(locs) {
582 var entry = {
583 tryLoc: locs[0]
584 };
585
586 if (1 in locs) {
587 entry.catchLoc = locs[1];
588 }
589
590 if (2 in locs) {
591 entry.finallyLoc = locs[2];
592 entry.afterLoc = locs[3];
593 }
594
595 this.tryEntries.push(entry);
596 }
597
598 function resetTryEntry(entry) {
599 var record = entry.completion || {};
600 record.type = "normal";
601 delete record.arg;
602 entry.completion = record;
603 }
604
605 function Context(tryLocsList) {
606 // The root entry object (effectively a try statement without a catch
607 // or a finally block) gives us a place to store values thrown from
608 // locations where there is no enclosing try statement.
609 this.tryEntries = [{
610 tryLoc: "root"
611 }];
612 tryLocsList.forEach(pushTryEntry, this);
613 this.reset(true);
614 }
615
616 exports.keys = function (object) {
617 var keys = [];
618
619 for (var key in object) {
620 keys.push(key);
621 }
622
623 keys.reverse(); // Rather than returning an object with a next method, we keep
624 // things simple and return the next function itself.
625
626 return function next() {
627 while (keys.length) {
628 var key = keys.pop();
629
630 if (key in object) {
631 next.value = key;
632 next.done = false;
633 return next;
634 }
635 } // To avoid creating an additional object, we just hang the .value
636 // and .done properties off the next function object itself. This
637 // also ensures that the minifier will not anonymize the function.
638
639
640 next.done = true;
641 return next;
642 };
643 };
644
645 function values(iterable) {
646 if (iterable) {
647 var iteratorMethod = iterable[iteratorSymbol];
648
649 if (iteratorMethod) {
650 return iteratorMethod.call(iterable);
651 }
652
653 if (typeof iterable.next === "function") {
654 return iterable;
655 }
656
657 if (!isNaN(iterable.length)) {
658 var i = -1,
659 next = function next() {
660 while (++i < iterable.length) {
661 if (hasOwn.call(iterable, i)) {
662 next.value = iterable[i];
663 next.done = false;
664 return next;
665 }
666 }
667
668 next.value = undefined$1;
669 next.done = true;
670 return next;
671 };
672
673 return next.next = next;
674 }
675 } // Return an iterator with no values.
676
677
678 return {
679 next: doneResult
680 };
681 }
682
683 exports.values = values;
684
685 function doneResult() {
686 return {
687 value: undefined$1,
688 done: true
689 };
690 }
691
692 Context.prototype = {
693 constructor: Context,
694 reset: function reset(skipTempReset) {
695 this.prev = 0;
696 this.next = 0; // Resetting context._sent for legacy support of Babel's
697 // function.sent implementation.
698
699 this.sent = this._sent = undefined$1;
700 this.done = false;
701 this.delegate = null;
702 this.method = "next";
703 this.arg = undefined$1;
704 this.tryEntries.forEach(resetTryEntry);
705
706 if (!skipTempReset) {
707 for (var name in this) {
708 // Not sure about the optimal order of these conditions:
709 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
710 this[name] = undefined$1;
711 }
712 }
713 }
714 },
715 stop: function stop() {
716 this.done = true;
717 var rootEntry = this.tryEntries[0];
718 var rootRecord = rootEntry.completion;
719
720 if (rootRecord.type === "throw") {
721 throw rootRecord.arg;
722 }
723
724 return this.rval;
725 },
726 dispatchException: function dispatchException(exception) {
727 if (this.done) {
728 throw exception;
729 }
730
731 var context = this;
732
733 function handle(loc, caught) {
734 record.type = "throw";
735 record.arg = exception;
736 context.next = loc;
737
738 if (caught) {
739 // If the dispatched exception was caught by a catch block,
740 // then let that catch block handle the exception normally.
741 context.method = "next";
742 context.arg = undefined$1;
743 }
744
745 return !!caught;
746 }
747
748 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
749 var entry = this.tryEntries[i];
750 var record = entry.completion;
751
752 if (entry.tryLoc === "root") {
753 // Exception thrown outside of any try block that could handle
754 // it, so set the completion value of the entire function to
755 // throw the exception.
756 return handle("end");
757 }
758
759 if (entry.tryLoc <= this.prev) {
760 var hasCatch = hasOwn.call(entry, "catchLoc");
761 var hasFinally = hasOwn.call(entry, "finallyLoc");
762
763 if (hasCatch && hasFinally) {
764 if (this.prev < entry.catchLoc) {
765 return handle(entry.catchLoc, true);
766 } else if (this.prev < entry.finallyLoc) {
767 return handle(entry.finallyLoc);
768 }
769 } else if (hasCatch) {
770 if (this.prev < entry.catchLoc) {
771 return handle(entry.catchLoc, true);
772 }
773 } else if (hasFinally) {
774 if (this.prev < entry.finallyLoc) {
775 return handle(entry.finallyLoc);
776 }
777 } else {
778 throw new Error("try statement without catch or finally");
779 }
780 }
781 }
782 },
783 abrupt: function abrupt(type, arg) {
784 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
785 var entry = this.tryEntries[i];
786
787 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
788 var finallyEntry = entry;
789 break;
790 }
791 }
792
793 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
794 // Ignore the finally entry if control is not jumping to a
795 // location outside the try/catch block.
796 finallyEntry = null;
797 }
798
799 var record = finallyEntry ? finallyEntry.completion : {};
800 record.type = type;
801 record.arg = arg;
802
803 if (finallyEntry) {
804 this.method = "next";
805 this.next = finallyEntry.finallyLoc;
806 return ContinueSentinel;
807 }
808
809 return this.complete(record);
810 },
811 complete: function complete(record, afterLoc) {
812 if (record.type === "throw") {
813 throw record.arg;
814 }
815
816 if (record.type === "break" || record.type === "continue") {
817 this.next = record.arg;
818 } else if (record.type === "return") {
819 this.rval = this.arg = record.arg;
820 this.method = "return";
821 this.next = "end";
822 } else if (record.type === "normal" && afterLoc) {
823 this.next = afterLoc;
824 }
825
826 return ContinueSentinel;
827 },
828 finish: function finish(finallyLoc) {
829 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
830 var entry = this.tryEntries[i];
831
832 if (entry.finallyLoc === finallyLoc) {
833 this.complete(entry.completion, entry.afterLoc);
834 resetTryEntry(entry);
835 return ContinueSentinel;
836 }
837 }
838 },
839 "catch": function _catch(tryLoc) {
840 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
841 var entry = this.tryEntries[i];
842
843 if (entry.tryLoc === tryLoc) {
844 var record = entry.completion;
845
846 if (record.type === "throw") {
847 var thrown = record.arg;
848 resetTryEntry(entry);
849 }
850
851 return thrown;
852 }
853 } // The context.catch method must only be called with a location
854 // argument that corresponds to a known catch block.
855
856
857 throw new Error("illegal catch attempt");
858 },
859 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
860 this.delegate = {
861 iterator: values(iterable),
862 resultName: resultName,
863 nextLoc: nextLoc
864 };
865
866 if (this.method === "next") {
867 // Deliberately forget the last sent value so that we don't
868 // accidentally pass it on to the delegate.
869 this.arg = undefined$1;
870 }
871
872 return ContinueSentinel;
873 }
874 }; // Regardless of whether this script is executing as a CommonJS module
875 // or not, return the runtime object so that we can declare the variable
876 // regeneratorRuntime in the outer scope, which allows this module to be
877 // injected easily by `bin/regenerator --include-runtime script.js`.
878
879 return exports;
880 }( // If this script is executing as a CommonJS module, use module.exports
881 // as the regeneratorRuntime namespace. Otherwise create a new empty
882 // object. Either way, the resulting object will be used to initialize
883 // the regeneratorRuntime variable at the top of this file.
884 module.exports );
885
886 try {
887 regeneratorRuntime = runtime;
888 } catch (accidentalStrictMode) {
889 // This module should not be running in strict mode, so the above
890 // assignment should always work unless something is misconfigured. Just
891 // in case runtime.js accidentally runs in strict mode, we can escape
892 // strict mode using a global Function call. This could conceivably fail
893 // if a Content Security Policy forbids using Function, but in that case
894 // the proper solution is to fix the accidental strict mode problem. If
895 // you've misconfigured your bundler to force strict mode and applied a
896 // CSP to forbid Function, and you're not willing to fix either of those
897 // problems, please detail your unique predicament in a GitHub issue.
898 Function("r", "regeneratorRuntime = r")(runtime);
899 }
900 });
901
902 /**
903 * lodash (Custom Build) <https://lodash.com/>
904 * Build: `lodash modularize exports="npm" -o ./`
905 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
906 * Released under MIT license <https://lodash.com/license>
907 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
908 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
909 */
910
911 /** Used as the `TypeError` message for "Functions" methods. */
912
913 var FUNC_ERROR_TEXT = 'Expected a function';
914 /** Used to stand-in for `undefined` hash values. */
915
916 var HASH_UNDEFINED = '__lodash_hash_undefined__';
917 /** Used as references for various `Number` constants. */
918
919 var INFINITY = 1 / 0;
920 /** `Object#toString` result references. */
921
922 var funcTag = '[object Function]',
923 genTag = '[object GeneratorFunction]',
924 symbolTag = '[object Symbol]';
925 /** Used to match property names within property paths. */
926
927 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
928 reIsPlainProp = /^\w*$/,
929 reLeadingDot = /^\./,
930 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
931 /**
932 * Used to match `RegExp`
933 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
934 */
935
936 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
937 /** Used to match backslashes in property paths. */
938
939 var reEscapeChar = /\\(\\)?/g;
940 /** Used to detect host constructors (Safari). */
941
942 var reIsHostCtor = /^\[object .+?Constructor\]$/;
943 /** Detect free variable `global` from Node.js. */
944
945 var freeGlobal = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
946 /** Detect free variable `self`. */
947
948 var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
949 /** Used as a reference to the global object. */
950
951 var root = freeGlobal || freeSelf || Function('return this')();
952 /**
953 * Gets the value at `key` of `object`.
954 *
955 * @private
956 * @param {Object} [object] The object to query.
957 * @param {string} key The key of the property to get.
958 * @returns {*} Returns the property value.
959 */
960
961 function getValue(object, key) {
962 return object == null ? undefined : object[key];
963 }
964 /**
965 * Checks if `value` is a host object in IE < 9.
966 *
967 * @private
968 * @param {*} value The value to check.
969 * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
970 */
971
972
973 function isHostObject(value) {
974 // Many host objects are `Object` objects that can coerce to strings
975 // despite having improperly defined `toString` methods.
976 var result = false;
977
978 if (value != null && typeof value.toString != 'function') {
979 try {
980 result = !!(value + '');
981 } catch (e) {}
982 }
983
984 return result;
985 }
986 /** Used for built-in method references. */
987
988
989 var arrayProto = Array.prototype,
990 funcProto = Function.prototype,
991 objectProto = Object.prototype;
992 /** Used to detect overreaching core-js shims. */
993
994 var coreJsData = root['__core-js_shared__'];
995 /** Used to detect methods masquerading as native. */
996
997 var maskSrcKey = function () {
998 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
999 return uid ? 'Symbol(src)_1.' + uid : '';
1000 }();
1001 /** Used to resolve the decompiled source of functions. */
1002
1003
1004 var funcToString = funcProto.toString;
1005 /** Used to check objects for own properties. */
1006
1007 var hasOwnProperty = objectProto.hasOwnProperty;
1008 /**
1009 * Used to resolve the
1010 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1011 * of values.
1012 */
1013
1014 var objectToString = objectProto.toString;
1015 /** Used to detect if a method is native. */
1016
1017 var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1018 /** Built-in value references. */
1019
1020 var _Symbol = root.Symbol,
1021 splice = arrayProto.splice;
1022 /* Built-in method references that are verified to be native. */
1023
1024 var Map = getNative(root, 'Map'),
1025 nativeCreate = getNative(Object, 'create');
1026 /** Used to convert symbols to primitives and strings. */
1027
1028 var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1029 symbolToString = symbolProto ? symbolProto.toString : undefined;
1030 /**
1031 * Creates a hash object.
1032 *
1033 * @private
1034 * @constructor
1035 * @param {Array} [entries] The key-value pairs to cache.
1036 */
1037
1038 function Hash(entries) {
1039 var index = -1,
1040 length = entries ? entries.length : 0;
1041 this.clear();
1042
1043 while (++index < length) {
1044 var entry = entries[index];
1045 this.set(entry[0], entry[1]);
1046 }
1047 }
1048 /**
1049 * Removes all key-value entries from the hash.
1050 *
1051 * @private
1052 * @name clear
1053 * @memberOf Hash
1054 */
1055
1056
1057 function hashClear() {
1058 this.__data__ = nativeCreate ? nativeCreate(null) : {};
1059 }
1060 /**
1061 * Removes `key` and its value from the hash.
1062 *
1063 * @private
1064 * @name delete
1065 * @memberOf Hash
1066 * @param {Object} hash The hash to modify.
1067 * @param {string} key The key of the value to remove.
1068 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1069 */
1070
1071
1072 function hashDelete(key) {
1073 return this.has(key) && delete this.__data__[key];
1074 }
1075 /**
1076 * Gets the hash value for `key`.
1077 *
1078 * @private
1079 * @name get
1080 * @memberOf Hash
1081 * @param {string} key The key of the value to get.
1082 * @returns {*} Returns the entry value.
1083 */
1084
1085
1086 function hashGet(key) {
1087 var data = this.__data__;
1088
1089 if (nativeCreate) {
1090 var result = data[key];
1091 return result === HASH_UNDEFINED ? undefined : result;
1092 }
1093
1094 return hasOwnProperty.call(data, key) ? data[key] : undefined;
1095 }
1096 /**
1097 * Checks if a hash value for `key` exists.
1098 *
1099 * @private
1100 * @name has
1101 * @memberOf Hash
1102 * @param {string} key The key of the entry to check.
1103 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1104 */
1105
1106
1107 function hashHas(key) {
1108 var data = this.__data__;
1109 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
1110 }
1111 /**
1112 * Sets the hash `key` to `value`.
1113 *
1114 * @private
1115 * @name set
1116 * @memberOf Hash
1117 * @param {string} key The key of the value to set.
1118 * @param {*} value The value to set.
1119 * @returns {Object} Returns the hash instance.
1120 */
1121
1122
1123 function hashSet(key, value) {
1124 var data = this.__data__;
1125 data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
1126 return this;
1127 } // Add methods to `Hash`.
1128
1129
1130 Hash.prototype.clear = hashClear;
1131 Hash.prototype['delete'] = hashDelete;
1132 Hash.prototype.get = hashGet;
1133 Hash.prototype.has = hashHas;
1134 Hash.prototype.set = hashSet;
1135 /**
1136 * Creates an list cache object.
1137 *
1138 * @private
1139 * @constructor
1140 * @param {Array} [entries] The key-value pairs to cache.
1141 */
1142
1143 function ListCache(entries) {
1144 var index = -1,
1145 length = entries ? entries.length : 0;
1146 this.clear();
1147
1148 while (++index < length) {
1149 var entry = entries[index];
1150 this.set(entry[0], entry[1]);
1151 }
1152 }
1153 /**
1154 * Removes all key-value entries from the list cache.
1155 *
1156 * @private
1157 * @name clear
1158 * @memberOf ListCache
1159 */
1160
1161
1162 function listCacheClear() {
1163 this.__data__ = [];
1164 }
1165 /**
1166 * Removes `key` and its value from the list cache.
1167 *
1168 * @private
1169 * @name delete
1170 * @memberOf ListCache
1171 * @param {string} key The key of the value to remove.
1172 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1173 */
1174
1175
1176 function listCacheDelete(key) {
1177 var data = this.__data__,
1178 index = assocIndexOf(data, key);
1179
1180 if (index < 0) {
1181 return false;
1182 }
1183
1184 var lastIndex = data.length - 1;
1185
1186 if (index == lastIndex) {
1187 data.pop();
1188 } else {
1189 splice.call(data, index, 1);
1190 }
1191
1192 return true;
1193 }
1194 /**
1195 * Gets the list cache value for `key`.
1196 *
1197 * @private
1198 * @name get
1199 * @memberOf ListCache
1200 * @param {string} key The key of the value to get.
1201 * @returns {*} Returns the entry value.
1202 */
1203
1204
1205 function listCacheGet(key) {
1206 var data = this.__data__,
1207 index = assocIndexOf(data, key);
1208 return index < 0 ? undefined : data[index][1];
1209 }
1210 /**
1211 * Checks if a list cache value for `key` exists.
1212 *
1213 * @private
1214 * @name has
1215 * @memberOf ListCache
1216 * @param {string} key The key of the entry to check.
1217 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1218 */
1219
1220
1221 function listCacheHas(key) {
1222 return assocIndexOf(this.__data__, key) > -1;
1223 }
1224 /**
1225 * Sets the list cache `key` to `value`.
1226 *
1227 * @private
1228 * @name set
1229 * @memberOf ListCache
1230 * @param {string} key The key of the value to set.
1231 * @param {*} value The value to set.
1232 * @returns {Object} Returns the list cache instance.
1233 */
1234
1235
1236 function listCacheSet(key, value) {
1237 var data = this.__data__,
1238 index = assocIndexOf(data, key);
1239
1240 if (index < 0) {
1241 data.push([key, value]);
1242 } else {
1243 data[index][1] = value;
1244 }
1245
1246 return this;
1247 } // Add methods to `ListCache`.
1248
1249
1250 ListCache.prototype.clear = listCacheClear;
1251 ListCache.prototype['delete'] = listCacheDelete;
1252 ListCache.prototype.get = listCacheGet;
1253 ListCache.prototype.has = listCacheHas;
1254 ListCache.prototype.set = listCacheSet;
1255 /**
1256 * Creates a map cache object to store key-value pairs.
1257 *
1258 * @private
1259 * @constructor
1260 * @param {Array} [entries] The key-value pairs to cache.
1261 */
1262
1263 function MapCache(entries) {
1264 var index = -1,
1265 length = entries ? entries.length : 0;
1266 this.clear();
1267
1268 while (++index < length) {
1269 var entry = entries[index];
1270 this.set(entry[0], entry[1]);
1271 }
1272 }
1273 /**
1274 * Removes all key-value entries from the map.
1275 *
1276 * @private
1277 * @name clear
1278 * @memberOf MapCache
1279 */
1280
1281
1282 function mapCacheClear() {
1283 this.__data__ = {
1284 'hash': new Hash(),
1285 'map': new (Map || ListCache)(),
1286 'string': new Hash()
1287 };
1288 }
1289 /**
1290 * Removes `key` and its value from the map.
1291 *
1292 * @private
1293 * @name delete
1294 * @memberOf MapCache
1295 * @param {string} key The key of the value to remove.
1296 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1297 */
1298
1299
1300 function mapCacheDelete(key) {
1301 return getMapData(this, key)['delete'](key);
1302 }
1303 /**
1304 * Gets the map value for `key`.
1305 *
1306 * @private
1307 * @name get
1308 * @memberOf MapCache
1309 * @param {string} key The key of the value to get.
1310 * @returns {*} Returns the entry value.
1311 */
1312
1313
1314 function mapCacheGet(key) {
1315 return getMapData(this, key).get(key);
1316 }
1317 /**
1318 * Checks if a map value for `key` exists.
1319 *
1320 * @private
1321 * @name has
1322 * @memberOf MapCache
1323 * @param {string} key The key of the entry to check.
1324 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1325 */
1326
1327
1328 function mapCacheHas(key) {
1329 return getMapData(this, key).has(key);
1330 }
1331 /**
1332 * Sets the map `key` to `value`.
1333 *
1334 * @private
1335 * @name set
1336 * @memberOf MapCache
1337 * @param {string} key The key of the value to set.
1338 * @param {*} value The value to set.
1339 * @returns {Object} Returns the map cache instance.
1340 */
1341
1342
1343 function mapCacheSet(key, value) {
1344 getMapData(this, key).set(key, value);
1345 return this;
1346 } // Add methods to `MapCache`.
1347
1348
1349 MapCache.prototype.clear = mapCacheClear;
1350 MapCache.prototype['delete'] = mapCacheDelete;
1351 MapCache.prototype.get = mapCacheGet;
1352 MapCache.prototype.has = mapCacheHas;
1353 MapCache.prototype.set = mapCacheSet;
1354 /**
1355 * Gets the index at which the `key` is found in `array` of key-value pairs.
1356 *
1357 * @private
1358 * @param {Array} array The array to inspect.
1359 * @param {*} key The key to search for.
1360 * @returns {number} Returns the index of the matched value, else `-1`.
1361 */
1362
1363 function assocIndexOf(array, key) {
1364 var length = array.length;
1365
1366 while (length--) {
1367 if (eq(array[length][0], key)) {
1368 return length;
1369 }
1370 }
1371
1372 return -1;
1373 }
1374 /**
1375 * The base implementation of `_.get` without support for default values.
1376 *
1377 * @private
1378 * @param {Object} object The object to query.
1379 * @param {Array|string} path The path of the property to get.
1380 * @returns {*} Returns the resolved value.
1381 */
1382
1383
1384 function baseGet(object, path) {
1385 path = isKey(path, object) ? [path] : castPath(path);
1386 var index = 0,
1387 length = path.length;
1388
1389 while (object != null && index < length) {
1390 object = object[toKey(path[index++])];
1391 }
1392
1393 return index && index == length ? object : undefined;
1394 }
1395 /**
1396 * The base implementation of `_.isNative` without bad shim checks.
1397 *
1398 * @private
1399 * @param {*} value The value to check.
1400 * @returns {boolean} Returns `true` if `value` is a native function,
1401 * else `false`.
1402 */
1403
1404
1405 function baseIsNative(value) {
1406 if (!isObject(value) || isMasked(value)) {
1407 return false;
1408 }
1409
1410 var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
1411 return pattern.test(toSource(value));
1412 }
1413 /**
1414 * The base implementation of `_.toString` which doesn't convert nullish
1415 * values to empty strings.
1416 *
1417 * @private
1418 * @param {*} value The value to process.
1419 * @returns {string} Returns the string.
1420 */
1421
1422
1423 function baseToString(value) {
1424 // Exit early for strings to avoid a performance hit in some environments.
1425 if (typeof value == 'string') {
1426 return value;
1427 }
1428
1429 if (isSymbol(value)) {
1430 return symbolToString ? symbolToString.call(value) : '';
1431 }
1432
1433 var result = value + '';
1434 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
1435 }
1436 /**
1437 * Casts `value` to a path array if it's not one.
1438 *
1439 * @private
1440 * @param {*} value The value to inspect.
1441 * @returns {Array} Returns the cast property path array.
1442 */
1443
1444
1445 function castPath(value) {
1446 return isArray(value) ? value : stringToPath(value);
1447 }
1448 /**
1449 * Gets the data for `map`.
1450 *
1451 * @private
1452 * @param {Object} map The map to query.
1453 * @param {string} key The reference key.
1454 * @returns {*} Returns the map data.
1455 */
1456
1457
1458 function getMapData(map, key) {
1459 var data = map.__data__;
1460 return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
1461 }
1462 /**
1463 * Gets the native function at `key` of `object`.
1464 *
1465 * @private
1466 * @param {Object} object The object to query.
1467 * @param {string} key The key of the method to get.
1468 * @returns {*} Returns the function if it's native, else `undefined`.
1469 */
1470
1471
1472 function getNative(object, key) {
1473 var value = getValue(object, key);
1474 return baseIsNative(value) ? value : undefined;
1475 }
1476 /**
1477 * Checks if `value` is a property name and not a property path.
1478 *
1479 * @private
1480 * @param {*} value The value to check.
1481 * @param {Object} [object] The object to query keys on.
1482 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1483 */
1484
1485
1486 function isKey(value, object) {
1487 if (isArray(value)) {
1488 return false;
1489 }
1490
1491 var type = _typeof(value);
1492
1493 if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
1494 return true;
1495 }
1496
1497 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
1498 }
1499 /**
1500 * Checks if `value` is suitable for use as unique object key.
1501 *
1502 * @private
1503 * @param {*} value The value to check.
1504 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1505 */
1506
1507
1508 function isKeyable(value) {
1509 var type = _typeof(value);
1510
1511 return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
1512 }
1513 /**
1514 * Checks if `func` has its source masked.
1515 *
1516 * @private
1517 * @param {Function} func The function to check.
1518 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1519 */
1520
1521
1522 function isMasked(func) {
1523 return !!maskSrcKey && maskSrcKey in func;
1524 }
1525 /**
1526 * Converts `string` to a property path array.
1527 *
1528 * @private
1529 * @param {string} string The string to convert.
1530 * @returns {Array} Returns the property path array.
1531 */
1532
1533
1534 var stringToPath = memoize(function (string) {
1535 string = toString(string);
1536 var result = [];
1537
1538 if (reLeadingDot.test(string)) {
1539 result.push('');
1540 }
1541
1542 string.replace(rePropName, function (match, number, quote, string) {
1543 result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
1544 });
1545 return result;
1546 });
1547 /**
1548 * Converts `value` to a string key if it's not a string or symbol.
1549 *
1550 * @private
1551 * @param {*} value The value to inspect.
1552 * @returns {string|symbol} Returns the key.
1553 */
1554
1555 function toKey(value) {
1556 if (typeof value == 'string' || isSymbol(value)) {
1557 return value;
1558 }
1559
1560 var result = value + '';
1561 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
1562 }
1563 /**
1564 * Converts `func` to its source code.
1565 *
1566 * @private
1567 * @param {Function} func The function to process.
1568 * @returns {string} Returns the source code.
1569 */
1570
1571
1572 function toSource(func) {
1573 if (func != null) {
1574 try {
1575 return funcToString.call(func);
1576 } catch (e) {}
1577
1578 try {
1579 return func + '';
1580 } catch (e) {}
1581 }
1582
1583 return '';
1584 }
1585 /**
1586 * Creates a function that memoizes the result of `func`. If `resolver` is
1587 * provided, it determines the cache key for storing the result based on the
1588 * arguments provided to the memoized function. By default, the first argument
1589 * provided to the memoized function is used as the map cache key. The `func`
1590 * is invoked with the `this` binding of the memoized function.
1591 *
1592 * **Note:** The cache is exposed as the `cache` property on the memoized
1593 * function. Its creation may be customized by replacing the `_.memoize.Cache`
1594 * constructor with one whose instances implement the
1595 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1596 * method interface of `delete`, `get`, `has`, and `set`.
1597 *
1598 * @static
1599 * @memberOf _
1600 * @since 0.1.0
1601 * @category Function
1602 * @param {Function} func The function to have its output memoized.
1603 * @param {Function} [resolver] The function to resolve the cache key.
1604 * @returns {Function} Returns the new memoized function.
1605 * @example
1606 *
1607 * var object = { 'a': 1, 'b': 2 };
1608 * var other = { 'c': 3, 'd': 4 };
1609 *
1610 * var values = _.memoize(_.values);
1611 * values(object);
1612 * // => [1, 2]
1613 *
1614 * values(other);
1615 * // => [3, 4]
1616 *
1617 * object.a = 2;
1618 * values(object);
1619 * // => [1, 2]
1620 *
1621 * // Modify the result cache.
1622 * values.cache.set(object, ['a', 'b']);
1623 * values(object);
1624 * // => ['a', 'b']
1625 *
1626 * // Replace `_.memoize.Cache`.
1627 * _.memoize.Cache = WeakMap;
1628 */
1629
1630
1631 function memoize(func, resolver) {
1632 if (typeof func != 'function' || resolver && typeof resolver != 'function') {
1633 throw new TypeError(FUNC_ERROR_TEXT);
1634 }
1635
1636 var memoized = function memoized() {
1637 var args = arguments,
1638 key = resolver ? resolver.apply(this, args) : args[0],
1639 cache = memoized.cache;
1640
1641 if (cache.has(key)) {
1642 return cache.get(key);
1643 }
1644
1645 var result = func.apply(this, args);
1646 memoized.cache = cache.set(key, result);
1647 return result;
1648 };
1649
1650 memoized.cache = new (memoize.Cache || MapCache)();
1651 return memoized;
1652 } // Assign cache to `_.memoize`.
1653
1654
1655 memoize.Cache = MapCache;
1656 /**
1657 * Performs a
1658 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1659 * comparison between two values to determine if they are equivalent.
1660 *
1661 * @static
1662 * @memberOf _
1663 * @since 4.0.0
1664 * @category Lang
1665 * @param {*} value The value to compare.
1666 * @param {*} other The other value to compare.
1667 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1668 * @example
1669 *
1670 * var object = { 'a': 1 };
1671 * var other = { 'a': 1 };
1672 *
1673 * _.eq(object, object);
1674 * // => true
1675 *
1676 * _.eq(object, other);
1677 * // => false
1678 *
1679 * _.eq('a', 'a');
1680 * // => true
1681 *
1682 * _.eq('a', Object('a'));
1683 * // => false
1684 *
1685 * _.eq(NaN, NaN);
1686 * // => true
1687 */
1688
1689 function eq(value, other) {
1690 return value === other || value !== value && other !== other;
1691 }
1692 /**
1693 * Checks if `value` is classified as an `Array` object.
1694 *
1695 * @static
1696 * @memberOf _
1697 * @since 0.1.0
1698 * @category Lang
1699 * @param {*} value The value to check.
1700 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1701 * @example
1702 *
1703 * _.isArray([1, 2, 3]);
1704 * // => true
1705 *
1706 * _.isArray(document.body.children);
1707 * // => false
1708 *
1709 * _.isArray('abc');
1710 * // => false
1711 *
1712 * _.isArray(_.noop);
1713 * // => false
1714 */
1715
1716
1717 var isArray = Array.isArray;
1718 /**
1719 * Checks if `value` is classified as a `Function` object.
1720 *
1721 * @static
1722 * @memberOf _
1723 * @since 0.1.0
1724 * @category Lang
1725 * @param {*} value The value to check.
1726 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1727 * @example
1728 *
1729 * _.isFunction(_);
1730 * // => true
1731 *
1732 * _.isFunction(/abc/);
1733 * // => false
1734 */
1735
1736 function isFunction(value) {
1737 // The use of `Object#toString` avoids issues with the `typeof` operator
1738 // in Safari 8-9 which returns 'object' for typed array and other constructors.
1739 var tag = isObject(value) ? objectToString.call(value) : '';
1740 return tag == funcTag || tag == genTag;
1741 }
1742 /**
1743 * Checks if `value` is the
1744 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1745 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1746 *
1747 * @static
1748 * @memberOf _
1749 * @since 0.1.0
1750 * @category Lang
1751 * @param {*} value The value to check.
1752 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1753 * @example
1754 *
1755 * _.isObject({});
1756 * // => true
1757 *
1758 * _.isObject([1, 2, 3]);
1759 * // => true
1760 *
1761 * _.isObject(_.noop);
1762 * // => true
1763 *
1764 * _.isObject(null);
1765 * // => false
1766 */
1767
1768
1769 function isObject(value) {
1770 var type = _typeof(value);
1771
1772 return !!value && (type == 'object' || type == 'function');
1773 }
1774 /**
1775 * Checks if `value` is object-like. A value is object-like if it's not `null`
1776 * and has a `typeof` result of "object".
1777 *
1778 * @static
1779 * @memberOf _
1780 * @since 4.0.0
1781 * @category Lang
1782 * @param {*} value The value to check.
1783 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1784 * @example
1785 *
1786 * _.isObjectLike({});
1787 * // => true
1788 *
1789 * _.isObjectLike([1, 2, 3]);
1790 * // => true
1791 *
1792 * _.isObjectLike(_.noop);
1793 * // => false
1794 *
1795 * _.isObjectLike(null);
1796 * // => false
1797 */
1798
1799
1800 function isObjectLike(value) {
1801 return !!value && _typeof(value) == 'object';
1802 }
1803 /**
1804 * Checks if `value` is classified as a `Symbol` primitive or object.
1805 *
1806 * @static
1807 * @memberOf _
1808 * @since 4.0.0
1809 * @category Lang
1810 * @param {*} value The value to check.
1811 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1812 * @example
1813 *
1814 * _.isSymbol(Symbol.iterator);
1815 * // => true
1816 *
1817 * _.isSymbol('abc');
1818 * // => false
1819 */
1820
1821
1822 function isSymbol(value) {
1823 return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
1824 }
1825 /**
1826 * Converts `value` to a string. An empty string is returned for `null`
1827 * and `undefined` values. The sign of `-0` is preserved.
1828 *
1829 * @static
1830 * @memberOf _
1831 * @since 4.0.0
1832 * @category Lang
1833 * @param {*} value The value to process.
1834 * @returns {string} Returns the string.
1835 * @example
1836 *
1837 * _.toString(null);
1838 * // => ''
1839 *
1840 * _.toString(-0);
1841 * // => '-0'
1842 *
1843 * _.toString([1, 2, 3]);
1844 * // => '1,2,3'
1845 */
1846
1847
1848 function toString(value) {
1849 return value == null ? '' : baseToString(value);
1850 }
1851 /**
1852 * Gets the value at `path` of `object`. If the resolved value is
1853 * `undefined`, the `defaultValue` is returned in its place.
1854 *
1855 * @static
1856 * @memberOf _
1857 * @since 3.7.0
1858 * @category Object
1859 * @param {Object} object The object to query.
1860 * @param {Array|string} path The path of the property to get.
1861 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1862 * @returns {*} Returns the resolved value.
1863 * @example
1864 *
1865 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1866 *
1867 * _.get(object, 'a[0].b.c');
1868 * // => 3
1869 *
1870 * _.get(object, ['a', '0', 'b', 'c']);
1871 * // => 3
1872 *
1873 * _.get(object, 'a.b.c', 'default');
1874 * // => 'default'
1875 */
1876
1877
1878 function get(object, path, defaultValue) {
1879 var result = object == null ? undefined : baseGet(object, path);
1880 return result === undefined ? defaultValue : result;
1881 }
1882
1883 var lodash_get = get;
1884
1885 var formDataFactory = {
1886 createFormData: function createFormData() {
1887 {
1888 return new FormData();
1889 }
1890 }
1891 };
1892
1893 function getInstance(baseURL) {
1894 var instance = axios.create({
1895 baseURL: baseURL
1896 });
1897 instance.interceptors.response.use(function (response) {
1898 var otcsticket = lodash_get(response, 'headers.otcsticket');
1899
1900 if (otcsticket) {
1901 instance.defaults.headers.common['OTCSTicket'] = otcsticket;
1902 }
1903
1904 return response;
1905 }, function (error) {
1906 return Promise.reject(error);
1907 });
1908 return instance;
1909 }
1910
1911 function axiosFactory(options) {
1912 var instance = getInstance(options.baseURL);
1913 var username = lodash_get(options, 'username');
1914 var password = lodash_get(options, 'password');
1915 var otcsticket = lodash_get(options, 'otcsticket');
1916
1917 if (otcsticket) {
1918 instance.defaults.headers.common['OTCSTicket'] = otcsticket;
1919 } else if (username && password) {
1920 instance.interceptors.request.use( /*#__PURE__*/function () {
1921 var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(request) {
1922 var formData, response;
1923 return regeneratorRuntime.wrap(function _callee$(_context) {
1924 while (1) {
1925 switch (_context.prev = _context.next) {
1926 case 0:
1927 if (!request.headers.common['OTCSTicket']) {
1928 _context.next = 4;
1929 break;
1930 }
1931
1932 return _context.abrupt("return", request);
1933
1934 case 4:
1935 formData = formDataFactory.createFormData();
1936 formData.append('username', username);
1937 formData.append('password', password);
1938
1939 {
1940 _context.next = 13;
1941 break;
1942 }
1943
1944 case 10:
1945 _context.t0 = _context.sent;
1946 _context.next = 16;
1947 break;
1948
1949 case 13:
1950 _context.next = 15;
1951 return axios.post("".concat(options.baseURL, "/api/v1/auth/"), formData);
1952
1953 case 15:
1954 _context.t0 = _context.sent;
1955
1956 case 16:
1957 response = _context.t0;
1958 request.headers.common['OTCSTicket'] = lodash_get(response, 'data.ticket');
1959 return _context.abrupt("return", request);
1960
1961 case 19:
1962 case "end":
1963 return _context.stop();
1964 }
1965 }
1966 }, _callee);
1967 }));
1968
1969 return function (_x) {
1970 return _ref.apply(this, arguments);
1971 };
1972 }());
1973 } else {
1974 throw 'You must provide an otcsticket or username and password.';
1975 }
1976
1977 return instance;
1978 }
1979
1980 var auth = axiosFactory;
1981
1982 var SubTypes = {
1983 FOLDER: 0,
1984 DOCUMENT: 144
1985 };
1986
1987 var nodes = function nodes(session) {
1988 return {
1989 addablenodetypes: function addablenodetypes(dataid) {
1990 return session.get("api/v1/nodes/".concat(dataid, "/addablenodetypes"));
1991 },
1992 addDocument: function addDocument(parent_id, fileHandler) {
1993 var _arguments = arguments;
1994 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
1995 var fileName, url, formData, path, f, name, _name;
1996
1997 return regeneratorRuntime.wrap(function _callee$(_context) {
1998 while (1) {
1999 switch (_context.prev = _context.next) {
2000 case 0:
2001 fileName = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : null;
2002 url = 'api/v1/nodes';
2003 formData = formDataFactory.createFormData();
2004 formData.append('type', SubTypes.DOCUMENT);
2005 formData.append('parent_id', parent_id);
2006
2007 {
2008 _context.next = 17;
2009 break;
2010 }
2011
2012 case 10:
2013 f = _context.sent;
2014 name = fileName || path.basename(fileHandler);
2015 formData.append('file', f, name);
2016 formData.append('name', name);
2017 return _context.abrupt("return", session.post(url, formData.getBuffer(), {
2018 headers: formData.getHeaders()
2019 }));
2020
2021 case 17:
2022 // browser
2023 _name = fileName || fileHandler.name;
2024 formData.append('file', fileHandler, _name);
2025 formData.append('name', _name);
2026 return _context.abrupt("return", session.post(url, formData));
2027
2028 case 21:
2029 case "end":
2030 return _context.stop();
2031 }
2032 }
2033 }, _callee);
2034 }))();
2035 },
2036 addItem: function addItem(type, parent_id, name) {
2037 var params = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2038 return session.postForm('api/v2/nodes', _objectSpread2({
2039 type: type,
2040 parent_id: parent_id,
2041 name: name
2042 }, params));
2043 },
2044 node: function node(dataid) {
2045 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2046 return session.get("api/v2/nodes/".concat(dataid), {
2047 params: params
2048 });
2049 },
2050 ancestors: function ancestors(dataid) {
2051 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2052 return session.get("api/v1/nodes/".concat(dataid, "/ancestors"), {
2053 params: params
2054 });
2055 },
2056 volumeInfo: function volumeInfo(objType) {
2057 return session.get("api/v1/volumes/".concat(objType));
2058 },
2059 volumes: function volumes() {
2060 return session.get('api/v2/volumes');
2061 },
2062 addFolder: function addFolder(parent_id, name) {
2063 var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2064 return this.addItem(SubTypes.FOLDER, parent_id, name, params);
2065 },
2066 children: function children(dataid) {
2067 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2068 // https://developer.opentext.com/webaccess/#url=%2Fawd%2Fresources%2Fapis%2Fcs-rest-api-for-cs-16-s%23!%2Fnodes%2FgetSubnodes_get_15&tab=501
2069 return session.get("api/v2/nodes/".concat(dataid, "/nodes"), {
2070 params: params
2071 });
2072 },
2073 "delete": function _delete(dataid) {
2074 return session["delete"]("api/v1/nodes/".concat(dataid));
2075 }
2076 };
2077 };
2078
2079 var workflow = function workflow(session) {
2080 return {
2081 start: function start(map_id) {
2082 var _this = this;
2083
2084 return this.draftprocesses(map_id).then(function (response) {
2085 return lodash_get(response, 'data.results.draftprocess_id');
2086 }).then(function (draftprocess_id) {
2087 return _this.draftprocesses_update(draftprocess_id);
2088 });
2089 },
2090 draftprocesses: function draftprocesses(workflow_id) {
2091 return session.postForm('api/v2/draftprocesses', {
2092 workflow_id: workflow_id
2093 });
2094 /*
2095
2096 return session.post('api/v2/draftprocesses', {}, {
2097 params: {
2098 workflow_id
2099 }
2100 })
2101 */
2102 },
2103 draftprocesses_update: function draftprocesses_update(draftprocess_id) {
2104 return session.get('api/v1/forms/draftprocesses/update', {
2105 params: {
2106 draftprocess_id: draftprocess_id
2107 }
2108 });
2109 },
2110 draftprocesses_put: function draftprocesses_put(draftprocess_id, body) {
2111 return session.putForm("api/v2/draftprocesses/".concat(draftprocess_id), {
2112 body: body
2113 });
2114 },
2115 draftprocesses_formUpdate: function draftprocesses_formUpdate(draftprocess_id, values) {
2116 // : {"WorkflowForm_2":"adsfasdf"}
2117 var body = {
2118 action: "formUpdate",
2119 values: values
2120 };
2121 return this.draftprocesses_put(draftprocess_id, body);
2122 } // async start(map_id) {
2123 // debugger
2124 // // this API is inconsistent with above
2125 // let response = await this.draftprocesses(map_id)
2126 // let draftprocess_id = get(response, 'data.results.draftprocess_id')
2127 // response = await this.draftprocesses_update(draftprocess_id)
2128 // return response.data
2129 // }
2130
2131 };
2132 };
2133
2134 var rhcore = function rhcore(session) {
2135 return {
2136 scriptNode: function scriptNode(id) {
2137 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2138 return session.get("api/v1/rhcore/".concat(id), {
2139 params: params
2140 });
2141 }
2142 };
2143 };
2144
2145 var members = function members(session) {
2146 return {
2147 USER: 0,
2148 GROUP: 1,
2149 // https://developer.opentext.com/awd/resources/apis/cs-rest-api-for-cs-16-s#!/members/SearchMember_get_1
2150 userQuery: function userQuery(query) {
2151 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2152
2153 var params = _objectSpread2({
2154 limit: 20,
2155 where_type: [this.USER, this.GROUP],
2156 query: query
2157 }, options);
2158
2159 return session.get("api/v2/members", {
2160 params: params
2161 });
2162 },
2163 member: function member(id) {
2164 return session.get("api/v2/members/".concat(id));
2165 }
2166 };
2167 };
2168
2169 var versions = function versions(session) {
2170 return {
2171 addVersion: function addVersion(dataid, fileHandler) {
2172 var _arguments = arguments;
2173 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
2174 var fileName, url, formData, path, f, name, _name;
2175
2176 return regeneratorRuntime.wrap(function _callee$(_context) {
2177 while (1) {
2178 switch (_context.prev = _context.next) {
2179 case 0:
2180 fileName = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : null;
2181 // ERROR: This seemed to only upload the first 2500 characters when the file extension
2182 // was .lxe (e.g., and unknown mimetype). Must look into this.
2183 url = "api/v1/nodes/".concat(dataid, "/versions");
2184 formData = formDataFactory.createFormData();
2185
2186 {
2187 _context.next = 14;
2188 break;
2189 }
2190
2191 case 8:
2192 f = _context.sent;
2193 name = fileName || path.basename(fileHandler);
2194 formData.append('file', f, name); // formData.append('name', name)
2195
2196 return _context.abrupt("return", session.post(url, formData.getBuffer(), {
2197 headers: formData.getHeaders()
2198 }));
2199
2200 case 14:
2201 // browser
2202 //
2203 _name = fileName || fileHandler.name;
2204 formData.append('file', fileHandler, _name); // formData.append('name', fileHandler.name)
2205
2206 return _context.abrupt("return", session.post(url, formData));
2207
2208 case 17:
2209 case "end":
2210 return _context.stop();
2211 }
2212 }
2213 }, _callee);
2214 }))();
2215 }
2216 };
2217 };
2218
2219 var webreports = function webreports(session) {
2220 return {
2221 run: function run(dataid) {
2222 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2223 var url = "api/v1/nodes/".concat(dataid, "/output");
2224 return session.get(url, {
2225 params: params
2226 });
2227 }
2228 };
2229 };
2230
2231 var Session_1 = /*#__PURE__*/function () {
2232 function Session(options) {
2233 _classCallCheck(this, Session);
2234
2235 this.axios = auth(options);
2236 }
2237
2238 _createClass(Session, [{
2239 key: "_isObject",
2240 value: function _isObject(value) {
2241 return value && _typeof(value) === 'object' && value.constructor === Object;
2242 }
2243 }, {
2244 key: "_objectToForm",
2245 value: function _objectToForm(obj) {
2246 var formData = formDataFactory.createFormData();
2247
2248 for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
2249 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
2250 key = _Object$entries$_i[0],
2251 value = _Object$entries$_i[1];
2252
2253 if (Array.isArray(value) || this._isObject(value)) {
2254 formData.append(key, JSON.stringify(value));
2255 } else {
2256 formData.append(key, value);
2257 }
2258 }
2259
2260 return formData;
2261 }
2262 }, {
2263 key: "get",
2264 value: function get() {
2265 var _this$axios;
2266
2267 return (_this$axios = this.axios).get.apply(_this$axios, arguments);
2268 }
2269 }, {
2270 key: "putForm",
2271 value: function putForm(url, params) {
2272 var formData = this._objectToForm(params);
2273
2274 return this.put(url, formData);
2275 }
2276 }, {
2277 key: "postForm",
2278 value: function postForm(url, params) {
2279 var formData = this._objectToForm(params);
2280
2281 return this.post(url, formData);
2282 }
2283 }, {
2284 key: "patchForm",
2285 value: function patchForm(url, params) {
2286 var formData = this._objectToForm(params);
2287
2288 return this.patch(url, formData);
2289 }
2290 }, {
2291 key: "post",
2292 value: function post() {
2293 var _this$axios2;
2294
2295 return (_this$axios2 = this.axios).post.apply(_this$axios2, arguments);
2296 }
2297 }, {
2298 key: "put",
2299 value: function put() {
2300 var _this$axios3;
2301
2302 return (_this$axios3 = this.axios).put.apply(_this$axios3, arguments);
2303 }
2304 }, {
2305 key: "delete",
2306 value: function _delete() {
2307 var _this$axios4;
2308
2309 return (_this$axios4 = this.axios)["delete"].apply(_this$axios4, arguments);
2310 }
2311 }, {
2312 key: "options",
2313 value: function options() {
2314 var _this$axios5;
2315
2316 return (_this$axios5 = this.axios).options.apply(_this$axios5, arguments);
2317 }
2318 }, {
2319 key: "patch",
2320 value: function patch() {
2321 var _this$axios6;
2322
2323 return (_this$axios6 = this.axios).patch.apply(_this$axios6, arguments);
2324 }
2325 }, {
2326 key: "nodes",
2327 get: function get() {
2328 // this creates a circular reference.. bad?
2329 if (this._nodes == null) {
2330 this._nodes = nodes(this);
2331 }
2332
2333 return this._nodes;
2334 }
2335 }, {
2336 key: "workflow",
2337 get: function get() {
2338 // this creates a circular reference.. bad?
2339 if (this._workflow == null) {
2340 this._workflow = workflow(this);
2341 }
2342
2343 return this._workflow;
2344 }
2345 }, {
2346 key: "rhcore",
2347 get: function get() {
2348 // this creates a circular reference.. bad?
2349 if (this._rhcore == null) {
2350 this._rhcore = rhcore(this);
2351 }
2352
2353 return this._rhcore;
2354 }
2355 }, {
2356 key: "members",
2357 get: function get() {
2358 // this creates a circular reference.. bad?
2359 if (this._members == null) {
2360 this._members = members(this);
2361 }
2362
2363 return this._members;
2364 }
2365 }, {
2366 key: "webreports",
2367 get: function get() {
2368 // this creates a circular reference.. bad?
2369 if (this._webreports == null) {
2370 this._webreports = webreports(this);
2371 }
2372
2373 return this._webreports;
2374 }
2375 }, {
2376 key: "versions",
2377 get: function get() {
2378 // this creates a circular reference.. bad?
2379 if (this._versions == null) {
2380 this._versions = versions(this);
2381 }
2382
2383 return this._versions;
2384 }
2385 }]);
2386
2387 return Session;
2388 }();
2389
2390 var src = {
2391 auth: auth,
2392 Session: Session_1
2393 };
2394 var src_1 = src.auth;
2395 var src_2 = src.Session;
2396
2397 exports.Session = src_2;
2398 exports.auth = src_1;
2399 exports.default = src;
2400
2401 Object.defineProperty(exports, '__esModule', { value: true });
2402
2403})));
2404//# sourceMappingURL=index.js.map