1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory((function webpackLoadOptionalExternalModule() { try { return require("esprima"); } catch(e) {} }()));
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define(["esprima"], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["SwaggerClient"] = factory((function webpackLoadOptionalExternalModule() { try { return require("esprima"); } catch(e) {} }()));
|
8 | else
|
9 | root["SwaggerClient"] = factory(root["esprima"]);
|
10 | })(window, function(__WEBPACK_EXTERNAL_MODULE__278__) {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50 | }
|
51 | };
|
52 |
|
53 |
|
54 | __webpack_require__.r = function(exports) {
|
55 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57 | }
|
58 | Object.defineProperty(exports, '__esModule', { value: true });
|
59 | };
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | __webpack_require__.t = function(value, mode) {
|
67 | if(mode & 1) value = __webpack_require__(value);
|
68 | if(mode & 8) return value;
|
69 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70 | var ns = Object.create(null);
|
71 | __webpack_require__.r(ns);
|
72 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74 | return ns;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.n = function(module) {
|
79 | var getter = module && module.__esModule ?
|
80 | function getDefault() { return module['default']; } :
|
81 | function getModuleExports() { return module; };
|
82 | __webpack_require__.d(getter, 'a', getter);
|
83 | return getter;
|
84 | };
|
85 |
|
86 |
|
87 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88 |
|
89 |
|
90 | __webpack_require__.p = "";
|
91 |
|
92 |
|
93 |
|
94 | return __webpack_require__(__webpack_require__.s = 185);
|
95 | })
|
96 |
|
97 | ([
|
98 |
|
99 | (function(module, exports, __webpack_require__) {
|
100 |
|
101 | module.exports = __webpack_require__(229);
|
102 |
|
103 | }),
|
104 |
|
105 | (function(module, exports, __webpack_require__) {
|
106 |
|
107 | module.exports = __webpack_require__(203);
|
108 |
|
109 | }),
|
110 |
|
111 | (function(module, exports, __webpack_require__) {
|
112 |
|
113 | var _Object$defineProperty = __webpack_require__(85);
|
114 |
|
115 | var _Object$defineProperties = __webpack_require__(189);
|
116 |
|
117 | var _Object$getOwnPropertyDescriptors = __webpack_require__(194);
|
118 |
|
119 | var _Object$getOwnPropertyDescriptor = __webpack_require__(123);
|
120 |
|
121 | var _Object$getOwnPropertySymbols = __webpack_require__(124);
|
122 |
|
123 | var _Object$keys = __webpack_require__(1);
|
124 |
|
125 | var defineProperty = __webpack_require__(116);
|
126 |
|
127 | function ownKeys(object, enumerableOnly) {
|
128 | var keys = _Object$keys(object);
|
129 |
|
130 | if (_Object$getOwnPropertySymbols) {
|
131 | var symbols = _Object$getOwnPropertySymbols(object);
|
132 |
|
133 | if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
134 | return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
135 | });
|
136 | keys.push.apply(keys, symbols);
|
137 | }
|
138 |
|
139 | return keys;
|
140 | }
|
141 |
|
142 | function _objectSpread2(target) {
|
143 | for (var i = 1; i < arguments.length; i++) {
|
144 | var source = arguments[i] != null ? arguments[i] : {};
|
145 |
|
146 | if (i % 2) {
|
147 | ownKeys(Object(source), true).forEach(function (key) {
|
148 | defineProperty(target, key, source[key]);
|
149 | });
|
150 | } else if (_Object$getOwnPropertyDescriptors) {
|
151 | _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source));
|
152 | } else {
|
153 | ownKeys(Object(source)).forEach(function (key) {
|
154 | _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key));
|
155 | });
|
156 | }
|
157 | }
|
158 |
|
159 | return target;
|
160 | }
|
161 |
|
162 | module.exports = _objectSpread2;
|
163 |
|
164 | }),
|
165 |
|
166 | (function(module, __webpack_exports__, __webpack_require__) {
|
167 |
|
168 | "use strict";
|
169 | __webpack_require__.r(__webpack_exports__);
|
170 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
171 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
172 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
|
173 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__);
|
174 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
|
175 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2__);
|
176 | var _babel_runtime_corejs2_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(116);
|
177 | var _babel_runtime_corejs2_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);
|
178 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(0);
|
179 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4__);
|
180 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10);
|
181 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5__);
|
182 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
183 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6__);
|
184 | var fast_json_patch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48);
|
185 | var fast_json_patch__WEBPACK_IMPORTED_MODULE_7___default = __webpack_require__.n(fast_json_patch__WEBPACK_IMPORTED_MODULE_7__);
|
186 | var deep_extend__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(166);
|
187 | var deep_extend__WEBPACK_IMPORTED_MODULE_8___default = __webpack_require__.n(deep_extend__WEBPACK_IMPORTED_MODULE_8__);
|
188 | var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(167);
|
189 | var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_9___default = __webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_9__);
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | __webpack_exports__["default"] = ({
|
201 | add: add,
|
202 | replace: replace,
|
203 | remove: remove,
|
204 | merge: merge,
|
205 | mergeDeep: mergeDeep,
|
206 | context: context,
|
207 | getIn: getIn,
|
208 | applyPatch: applyPatch,
|
209 | parentPathMatch: parentPathMatch,
|
210 | flatten: flatten,
|
211 | fullyNormalizeArray: fullyNormalizeArray,
|
212 | normalizeArray: normalizeArray,
|
213 | isPromise: isPromise,
|
214 | forEachNew: forEachNew,
|
215 | forEachNewPrimitive: forEachNewPrimitive,
|
216 | isJsonPatch: isJsonPatch,
|
217 | isContextPatch: isContextPatch,
|
218 | isPatch: isPatch,
|
219 | isMutation: isMutation,
|
220 | isAdditiveMutation: isAdditiveMutation,
|
221 | isGenerator: isGenerator,
|
222 | isFunction: isFunction,
|
223 | isObject: isObject,
|
224 | isError: isError
|
225 | });
|
226 |
|
227 | function applyPatch(obj, patch, opts) {
|
228 | opts = opts || {};
|
229 | patch = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()({}, patch), {}, {
|
230 | path: patch.path && normalizeJSONPath(patch.path)
|
231 | });
|
232 |
|
233 | if (patch.op === 'merge') {
|
234 | var newValue = getInByJsonPath(obj, patch.path);
|
235 |
|
236 | _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5___default()(newValue, patch.value);
|
237 |
|
238 | fast_json_patch__WEBPACK_IMPORTED_MODULE_7__["applyPatch"](obj, [replace(patch.path, newValue)]);
|
239 | } else if (patch.op === 'mergeDeep') {
|
240 | var currentValue = getInByJsonPath(obj, patch.path);
|
241 |
|
242 |
|
243 | for (var prop in patch.value) {
|
244 | var propVal = patch.value[prop];
|
245 |
|
246 | var isArray = _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(propVal);
|
247 |
|
248 | if (isArray) {
|
249 |
|
250 | var existing = currentValue[prop] || [];
|
251 | currentValue[prop] = existing.concat(propVal);
|
252 | } else if (isObject(propVal) && !isArray) {
|
253 |
|
254 |
|
255 | var currentObj = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()({}, currentValue[prop]);
|
256 |
|
257 |
|
258 | for (var key in propVal) {
|
259 | if (Object.prototype.hasOwnProperty.call(currentObj, key)) {
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 | currentObj = deep_extend__WEBPACK_IMPORTED_MODULE_8___default()(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_9___default()(currentObj), propVal);
|
268 | break;
|
269 | } else {
|
270 | _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5___default()(currentObj, _babel_runtime_corejs2_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()({}, key, propVal[key]));
|
271 | }
|
272 | }
|
273 |
|
274 | currentValue[prop] = currentObj;
|
275 | } else {
|
276 |
|
277 | currentValue[prop] = propVal;
|
278 | }
|
279 | }
|
280 | } else if (patch.op === 'add' && patch.path === '' && isObject(patch.value)) {
|
281 |
|
282 |
|
283 |
|
284 |
|
285 | var patches = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(patch.value).reduce(function (arr, key) {
|
286 | arr.push({
|
287 | op: 'add',
|
288 | path: "/".concat(normalizeJSONPath(key)),
|
289 | value: patch.value[key]
|
290 | });
|
291 | return arr;
|
292 | }, []);
|
293 |
|
294 | fast_json_patch__WEBPACK_IMPORTED_MODULE_7__["applyPatch"](obj, patches);
|
295 | } else if (patch.op === 'replace' && patch.path === '') {
|
296 | var _patch = patch,
|
297 | value = _patch.value;
|
298 |
|
299 | if (opts.allowMetaPatches && patch.meta && isAdditiveMutation(patch) && (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(patch.value) || isObject(patch.value))) {
|
300 | value = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()({}, value), patch.meta);
|
301 | }
|
302 |
|
303 | obj = value;
|
304 | } else {
|
305 | fast_json_patch__WEBPACK_IMPORTED_MODULE_7__["applyPatch"](obj, [patch]);
|
306 |
|
307 | if (opts.allowMetaPatches && patch.meta && isAdditiveMutation(patch) && (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(patch.value) || isObject(patch.value))) {
|
308 | var _currentValue = getInByJsonPath(obj, patch.path);
|
309 |
|
310 | var _newValue = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_6___default()({}, _currentValue), patch.meta);
|
311 |
|
312 | fast_json_patch__WEBPACK_IMPORTED_MODULE_7__["applyPatch"](obj, [replace(patch.path, _newValue)]);
|
313 | }
|
314 | }
|
315 |
|
316 | return obj;
|
317 | }
|
318 |
|
319 | function normalizeJSONPath(path) {
|
320 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(path)) {
|
321 | if (path.length < 1) {
|
322 | return '';
|
323 | }
|
324 |
|
325 | return "/".concat(path.map(function (item) {
|
326 |
|
327 | return (item + '').replace(/~/g, '~0').replace(/\//g, '~1');
|
328 | }).join('/'));
|
329 | }
|
330 |
|
331 | return path;
|
332 | }
|
333 |
|
334 |
|
335 |
|
336 |
|
337 | function add(path, value) {
|
338 | return {
|
339 | op: 'add',
|
340 | path: path,
|
341 | value: value
|
342 | };
|
343 | }
|
344 |
|
345 |
|
346 |
|
347 |
|
348 | function replace(path, value, meta) {
|
349 | return {
|
350 | op: 'replace',
|
351 | path: path,
|
352 | value: value,
|
353 | meta: meta
|
354 | };
|
355 | }
|
356 |
|
357 | function remove(path) {
|
358 | return {
|
359 | op: 'remove',
|
360 | path: path
|
361 | };
|
362 | }
|
363 |
|
364 |
|
365 | function merge(path, value) {
|
366 | return {
|
367 | type: 'mutation',
|
368 | op: 'merge',
|
369 | path: path,
|
370 | value: value
|
371 | };
|
372 | }
|
373 |
|
374 |
|
375 | function mergeDeep(path, value) {
|
376 | return {
|
377 | type: 'mutation',
|
378 | op: 'mergeDeep',
|
379 | path: path,
|
380 | value: value
|
381 | };
|
382 | }
|
383 |
|
384 | function context(path, value) {
|
385 | return {
|
386 | type: 'context',
|
387 | path: path,
|
388 | value: value
|
389 | };
|
390 | }
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | function forEachNew(mutations, fn) {
|
396 | try {
|
397 | return forEachNewPatch(mutations, forEach, fn);
|
398 | } catch (e) {
|
399 | return e;
|
400 | }
|
401 | }
|
402 |
|
403 | function forEachNewPrimitive(mutations, fn) {
|
404 | try {
|
405 | return forEachNewPatch(mutations, forEachPrimitive, fn);
|
406 | } catch (e) {
|
407 | return e;
|
408 | }
|
409 | }
|
410 |
|
411 | function forEachNewPatch(mutations, fn, callback) {
|
412 | var res = mutations.filter(isAdditiveMutation).map(function (mutation) {
|
413 | return fn(mutation.value, callback, mutation.path);
|
414 | }) || [];
|
415 | var flat = flatten(res);
|
416 | var clean = cleanArray(flat);
|
417 | return clean;
|
418 | }
|
419 |
|
420 | function forEachPrimitive(obj, fn, basePath) {
|
421 | basePath = basePath || [];
|
422 |
|
423 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(obj)) {
|
424 | return obj.map(function (val, key) {
|
425 | return forEachPrimitive(val, fn, basePath.concat(key));
|
426 | });
|
427 | }
|
428 |
|
429 | if (isObject(obj)) {
|
430 | return _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(obj).map(function (key) {
|
431 | return forEachPrimitive(obj[key], fn, basePath.concat(key));
|
432 | });
|
433 | }
|
434 |
|
435 | return fn(obj, basePath[basePath.length - 1], basePath);
|
436 | }
|
437 |
|
438 | function forEach(obj, fn, basePath) {
|
439 | basePath = basePath || [];
|
440 | var results = [];
|
441 |
|
442 | if (basePath.length > 0) {
|
443 | var newResults = fn(obj, basePath[basePath.length - 1], basePath);
|
444 |
|
445 | if (newResults) {
|
446 | results = results.concat(newResults);
|
447 | }
|
448 | }
|
449 |
|
450 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(obj)) {
|
451 | var arrayResults = obj.map(function (val, key) {
|
452 | return forEach(val, fn, basePath.concat(key));
|
453 | });
|
454 |
|
455 | if (arrayResults) {
|
456 | results = results.concat(arrayResults);
|
457 | }
|
458 | } else if (isObject(obj)) {
|
459 | var moreResults = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(obj).map(function (key) {
|
460 | return forEach(obj[key], fn, basePath.concat(key));
|
461 | });
|
462 |
|
463 | if (moreResults) {
|
464 | results = results.concat(moreResults);
|
465 | }
|
466 | }
|
467 |
|
468 | results = flatten(results);
|
469 | return results;
|
470 | }
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | function parentPathMatch(path, arr) {
|
476 | if (!_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(arr)) {
|
477 | return false;
|
478 | }
|
479 |
|
480 | for (var i = 0, len = arr.length; i < len; i += 1) {
|
481 | if (arr[i] !== path[i]) {
|
482 | return false;
|
483 | }
|
484 | }
|
485 |
|
486 | return true;
|
487 | }
|
488 |
|
489 | function getIn(obj, path) {
|
490 | return path.reduce(function (val, token) {
|
491 | if (typeof token !== 'undefined' && val) {
|
492 | return val[token];
|
493 | }
|
494 |
|
495 | return val;
|
496 | }, obj);
|
497 | }
|
498 |
|
499 |
|
500 |
|
501 |
|
502 | function fullyNormalizeArray(arr) {
|
503 | return cleanArray(flatten(normalizeArray(arr)));
|
504 | }
|
505 |
|
506 | function normalizeArray(arr) {
|
507 | return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(arr) ? arr : [arr];
|
508 | }
|
509 |
|
510 | function flatten(arr) {
|
511 | var _ref;
|
512 |
|
513 | return (_ref = []).concat.apply(_ref, _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default()(arr.map(function (val) {
|
514 | return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(val) ? flatten(val) : val;
|
515 | })));
|
516 | }
|
517 |
|
518 | function cleanArray(arr) {
|
519 | return arr.filter(function (elm) {
|
520 | return typeof elm !== 'undefined';
|
521 | });
|
522 | }
|
523 |
|
524 |
|
525 |
|
526 |
|
527 | function isObject(val) {
|
528 | return val && _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(val) === 'object';
|
529 | }
|
530 |
|
531 | function isPromise(val) {
|
532 | return isObject(val) && isFunction(val.then);
|
533 | }
|
534 |
|
535 | function isFunction(val) {
|
536 | return val && typeof val === 'function';
|
537 | }
|
538 |
|
539 | function isError(patch) {
|
540 | return patch instanceof Error;
|
541 | }
|
542 |
|
543 | function isJsonPatch(patch) {
|
544 | if (isPatch(patch)) {
|
545 | var op = patch.op;
|
546 | return op === 'add' || op === 'remove' || op === 'replace';
|
547 | }
|
548 |
|
549 | return false;
|
550 | }
|
551 |
|
552 | function isGenerator(thing) {
|
553 | return Object.prototype.toString.call(thing) === '[object GeneratorFunction]';
|
554 | }
|
555 |
|
556 | function isMutation(patch) {
|
557 | return isJsonPatch(patch) || isPatch(patch) && patch.type === 'mutation';
|
558 | }
|
559 |
|
560 | function isAdditiveMutation(patch) {
|
561 | return isMutation(patch) && (patch.op === 'add' || patch.op === 'replace' || patch.op === 'merge' || patch.op === 'mergeDeep');
|
562 | }
|
563 |
|
564 | function isContextPatch(patch) {
|
565 | return isPatch(patch) && patch.type === 'context';
|
566 | }
|
567 |
|
568 | function isPatch(patch) {
|
569 | return patch && _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(patch) === 'object';
|
570 | }
|
571 |
|
572 | function getInByJsonPath(obj, jsonPath) {
|
573 | try {
|
574 | return fast_json_patch__WEBPACK_IMPORTED_MODULE_7__["getValueByPointer"](obj, jsonPath);
|
575 | } catch (e) {
|
576 | console.error(e);
|
577 |
|
578 | return {};
|
579 | }
|
580 | }
|
581 |
|
582 | }),
|
583 |
|
584 | (function(module, exports, __webpack_require__) {
|
585 |
|
586 | var _Symbol$iterator = __webpack_require__(138);
|
587 |
|
588 | var _Symbol = __webpack_require__(70);
|
589 |
|
590 | function _typeof(obj) {
|
591 | "@babel/helpers - typeof";
|
592 |
|
593 | if (typeof _Symbol === "function" && typeof _Symbol$iterator === "symbol") {
|
594 | module.exports = _typeof = function _typeof(obj) {
|
595 | return typeof obj;
|
596 | };
|
597 | } else {
|
598 | module.exports = _typeof = function _typeof(obj) {
|
599 | return obj && typeof _Symbol === "function" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
|
600 | };
|
601 | }
|
602 |
|
603 | return _typeof(obj);
|
604 | }
|
605 |
|
606 | module.exports = _typeof;
|
607 |
|
608 | }),
|
609 |
|
610 | (function(module, exports) {
|
611 |
|
612 | var core = module.exports = { version: '2.6.11' };
|
613 | if (typeof __e == 'number') __e = core;
|
614 |
|
615 |
|
616 | }),
|
617 |
|
618 | (function(module, exports, __webpack_require__) {
|
619 |
|
620 | var global = __webpack_require__(7);
|
621 | var core = __webpack_require__(5);
|
622 | var ctx = __webpack_require__(26);
|
623 | var hide = __webpack_require__(27);
|
624 | var has = __webpack_require__(23);
|
625 | var PROTOTYPE = 'prototype';
|
626 |
|
627 | var $export = function (type, name, source) {
|
628 | var IS_FORCED = type & $export.F;
|
629 | var IS_GLOBAL = type & $export.G;
|
630 | var IS_STATIC = type & $export.S;
|
631 | var IS_PROTO = type & $export.P;
|
632 | var IS_BIND = type & $export.B;
|
633 | var IS_WRAP = type & $export.W;
|
634 | var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
635 | var expProto = exports[PROTOTYPE];
|
636 | var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
|
637 | var key, own, out;
|
638 | if (IS_GLOBAL) source = name;
|
639 | for (key in source) {
|
640 |
|
641 | own = !IS_FORCED && target && target[key] !== undefined;
|
642 | if (own && has(exports, key)) continue;
|
643 |
|
644 | out = own ? target[key] : source[key];
|
645 |
|
646 | exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
|
647 |
|
648 | : IS_BIND && own ? ctx(out, global)
|
649 |
|
650 | : IS_WRAP && target[key] == out ? (function (C) {
|
651 | var F = function (a, b, c) {
|
652 | if (this instanceof C) {
|
653 | switch (arguments.length) {
|
654 | case 0: return new C();
|
655 | case 1: return new C(a);
|
656 | case 2: return new C(a, b);
|
657 | } return new C(a, b, c);
|
658 | } return C.apply(this, arguments);
|
659 | };
|
660 | F[PROTOTYPE] = C[PROTOTYPE];
|
661 | return F;
|
662 |
|
663 | })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
664 |
|
665 | if (IS_PROTO) {
|
666 | (exports.virtual || (exports.virtual = {}))[key] = out;
|
667 |
|
668 | if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
|
669 | }
|
670 | }
|
671 | };
|
672 |
|
673 | $export.F = 1;
|
674 | $export.G = 2;
|
675 | $export.S = 4;
|
676 | $export.P = 8;
|
677 | $export.B = 16;
|
678 | $export.W = 32;
|
679 | $export.U = 64;
|
680 | $export.R = 128;
|
681 | module.exports = $export;
|
682 |
|
683 |
|
684 | }),
|
685 |
|
686 | (function(module, exports) {
|
687 |
|
688 |
|
689 | var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
690 | ? window : typeof self != 'undefined' && self.Math == Math ? self
|
691 |
|
692 | : Function('return this')();
|
693 | if (typeof __g == 'number') __g = global;
|
694 |
|
695 |
|
696 | }),
|
697 |
|
698 | (function(module, exports, __webpack_require__) {
|
699 |
|
700 | "use strict";
|
701 |
|
702 |
|
703 | var YAMLException = __webpack_require__(58);
|
704 |
|
705 | var TYPE_CONSTRUCTOR_OPTIONS = [
|
706 | 'kind',
|
707 | 'resolve',
|
708 | 'construct',
|
709 | 'instanceOf',
|
710 | 'predicate',
|
711 | 'represent',
|
712 | 'defaultStyle',
|
713 | 'styleAliases'
|
714 | ];
|
715 |
|
716 | var YAML_NODE_KINDS = [
|
717 | 'scalar',
|
718 | 'sequence',
|
719 | 'mapping'
|
720 | ];
|
721 |
|
722 | function compileStyleAliases(map) {
|
723 | var result = {};
|
724 |
|
725 | if (map !== null) {
|
726 | Object.keys(map).forEach(function (style) {
|
727 | map[style].forEach(function (alias) {
|
728 | result[String(alias)] = style;
|
729 | });
|
730 | });
|
731 | }
|
732 |
|
733 | return result;
|
734 | }
|
735 |
|
736 | function Type(tag, options) {
|
737 | options = options || {};
|
738 |
|
739 | Object.keys(options).forEach(function (name) {
|
740 | if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
741 | throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
742 | }
|
743 | });
|
744 |
|
745 |
|
746 | this.tag = tag;
|
747 | this.kind = options['kind'] || null;
|
748 | this.resolve = options['resolve'] || function () { return true; };
|
749 | this.construct = options['construct'] || function (data) { return data; };
|
750 | this.instanceOf = options['instanceOf'] || null;
|
751 | this.predicate = options['predicate'] || null;
|
752 | this.represent = options['represent'] || null;
|
753 | this.defaultStyle = options['defaultStyle'] || null;
|
754 | this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
|
755 |
|
756 | if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
757 | throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
758 | }
|
759 | }
|
760 |
|
761 | module.exports = Type;
|
762 |
|
763 |
|
764 | }),
|
765 |
|
766 | (function(module, exports) {
|
767 |
|
768 | module.exports = function (it) {
|
769 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
770 | };
|
771 |
|
772 |
|
773 | }),
|
774 |
|
775 | (function(module, exports, __webpack_require__) {
|
776 |
|
777 | module.exports = __webpack_require__(314);
|
778 |
|
779 | }),
|
780 |
|
781 | (function(module, exports, __webpack_require__) {
|
782 |
|
783 | var store = __webpack_require__(92)('wks');
|
784 | var uid = __webpack_require__(64);
|
785 | var Symbol = __webpack_require__(7).Symbol;
|
786 | var USE_SYMBOL = typeof Symbol == 'function';
|
787 |
|
788 | var $exports = module.exports = function (name) {
|
789 | return store[name] || (store[name] =
|
790 | USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
791 | };
|
792 |
|
793 | $exports.store = store;
|
794 |
|
795 |
|
796 | }),
|
797 |
|
798 | (function(module, exports, __webpack_require__) {
|
799 |
|
800 | var isObject = __webpack_require__(9);
|
801 | module.exports = function (it) {
|
802 | if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
803 | return it;
|
804 | };
|
805 |
|
806 |
|
807 | }),
|
808 |
|
809 | (function(module, __webpack_exports__, __webpack_require__) {
|
810 |
|
811 | "use strict";
|
812 | __webpack_require__.r(__webpack_exports__);
|
813 | __webpack_require__.d(__webpack_exports__, "isOAS3", function() { return isOAS3; });
|
814 | __webpack_require__.d(__webpack_exports__, "isSwagger2", function() { return isSwagger2; });
|
815 | __webpack_require__.d(__webpack_exports__, "opId", function() { return opId; });
|
816 | __webpack_require__.d(__webpack_exports__, "idFromPathMethod", function() { return idFromPathMethod; });
|
817 | __webpack_require__.d(__webpack_exports__, "legacyIdFromPathMethod", function() { return legacyIdFromPathMethod; });
|
818 | __webpack_require__.d(__webpack_exports__, "getOperationRaw", function() { return getOperationRaw; });
|
819 | __webpack_require__.d(__webpack_exports__, "findOperation", function() { return findOperation; });
|
820 | __webpack_require__.d(__webpack_exports__, "eachOperation", function() { return eachOperation; });
|
821 | __webpack_require__.d(__webpack_exports__, "normalizeSwagger", function() { return normalizeSwagger; });
|
822 | var _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
|
823 | var _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0__);
|
824 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
825 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
|
826 | var lodash_isObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35);
|
827 | var lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_2__);
|
828 | var lodash_startsWith__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60);
|
829 | var lodash_startsWith__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(lodash_startsWith__WEBPACK_IMPORTED_MODULE_3__);
|
830 |
|
831 |
|
832 |
|
833 |
|
834 |
|
835 | var toLower = function toLower(str) {
|
836 | return String.prototype.toLowerCase.call(str);
|
837 | };
|
838 |
|
839 | var escapeString = function escapeString(str) {
|
840 | return str.replace(/[^\w]/gi, '_');
|
841 | };
|
842 |
|
843 |
|
844 | function isOAS3(spec) {
|
845 | var oasVersion = spec.openapi;
|
846 |
|
847 | if (!oasVersion) {
|
848 | return false;
|
849 | }
|
850 |
|
851 | return lodash_startsWith__WEBPACK_IMPORTED_MODULE_3___default()(oasVersion, '3');
|
852 | }
|
853 | function isSwagger2(spec) {
|
854 | var swaggerVersion = spec.swagger;
|
855 |
|
856 | if (!swaggerVersion) {
|
857 | return false;
|
858 | }
|
859 |
|
860 | return lodash_startsWith__WEBPACK_IMPORTED_MODULE_3___default()(swaggerVersion, '2');
|
861 | }
|
862 |
|
863 | function opId(operation, pathName) {
|
864 | var method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
865 |
|
866 | var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
867 | v2OperationIdCompatibilityMode = _ref.v2OperationIdCompatibilityMode;
|
868 |
|
869 | if (!operation || _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(operation) !== 'object') {
|
870 | return null;
|
871 | }
|
872 |
|
873 | var idWithoutWhitespace = (operation.operationId || '').replace(/\s/g, '');
|
874 |
|
875 | if (idWithoutWhitespace.length) {
|
876 | return escapeString(operation.operationId);
|
877 | }
|
878 |
|
879 | return idFromPathMethod(pathName, method, {
|
880 | v2OperationIdCompatibilityMode: v2OperationIdCompatibilityMode
|
881 | });
|
882 | }
|
883 |
|
884 | function idFromPathMethod(pathName, method) {
|
885 | var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
886 | v2OperationIdCompatibilityMode = _ref2.v2OperationIdCompatibilityMode;
|
887 |
|
888 | if (v2OperationIdCompatibilityMode) {
|
889 | var res = "".concat(method.toLowerCase(), "_").concat(pathName).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g, '_');
|
890 | res = res || "".concat(pathName.substring(1), "_").concat(method);
|
891 | return res.replace(/((_){2,})/g, '_').replace(/^(_)*/g, '').replace(/([_])*$/g, '');
|
892 | }
|
893 |
|
894 | return "".concat(toLower(method)).concat(escapeString(pathName));
|
895 | }
|
896 | function legacyIdFromPathMethod(pathName, method) {
|
897 | return "".concat(toLower(method), "-").concat(pathName);
|
898 | }
|
899 |
|
900 | function getOperationRaw(spec, id) {
|
901 | if (!spec || !spec.paths) {
|
902 | return null;
|
903 | }
|
904 |
|
905 | return findOperation(spec, function (_ref3) {
|
906 | var pathName = _ref3.pathName,
|
907 | method = _ref3.method,
|
908 | operation = _ref3.operation;
|
909 |
|
910 | if (!operation || _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(operation) !== 'object') {
|
911 | return false;
|
912 | }
|
913 |
|
914 | var rawOperationId = operation.operationId;
|
915 |
|
916 | var operationId = opId(operation, pathName, method);
|
917 | var legacyOperationId = legacyIdFromPathMethod(pathName, method);
|
918 | return [operationId, legacyOperationId, rawOperationId].some(function (val) {
|
919 | return val && val === id;
|
920 | });
|
921 | });
|
922 | }
|
923 |
|
924 |
|
925 | function findOperation(spec, predicate) {
|
926 | return eachOperation(spec, predicate, true) || null;
|
927 | }
|
928 |
|
929 |
|
930 | function eachOperation(spec, cb, find) {
|
931 | if (!spec || _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(spec) !== 'object' || !spec.paths || _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(spec.paths) !== 'object') {
|
932 | return null;
|
933 | }
|
934 |
|
935 | var paths = spec.paths;
|
936 |
|
937 |
|
938 | for (var pathName in paths) {
|
939 |
|
940 | for (var method in paths[pathName]) {
|
941 | if (method.toUpperCase() === 'PARAMETERS') {
|
942 | continue;
|
943 | }
|
944 |
|
945 | var operation = paths[pathName][method];
|
946 |
|
947 | if (!operation || _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(operation) !== 'object') {
|
948 | continue;
|
949 | }
|
950 |
|
951 | var operationObj = {
|
952 | spec: spec,
|
953 | pathName: pathName,
|
954 | method: method.toUpperCase(),
|
955 | operation: operation
|
956 | };
|
957 | var cbValue = cb(operationObj);
|
958 |
|
959 | if (find && cbValue) {
|
960 | return operationObj;
|
961 | }
|
962 | }
|
963 | }
|
964 |
|
965 | return undefined;
|
966 | }
|
967 |
|
968 |
|
969 | function normalizeSwagger(parsedSpec) {
|
970 | var spec = parsedSpec.spec;
|
971 | var paths = spec.paths;
|
972 | var map = {};
|
973 |
|
974 | if (!paths || spec.$$normalized) {
|
975 | return parsedSpec;
|
976 | }
|
977 |
|
978 |
|
979 | for (var pathName in paths) {
|
980 | var path = paths[pathName];
|
981 |
|
982 | if (!lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default()(path)) {
|
983 | continue;
|
984 | }
|
985 |
|
986 | var pathParameters = path.parameters;
|
987 |
|
988 | var _loop = function _loop(method) {
|
989 | var operation = path[method];
|
990 |
|
991 | if (!lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default()(operation)) {
|
992 | return "continue";
|
993 | }
|
994 |
|
995 | var oid = opId(operation, pathName, method);
|
996 |
|
997 | if (oid) {
|
998 | if (map[oid]) {
|
999 | map[oid].push(operation);
|
1000 | } else {
|
1001 | map[oid] = [operation];
|
1002 | }
|
1003 |
|
1004 | var opList = map[oid];
|
1005 |
|
1006 | if (opList.length > 1) {
|
1007 | opList.forEach(function (o, i) {
|
1008 |
|
1009 | o.__originalOperationId = o.__originalOperationId || o.operationId;
|
1010 | o.operationId = "".concat(oid).concat(i + 1);
|
1011 | });
|
1012 | } else if (typeof operation.operationId !== 'undefined') {
|
1013 |
|
1014 |
|
1015 |
|
1016 | var obj = opList[0];
|
1017 |
|
1018 | obj.__originalOperationId = obj.__originalOperationId || operation.operationId;
|
1019 | obj.operationId = oid;
|
1020 | }
|
1021 | }
|
1022 |
|
1023 | if (method !== 'parameters') {
|
1024 |
|
1025 | var inheritsList = [];
|
1026 | var toBeInherit = {};
|
1027 |
|
1028 |
|
1029 | for (var key in spec) {
|
1030 | if (key === 'produces' || key === 'consumes' || key === 'security') {
|
1031 | toBeInherit[key] = spec[key];
|
1032 | inheritsList.push(toBeInherit);
|
1033 | }
|
1034 | }
|
1035 |
|
1036 |
|
1037 | if (pathParameters) {
|
1038 | toBeInherit.parameters = pathParameters;
|
1039 | inheritsList.push(toBeInherit);
|
1040 | }
|
1041 |
|
1042 | if (inheritsList.length) {
|
1043 |
|
1044 | var _iterator = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0___default()(inheritsList),
|
1045 | _step;
|
1046 |
|
1047 | try {
|
1048 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
1049 | var inherits = _step.value;
|
1050 |
|
1051 |
|
1052 | for (var inheritName in inherits) {
|
1053 | if (!operation[inheritName]) {
|
1054 | operation[inheritName] = inherits[inheritName];
|
1055 | } else if (inheritName === 'parameters') {
|
1056 |
|
1057 | var _iterator2 = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0___default()(inherits[inheritName]),
|
1058 | _step2;
|
1059 |
|
1060 | try {
|
1061 | var _loop2 = function _loop2() {
|
1062 | var param = _step2.value;
|
1063 | var exists = operation[inheritName].some(function (opParam) {
|
1064 | return opParam.name && opParam.name === param.name || opParam.$ref && opParam.$ref === param.$ref || opParam.$$ref && opParam.$$ref === param.$$ref || opParam === param;
|
1065 | });
|
1066 |
|
1067 | if (!exists) {
|
1068 | operation[inheritName].push(param);
|
1069 | }
|
1070 | };
|
1071 |
|
1072 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
1073 | _loop2();
|
1074 | }
|
1075 | } catch (err) {
|
1076 | _iterator2.e(err);
|
1077 | } finally {
|
1078 | _iterator2.f();
|
1079 | }
|
1080 | }
|
1081 | }
|
1082 | }
|
1083 | } catch (err) {
|
1084 | _iterator.e(err);
|
1085 | } finally {
|
1086 | _iterator.f();
|
1087 | }
|
1088 | }
|
1089 | }
|
1090 | };
|
1091 |
|
1092 | for (var method in path) {
|
1093 | var _ret = _loop(method);
|
1094 |
|
1095 | if (_ret === "continue") continue;
|
1096 | }
|
1097 | }
|
1098 |
|
1099 | spec.$$normalized = true;
|
1100 | return parsedSpec;
|
1101 | }
|
1102 |
|
1103 | }),
|
1104 |
|
1105 | (function(module, exports, __webpack_require__) {
|
1106 |
|
1107 | module.exports = __webpack_require__(221);
|
1108 |
|
1109 |
|
1110 | }),
|
1111 |
|
1112 | (function(module, exports, __webpack_require__) {
|
1113 |
|
1114 | var arrayWithHoles = __webpack_require__(241);
|
1115 |
|
1116 | var iterableToArrayLimit = __webpack_require__(242);
|
1117 |
|
1118 | var unsupportedIterableToArray = __webpack_require__(106);
|
1119 |
|
1120 | var nonIterableRest = __webpack_require__(245);
|
1121 |
|
1122 | function _slicedToArray(arr, i) {
|
1123 | return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
1124 | }
|
1125 |
|
1126 | module.exports = _slicedToArray;
|
1127 |
|
1128 | }),
|
1129 |
|
1130 | (function(module, exports, __webpack_require__) {
|
1131 |
|
1132 |
|
1133 | module.exports = !__webpack_require__(28)(function () {
|
1134 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
1135 | });
|
1136 |
|
1137 |
|
1138 | }),
|
1139 |
|
1140 | (function(module, exports, __webpack_require__) {
|
1141 |
|
1142 | var arrayWithoutHoles = __webpack_require__(311);
|
1143 |
|
1144 | var iterableToArray = __webpack_require__(312);
|
1145 |
|
1146 | var unsupportedIterableToArray = __webpack_require__(106);
|
1147 |
|
1148 | var nonIterableSpread = __webpack_require__(313);
|
1149 |
|
1150 | function _toConsumableArray(arr) {
|
1151 | return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
1152 | }
|
1153 |
|
1154 | module.exports = _toConsumableArray;
|
1155 |
|
1156 | }),
|
1157 |
|
1158 | (function(module, __webpack_exports__, __webpack_require__) {
|
1159 |
|
1160 | "use strict";
|
1161 | __webpack_require__.r(__webpack_exports__);
|
1162 | __webpack_require__.d(__webpack_exports__, "self", function() { return self; });
|
1163 | __webpack_require__.d(__webpack_exports__, "default", function() { return http; });
|
1164 | __webpack_require__.d(__webpack_exports__, "shouldDownloadAsText", function() { return shouldDownloadAsText; });
|
1165 | __webpack_require__.d(__webpack_exports__, "serializeRes", function() { return serializeRes; });
|
1166 | __webpack_require__.d(__webpack_exports__, "serializeHeaders", function() { return serializeHeaders; });
|
1167 | __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; });
|
1168 | __webpack_require__.d(__webpack_exports__, "encodeFormOrQuery", function() { return encodeFormOrQuery; });
|
1169 | __webpack_require__.d(__webpack_exports__, "mergeInQueryOrForm", function() { return mergeInQueryOrForm; });
|
1170 | __webpack_require__.d(__webpack_exports__, "makeHttp", function() { return makeHttp; });
|
1171 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
|
1172 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0__);
|
1173 | var _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
|
1174 | var _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_1__);
|
1175 | var _babel_runtime_corejs2_core_js_object_entries__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159);
|
1176 | var _babel_runtime_corejs2_core_js_object_entries__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_entries__WEBPACK_IMPORTED_MODULE_2__);
|
1177 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
|
1178 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3__);
|
1179 | var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37);
|
1180 | var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_4__);
|
1181 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
1182 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5__);
|
1183 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4);
|
1184 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6__);
|
1185 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15);
|
1186 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__);
|
1187 | var _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(76);
|
1188 | var _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_8___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_8__);
|
1189 | var _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(45);
|
1190 | var _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__);
|
1191 | var cross_fetch_polyfill__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(253);
|
1192 | var cross_fetch_polyfill__WEBPACK_IMPORTED_MODULE_10___default = __webpack_require__.n(cross_fetch_polyfill__WEBPACK_IMPORTED_MODULE_10__);
|
1193 | var qs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(83);
|
1194 | var qs__WEBPACK_IMPORTED_MODULE_11___default = __webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_11__);
|
1195 | var js_yaml__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(78);
|
1196 | var js_yaml__WEBPACK_IMPORTED_MODULE_12___default = __webpack_require__.n(js_yaml__WEBPACK_IMPORTED_MODULE_12__);
|
1197 | var lodash_pick__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(46);
|
1198 | var lodash_pick__WEBPACK_IMPORTED_MODULE_13___default = __webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_13__);
|
1199 | var lodash_isFunction__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(30);
|
1200 | var lodash_isFunction__WEBPACK_IMPORTED_MODULE_14___default = __webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_14__);
|
1201 | var buffer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(29);
|
1202 | var buffer__WEBPACK_IMPORTED_MODULE_15___default = __webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_15__);
|
1203 | var _internal_form_data_monkey_patch__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(160);
|
1204 | var _execute_oas3_style_serializer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(32);
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 | var self = {
|
1227 | serializeRes: serializeRes,
|
1228 | mergeInQueryOrForm: mergeInQueryOrForm
|
1229 | };
|
1230 |
|
1231 |
|
1232 | function http(_x) {
|
1233 | return _http.apply(this, arguments);
|
1234 | }
|
1235 |
|
1236 | function _http() {
|
1237 | _http = _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9___default()( _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(url) {
|
1238 | var request,
|
1239 | contentType,
|
1240 | res,
|
1241 | error,
|
1242 | _error,
|
1243 | _args = arguments;
|
1244 |
|
1245 | return _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
|
1246 | while (1) {
|
1247 | switch (_context.prev = _context.next) {
|
1248 | case 0:
|
1249 | request = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
1250 |
|
1251 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(url) === 'object') {
|
1252 | request = url;
|
1253 | url = request.url;
|
1254 | }
|
1255 |
|
1256 | request.headers = request.headers || {};
|
1257 |
|
1258 |
|
1259 |
|
1260 | self.mergeInQueryOrForm(request);
|
1261 |
|
1262 |
|
1263 |
|
1264 | if (request.headers) {
|
1265 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(request.headers).forEach(function (headerName) {
|
1266 | var value = request.headers[headerName];
|
1267 |
|
1268 | if (typeof value === 'string') {
|
1269 | request.headers[headerName] = value.replace(/\n+/g, ' ');
|
1270 | }
|
1271 | });
|
1272 | }
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 | if (!request.requestInterceptor) {
|
1278 | _context.next = 12;
|
1279 | break;
|
1280 | }
|
1281 |
|
1282 | _context.next = 8;
|
1283 | return request.requestInterceptor(request);
|
1284 |
|
1285 | case 8:
|
1286 | _context.t0 = _context.sent;
|
1287 |
|
1288 | if (_context.t0) {
|
1289 | _context.next = 11;
|
1290 | break;
|
1291 | }
|
1292 |
|
1293 | _context.t0 = request;
|
1294 |
|
1295 | case 11:
|
1296 | request = _context.t0;
|
1297 |
|
1298 | case 12:
|
1299 |
|
1300 |
|
1301 | contentType = request.headers['content-type'] || request.headers['Content-Type'];
|
1302 |
|
1303 | if (/multipart\/form-data/i.test(contentType)) {
|
1304 | delete request.headers['content-type'];
|
1305 | delete request.headers['Content-Type'];
|
1306 | }
|
1307 |
|
1308 |
|
1309 | _context.prev = 14;
|
1310 | _context.next = 17;
|
1311 | return (request.userFetch || fetch)(request.url, request);
|
1312 |
|
1313 | case 17:
|
1314 | res = _context.sent;
|
1315 | _context.next = 20;
|
1316 | return self.serializeRes(res, url, request);
|
1317 |
|
1318 | case 20:
|
1319 | res = _context.sent;
|
1320 |
|
1321 | if (!request.responseInterceptor) {
|
1322 | _context.next = 28;
|
1323 | break;
|
1324 | }
|
1325 |
|
1326 | _context.next = 24;
|
1327 | return request.responseInterceptor(res);
|
1328 |
|
1329 | case 24:
|
1330 | _context.t1 = _context.sent;
|
1331 |
|
1332 | if (_context.t1) {
|
1333 | _context.next = 27;
|
1334 | break;
|
1335 | }
|
1336 |
|
1337 | _context.t1 = res;
|
1338 |
|
1339 | case 27:
|
1340 | res = _context.t1;
|
1341 |
|
1342 | case 28:
|
1343 | _context.next = 39;
|
1344 | break;
|
1345 |
|
1346 | case 30:
|
1347 | _context.prev = 30;
|
1348 | _context.t2 = _context["catch"](14);
|
1349 |
|
1350 | if (res) {
|
1351 | _context.next = 34;
|
1352 | break;
|
1353 | }
|
1354 |
|
1355 | throw _context.t2;
|
1356 |
|
1357 | case 34:
|
1358 | error = new Error(res.statusText);
|
1359 | error.status = res.status;
|
1360 | error.statusCode = res.status;
|
1361 | error.responseError = _context.t2;
|
1362 | throw error;
|
1363 |
|
1364 | case 39:
|
1365 | if (res.ok) {
|
1366 | _context.next = 45;
|
1367 | break;
|
1368 | }
|
1369 |
|
1370 | _error = new Error(res.statusText);
|
1371 | _error.status = res.status;
|
1372 | _error.statusCode = res.status;
|
1373 | _error.response = res;
|
1374 | throw _error;
|
1375 |
|
1376 | case 45:
|
1377 | return _context.abrupt("return", res);
|
1378 |
|
1379 | case 46:
|
1380 | case "end":
|
1381 | return _context.stop();
|
1382 | }
|
1383 | }
|
1384 | }, _callee, null, [[14, 30]]);
|
1385 | }));
|
1386 | return _http.apply(this, arguments);
|
1387 | }
|
1388 |
|
1389 | var shouldDownloadAsText = function shouldDownloadAsText() {
|
1390 | var contentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
1391 | return /(json|xml|yaml|text)\b/.test(contentType);
|
1392 | };
|
1393 |
|
1394 | function parseBody(body, contentType) {
|
1395 | if (contentType && (contentType.indexOf('application/json') === 0 || contentType.indexOf('+json') > 0)) {
|
1396 | return JSON.parse(body);
|
1397 | }
|
1398 |
|
1399 | return js_yaml__WEBPACK_IMPORTED_MODULE_12___default.a.safeLoad(body);
|
1400 | }
|
1401 |
|
1402 |
|
1403 | function serializeRes(oriRes, url) {
|
1404 | var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
1405 | _ref$loadSpec = _ref.loadSpec,
|
1406 | loadSpec = _ref$loadSpec === void 0 ? false : _ref$loadSpec;
|
1407 |
|
1408 | var res = {
|
1409 | ok: oriRes.ok,
|
1410 | url: oriRes.url || url,
|
1411 | status: oriRes.status,
|
1412 | statusText: oriRes.statusText,
|
1413 | headers: serializeHeaders(oriRes.headers)
|
1414 | };
|
1415 | var contentType = res.headers['content-type'];
|
1416 | var useText = loadSpec || shouldDownloadAsText(contentType);
|
1417 | var getBody = useText ? oriRes.text : oriRes.blob || oriRes.buffer;
|
1418 | return getBody.call(oriRes).then(function (body) {
|
1419 | res.text = body;
|
1420 | res.data = body;
|
1421 |
|
1422 | if (useText) {
|
1423 | try {
|
1424 | var obj = parseBody(body, contentType);
|
1425 | res.body = obj;
|
1426 | res.obj = obj;
|
1427 | } catch (e) {
|
1428 | res.parseError = e;
|
1429 | }
|
1430 | }
|
1431 |
|
1432 | return res;
|
1433 | });
|
1434 | }
|
1435 |
|
1436 | function serializeHeaderValue(value) {
|
1437 | var isMulti = value.includes(', ');
|
1438 | return isMulti ? value.split(', ') : value;
|
1439 | }
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 | function serializeHeaders() {
|
1447 | var headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1448 | if (!lodash_isFunction__WEBPACK_IMPORTED_MODULE_14___default()(headers.entries)) return {};
|
1449 | return _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_8___default()(headers.entries()).reduce(function (acc, _ref2) {
|
1450 | var _ref3 = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7___default()(_ref2, 2),
|
1451 | header = _ref3[0],
|
1452 | value = _ref3[1];
|
1453 |
|
1454 | acc[header] = serializeHeaderValue(value);
|
1455 | return acc;
|
1456 | }, {});
|
1457 | }
|
1458 | function isFile(obj, navigatorObj) {
|
1459 | if (!navigatorObj && typeof navigator !== 'undefined') {
|
1460 |
|
1461 | navigatorObj = navigator;
|
1462 | }
|
1463 |
|
1464 | if (navigatorObj && navigatorObj.product === 'ReactNative') {
|
1465 | if (obj && _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(obj) === 'object' && typeof obj.uri === 'string') {
|
1466 | return true;
|
1467 | }
|
1468 |
|
1469 | return false;
|
1470 | }
|
1471 |
|
1472 | if (typeof File !== 'undefined' && obj instanceof File) {
|
1473 |
|
1474 | return true;
|
1475 | }
|
1476 |
|
1477 | if (typeof Blob !== 'undefined' && obj instanceof Blob) {
|
1478 |
|
1479 | return true;
|
1480 | }
|
1481 |
|
1482 | if (typeof buffer__WEBPACK_IMPORTED_MODULE_15__["Buffer"] !== 'undefined' && obj instanceof buffer__WEBPACK_IMPORTED_MODULE_15__["Buffer"]) {
|
1483 | return true;
|
1484 | }
|
1485 |
|
1486 | return obj !== null && _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(obj) === 'object' && typeof obj.pipe === 'function';
|
1487 | }
|
1488 |
|
1489 | function isArrayOfFile(obj, navigatorObj) {
|
1490 | return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default()(obj) && obj.some(function (v) {
|
1491 | return isFile(v, navigatorObj);
|
1492 | });
|
1493 | }
|
1494 |
|
1495 | var STYLE_SEPARATORS = {
|
1496 | form: ',',
|
1497 | spaceDelimited: '%20',
|
1498 | pipeDelimited: '|'
|
1499 | };
|
1500 | var SEPARATORS = {
|
1501 | csv: ',',
|
1502 | ssv: '%20',
|
1503 | tsv: '%09',
|
1504 | pipes: '|'
|
1505 | };
|
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 | function formatKeyValue(key, input) {
|
1515 | var skipEncoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
1516 | var collectionFormat = input.collectionFormat,
|
1517 | allowEmptyValue = input.allowEmptyValue,
|
1518 | serializationOption = input.serializationOption,
|
1519 | encoding = input.encoding;
|
1520 |
|
1521 | var value = _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(input) === 'object' && !_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default()(input) ? input.value : input;
|
1522 | var encodeFn = skipEncoding ? function (k) {
|
1523 | return k.toString();
|
1524 | } : function (k) {
|
1525 | return encodeURIComponent(k);
|
1526 | };
|
1527 | var encodedKey = encodeFn(key);
|
1528 |
|
1529 | if (typeof value === 'undefined' && allowEmptyValue) {
|
1530 | return [[encodedKey, '']];
|
1531 | }
|
1532 |
|
1533 |
|
1534 | if (isFile(value) || isArrayOfFile(value)) {
|
1535 | return [[encodedKey, value]];
|
1536 | }
|
1537 |
|
1538 |
|
1539 | if (serializationOption) {
|
1540 | return formatKeyValueBySerializationOption(key, value, skipEncoding, serializationOption);
|
1541 | }
|
1542 |
|
1543 |
|
1544 | if (encoding) {
|
1545 | if ([_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(encoding.style), _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(encoding.explode), _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(encoding.allowReserved)].some(function (type) {
|
1546 | return type !== 'undefined';
|
1547 | })) {
|
1548 | return formatKeyValueBySerializationOption(key, value, skipEncoding, lodash_pick__WEBPACK_IMPORTED_MODULE_13___default()(encoding, ['style', 'explode', 'allowReserved']));
|
1549 | }
|
1550 |
|
1551 | if (encoding.contentType) {
|
1552 | if (encoding.contentType === 'application/json') {
|
1553 |
|
1554 | var json = typeof value === 'string' ? value : _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_4___default()(value);
|
1555 | return [[encodedKey, encodeFn(json)]];
|
1556 | }
|
1557 |
|
1558 | return [[encodedKey, encodeFn(value.toString())]];
|
1559 | }
|
1560 |
|
1561 |
|
1562 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(value) !== 'object') {
|
1563 | return [[encodedKey, encodeFn(value)]];
|
1564 | }
|
1565 |
|
1566 |
|
1567 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default()(value) && value.every(function (v) {
|
1568 | return _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(v) !== 'object';
|
1569 | })) {
|
1570 | return [[encodedKey, value.map(encodeFn).join(',')]];
|
1571 | }
|
1572 |
|
1573 |
|
1574 | return [[encodedKey, encodeFn(_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_4___default()(value))]];
|
1575 | }
|
1576 |
|
1577 |
|
1578 |
|
1579 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(value) !== 'object') {
|
1580 | return [[encodedKey, encodeFn(value)]];
|
1581 | }
|
1582 |
|
1583 |
|
1584 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default()(value)) {
|
1585 | if (collectionFormat === 'multi') {
|
1586 |
|
1587 |
|
1588 | return [[encodedKey, value.map(encodeFn)]];
|
1589 | }
|
1590 |
|
1591 | return [[encodedKey, value.map(encodeFn).join(SEPARATORS[collectionFormat || 'csv'])]];
|
1592 | }
|
1593 |
|
1594 |
|
1595 | return [[encodedKey, '']];
|
1596 | }
|
1597 |
|
1598 | function formatKeyValueBySerializationOption(key, value, skipEncoding, serializationOption) {
|
1599 | var style = serializationOption.style || 'form';
|
1600 | var explode = typeof serializationOption.explode === 'undefined' ? style === 'form' : serializationOption.explode;
|
1601 |
|
1602 | var escape = skipEncoding ? false : serializationOption && serializationOption.allowReserved ? 'unsafe' : 'reserved';
|
1603 |
|
1604 | var encodeFn = function encodeFn(v) {
|
1605 | return Object(_execute_oas3_style_serializer__WEBPACK_IMPORTED_MODULE_17__["encodeDisallowedCharacters"])(v, {
|
1606 | escape: escape
|
1607 | });
|
1608 | };
|
1609 |
|
1610 | var encodeKeyFn = skipEncoding ? function (k) {
|
1611 | return k;
|
1612 | } : function (k) {
|
1613 | return Object(_execute_oas3_style_serializer__WEBPACK_IMPORTED_MODULE_17__["encodeDisallowedCharacters"])(k, {
|
1614 | escape: escape
|
1615 | });
|
1616 | };
|
1617 |
|
1618 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_6___default()(value) !== 'object') {
|
1619 | return [[encodeKeyFn(key), encodeFn(value)]];
|
1620 | }
|
1621 |
|
1622 |
|
1623 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default()(value)) {
|
1624 | if (explode) {
|
1625 |
|
1626 |
|
1627 | return [[encodeKeyFn(key), value.map(encodeFn)]];
|
1628 | }
|
1629 |
|
1630 | return [[encodeKeyFn(key), value.map(encodeFn).join(STYLE_SEPARATORS[style])]];
|
1631 | }
|
1632 |
|
1633 |
|
1634 | if (style === 'deepObject') {
|
1635 | return _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(value).map(function (valueKey) {
|
1636 | return [encodeKeyFn("".concat(key, "[").concat(valueKey, "]")), encodeFn(value[valueKey])];
|
1637 | });
|
1638 | }
|
1639 |
|
1640 | if (explode) {
|
1641 | return _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(value).map(function (valueKey) {
|
1642 | return [encodeKeyFn(valueKey), encodeFn(value[valueKey])];
|
1643 | });
|
1644 | }
|
1645 |
|
1646 | return [[encodeKeyFn(key), _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(value).map(function (valueKey) {
|
1647 | return ["".concat(encodeKeyFn(valueKey), ",").concat(encodeFn(value[valueKey]))];
|
1648 | }).join(',')]];
|
1649 | }
|
1650 |
|
1651 | function buildFormData(reqForm) {
|
1652 | |
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 | return _babel_runtime_corejs2_core_js_object_entries__WEBPACK_IMPORTED_MODULE_2___default()(reqForm).reduce(function (formData, _ref4) {
|
1660 | var _ref5 = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7___default()(_ref4, 2),
|
1661 | name = _ref5[0],
|
1662 | input = _ref5[1];
|
1663 |
|
1664 |
|
1665 | var _iterator = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_1___default()(formatKeyValue(name, input, true)),
|
1666 | _step;
|
1667 |
|
1668 | try {
|
1669 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
1670 | var _step$value = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7___default()(_step.value, 2),
|
1671 | key = _step$value[0],
|
1672 | value = _step$value[1];
|
1673 |
|
1674 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_5___default()(value)) {
|
1675 |
|
1676 | var _iterator2 = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_1___default()(value),
|
1677 | _step2;
|
1678 |
|
1679 | try {
|
1680 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
1681 | var v = _step2.value;
|
1682 | formData.append(key, v);
|
1683 | }
|
1684 | } catch (err) {
|
1685 | _iterator2.e(err);
|
1686 | } finally {
|
1687 | _iterator2.f();
|
1688 | }
|
1689 | } else {
|
1690 | formData.append(key, value);
|
1691 | }
|
1692 | }
|
1693 | } catch (err) {
|
1694 | _iterator.e(err);
|
1695 | } finally {
|
1696 | _iterator.f();
|
1697 | }
|
1698 |
|
1699 | return formData;
|
1700 | }, new _internal_form_data_monkey_patch__WEBPACK_IMPORTED_MODULE_16__["default"]());
|
1701 | }
|
1702 |
|
1703 |
|
1704 | function encodeFormOrQuery(data) {
|
1705 | |
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 | var encodedQuery = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(data).reduce(function (result, parameterName) {
|
1712 |
|
1713 | var _iterator3 = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_1___default()(formatKeyValue(parameterName, data[parameterName])),
|
1714 | _step3;
|
1715 |
|
1716 | try {
|
1717 | for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
1718 | var _step3$value = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7___default()(_step3.value, 2),
|
1719 | key = _step3$value[0],
|
1720 | value = _step3$value[1];
|
1721 |
|
1722 | result[key] = value;
|
1723 | }
|
1724 | } catch (err) {
|
1725 | _iterator3.e(err);
|
1726 | } finally {
|
1727 | _iterator3.f();
|
1728 | }
|
1729 |
|
1730 | return result;
|
1731 | }, {});
|
1732 |
|
1733 | return qs__WEBPACK_IMPORTED_MODULE_11___default.a.stringify(encodedQuery, {
|
1734 | encode: false,
|
1735 | indices: false
|
1736 | }) || '';
|
1737 | }
|
1738 |
|
1739 |
|
1740 | function mergeInQueryOrForm() {
|
1741 | var req = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1742 | var _req$url = req.url,
|
1743 | url = _req$url === void 0 ? '' : _req$url,
|
1744 | query = req.query,
|
1745 | form = req.form;
|
1746 |
|
1747 | var joinSearch = function joinSearch() {
|
1748 | for (var _len = arguments.length, strs = new Array(_len), _key = 0; _key < _len; _key++) {
|
1749 | strs[_key] = arguments[_key];
|
1750 | }
|
1751 |
|
1752 | var search = strs.filter(function (a) {
|
1753 | return a;
|
1754 | }).join('&');
|
1755 |
|
1756 | return search ? "?".concat(search) : '';
|
1757 | };
|
1758 |
|
1759 | if (form) {
|
1760 | var hasFile = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(form).some(function (key) {
|
1761 | var value = form[key].value;
|
1762 | return isFile(value) || isArrayOfFile(value);
|
1763 | });
|
1764 |
|
1765 | var contentType = req.headers['content-type'] || req.headers['Content-Type'];
|
1766 |
|
1767 | if (hasFile || /multipart\/form-data/i.test(contentType)) {
|
1768 | req.body = buildFormData(req.form);
|
1769 | } else {
|
1770 | req.body = encodeFormOrQuery(form);
|
1771 | }
|
1772 |
|
1773 | delete req.form;
|
1774 | }
|
1775 |
|
1776 | if (query) {
|
1777 | var _url$split = url.split('?'),
|
1778 | _url$split2 = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7___default()(_url$split, 2),
|
1779 | baseUrl = _url$split2[0],
|
1780 | oriSearch = _url$split2[1];
|
1781 |
|
1782 | var newStr = '';
|
1783 |
|
1784 | if (oriSearch) {
|
1785 | var oriQuery = qs__WEBPACK_IMPORTED_MODULE_11___default.a.parse(oriSearch);
|
1786 |
|
1787 | var keysToRemove = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(query);
|
1788 |
|
1789 | keysToRemove.forEach(function (key) {
|
1790 | return delete oriQuery[key];
|
1791 | });
|
1792 | newStr = qs__WEBPACK_IMPORTED_MODULE_11___default.a.stringify(oriQuery, {
|
1793 | encode: true
|
1794 | });
|
1795 | }
|
1796 |
|
1797 | var finalStr = joinSearch(newStr, encodeFormOrQuery(query));
|
1798 | req.url = baseUrl + finalStr;
|
1799 | delete req.query;
|
1800 | }
|
1801 |
|
1802 | return req;
|
1803 | }
|
1804 |
|
1805 | function makeHttp(httpFn, preFetch, postFetch) {
|
1806 | postFetch = postFetch || function (a) {
|
1807 | return a;
|
1808 | };
|
1809 |
|
1810 | preFetch = preFetch || function (a) {
|
1811 | return a;
|
1812 | };
|
1813 |
|
1814 | return function (req) {
|
1815 | if (typeof req === 'string') {
|
1816 | req = {
|
1817 | url: req
|
1818 | };
|
1819 | }
|
1820 |
|
1821 | self.mergeInQueryOrForm(req);
|
1822 | req = preFetch(req);
|
1823 | return postFetch(httpFn(req));
|
1824 | };
|
1825 | }
|
1826 |
|
1827 | }),
|
1828 |
|
1829 | (function(module, exports, __webpack_require__) {
|
1830 |
|
1831 | var anObject = __webpack_require__(12);
|
1832 | var IE8_DOM_DEFINE = __webpack_require__(119);
|
1833 | var toPrimitive = __webpack_require__(87);
|
1834 | var dP = Object.defineProperty;
|
1835 |
|
1836 | exports.f = __webpack_require__(16) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
1837 | anObject(O);
|
1838 | P = toPrimitive(P, true);
|
1839 | anObject(Attributes);
|
1840 | if (IE8_DOM_DEFINE) try {
|
1841 | return dP(O, P, Attributes);
|
1842 | } catch (e) { }
|
1843 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
1844 | if ('value' in Attributes) O[P] = Attributes.value;
|
1845 | return O;
|
1846 | };
|
1847 |
|
1848 |
|
1849 | }),
|
1850 |
|
1851 | (function(module, exports, __webpack_require__) {
|
1852 |
|
1853 | "use strict";
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 | var punycode = __webpack_require__(216);
|
1878 | var util = __webpack_require__(217);
|
1879 |
|
1880 | exports.parse = urlParse;
|
1881 | exports.resolve = urlResolve;
|
1882 | exports.resolveObject = urlResolveObject;
|
1883 | exports.format = urlFormat;
|
1884 |
|
1885 | exports.Url = Url;
|
1886 |
|
1887 | function Url() {
|
1888 | this.protocol = null;
|
1889 | this.slashes = null;
|
1890 | this.auth = null;
|
1891 | this.host = null;
|
1892 | this.port = null;
|
1893 | this.hostname = null;
|
1894 | this.hash = null;
|
1895 | this.search = null;
|
1896 | this.query = null;
|
1897 | this.pathname = null;
|
1898 | this.path = null;
|
1899 | this.href = null;
|
1900 | }
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 | var protocolPattern = /^([a-z0-9.+-]+:)/i,
|
1907 | portPattern = /:[0-9]*$/,
|
1908 |
|
1909 |
|
1910 | simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
1911 |
|
1912 |
|
1913 |
|
1914 | delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
|
1915 |
|
1916 |
|
1917 | unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
|
1918 |
|
1919 |
|
1920 | autoEscape = ['\''].concat(unwise),
|
1921 |
|
1922 |
|
1923 |
|
1924 |
|
1925 | nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
|
1926 | hostEndingChars = ['/', '?', '#'],
|
1927 | hostnameMaxLen = 255,
|
1928 | hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
|
1929 | hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
1930 |
|
1931 | unsafeProtocol = {
|
1932 | 'javascript': true,
|
1933 | 'javascript:': true
|
1934 | },
|
1935 |
|
1936 | hostlessProtocol = {
|
1937 | 'javascript': true,
|
1938 | 'javascript:': true
|
1939 | },
|
1940 |
|
1941 | slashedProtocol = {
|
1942 | 'http': true,
|
1943 | 'https': true,
|
1944 | 'ftp': true,
|
1945 | 'gopher': true,
|
1946 | 'file': true,
|
1947 | 'http:': true,
|
1948 | 'https:': true,
|
1949 | 'ftp:': true,
|
1950 | 'gopher:': true,
|
1951 | 'file:': true
|
1952 | },
|
1953 | querystring = __webpack_require__(218);
|
1954 |
|
1955 | function urlParse(url, parseQueryString, slashesDenoteHost) {
|
1956 | if (url && util.isObject(url) && url instanceof Url) return url;
|
1957 |
|
1958 | var u = new Url;
|
1959 | u.parse(url, parseQueryString, slashesDenoteHost);
|
1960 | return u;
|
1961 | }
|
1962 |
|
1963 | Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
1964 | if (!util.isString(url)) {
|
1965 | throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
|
1966 | }
|
1967 |
|
1968 |
|
1969 |
|
1970 |
|
1971 | var queryIndex = url.indexOf('?'),
|
1972 | splitter =
|
1973 | (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
|
1974 | uSplit = url.split(splitter),
|
1975 | slashRegex = /\\/g;
|
1976 | uSplit[0] = uSplit[0].replace(slashRegex, '/');
|
1977 | url = uSplit.join(splitter);
|
1978 |
|
1979 | var rest = url;
|
1980 |
|
1981 |
|
1982 |
|
1983 | rest = rest.trim();
|
1984 |
|
1985 | if (!slashesDenoteHost && url.split('#').length === 1) {
|
1986 |
|
1987 | var simplePath = simplePathPattern.exec(rest);
|
1988 | if (simplePath) {
|
1989 | this.path = rest;
|
1990 | this.href = rest;
|
1991 | this.pathname = simplePath[1];
|
1992 | if (simplePath[2]) {
|
1993 | this.search = simplePath[2];
|
1994 | if (parseQueryString) {
|
1995 | this.query = querystring.parse(this.search.substr(1));
|
1996 | } else {
|
1997 | this.query = this.search.substr(1);
|
1998 | }
|
1999 | } else if (parseQueryString) {
|
2000 | this.search = '';
|
2001 | this.query = {};
|
2002 | }
|
2003 | return this;
|
2004 | }
|
2005 | }
|
2006 |
|
2007 | var proto = protocolPattern.exec(rest);
|
2008 | if (proto) {
|
2009 | proto = proto[0];
|
2010 | var lowerProto = proto.toLowerCase();
|
2011 | this.protocol = lowerProto;
|
2012 | rest = rest.substr(proto.length);
|
2013 | }
|
2014 |
|
2015 |
|
2016 |
|
2017 |
|
2018 |
|
2019 | if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
2020 | var slashes = rest.substr(0, 2) === '//';
|
2021 | if (slashes && !(proto && hostlessProtocol[proto])) {
|
2022 | rest = rest.substr(2);
|
2023 | this.slashes = true;
|
2024 | }
|
2025 | }
|
2026 |
|
2027 | if (!hostlessProtocol[proto] &&
|
2028 | (slashes || (proto && !slashedProtocol[proto]))) {
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 | var hostEnd = -1;
|
2047 | for (var i = 0; i < hostEndingChars.length; i++) {
|
2048 | var hec = rest.indexOf(hostEndingChars[i]);
|
2049 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
2050 | hostEnd = hec;
|
2051 | }
|
2052 |
|
2053 |
|
2054 |
|
2055 | var auth, atSign;
|
2056 | if (hostEnd === -1) {
|
2057 |
|
2058 | atSign = rest.lastIndexOf('@');
|
2059 | } else {
|
2060 |
|
2061 |
|
2062 | atSign = rest.lastIndexOf('@', hostEnd);
|
2063 | }
|
2064 |
|
2065 |
|
2066 |
|
2067 | if (atSign !== -1) {
|
2068 | auth = rest.slice(0, atSign);
|
2069 | rest = rest.slice(atSign + 1);
|
2070 | this.auth = decodeURIComponent(auth);
|
2071 | }
|
2072 |
|
2073 |
|
2074 | hostEnd = -1;
|
2075 | for (var i = 0; i < nonHostChars.length; i++) {
|
2076 | var hec = rest.indexOf(nonHostChars[i]);
|
2077 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
2078 | hostEnd = hec;
|
2079 | }
|
2080 |
|
2081 | if (hostEnd === -1)
|
2082 | hostEnd = rest.length;
|
2083 |
|
2084 | this.host = rest.slice(0, hostEnd);
|
2085 | rest = rest.slice(hostEnd);
|
2086 |
|
2087 |
|
2088 | this.parseHost();
|
2089 |
|
2090 |
|
2091 |
|
2092 | this.hostname = this.hostname || '';
|
2093 |
|
2094 |
|
2095 |
|
2096 | var ipv6Hostname = this.hostname[0] === '[' &&
|
2097 | this.hostname[this.hostname.length - 1] === ']';
|
2098 |
|
2099 |
|
2100 | if (!ipv6Hostname) {
|
2101 | var hostparts = this.hostname.split(/\./);
|
2102 | for (var i = 0, l = hostparts.length; i < l; i++) {
|
2103 | var part = hostparts[i];
|
2104 | if (!part) continue;
|
2105 | if (!part.match(hostnamePartPattern)) {
|
2106 | var newpart = '';
|
2107 | for (var j = 0, k = part.length; j < k; j++) {
|
2108 | if (part.charCodeAt(j) > 127) {
|
2109 |
|
2110 |
|
2111 |
|
2112 | newpart += 'x';
|
2113 | } else {
|
2114 | newpart += part[j];
|
2115 | }
|
2116 | }
|
2117 |
|
2118 | if (!newpart.match(hostnamePartPattern)) {
|
2119 | var validParts = hostparts.slice(0, i);
|
2120 | var notHost = hostparts.slice(i + 1);
|
2121 | var bit = part.match(hostnamePartStart);
|
2122 | if (bit) {
|
2123 | validParts.push(bit[1]);
|
2124 | notHost.unshift(bit[2]);
|
2125 | }
|
2126 | if (notHost.length) {
|
2127 | rest = '/' + notHost.join('.') + rest;
|
2128 | }
|
2129 | this.hostname = validParts.join('.');
|
2130 | break;
|
2131 | }
|
2132 | }
|
2133 | }
|
2134 | }
|
2135 |
|
2136 | if (this.hostname.length > hostnameMaxLen) {
|
2137 | this.hostname = '';
|
2138 | } else {
|
2139 |
|
2140 | this.hostname = this.hostname.toLowerCase();
|
2141 | }
|
2142 |
|
2143 | if (!ipv6Hostname) {
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 | this.hostname = punycode.toASCII(this.hostname);
|
2149 | }
|
2150 |
|
2151 | var p = this.port ? ':' + this.port : '';
|
2152 | var h = this.hostname || '';
|
2153 | this.host = h + p;
|
2154 | this.href += this.host;
|
2155 |
|
2156 |
|
2157 |
|
2158 | if (ipv6Hostname) {
|
2159 | this.hostname = this.hostname.substr(1, this.hostname.length - 2);
|
2160 | if (rest[0] !== '/') {
|
2161 | rest = '/' + rest;
|
2162 | }
|
2163 | }
|
2164 | }
|
2165 |
|
2166 |
|
2167 |
|
2168 | if (!unsafeProtocol[lowerProto]) {
|
2169 |
|
2170 |
|
2171 |
|
2172 |
|
2173 | for (var i = 0, l = autoEscape.length; i < l; i++) {
|
2174 | var ae = autoEscape[i];
|
2175 | if (rest.indexOf(ae) === -1)
|
2176 | continue;
|
2177 | var esc = encodeURIComponent(ae);
|
2178 | if (esc === ae) {
|
2179 | esc = escape(ae);
|
2180 | }
|
2181 | rest = rest.split(ae).join(esc);
|
2182 | }
|
2183 | }
|
2184 |
|
2185 |
|
2186 |
|
2187 | var hash = rest.indexOf('#');
|
2188 | if (hash !== -1) {
|
2189 |
|
2190 | this.hash = rest.substr(hash);
|
2191 | rest = rest.slice(0, hash);
|
2192 | }
|
2193 | var qm = rest.indexOf('?');
|
2194 | if (qm !== -1) {
|
2195 | this.search = rest.substr(qm);
|
2196 | this.query = rest.substr(qm + 1);
|
2197 | if (parseQueryString) {
|
2198 | this.query = querystring.parse(this.query);
|
2199 | }
|
2200 | rest = rest.slice(0, qm);
|
2201 | } else if (parseQueryString) {
|
2202 |
|
2203 | this.search = '';
|
2204 | this.query = {};
|
2205 | }
|
2206 | if (rest) this.pathname = rest;
|
2207 | if (slashedProtocol[lowerProto] &&
|
2208 | this.hostname && !this.pathname) {
|
2209 | this.pathname = '/';
|
2210 | }
|
2211 |
|
2212 |
|
2213 | if (this.pathname || this.search) {
|
2214 | var p = this.pathname || '';
|
2215 | var s = this.search || '';
|
2216 | this.path = p + s;
|
2217 | }
|
2218 |
|
2219 |
|
2220 | this.href = this.format();
|
2221 | return this;
|
2222 | };
|
2223 |
|
2224 |
|
2225 | function urlFormat(obj) {
|
2226 |
|
2227 |
|
2228 |
|
2229 |
|
2230 | if (util.isString(obj)) obj = urlParse(obj);
|
2231 | if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
|
2232 | return obj.format();
|
2233 | }
|
2234 |
|
2235 | Url.prototype.format = function() {
|
2236 | var auth = this.auth || '';
|
2237 | if (auth) {
|
2238 | auth = encodeURIComponent(auth);
|
2239 | auth = auth.replace(/%3A/i, ':');
|
2240 | auth += '@';
|
2241 | }
|
2242 |
|
2243 | var protocol = this.protocol || '',
|
2244 | pathname = this.pathname || '',
|
2245 | hash = this.hash || '',
|
2246 | host = false,
|
2247 | query = '';
|
2248 |
|
2249 | if (this.host) {
|
2250 | host = auth + this.host;
|
2251 | } else if (this.hostname) {
|
2252 | host = auth + (this.hostname.indexOf(':') === -1 ?
|
2253 | this.hostname :
|
2254 | '[' + this.hostname + ']');
|
2255 | if (this.port) {
|
2256 | host += ':' + this.port;
|
2257 | }
|
2258 | }
|
2259 |
|
2260 | if (this.query &&
|
2261 | util.isObject(this.query) &&
|
2262 | Object.keys(this.query).length) {
|
2263 | query = querystring.stringify(this.query);
|
2264 | }
|
2265 |
|
2266 | var search = this.search || (query && ('?' + query)) || '';
|
2267 |
|
2268 | if (protocol && protocol.substr(-1) !== ':') protocol += ':';
|
2269 |
|
2270 |
|
2271 |
|
2272 | if (this.slashes ||
|
2273 | (!protocol || slashedProtocol[protocol]) && host !== false) {
|
2274 | host = '//' + (host || '');
|
2275 | if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
|
2276 | } else if (!host) {
|
2277 | host = '';
|
2278 | }
|
2279 |
|
2280 | if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
|
2281 | if (search && search.charAt(0) !== '?') search = '?' + search;
|
2282 |
|
2283 | pathname = pathname.replace(/[?#]/g, function(match) {
|
2284 | return encodeURIComponent(match);
|
2285 | });
|
2286 | search = search.replace('#', '%23');
|
2287 |
|
2288 | return protocol + host + pathname + search + hash;
|
2289 | };
|
2290 |
|
2291 | function urlResolve(source, relative) {
|
2292 | return urlParse(source, false, true).resolve(relative);
|
2293 | }
|
2294 |
|
2295 | Url.prototype.resolve = function(relative) {
|
2296 | return this.resolveObject(urlParse(relative, false, true)).format();
|
2297 | };
|
2298 |
|
2299 | function urlResolveObject(source, relative) {
|
2300 | if (!source) return relative;
|
2301 | return urlParse(source, false, true).resolveObject(relative);
|
2302 | }
|
2303 |
|
2304 | Url.prototype.resolveObject = function(relative) {
|
2305 | if (util.isString(relative)) {
|
2306 | var rel = new Url();
|
2307 | rel.parse(relative, false, true);
|
2308 | relative = rel;
|
2309 | }
|
2310 |
|
2311 | var result = new Url();
|
2312 | var tkeys = Object.keys(this);
|
2313 | for (var tk = 0; tk < tkeys.length; tk++) {
|
2314 | var tkey = tkeys[tk];
|
2315 | result[tkey] = this[tkey];
|
2316 | }
|
2317 |
|
2318 |
|
2319 |
|
2320 | result.hash = relative.hash;
|
2321 |
|
2322 |
|
2323 | if (relative.href === '') {
|
2324 | result.href = result.format();
|
2325 | return result;
|
2326 | }
|
2327 |
|
2328 |
|
2329 | if (relative.slashes && !relative.protocol) {
|
2330 |
|
2331 | var rkeys = Object.keys(relative);
|
2332 | for (var rk = 0; rk < rkeys.length; rk++) {
|
2333 | var rkey = rkeys[rk];
|
2334 | if (rkey !== 'protocol')
|
2335 | result[rkey] = relative[rkey];
|
2336 | }
|
2337 |
|
2338 |
|
2339 | if (slashedProtocol[result.protocol] &&
|
2340 | result.hostname && !result.pathname) {
|
2341 | result.path = result.pathname = '/';
|
2342 | }
|
2343 |
|
2344 | result.href = result.format();
|
2345 | return result;
|
2346 | }
|
2347 |
|
2348 | if (relative.protocol && relative.protocol !== result.protocol) {
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 | if (!slashedProtocol[relative.protocol]) {
|
2358 | var keys = Object.keys(relative);
|
2359 | for (var v = 0; v < keys.length; v++) {
|
2360 | var k = keys[v];
|
2361 | result[k] = relative[k];
|
2362 | }
|
2363 | result.href = result.format();
|
2364 | return result;
|
2365 | }
|
2366 |
|
2367 | result.protocol = relative.protocol;
|
2368 | if (!relative.host && !hostlessProtocol[relative.protocol]) {
|
2369 | var relPath = (relative.pathname || '').split('/');
|
2370 | while (relPath.length && !(relative.host = relPath.shift()));
|
2371 | if (!relative.host) relative.host = '';
|
2372 | if (!relative.hostname) relative.hostname = '';
|
2373 | if (relPath[0] !== '') relPath.unshift('');
|
2374 | if (relPath.length < 2) relPath.unshift('');
|
2375 | result.pathname = relPath.join('/');
|
2376 | } else {
|
2377 | result.pathname = relative.pathname;
|
2378 | }
|
2379 | result.search = relative.search;
|
2380 | result.query = relative.query;
|
2381 | result.host = relative.host || '';
|
2382 | result.auth = relative.auth;
|
2383 | result.hostname = relative.hostname || relative.host;
|
2384 | result.port = relative.port;
|
2385 |
|
2386 | if (result.pathname || result.search) {
|
2387 | var p = result.pathname || '';
|
2388 | var s = result.search || '';
|
2389 | result.path = p + s;
|
2390 | }
|
2391 | result.slashes = result.slashes || relative.slashes;
|
2392 | result.href = result.format();
|
2393 | return result;
|
2394 | }
|
2395 |
|
2396 | var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
|
2397 | isRelAbs = (
|
2398 | relative.host ||
|
2399 | relative.pathname && relative.pathname.charAt(0) === '/'
|
2400 | ),
|
2401 | mustEndAbs = (isRelAbs || isSourceAbs ||
|
2402 | (result.host && relative.pathname)),
|
2403 | removeAllDots = mustEndAbs,
|
2404 | srcPath = result.pathname && result.pathname.split('/') || [],
|
2405 | relPath = relative.pathname && relative.pathname.split('/') || [],
|
2406 | psychotic = result.protocol && !slashedProtocol[result.protocol];
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 | if (psychotic) {
|
2414 | result.hostname = '';
|
2415 | result.port = null;
|
2416 | if (result.host) {
|
2417 | if (srcPath[0] === '') srcPath[0] = result.host;
|
2418 | else srcPath.unshift(result.host);
|
2419 | }
|
2420 | result.host = '';
|
2421 | if (relative.protocol) {
|
2422 | relative.hostname = null;
|
2423 | relative.port = null;
|
2424 | if (relative.host) {
|
2425 | if (relPath[0] === '') relPath[0] = relative.host;
|
2426 | else relPath.unshift(relative.host);
|
2427 | }
|
2428 | relative.host = null;
|
2429 | }
|
2430 | mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
|
2431 | }
|
2432 |
|
2433 | if (isRelAbs) {
|
2434 |
|
2435 | result.host = (relative.host || relative.host === '') ?
|
2436 | relative.host : result.host;
|
2437 | result.hostname = (relative.hostname || relative.hostname === '') ?
|
2438 | relative.hostname : result.hostname;
|
2439 | result.search = relative.search;
|
2440 | result.query = relative.query;
|
2441 | srcPath = relPath;
|
2442 |
|
2443 | } else if (relPath.length) {
|
2444 |
|
2445 |
|
2446 | if (!srcPath) srcPath = [];
|
2447 | srcPath.pop();
|
2448 | srcPath = srcPath.concat(relPath);
|
2449 | result.search = relative.search;
|
2450 | result.query = relative.query;
|
2451 | } else if (!util.isNullOrUndefined(relative.search)) {
|
2452 |
|
2453 |
|
2454 |
|
2455 | if (psychotic) {
|
2456 | result.hostname = result.host = srcPath.shift();
|
2457 |
|
2458 |
|
2459 |
|
2460 | var authInHost = result.host && result.host.indexOf('@') > 0 ?
|
2461 | result.host.split('@') : false;
|
2462 | if (authInHost) {
|
2463 | result.auth = authInHost.shift();
|
2464 | result.host = result.hostname = authInHost.shift();
|
2465 | }
|
2466 | }
|
2467 | result.search = relative.search;
|
2468 | result.query = relative.query;
|
2469 |
|
2470 | if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
2471 | result.path = (result.pathname ? result.pathname : '') +
|
2472 | (result.search ? result.search : '');
|
2473 | }
|
2474 | result.href = result.format();
|
2475 | return result;
|
2476 | }
|
2477 |
|
2478 | if (!srcPath.length) {
|
2479 |
|
2480 |
|
2481 | result.pathname = null;
|
2482 |
|
2483 | if (result.search) {
|
2484 | result.path = '/' + result.search;
|
2485 | } else {
|
2486 | result.path = null;
|
2487 | }
|
2488 | result.href = result.format();
|
2489 | return result;
|
2490 | }
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 | var last = srcPath.slice(-1)[0];
|
2496 | var hasTrailingSlash = (
|
2497 | (result.host || relative.host || srcPath.length > 1) &&
|
2498 | (last === '.' || last === '..') || last === '');
|
2499 |
|
2500 |
|
2501 |
|
2502 | var up = 0;
|
2503 | for (var i = srcPath.length; i >= 0; i--) {
|
2504 | last = srcPath[i];
|
2505 | if (last === '.') {
|
2506 | srcPath.splice(i, 1);
|
2507 | } else if (last === '..') {
|
2508 | srcPath.splice(i, 1);
|
2509 | up++;
|
2510 | } else if (up) {
|
2511 | srcPath.splice(i, 1);
|
2512 | up--;
|
2513 | }
|
2514 | }
|
2515 |
|
2516 |
|
2517 | if (!mustEndAbs && !removeAllDots) {
|
2518 | for (; up--; up) {
|
2519 | srcPath.unshift('..');
|
2520 | }
|
2521 | }
|
2522 |
|
2523 | if (mustEndAbs && srcPath[0] !== '' &&
|
2524 | (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
|
2525 | srcPath.unshift('');
|
2526 | }
|
2527 |
|
2528 | if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
|
2529 | srcPath.push('');
|
2530 | }
|
2531 |
|
2532 | var isAbsolute = srcPath[0] === '' ||
|
2533 | (srcPath[0] && srcPath[0].charAt(0) === '/');
|
2534 |
|
2535 |
|
2536 | if (psychotic) {
|
2537 | result.hostname = result.host = isAbsolute ? '' :
|
2538 | srcPath.length ? srcPath.shift() : '';
|
2539 |
|
2540 |
|
2541 |
|
2542 | var authInHost = result.host && result.host.indexOf('@') > 0 ?
|
2543 | result.host.split('@') : false;
|
2544 | if (authInHost) {
|
2545 | result.auth = authInHost.shift();
|
2546 | result.host = result.hostname = authInHost.shift();
|
2547 | }
|
2548 | }
|
2549 |
|
2550 | mustEndAbs = mustEndAbs || (result.host && srcPath.length);
|
2551 |
|
2552 | if (mustEndAbs && !isAbsolute) {
|
2553 | srcPath.unshift('');
|
2554 | }
|
2555 |
|
2556 | if (!srcPath.length) {
|
2557 | result.pathname = null;
|
2558 | result.path = null;
|
2559 | } else {
|
2560 | result.pathname = srcPath.join('/');
|
2561 | }
|
2562 |
|
2563 |
|
2564 | if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
2565 | result.path = (result.pathname ? result.pathname : '') +
|
2566 | (result.search ? result.search : '');
|
2567 | }
|
2568 | result.auth = relative.auth || result.auth;
|
2569 | result.slashes = result.slashes || relative.slashes;
|
2570 | result.href = result.format();
|
2571 | return result;
|
2572 | };
|
2573 |
|
2574 | Url.prototype.parseHost = function() {
|
2575 | var host = this.host;
|
2576 | var port = portPattern.exec(host);
|
2577 | if (port) {
|
2578 | port = port[0];
|
2579 | if (port !== ':') {
|
2580 | this.port = port.substr(1);
|
2581 | }
|
2582 | host = host.substr(0, host.length - port.length);
|
2583 | }
|
2584 | if (host) this.hostname = host;
|
2585 | };
|
2586 |
|
2587 |
|
2588 | }),
|
2589 |
|
2590 | (function(module, exports, __webpack_require__) {
|
2591 |
|
2592 | var _getIterator = __webpack_require__(136);
|
2593 |
|
2594 | var _Array$isArray = __webpack_require__(0);
|
2595 |
|
2596 | var _Symbol$iterator = __webpack_require__(138);
|
2597 |
|
2598 | var _Symbol = __webpack_require__(70);
|
2599 |
|
2600 | var unsupportedIterableToArray = __webpack_require__(106);
|
2601 |
|
2602 | function _createForOfIteratorHelper(o, allowArrayLike) {
|
2603 | var it;
|
2604 |
|
2605 | if (typeof _Symbol === "undefined" || o[_Symbol$iterator] == null) {
|
2606 | if (_Array$isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
2607 | if (it) o = it;
|
2608 | var i = 0;
|
2609 |
|
2610 | var F = function F() {};
|
2611 |
|
2612 | return {
|
2613 | s: F,
|
2614 | n: function n() {
|
2615 | if (i >= o.length) return {
|
2616 | done: true
|
2617 | };
|
2618 | return {
|
2619 | done: false,
|
2620 | value: o[i++]
|
2621 | };
|
2622 | },
|
2623 | e: function e(_e) {
|
2624 | throw _e;
|
2625 | },
|
2626 | f: F
|
2627 | };
|
2628 | }
|
2629 |
|
2630 | throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
2631 | }
|
2632 |
|
2633 | var normalCompletion = true,
|
2634 | didErr = false,
|
2635 | err;
|
2636 | return {
|
2637 | s: function s() {
|
2638 | it = _getIterator(o);
|
2639 | },
|
2640 | n: function n() {
|
2641 | var step = it.next();
|
2642 | normalCompletion = step.done;
|
2643 | return step;
|
2644 | },
|
2645 | e: function e(_e2) {
|
2646 | didErr = true;
|
2647 | err = _e2;
|
2648 | },
|
2649 | f: function f() {
|
2650 | try {
|
2651 | if (!normalCompletion && it["return"] != null) it["return"]();
|
2652 | } finally {
|
2653 | if (didErr) throw err;
|
2654 | }
|
2655 | }
|
2656 | };
|
2657 | }
|
2658 |
|
2659 | module.exports = _createForOfIteratorHelper;
|
2660 |
|
2661 | }),
|
2662 |
|
2663 | (function(module, exports, __webpack_require__) {
|
2664 |
|
2665 | module.exports = __webpack_require__(246);
|
2666 |
|
2667 | }),
|
2668 |
|
2669 | (function(module, exports) {
|
2670 |
|
2671 | var hasOwnProperty = {}.hasOwnProperty;
|
2672 | module.exports = function (it, key) {
|
2673 | return hasOwnProperty.call(it, key);
|
2674 | };
|
2675 |
|
2676 |
|
2677 | }),
|
2678 |
|
2679 | (function(module, exports, __webpack_require__) {
|
2680 |
|
2681 |
|
2682 | var IObject = __webpack_require__(88);
|
2683 | var defined = __webpack_require__(89);
|
2684 | module.exports = function (it) {
|
2685 | return IObject(defined(it));
|
2686 | };
|
2687 |
|
2688 |
|
2689 | }),
|
2690 |
|
2691 | (function(module, __webpack_exports__, __webpack_require__) {
|
2692 |
|
2693 | "use strict";
|
2694 | __webpack_require__.r(__webpack_exports__);
|
2695 | __webpack_require__.d(__webpack_exports__, "default", function() { return mapSpec; });
|
2696 | __webpack_require__.d(__webpack_exports__, "SpecMap", function() { return SpecMap; });
|
2697 | __webpack_require__.d(__webpack_exports__, "plugins", function() { return plugins; });
|
2698 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
2699 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
|
2700 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
2701 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
|
2702 | var _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22);
|
2703 | var _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2__);
|
2704 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
|
2705 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3__);
|
2706 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
|
2707 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4__);
|
2708 | var _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21);
|
2709 | var _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_5__);
|
2710 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
2711 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6__);
|
2712 | var _babel_runtime_corejs2_core_js_object_create__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(79);
|
2713 | var _babel_runtime_corejs2_core_js_object_create__WEBPACK_IMPORTED_MODULE_7___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_create__WEBPACK_IMPORTED_MODULE_7__);
|
2714 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(10);
|
2715 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8__);
|
2716 | var _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(47);
|
2717 | var _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_9___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_9__);
|
2718 | var _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(38);
|
2719 | var _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_10___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_10__);
|
2720 | var lodash_find__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(165);
|
2721 | var lodash_find__WEBPACK_IMPORTED_MODULE_11___default = __webpack_require__.n(lodash_find__WEBPACK_IMPORTED_MODULE_11__);
|
2722 | var lodash_noop__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(117);
|
2723 | var lodash_noop__WEBPACK_IMPORTED_MODULE_12___default = __webpack_require__.n(lodash_noop__WEBPACK_IMPORTED_MODULE_12__);
|
2724 | var _lib__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(3);
|
2725 | var _lib_refs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(168);
|
2726 | var _lib_all_of__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(172);
|
2727 | var _lib_parameters__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(173);
|
2728 | var _lib_properties__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(174);
|
2729 | var _lib_context_tree__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(175);
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 | var HARD_LIMIT = 100;
|
2750 |
|
2751 | var SpecMap = function () {
|
2752 | _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_10___default()(SpecMap, null, [{
|
2753 | key: "getPluginName",
|
2754 | value: function getPluginName(plugin) {
|
2755 | return plugin.pluginName;
|
2756 | }
|
2757 | }, {
|
2758 | key: "getPatchesOfType",
|
2759 | value: function getPatchesOfType(patches, fn) {
|
2760 | return patches.filter(fn);
|
2761 | }
|
2762 | }]);
|
2763 |
|
2764 | function SpecMap(opts) {
|
2765 | var _this = this;
|
2766 |
|
2767 | _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_9___default()(this, SpecMap);
|
2768 |
|
2769 | _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8___default()(this, {
|
2770 | spec: '',
|
2771 | debugLevel: 'info',
|
2772 | plugins: [],
|
2773 | pluginHistory: {},
|
2774 | errors: [],
|
2775 | mutations: [],
|
2776 | promisedPatches: [],
|
2777 | state: {},
|
2778 | patches: [],
|
2779 | context: {},
|
2780 | contextTree: new _lib_context_tree__WEBPACK_IMPORTED_MODULE_18__["default"](),
|
2781 | showDebug: false,
|
2782 | allPatches: [],
|
2783 |
|
2784 | pluginProp: 'specMap',
|
2785 | libMethods: _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_corejs2_core_js_object_create__WEBPACK_IMPORTED_MODULE_7___default()(this), _lib__WEBPACK_IMPORTED_MODULE_13__["default"], {
|
2786 | getInstance: function getInstance() {
|
2787 | return _this;
|
2788 | }
|
2789 | }),
|
2790 | allowMetaPatches: false
|
2791 | }, opts);
|
2792 |
|
2793 |
|
2794 | this.get = this._get.bind(this);
|
2795 |
|
2796 | this.getContext = this._getContext.bind(this);
|
2797 |
|
2798 | this.hasRun = this._hasRun.bind(this);
|
2799 |
|
2800 | this.wrappedPlugins = this.plugins.map(this.wrapPlugin.bind(this)).filter(_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isFunction);
|
2801 |
|
2802 | this.patches.push(_lib__WEBPACK_IMPORTED_MODULE_13__["default"].add([], this.spec));
|
2803 | this.patches.push(_lib__WEBPACK_IMPORTED_MODULE_13__["default"].context([], this.context));
|
2804 | this.updatePatches(this.patches);
|
2805 | }
|
2806 |
|
2807 | _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_10___default()(SpecMap, [{
|
2808 | key: "debug",
|
2809 | value: function debug(level) {
|
2810 | if (this.debugLevel === level) {
|
2811 | var _console;
|
2812 |
|
2813 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
2814 | args[_key - 1] = arguments[_key];
|
2815 | }
|
2816 |
|
2817 | (_console = console).log.apply(_console, args);
|
2818 |
|
2819 | }
|
2820 | }
|
2821 | }, {
|
2822 | key: "verbose",
|
2823 | value: function verbose(header) {
|
2824 | if (this.debugLevel === 'verbose') {
|
2825 | var _console2;
|
2826 |
|
2827 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
2828 | args[_key2 - 1] = arguments[_key2];
|
2829 | }
|
2830 |
|
2831 | (_console2 = console).log.apply(_console2, ["[".concat(header, "] ")].concat(args));
|
2832 |
|
2833 | }
|
2834 | }
|
2835 | }, {
|
2836 | key: "wrapPlugin",
|
2837 | value: function wrapPlugin(plugin, name) {
|
2838 | var pathDiscriminator = this.pathDiscriminator;
|
2839 | var ctx = null;
|
2840 | var fn;
|
2841 |
|
2842 | if (plugin[this.pluginProp]) {
|
2843 | ctx = plugin;
|
2844 | fn = plugin[this.pluginProp];
|
2845 | } else if (_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isFunction(plugin)) {
|
2846 | fn = plugin;
|
2847 | } else if (_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isObject(plugin)) {
|
2848 | fn = createKeyBasedPlugin(plugin);
|
2849 | }
|
2850 |
|
2851 | return _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8___default()(fn.bind(ctx), {
|
2852 | pluginName: plugin.name || name,
|
2853 | isGenerator: _lib__WEBPACK_IMPORTED_MODULE_13__["default"].isGenerator(fn)
|
2854 | });
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 | function createKeyBasedPlugin(pluginObj) {
|
2860 | var isSubPath = function isSubPath(path, tested) {
|
2861 | if (!_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6___default()(path)) {
|
2862 | return true;
|
2863 | }
|
2864 |
|
2865 | return path.every(function (val, i) {
|
2866 | return val === tested[i];
|
2867 | });
|
2868 | };
|
2869 |
|
2870 | return _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function generator(patches, specmap) {
|
2871 | var _marked, refCache, _iterator, _step, patch, traverse;
|
2872 |
|
2873 | return _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function generator$(_context2) {
|
2874 | while (1) {
|
2875 | switch (_context2.prev = _context2.next) {
|
2876 | case 0:
|
2877 | traverse = function _traverse(obj, path, patch) {
|
2878 | var parentIndex, parent, indexOfFirstProperties, isRootProperties, traversed, _i, _Object$keys, key, val, updatedPath, isObj, objRef, isWithinPathDiscriminator;
|
2879 |
|
2880 | return _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function traverse$(_context) {
|
2881 | while (1) {
|
2882 | switch (_context.prev = _context.next) {
|
2883 | case 0:
|
2884 | if (_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isObject(obj)) {
|
2885 | _context.next = 6;
|
2886 | break;
|
2887 | }
|
2888 |
|
2889 | if (!(pluginObj.key === path[path.length - 1])) {
|
2890 | _context.next = 4;
|
2891 | break;
|
2892 | }
|
2893 |
|
2894 | _context.next = 4;
|
2895 | return pluginObj.plugin(obj, pluginObj.key, path, specmap);
|
2896 |
|
2897 | case 4:
|
2898 | _context.next = 30;
|
2899 | break;
|
2900 |
|
2901 | case 6:
|
2902 | parentIndex = path.length - 1;
|
2903 | parent = path[parentIndex];
|
2904 | indexOfFirstProperties = path.indexOf('properties');
|
2905 | isRootProperties = parent === 'properties' && parentIndex === indexOfFirstProperties;
|
2906 | traversed = specmap.allowMetaPatches && refCache[obj.$$ref];
|
2907 |
|
2908 | _i = 0, _Object$keys = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default()(obj);
|
2909 |
|
2910 | case 12:
|
2911 | if (!(_i < _Object$keys.length)) {
|
2912 | _context.next = 30;
|
2913 | break;
|
2914 | }
|
2915 |
|
2916 | key = _Object$keys[_i];
|
2917 | val = obj[key];
|
2918 | updatedPath = path.concat(key);
|
2919 | isObj = _lib__WEBPACK_IMPORTED_MODULE_13__["default"].isObject(val);
|
2920 | objRef = obj.$$ref;
|
2921 |
|
2922 | if (traversed) {
|
2923 | _context.next = 22;
|
2924 | break;
|
2925 | }
|
2926 |
|
2927 | if (!isObj) {
|
2928 | _context.next = 22;
|
2929 | break;
|
2930 | }
|
2931 |
|
2932 |
|
2933 | if (specmap.allowMetaPatches && objRef) {
|
2934 | refCache[objRef] = true;
|
2935 | }
|
2936 |
|
2937 | return _context.delegateYield(traverse(val, updatedPath, patch), "t0", 22);
|
2938 |
|
2939 | case 22:
|
2940 | if (!(!isRootProperties && key === pluginObj.key)) {
|
2941 | _context.next = 27;
|
2942 | break;
|
2943 | }
|
2944 |
|
2945 | isWithinPathDiscriminator = isSubPath(pathDiscriminator, path);
|
2946 |
|
2947 | if (!(!pathDiscriminator || isWithinPathDiscriminator)) {
|
2948 | _context.next = 27;
|
2949 | break;
|
2950 | }
|
2951 |
|
2952 | _context.next = 27;
|
2953 | return pluginObj.plugin(val, key, updatedPath, specmap, patch);
|
2954 |
|
2955 | case 27:
|
2956 | _i++;
|
2957 | _context.next = 12;
|
2958 | break;
|
2959 |
|
2960 | case 30:
|
2961 | case "end":
|
2962 | return _context.stop();
|
2963 | }
|
2964 | }
|
2965 | }, _marked);
|
2966 | };
|
2967 |
|
2968 | _marked = _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(traverse);
|
2969 | refCache = {};
|
2970 |
|
2971 | _iterator = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_5___default()(patches.filter(_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isAdditiveMutation));
|
2972 | _context2.prev = 4;
|
2973 |
|
2974 | _iterator.s();
|
2975 |
|
2976 | case 6:
|
2977 | if ((_step = _iterator.n()).done) {
|
2978 | _context2.next = 11;
|
2979 | break;
|
2980 | }
|
2981 |
|
2982 | patch = _step.value;
|
2983 | return _context2.delegateYield(traverse(patch.value, patch.path, patch), "t0", 9);
|
2984 |
|
2985 | case 9:
|
2986 | _context2.next = 6;
|
2987 | break;
|
2988 |
|
2989 | case 11:
|
2990 | _context2.next = 16;
|
2991 | break;
|
2992 |
|
2993 | case 13:
|
2994 | _context2.prev = 13;
|
2995 | _context2.t1 = _context2["catch"](4);
|
2996 |
|
2997 | _iterator.e(_context2.t1);
|
2998 |
|
2999 | case 16:
|
3000 | _context2.prev = 16;
|
3001 |
|
3002 | _iterator.f();
|
3003 |
|
3004 | return _context2.finish(16);
|
3005 |
|
3006 | case 19:
|
3007 | case "end":
|
3008 | return _context2.stop();
|
3009 | }
|
3010 | }
|
3011 | }, generator, null, [[4, 13, 16, 19]]);
|
3012 | });
|
3013 | }
|
3014 | }
|
3015 | }, {
|
3016 | key: "nextPlugin",
|
3017 | value: function nextPlugin() {
|
3018 | var _this2 = this;
|
3019 |
|
3020 |
|
3021 | return lodash_find__WEBPACK_IMPORTED_MODULE_11___default()(this.wrappedPlugins, function (plugin) {
|
3022 | var mutations = _this2.getMutationsForPlugin(plugin);
|
3023 |
|
3024 | return mutations.length > 0;
|
3025 | });
|
3026 | }
|
3027 | }, {
|
3028 | key: "nextPromisedPatch",
|
3029 | value: function nextPromisedPatch() {
|
3030 | if (this.promisedPatches.length > 0) {
|
3031 | return _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.race(this.promisedPatches.map(function (patch) {
|
3032 | return patch.value;
|
3033 | }));
|
3034 | }
|
3035 |
|
3036 | return undefined;
|
3037 | }
|
3038 | }, {
|
3039 | key: "getPluginHistory",
|
3040 | value: function getPluginHistory(plugin) {
|
3041 | var name = this.constructor.getPluginName(plugin);
|
3042 | return this.pluginHistory[name] || [];
|
3043 | }
|
3044 | }, {
|
3045 | key: "getPluginRunCount",
|
3046 | value: function getPluginRunCount(plugin) {
|
3047 | return this.getPluginHistory(plugin).length;
|
3048 | }
|
3049 | }, {
|
3050 | key: "getPluginHistoryTip",
|
3051 | value: function getPluginHistoryTip(plugin) {
|
3052 | var history = this.getPluginHistory(plugin);
|
3053 | var val = history && history[history.length - 1];
|
3054 | return val || {};
|
3055 | }
|
3056 | }, {
|
3057 | key: "getPluginMutationIndex",
|
3058 | value: function getPluginMutationIndex(plugin) {
|
3059 | var mi = this.getPluginHistoryTip(plugin).mutationIndex;
|
3060 | return typeof mi !== 'number' ? -1 : mi;
|
3061 | }
|
3062 | }, {
|
3063 | key: "updatePluginHistory",
|
3064 | value: function updatePluginHistory(plugin, val) {
|
3065 | var name = this.constructor.getPluginName(plugin);
|
3066 | this.pluginHistory[name] = this.pluginHistory[name] || [];
|
3067 | this.pluginHistory[name].push(val);
|
3068 | }
|
3069 | }, {
|
3070 | key: "updatePatches",
|
3071 | value: function updatePatches(patches) {
|
3072 | var _this3 = this;
|
3073 |
|
3074 | _lib__WEBPACK_IMPORTED_MODULE_13__["default"].normalizeArray(patches).forEach(function (patch) {
|
3075 | if (patch instanceof Error) {
|
3076 | _this3.errors.push(patch);
|
3077 |
|
3078 | return;
|
3079 | }
|
3080 |
|
3081 | try {
|
3082 | if (!_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isObject(patch)) {
|
3083 | _this3.debug('updatePatches', 'Got a non-object patch', patch);
|
3084 |
|
3085 | return;
|
3086 | }
|
3087 |
|
3088 | if (_this3.showDebug) {
|
3089 | _this3.allPatches.push(patch);
|
3090 | }
|
3091 |
|
3092 | if (_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isPromise(patch.value)) {
|
3093 | _this3.promisedPatches.push(patch);
|
3094 |
|
3095 | _this3.promisedPatchThen(patch);
|
3096 |
|
3097 | return;
|
3098 | }
|
3099 |
|
3100 | if (_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isContextPatch(patch)) {
|
3101 | _this3.setContext(patch.path, patch.value);
|
3102 |
|
3103 | return;
|
3104 | }
|
3105 |
|
3106 | if (_lib__WEBPACK_IMPORTED_MODULE_13__["default"].isMutation(patch)) {
|
3107 | _this3.updateMutations(patch);
|
3108 |
|
3109 | return;
|
3110 | }
|
3111 | } catch (e) {
|
3112 | console.error(e);
|
3113 |
|
3114 | _this3.errors.push(e);
|
3115 | }
|
3116 | });
|
3117 | }
|
3118 | }, {
|
3119 | key: "updateMutations",
|
3120 | value: function updateMutations(patch) {
|
3121 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(patch.value) === 'object' && !_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6___default()(patch.value) && this.allowMetaPatches) {
|
3122 | patch.value = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, patch.value);
|
3123 | }
|
3124 |
|
3125 | var result = _lib__WEBPACK_IMPORTED_MODULE_13__["default"].applyPatch(this.state, patch, {
|
3126 | allowMetaPatches: this.allowMetaPatches
|
3127 | });
|
3128 |
|
3129 | if (result) {
|
3130 | this.mutations.push(patch);
|
3131 | this.state = result;
|
3132 | }
|
3133 | }
|
3134 | }, {
|
3135 | key: "removePromisedPatch",
|
3136 | value: function removePromisedPatch(patch) {
|
3137 | var index = this.promisedPatches.indexOf(patch);
|
3138 |
|
3139 | if (index < 0) {
|
3140 | this.debug("Tried to remove a promisedPatch that isn't there!");
|
3141 | return;
|
3142 | }
|
3143 |
|
3144 | this.promisedPatches.splice(index, 1);
|
3145 | }
|
3146 | }, {
|
3147 | key: "promisedPatchThen",
|
3148 | value: function promisedPatchThen(patch) {
|
3149 | var _this4 = this;
|
3150 |
|
3151 | patch.value = patch.value.then(function (val) {
|
3152 | var promisedPatch = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, patch), {}, {
|
3153 | value: val
|
3154 | });
|
3155 |
|
3156 | _this4.removePromisedPatch(patch);
|
3157 |
|
3158 | _this4.updatePatches(promisedPatch);
|
3159 | }).catch(function (e) {
|
3160 | _this4.removePromisedPatch(patch);
|
3161 |
|
3162 | _this4.updatePatches(e);
|
3163 | });
|
3164 | return patch.value;
|
3165 | }
|
3166 | }, {
|
3167 | key: "getMutations",
|
3168 | value: function getMutations(from, to) {
|
3169 | from = from || 0;
|
3170 |
|
3171 | if (typeof to !== 'number') {
|
3172 | to = this.mutations.length;
|
3173 | }
|
3174 |
|
3175 | return this.mutations.slice(from, to);
|
3176 | }
|
3177 | }, {
|
3178 | key: "getCurrentMutations",
|
3179 | value: function getCurrentMutations() {
|
3180 | return this.getMutationsForPlugin(this.getCurrentPlugin());
|
3181 | }
|
3182 | }, {
|
3183 | key: "getMutationsForPlugin",
|
3184 | value: function getMutationsForPlugin(plugin) {
|
3185 | var tip = this.getPluginMutationIndex(plugin);
|
3186 | return this.getMutations(tip + 1);
|
3187 | }
|
3188 | }, {
|
3189 | key: "getCurrentPlugin",
|
3190 | value: function getCurrentPlugin() {
|
3191 | return this.currentPlugin;
|
3192 | }
|
3193 | }, {
|
3194 | key: "getLib",
|
3195 | value: function getLib() {
|
3196 | return this.libMethods;
|
3197 | }
|
3198 |
|
3199 | }, {
|
3200 | key: "_get",
|
3201 | value: function _get(path) {
|
3202 | return _lib__WEBPACK_IMPORTED_MODULE_13__["default"].getIn(this.state, path);
|
3203 | }
|
3204 |
|
3205 | }, {
|
3206 | key: "_getContext",
|
3207 | value: function _getContext(path) {
|
3208 | return this.contextTree.get(path);
|
3209 | }
|
3210 | }, {
|
3211 | key: "setContext",
|
3212 | value: function setContext(path, value) {
|
3213 | return this.contextTree.set(path, value);
|
3214 | }
|
3215 |
|
3216 | }, {
|
3217 | key: "_hasRun",
|
3218 | value: function _hasRun(count) {
|
3219 | var times = this.getPluginRunCount(this.getCurrentPlugin());
|
3220 | return times > (count || 0);
|
3221 | }
|
3222 | }, {
|
3223 | key: "dispatch",
|
3224 | value: function dispatch() {
|
3225 | var _this5 = this;
|
3226 |
|
3227 | var that = this;
|
3228 | var plugin = this.nextPlugin();
|
3229 |
|
3230 | if (!plugin) {
|
3231 | var nextPromise = this.nextPromisedPatch();
|
3232 |
|
3233 | if (nextPromise) {
|
3234 | return nextPromise.then(function () {
|
3235 | return _this5.dispatch();
|
3236 | }).catch(function () {
|
3237 | return _this5.dispatch();
|
3238 | });
|
3239 | }
|
3240 |
|
3241 |
|
3242 | var result = {
|
3243 | spec: this.state,
|
3244 | errors: this.errors
|
3245 | };
|
3246 |
|
3247 | if (this.showDebug) {
|
3248 | result.patches = this.allPatches;
|
3249 | }
|
3250 |
|
3251 | return _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.resolve(result);
|
3252 | }
|
3253 |
|
3254 |
|
3255 | that.pluginCount = that.pluginCount || {};
|
3256 | that.pluginCount[plugin] = (that.pluginCount[plugin] || 0) + 1;
|
3257 |
|
3258 | if (that.pluginCount[plugin] > HARD_LIMIT) {
|
3259 | return _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.resolve({
|
3260 | spec: that.state,
|
3261 | errors: that.errors.concat(new Error("We've reached a hard limit of ".concat(HARD_LIMIT, " plugin runs")))
|
3262 | });
|
3263 | }
|
3264 |
|
3265 |
|
3266 | if (plugin !== this.currentPlugin && this.promisedPatches.length) {
|
3267 | var promises = this.promisedPatches.map(function (p) {
|
3268 | return p.value;
|
3269 | });
|
3270 |
|
3271 | return _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.all(promises.map(function (promise) {
|
3272 | return promise.then(lodash_noop__WEBPACK_IMPORTED_MODULE_12___default.a, lodash_noop__WEBPACK_IMPORTED_MODULE_12___default.a);
|
3273 | })).then(function () {
|
3274 | return _this5.dispatch();
|
3275 | });
|
3276 | }
|
3277 |
|
3278 |
|
3279 | return executePlugin();
|
3280 |
|
3281 | function executePlugin() {
|
3282 | that.currentPlugin = plugin;
|
3283 | var mutations = that.getCurrentMutations();
|
3284 | var lastMutationIndex = that.mutations.length - 1;
|
3285 |
|
3286 | try {
|
3287 | if (plugin.isGenerator) {
|
3288 |
|
3289 | var _iterator2 = _babel_runtime_corejs2_helpers_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_5___default()(plugin(mutations, that.getLib())),
|
3290 | _step2;
|
3291 |
|
3292 | try {
|
3293 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
3294 | var yieldedPatches = _step2.value;
|
3295 | updatePatches(yieldedPatches);
|
3296 | }
|
3297 | } catch (err) {
|
3298 | _iterator2.e(err);
|
3299 | } finally {
|
3300 | _iterator2.f();
|
3301 | }
|
3302 | } else {
|
3303 | var newPatches = plugin(mutations, that.getLib());
|
3304 | updatePatches(newPatches);
|
3305 | }
|
3306 | } catch (e) {
|
3307 | console.error(e);
|
3308 |
|
3309 | updatePatches([_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_corejs2_core_js_object_create__WEBPACK_IMPORTED_MODULE_7___default()(e), {
|
3310 | plugin: plugin
|
3311 | })]);
|
3312 | } finally {
|
3313 | that.updatePluginHistory(plugin, {
|
3314 | mutationIndex: lastMutationIndex
|
3315 | });
|
3316 | }
|
3317 |
|
3318 | return that.dispatch();
|
3319 | }
|
3320 |
|
3321 | function updatePatches(patches) {
|
3322 | if (patches) {
|
3323 | patches = _lib__WEBPACK_IMPORTED_MODULE_13__["default"].fullyNormalizeArray(patches);
|
3324 | that.updatePatches(patches, plugin);
|
3325 | }
|
3326 | }
|
3327 | }
|
3328 | }]);
|
3329 |
|
3330 | return SpecMap;
|
3331 | }();
|
3332 |
|
3333 | function mapSpec(opts) {
|
3334 | return new SpecMap(opts).dispatch();
|
3335 | }
|
3336 | var plugins = {
|
3337 | refs: _lib_refs__WEBPACK_IMPORTED_MODULE_14__["default"],
|
3338 | allOf: _lib_all_of__WEBPACK_IMPORTED_MODULE_15__["default"],
|
3339 | parameters: _lib_parameters__WEBPACK_IMPORTED_MODULE_16__["default"],
|
3340 | properties: _lib_properties__WEBPACK_IMPORTED_MODULE_17__["default"]
|
3341 | };
|
3342 |
|
3343 |
|
3344 | }),
|
3345 |
|
3346 | (function(module, exports, __webpack_require__) {
|
3347 |
|
3348 |
|
3349 | var aFunction = __webpack_require__(33);
|
3350 | module.exports = function (fn, that, length) {
|
3351 | aFunction(fn);
|
3352 | if (that === undefined) return fn;
|
3353 | switch (length) {
|
3354 | case 1: return function (a) {
|
3355 | return fn.call(that, a);
|
3356 | };
|
3357 | case 2: return function (a, b) {
|
3358 | return fn.call(that, a, b);
|
3359 | };
|
3360 | case 3: return function (a, b, c) {
|
3361 | return fn.call(that, a, b, c);
|
3362 | };
|
3363 | }
|
3364 | return function (/* ...args */) {
|
3365 | return fn.apply(that, arguments);
|
3366 | };
|
3367 | };
|
3368 |
|
3369 |
|
3370 | }),
|
3371 |
|
3372 | (function(module, exports, __webpack_require__) {
|
3373 |
|
3374 | var dP = __webpack_require__(19);
|
3375 | var createDesc = __webpack_require__(49);
|
3376 | module.exports = __webpack_require__(16) ? function (object, key, value) {
|
3377 | return dP.f(object, key, createDesc(1, value));
|
3378 | } : function (object, key, value) {
|
3379 | object[key] = value;
|
3380 | return object;
|
3381 | };
|
3382 |
|
3383 |
|
3384 | }),
|
3385 |
|
3386 | (function(module, exports) {
|
3387 |
|
3388 | module.exports = function (exec) {
|
3389 | try {
|
3390 | return !!exec();
|
3391 | } catch (e) {
|
3392 | return true;
|
3393 | }
|
3394 | };
|
3395 |
|
3396 |
|
3397 | }),
|
3398 |
|
3399 | (function(module, exports, __webpack_require__) {
|
3400 |
|
3401 | "use strict";
|
3402 | (function(global) { |
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 | var base64 = __webpack_require__(269)
|
3413 | var ieee754 = __webpack_require__(270)
|
3414 | var isArray = __webpack_require__(271)
|
3415 |
|
3416 | exports.Buffer = Buffer
|
3417 | exports.SlowBuffer = SlowBuffer
|
3418 | exports.INSPECT_MAX_BYTES = 50
|
3419 |
|
3420 |
|
3421 |
|
3422 |
|
3423 |
|
3424 |
|
3425 |
|
3426 |
|
3427 |
|
3428 |
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 |
|
3438 |
|
3439 |
|
3440 |
|
3441 |
|
3442 |
|
3443 |
|
3444 | Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
|
3445 | ? global.TYPED_ARRAY_SUPPORT
|
3446 | : typedArraySupport()
|
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 | exports.kMaxLength = kMaxLength()
|
3452 |
|
3453 | function typedArraySupport () {
|
3454 | try {
|
3455 | var arr = new Uint8Array(1)
|
3456 | arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
|
3457 | return arr.foo() === 42 &&
|
3458 | typeof arr.subarray === 'function' &&
|
3459 | arr.subarray(1, 1).byteLength === 0
|
3460 | } catch (e) {
|
3461 | return false
|
3462 | }
|
3463 | }
|
3464 |
|
3465 | function kMaxLength () {
|
3466 | return Buffer.TYPED_ARRAY_SUPPORT
|
3467 | ? 0x7fffffff
|
3468 | : 0x3fffffff
|
3469 | }
|
3470 |
|
3471 | function createBuffer (that, length) {
|
3472 | if (kMaxLength() < length) {
|
3473 | throw new RangeError('Invalid typed array length')
|
3474 | }
|
3475 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
3476 |
|
3477 | that = new Uint8Array(length)
|
3478 | that.__proto__ = Buffer.prototype
|
3479 | } else {
|
3480 |
|
3481 | if (that === null) {
|
3482 | that = new Buffer(length)
|
3483 | }
|
3484 | that.length = length
|
3485 | }
|
3486 |
|
3487 | return that
|
3488 | }
|
3489 |
|
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 |
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 | function Buffer (arg, encodingOrOffset, length) {
|
3501 | if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
|
3502 | return new Buffer(arg, encodingOrOffset, length)
|
3503 | }
|
3504 |
|
3505 |
|
3506 | if (typeof arg === 'number') {
|
3507 | if (typeof encodingOrOffset === 'string') {
|
3508 | throw new Error(
|
3509 | 'If encoding is specified then the first argument must be a string'
|
3510 | )
|
3511 | }
|
3512 | return allocUnsafe(this, arg)
|
3513 | }
|
3514 | return from(this, arg, encodingOrOffset, length)
|
3515 | }
|
3516 |
|
3517 | Buffer.poolSize = 8192
|
3518 |
|
3519 |
|
3520 | Buffer._augment = function (arr) {
|
3521 | arr.__proto__ = Buffer.prototype
|
3522 | return arr
|
3523 | }
|
3524 |
|
3525 | function from (that, value, encodingOrOffset, length) {
|
3526 | if (typeof value === 'number') {
|
3527 | throw new TypeError('"value" argument must not be a number')
|
3528 | }
|
3529 |
|
3530 | if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
|
3531 | return fromArrayBuffer(that, value, encodingOrOffset, length)
|
3532 | }
|
3533 |
|
3534 | if (typeof value === 'string') {
|
3535 | return fromString(that, value, encodingOrOffset)
|
3536 | }
|
3537 |
|
3538 | return fromObject(that, value)
|
3539 | }
|
3540 |
|
3541 |
|
3542 |
|
3543 |
|
3544 |
|
3545 |
|
3546 |
|
3547 |
|
3548 |
|
3549 | Buffer.from = function (value, encodingOrOffset, length) {
|
3550 | return from(null, value, encodingOrOffset, length)
|
3551 | }
|
3552 |
|
3553 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
3554 | Buffer.prototype.__proto__ = Uint8Array.prototype
|
3555 | Buffer.__proto__ = Uint8Array
|
3556 | if (typeof Symbol !== 'undefined' && Symbol.species &&
|
3557 | Buffer[Symbol.species] === Buffer) {
|
3558 |
|
3559 | Object.defineProperty(Buffer, Symbol.species, {
|
3560 | value: null,
|
3561 | configurable: true
|
3562 | })
|
3563 | }
|
3564 | }
|
3565 |
|
3566 | function assertSize (size) {
|
3567 | if (typeof size !== 'number') {
|
3568 | throw new TypeError('"size" argument must be a number')
|
3569 | } else if (size < 0) {
|
3570 | throw new RangeError('"size" argument must not be negative')
|
3571 | }
|
3572 | }
|
3573 |
|
3574 | function alloc (that, size, fill, encoding) {
|
3575 | assertSize(size)
|
3576 | if (size <= 0) {
|
3577 | return createBuffer(that, size)
|
3578 | }
|
3579 | if (fill !== undefined) {
|
3580 |
|
3581 |
|
3582 |
|
3583 | return typeof encoding === 'string'
|
3584 | ? createBuffer(that, size).fill(fill, encoding)
|
3585 | : createBuffer(that, size).fill(fill)
|
3586 | }
|
3587 | return createBuffer(that, size)
|
3588 | }
|
3589 |
|
3590 |
|
3591 |
|
3592 |
|
3593 |
|
3594 | Buffer.alloc = function (size, fill, encoding) {
|
3595 | return alloc(null, size, fill, encoding)
|
3596 | }
|
3597 |
|
3598 | function allocUnsafe (that, size) {
|
3599 | assertSize(size)
|
3600 | that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
|
3601 | if (!Buffer.TYPED_ARRAY_SUPPORT) {
|
3602 | for (var i = 0; i < size; ++i) {
|
3603 | that[i] = 0
|
3604 | }
|
3605 | }
|
3606 | return that
|
3607 | }
|
3608 |
|
3609 |
|
3610 |
|
3611 |
|
3612 | Buffer.allocUnsafe = function (size) {
|
3613 | return allocUnsafe(null, size)
|
3614 | }
|
3615 |
|
3616 |
|
3617 |
|
3618 | Buffer.allocUnsafeSlow = function (size) {
|
3619 | return allocUnsafe(null, size)
|
3620 | }
|
3621 |
|
3622 | function fromString (that, string, encoding) {
|
3623 | if (typeof encoding !== 'string' || encoding === '') {
|
3624 | encoding = 'utf8'
|
3625 | }
|
3626 |
|
3627 | if (!Buffer.isEncoding(encoding)) {
|
3628 | throw new TypeError('"encoding" must be a valid string encoding')
|
3629 | }
|
3630 |
|
3631 | var length = byteLength(string, encoding) | 0
|
3632 | that = createBuffer(that, length)
|
3633 |
|
3634 | var actual = that.write(string, encoding)
|
3635 |
|
3636 | if (actual !== length) {
|
3637 |
|
3638 |
|
3639 |
|
3640 | that = that.slice(0, actual)
|
3641 | }
|
3642 |
|
3643 | return that
|
3644 | }
|
3645 |
|
3646 | function fromArrayLike (that, array) {
|
3647 | var length = array.length < 0 ? 0 : checked(array.length) | 0
|
3648 | that = createBuffer(that, length)
|
3649 | for (var i = 0; i < length; i += 1) {
|
3650 | that[i] = array[i] & 255
|
3651 | }
|
3652 | return that
|
3653 | }
|
3654 |
|
3655 | function fromArrayBuffer (that, array, byteOffset, length) {
|
3656 | array.byteLength
|
3657 |
|
3658 | if (byteOffset < 0 || array.byteLength < byteOffset) {
|
3659 | throw new RangeError('\'offset\' is out of bounds')
|
3660 | }
|
3661 |
|
3662 | if (array.byteLength < byteOffset + (length || 0)) {
|
3663 | throw new RangeError('\'length\' is out of bounds')
|
3664 | }
|
3665 |
|
3666 | if (byteOffset === undefined && length === undefined) {
|
3667 | array = new Uint8Array(array)
|
3668 | } else if (length === undefined) {
|
3669 | array = new Uint8Array(array, byteOffset)
|
3670 | } else {
|
3671 | array = new Uint8Array(array, byteOffset, length)
|
3672 | }
|
3673 |
|
3674 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
3675 |
|
3676 | that = array
|
3677 | that.__proto__ = Buffer.prototype
|
3678 | } else {
|
3679 |
|
3680 | that = fromArrayLike(that, array)
|
3681 | }
|
3682 | return that
|
3683 | }
|
3684 |
|
3685 | function fromObject (that, obj) {
|
3686 | if (Buffer.isBuffer(obj)) {
|
3687 | var len = checked(obj.length) | 0
|
3688 | that = createBuffer(that, len)
|
3689 |
|
3690 | if (that.length === 0) {
|
3691 | return that
|
3692 | }
|
3693 |
|
3694 | obj.copy(that, 0, 0, len)
|
3695 | return that
|
3696 | }
|
3697 |
|
3698 | if (obj) {
|
3699 | if ((typeof ArrayBuffer !== 'undefined' &&
|
3700 | obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
|
3701 | if (typeof obj.length !== 'number' || isnan(obj.length)) {
|
3702 | return createBuffer(that, 0)
|
3703 | }
|
3704 | return fromArrayLike(that, obj)
|
3705 | }
|
3706 |
|
3707 | if (obj.type === 'Buffer' && isArray(obj.data)) {
|
3708 | return fromArrayLike(that, obj.data)
|
3709 | }
|
3710 | }
|
3711 |
|
3712 | throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
|
3713 | }
|
3714 |
|
3715 | function checked (length) {
|
3716 |
|
3717 |
|
3718 | if (length >= kMaxLength()) {
|
3719 | throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
|
3720 | 'size: 0x' + kMaxLength().toString(16) + ' bytes')
|
3721 | }
|
3722 | return length | 0
|
3723 | }
|
3724 |
|
3725 | function SlowBuffer (length) {
|
3726 | if (+length != length) {
|
3727 | length = 0
|
3728 | }
|
3729 | return Buffer.alloc(+length)
|
3730 | }
|
3731 |
|
3732 | Buffer.isBuffer = function isBuffer (b) {
|
3733 | return !!(b != null && b._isBuffer)
|
3734 | }
|
3735 |
|
3736 | Buffer.compare = function compare (a, b) {
|
3737 | if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
|
3738 | throw new TypeError('Arguments must be Buffers')
|
3739 | }
|
3740 |
|
3741 | if (a === b) return 0
|
3742 |
|
3743 | var x = a.length
|
3744 | var y = b.length
|
3745 |
|
3746 | for (var i = 0, len = Math.min(x, y); i < len; ++i) {
|
3747 | if (a[i] !== b[i]) {
|
3748 | x = a[i]
|
3749 | y = b[i]
|
3750 | break
|
3751 | }
|
3752 | }
|
3753 |
|
3754 | if (x < y) return -1
|
3755 | if (y < x) return 1
|
3756 | return 0
|
3757 | }
|
3758 |
|
3759 | Buffer.isEncoding = function isEncoding (encoding) {
|
3760 | switch (String(encoding).toLowerCase()) {
|
3761 | case 'hex':
|
3762 | case 'utf8':
|
3763 | case 'utf-8':
|
3764 | case 'ascii':
|
3765 | case 'latin1':
|
3766 | case 'binary':
|
3767 | case 'base64':
|
3768 | case 'ucs2':
|
3769 | case 'ucs-2':
|
3770 | case 'utf16le':
|
3771 | case 'utf-16le':
|
3772 | return true
|
3773 | default:
|
3774 | return false
|
3775 | }
|
3776 | }
|
3777 |
|
3778 | Buffer.concat = function concat (list, length) {
|
3779 | if (!isArray(list)) {
|
3780 | throw new TypeError('"list" argument must be an Array of Buffers')
|
3781 | }
|
3782 |
|
3783 | if (list.length === 0) {
|
3784 | return Buffer.alloc(0)
|
3785 | }
|
3786 |
|
3787 | var i
|
3788 | if (length === undefined) {
|
3789 | length = 0
|
3790 | for (i = 0; i < list.length; ++i) {
|
3791 | length += list[i].length
|
3792 | }
|
3793 | }
|
3794 |
|
3795 | var buffer = Buffer.allocUnsafe(length)
|
3796 | var pos = 0
|
3797 | for (i = 0; i < list.length; ++i) {
|
3798 | var buf = list[i]
|
3799 | if (!Buffer.isBuffer(buf)) {
|
3800 | throw new TypeError('"list" argument must be an Array of Buffers')
|
3801 | }
|
3802 | buf.copy(buffer, pos)
|
3803 | pos += buf.length
|
3804 | }
|
3805 | return buffer
|
3806 | }
|
3807 |
|
3808 | function byteLength (string, encoding) {
|
3809 | if (Buffer.isBuffer(string)) {
|
3810 | return string.length
|
3811 | }
|
3812 | if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
|
3813 | (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
|
3814 | return string.byteLength
|
3815 | }
|
3816 | if (typeof string !== 'string') {
|
3817 | string = '' + string
|
3818 | }
|
3819 |
|
3820 | var len = string.length
|
3821 | if (len === 0) return 0
|
3822 |
|
3823 |
|
3824 | var loweredCase = false
|
3825 | for (;;) {
|
3826 | switch (encoding) {
|
3827 | case 'ascii':
|
3828 | case 'latin1':
|
3829 | case 'binary':
|
3830 | return len
|
3831 | case 'utf8':
|
3832 | case 'utf-8':
|
3833 | case undefined:
|
3834 | return utf8ToBytes(string).length
|
3835 | case 'ucs2':
|
3836 | case 'ucs-2':
|
3837 | case 'utf16le':
|
3838 | case 'utf-16le':
|
3839 | return len * 2
|
3840 | case 'hex':
|
3841 | return len >>> 1
|
3842 | case 'base64':
|
3843 | return base64ToBytes(string).length
|
3844 | default:
|
3845 | if (loweredCase) return utf8ToBytes(string).length
|
3846 | encoding = ('' + encoding).toLowerCase()
|
3847 | loweredCase = true
|
3848 | }
|
3849 | }
|
3850 | }
|
3851 | Buffer.byteLength = byteLength
|
3852 |
|
3853 | function slowToString (encoding, start, end) {
|
3854 | var loweredCase = false
|
3855 |
|
3856 |
|
3857 |
|
3858 |
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 | if (start === undefined || start < 0) {
|
3864 | start = 0
|
3865 | }
|
3866 |
|
3867 |
|
3868 | if (start > this.length) {
|
3869 | return ''
|
3870 | }
|
3871 |
|
3872 | if (end === undefined || end > this.length) {
|
3873 | end = this.length
|
3874 | }
|
3875 |
|
3876 | if (end <= 0) {
|
3877 | return ''
|
3878 | }
|
3879 |
|
3880 |
|
3881 | end >>>= 0
|
3882 | start >>>= 0
|
3883 |
|
3884 | if (end <= start) {
|
3885 | return ''
|
3886 | }
|
3887 |
|
3888 | if (!encoding) encoding = 'utf8'
|
3889 |
|
3890 | while (true) {
|
3891 | switch (encoding) {
|
3892 | case 'hex':
|
3893 | return hexSlice(this, start, end)
|
3894 |
|
3895 | case 'utf8':
|
3896 | case 'utf-8':
|
3897 | return utf8Slice(this, start, end)
|
3898 |
|
3899 | case 'ascii':
|
3900 | return asciiSlice(this, start, end)
|
3901 |
|
3902 | case 'latin1':
|
3903 | case 'binary':
|
3904 | return latin1Slice(this, start, end)
|
3905 |
|
3906 | case 'base64':
|
3907 | return base64Slice(this, start, end)
|
3908 |
|
3909 | case 'ucs2':
|
3910 | case 'ucs-2':
|
3911 | case 'utf16le':
|
3912 | case 'utf-16le':
|
3913 | return utf16leSlice(this, start, end)
|
3914 |
|
3915 | default:
|
3916 | if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
|
3917 | encoding = (encoding + '').toLowerCase()
|
3918 | loweredCase = true
|
3919 | }
|
3920 | }
|
3921 | }
|
3922 |
|
3923 |
|
3924 |
|
3925 | Buffer.prototype._isBuffer = true
|
3926 |
|
3927 | function swap (b, n, m) {
|
3928 | var i = b[n]
|
3929 | b[n] = b[m]
|
3930 | b[m] = i
|
3931 | }
|
3932 |
|
3933 | Buffer.prototype.swap16 = function swap16 () {
|
3934 | var len = this.length
|
3935 | if (len % 2 !== 0) {
|
3936 | throw new RangeError('Buffer size must be a multiple of 16-bits')
|
3937 | }
|
3938 | for (var i = 0; i < len; i += 2) {
|
3939 | swap(this, i, i + 1)
|
3940 | }
|
3941 | return this
|
3942 | }
|
3943 |
|
3944 | Buffer.prototype.swap32 = function swap32 () {
|
3945 | var len = this.length
|
3946 | if (len % 4 !== 0) {
|
3947 | throw new RangeError('Buffer size must be a multiple of 32-bits')
|
3948 | }
|
3949 | for (var i = 0; i < len; i += 4) {
|
3950 | swap(this, i, i + 3)
|
3951 | swap(this, i + 1, i + 2)
|
3952 | }
|
3953 | return this
|
3954 | }
|
3955 |
|
3956 | Buffer.prototype.swap64 = function swap64 () {
|
3957 | var len = this.length
|
3958 | if (len % 8 !== 0) {
|
3959 | throw new RangeError('Buffer size must be a multiple of 64-bits')
|
3960 | }
|
3961 | for (var i = 0; i < len; i += 8) {
|
3962 | swap(this, i, i + 7)
|
3963 | swap(this, i + 1, i + 6)
|
3964 | swap(this, i + 2, i + 5)
|
3965 | swap(this, i + 3, i + 4)
|
3966 | }
|
3967 | return this
|
3968 | }
|
3969 |
|
3970 | Buffer.prototype.toString = function toString () {
|
3971 | var length = this.length | 0
|
3972 | if (length === 0) return ''
|
3973 | if (arguments.length === 0) return utf8Slice(this, 0, length)
|
3974 | return slowToString.apply(this, arguments)
|
3975 | }
|
3976 |
|
3977 | Buffer.prototype.equals = function equals (b) {
|
3978 | if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
3979 | if (this === b) return true
|
3980 | return Buffer.compare(this, b) === 0
|
3981 | }
|
3982 |
|
3983 | Buffer.prototype.inspect = function inspect () {
|
3984 | var str = ''
|
3985 | var max = exports.INSPECT_MAX_BYTES
|
3986 | if (this.length > 0) {
|
3987 | str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
|
3988 | if (this.length > max) str += ' ... '
|
3989 | }
|
3990 | return '<Buffer ' + str + '>'
|
3991 | }
|
3992 |
|
3993 | Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
|
3994 | if (!Buffer.isBuffer(target)) {
|
3995 | throw new TypeError('Argument must be a Buffer')
|
3996 | }
|
3997 |
|
3998 | if (start === undefined) {
|
3999 | start = 0
|
4000 | }
|
4001 | if (end === undefined) {
|
4002 | end = target ? target.length : 0
|
4003 | }
|
4004 | if (thisStart === undefined) {
|
4005 | thisStart = 0
|
4006 | }
|
4007 | if (thisEnd === undefined) {
|
4008 | thisEnd = this.length
|
4009 | }
|
4010 |
|
4011 | if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
|
4012 | throw new RangeError('out of range index')
|
4013 | }
|
4014 |
|
4015 | if (thisStart >= thisEnd && start >= end) {
|
4016 | return 0
|
4017 | }
|
4018 | if (thisStart >= thisEnd) {
|
4019 | return -1
|
4020 | }
|
4021 | if (start >= end) {
|
4022 | return 1
|
4023 | }
|
4024 |
|
4025 | start >>>= 0
|
4026 | end >>>= 0
|
4027 | thisStart >>>= 0
|
4028 | thisEnd >>>= 0
|
4029 |
|
4030 | if (this === target) return 0
|
4031 |
|
4032 | var x = thisEnd - thisStart
|
4033 | var y = end - start
|
4034 | var len = Math.min(x, y)
|
4035 |
|
4036 | var thisCopy = this.slice(thisStart, thisEnd)
|
4037 | var targetCopy = target.slice(start, end)
|
4038 |
|
4039 | for (var i = 0; i < len; ++i) {
|
4040 | if (thisCopy[i] !== targetCopy[i]) {
|
4041 | x = thisCopy[i]
|
4042 | y = targetCopy[i]
|
4043 | break
|
4044 | }
|
4045 | }
|
4046 |
|
4047 | if (x < y) return -1
|
4048 | if (y < x) return 1
|
4049 | return 0
|
4050 | }
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 |
|
4061 | function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
|
4062 |
|
4063 | if (buffer.length === 0) return -1
|
4064 |
|
4065 |
|
4066 | if (typeof byteOffset === 'string') {
|
4067 | encoding = byteOffset
|
4068 | byteOffset = 0
|
4069 | } else if (byteOffset > 0x7fffffff) {
|
4070 | byteOffset = 0x7fffffff
|
4071 | } else if (byteOffset < -0x80000000) {
|
4072 | byteOffset = -0x80000000
|
4073 | }
|
4074 | byteOffset = +byteOffset
|
4075 | if (isNaN(byteOffset)) {
|
4076 |
|
4077 | byteOffset = dir ? 0 : (buffer.length - 1)
|
4078 | }
|
4079 |
|
4080 |
|
4081 | if (byteOffset < 0) byteOffset = buffer.length + byteOffset
|
4082 | if (byteOffset >= buffer.length) {
|
4083 | if (dir) return -1
|
4084 | else byteOffset = buffer.length - 1
|
4085 | } else if (byteOffset < 0) {
|
4086 | if (dir) byteOffset = 0
|
4087 | else return -1
|
4088 | }
|
4089 |
|
4090 |
|
4091 | if (typeof val === 'string') {
|
4092 | val = Buffer.from(val, encoding)
|
4093 | }
|
4094 |
|
4095 |
|
4096 | if (Buffer.isBuffer(val)) {
|
4097 |
|
4098 | if (val.length === 0) {
|
4099 | return -1
|
4100 | }
|
4101 | return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
|
4102 | } else if (typeof val === 'number') {
|
4103 | val = val & 0xFF
|
4104 | if (Buffer.TYPED_ARRAY_SUPPORT &&
|
4105 | typeof Uint8Array.prototype.indexOf === 'function') {
|
4106 | if (dir) {
|
4107 | return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
|
4108 | } else {
|
4109 | return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
|
4110 | }
|
4111 | }
|
4112 | return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
|
4113 | }
|
4114 |
|
4115 | throw new TypeError('val must be string, number or Buffer')
|
4116 | }
|
4117 |
|
4118 | function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
|
4119 | var indexSize = 1
|
4120 | var arrLength = arr.length
|
4121 | var valLength = val.length
|
4122 |
|
4123 | if (encoding !== undefined) {
|
4124 | encoding = String(encoding).toLowerCase()
|
4125 | if (encoding === 'ucs2' || encoding === 'ucs-2' ||
|
4126 | encoding === 'utf16le' || encoding === 'utf-16le') {
|
4127 | if (arr.length < 2 || val.length < 2) {
|
4128 | return -1
|
4129 | }
|
4130 | indexSize = 2
|
4131 | arrLength /= 2
|
4132 | valLength /= 2
|
4133 | byteOffset /= 2
|
4134 | }
|
4135 | }
|
4136 |
|
4137 | function read (buf, i) {
|
4138 | if (indexSize === 1) {
|
4139 | return buf[i]
|
4140 | } else {
|
4141 | return buf.readUInt16BE(i * indexSize)
|
4142 | }
|
4143 | }
|
4144 |
|
4145 | var i
|
4146 | if (dir) {
|
4147 | var foundIndex = -1
|
4148 | for (i = byteOffset; i < arrLength; i++) {
|
4149 | if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
4150 | if (foundIndex === -1) foundIndex = i
|
4151 | if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
|
4152 | } else {
|
4153 | if (foundIndex !== -1) i -= i - foundIndex
|
4154 | foundIndex = -1
|
4155 | }
|
4156 | }
|
4157 | } else {
|
4158 | if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
|
4159 | for (i = byteOffset; i >= 0; i--) {
|
4160 | var found = true
|
4161 | for (var j = 0; j < valLength; j++) {
|
4162 | if (read(arr, i + j) !== read(val, j)) {
|
4163 | found = false
|
4164 | break
|
4165 | }
|
4166 | }
|
4167 | if (found) return i
|
4168 | }
|
4169 | }
|
4170 |
|
4171 | return -1
|
4172 | }
|
4173 |
|
4174 | Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
|
4175 | return this.indexOf(val, byteOffset, encoding) !== -1
|
4176 | }
|
4177 |
|
4178 | Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
|
4179 | return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
|
4180 | }
|
4181 |
|
4182 | Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
|
4183 | return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
|
4184 | }
|
4185 |
|
4186 | function hexWrite (buf, string, offset, length) {
|
4187 | offset = Number(offset) || 0
|
4188 | var remaining = buf.length - offset
|
4189 | if (!length) {
|
4190 | length = remaining
|
4191 | } else {
|
4192 | length = Number(length)
|
4193 | if (length > remaining) {
|
4194 | length = remaining
|
4195 | }
|
4196 | }
|
4197 |
|
4198 |
|
4199 | var strLen = string.length
|
4200 | if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
|
4201 |
|
4202 | if (length > strLen / 2) {
|
4203 | length = strLen / 2
|
4204 | }
|
4205 | for (var i = 0; i < length; ++i) {
|
4206 | var parsed = parseInt(string.substr(i * 2, 2), 16)
|
4207 | if (isNaN(parsed)) return i
|
4208 | buf[offset + i] = parsed
|
4209 | }
|
4210 | return i
|
4211 | }
|
4212 |
|
4213 | function utf8Write (buf, string, offset, length) {
|
4214 | return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
|
4215 | }
|
4216 |
|
4217 | function asciiWrite (buf, string, offset, length) {
|
4218 | return blitBuffer(asciiToBytes(string), buf, offset, length)
|
4219 | }
|
4220 |
|
4221 | function latin1Write (buf, string, offset, length) {
|
4222 | return asciiWrite(buf, string, offset, length)
|
4223 | }
|
4224 |
|
4225 | function base64Write (buf, string, offset, length) {
|
4226 | return blitBuffer(base64ToBytes(string), buf, offset, length)
|
4227 | }
|
4228 |
|
4229 | function ucs2Write (buf, string, offset, length) {
|
4230 | return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
|
4231 | }
|
4232 |
|
4233 | Buffer.prototype.write = function write (string, offset, length, encoding) {
|
4234 |
|
4235 | if (offset === undefined) {
|
4236 | encoding = 'utf8'
|
4237 | length = this.length
|
4238 | offset = 0
|
4239 |
|
4240 | } else if (length === undefined && typeof offset === 'string') {
|
4241 | encoding = offset
|
4242 | length = this.length
|
4243 | offset = 0
|
4244 |
|
4245 | } else if (isFinite(offset)) {
|
4246 | offset = offset | 0
|
4247 | if (isFinite(length)) {
|
4248 | length = length | 0
|
4249 | if (encoding === undefined) encoding = 'utf8'
|
4250 | } else {
|
4251 | encoding = length
|
4252 | length = undefined
|
4253 | }
|
4254 |
|
4255 | } else {
|
4256 | throw new Error(
|
4257 | 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
|
4258 | )
|
4259 | }
|
4260 |
|
4261 | var remaining = this.length - offset
|
4262 | if (length === undefined || length > remaining) length = remaining
|
4263 |
|
4264 | if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
|
4265 | throw new RangeError('Attempt to write outside buffer bounds')
|
4266 | }
|
4267 |
|
4268 | if (!encoding) encoding = 'utf8'
|
4269 |
|
4270 | var loweredCase = false
|
4271 | for (;;) {
|
4272 | switch (encoding) {
|
4273 | case 'hex':
|
4274 | return hexWrite(this, string, offset, length)
|
4275 |
|
4276 | case 'utf8':
|
4277 | case 'utf-8':
|
4278 | return utf8Write(this, string, offset, length)
|
4279 |
|
4280 | case 'ascii':
|
4281 | return asciiWrite(this, string, offset, length)
|
4282 |
|
4283 | case 'latin1':
|
4284 | case 'binary':
|
4285 | return latin1Write(this, string, offset, length)
|
4286 |
|
4287 | case 'base64':
|
4288 |
|
4289 | return base64Write(this, string, offset, length)
|
4290 |
|
4291 | case 'ucs2':
|
4292 | case 'ucs-2':
|
4293 | case 'utf16le':
|
4294 | case 'utf-16le':
|
4295 | return ucs2Write(this, string, offset, length)
|
4296 |
|
4297 | default:
|
4298 | if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
|
4299 | encoding = ('' + encoding).toLowerCase()
|
4300 | loweredCase = true
|
4301 | }
|
4302 | }
|
4303 | }
|
4304 |
|
4305 | Buffer.prototype.toJSON = function toJSON () {
|
4306 | return {
|
4307 | type: 'Buffer',
|
4308 | data: Array.prototype.slice.call(this._arr || this, 0)
|
4309 | }
|
4310 | }
|
4311 |
|
4312 | function base64Slice (buf, start, end) {
|
4313 | if (start === 0 && end === buf.length) {
|
4314 | return base64.fromByteArray(buf)
|
4315 | } else {
|
4316 | return base64.fromByteArray(buf.slice(start, end))
|
4317 | }
|
4318 | }
|
4319 |
|
4320 | function utf8Slice (buf, start, end) {
|
4321 | end = Math.min(buf.length, end)
|
4322 | var res = []
|
4323 |
|
4324 | var i = start
|
4325 | while (i < end) {
|
4326 | var firstByte = buf[i]
|
4327 | var codePoint = null
|
4328 | var bytesPerSequence = (firstByte > 0xEF) ? 4
|
4329 | : (firstByte > 0xDF) ? 3
|
4330 | : (firstByte > 0xBF) ? 2
|
4331 | : 1
|
4332 |
|
4333 | if (i + bytesPerSequence <= end) {
|
4334 | var secondByte, thirdByte, fourthByte, tempCodePoint
|
4335 |
|
4336 | switch (bytesPerSequence) {
|
4337 | case 1:
|
4338 | if (firstByte < 0x80) {
|
4339 | codePoint = firstByte
|
4340 | }
|
4341 | break
|
4342 | case 2:
|
4343 | secondByte = buf[i + 1]
|
4344 | if ((secondByte & 0xC0) === 0x80) {
|
4345 | tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
|
4346 | if (tempCodePoint > 0x7F) {
|
4347 | codePoint = tempCodePoint
|
4348 | }
|
4349 | }
|
4350 | break
|
4351 | case 3:
|
4352 | secondByte = buf[i + 1]
|
4353 | thirdByte = buf[i + 2]
|
4354 | if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
|
4355 | tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
|
4356 | if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
|
4357 | codePoint = tempCodePoint
|
4358 | }
|
4359 | }
|
4360 | break
|
4361 | case 4:
|
4362 | secondByte = buf[i + 1]
|
4363 | thirdByte = buf[i + 2]
|
4364 | fourthByte = buf[i + 3]
|
4365 | if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
|
4366 | tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
|
4367 | if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
|
4368 | codePoint = tempCodePoint
|
4369 | }
|
4370 | }
|
4371 | }
|
4372 | }
|
4373 |
|
4374 | if (codePoint === null) {
|
4375 |
|
4376 |
|
4377 | codePoint = 0xFFFD
|
4378 | bytesPerSequence = 1
|
4379 | } else if (codePoint > 0xFFFF) {
|
4380 |
|
4381 | codePoint -= 0x10000
|
4382 | res.push(codePoint >>> 10 & 0x3FF | 0xD800)
|
4383 | codePoint = 0xDC00 | codePoint & 0x3FF
|
4384 | }
|
4385 |
|
4386 | res.push(codePoint)
|
4387 | i += bytesPerSequence
|
4388 | }
|
4389 |
|
4390 | return decodeCodePointsArray(res)
|
4391 | }
|
4392 |
|
4393 |
|
4394 |
|
4395 |
|
4396 | var MAX_ARGUMENTS_LENGTH = 0x1000
|
4397 |
|
4398 | function decodeCodePointsArray (codePoints) {
|
4399 | var len = codePoints.length
|
4400 | if (len <= MAX_ARGUMENTS_LENGTH) {
|
4401 | return String.fromCharCode.apply(String, codePoints)
|
4402 | }
|
4403 |
|
4404 |
|
4405 | var res = ''
|
4406 | var i = 0
|
4407 | while (i < len) {
|
4408 | res += String.fromCharCode.apply(
|
4409 | String,
|
4410 | codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
|
4411 | )
|
4412 | }
|
4413 | return res
|
4414 | }
|
4415 |
|
4416 | function asciiSlice (buf, start, end) {
|
4417 | var ret = ''
|
4418 | end = Math.min(buf.length, end)
|
4419 |
|
4420 | for (var i = start; i < end; ++i) {
|
4421 | ret += String.fromCharCode(buf[i] & 0x7F)
|
4422 | }
|
4423 | return ret
|
4424 | }
|
4425 |
|
4426 | function latin1Slice (buf, start, end) {
|
4427 | var ret = ''
|
4428 | end = Math.min(buf.length, end)
|
4429 |
|
4430 | for (var i = start; i < end; ++i) {
|
4431 | ret += String.fromCharCode(buf[i])
|
4432 | }
|
4433 | return ret
|
4434 | }
|
4435 |
|
4436 | function hexSlice (buf, start, end) {
|
4437 | var len = buf.length
|
4438 |
|
4439 | if (!start || start < 0) start = 0
|
4440 | if (!end || end < 0 || end > len) end = len
|
4441 |
|
4442 | var out = ''
|
4443 | for (var i = start; i < end; ++i) {
|
4444 | out += toHex(buf[i])
|
4445 | }
|
4446 | return out
|
4447 | }
|
4448 |
|
4449 | function utf16leSlice (buf, start, end) {
|
4450 | var bytes = buf.slice(start, end)
|
4451 | var res = ''
|
4452 | for (var i = 0; i < bytes.length; i += 2) {
|
4453 | res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
|
4454 | }
|
4455 | return res
|
4456 | }
|
4457 |
|
4458 | Buffer.prototype.slice = function slice (start, end) {
|
4459 | var len = this.length
|
4460 | start = ~~start
|
4461 | end = end === undefined ? len : ~~end
|
4462 |
|
4463 | if (start < 0) {
|
4464 | start += len
|
4465 | if (start < 0) start = 0
|
4466 | } else if (start > len) {
|
4467 | start = len
|
4468 | }
|
4469 |
|
4470 | if (end < 0) {
|
4471 | end += len
|
4472 | if (end < 0) end = 0
|
4473 | } else if (end > len) {
|
4474 | end = len
|
4475 | }
|
4476 |
|
4477 | if (end < start) end = start
|
4478 |
|
4479 | var newBuf
|
4480 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4481 | newBuf = this.subarray(start, end)
|
4482 | newBuf.__proto__ = Buffer.prototype
|
4483 | } else {
|
4484 | var sliceLen = end - start
|
4485 | newBuf = new Buffer(sliceLen, undefined)
|
4486 | for (var i = 0; i < sliceLen; ++i) {
|
4487 | newBuf[i] = this[i + start]
|
4488 | }
|
4489 | }
|
4490 |
|
4491 | return newBuf
|
4492 | }
|
4493 |
|
4494 |
|
4495 |
|
4496 |
|
4497 | function checkOffset (offset, ext, length) {
|
4498 | if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
|
4499 | if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
|
4500 | }
|
4501 |
|
4502 | Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
|
4503 | offset = offset | 0
|
4504 | byteLength = byteLength | 0
|
4505 | if (!noAssert) checkOffset(offset, byteLength, this.length)
|
4506 |
|
4507 | var val = this[offset]
|
4508 | var mul = 1
|
4509 | var i = 0
|
4510 | while (++i < byteLength && (mul *= 0x100)) {
|
4511 | val += this[offset + i] * mul
|
4512 | }
|
4513 |
|
4514 | return val
|
4515 | }
|
4516 |
|
4517 | Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
|
4518 | offset = offset | 0
|
4519 | byteLength = byteLength | 0
|
4520 | if (!noAssert) {
|
4521 | checkOffset(offset, byteLength, this.length)
|
4522 | }
|
4523 |
|
4524 | var val = this[offset + --byteLength]
|
4525 | var mul = 1
|
4526 | while (byteLength > 0 && (mul *= 0x100)) {
|
4527 | val += this[offset + --byteLength] * mul
|
4528 | }
|
4529 |
|
4530 | return val
|
4531 | }
|
4532 |
|
4533 | Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
|
4534 | if (!noAssert) checkOffset(offset, 1, this.length)
|
4535 | return this[offset]
|
4536 | }
|
4537 |
|
4538 | Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
|
4539 | if (!noAssert) checkOffset(offset, 2, this.length)
|
4540 | return this[offset] | (this[offset + 1] << 8)
|
4541 | }
|
4542 |
|
4543 | Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
|
4544 | if (!noAssert) checkOffset(offset, 2, this.length)
|
4545 | return (this[offset] << 8) | this[offset + 1]
|
4546 | }
|
4547 |
|
4548 | Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
|
4549 | if (!noAssert) checkOffset(offset, 4, this.length)
|
4550 |
|
4551 | return ((this[offset]) |
|
4552 | (this[offset + 1] << 8) |
|
4553 | (this[offset + 2] << 16)) +
|
4554 | (this[offset + 3] * 0x1000000)
|
4555 | }
|
4556 |
|
4557 | Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
|
4558 | if (!noAssert) checkOffset(offset, 4, this.length)
|
4559 |
|
4560 | return (this[offset] * 0x1000000) +
|
4561 | ((this[offset + 1] << 16) |
|
4562 | (this[offset + 2] << 8) |
|
4563 | this[offset + 3])
|
4564 | }
|
4565 |
|
4566 | Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
|
4567 | offset = offset | 0
|
4568 | byteLength = byteLength | 0
|
4569 | if (!noAssert) checkOffset(offset, byteLength, this.length)
|
4570 |
|
4571 | var val = this[offset]
|
4572 | var mul = 1
|
4573 | var i = 0
|
4574 | while (++i < byteLength && (mul *= 0x100)) {
|
4575 | val += this[offset + i] * mul
|
4576 | }
|
4577 | mul *= 0x80
|
4578 |
|
4579 | if (val >= mul) val -= Math.pow(2, 8 * byteLength)
|
4580 |
|
4581 | return val
|
4582 | }
|
4583 |
|
4584 | Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
|
4585 | offset = offset | 0
|
4586 | byteLength = byteLength | 0
|
4587 | if (!noAssert) checkOffset(offset, byteLength, this.length)
|
4588 |
|
4589 | var i = byteLength
|
4590 | var mul = 1
|
4591 | var val = this[offset + --i]
|
4592 | while (i > 0 && (mul *= 0x100)) {
|
4593 | val += this[offset + --i] * mul
|
4594 | }
|
4595 | mul *= 0x80
|
4596 |
|
4597 | if (val >= mul) val -= Math.pow(2, 8 * byteLength)
|
4598 |
|
4599 | return val
|
4600 | }
|
4601 |
|
4602 | Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
|
4603 | if (!noAssert) checkOffset(offset, 1, this.length)
|
4604 | if (!(this[offset] & 0x80)) return (this[offset])
|
4605 | return ((0xff - this[offset] + 1) * -1)
|
4606 | }
|
4607 |
|
4608 | Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
|
4609 | if (!noAssert) checkOffset(offset, 2, this.length)
|
4610 | var val = this[offset] | (this[offset + 1] << 8)
|
4611 | return (val & 0x8000) ? val | 0xFFFF0000 : val
|
4612 | }
|
4613 |
|
4614 | Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
|
4615 | if (!noAssert) checkOffset(offset, 2, this.length)
|
4616 | var val = this[offset + 1] | (this[offset] << 8)
|
4617 | return (val & 0x8000) ? val | 0xFFFF0000 : val
|
4618 | }
|
4619 |
|
4620 | Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
|
4621 | if (!noAssert) checkOffset(offset, 4, this.length)
|
4622 |
|
4623 | return (this[offset]) |
|
4624 | (this[offset + 1] << 8) |
|
4625 | (this[offset + 2] << 16) |
|
4626 | (this[offset + 3] << 24)
|
4627 | }
|
4628 |
|
4629 | Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
|
4630 | if (!noAssert) checkOffset(offset, 4, this.length)
|
4631 |
|
4632 | return (this[offset] << 24) |
|
4633 | (this[offset + 1] << 16) |
|
4634 | (this[offset + 2] << 8) |
|
4635 | (this[offset + 3])
|
4636 | }
|
4637 |
|
4638 | Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
|
4639 | if (!noAssert) checkOffset(offset, 4, this.length)
|
4640 | return ieee754.read(this, offset, true, 23, 4)
|
4641 | }
|
4642 |
|
4643 | Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
|
4644 | if (!noAssert) checkOffset(offset, 4, this.length)
|
4645 | return ieee754.read(this, offset, false, 23, 4)
|
4646 | }
|
4647 |
|
4648 | Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
|
4649 | if (!noAssert) checkOffset(offset, 8, this.length)
|
4650 | return ieee754.read(this, offset, true, 52, 8)
|
4651 | }
|
4652 |
|
4653 | Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
|
4654 | if (!noAssert) checkOffset(offset, 8, this.length)
|
4655 | return ieee754.read(this, offset, false, 52, 8)
|
4656 | }
|
4657 |
|
4658 | function checkInt (buf, value, offset, ext, max, min) {
|
4659 | if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
|
4660 | if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
|
4661 | if (offset + ext > buf.length) throw new RangeError('Index out of range')
|
4662 | }
|
4663 |
|
4664 | Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
|
4665 | value = +value
|
4666 | offset = offset | 0
|
4667 | byteLength = byteLength | 0
|
4668 | if (!noAssert) {
|
4669 | var maxBytes = Math.pow(2, 8 * byteLength) - 1
|
4670 | checkInt(this, value, offset, byteLength, maxBytes, 0)
|
4671 | }
|
4672 |
|
4673 | var mul = 1
|
4674 | var i = 0
|
4675 | this[offset] = value & 0xFF
|
4676 | while (++i < byteLength && (mul *= 0x100)) {
|
4677 | this[offset + i] = (value / mul) & 0xFF
|
4678 | }
|
4679 |
|
4680 | return offset + byteLength
|
4681 | }
|
4682 |
|
4683 | Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
|
4684 | value = +value
|
4685 | offset = offset | 0
|
4686 | byteLength = byteLength | 0
|
4687 | if (!noAssert) {
|
4688 | var maxBytes = Math.pow(2, 8 * byteLength) - 1
|
4689 | checkInt(this, value, offset, byteLength, maxBytes, 0)
|
4690 | }
|
4691 |
|
4692 | var i = byteLength - 1
|
4693 | var mul = 1
|
4694 | this[offset + i] = value & 0xFF
|
4695 | while (--i >= 0 && (mul *= 0x100)) {
|
4696 | this[offset + i] = (value / mul) & 0xFF
|
4697 | }
|
4698 |
|
4699 | return offset + byteLength
|
4700 | }
|
4701 |
|
4702 | Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
|
4703 | value = +value
|
4704 | offset = offset | 0
|
4705 | if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
|
4706 | if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
|
4707 | this[offset] = (value & 0xff)
|
4708 | return offset + 1
|
4709 | }
|
4710 |
|
4711 | function objectWriteUInt16 (buf, value, offset, littleEndian) {
|
4712 | if (value < 0) value = 0xffff + value + 1
|
4713 | for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
|
4714 | buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
|
4715 | (littleEndian ? i : 1 - i) * 8
|
4716 | }
|
4717 | }
|
4718 |
|
4719 | Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
|
4720 | value = +value
|
4721 | offset = offset | 0
|
4722 | if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
|
4723 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4724 | this[offset] = (value & 0xff)
|
4725 | this[offset + 1] = (value >>> 8)
|
4726 | } else {
|
4727 | objectWriteUInt16(this, value, offset, true)
|
4728 | }
|
4729 | return offset + 2
|
4730 | }
|
4731 |
|
4732 | Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
|
4733 | value = +value
|
4734 | offset = offset | 0
|
4735 | if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
|
4736 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4737 | this[offset] = (value >>> 8)
|
4738 | this[offset + 1] = (value & 0xff)
|
4739 | } else {
|
4740 | objectWriteUInt16(this, value, offset, false)
|
4741 | }
|
4742 | return offset + 2
|
4743 | }
|
4744 |
|
4745 | function objectWriteUInt32 (buf, value, offset, littleEndian) {
|
4746 | if (value < 0) value = 0xffffffff + value + 1
|
4747 | for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
|
4748 | buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
|
4749 | }
|
4750 | }
|
4751 |
|
4752 | Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
|
4753 | value = +value
|
4754 | offset = offset | 0
|
4755 | if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
|
4756 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4757 | this[offset + 3] = (value >>> 24)
|
4758 | this[offset + 2] = (value >>> 16)
|
4759 | this[offset + 1] = (value >>> 8)
|
4760 | this[offset] = (value & 0xff)
|
4761 | } else {
|
4762 | objectWriteUInt32(this, value, offset, true)
|
4763 | }
|
4764 | return offset + 4
|
4765 | }
|
4766 |
|
4767 | Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
|
4768 | value = +value
|
4769 | offset = offset | 0
|
4770 | if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
|
4771 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4772 | this[offset] = (value >>> 24)
|
4773 | this[offset + 1] = (value >>> 16)
|
4774 | this[offset + 2] = (value >>> 8)
|
4775 | this[offset + 3] = (value & 0xff)
|
4776 | } else {
|
4777 | objectWriteUInt32(this, value, offset, false)
|
4778 | }
|
4779 | return offset + 4
|
4780 | }
|
4781 |
|
4782 | Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
|
4783 | value = +value
|
4784 | offset = offset | 0
|
4785 | if (!noAssert) {
|
4786 | var limit = Math.pow(2, 8 * byteLength - 1)
|
4787 |
|
4788 | checkInt(this, value, offset, byteLength, limit - 1, -limit)
|
4789 | }
|
4790 |
|
4791 | var i = 0
|
4792 | var mul = 1
|
4793 | var sub = 0
|
4794 | this[offset] = value & 0xFF
|
4795 | while (++i < byteLength && (mul *= 0x100)) {
|
4796 | if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
|
4797 | sub = 1
|
4798 | }
|
4799 | this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
|
4800 | }
|
4801 |
|
4802 | return offset + byteLength
|
4803 | }
|
4804 |
|
4805 | Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
|
4806 | value = +value
|
4807 | offset = offset | 0
|
4808 | if (!noAssert) {
|
4809 | var limit = Math.pow(2, 8 * byteLength - 1)
|
4810 |
|
4811 | checkInt(this, value, offset, byteLength, limit - 1, -limit)
|
4812 | }
|
4813 |
|
4814 | var i = byteLength - 1
|
4815 | var mul = 1
|
4816 | var sub = 0
|
4817 | this[offset + i] = value & 0xFF
|
4818 | while (--i >= 0 && (mul *= 0x100)) {
|
4819 | if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
|
4820 | sub = 1
|
4821 | }
|
4822 | this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
|
4823 | }
|
4824 |
|
4825 | return offset + byteLength
|
4826 | }
|
4827 |
|
4828 | Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
|
4829 | value = +value
|
4830 | offset = offset | 0
|
4831 | if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
|
4832 | if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
|
4833 | if (value < 0) value = 0xff + value + 1
|
4834 | this[offset] = (value & 0xff)
|
4835 | return offset + 1
|
4836 | }
|
4837 |
|
4838 | Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
|
4839 | value = +value
|
4840 | offset = offset | 0
|
4841 | if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
|
4842 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4843 | this[offset] = (value & 0xff)
|
4844 | this[offset + 1] = (value >>> 8)
|
4845 | } else {
|
4846 | objectWriteUInt16(this, value, offset, true)
|
4847 | }
|
4848 | return offset + 2
|
4849 | }
|
4850 |
|
4851 | Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
|
4852 | value = +value
|
4853 | offset = offset | 0
|
4854 | if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
|
4855 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4856 | this[offset] = (value >>> 8)
|
4857 | this[offset + 1] = (value & 0xff)
|
4858 | } else {
|
4859 | objectWriteUInt16(this, value, offset, false)
|
4860 | }
|
4861 | return offset + 2
|
4862 | }
|
4863 |
|
4864 | Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
|
4865 | value = +value
|
4866 | offset = offset | 0
|
4867 | if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
|
4868 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4869 | this[offset] = (value & 0xff)
|
4870 | this[offset + 1] = (value >>> 8)
|
4871 | this[offset + 2] = (value >>> 16)
|
4872 | this[offset + 3] = (value >>> 24)
|
4873 | } else {
|
4874 | objectWriteUInt32(this, value, offset, true)
|
4875 | }
|
4876 | return offset + 4
|
4877 | }
|
4878 |
|
4879 | Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
|
4880 | value = +value
|
4881 | offset = offset | 0
|
4882 | if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
|
4883 | if (value < 0) value = 0xffffffff + value + 1
|
4884 | if (Buffer.TYPED_ARRAY_SUPPORT) {
|
4885 | this[offset] = (value >>> 24)
|
4886 | this[offset + 1] = (value >>> 16)
|
4887 | this[offset + 2] = (value >>> 8)
|
4888 | this[offset + 3] = (value & 0xff)
|
4889 | } else {
|
4890 | objectWriteUInt32(this, value, offset, false)
|
4891 | }
|
4892 | return offset + 4
|
4893 | }
|
4894 |
|
4895 | function checkIEEE754 (buf, value, offset, ext, max, min) {
|
4896 | if (offset + ext > buf.length) throw new RangeError('Index out of range')
|
4897 | if (offset < 0) throw new RangeError('Index out of range')
|
4898 | }
|
4899 |
|
4900 | function writeFloat (buf, value, offset, littleEndian, noAssert) {
|
4901 | if (!noAssert) {
|
4902 | checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
|
4903 | }
|
4904 | ieee754.write(buf, value, offset, littleEndian, 23, 4)
|
4905 | return offset + 4
|
4906 | }
|
4907 |
|
4908 | Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
|
4909 | return writeFloat(this, value, offset, true, noAssert)
|
4910 | }
|
4911 |
|
4912 | Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
|
4913 | return writeFloat(this, value, offset, false, noAssert)
|
4914 | }
|
4915 |
|
4916 | function writeDouble (buf, value, offset, littleEndian, noAssert) {
|
4917 | if (!noAssert) {
|
4918 | checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
|
4919 | }
|
4920 | ieee754.write(buf, value, offset, littleEndian, 52, 8)
|
4921 | return offset + 8
|
4922 | }
|
4923 |
|
4924 | Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
|
4925 | return writeDouble(this, value, offset, true, noAssert)
|
4926 | }
|
4927 |
|
4928 | Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
|
4929 | return writeDouble(this, value, offset, false, noAssert)
|
4930 | }
|
4931 |
|
4932 |
|
4933 | Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
4934 | if (!start) start = 0
|
4935 | if (!end && end !== 0) end = this.length
|
4936 | if (targetStart >= target.length) targetStart = target.length
|
4937 | if (!targetStart) targetStart = 0
|
4938 | if (end > 0 && end < start) end = start
|
4939 |
|
4940 |
|
4941 | if (end === start) return 0
|
4942 | if (target.length === 0 || this.length === 0) return 0
|
4943 |
|
4944 |
|
4945 | if (targetStart < 0) {
|
4946 | throw new RangeError('targetStart out of bounds')
|
4947 | }
|
4948 | if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
|
4949 | if (end < 0) throw new RangeError('sourceEnd out of bounds')
|
4950 |
|
4951 |
|
4952 | if (end > this.length) end = this.length
|
4953 | if (target.length - targetStart < end - start) {
|
4954 | end = target.length - targetStart + start
|
4955 | }
|
4956 |
|
4957 | var len = end - start
|
4958 | var i
|
4959 |
|
4960 | if (this === target && start < targetStart && targetStart < end) {
|
4961 |
|
4962 | for (i = len - 1; i >= 0; --i) {
|
4963 | target[i + targetStart] = this[i + start]
|
4964 | }
|
4965 | } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
|
4966 |
|
4967 | for (i = 0; i < len; ++i) {
|
4968 | target[i + targetStart] = this[i + start]
|
4969 | }
|
4970 | } else {
|
4971 | Uint8Array.prototype.set.call(
|
4972 | target,
|
4973 | this.subarray(start, start + len),
|
4974 | targetStart
|
4975 | )
|
4976 | }
|
4977 |
|
4978 | return len
|
4979 | }
|
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 | Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
4986 |
|
4987 | if (typeof val === 'string') {
|
4988 | if (typeof start === 'string') {
|
4989 | encoding = start
|
4990 | start = 0
|
4991 | end = this.length
|
4992 | } else if (typeof end === 'string') {
|
4993 | encoding = end
|
4994 | end = this.length
|
4995 | }
|
4996 | if (val.length === 1) {
|
4997 | var code = val.charCodeAt(0)
|
4998 | if (code < 256) {
|
4999 | val = code
|
5000 | }
|
5001 | }
|
5002 | if (encoding !== undefined && typeof encoding !== 'string') {
|
5003 | throw new TypeError('encoding must be a string')
|
5004 | }
|
5005 | if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
|
5006 | throw new TypeError('Unknown encoding: ' + encoding)
|
5007 | }
|
5008 | } else if (typeof val === 'number') {
|
5009 | val = val & 255
|
5010 | }
|
5011 |
|
5012 |
|
5013 | if (start < 0 || this.length < start || this.length < end) {
|
5014 | throw new RangeError('Out of range index')
|
5015 | }
|
5016 |
|
5017 | if (end <= start) {
|
5018 | return this
|
5019 | }
|
5020 |
|
5021 | start = start >>> 0
|
5022 | end = end === undefined ? this.length : end >>> 0
|
5023 |
|
5024 | if (!val) val = 0
|
5025 |
|
5026 | var i
|
5027 | if (typeof val === 'number') {
|
5028 | for (i = start; i < end; ++i) {
|
5029 | this[i] = val
|
5030 | }
|
5031 | } else {
|
5032 | var bytes = Buffer.isBuffer(val)
|
5033 | ? val
|
5034 | : utf8ToBytes(new Buffer(val, encoding).toString())
|
5035 | var len = bytes.length
|
5036 | for (i = 0; i < end - start; ++i) {
|
5037 | this[i + start] = bytes[i % len]
|
5038 | }
|
5039 | }
|
5040 |
|
5041 | return this
|
5042 | }
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 | var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
|
5048 |
|
5049 | function base64clean (str) {
|
5050 |
|
5051 | str = stringtrim(str).replace(INVALID_BASE64_RE, '')
|
5052 |
|
5053 | if (str.length < 2) return ''
|
5054 |
|
5055 | while (str.length % 4 !== 0) {
|
5056 | str = str + '='
|
5057 | }
|
5058 | return str
|
5059 | }
|
5060 |
|
5061 | function stringtrim (str) {
|
5062 | if (str.trim) return str.trim()
|
5063 | return str.replace(/^\s+|\s+$/g, '')
|
5064 | }
|
5065 |
|
5066 | function toHex (n) {
|
5067 | if (n < 16) return '0' + n.toString(16)
|
5068 | return n.toString(16)
|
5069 | }
|
5070 |
|
5071 | function utf8ToBytes (string, units) {
|
5072 | units = units || Infinity
|
5073 | var codePoint
|
5074 | var length = string.length
|
5075 | var leadSurrogate = null
|
5076 | var bytes = []
|
5077 |
|
5078 | for (var i = 0; i < length; ++i) {
|
5079 | codePoint = string.charCodeAt(i)
|
5080 |
|
5081 |
|
5082 | if (codePoint > 0xD7FF && codePoint < 0xE000) {
|
5083 |
|
5084 | if (!leadSurrogate) {
|
5085 |
|
5086 | if (codePoint > 0xDBFF) {
|
5087 |
|
5088 | if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
5089 | continue
|
5090 | } else if (i + 1 === length) {
|
5091 |
|
5092 | if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
5093 | continue
|
5094 | }
|
5095 |
|
5096 |
|
5097 | leadSurrogate = codePoint
|
5098 |
|
5099 | continue
|
5100 | }
|
5101 |
|
5102 |
|
5103 | if (codePoint < 0xDC00) {
|
5104 | if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
5105 | leadSurrogate = codePoint
|
5106 | continue
|
5107 | }
|
5108 |
|
5109 |
|
5110 | codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
|
5111 | } else if (leadSurrogate) {
|
5112 |
|
5113 | if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
5114 | }
|
5115 |
|
5116 | leadSurrogate = null
|
5117 |
|
5118 |
|
5119 | if (codePoint < 0x80) {
|
5120 | if ((units -= 1) < 0) break
|
5121 | bytes.push(codePoint)
|
5122 | } else if (codePoint < 0x800) {
|
5123 | if ((units -= 2) < 0) break
|
5124 | bytes.push(
|
5125 | codePoint >> 0x6 | 0xC0,
|
5126 | codePoint & 0x3F | 0x80
|
5127 | )
|
5128 | } else if (codePoint < 0x10000) {
|
5129 | if ((units -= 3) < 0) break
|
5130 | bytes.push(
|
5131 | codePoint >> 0xC | 0xE0,
|
5132 | codePoint >> 0x6 & 0x3F | 0x80,
|
5133 | codePoint & 0x3F | 0x80
|
5134 | )
|
5135 | } else if (codePoint < 0x110000) {
|
5136 | if ((units -= 4) < 0) break
|
5137 | bytes.push(
|
5138 | codePoint >> 0x12 | 0xF0,
|
5139 | codePoint >> 0xC & 0x3F | 0x80,
|
5140 | codePoint >> 0x6 & 0x3F | 0x80,
|
5141 | codePoint & 0x3F | 0x80
|
5142 | )
|
5143 | } else {
|
5144 | throw new Error('Invalid code point')
|
5145 | }
|
5146 | }
|
5147 |
|
5148 | return bytes
|
5149 | }
|
5150 |
|
5151 | function asciiToBytes (str) {
|
5152 | var byteArray = []
|
5153 | for (var i = 0; i < str.length; ++i) {
|
5154 |
|
5155 | byteArray.push(str.charCodeAt(i) & 0xFF)
|
5156 | }
|
5157 | return byteArray
|
5158 | }
|
5159 |
|
5160 | function utf16leToBytes (str, units) {
|
5161 | var c, hi, lo
|
5162 | var byteArray = []
|
5163 | for (var i = 0; i < str.length; ++i) {
|
5164 | if ((units -= 2) < 0) break
|
5165 |
|
5166 | c = str.charCodeAt(i)
|
5167 | hi = c >> 8
|
5168 | lo = c % 256
|
5169 | byteArray.push(lo)
|
5170 | byteArray.push(hi)
|
5171 | }
|
5172 |
|
5173 | return byteArray
|
5174 | }
|
5175 |
|
5176 | function base64ToBytes (str) {
|
5177 | return base64.toByteArray(base64clean(str))
|
5178 | }
|
5179 |
|
5180 | function blitBuffer (src, dst, offset, length) {
|
5181 | for (var i = 0; i < length; ++i) {
|
5182 | if ((i + offset >= dst.length) || (i >= src.length)) break
|
5183 | dst[i + offset] = src[i]
|
5184 | }
|
5185 | return i
|
5186 | }
|
5187 |
|
5188 | function isnan (val) {
|
5189 | return val !== val
|
5190 | }
|
5191 |
|
5192 | }.call(this, __webpack_require__(101)))
|
5193 |
|
5194 | }),
|
5195 |
|
5196 | (function(module, exports, __webpack_require__) {
|
5197 |
|
5198 | var baseGetTag = __webpack_require__(130),
|
5199 | isObject = __webpack_require__(35);
|
5200 |
|
5201 |
|
5202 | var asyncTag = '[object AsyncFunction]',
|
5203 | funcTag = '[object Function]',
|
5204 | genTag = '[object GeneratorFunction]',
|
5205 | proxyTag = '[object Proxy]';
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 |
|
5219 |
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 | function isFunction(value) {
|
5225 | if (!isObject(value)) {
|
5226 | return false;
|
5227 | }
|
5228 |
|
5229 |
|
5230 | var tag = baseGetTag(value);
|
5231 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
5232 | }
|
5233 |
|
5234 | module.exports = isFunction;
|
5235 |
|
5236 |
|
5237 | }),
|
5238 |
|
5239 | (function(module, exports, __webpack_require__) {
|
5240 |
|
5241 | var baseGet = __webpack_require__(152);
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 |
|
5251 |
|
5252 |
|
5253 |
|
5254 |
|
5255 |
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 | function get(object, path, defaultValue) {
|
5269 | var result = object == null ? undefined : baseGet(object, path);
|
5270 | return result === undefined ? defaultValue : result;
|
5271 | }
|
5272 |
|
5273 | module.exports = get;
|
5274 |
|
5275 |
|
5276 | /***/ }),
|
5277 | /* 32 */
|
5278 | /***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5279 |
|
5280 | "use strict";
|
5281 | __webpack_require__.r(__webpack_exports__);
|
5282 | __webpack_require__.d(__webpack_exports__, "encodeDisallowedCharacters", function() { return encodeDisallowedCharacters; });
|
5283 | __webpack_require__.d(__webpack_exports__, "default", function() { return stylize; });
|
5284 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
5285 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0__);
|
5286 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
5287 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
|
5288 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
5289 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__);
|
5290 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17);
|
5291 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__);
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 | var _require = __webpack_require__(29),
|
5298 | Buffer = _require.Buffer;
|
5299 |
|
5300 | var isRfc3986Reserved = function isRfc3986Reserved(char) {
|
5301 | return ":/?#[]@!$&'()*+,;=".indexOf(char) > -1;
|
5302 | };
|
5303 |
|
5304 | var isRrc3986Unreserved = function isRrc3986Unreserved(char) {
|
5305 | return /^[a-z0-9\-._~]+$/i.test(char);
|
5306 | };
|
5307 |
|
5308 | function encodeDisallowedCharacters(str) {
|
5309 | var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
5310 | escape = _ref.escape;
|
5311 |
|
5312 | var parse = arguments.length > 2 ? arguments[2] : undefined;
|
5313 |
|
5314 | if (typeof str === 'number') {
|
5315 | str = str.toString();
|
5316 | }
|
5317 |
|
5318 | if (typeof str !== 'string' || !str.length) {
|
5319 | return str;
|
5320 | }
|
5321 |
|
5322 | if (!escape) {
|
5323 | return str;
|
5324 | }
|
5325 |
|
5326 | if (parse) {
|
5327 | return JSON.parse(str);
|
5328 | }
|
5329 |
|
5330 |
|
5331 |
|
5332 |
|
5333 |
|
5334 | return _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3___default()(str).map(function (char) {
|
5335 | if (isRrc3986Unreserved(char)) {
|
5336 | return char;
|
5337 | }
|
5338 |
|
5339 | if (isRfc3986Reserved(char) && escape === 'unsafe') {
|
5340 | return char;
|
5341 | }
|
5342 |
|
5343 | var encoded = (Buffer.from(char).toJSON().data || []).map(function (byte) {
|
5344 | return "0".concat(byte.toString(16).toUpperCase()).slice(-2);
|
5345 | }).map(function (encodedByte) {
|
5346 | return "%".concat(encodedByte);
|
5347 | }).join('');
|
5348 | return encoded;
|
5349 | }).join('');
|
5350 | }
|
5351 | function stylize(config) {
|
5352 | var value = config.value;
|
5353 |
|
5354 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default()(value)) {
|
5355 | return encodeArray(config);
|
5356 | }
|
5357 |
|
5358 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(value) === 'object') {
|
5359 | return encodeObject(config);
|
5360 | }
|
5361 |
|
5362 | return encodePrimitive(config);
|
5363 | }
|
5364 |
|
5365 | function encodeArray(_ref2) {
|
5366 | var key = _ref2.key,
|
5367 | value = _ref2.value,
|
5368 | style = _ref2.style,
|
5369 | explode = _ref2.explode,
|
5370 | escape = _ref2.escape;
|
5371 |
|
5372 | var valueEncoder = function valueEncoder(str) {
|
5373 | return encodeDisallowedCharacters(str, {
|
5374 | escape: escape
|
5375 | });
|
5376 | };
|
5377 |
|
5378 | if (style === 'simple') {
|
5379 | return value.map(function (val) {
|
5380 | return valueEncoder(val);
|
5381 | }).join(',');
|
5382 | }
|
5383 |
|
5384 | if (style === 'label') {
|
5385 | return ".".concat(value.map(function (val) {
|
5386 | return valueEncoder(val);
|
5387 | }).join('.'));
|
5388 | }
|
5389 |
|
5390 | if (style === 'matrix') {
|
5391 | return value.map(function (val) {
|
5392 | return valueEncoder(val);
|
5393 | }).reduce(function (prev, curr) {
|
5394 | if (!prev || explode) {
|
5395 | return "".concat(prev || '', ";").concat(key, "=").concat(curr);
|
5396 | }
|
5397 |
|
5398 | return "".concat(prev, ",").concat(curr);
|
5399 | }, '');
|
5400 | }
|
5401 |
|
5402 | if (style === 'form') {
|
5403 | var after = explode ? "&".concat(key, "=") : ',';
|
5404 | return value.map(function (val) {
|
5405 | return valueEncoder(val);
|
5406 | }).join(after);
|
5407 | }
|
5408 |
|
5409 | if (style === 'spaceDelimited') {
|
5410 | var _after = explode ? "".concat(key, "=") : '';
|
5411 |
|
5412 | return value.map(function (val) {
|
5413 | return valueEncoder(val);
|
5414 | }).join(" ".concat(_after));
|
5415 | }
|
5416 |
|
5417 | if (style === 'pipeDelimited') {
|
5418 | var _after2 = explode ? "".concat(key, "=") : '';
|
5419 |
|
5420 | return value.map(function (val) {
|
5421 | return valueEncoder(val);
|
5422 | }).join("|".concat(_after2));
|
5423 | }
|
5424 |
|
5425 | return undefined;
|
5426 | }
|
5427 |
|
5428 | function encodeObject(_ref3) {
|
5429 | var key = _ref3.key,
|
5430 | value = _ref3.value,
|
5431 | style = _ref3.style,
|
5432 | explode = _ref3.explode,
|
5433 | escape = _ref3.escape;
|
5434 |
|
5435 | var valueEncoder = function valueEncoder(str) {
|
5436 | return encodeDisallowedCharacters(str, {
|
5437 | escape: escape
|
5438 | });
|
5439 | };
|
5440 |
|
5441 | var valueKeys = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(value);
|
5442 |
|
5443 | if (style === 'simple') {
|
5444 | return valueKeys.reduce(function (prev, curr) {
|
5445 | var val = valueEncoder(value[curr]);
|
5446 | var middleChar = explode ? '=' : ',';
|
5447 | var prefix = prev ? "".concat(prev, ",") : '';
|
5448 | return "".concat(prefix).concat(curr).concat(middleChar).concat(val);
|
5449 | }, '');
|
5450 | }
|
5451 |
|
5452 | if (style === 'label') {
|
5453 | return valueKeys.reduce(function (prev, curr) {
|
5454 | var val = valueEncoder(value[curr]);
|
5455 | var middleChar = explode ? '=' : '.';
|
5456 | var prefix = prev ? "".concat(prev, ".") : '.';
|
5457 | return "".concat(prefix).concat(curr).concat(middleChar).concat(val);
|
5458 | }, '');
|
5459 | }
|
5460 |
|
5461 | if (style === 'matrix' && explode) {
|
5462 | return valueKeys.reduce(function (prev, curr) {
|
5463 | var val = valueEncoder(value[curr]);
|
5464 | var prefix = prev ? "".concat(prev, ";") : ';';
|
5465 | return "".concat(prefix).concat(curr, "=").concat(val);
|
5466 | }, '');
|
5467 | }
|
5468 |
|
5469 | if (style === 'matrix') {
|
5470 |
|
5471 | return valueKeys.reduce(function (prev, curr) {
|
5472 | var val = valueEncoder(value[curr]);
|
5473 | var prefix = prev ? "".concat(prev, ",") : ";".concat(key, "=");
|
5474 | return "".concat(prefix).concat(curr, ",").concat(val);
|
5475 | }, '');
|
5476 | }
|
5477 |
|
5478 | if (style === 'form') {
|
5479 | return valueKeys.reduce(function (prev, curr) {
|
5480 | var val = valueEncoder(value[curr]);
|
5481 | var prefix = prev ? "".concat(prev).concat(explode ? '&' : ',') : '';
|
5482 | var separator = explode ? '=' : ',';
|
5483 | return "".concat(prefix).concat(curr).concat(separator).concat(val);
|
5484 | }, '');
|
5485 | }
|
5486 |
|
5487 | return undefined;
|
5488 | }
|
5489 |
|
5490 | function encodePrimitive(_ref4) {
|
5491 | var key = _ref4.key,
|
5492 | value = _ref4.value,
|
5493 | style = _ref4.style,
|
5494 | escape = _ref4.escape;
|
5495 |
|
5496 | var valueEncoder = function valueEncoder(str) {
|
5497 | return encodeDisallowedCharacters(str, {
|
5498 | escape: escape
|
5499 | });
|
5500 | };
|
5501 |
|
5502 | if (style === 'simple') {
|
5503 | return valueEncoder(value);
|
5504 | }
|
5505 |
|
5506 | if (style === 'label') {
|
5507 | return ".".concat(valueEncoder(value));
|
5508 | }
|
5509 |
|
5510 | if (style === 'matrix') {
|
5511 | return ";".concat(key, "=").concat(valueEncoder(value));
|
5512 | }
|
5513 |
|
5514 | if (style === 'form') {
|
5515 | return valueEncoder(value);
|
5516 | }
|
5517 |
|
5518 | if (style === 'deepObject') {
|
5519 | return valueEncoder(value, {}, true);
|
5520 | }
|
5521 |
|
5522 | return undefined;
|
5523 | }
|
5524 |
|
5525 | }),
|
5526 |
|
5527 | (function(module, exports) {
|
5528 |
|
5529 | module.exports = function (it) {
|
5530 | if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
5531 | return it;
|
5532 | };
|
5533 |
|
5534 |
|
5535 | }),
|
5536 |
|
5537 | (function(module, exports, __webpack_require__) {
|
5538 |
|
5539 |
|
5540 | var defined = __webpack_require__(89);
|
5541 | module.exports = function (it) {
|
5542 | return Object(defined(it));
|
5543 | };
|
5544 |
|
5545 |
|
5546 | }),
|
5547 |
|
5548 | (function(module, exports) {
|
5549 |
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 |
|
5560 |
|
5561 |
|
5562 |
|
5563 |
|
5564 |
|
5565 |
|
5566 |
|
5567 |
|
5568 |
|
5569 |
|
5570 |
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 | function isObject(value) {
|
5576 | var type = typeof value;
|
5577 | return value != null && (type == 'object' || type == 'function');
|
5578 | }
|
5579 |
|
5580 | module.exports = isObject;
|
5581 |
|
5582 |
|
5583 | }),
|
5584 |
|
5585 | (function(module, exports, __webpack_require__) {
|
5586 |
|
5587 | var assignValue = __webpack_require__(68),
|
5588 | copyObject = __webpack_require__(55),
|
5589 | createAssigner = __webpack_require__(207),
|
5590 | isArrayLike = __webpack_require__(129),
|
5591 | isPrototype = __webpack_require__(132),
|
5592 | keys = __webpack_require__(69);
|
5593 |
|
5594 |
|
5595 | var objectProto = Object.prototype;
|
5596 |
|
5597 |
|
5598 | var hasOwnProperty = objectProto.hasOwnProperty;
|
5599 |
|
5600 |
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 |
|
5607 |
|
5608 |
|
5609 |
|
5610 |
|
5611 |
|
5612 |
|
5613 |
|
5614 |
|
5615 |
|
5616 |
|
5617 |
|
5618 |
|
5619 |
|
5620 |
|
5621 |
|
5622 |
|
5623 |
|
5624 |
|
5625 |
|
5626 |
|
5627 |
|
5628 |
|
5629 |
|
5630 |
|
5631 |
|
5632 | var assign = createAssigner(function(object, source) {
|
5633 | if (isPrototype(source) || isArrayLike(source)) {
|
5634 | copyObject(source, keys(source), object);
|
5635 | return;
|
5636 | }
|
5637 | for (var key in source) {
|
5638 | if (hasOwnProperty.call(source, key)) {
|
5639 | assignValue(object, key, source[key]);
|
5640 | }
|
5641 | }
|
5642 | });
|
5643 |
|
5644 | module.exports = assign;
|
5645 |
|
5646 |
|
5647 | }),
|
5648 |
|
5649 | (function(module, exports, __webpack_require__) {
|
5650 |
|
5651 | module.exports = __webpack_require__(240);
|
5652 |
|
5653 | }),
|
5654 |
|
5655 | (function(module, exports, __webpack_require__) {
|
5656 |
|
5657 | var _Object$defineProperty = __webpack_require__(85);
|
5658 |
|
5659 | function _defineProperties(target, props) {
|
5660 | for (var i = 0; i < props.length; i++) {
|
5661 | var descriptor = props[i];
|
5662 | descriptor.enumerable = descriptor.enumerable || false;
|
5663 | descriptor.configurable = true;
|
5664 | if ("value" in descriptor) descriptor.writable = true;
|
5665 |
|
5666 | _Object$defineProperty(target, descriptor.key, descriptor);
|
5667 | }
|
5668 | }
|
5669 |
|
5670 | function _createClass(Constructor, protoProps, staticProps) {
|
5671 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
5672 | if (staticProps) _defineProperties(Constructor, staticProps);
|
5673 | return Constructor;
|
5674 | }
|
5675 |
|
5676 | module.exports = _createClass;
|
5677 |
|
5678 | }),
|
5679 |
|
5680 | (function(module, __webpack_exports__, __webpack_require__) {
|
5681 |
|
5682 | "use strict";
|
5683 | __webpack_require__.r(__webpack_exports__);
|
5684 | __webpack_require__.d(__webpack_exports__, "isFreelyNamed", function() { return isFreelyNamed; });
|
5685 | __webpack_require__.d(__webpack_exports__, "generateAbsoluteRefPatches", function() { return generateAbsoluteRefPatches; });
|
5686 | __webpack_require__.d(__webpack_exports__, "absolutifyPointer", function() { return absolutifyPointer; });
|
5687 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
|
5688 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
|
5689 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
|
5690 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__);
|
5691 | var traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171);
|
5692 | var traverse__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(traverse__WEBPACK_IMPORTED_MODULE_2__);
|
5693 | var url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
|
5694 | var url__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_3__);
|
5695 |
|
5696 |
|
5697 |
|
5698 |
|
5699 |
|
5700 | var freelyNamedKeyParents = ['properties'];
|
5701 |
|
5702 |
|
5703 | var nonFreelyNamedKeyGrandparents = ['properties'];
|
5704 |
|
5705 |
|
5706 |
|
5707 |
|
5708 | var freelyNamedPaths = [
|
5709 | 'definitions', 'parameters', 'responses', 'securityDefinitions',
|
5710 | 'components/schemas', 'components/responses', 'components/parameters', 'components/securitySchemes'];
|
5711 |
|
5712 |
|
5713 |
|
5714 |
|
5715 | var freelyNamedAncestors = ['schema/example', 'items/example'];
|
5716 | function isFreelyNamed(parentPath) {
|
5717 | var parentKey = parentPath[parentPath.length - 1];
|
5718 | var grandparentKey = parentPath[parentPath.length - 2];
|
5719 | var parentStr = parentPath.join('/');
|
5720 | return (
|
5721 | freelyNamedKeyParents.indexOf(parentKey) > -1 && nonFreelyNamedKeyGrandparents.indexOf(grandparentKey) === -1 || freelyNamedPaths.indexOf(parentStr) > -1 || freelyNamedAncestors.some(function (el) {
|
5722 | return parentStr.indexOf(el) > -1;
|
5723 | })
|
5724 | );
|
5725 | }
|
5726 | function generateAbsoluteRefPatches(obj, basePath) {
|
5727 | var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
5728 | specmap = _ref.specmap,
|
5729 | _ref$getBaseUrlForNod = _ref.getBaseUrlForNodePath,
|
5730 | getBaseUrlForNodePath = _ref$getBaseUrlForNod === void 0 ? function (path) {
|
5731 | return specmap.getContext([].concat(_babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default()(basePath), _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default()(path))).baseDoc;
|
5732 | } : _ref$getBaseUrlForNod,
|
5733 | _ref$targetKeys = _ref.targetKeys,
|
5734 | targetKeys = _ref$targetKeys === void 0 ? ['$ref', '$$ref'] : _ref$targetKeys;
|
5735 |
|
5736 | var patches = [];
|
5737 | traverse__WEBPACK_IMPORTED_MODULE_2___default()(obj).forEach(function callback() {
|
5738 | if (targetKeys.indexOf(this.key) > -1) {
|
5739 | var nodePath = this.path;
|
5740 |
|
5741 | var fullPath = basePath.concat(this.path);
|
5742 | var absolutifiedRefValue = absolutifyPointer(this.node, getBaseUrlForNodePath(nodePath));
|
5743 | patches.push(specmap.replace(fullPath, absolutifiedRefValue));
|
5744 | }
|
5745 | });
|
5746 | return patches;
|
5747 | }
|
5748 | function absolutifyPointer(pointer, baseUrl) {
|
5749 | var _pointer$split = pointer.split('#'),
|
5750 | _pointer$split2 = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_pointer$split, 2),
|
5751 | urlPart = _pointer$split2[0],
|
5752 | fragmentPart = _pointer$split2[1];
|
5753 |
|
5754 | var newRefUrlPart = url__WEBPACK_IMPORTED_MODULE_3___default.a.resolve(urlPart || '', baseUrl || '');
|
5755 | return fragmentPart ? "".concat(newRefUrlPart, "#").concat(fragmentPart) : newRefUrlPart;
|
5756 | }
|
5757 |
|
5758 | }),
|
5759 |
|
5760 | (function(module, exports, __webpack_require__) {
|
5761 |
|
5762 |
|
5763 | var $keys = __webpack_require__(121);
|
5764 | var enumBugKeys = __webpack_require__(93);
|
5765 |
|
5766 | module.exports = Object.keys || function keys(O) {
|
5767 | return $keys(O, enumBugKeys);
|
5768 | };
|
5769 |
|
5770 |
|
5771 | }),
|
5772 |
|
5773 | (function(module, exports) {
|
5774 |
|
5775 | module.exports = {};
|
5776 |
|
5777 |
|
5778 | }),
|
5779 |
|
5780 | (function(module, exports, __webpack_require__) {
|
5781 |
|
5782 | "use strict";
|
5783 |
|
5784 |
|
5785 |
|
5786 | function isNothing(subject) {
|
5787 | return (typeof subject === 'undefined') || (subject === null);
|
5788 | }
|
5789 |
|
5790 |
|
5791 | function isObject(subject) {
|
5792 | return (typeof subject === 'object') && (subject !== null);
|
5793 | }
|
5794 |
|
5795 |
|
5796 | function toArray(sequence) {
|
5797 | if (Array.isArray(sequence)) return sequence;
|
5798 | else if (isNothing(sequence)) return [];
|
5799 |
|
5800 | return [ sequence ];
|
5801 | }
|
5802 |
|
5803 |
|
5804 | function extend(target, source) {
|
5805 | var index, length, key, sourceKeys;
|
5806 |
|
5807 | if (source) {
|
5808 | sourceKeys = Object.keys(source);
|
5809 |
|
5810 | for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
5811 | key = sourceKeys[index];
|
5812 | target[key] = source[key];
|
5813 | }
|
5814 | }
|
5815 |
|
5816 | return target;
|
5817 | }
|
5818 |
|
5819 |
|
5820 | function repeat(string, count) {
|
5821 | var result = '', cycle;
|
5822 |
|
5823 | for (cycle = 0; cycle < count; cycle += 1) {
|
5824 | result += string;
|
5825 | }
|
5826 |
|
5827 | return result;
|
5828 | }
|
5829 |
|
5830 |
|
5831 | function isNegativeZero(number) {
|
5832 | return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
|
5833 | }
|
5834 |
|
5835 |
|
5836 | module.exports.isNothing = isNothing;
|
5837 | module.exports.isObject = isObject;
|
5838 | module.exports.toArray = toArray;
|
5839 | module.exports.repeat = repeat;
|
5840 | module.exports.isNegativeZero = isNegativeZero;
|
5841 | module.exports.extend = extend;
|
5842 |
|
5843 |
|
5844 | }),
|
5845 |
|
5846 | (function(module, exports, __webpack_require__) {
|
5847 |
|
5848 | "use strict";
|
5849 |
|
5850 |
|
5851 |
|
5852 |
|
5853 | var common = __webpack_require__(42);
|
5854 | var YAMLException = __webpack_require__(58);
|
5855 | var Type = __webpack_require__(8);
|
5856 |
|
5857 |
|
5858 | function compileList(schema, name, result) {
|
5859 | var exclude = [];
|
5860 |
|
5861 | schema.include.forEach(function (includedSchema) {
|
5862 | result = compileList(includedSchema, name, result);
|
5863 | });
|
5864 |
|
5865 | schema[name].forEach(function (currentType) {
|
5866 | result.forEach(function (previousType, previousIndex) {
|
5867 | if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
5868 | exclude.push(previousIndex);
|
5869 | }
|
5870 | });
|
5871 |
|
5872 | result.push(currentType);
|
5873 | });
|
5874 |
|
5875 | return result.filter(function (type, index) {
|
5876 | return exclude.indexOf(index) === -1;
|
5877 | });
|
5878 | }
|
5879 |
|
5880 |
|
5881 | function compileMap(/* lists... */) {
|
5882 | var result = {
|
5883 | scalar: {},
|
5884 | sequence: {},
|
5885 | mapping: {},
|
5886 | fallback: {}
|
5887 | }, index, length;
|
5888 |
|
5889 | function collectType(type) {
|
5890 | result[type.kind][type.tag] = result['fallback'][type.tag] = type;
|
5891 | }
|
5892 |
|
5893 | for (index = 0, length = arguments.length; index < length; index += 1) {
|
5894 | arguments[index].forEach(collectType);
|
5895 | }
|
5896 | return result;
|
5897 | }
|
5898 |
|
5899 |
|
5900 | function Schema(definition) {
|
5901 | this.include = definition.include || [];
|
5902 | this.implicit = definition.implicit || [];
|
5903 | this.explicit = definition.explicit || [];
|
5904 |
|
5905 | this.implicit.forEach(function (type) {
|
5906 | if (type.loadKind && type.loadKind !== 'scalar') {
|
5907 | throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
|
5908 | }
|
5909 | });
|
5910 |
|
5911 | this.compiledImplicit = compileList(this, 'implicit', []);
|
5912 | this.compiledExplicit = compileList(this, 'explicit', []);
|
5913 | this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
|
5914 | }
|
5915 |
|
5916 |
|
5917 | Schema.DEFAULT = null;
|
5918 |
|
5919 |
|
5920 | Schema.create = function createSchema() {
|
5921 | var schemas, types;
|
5922 |
|
5923 | switch (arguments.length) {
|
5924 | case 1:
|
5925 | schemas = Schema.DEFAULT;
|
5926 | types = arguments[0];
|
5927 | break;
|
5928 |
|
5929 | case 2:
|
5930 | schemas = arguments[0];
|
5931 | types = arguments[1];
|
5932 | break;
|
5933 |
|
5934 | default:
|
5935 | throw new YAMLException('Wrong number of arguments for Schema.create function');
|
5936 | }
|
5937 |
|
5938 | schemas = common.toArray(schemas);
|
5939 | types = common.toArray(types);
|
5940 |
|
5941 | if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
|
5942 | throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
|
5943 | }
|
5944 |
|
5945 | if (!types.every(function (type) { return type instanceof Type; })) {
|
5946 | throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
|
5947 | }
|
5948 |
|
5949 | return new Schema({
|
5950 | include: schemas,
|
5951 | explicit: types
|
5952 | });
|
5953 | };
|
5954 |
|
5955 |
|
5956 | module.exports = Schema;
|
5957 |
|
5958 |
|
5959 | }),
|
5960 |
|
5961 | (function(module, exports) {
|
5962 |
|
5963 |
|
5964 |
|
5965 |
|
5966 |
|
5967 |
|
5968 |
|
5969 |
|
5970 |
|
5971 |
|
5972 |
|
5973 |
|
5974 |
|
5975 |
|
5976 |
|
5977 |
|
5978 |
|
5979 |
|
5980 |
|
5981 |
|
5982 |
|
5983 |
|
5984 |
|
5985 |
|
5986 | var isArray = Array.isArray;
|
5987 |
|
5988 | module.exports = isArray;
|
5989 |
|
5990 |
|
5991 | }),
|
5992 |
|
5993 | (function(module, exports, __webpack_require__) {
|
5994 |
|
5995 | var _Promise = __webpack_require__(22);
|
5996 |
|
5997 | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
5998 | try {
|
5999 | var info = gen[key](arg);
|
6000 | var value = info.value;
|
6001 | } catch (error) {
|
6002 | reject(error);
|
6003 | return;
|
6004 | }
|
6005 |
|
6006 | if (info.done) {
|
6007 | resolve(value);
|
6008 | } else {
|
6009 | _Promise.resolve(value).then(_next, _throw);
|
6010 | }
|
6011 | }
|
6012 |
|
6013 | function _asyncToGenerator(fn) {
|
6014 | return function () {
|
6015 | var self = this,
|
6016 | args = arguments;
|
6017 | return new _Promise(function (resolve, reject) {
|
6018 | var gen = fn.apply(self, args);
|
6019 |
|
6020 | function _next(value) {
|
6021 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
6022 | }
|
6023 |
|
6024 | function _throw(err) {
|
6025 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
6026 | }
|
6027 |
|
6028 | _next(undefined);
|
6029 | });
|
6030 | };
|
6031 | }
|
6032 |
|
6033 | module.exports = _asyncToGenerator;
|
6034 |
|
6035 | }),
|
6036 |
|
6037 | (function(module, exports, __webpack_require__) {
|
6038 |
|
6039 | var basePick = __webpack_require__(280),
|
6040 | flatRest = __webpack_require__(291);
|
6041 |
|
6042 |
|
6043 |
|
6044 |
|
6045 |
|
6046 |
|
6047 |
|
6048 |
|
6049 |
|
6050 |
|
6051 |
|
6052 |
|
6053 |
|
6054 |
|
6055 |
|
6056 |
|
6057 |
|
6058 |
|
6059 | var pick = flatRest(function(object, paths) {
|
6060 | return object == null ? {} : basePick(object, paths);
|
6061 | });
|
6062 |
|
6063 | module.exports = pick;
|
6064 |
|
6065 |
|
6066 | }),
|
6067 |
|
6068 | (function(module, exports) {
|
6069 |
|
6070 | function _classCallCheck(instance, Constructor) {
|
6071 | if (!(instance instanceof Constructor)) {
|
6072 | throw new TypeError("Cannot call a class as a function");
|
6073 | }
|
6074 | }
|
6075 |
|
6076 | module.exports = _classCallCheck;
|
6077 |
|
6078 | }),
|
6079 |
|
6080 | (function(module, exports, __webpack_require__) {
|
6081 |
|
6082 | var __assign = (this && this.__assign) || function () {
|
6083 | __assign = Object.assign || function(t) {
|
6084 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6085 | s = arguments[i];
|
6086 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6087 | t[p] = s[p];
|
6088 | }
|
6089 | return t;
|
6090 | };
|
6091 | return __assign.apply(this, arguments);
|
6092 | };
|
6093 | Object.defineProperty(exports, "__esModule", { value: true });
|
6094 |
|
6095 |
|
6096 |
|
6097 |
|
6098 |
|
6099 | var helpers_1 = __webpack_require__(74);
|
6100 | var core_1 = __webpack_require__(113);
|
6101 |
|
6102 | var core_2 = __webpack_require__(113);
|
6103 | exports.applyOperation = core_2.applyOperation;
|
6104 | exports.applyPatch = core_2.applyPatch;
|
6105 | exports.applyReducer = core_2.applyReducer;
|
6106 | exports.getValueByPointer = core_2.getValueByPointer;
|
6107 | exports.validate = core_2.validate;
|
6108 | exports.validator = core_2.validator;
|
6109 |
|
6110 | var helpers_2 = __webpack_require__(74);
|
6111 | exports.JsonPatchError = helpers_2.PatchError;
|
6112 | exports.deepClone = helpers_2._deepClone;
|
6113 | exports.escapePathComponent = helpers_2.escapePathComponent;
|
6114 | exports.unescapePathComponent = helpers_2.unescapePathComponent;
|
6115 | var beforeDict = new WeakMap();
|
6116 | var Mirror = (function () {
|
6117 | function Mirror(obj) {
|
6118 | this.observers = new Map();
|
6119 | this.obj = obj;
|
6120 | }
|
6121 | return Mirror;
|
6122 | }());
|
6123 | var ObserverInfo = (function () {
|
6124 | function ObserverInfo(callback, observer) {
|
6125 | this.callback = callback;
|
6126 | this.observer = observer;
|
6127 | }
|
6128 | return ObserverInfo;
|
6129 | }());
|
6130 | function getMirror(obj) {
|
6131 | return beforeDict.get(obj);
|
6132 | }
|
6133 | function getObserverFromMirror(mirror, callback) {
|
6134 | return mirror.observers.get(callback);
|
6135 | }
|
6136 | function removeObserverFromMirror(mirror, observer) {
|
6137 | mirror.observers.delete(observer.callback);
|
6138 | }
|
6139 |
|
6140 |
|
6141 |
|
6142 | function unobserve(root, observer) {
|
6143 | observer.unobserve();
|
6144 | }
|
6145 | exports.unobserve = unobserve;
|
6146 |
|
6147 |
|
6148 |
|
6149 | function observe(obj, callback) {
|
6150 | var patches = [];
|
6151 | var observer;
|
6152 | var mirror = getMirror(obj);
|
6153 | if (!mirror) {
|
6154 | mirror = new Mirror(obj);
|
6155 | beforeDict.set(obj, mirror);
|
6156 | }
|
6157 | else {
|
6158 | var observerInfo = getObserverFromMirror(mirror, callback);
|
6159 | observer = observerInfo && observerInfo.observer;
|
6160 | }
|
6161 | if (observer) {
|
6162 | return observer;
|
6163 | }
|
6164 | observer = {};
|
6165 | mirror.value = helpers_1._deepClone(obj);
|
6166 | if (callback) {
|
6167 | observer.callback = callback;
|
6168 | observer.next = null;
|
6169 | var dirtyCheck = function () {
|
6170 | generate(observer);
|
6171 | };
|
6172 | var fastCheck = function () {
|
6173 | clearTimeout(observer.next);
|
6174 | observer.next = setTimeout(dirtyCheck);
|
6175 | };
|
6176 | if (typeof window !== 'undefined') {
|
6177 | window.addEventListener('mouseup', fastCheck);
|
6178 | window.addEventListener('keyup', fastCheck);
|
6179 | window.addEventListener('mousedown', fastCheck);
|
6180 | window.addEventListener('keydown', fastCheck);
|
6181 | window.addEventListener('change', fastCheck);
|
6182 | }
|
6183 | }
|
6184 | observer.patches = patches;
|
6185 | observer.object = obj;
|
6186 | observer.unobserve = function () {
|
6187 | generate(observer);
|
6188 | clearTimeout(observer.next);
|
6189 | removeObserverFromMirror(mirror, observer);
|
6190 | if (typeof window !== 'undefined') {
|
6191 | window.removeEventListener('mouseup', fastCheck);
|
6192 | window.removeEventListener('keyup', fastCheck);
|
6193 | window.removeEventListener('mousedown', fastCheck);
|
6194 | window.removeEventListener('keydown', fastCheck);
|
6195 | window.removeEventListener('change', fastCheck);
|
6196 | }
|
6197 | };
|
6198 | mirror.observers.set(callback, new ObserverInfo(callback, observer));
|
6199 | return observer;
|
6200 | }
|
6201 | exports.observe = observe;
|
6202 |
|
6203 |
|
6204 |
|
6205 | function generate(observer, invertible) {
|
6206 | if (invertible === void 0) { invertible = false; }
|
6207 | var mirror = beforeDict.get(observer.object);
|
6208 | _generate(mirror.value, observer.object, observer.patches, "", invertible);
|
6209 | if (observer.patches.length) {
|
6210 | core_1.applyPatch(mirror.value, observer.patches);
|
6211 | }
|
6212 | var temp = observer.patches;
|
6213 | if (temp.length > 0) {
|
6214 | observer.patches = [];
|
6215 | if (observer.callback) {
|
6216 | observer.callback(temp);
|
6217 | }
|
6218 | }
|
6219 | return temp;
|
6220 | }
|
6221 | exports.generate = generate;
|
6222 |
|
6223 | function _generate(mirror, obj, patches, path, invertible) {
|
6224 | if (obj === mirror) {
|
6225 | return;
|
6226 | }
|
6227 | if (typeof obj.toJSON === "function") {
|
6228 | obj = obj.toJSON();
|
6229 | }
|
6230 | var newKeys = helpers_1._objectKeys(obj);
|
6231 | var oldKeys = helpers_1._objectKeys(mirror);
|
6232 | var changed = false;
|
6233 | var deleted = false;
|
6234 |
|
6235 | for (var t = oldKeys.length - 1; t >= 0; t--) {
|
6236 | var key = oldKeys[t];
|
6237 | var oldVal = mirror[key];
|
6238 | if (helpers_1.hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {
|
6239 | var newVal = obj[key];
|
6240 | if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null) {
|
6241 | _generate(oldVal, newVal, patches, path + "/" + helpers_1.escapePathComponent(key), invertible);
|
6242 | }
|
6243 | else {
|
6244 | if (oldVal !== newVal) {
|
6245 | changed = true;
|
6246 | if (invertible) {
|
6247 | patches.push({ op: "test", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(oldVal) });
|
6248 | }
|
6249 | patches.push({ op: "replace", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(newVal) });
|
6250 | }
|
6251 | }
|
6252 | }
|
6253 | else if (Array.isArray(mirror) === Array.isArray(obj)) {
|
6254 | if (invertible) {
|
6255 | patches.push({ op: "test", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(oldVal) });
|
6256 | }
|
6257 | patches.push({ op: "remove", path: path + "/" + helpers_1.escapePathComponent(key) });
|
6258 | deleted = true;
|
6259 | }
|
6260 | else {
|
6261 | if (invertible) {
|
6262 | patches.push({ op: "test", path: path, value: mirror });
|
6263 | }
|
6264 | patches.push({ op: "replace", path: path, value: obj });
|
6265 | changed = true;
|
6266 | }
|
6267 | }
|
6268 | if (!deleted && newKeys.length == oldKeys.length) {
|
6269 | return;
|
6270 | }
|
6271 | for (var t = 0; t < newKeys.length; t++) {
|
6272 | var key = newKeys[t];
|
6273 | if (!helpers_1.hasOwnProperty(mirror, key) && obj[key] !== undefined) {
|
6274 | patches.push({ op: "add", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(obj[key]) });
|
6275 | }
|
6276 | }
|
6277 | }
|
6278 |
|
6279 |
|
6280 |
|
6281 | function compare(tree1, tree2, invertible) {
|
6282 | if (invertible === void 0) { invertible = false; }
|
6283 | var patches = [];
|
6284 | _generate(tree1, tree2, patches, '', invertible);
|
6285 | return patches;
|
6286 | }
|
6287 | exports.compare = compare;
|
6288 |
|
6289 |
|
6290 |
|
6291 |
|
6292 | var core = __webpack_require__(113);
|
6293 | var helpers_3 = __webpack_require__(74);
|
6294 | exports.default = __assign({}, core, {
|
6295 |
|
6296 | unobserve: unobserve,
|
6297 | observe: observe,
|
6298 | generate: generate,
|
6299 | compare: compare,
|
6300 |
|
6301 | JsonPatchError: helpers_3.PatchError, deepClone: helpers_1._deepClone, escapePathComponent: helpers_1.escapePathComponent,
|
6302 | unescapePathComponent: helpers_3.unescapePathComponent });
|
6303 |
|
6304 |
|
6305 | }),
|
6306 |
|
6307 | (function(module, exports) {
|
6308 |
|
6309 | module.exports = function (bitmap, value) {
|
6310 | return {
|
6311 | enumerable: !(bitmap & 1),
|
6312 | configurable: !(bitmap & 2),
|
6313 | writable: !(bitmap & 4),
|
6314 | value: value
|
6315 | };
|
6316 | };
|
6317 |
|
6318 |
|
6319 | }),
|
6320 |
|
6321 | (function(module, exports) {
|
6322 |
|
6323 | var toString = {}.toString;
|
6324 |
|
6325 | module.exports = function (it) {
|
6326 | return toString.call(it).slice(8, -1);
|
6327 | };
|
6328 |
|
6329 |
|
6330 | }),
|
6331 |
|
6332 | (function(module, exports) {
|
6333 |
|
6334 | module.exports = true;
|
6335 |
|
6336 |
|
6337 | }),
|
6338 |
|
6339 | (function(module, exports, __webpack_require__) {
|
6340 |
|
6341 | var pIE = __webpack_require__(53);
|
6342 | var createDesc = __webpack_require__(49);
|
6343 | var toIObject = __webpack_require__(24);
|
6344 | var toPrimitive = __webpack_require__(87);
|
6345 | var has = __webpack_require__(23);
|
6346 | var IE8_DOM_DEFINE = __webpack_require__(119);
|
6347 | var gOPD = Object.getOwnPropertyDescriptor;
|
6348 |
|
6349 | exports.f = __webpack_require__(16) ? gOPD : function getOwnPropertyDescriptor(O, P) {
|
6350 | O = toIObject(O);
|
6351 | P = toPrimitive(P, true);
|
6352 | if (IE8_DOM_DEFINE) try {
|
6353 | return gOPD(O, P);
|
6354 | } catch (e) { }
|
6355 | if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
|
6356 | };
|
6357 |
|
6358 |
|
6359 | }),
|
6360 |
|
6361 | (function(module, exports) {
|
6362 |
|
6363 | exports.f = {}.propertyIsEnumerable;
|
6364 |
|
6365 |
|
6366 | }),
|
6367 |
|
6368 | (function(module, exports, __webpack_require__) {
|
6369 |
|
6370 | var def = __webpack_require__(19).f;
|
6371 | var has = __webpack_require__(23);
|
6372 | var TAG = __webpack_require__(11)('toStringTag');
|
6373 |
|
6374 | module.exports = function (it, tag, stat) {
|
6375 | if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
6376 | };
|
6377 |
|
6378 |
|
6379 | }),
|
6380 |
|
6381 | (function(module, exports, __webpack_require__) {
|
6382 |
|
6383 | var assignValue = __webpack_require__(68),
|
6384 | baseAssignValue = __webpack_require__(127);
|
6385 |
|
6386 |
|
6387 |
|
6388 |
|
6389 |
|
6390 |
|
6391 |
|
6392 |
|
6393 |
|
6394 |
|
6395 |
|
6396 | function copyObject(source, props, object, customizer) {
|
6397 | var isNew = !object;
|
6398 | object || (object = {});
|
6399 |
|
6400 | var index = -1,
|
6401 | length = props.length;
|
6402 |
|
6403 | while (++index < length) {
|
6404 | var key = props[index];
|
6405 |
|
6406 | var newValue = customizer
|
6407 | ? customizer(object[key], source[key], key, object, source)
|
6408 | : undefined;
|
6409 |
|
6410 | if (newValue === undefined) {
|
6411 | newValue = source[key];
|
6412 | }
|
6413 | if (isNew) {
|
6414 | baseAssignValue(object, key, newValue);
|
6415 | } else {
|
6416 | assignValue(object, key, newValue);
|
6417 | }
|
6418 | }
|
6419 | return object;
|
6420 | }
|
6421 |
|
6422 | module.exports = copyObject;
|
6423 |
|
6424 |
|
6425 | }),
|
6426 |
|
6427 | (function(module, exports, __webpack_require__) {
|
6428 |
|
6429 | __webpack_require__(223);
|
6430 | var global = __webpack_require__(7);
|
6431 | var hide = __webpack_require__(27);
|
6432 | var Iterators = __webpack_require__(41);
|
6433 | var TO_STRING_TAG = __webpack_require__(11)('toStringTag');
|
6434 |
|
6435 | var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
|
6436 | 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
|
6437 | 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
|
6438 | 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
|
6439 | 'TextTrackList,TouchList').split(',');
|
6440 |
|
6441 | for (var i = 0; i < DOMIterables.length; i++) {
|
6442 | var NAME = DOMIterables[i];
|
6443 | var Collection = global[NAME];
|
6444 | var proto = Collection && Collection.prototype;
|
6445 | if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
6446 | Iterators[NAME] = Iterators.Array;
|
6447 | }
|
6448 |
|
6449 |
|
6450 | }),
|
6451 |
|
6452 | (function(module, exports, __webpack_require__) {
|
6453 |
|
6454 | "use strict";
|
6455 |
|
6456 | var $at = __webpack_require__(227)(true);
|
6457 |
|
6458 |
|
6459 | __webpack_require__(137)(String, 'String', function (iterated) {
|
6460 | this._t = String(iterated);
|
6461 | this._i = 0;
|
6462 |
|
6463 | }, function () {
|
6464 | var O = this._t;
|
6465 | var index = this._i;
|
6466 | var point;
|
6467 | if (index >= O.length) return { value: undefined, done: true };
|
6468 | point = $at(O, index);
|
6469 | this._i += point.length;
|
6470 | return { value: point, done: false };
|
6471 | });
|
6472 |
|
6473 |
|
6474 | }),
|
6475 |
|
6476 | (function(module, exports, __webpack_require__) {
|
6477 |
|
6478 | "use strict";
|
6479 |
|
6480 |
|
6481 |
|
6482 |
|
6483 | function YAMLException(reason, mark) {
|
6484 |
|
6485 | Error.call(this);
|
6486 |
|
6487 | this.name = 'YAMLException';
|
6488 | this.reason = reason;
|
6489 | this.mark = mark;
|
6490 | this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
|
6491 |
|
6492 |
|
6493 | if (Error.captureStackTrace) {
|
6494 |
|
6495 | Error.captureStackTrace(this, this.constructor);
|
6496 | } else {
|
6497 |
|
6498 | this.stack = (new Error()).stack || '';
|
6499 | }
|
6500 | }
|
6501 |
|
6502 |
|
6503 |
|
6504 | YAMLException.prototype = Object.create(Error.prototype);
|
6505 | YAMLException.prototype.constructor = YAMLException;
|
6506 |
|
6507 |
|
6508 | YAMLException.prototype.toString = function toString(compact) {
|
6509 | var result = this.name + ': ';
|
6510 |
|
6511 | result += this.reason || '(unknown reason)';
|
6512 |
|
6513 | if (!compact && this.mark) {
|
6514 | result += ' ' + this.mark.toString();
|
6515 | }
|
6516 |
|
6517 | return result;
|
6518 | };
|
6519 |
|
6520 |
|
6521 | module.exports = YAMLException;
|
6522 |
|
6523 |
|
6524 | }),
|
6525 |
|
6526 | (function(module, exports, __webpack_require__) {
|
6527 |
|
6528 | "use strict";
|
6529 |
|
6530 |
|
6531 |
|
6532 |
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 |
|
6538 |
|
6539 | var Schema = __webpack_require__(43);
|
6540 |
|
6541 |
|
6542 | module.exports = new Schema({
|
6543 | include: [
|
6544 | __webpack_require__(150)
|
6545 | ],
|
6546 | implicit: [
|
6547 | __webpack_require__(266),
|
6548 | __webpack_require__(267)
|
6549 | ],
|
6550 | explicit: [
|
6551 | __webpack_require__(268),
|
6552 | __webpack_require__(272),
|
6553 | __webpack_require__(273),
|
6554 | __webpack_require__(274)
|
6555 | ]
|
6556 | });
|
6557 |
|
6558 |
|
6559 | }),
|
6560 |
|
6561 | (function(module, exports, __webpack_require__) {
|
6562 |
|
6563 | var baseClamp = __webpack_require__(214),
|
6564 | baseToString = __webpack_require__(215),
|
6565 | toInteger = __webpack_require__(133),
|
6566 | toString = __webpack_require__(134);
|
6567 |
|
6568 |
|
6569 |
|
6570 |
|
6571 |
|
6572 |
|
6573 |
|
6574 |
|
6575 |
|
6576 |
|
6577 |
|
6578 |
|
6579 |
|
6580 |
|
6581 |
|
6582 |
|
6583 |
|
6584 |
|
6585 |
|
6586 |
|
6587 |
|
6588 |
|
6589 |
|
6590 |
|
6591 | function startsWith(string, target, position) {
|
6592 | string = toString(string);
|
6593 | position = position == null
|
6594 | ? 0
|
6595 | : baseClamp(toInteger(position), 0, string.length);
|
6596 |
|
6597 | target = baseToString(target);
|
6598 | return string.slice(position, position + target.length) == target;
|
6599 | }
|
6600 |
|
6601 | module.exports = startsWith;
|
6602 |
|
6603 |
|
6604 | }),
|
6605 |
|
6606 | (function(module, __webpack_exports__, __webpack_require__) {
|
6607 |
|
6608 | "use strict";
|
6609 | __webpack_require__.r(__webpack_exports__);
|
6610 | __webpack_require__.d(__webpack_exports__, "makeFetchJSON", function() { return makeFetchJSON; });
|
6611 | __webpack_require__.d(__webpack_exports__, "clearCache", function() { return clearCache; });
|
6612 | __webpack_require__.d(__webpack_exports__, "default", function() { return resolve; });
|
6613 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
|
6614 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0__);
|
6615 | var _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45);
|
6616 | var _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
|
6617 | var _http__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
|
6618 | var _specmap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
|
6619 | var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13);
|
6620 | var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81);
|
6621 |
|
6622 |
|
6623 |
|
6624 |
|
6625 |
|
6626 |
|
6627 | function makeFetchJSON(http) {
|
6628 | var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
6629 | var requestInterceptor = opts.requestInterceptor,
|
6630 | responseInterceptor = opts.responseInterceptor;
|
6631 |
|
6632 | var credentials = http.withCredentials ? 'include' : 'same-origin';
|
6633 | return function (docPath) {
|
6634 | return http({
|
6635 | url: docPath,
|
6636 | loadSpec: true,
|
6637 | requestInterceptor: requestInterceptor,
|
6638 | responseInterceptor: responseInterceptor,
|
6639 | headers: {
|
6640 | Accept: _constants__WEBPACK_IMPORTED_MODULE_5__["ACCEPT_HEADER_VALUE_FOR_DOCUMENTS"]
|
6641 | },
|
6642 | credentials: credentials
|
6643 | }).then(function (res) {
|
6644 | return res.body;
|
6645 | });
|
6646 | };
|
6647 | }
|
6648 |
|
6649 | function clearCache() {
|
6650 | _specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].refs.clearCache();
|
6651 | }
|
6652 | function resolve(obj) {
|
6653 | var fetch = obj.fetch,
|
6654 | spec = obj.spec,
|
6655 | url = obj.url,
|
6656 | mode = obj.mode,
|
6657 | _obj$allowMetaPatches = obj.allowMetaPatches,
|
6658 | allowMetaPatches = _obj$allowMetaPatches === void 0 ? true : _obj$allowMetaPatches,
|
6659 | pathDiscriminator = obj.pathDiscriminator,
|
6660 | modelPropertyMacro = obj.modelPropertyMacro,
|
6661 | parameterMacro = obj.parameterMacro,
|
6662 | requestInterceptor = obj.requestInterceptor,
|
6663 | responseInterceptor = obj.responseInterceptor,
|
6664 | skipNormalization = obj.skipNormalization,
|
6665 | useCircularStructures = obj.useCircularStructures;
|
6666 | var http = obj.http,
|
6667 | baseDoc = obj.baseDoc;
|
6668 |
|
6669 |
|
6670 | baseDoc = baseDoc || url;
|
6671 |
|
6672 |
|
6673 | http = fetch || http || _http__WEBPACK_IMPORTED_MODULE_2__["default"];
|
6674 |
|
6675 | if (!spec) {
|
6676 | return makeFetchJSON(http, {
|
6677 | requestInterceptor: requestInterceptor,
|
6678 | responseInterceptor: responseInterceptor
|
6679 | })(baseDoc).then(doResolve);
|
6680 | }
|
6681 |
|
6682 | return doResolve(spec);
|
6683 |
|
6684 | function doResolve(_spec) {
|
6685 | if (baseDoc) {
|
6686 | _specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].refs.docCache[baseDoc] = _spec;
|
6687 | }
|
6688 |
|
6689 |
|
6690 | _specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].refs.fetchJSON = makeFetchJSON(http, {
|
6691 | requestInterceptor: requestInterceptor,
|
6692 | responseInterceptor: responseInterceptor
|
6693 | });
|
6694 | var plugs = [_specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].refs];
|
6695 |
|
6696 | if (typeof parameterMacro === 'function') {
|
6697 | plugs.push(_specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].parameters);
|
6698 | }
|
6699 |
|
6700 | if (typeof modelPropertyMacro === 'function') {
|
6701 | plugs.push(_specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].properties);
|
6702 | }
|
6703 |
|
6704 | if (mode !== 'strict') {
|
6705 | plugs.push(_specmap__WEBPACK_IMPORTED_MODULE_3__["plugins"].allOf);
|
6706 | }
|
6707 |
|
6708 |
|
6709 | return Object(_specmap__WEBPACK_IMPORTED_MODULE_3__["default"])({
|
6710 | spec: _spec,
|
6711 | context: {
|
6712 | baseDoc: baseDoc
|
6713 | },
|
6714 | plugins: plugs,
|
6715 | allowMetaPatches: allowMetaPatches,
|
6716 |
|
6717 | pathDiscriminator: pathDiscriminator,
|
6718 |
|
6719 | parameterMacro: parameterMacro,
|
6720 | modelPropertyMacro: modelPropertyMacro,
|
6721 | useCircularStructures: useCircularStructures
|
6722 | }).then(skipNormalization ? function () {
|
6723 | var _ref = _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(a) {
|
6724 | return _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
|
6725 | while (1) {
|
6726 | switch (_context.prev = _context.next) {
|
6727 | case 0:
|
6728 | return _context.abrupt("return", a);
|
6729 |
|
6730 | case 1:
|
6731 | case "end":
|
6732 | return _context.stop();
|
6733 | }
|
6734 | }
|
6735 | }, _callee);
|
6736 | }));
|
6737 |
|
6738 | return function (_x) {
|
6739 | return _ref.apply(this, arguments);
|
6740 | };
|
6741 | }() : _helpers__WEBPACK_IMPORTED_MODULE_4__["normalizeSwagger"]);
|
6742 | }
|
6743 | }
|
6744 |
|
6745 | }),
|
6746 |
|
6747 | (function(module, __webpack_exports__, __webpack_require__) {
|
6748 |
|
6749 | "use strict";
|
6750 | __webpack_require__.r(__webpack_exports__);
|
6751 | __webpack_require__.d(__webpack_exports__, "default", function() { return serialize; });
|
6752 | var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
|
6753 | var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_0__);
|
6754 |
|
6755 |
|
6756 |
|
6757 |
|
6758 |
|
6759 |
|
6760 | function serialize(value, mediaType) {
|
6761 | if (mediaType.includes('application/json')) {
|
6762 | if (typeof value === 'string') {
|
6763 |
|
6764 | return value;
|
6765 | }
|
6766 |
|
6767 | return _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_0___default()(value);
|
6768 | }
|
6769 |
|
6770 | return value.toString();
|
6771 | }
|
6772 |
|
6773 | }),
|
6774 |
|
6775 | (function(module, exports, __webpack_require__) {
|
6776 |
|
6777 |
|
6778 | var toInteger = __webpack_require__(90);
|
6779 | var min = Math.min;
|
6780 | module.exports = function (it) {
|
6781 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0;
|
6782 | };
|
6783 |
|
6784 |
|
6785 | }),
|
6786 |
|
6787 | (function(module, exports) {
|
6788 |
|
6789 | var id = 0;
|
6790 | var px = Math.random();
|
6791 | module.exports = function (key) {
|
6792 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
6793 | };
|
6794 |
|
6795 |
|
6796 | }),
|
6797 |
|
6798 | (function(module, exports) {
|
6799 |
|
6800 | exports.f = Object.getOwnPropertySymbols;
|
6801 |
|
6802 |
|
6803 | }),
|
6804 |
|
6805 | (function(module, exports, __webpack_require__) {
|
6806 |
|
6807 | var META = __webpack_require__(64)('meta');
|
6808 | var isObject = __webpack_require__(9);
|
6809 | var has = __webpack_require__(23);
|
6810 | var setDesc = __webpack_require__(19).f;
|
6811 | var id = 0;
|
6812 | var isExtensible = Object.isExtensible || function () {
|
6813 | return true;
|
6814 | };
|
6815 | var FREEZE = !__webpack_require__(28)(function () {
|
6816 | return isExtensible(Object.preventExtensions({}));
|
6817 | });
|
6818 | var setMeta = function (it) {
|
6819 | setDesc(it, META, { value: {
|
6820 | i: 'O' + ++id,
|
6821 | w: {}
|
6822 | } });
|
6823 | };
|
6824 | var fastKey = function (it, create) {
|
6825 |
|
6826 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
6827 | if (!has(it, META)) {
|
6828 |
|
6829 | if (!isExtensible(it)) return 'F';
|
6830 |
|
6831 | if (!create) return 'E';
|
6832 |
|
6833 | setMeta(it);
|
6834 |
|
6835 | } return it[META].i;
|
6836 | };
|
6837 | var getWeak = function (it, create) {
|
6838 | if (!has(it, META)) {
|
6839 |
|
6840 | if (!isExtensible(it)) return true;
|
6841 |
|
6842 | if (!create) return false;
|
6843 |
|
6844 | setMeta(it);
|
6845 |
|
6846 | } return it[META].w;
|
6847 | };
|
6848 |
|
6849 | var onFreeze = function (it) {
|
6850 | if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
6851 | return it;
|
6852 | };
|
6853 | var meta = module.exports = {
|
6854 | KEY: META,
|
6855 | NEED: false,
|
6856 | fastKey: fastKey,
|
6857 | getWeak: getWeak,
|
6858 | onFreeze: onFreeze
|
6859 | };
|
6860 |
|
6861 |
|
6862 | }),
|
6863 |
|
6864 | (function(module, exports, __webpack_require__) {
|
6865 |
|
6866 |
|
6867 | var anObject = __webpack_require__(12);
|
6868 | var dPs = __webpack_require__(120);
|
6869 | var enumBugKeys = __webpack_require__(93);
|
6870 | var IE_PROTO = __webpack_require__(91)('IE_PROTO');
|
6871 | var Empty = function () { };
|
6872 | var PROTOTYPE = 'prototype';
|
6873 |
|
6874 |
|
6875 | var createDict = function () {
|
6876 |
|
6877 | var iframe = __webpack_require__(86)('iframe');
|
6878 | var i = enumBugKeys.length;
|
6879 | var lt = '<';
|
6880 | var gt = '>';
|
6881 | var iframeDocument;
|
6882 | iframe.style.display = 'none';
|
6883 | __webpack_require__(126).appendChild(iframe);
|
6884 | iframe.src = 'javascript:';
|
6885 |
|
6886 |
|
6887 | iframeDocument = iframe.contentWindow.document;
|
6888 | iframeDocument.open();
|
6889 | iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
6890 | iframeDocument.close();
|
6891 | createDict = iframeDocument.F;
|
6892 | while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
6893 | return createDict();
|
6894 | };
|
6895 |
|
6896 | module.exports = Object.create || function create(O, Properties) {
|
6897 | var result;
|
6898 | if (O !== null) {
|
6899 | Empty[PROTOTYPE] = anObject(O);
|
6900 | result = new Empty();
|
6901 | Empty[PROTOTYPE] = null;
|
6902 |
|
6903 | result[IE_PROTO] = O;
|
6904 | } else result = createDict();
|
6905 | return Properties === undefined ? result : dPs(result, Properties);
|
6906 | };
|
6907 |
|
6908 |
|
6909 | }),
|
6910 |
|
6911 | (function(module, exports, __webpack_require__) {
|
6912 |
|
6913 | var baseAssignValue = __webpack_require__(127),
|
6914 | eq = __webpack_require__(128);
|
6915 |
|
6916 |
|
6917 | var objectProto = Object.prototype;
|
6918 |
|
6919 |
|
6920 | var hasOwnProperty = objectProto.hasOwnProperty;
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 | function assignValue(object, key, value) {
|
6933 | var objValue = object[key];
|
6934 | if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
6935 | (value === undefined && !(key in object))) {
|
6936 | baseAssignValue(object, key, value);
|
6937 | }
|
6938 | }
|
6939 |
|
6940 | module.exports = assignValue;
|
6941 |
|
6942 |
|
6943 | }),
|
6944 |
|
6945 | (function(module, exports, __webpack_require__) {
|
6946 |
|
6947 | var overArg = __webpack_require__(100);
|
6948 |
|
6949 |
|
6950 | var nativeKeys = overArg(Object.keys, Object);
|
6951 |
|
6952 | module.exports = nativeKeys;
|
6953 |
|
6954 |
|
6955 | }),
|
6956 |
|
6957 | (function(module, exports, __webpack_require__) {
|
6958 |
|
6959 | module.exports = __webpack_require__(232);
|
6960 |
|
6961 | }),
|
6962 |
|
6963 | (function(module, exports, __webpack_require__) {
|
6964 |
|
6965 | var ctx = __webpack_require__(26);
|
6966 | var call = __webpack_require__(139);
|
6967 | var isArrayIter = __webpack_require__(140);
|
6968 | var anObject = __webpack_require__(12);
|
6969 | var toLength = __webpack_require__(63);
|
6970 | var getIterFn = __webpack_require__(103);
|
6971 | var BREAK = {};
|
6972 | var RETURN = {};
|
6973 | var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
|
6974 | var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
|
6975 | var f = ctx(fn, that, entries ? 2 : 1);
|
6976 | var index = 0;
|
6977 | var length, step, iterator, result;
|
6978 | if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
|
6979 |
|
6980 | if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
|
6981 | result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
|
6982 | if (result === BREAK || result === RETURN) return result;
|
6983 | } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
|
6984 | result = call(iterator, f, step.value, entries);
|
6985 | if (result === BREAK || result === RETURN) return result;
|
6986 | }
|
6987 | };
|
6988 | exports.BREAK = BREAK;
|
6989 | exports.RETURN = RETURN;
|
6990 |
|
6991 |
|
6992 | }),
|
6993 |
|
6994 | (function(module, exports, __webpack_require__) {
|
6995 |
|
6996 | "use strict";
|
6997 |
|
6998 |
|
6999 |
|
7000 |
|
7001 |
|
7002 |
|
7003 |
|
7004 |
|
7005 |
|
7006 |
|
7007 |
|
7008 |
|
7009 | var Schema = __webpack_require__(43);
|
7010 |
|
7011 |
|
7012 | module.exports = Schema.DEFAULT = new Schema({
|
7013 | include: [
|
7014 | __webpack_require__(59)
|
7015 | ],
|
7016 | explicit: [
|
7017 | __webpack_require__(275),
|
7018 | __webpack_require__(276),
|
7019 | __webpack_require__(277)
|
7020 | ]
|
7021 | });
|
7022 |
|
7023 |
|
7024 | }),
|
7025 |
|
7026 | (function(module, exports, __webpack_require__) {
|
7027 |
|
7028 | var isArray = __webpack_require__(44),
|
7029 | isKey = __webpack_require__(282),
|
7030 | stringToPath = __webpack_require__(284),
|
7031 | toString = __webpack_require__(134);
|
7032 |
|
7033 |
|
7034 |
|
7035 |
|
7036 |
|
7037 |
|
7038 |
|
7039 |
|
7040 |
|
7041 | function castPath(value, object) {
|
7042 | if (isArray(value)) {
|
7043 | return value;
|
7044 | }
|
7045 | return isKey(value, object) ? [value] : stringToPath(toString(value));
|
7046 | }
|
7047 |
|
7048 | module.exports = castPath;
|
7049 |
|
7050 |
|
7051 | }),
|
7052 |
|
7053 | (function(module, exports) {
|
7054 |
|
7055 |
|
7056 |
|
7057 |
|
7058 |
|
7059 |
|
7060 | var __extends = (this && this.__extends) || (function () {
|
7061 | var extendStatics = function (d, b) {
|
7062 | extendStatics = Object.setPrototypeOf ||
|
7063 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
7064 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7065 | return extendStatics(d, b);
|
7066 | };
|
7067 | return function (d, b) {
|
7068 | extendStatics(d, b);
|
7069 | function __() { this.constructor = d; }
|
7070 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
7071 | };
|
7072 | })();
|
7073 | Object.defineProperty(exports, "__esModule", { value: true });
|
7074 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
7075 | function hasOwnProperty(obj, key) {
|
7076 | return _hasOwnProperty.call(obj, key);
|
7077 | }
|
7078 | exports.hasOwnProperty = hasOwnProperty;
|
7079 | function _objectKeys(obj) {
|
7080 | if (Array.isArray(obj)) {
|
7081 | var keys = new Array(obj.length);
|
7082 | for (var k = 0; k < keys.length; k++) {
|
7083 | keys[k] = "" + k;
|
7084 | }
|
7085 | return keys;
|
7086 | }
|
7087 | if (Object.keys) {
|
7088 | return Object.keys(obj);
|
7089 | }
|
7090 | var keys = [];
|
7091 | for (var i in obj) {
|
7092 | if (hasOwnProperty(obj, i)) {
|
7093 | keys.push(i);
|
7094 | }
|
7095 | }
|
7096 | return keys;
|
7097 | }
|
7098 | exports._objectKeys = _objectKeys;
|
7099 | ;
|
7100 |
|
7101 |
|
7102 |
|
7103 |
|
7104 |
|
7105 |
|
7106 | function _deepClone(obj) {
|
7107 | switch (typeof obj) {
|
7108 | case "object":
|
7109 | return JSON.parse(JSON.stringify(obj));
|
7110 | case "undefined":
|
7111 | return null;
|
7112 | default:
|
7113 | return obj;
|
7114 | }
|
7115 | }
|
7116 | exports._deepClone = _deepClone;
|
7117 |
|
7118 | function isInteger(str) {
|
7119 | var i = 0;
|
7120 | var len = str.length;
|
7121 | var charCode;
|
7122 | while (i < len) {
|
7123 | charCode = str.charCodeAt(i);
|
7124 | if (charCode >= 48 && charCode <= 57) {
|
7125 | i++;
|
7126 | continue;
|
7127 | }
|
7128 | return false;
|
7129 | }
|
7130 | return true;
|
7131 | }
|
7132 | exports.isInteger = isInteger;
|
7133 |
|
7134 |
|
7135 |
|
7136 |
|
7137 |
|
7138 | function escapePathComponent(path) {
|
7139 | if (path.indexOf('/') === -1 && path.indexOf('~') === -1)
|
7140 | return path;
|
7141 | return path.replace(/~/g, '~0').replace(/\//g, '~1');
|
7142 | }
|
7143 | exports.escapePathComponent = escapePathComponent;
|
7144 |
|
7145 |
|
7146 |
|
7147 |
|
7148 |
|
7149 | function unescapePathComponent(path) {
|
7150 | return path.replace(/~1/g, '/').replace(/~0/g, '~');
|
7151 | }
|
7152 | exports.unescapePathComponent = unescapePathComponent;
|
7153 | function _getPathRecursive(root, obj) {
|
7154 | var found;
|
7155 | for (var key in root) {
|
7156 | if (hasOwnProperty(root, key)) {
|
7157 | if (root[key] === obj) {
|
7158 | return escapePathComponent(key) + '/';
|
7159 | }
|
7160 | else if (typeof root[key] === 'object') {
|
7161 | found = _getPathRecursive(root[key], obj);
|
7162 | if (found != '') {
|
7163 | return escapePathComponent(key) + '/' + found;
|
7164 | }
|
7165 | }
|
7166 | }
|
7167 | }
|
7168 | return '';
|
7169 | }
|
7170 | exports._getPathRecursive = _getPathRecursive;
|
7171 | function getPath(root, obj) {
|
7172 | if (root === obj) {
|
7173 | return '/';
|
7174 | }
|
7175 | var path = _getPathRecursive(root, obj);
|
7176 | if (path === '') {
|
7177 | throw new Error("Object not found in root");
|
7178 | }
|
7179 | return '/' + path;
|
7180 | }
|
7181 | exports.getPath = getPath;
|
7182 |
|
7183 |
|
7184 |
|
7185 | function hasUndefined(obj) {
|
7186 | if (obj === undefined) {
|
7187 | return true;
|
7188 | }
|
7189 | if (obj) {
|
7190 | if (Array.isArray(obj)) {
|
7191 | for (var i = 0, len = obj.length; i < len; i++) {
|
7192 | if (hasUndefined(obj[i])) {
|
7193 | return true;
|
7194 | }
|
7195 | }
|
7196 | }
|
7197 | else if (typeof obj === "object") {
|
7198 | var objKeys = _objectKeys(obj);
|
7199 | var objKeysLength = objKeys.length;
|
7200 | for (var i = 0; i < objKeysLength; i++) {
|
7201 | if (hasUndefined(obj[objKeys[i]])) {
|
7202 | return true;
|
7203 | }
|
7204 | }
|
7205 | }
|
7206 | }
|
7207 | return false;
|
7208 | }
|
7209 | exports.hasUndefined = hasUndefined;
|
7210 | function patchErrorMessageFormatter(message, args) {
|
7211 | var messageParts = [message];
|
7212 | for (var key in args) {
|
7213 | var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key];
|
7214 | if (typeof value !== 'undefined') {
|
7215 | messageParts.push(key + ": " + value);
|
7216 | }
|
7217 | }
|
7218 | return messageParts.join('\n');
|
7219 | }
|
7220 | var PatchError = (function (_super) {
|
7221 | __extends(PatchError, _super);
|
7222 | function PatchError(message, name, index, operation, tree) {
|
7223 | var _newTarget = this.constructor;
|
7224 | var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this;
|
7225 | _this.name = name;
|
7226 | _this.index = index;
|
7227 | _this.operation = operation;
|
7228 | _this.tree = tree;
|
7229 | Object.setPrototypeOf(_this, _newTarget.prototype);
|
7230 | _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree });
|
7231 | return _this;
|
7232 | }
|
7233 | return PatchError;
|
7234 | }(Error));
|
7235 | exports.PatchError = PatchError;
|
7236 |
|
7237 |
|
7238 | }),
|
7239 |
|
7240 | (function(module, exports, __webpack_require__) {
|
7241 |
|
7242 | var eq = __webpack_require__(128);
|
7243 |
|
7244 |
|
7245 |
|
7246 |
|
7247 |
|
7248 |
|
7249 |
|
7250 |
|
7251 |
|
7252 | function assocIndexOf(array, key) {
|
7253 | var length = array.length;
|
7254 | while (length--) {
|
7255 | if (eq(array[length][0], key)) {
|
7256 | return length;
|
7257 | }
|
7258 | }
|
7259 | return -1;
|
7260 | }
|
7261 |
|
7262 | module.exports = assocIndexOf;
|
7263 |
|
7264 |
|
7265 | }),
|
7266 |
|
7267 | (function(module, exports, __webpack_require__) {
|
7268 |
|
7269 | module.exports = __webpack_require__(235);
|
7270 |
|
7271 | }),
|
7272 |
|
7273 | (function(module, exports, __webpack_require__) {
|
7274 |
|
7275 | var _Object$getPrototypeOf = __webpack_require__(296);
|
7276 |
|
7277 | var _Object$setPrototypeOf = __webpack_require__(154);
|
7278 |
|
7279 | function _getPrototypeOf(o) {
|
7280 | module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _Object$getPrototypeOf : function _getPrototypeOf(o) {
|
7281 | return o.__proto__ || _Object$getPrototypeOf(o);
|
7282 | };
|
7283 | return _getPrototypeOf(o);
|
7284 | }
|
7285 |
|
7286 | module.exports = _getPrototypeOf;
|
7287 |
|
7288 | }),
|
7289 |
|
7290 | (function(module, exports, __webpack_require__) {
|
7291 |
|
7292 | "use strict";
|
7293 |
|
7294 |
|
7295 |
|
7296 | var yaml = __webpack_require__(256);
|
7297 |
|
7298 |
|
7299 | module.exports = yaml;
|
7300 |
|
7301 |
|
7302 | }),
|
7303 |
|
7304 | (function(module, exports, __webpack_require__) {
|
7305 |
|
7306 | module.exports = __webpack_require__(302);
|
7307 |
|
7308 | }),
|
7309 |
|
7310 | (function(module, __webpack_exports__, __webpack_require__) {
|
7311 |
|
7312 | "use strict";
|
7313 | __webpack_require__.r(__webpack_exports__);
|
7314 | __webpack_require__.d(__webpack_exports__, "default", function() { return createErrorType; });
|
7315 | function createErrorType(name, init) {
|
7316 | function E() {
|
7317 | if (!Error.captureStackTrace) {
|
7318 | this.stack = new Error().stack;
|
7319 | } else {
|
7320 | Error.captureStackTrace(this, this.constructor);
|
7321 | }
|
7322 |
|
7323 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
7324 | args[_key] = arguments[_key];
|
7325 | }
|
7326 |
|
7327 | this.message = args[0];
|
7328 |
|
7329 | if (init) {
|
7330 | init.apply(this, args);
|
7331 | }
|
7332 | }
|
7333 |
|
7334 | E.prototype = new Error();
|
7335 | E.prototype.name = name;
|
7336 | E.prototype.constructor = E;
|
7337 | return E;
|
7338 | }
|
7339 |
|
7340 | }),
|
7341 |
|
7342 | (function(module, __webpack_exports__, __webpack_require__) {
|
7343 |
|
7344 | "use strict";
|
7345 | __webpack_require__.r(__webpack_exports__);
|
7346 | __webpack_require__.d(__webpack_exports__, "ACCEPT_HEADER_VALUE_FOR_DOCUMENTS", function() { return ACCEPT_HEADER_VALUE_FOR_DOCUMENTS; });
|
7347 |
|
7348 | var ACCEPT_HEADER_VALUE_FOR_DOCUMENTS = 'application/json, application/yaml';
|
7349 |
|
7350 | }),
|
7351 |
|
7352 | (function(module, exports, __webpack_require__) {
|
7353 |
|
7354 | (function(Buffer) {(function () {
|
7355 | "use strict";
|
7356 |
|
7357 | function btoa(str) {
|
7358 | var buffer;
|
7359 |
|
7360 | if (str instanceof Buffer) {
|
7361 | buffer = str;
|
7362 | } else {
|
7363 | buffer = Buffer.from(str.toString(), 'binary');
|
7364 | }
|
7365 |
|
7366 | return buffer.toString('base64');
|
7367 | }
|
7368 |
|
7369 | module.exports = btoa;
|
7370 | }());
|
7371 |
|
7372 | }.call(this, __webpack_require__(29).Buffer))
|
7373 |
|
7374 | }),
|
7375 |
|
7376 | (function(module, exports, __webpack_require__) {
|
7377 |
|
7378 | "use strict";
|
7379 |
|
7380 |
|
7381 | var stringify = __webpack_require__(254);
|
7382 | var parse = __webpack_require__(255);
|
7383 | var formats = __webpack_require__(149);
|
7384 |
|
7385 | module.exports = {
|
7386 | formats: formats,
|
7387 | parse: parse,
|
7388 | stringify: stringify
|
7389 | };
|
7390 |
|
7391 |
|
7392 | }),
|
7393 |
|
7394 | (function(module, __webpack_exports__, __webpack_require__) {
|
7395 |
|
7396 | "use strict";
|
7397 | __webpack_require__.r(__webpack_exports__);
|
7398 | __webpack_require__.d(__webpack_exports__, "self", function() { return self; });
|
7399 | __webpack_require__.d(__webpack_exports__, "execute", function() { return execute; });
|
7400 | __webpack_require__.d(__webpack_exports__, "buildRequest", function() { return buildRequest; });
|
7401 | __webpack_require__.d(__webpack_exports__, "baseUrl", function() { return baseUrl; });
|
7402 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
|
7403 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
|
7404 | var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
|
7405 | var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_1__);
|
7406 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
7407 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2__);
|
7408 | var _babel_runtime_corejs2_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(178);
|
7409 | var _babel_runtime_corejs2_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__);
|
7410 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
|
7411 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4__);
|
7412 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10);
|
7413 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5__);
|
7414 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
7415 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6__);
|
7416 | var lodash_get__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31);
|
7417 | var lodash_get__WEBPACK_IMPORTED_MODULE_7___default = __webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_7__);
|
7418 | var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(179);
|
7419 | var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_8___default = __webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_8__);
|
7420 | var lodash_isArray__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(44);
|
7421 | var lodash_isArray__WEBPACK_IMPORTED_MODULE_9___default = __webpack_require__.n(lodash_isArray__WEBPACK_IMPORTED_MODULE_9__);
|
7422 | var url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(20);
|
7423 | var url__WEBPACK_IMPORTED_MODULE_10___default = __webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_10__);
|
7424 | var cookie__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(180);
|
7425 | var cookie__WEBPACK_IMPORTED_MODULE_11___default = __webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_11__);
|
7426 | var _http__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(18);
|
7427 | var _specmap_lib_create_error__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(80);
|
7428 | var _swagger2_parameter_builders__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(181);
|
7429 | var _oas3_parameter_builders__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(182);
|
7430 | var _oas3_build_request__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(183);
|
7431 | var _swagger2_build_request__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(184);
|
7432 | var _helpers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(13);
|
7433 |
|
7434 |
|
7435 |
|
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 |
|
7441 |
|
7442 |
|
7443 |
|
7444 |
|
7445 |
|
7446 |
|
7447 |
|
7448 |
|
7449 |
|
7450 |
|
7451 |
|
7452 |
|
7453 | var arrayOrEmpty = function arrayOrEmpty(ar) {
|
7454 | return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6___default()(ar) ? ar : [];
|
7455 | };
|
7456 |
|
7457 | var OperationNotFoundError = Object(_specmap_lib_create_error__WEBPACK_IMPORTED_MODULE_13__["default"])('OperationNotFoundError', function cb(message, extra, oriError) {
|
7458 | this.originalError = oriError;
|
7459 |
|
7460 | _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_5___default()(this, extra || {});
|
7461 | });
|
7462 |
|
7463 | var findParametersWithName = function findParametersWithName(name, parameters) {
|
7464 | return parameters.filter(function (p) {
|
7465 | return p.name === name;
|
7466 | });
|
7467 | };
|
7468 |
|
7469 |
|
7470 | var deduplicateParameters = function deduplicateParameters(parameters) {
|
7471 | var paramsMap = {};
|
7472 | parameters.forEach(function (p) {
|
7473 | if (!paramsMap[p.in]) {
|
7474 | paramsMap[p.in] = {};
|
7475 | }
|
7476 |
|
7477 | paramsMap[p.in][p.name] = p;
|
7478 | });
|
7479 | var dedupedParameters = [];
|
7480 |
|
7481 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default()(paramsMap).forEach(function (i) {
|
7482 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default()(paramsMap[i]).forEach(function (p) {
|
7483 | dedupedParameters.push(paramsMap[i][p]);
|
7484 | });
|
7485 | });
|
7486 |
|
7487 | return dedupedParameters;
|
7488 | };
|
7489 |
|
7490 |
|
7491 | var self = {
|
7492 | buildRequest: buildRequest
|
7493 | };
|
7494 |
|
7495 |
|
7496 | function execute(_ref) {
|
7497 | var userHttp = _ref.http,
|
7498 | fetch = _ref.fetch,
|
7499 | spec = _ref.spec,
|
7500 | operationId = _ref.operationId,
|
7501 | pathName = _ref.pathName,
|
7502 | method = _ref.method,
|
7503 | parameters = _ref.parameters,
|
7504 | securities = _ref.securities,
|
7505 | extras = _babel_runtime_corejs2_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3___default()(_ref, ["http", "fetch", "spec", "operationId", "pathName", "method", "parameters", "securities"]);
|
7506 |
|
7507 |
|
7508 | var http = userHttp || fetch || _http__WEBPACK_IMPORTED_MODULE_12__["default"];
|
7509 |
|
7510 | if (pathName && method && !operationId) {
|
7511 | operationId = Object(_helpers__WEBPACK_IMPORTED_MODULE_18__["legacyIdFromPathMethod"])(pathName, method);
|
7512 | }
|
7513 |
|
7514 | var request = self.buildRequest(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default()({
|
7515 | spec: spec,
|
7516 | operationId: operationId,
|
7517 | parameters: parameters,
|
7518 | securities: securities,
|
7519 | http: http
|
7520 | }, extras));
|
7521 |
|
7522 | if (request.body && (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_8___default()(request.body) || lodash_isArray__WEBPACK_IMPORTED_MODULE_9___default()(request.body))) {
|
7523 | request.body = _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_1___default()(request.body);
|
7524 | }
|
7525 |
|
7526 |
|
7527 | return http(request);
|
7528 | }
|
7529 |
|
7530 | function buildRequest(options) {
|
7531 | var spec = options.spec,
|
7532 | operationId = options.operationId,
|
7533 | responseContentType = options.responseContentType,
|
7534 | scheme = options.scheme,
|
7535 | requestInterceptor = options.requestInterceptor,
|
7536 | responseInterceptor = options.responseInterceptor,
|
7537 | contextUrl = options.contextUrl,
|
7538 | userFetch = options.userFetch,
|
7539 | server = options.server,
|
7540 | serverVariables = options.serverVariables,
|
7541 | http = options.http;
|
7542 | var parameters = options.parameters,
|
7543 | parameterBuilders = options.parameterBuilders;
|
7544 | var specIsOAS3 = Object(_helpers__WEBPACK_IMPORTED_MODULE_18__["isOAS3"])(spec);
|
7545 |
|
7546 | if (!parameterBuilders) {
|
7547 |
|
7548 | if (specIsOAS3) {
|
7549 | parameterBuilders = _oas3_parameter_builders__WEBPACK_IMPORTED_MODULE_15__;
|
7550 | } else {
|
7551 | parameterBuilders = _swagger2_parameter_builders__WEBPACK_IMPORTED_MODULE_14__["default"];
|
7552 | }
|
7553 | }
|
7554 |
|
7555 |
|
7556 | var credentials = http && http.withCredentials ? 'include' : 'same-origin';
|
7557 |
|
7558 | var req = {
|
7559 | url: '',
|
7560 | credentials: credentials,
|
7561 | headers: {},
|
7562 | cookies: {}
|
7563 | };
|
7564 |
|
7565 | if (requestInterceptor) {
|
7566 | req.requestInterceptor = requestInterceptor;
|
7567 | }
|
7568 |
|
7569 | if (responseInterceptor) {
|
7570 | req.responseInterceptor = responseInterceptor;
|
7571 | }
|
7572 |
|
7573 | if (userFetch) {
|
7574 | req.userFetch = userFetch;
|
7575 | }
|
7576 |
|
7577 | var operationRaw = Object(_helpers__WEBPACK_IMPORTED_MODULE_18__["getOperationRaw"])(spec, operationId);
|
7578 |
|
7579 | if (!operationRaw) {
|
7580 | throw new OperationNotFoundError("Operation ".concat(operationId, " not found"));
|
7581 | }
|
7582 |
|
7583 | var _operationRaw$operati = operationRaw.operation,
|
7584 | operation = _operationRaw$operati === void 0 ? {} : _operationRaw$operati,
|
7585 | method = operationRaw.method,
|
7586 | pathName = operationRaw.pathName;
|
7587 | req.url += baseUrl({
|
7588 | spec: spec,
|
7589 | scheme: scheme,
|
7590 | contextUrl: contextUrl,
|
7591 | server: server,
|
7592 | serverVariables: serverVariables,
|
7593 | pathName: pathName,
|
7594 | method: method
|
7595 | });
|
7596 |
|
7597 | if (!operationId) {
|
7598 |
|
7599 |
|
7600 |
|
7601 |
|
7602 | delete req.cookies;
|
7603 | return req;
|
7604 | }
|
7605 |
|
7606 | req.url += pathName;
|
7607 |
|
7608 | req.method = "".concat(method).toUpperCase();
|
7609 | parameters = parameters || {};
|
7610 | var path = spec.paths[pathName] || {};
|
7611 |
|
7612 | if (responseContentType) {
|
7613 | req.headers.accept = responseContentType;
|
7614 | }
|
7615 |
|
7616 | var combinedParameters = deduplicateParameters([].concat(arrayOrEmpty(operation.parameters))
|
7617 | .concat(arrayOrEmpty(path.parameters)));
|
7618 |
|
7619 |
|
7620 |
|
7621 |
|
7622 | combinedParameters.forEach(function (parameter) {
|
7623 | var builder = parameterBuilders[parameter.in];
|
7624 | var value;
|
7625 |
|
7626 | if (parameter.in === 'body' && parameter.schema && parameter.schema.properties) {
|
7627 | value = parameters;
|
7628 | }
|
7629 |
|
7630 | value = parameter && parameter.name && parameters[parameter.name];
|
7631 |
|
7632 | if (typeof value === 'undefined') {
|
7633 |
|
7634 | value = parameter && parameter.name && parameters["".concat(parameter.in, ".").concat(parameter.name)];
|
7635 | } else if (findParametersWithName(parameter.name, combinedParameters).length > 1) {
|
7636 |
|
7637 |
|
7638 |
|
7639 | console.warn("Parameter '".concat(parameter.name, "' is ambiguous because the defined spec has more than one parameter with the name: '").concat(parameter.name, "' and the passed-in parameter values did not define an 'in' value."));
|
7640 | }
|
7641 |
|
7642 | if (value === null) {
|
7643 | return;
|
7644 | }
|
7645 |
|
7646 | if (typeof parameter.default !== 'undefined' && typeof value === 'undefined') {
|
7647 | value = parameter.default;
|
7648 | }
|
7649 |
|
7650 | if (typeof value === 'undefined' && parameter.required && !parameter.allowEmptyValue) {
|
7651 | throw new Error("Required parameter ".concat(parameter.name, " is not provided"));
|
7652 | }
|
7653 |
|
7654 | if (specIsOAS3 && parameter.schema && parameter.schema.type === 'object' && typeof value === 'string') {
|
7655 | try {
|
7656 | value = JSON.parse(value);
|
7657 | } catch (e) {
|
7658 | throw new Error('Could not parse object parameter value string as JSON');
|
7659 | }
|
7660 | }
|
7661 |
|
7662 | if (builder) {
|
7663 | builder({
|
7664 | req: req,
|
7665 | parameter: parameter,
|
7666 | value: value,
|
7667 | operation: operation,
|
7668 | spec: spec
|
7669 | });
|
7670 | }
|
7671 | });
|
7672 |
|
7673 | var versionSpecificOptions = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default()({}, options), {}, {
|
7674 | operation: operation
|
7675 | });
|
7676 |
|
7677 | if (specIsOAS3) {
|
7678 | req = Object(_oas3_build_request__WEBPACK_IMPORTED_MODULE_16__["default"])(versionSpecificOptions, req);
|
7679 | } else {
|
7680 |
|
7681 | req = Object(_swagger2_build_request__WEBPACK_IMPORTED_MODULE_17__["default"])(versionSpecificOptions, req);
|
7682 | }
|
7683 |
|
7684 |
|
7685 |
|
7686 | if (req.cookies && _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default()(req.cookies).length) {
|
7687 | var cookieString = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_4___default()(req.cookies).reduce(function (prev, cookieName) {
|
7688 | var cookieValue = req.cookies[cookieName];
|
7689 | var prefix = prev ? '&' : '';
|
7690 | var stringified = cookie__WEBPACK_IMPORTED_MODULE_11___default.a.serialize(cookieName, cookieValue);
|
7691 | return prev + prefix + stringified;
|
7692 | }, '');
|
7693 |
|
7694 | req.headers.Cookie = cookieString;
|
7695 | }
|
7696 |
|
7697 | if (req.cookies) {
|
7698 |
|
7699 |
|
7700 |
|
7701 | delete req.cookies;
|
7702 | }
|
7703 |
|
7704 |
|
7705 |
|
7706 | Object(_http__WEBPACK_IMPORTED_MODULE_12__["mergeInQueryOrForm"])(req);
|
7707 | return req;
|
7708 | }
|
7709 |
|
7710 | var stripNonAlpha = function stripNonAlpha(str) {
|
7711 | return str ? str.replace(/\W/g, '') : null;
|
7712 | };
|
7713 |
|
7714 |
|
7715 | function baseUrl(obj) {
|
7716 | var specIsOAS3 = Object(_helpers__WEBPACK_IMPORTED_MODULE_18__["isOAS3"])(obj.spec);
|
7717 | return specIsOAS3 ? oas3BaseUrl(obj) : swagger2BaseUrl(obj);
|
7718 | }
|
7719 |
|
7720 | function oas3BaseUrl(_ref2) {
|
7721 | var spec = _ref2.spec,
|
7722 | pathName = _ref2.pathName,
|
7723 | method = _ref2.method,
|
7724 | server = _ref2.server,
|
7725 | contextUrl = _ref2.contextUrl,
|
7726 | _ref2$serverVariables = _ref2.serverVariables,
|
7727 | serverVariables = _ref2$serverVariables === void 0 ? {} : _ref2$serverVariables;
|
7728 | var servers = lodash_get__WEBPACK_IMPORTED_MODULE_7___default()(spec, ['paths', pathName, (method || '').toLowerCase(), 'servers']) || lodash_get__WEBPACK_IMPORTED_MODULE_7___default()(spec, ['paths', pathName, 'servers']) || lodash_get__WEBPACK_IMPORTED_MODULE_7___default()(spec, ['servers']);
|
7729 | var selectedServerUrl = '';
|
7730 | var selectedServerObj = null;
|
7731 |
|
7732 | if (server && servers && servers.length) {
|
7733 | var serverUrls = servers.map(function (srv) {
|
7734 | return srv.url;
|
7735 | });
|
7736 |
|
7737 | if (serverUrls.indexOf(server) > -1) {
|
7738 | selectedServerUrl = server;
|
7739 | selectedServerObj = servers[serverUrls.indexOf(server)];
|
7740 | }
|
7741 | }
|
7742 |
|
7743 | if (!selectedServerUrl && servers && servers.length) {
|
7744 |
|
7745 | selectedServerUrl = servers[0].url;
|
7746 |
|
7747 | var _servers = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(servers, 1);
|
7748 |
|
7749 | selectedServerObj = _servers[0];
|
7750 | }
|
7751 |
|
7752 | if (selectedServerUrl.indexOf('{') > -1) {
|
7753 |
|
7754 | var varNames = getVariableTemplateNames(selectedServerUrl);
|
7755 | varNames.forEach(function (vari) {
|
7756 | if (selectedServerObj.variables && selectedServerObj.variables[vari]) {
|
7757 |
|
7758 | var variableDefinition = selectedServerObj.variables[vari];
|
7759 | var variableValue = serverVariables[vari] || variableDefinition.default;
|
7760 | var re = new RegExp("{".concat(vari, "}"), 'g');
|
7761 | selectedServerUrl = selectedServerUrl.replace(re, variableValue);
|
7762 | }
|
7763 | });
|
7764 | }
|
7765 |
|
7766 | return buildOas3UrlWithContext(selectedServerUrl, contextUrl);
|
7767 | }
|
7768 |
|
7769 | function buildOas3UrlWithContext() {
|
7770 | var ourUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
7771 | var contextUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
7772 | var parsedUrl = url__WEBPACK_IMPORTED_MODULE_10___default.a.parse(ourUrl);
|
7773 | var parsedContextUrl = url__WEBPACK_IMPORTED_MODULE_10___default.a.parse(contextUrl);
|
7774 | var computedScheme = stripNonAlpha(parsedUrl.protocol) || stripNonAlpha(parsedContextUrl.protocol) || '';
|
7775 | var computedHost = parsedUrl.host || parsedContextUrl.host;
|
7776 | var computedPath = parsedUrl.pathname || '';
|
7777 | var res;
|
7778 |
|
7779 | if (computedScheme && computedHost) {
|
7780 | res = "".concat(computedScheme, "://").concat(computedHost + computedPath);
|
7781 | } else {
|
7782 | res = computedPath;
|
7783 | }
|
7784 |
|
7785 | return res[res.length - 1] === '/' ? res.slice(0, -1) : res;
|
7786 | }
|
7787 |
|
7788 | function getVariableTemplateNames(str) {
|
7789 | var results = [];
|
7790 | var re = /{([^}]+)}/g;
|
7791 | var text;
|
7792 |
|
7793 | while (text = re.exec(str)) {
|
7794 | results.push(text[1]);
|
7795 | }
|
7796 |
|
7797 | return results;
|
7798 | }
|
7799 |
|
7800 |
|
7801 | function swagger2BaseUrl(_ref3) {
|
7802 | var spec = _ref3.spec,
|
7803 | scheme = _ref3.scheme,
|
7804 | _ref3$contextUrl = _ref3.contextUrl,
|
7805 | contextUrl = _ref3$contextUrl === void 0 ? '' : _ref3$contextUrl;
|
7806 | var parsedContextUrl = url__WEBPACK_IMPORTED_MODULE_10___default.a.parse(contextUrl);
|
7807 | var firstSchemeInSpec = _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_6___default()(spec.schemes) ? spec.schemes[0] : null;
|
7808 | var computedScheme = scheme || firstSchemeInSpec || stripNonAlpha(parsedContextUrl.protocol) || 'http';
|
7809 | var computedHost = spec.host || parsedContextUrl.host || '';
|
7810 | var computedPath = spec.basePath || '';
|
7811 | var res;
|
7812 |
|
7813 | if (computedScheme && computedHost) {
|
7814 |
|
7815 | res = "".concat(computedScheme, "://").concat(computedHost + computedPath);
|
7816 | } else {
|
7817 |
|
7818 | res = computedPath;
|
7819 | }
|
7820 |
|
7821 |
|
7822 | return res[res.length - 1] === '/' ? res.slice(0, -1) : res;
|
7823 | }
|
7824 |
|
7825 | }),
|
7826 |
|
7827 | (function(module, exports, __webpack_require__) {
|
7828 |
|
7829 | module.exports = __webpack_require__(187);
|
7830 |
|
7831 | }),
|
7832 |
|
7833 | (function(module, exports, __webpack_require__) {
|
7834 |
|
7835 | var isObject = __webpack_require__(9);
|
7836 | var document = __webpack_require__(7).document;
|
7837 |
|
7838 | var is = isObject(document) && isObject(document.createElement);
|
7839 | module.exports = function (it) {
|
7840 | return is ? document.createElement(it) : {};
|
7841 | };
|
7842 |
|
7843 |
|
7844 | }),
|
7845 |
|
7846 | (function(module, exports, __webpack_require__) {
|
7847 |
|
7848 |
|
7849 | var isObject = __webpack_require__(9);
|
7850 |
|
7851 |
|
7852 | module.exports = function (it, S) {
|
7853 | if (!isObject(it)) return it;
|
7854 | var fn, val;
|
7855 | if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
7856 | if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
|
7857 | if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
7858 | throw TypeError("Can't convert object to primitive value");
|
7859 | };
|
7860 |
|
7861 |
|
7862 | }),
|
7863 |
|
7864 | (function(module, exports, __webpack_require__) {
|
7865 |
|
7866 |
|
7867 | var cof = __webpack_require__(50);
|
7868 |
|
7869 | module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
7870 | return cof(it) == 'String' ? it.split('') : Object(it);
|
7871 | };
|
7872 |
|
7873 |
|
7874 | }),
|
7875 |
|
7876 | (function(module, exports) {
|
7877 |
|
7878 |
|
7879 | module.exports = function (it) {
|
7880 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
7881 | return it;
|
7882 | };
|
7883 |
|
7884 |
|
7885 | }),
|
7886 |
|
7887 | (function(module, exports) {
|
7888 |
|
7889 |
|
7890 | var ceil = Math.ceil;
|
7891 | var floor = Math.floor;
|
7892 | module.exports = function (it) {
|
7893 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
7894 | };
|
7895 |
|
7896 |
|
7897 | }),
|
7898 |
|
7899 | (function(module, exports, __webpack_require__) {
|
7900 |
|
7901 | var shared = __webpack_require__(92)('keys');
|
7902 | var uid = __webpack_require__(64);
|
7903 | module.exports = function (key) {
|
7904 | return shared[key] || (shared[key] = uid(key));
|
7905 | };
|
7906 |
|
7907 |
|
7908 | }),
|
7909 |
|
7910 | (function(module, exports, __webpack_require__) {
|
7911 |
|
7912 | var core = __webpack_require__(5);
|
7913 | var global = __webpack_require__(7);
|
7914 | var SHARED = '__core-js_shared__';
|
7915 | var store = global[SHARED] || (global[SHARED] = {});
|
7916 |
|
7917 | (module.exports = function (key, value) {
|
7918 | return store[key] || (store[key] = value !== undefined ? value : {});
|
7919 | })('versions', []).push({
|
7920 | version: core.version,
|
7921 | mode: __webpack_require__(51) ? 'pure' : 'global',
|
7922 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
7923 | });
|
7924 |
|
7925 |
|
7926 | }),
|
7927 |
|
7928 | (function(module, exports) {
|
7929 |
|
7930 |
|
7931 | module.exports = (
|
7932 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
7933 | ).split(',');
|
7934 |
|
7935 |
|
7936 | }),
|
7937 |
|
7938 | (function(module, exports, __webpack_require__) {
|
7939 |
|
7940 |
|
7941 | var $keys = __webpack_require__(121);
|
7942 | var hiddenKeys = __webpack_require__(93).concat('length', 'prototype');
|
7943 |
|
7944 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
7945 | return $keys(O, hiddenKeys);
|
7946 | };
|
7947 |
|
7948 |
|
7949 | }),
|
7950 |
|
7951 | (function(module, exports, __webpack_require__) {
|
7952 |
|
7953 |
|
7954 | var $export = __webpack_require__(6);
|
7955 | var core = __webpack_require__(5);
|
7956 | var fails = __webpack_require__(28);
|
7957 | module.exports = function (KEY, exec) {
|
7958 | var fn = (core.Object || {})[KEY] || Object[KEY];
|
7959 | var exp = {};
|
7960 | exp[KEY] = exec(fn);
|
7961 | $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
|
7962 | };
|
7963 |
|
7964 |
|
7965 | }),
|
7966 |
|
7967 | (function(module, exports, __webpack_require__) {
|
7968 |
|
7969 | module.exports = __webpack_require__(27);
|
7970 |
|
7971 |
|
7972 | }),
|
7973 |
|
7974 | (function(module, exports, __webpack_require__) {
|
7975 |
|
7976 | exports.f = __webpack_require__(11);
|
7977 |
|
7978 |
|
7979 | }),
|
7980 |
|
7981 | (function(module, exports, __webpack_require__) {
|
7982 |
|
7983 | var global = __webpack_require__(7);
|
7984 | var core = __webpack_require__(5);
|
7985 | var LIBRARY = __webpack_require__(51);
|
7986 | var wksExt = __webpack_require__(97);
|
7987 | var defineProperty = __webpack_require__(19).f;
|
7988 | module.exports = function (name) {
|
7989 | var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
|
7990 | if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
|
7991 | };
|
7992 |
|
7993 |
|
7994 | }),
|
7995 |
|
7996 | (function(module, exports, __webpack_require__) {
|
7997 |
|
7998 |
|
7999 | var cof = __webpack_require__(50);
|
8000 | module.exports = Array.isArray || function isArray(arg) {
|
8001 | return cof(arg) == 'Array';
|
8002 | };
|
8003 |
|
8004 |
|
8005 | }),
|
8006 |
|
8007 | (function(module, exports) {
|
8008 |
|
8009 |
|
8010 |
|
8011 |
|
8012 |
|
8013 |
|
8014 |
|
8015 |
|
8016 |
|
8017 | function overArg(func, transform) {
|
8018 | return function(arg) {
|
8019 | return func(transform(arg));
|
8020 | };
|
8021 | }
|
8022 |
|
8023 | module.exports = overArg;
|
8024 |
|
8025 |
|
8026 | }),
|
8027 |
|
8028 | (function(module, exports) {
|
8029 |
|
8030 | var g;
|
8031 |
|
8032 |
|
8033 | g = (function() {
|
8034 | return this;
|
8035 | })();
|
8036 |
|
8037 | try {
|
8038 |
|
8039 | g = g || new Function("return this")();
|
8040 | } catch (e) {
|
8041 |
|
8042 | if (typeof window === "object") g = window;
|
8043 | }
|
8044 |
|
8045 |
|
8046 |
|
8047 |
|
8048 |
|
8049 | module.exports = g;
|
8050 |
|
8051 |
|
8052 | }),
|
8053 |
|
8054 | (function(module, exports, __webpack_require__) {
|
8055 |
|
8056 |
|
8057 | var has = __webpack_require__(23);
|
8058 | var toObject = __webpack_require__(34);
|
8059 | var IE_PROTO = __webpack_require__(91)('IE_PROTO');
|
8060 | var ObjectProto = Object.prototype;
|
8061 |
|
8062 | module.exports = Object.getPrototypeOf || function (O) {
|
8063 | O = toObject(O);
|
8064 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
8065 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
8066 | return O.constructor.prototype;
|
8067 | } return O instanceof Object ? ObjectProto : null;
|
8068 | };
|
8069 |
|
8070 |
|
8071 | }),
|
8072 |
|
8073 | (function(module, exports, __webpack_require__) {
|
8074 |
|
8075 | var classof = __webpack_require__(104);
|
8076 | var ITERATOR = __webpack_require__(11)('iterator');
|
8077 | var Iterators = __webpack_require__(41);
|
8078 | module.exports = __webpack_require__(5).getIteratorMethod = function (it) {
|
8079 | if (it != undefined) return it[ITERATOR]
|
8080 | || it['@@iterator']
|
8081 | || Iterators[classof(it)];
|
8082 | };
|
8083 |
|
8084 |
|
8085 | }),
|
8086 |
|
8087 | (function(module, exports, __webpack_require__) {
|
8088 |
|
8089 |
|
8090 | var cof = __webpack_require__(50);
|
8091 | var TAG = __webpack_require__(11)('toStringTag');
|
8092 |
|
8093 | var ARG = cof(function () { return arguments; }()) == 'Arguments';
|
8094 |
|
8095 |
|
8096 | var tryGet = function (it, key) {
|
8097 | try {
|
8098 | return it[key];
|
8099 | } catch (e) { }
|
8100 | };
|
8101 |
|
8102 | module.exports = function (it) {
|
8103 | var O, T, B;
|
8104 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
8105 |
|
8106 | : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
|
8107 |
|
8108 | : ARG ? cof(O)
|
8109 |
|
8110 | : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
|
8111 | };
|
8112 |
|
8113 |
|
8114 | }),
|
8115 |
|
8116 | (function(module, exports) {
|
8117 |
|
8118 |
|
8119 |
|
8120 | }),
|
8121 |
|
8122 | (function(module, exports, __webpack_require__) {
|
8123 |
|
8124 | var _Array$from = __webpack_require__(76);
|
8125 |
|
8126 | var arrayLikeToArray = __webpack_require__(142);
|
8127 |
|
8128 | function _unsupportedIterableToArray(o, minLen) {
|
8129 | if (!o) return;
|
8130 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
8131 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
8132 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
8133 | if (n === "Map" || n === "Set") return _Array$from(o);
|
8134 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
8135 | }
|
8136 |
|
8137 | module.exports = _unsupportedIterableToArray;
|
8138 |
|
8139 | }),
|
8140 |
|
8141 | (function(module, exports) {
|
8142 |
|
8143 | module.exports = function (it, Constructor, name, forbiddenField) {
|
8144 | if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
|
8145 | throw TypeError(name + ': incorrect invocation!');
|
8146 | } return it;
|
8147 | };
|
8148 |
|
8149 |
|
8150 | }),
|
8151 |
|
8152 | (function(module, exports, __webpack_require__) {
|
8153 |
|
8154 | "use strict";
|
8155 |
|
8156 |
|
8157 | var aFunction = __webpack_require__(33);
|
8158 |
|
8159 | function PromiseCapability(C) {
|
8160 | var resolve, reject;
|
8161 | this.promise = new C(function ($$resolve, $$reject) {
|
8162 | if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
8163 | resolve = $$resolve;
|
8164 | reject = $$reject;
|
8165 | });
|
8166 | this.resolve = aFunction(resolve);
|
8167 | this.reject = aFunction(reject);
|
8168 | }
|
8169 |
|
8170 | module.exports.f = function (C) {
|
8171 | return new PromiseCapability(C);
|
8172 | };
|
8173 |
|
8174 |
|
8175 | }),
|
8176 |
|
8177 | (function(module, exports, __webpack_require__) {
|
8178 |
|
8179 | var hide = __webpack_require__(27);
|
8180 | module.exports = function (target, src, safe) {
|
8181 | for (var key in src) {
|
8182 | if (safe && target[key]) target[key] = src[key];
|
8183 | else hide(target, key, src[key]);
|
8184 | } return target;
|
8185 | };
|
8186 |
|
8187 |
|
8188 | }),
|
8189 |
|
8190 | (function(module, exports, __webpack_require__) {
|
8191 |
|
8192 | "use strict";
|
8193 |
|
8194 |
|
8195 | var has = Object.prototype.hasOwnProperty;
|
8196 | var isArray = Array.isArray;
|
8197 |
|
8198 | var hexTable = (function () {
|
8199 | var array = [];
|
8200 | for (var i = 0; i < 256; ++i) {
|
8201 | array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
8202 | }
|
8203 |
|
8204 | return array;
|
8205 | }());
|
8206 |
|
8207 | var compactQueue = function compactQueue(queue) {
|
8208 | while (queue.length > 1) {
|
8209 | var item = queue.pop();
|
8210 | var obj = item.obj[item.prop];
|
8211 |
|
8212 | if (isArray(obj)) {
|
8213 | var compacted = [];
|
8214 |
|
8215 | for (var j = 0; j < obj.length; ++j) {
|
8216 | if (typeof obj[j] !== 'undefined') {
|
8217 | compacted.push(obj[j]);
|
8218 | }
|
8219 | }
|
8220 |
|
8221 | item.obj[item.prop] = compacted;
|
8222 | }
|
8223 | }
|
8224 | };
|
8225 |
|
8226 | var arrayToObject = function arrayToObject(source, options) {
|
8227 | var obj = options && options.plainObjects ? Object.create(null) : {};
|
8228 | for (var i = 0; i < source.length; ++i) {
|
8229 | if (typeof source[i] !== 'undefined') {
|
8230 | obj[i] = source[i];
|
8231 | }
|
8232 | }
|
8233 |
|
8234 | return obj;
|
8235 | };
|
8236 |
|
8237 | var merge = function merge(target, source, options) {
|
8238 |
|
8239 | if (!source) {
|
8240 | return target;
|
8241 | }
|
8242 |
|
8243 | if (typeof source !== 'object') {
|
8244 | if (isArray(target)) {
|
8245 | target.push(source);
|
8246 | } else if (target && typeof target === 'object') {
|
8247 | if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
|
8248 | target[source] = true;
|
8249 | }
|
8250 | } else {
|
8251 | return [target, source];
|
8252 | }
|
8253 |
|
8254 | return target;
|
8255 | }
|
8256 |
|
8257 | if (!target || typeof target !== 'object') {
|
8258 | return [target].concat(source);
|
8259 | }
|
8260 |
|
8261 | var mergeTarget = target;
|
8262 | if (isArray(target) && !isArray(source)) {
|
8263 | mergeTarget = arrayToObject(target, options);
|
8264 | }
|
8265 |
|
8266 | if (isArray(target) && isArray(source)) {
|
8267 | source.forEach(function (item, i) {
|
8268 | if (has.call(target, i)) {
|
8269 | var targetItem = target[i];
|
8270 | if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
8271 | target[i] = merge(targetItem, item, options);
|
8272 | } else {
|
8273 | target.push(item);
|
8274 | }
|
8275 | } else {
|
8276 | target[i] = item;
|
8277 | }
|
8278 | });
|
8279 | return target;
|
8280 | }
|
8281 |
|
8282 | return Object.keys(source).reduce(function (acc, key) {
|
8283 | var value = source[key];
|
8284 |
|
8285 | if (has.call(acc, key)) {
|
8286 | acc[key] = merge(acc[key], value, options);
|
8287 | } else {
|
8288 | acc[key] = value;
|
8289 | }
|
8290 | return acc;
|
8291 | }, mergeTarget);
|
8292 | };
|
8293 |
|
8294 | var assign = function assignSingleSource(target, source) {
|
8295 | return Object.keys(source).reduce(function (acc, key) {
|
8296 | acc[key] = source[key];
|
8297 | return acc;
|
8298 | }, target);
|
8299 | };
|
8300 |
|
8301 | var decode = function (str, decoder, charset) {
|
8302 | var strWithoutPlus = str.replace(/\+/g, ' ');
|
8303 | if (charset === 'iso-8859-1') {
|
8304 |
|
8305 | return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
8306 | }
|
8307 |
|
8308 | try {
|
8309 | return decodeURIComponent(strWithoutPlus);
|
8310 | } catch (e) {
|
8311 | return strWithoutPlus;
|
8312 | }
|
8313 | };
|
8314 |
|
8315 | var encode = function encode(str, defaultEncoder, charset) {
|
8316 |
|
8317 |
|
8318 | if (str.length === 0) {
|
8319 | return str;
|
8320 | }
|
8321 |
|
8322 | var string = str;
|
8323 | if (typeof str === 'symbol') {
|
8324 | string = Symbol.prototype.toString.call(str);
|
8325 | } else if (typeof str !== 'string') {
|
8326 | string = String(str);
|
8327 | }
|
8328 |
|
8329 | if (charset === 'iso-8859-1') {
|
8330 | return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
8331 | return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
8332 | });
|
8333 | }
|
8334 |
|
8335 | var out = '';
|
8336 | for (var i = 0; i < string.length; ++i) {
|
8337 | var c = string.charCodeAt(i);
|
8338 |
|
8339 | if (
|
8340 | c === 0x2D
|
8341 | || c === 0x2E
|
8342 | || c === 0x5F
|
8343 | || c === 0x7E
|
8344 | || (c >= 0x30 && c <= 0x39)
|
8345 | || (c >= 0x41 && c <= 0x5A)
|
8346 | || (c >= 0x61 && c <= 0x7A)
|
8347 | ) {
|
8348 | out += string.charAt(i);
|
8349 | continue;
|
8350 | }
|
8351 |
|
8352 | if (c < 0x80) {
|
8353 | out = out + hexTable[c];
|
8354 | continue;
|
8355 | }
|
8356 |
|
8357 | if (c < 0x800) {
|
8358 | out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
8359 | continue;
|
8360 | }
|
8361 |
|
8362 | if (c < 0xD800 || c >= 0xE000) {
|
8363 | out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
8364 | continue;
|
8365 | }
|
8366 |
|
8367 | i += 1;
|
8368 | c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
8369 | out += hexTable[0xF0 | (c >> 18)]
|
8370 | + hexTable[0x80 | ((c >> 12) & 0x3F)]
|
8371 | + hexTable[0x80 | ((c >> 6) & 0x3F)]
|
8372 | + hexTable[0x80 | (c & 0x3F)];
|
8373 | }
|
8374 |
|
8375 | return out;
|
8376 | };
|
8377 |
|
8378 | var compact = function compact(value) {
|
8379 | var queue = [{ obj: { o: value }, prop: 'o' }];
|
8380 | var refs = [];
|
8381 |
|
8382 | for (var i = 0; i < queue.length; ++i) {
|
8383 | var item = queue[i];
|
8384 | var obj = item.obj[item.prop];
|
8385 |
|
8386 | var keys = Object.keys(obj);
|
8387 | for (var j = 0; j < keys.length; ++j) {
|
8388 | var key = keys[j];
|
8389 | var val = obj[key];
|
8390 | if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
8391 | queue.push({ obj: obj, prop: key });
|
8392 | refs.push(val);
|
8393 | }
|
8394 | }
|
8395 | }
|
8396 |
|
8397 | compactQueue(queue);
|
8398 |
|
8399 | return value;
|
8400 | };
|
8401 |
|
8402 | var isRegExp = function isRegExp(obj) {
|
8403 | return Object.prototype.toString.call(obj) === '[object RegExp]';
|
8404 | };
|
8405 |
|
8406 | var isBuffer = function isBuffer(obj) {
|
8407 | if (!obj || typeof obj !== 'object') {
|
8408 | return false;
|
8409 | }
|
8410 |
|
8411 | return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
8412 | };
|
8413 |
|
8414 | var combine = function combine(a, b) {
|
8415 | return [].concat(a, b);
|
8416 | };
|
8417 |
|
8418 | var maybeMap = function maybeMap(val, fn) {
|
8419 | if (isArray(val)) {
|
8420 | var mapped = [];
|
8421 | for (var i = 0; i < val.length; i += 1) {
|
8422 | mapped.push(fn(val[i]));
|
8423 | }
|
8424 | return mapped;
|
8425 | }
|
8426 | return fn(val);
|
8427 | };
|
8428 |
|
8429 | module.exports = {
|
8430 | arrayToObject: arrayToObject,
|
8431 | assign: assign,
|
8432 | combine: combine,
|
8433 | compact: compact,
|
8434 | decode: decode,
|
8435 | encode: encode,
|
8436 | isBuffer: isBuffer,
|
8437 | isRegExp: isRegExp,
|
8438 | maybeMap: maybeMap,
|
8439 | merge: merge
|
8440 | };
|
8441 |
|
8442 |
|
8443 | }),
|
8444 |
|
8445 | (function(module, exports, __webpack_require__) {
|
8446 |
|
8447 | "use strict";
|
8448 |
|
8449 |
|
8450 |
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 | var Schema = __webpack_require__(43);
|
8456 |
|
8457 |
|
8458 | module.exports = new Schema({
|
8459 | explicit: [
|
8460 | __webpack_require__(259),
|
8461 | __webpack_require__(260),
|
8462 | __webpack_require__(261)
|
8463 | ]
|
8464 | });
|
8465 |
|
8466 |
|
8467 | }),
|
8468 |
|
8469 | (function(module, exports) {
|
8470 |
|
8471 |
|
8472 |
|
8473 |
|
8474 |
|
8475 |
|
8476 |
|
8477 |
|
8478 |
|
8479 |
|
8480 |
|
8481 |
|
8482 |
|
8483 |
|
8484 |
|
8485 |
|
8486 |
|
8487 | function identity(value) {
|
8488 | return value;
|
8489 | }
|
8490 |
|
8491 | module.exports = identity;
|
8492 |
|
8493 |
|
8494 | }),
|
8495 |
|
8496 | (function(module, exports, __webpack_require__) {
|
8497 |
|
8498 | Object.defineProperty(exports, "__esModule", { value: true });
|
8499 | var areEquals = __webpack_require__(319);
|
8500 | var helpers_1 = __webpack_require__(74);
|
8501 | exports.JsonPatchError = helpers_1.PatchError;
|
8502 | exports.deepClone = helpers_1._deepClone;
|
8503 |
|
8504 |
|
8505 |
|
8506 |
|
8507 |
|
8508 |
|
8509 |
|
8510 | var objOps = {
|
8511 | add: function (obj, key, document) {
|
8512 | obj[key] = this.value;
|
8513 | return { newDocument: document };
|
8514 | },
|
8515 | remove: function (obj, key, document) {
|
8516 | var removed = obj[key];
|
8517 | delete obj[key];
|
8518 | return { newDocument: document, removed: removed };
|
8519 | },
|
8520 | replace: function (obj, key, document) {
|
8521 | var removed = obj[key];
|
8522 | obj[key] = this.value;
|
8523 | return { newDocument: document, removed: removed };
|
8524 | },
|
8525 | move: function (obj, key, document) {
|
8526 | |
8527 |
|
8528 |
|
8529 | var removed = getValueByPointer(document, this.path);
|
8530 | if (removed) {
|
8531 | removed = helpers_1._deepClone(removed);
|
8532 | }
|
8533 | var originalValue = applyOperation(document, { op: "remove", path: this.from }).removed;
|
8534 | applyOperation(document, { op: "add", path: this.path, value: originalValue });
|
8535 | return { newDocument: document, removed: removed };
|
8536 | },
|
8537 | copy: function (obj, key, document) {
|
8538 | var valueToCopy = getValueByPointer(document, this.from);
|
8539 |
|
8540 | applyOperation(document, { op: "add", path: this.path, value: helpers_1._deepClone(valueToCopy) });
|
8541 | return { newDocument: document };
|
8542 | },
|
8543 | test: function (obj, key, document) {
|
8544 | return { newDocument: document, test: areEquals(obj[key], this.value) };
|
8545 | },
|
8546 | _get: function (obj, key, document) {
|
8547 | this.value = obj[key];
|
8548 | return { newDocument: document };
|
8549 | }
|
8550 | };
|
8551 |
|
8552 | var arrOps = {
|
8553 | add: function (arr, i, document) {
|
8554 | if (helpers_1.isInteger(i)) {
|
8555 | arr.splice(i, 0, this.value);
|
8556 | }
|
8557 | else {
|
8558 | arr[i] = this.value;
|
8559 | }
|
8560 |
|
8561 | return { newDocument: document, index: i };
|
8562 | },
|
8563 | remove: function (arr, i, document) {
|
8564 | var removedList = arr.splice(i, 1);
|
8565 | return { newDocument: document, removed: removedList[0] };
|
8566 | },
|
8567 | replace: function (arr, i, document) {
|
8568 | var removed = arr[i];
|
8569 | arr[i] = this.value;
|
8570 | return { newDocument: document, removed: removed };
|
8571 | },
|
8572 | move: objOps.move,
|
8573 | copy: objOps.copy,
|
8574 | test: objOps.test,
|
8575 | _get: objOps._get
|
8576 | };
|
8577 |
|
8578 |
|
8579 |
|
8580 |
|
8581 |
|
8582 |
|
8583 |
|
8584 |
|
8585 | function getValueByPointer(document, pointer) {
|
8586 | if (pointer == '') {
|
8587 | return document;
|
8588 | }
|
8589 | var getOriginalDestination = { op: "_get", path: pointer };
|
8590 | applyOperation(document, getOriginalDestination);
|
8591 | return getOriginalDestination.value;
|
8592 | }
|
8593 | exports.getValueByPointer = getValueByPointer;
|
8594 |
|
8595 |
|
8596 |
|
8597 |
|
8598 |
|
8599 |
|
8600 |
|
8601 |
|
8602 |
|
8603 |
|
8604 |
|
8605 |
|
8606 |
|
8607 |
|
8608 | function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {
|
8609 | if (validateOperation === void 0) { validateOperation = false; }
|
8610 | if (mutateDocument === void 0) { mutateDocument = true; }
|
8611 | if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }
|
8612 | if (index === void 0) { index = 0; }
|
8613 | if (validateOperation) {
|
8614 | if (typeof validateOperation == 'function') {
|
8615 | validateOperation(operation, 0, document, operation.path);
|
8616 | }
|
8617 | else {
|
8618 | validator(operation, 0);
|
8619 | }
|
8620 | }
|
8621 |
|
8622 | if (operation.path === "") {
|
8623 | var returnValue = { newDocument: document };
|
8624 | if (operation.op === 'add') {
|
8625 | returnValue.newDocument = operation.value;
|
8626 | return returnValue;
|
8627 | }
|
8628 | else if (operation.op === 'replace') {
|
8629 | returnValue.newDocument = operation.value;
|
8630 | returnValue.removed = document;
|
8631 | return returnValue;
|
8632 | }
|
8633 | else if (operation.op === 'move' || operation.op === 'copy') {
|
8634 | returnValue.newDocument = getValueByPointer(document, operation.from);
|
8635 | if (operation.op === 'move') {
|
8636 | returnValue.removed = document;
|
8637 | }
|
8638 | return returnValue;
|
8639 | }
|
8640 | else if (operation.op === 'test') {
|
8641 | returnValue.test = areEquals(document, operation.value);
|
8642 | if (returnValue.test === false) {
|
8643 | throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
|
8644 | }
|
8645 | returnValue.newDocument = document;
|
8646 | return returnValue;
|
8647 | }
|
8648 | else if (operation.op === 'remove') {
|
8649 | returnValue.removed = document;
|
8650 | returnValue.newDocument = null;
|
8651 | return returnValue;
|
8652 | }
|
8653 | else if (operation.op === '_get') {
|
8654 | operation.value = document;
|
8655 | return returnValue;
|
8656 | }
|
8657 | else {
|
8658 | if (validateOperation) {
|
8659 | throw new exports.JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);
|
8660 | }
|
8661 | else {
|
8662 | return returnValue;
|
8663 | }
|
8664 | }
|
8665 | }
|
8666 | else {
|
8667 | if (!mutateDocument) {
|
8668 | document = helpers_1._deepClone(document);
|
8669 | }
|
8670 | var path = operation.path || "";
|
8671 | var keys = path.split('/');
|
8672 | var obj = document;
|
8673 | var t = 1;
|
8674 | var len = keys.length;
|
8675 | var existingPathFragment = undefined;
|
8676 | var key = void 0;
|
8677 | var validateFunction = void 0;
|
8678 | if (typeof validateOperation == 'function') {
|
8679 | validateFunction = validateOperation;
|
8680 | }
|
8681 | else {
|
8682 | validateFunction = validator;
|
8683 | }
|
8684 | while (true) {
|
8685 | key = keys[t];
|
8686 | if (banPrototypeModifications && key == '__proto__') {
|
8687 | throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
|
8688 | }
|
8689 | if (validateOperation) {
|
8690 | if (existingPathFragment === undefined) {
|
8691 | if (obj[key] === undefined) {
|
8692 | existingPathFragment = keys.slice(0, t).join('/');
|
8693 | }
|
8694 | else if (t == len - 1) {
|
8695 | existingPathFragment = operation.path;
|
8696 | }
|
8697 | if (existingPathFragment !== undefined) {
|
8698 | validateFunction(operation, 0, document, existingPathFragment);
|
8699 | }
|
8700 | }
|
8701 | }
|
8702 | t++;
|
8703 | if (Array.isArray(obj)) {
|
8704 | if (key === '-') {
|
8705 | key = obj.length;
|
8706 | }
|
8707 | else {
|
8708 | if (validateOperation && !helpers_1.isInteger(key)) {
|
8709 | throw new exports.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index, operation, document);
|
8710 | }
|
8711 | else if (helpers_1.isInteger(key)) {
|
8712 | key = ~~key;
|
8713 | }
|
8714 | }
|
8715 | if (t >= len) {
|
8716 | if (validateOperation && operation.op === "add" && key > obj.length) {
|
8717 | throw new exports.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", index, operation, document);
|
8718 | }
|
8719 | var returnValue = arrOps[operation.op].call(operation, obj, key, document);
|
8720 | if (returnValue.test === false) {
|
8721 | throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
|
8722 | }
|
8723 | return returnValue;
|
8724 | }
|
8725 | }
|
8726 | else {
|
8727 | if (key && key.indexOf('~') != -1) {
|
8728 | key = helpers_1.unescapePathComponent(key);
|
8729 | }
|
8730 | if (t >= len) {
|
8731 | var returnValue = objOps[operation.op].call(operation, obj, key, document);
|
8732 | if (returnValue.test === false) {
|
8733 | throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
|
8734 | }
|
8735 | return returnValue;
|
8736 | }
|
8737 | }
|
8738 | obj = obj[key];
|
8739 | }
|
8740 | }
|
8741 | }
|
8742 | exports.applyOperation = applyOperation;
|
8743 |
|
8744 |
|
8745 |
|
8746 |
|
8747 |
|
8748 |
|
8749 |
|
8750 |
|
8751 |
|
8752 |
|
8753 |
|
8754 |
|
8755 |
|
8756 |
|
8757 | function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {
|
8758 | if (mutateDocument === void 0) { mutateDocument = true; }
|
8759 | if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }
|
8760 | if (validateOperation) {
|
8761 | if (!Array.isArray(patch)) {
|
8762 | throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');
|
8763 | }
|
8764 | }
|
8765 | if (!mutateDocument) {
|
8766 | document = helpers_1._deepClone(document);
|
8767 | }
|
8768 | var results = new Array(patch.length);
|
8769 | for (var i = 0, length_1 = patch.length; i < length_1; i++) {
|
8770 |
|
8771 | results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);
|
8772 | document = results[i].newDocument;
|
8773 | }
|
8774 | results.newDocument = document;
|
8775 | return results;
|
8776 | }
|
8777 | exports.applyPatch = applyPatch;
|
8778 |
|
8779 |
|
8780 |
|
8781 |
|
8782 |
|
8783 |
|
8784 |
|
8785 |
|
8786 |
|
8787 | function applyReducer(document, operation, index) {
|
8788 | var operationResult = applyOperation(document, operation);
|
8789 | if (operationResult.test === false) {
|
8790 | throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
|
8791 | }
|
8792 | return operationResult.newDocument;
|
8793 | }
|
8794 | exports.applyReducer = applyReducer;
|
8795 |
|
8796 |
|
8797 |
|
8798 |
|
8799 |
|
8800 |
|
8801 |
|
8802 | function validator(operation, index, document, existingPathFragment) {
|
8803 | if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {
|
8804 | throw new exports.JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);
|
8805 | }
|
8806 | else if (!objOps[operation.op]) {
|
8807 | throw new exports.JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);
|
8808 | }
|
8809 | else if (typeof operation.path !== 'string') {
|
8810 | throw new exports.JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);
|
8811 | }
|
8812 | else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {
|
8813 |
|
8814 | throw new exports.JsonPatchError('Operation `path` property must start with "/"', 'OPERATION_PATH_INVALID', index, operation, document);
|
8815 | }
|
8816 | else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {
|
8817 | throw new exports.JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);
|
8818 | }
|
8819 | else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {
|
8820 | throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);
|
8821 | }
|
8822 | else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && helpers_1.hasUndefined(operation.value)) {
|
8823 | throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);
|
8824 | }
|
8825 | else if (document) {
|
8826 | if (operation.op == "add") {
|
8827 | var pathLen = operation.path.split("/").length;
|
8828 | var existingPathLen = existingPathFragment.split("/").length;
|
8829 | if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {
|
8830 | throw new exports.JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);
|
8831 | }
|
8832 | }
|
8833 | else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {
|
8834 | if (operation.path !== existingPathFragment) {
|
8835 | throw new exports.JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);
|
8836 | }
|
8837 | }
|
8838 | else if (operation.op === 'move' || operation.op === 'copy') {
|
8839 | var existingValue = { op: "_get", path: operation.from, value: undefined };
|
8840 | var error = validate([existingValue], document);
|
8841 | if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {
|
8842 | throw new exports.JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);
|
8843 | }
|
8844 | }
|
8845 | }
|
8846 | }
|
8847 | exports.validator = validator;
|
8848 |
|
8849 |
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 | function validate(sequence, document, externalValidator) {
|
8856 | try {
|
8857 | if (!Array.isArray(sequence)) {
|
8858 | throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');
|
8859 | }
|
8860 | if (document) {
|
8861 |
|
8862 | applyPatch(helpers_1._deepClone(document), helpers_1._deepClone(sequence), externalValidator || true);
|
8863 | }
|
8864 | else {
|
8865 | externalValidator = externalValidator || validator;
|
8866 | for (var i = 0; i < sequence.length; i++) {
|
8867 | externalValidator(sequence[i], i, document, undefined);
|
8868 | }
|
8869 | }
|
8870 | }
|
8871 | catch (e) {
|
8872 | if (e instanceof exports.JsonPatchError) {
|
8873 | return e;
|
8874 | }
|
8875 | else {
|
8876 | throw e;
|
8877 | }
|
8878 | }
|
8879 | }
|
8880 | exports.validate = validate;
|
8881 |
|
8882 |
|
8883 |
|
8884 | exports.default = {
|
8885 | JsonPatchError: exports.JsonPatchError,
|
8886 | deepClone: exports.deepClone,
|
8887 | getValueByPointer: getValueByPointer,
|
8888 | applyOperation: applyOperation,
|
8889 | applyPatch: applyPatch,
|
8890 | applyReducer: applyReducer,
|
8891 | validator: validator,
|
8892 | validate: validate
|
8893 | };
|
8894 |
|
8895 |
|
8896 | }),
|
8897 |
|
8898 | (function(module, exports, __webpack_require__) {
|
8899 |
|
8900 |
|
8901 |
|
8902 |
|
8903 |
|
8904 |
|
8905 |
|
8906 |
|
8907 | var ctx = __webpack_require__(26);
|
8908 | var IObject = __webpack_require__(88);
|
8909 | var toObject = __webpack_require__(34);
|
8910 | var toLength = __webpack_require__(63);
|
8911 | var asc = __webpack_require__(351);
|
8912 | module.exports = function (TYPE, $create) {
|
8913 | var IS_MAP = TYPE == 1;
|
8914 | var IS_FILTER = TYPE == 2;
|
8915 | var IS_SOME = TYPE == 3;
|
8916 | var IS_EVERY = TYPE == 4;
|
8917 | var IS_FIND_INDEX = TYPE == 6;
|
8918 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
8919 | var create = $create || asc;
|
8920 | return function ($this, callbackfn, that) {
|
8921 | var O = toObject($this);
|
8922 | var self = IObject(O);
|
8923 | var f = ctx(callbackfn, that, 3);
|
8924 | var length = toLength(self.length);
|
8925 | var index = 0;
|
8926 | var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
8927 | var val, res;
|
8928 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
8929 | val = self[index];
|
8930 | res = f(val, index, O);
|
8931 | if (TYPE) {
|
8932 | if (IS_MAP) result[index] = res;
|
8933 | else if (res) switch (TYPE) {
|
8934 | case 3: return true;
|
8935 | case 5: return val;
|
8936 | case 6: return index;
|
8937 | case 2: result.push(val);
|
8938 | } else if (IS_EVERY) return false;
|
8939 | }
|
8940 | }
|
8941 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
|
8942 | };
|
8943 | };
|
8944 |
|
8945 |
|
8946 | }),
|
8947 |
|
8948 | (function(module, exports, __webpack_require__) {
|
8949 |
|
8950 | var isObject = __webpack_require__(9);
|
8951 | module.exports = function (it, TYPE) {
|
8952 | if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
|
8953 | return it;
|
8954 | };
|
8955 |
|
8956 |
|
8957 | }),
|
8958 |
|
8959 | (function(module, exports, __webpack_require__) {
|
8960 |
|
8961 | var _Object$defineProperty = __webpack_require__(85);
|
8962 |
|
8963 | function _defineProperty(obj, key, value) {
|
8964 | if (key in obj) {
|
8965 | _Object$defineProperty(obj, key, {
|
8966 | value: value,
|
8967 | enumerable: true,
|
8968 | configurable: true,
|
8969 | writable: true
|
8970 | });
|
8971 | } else {
|
8972 | obj[key] = value;
|
8973 | }
|
8974 |
|
8975 | return obj;
|
8976 | }
|
8977 |
|
8978 | module.exports = _defineProperty;
|
8979 |
|
8980 | }),
|
8981 |
|
8982 | (function(module, exports) {
|
8983 |
|
8984 |
|
8985 |
|
8986 |
|
8987 |
|
8988 |
|
8989 |
|
8990 |
|
8991 |
|
8992 |
|
8993 |
|
8994 |
|
8995 |
|
8996 | function noop() {
|
8997 |
|
8998 | }
|
8999 |
|
9000 | module.exports = noop;
|
9001 |
|
9002 |
|
9003 | }),
|
9004 |
|
9005 | (function(module, exports, __webpack_require__) {
|
9006 |
|
9007 | "use strict";
|
9008 |
|
9009 |
|
9010 |
|
9011 |
|
9012 | var QueryString = exports;
|
9013 | var Buffer = __webpack_require__(29).Buffer;
|
9014 |
|
9015 |
|
9016 |
|
9017 | QueryString.unescapeBuffer = function(s, decodeSpaces) {
|
9018 | var out = new Buffer(s.length);
|
9019 | var state = 0;
|
9020 | var n, m, hexchar;
|
9021 |
|
9022 | for (var inIndex = 0, outIndex = 0; inIndex <= s.length; inIndex++) {
|
9023 | var c = inIndex < s.length ? s.charCodeAt(inIndex) : NaN;
|
9024 | switch (state) {
|
9025 | case 0:
|
9026 | switch (c) {
|
9027 | case 37:
|
9028 | n = 0;
|
9029 | m = 0;
|
9030 | state = 1;
|
9031 | break;
|
9032 | case 43:
|
9033 | if (decodeSpaces)
|
9034 | c = 32;
|
9035 |
|
9036 | default:
|
9037 | out[outIndex++] = c;
|
9038 | break;
|
9039 | }
|
9040 | break;
|
9041 |
|
9042 | case 1:
|
9043 | hexchar = c;
|
9044 | if (c >= 48 && c <= 57) {
|
9045 | n = c - 48;
|
9046 | } else if (c >= 65 && c <= 70) {
|
9047 | n = c - 65 + 10;
|
9048 | } else if (c >= 97 && c <= 102) {
|
9049 | n = c - 97 + 10;
|
9050 | } else {
|
9051 | out[outIndex++] = 37;
|
9052 | out[outIndex++] = c;
|
9053 | state = 0;
|
9054 | break;
|
9055 | }
|
9056 | state = 2;
|
9057 | break;
|
9058 |
|
9059 | case 2:
|
9060 | state = 0;
|
9061 | if (c >= 48 && c <= 57) {
|
9062 | m = c - 48;
|
9063 | } else if (c >= 65 && c <= 70) {
|
9064 | m = c - 65 + 10;
|
9065 | } else if (c >= 97 && c <= 102) {
|
9066 | m = c - 97 + 10;
|
9067 | } else {
|
9068 | out[outIndex++] = 37;
|
9069 | out[outIndex++] = hexchar;
|
9070 | out[outIndex++] = c;
|
9071 | break;
|
9072 | }
|
9073 | out[outIndex++] = 16 * n + m;
|
9074 | break;
|
9075 | }
|
9076 | }
|
9077 |
|
9078 |
|
9079 |
|
9080 | return out.slice(0, outIndex - 1);
|
9081 | };
|
9082 |
|
9083 |
|
9084 | function qsUnescape(s, decodeSpaces) {
|
9085 | try {
|
9086 | return decodeURIComponent(s);
|
9087 | } catch (e) {
|
9088 | return QueryString.unescapeBuffer(s, decodeSpaces).toString();
|
9089 | }
|
9090 | }
|
9091 | QueryString.unescape = qsUnescape;
|
9092 |
|
9093 |
|
9094 | var hexTable = new Array(256);
|
9095 | for (var i = 0; i < 256; ++i)
|
9096 | hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
|
9097 | QueryString.escape = function(str) {
|
9098 |
|
9099 |
|
9100 | if (typeof str !== 'string')
|
9101 | str += '';
|
9102 | var out = '';
|
9103 | var lastPos = 0;
|
9104 |
|
9105 | for (var i = 0; i < str.length; ++i) {
|
9106 | var c = str.charCodeAt(i);
|
9107 |
|
9108 |
|
9109 |
|
9110 |
|
9111 |
|
9112 |
|
9113 |
|
9114 | if (c === 0x21 || c === 0x2D || c === 0x2E || c === 0x5F || c === 0x7E ||
|
9115 | (c >= 0x27 && c <= 0x2A) ||
|
9116 | (c >= 0x30 && c <= 0x39) ||
|
9117 | (c >= 0x41 && c <= 0x5A) ||
|
9118 | (c >= 0x61 && c <= 0x7A)) {
|
9119 | continue;
|
9120 | }
|
9121 |
|
9122 | if (i - lastPos > 0)
|
9123 | out += str.slice(lastPos, i);
|
9124 |
|
9125 |
|
9126 | if (c < 0x80) {
|
9127 | lastPos = i + 1;
|
9128 | out += hexTable[c];
|
9129 | continue;
|
9130 | }
|
9131 |
|
9132 |
|
9133 | if (c < 0x800) {
|
9134 | lastPos = i + 1;
|
9135 | out += hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)];
|
9136 | continue;
|
9137 | }
|
9138 | if (c < 0xD800 || c >= 0xE000) {
|
9139 | lastPos = i + 1;
|
9140 | out += hexTable[0xE0 | (c >> 12)] +
|
9141 | hexTable[0x80 | ((c >> 6) & 0x3F)] +
|
9142 | hexTable[0x80 | (c & 0x3F)];
|
9143 | continue;
|
9144 | }
|
9145 |
|
9146 | ++i;
|
9147 | var c2;
|
9148 | if (i < str.length)
|
9149 | c2 = str.charCodeAt(i) & 0x3FF;
|
9150 | else
|
9151 | throw new URIError('URI malformed');
|
9152 | lastPos = i + 1;
|
9153 | c = 0x10000 + (((c & 0x3FF) << 10) | c2);
|
9154 | out += hexTable[0xF0 | (c >> 18)] +
|
9155 | hexTable[0x80 | ((c >> 12) & 0x3F)] +
|
9156 | hexTable[0x80 | ((c >> 6) & 0x3F)] +
|
9157 | hexTable[0x80 | (c & 0x3F)];
|
9158 | }
|
9159 | if (lastPos === 0)
|
9160 | return str;
|
9161 | if (lastPos < str.length)
|
9162 | return out + str.slice(lastPos);
|
9163 | return out;
|
9164 | };
|
9165 |
|
9166 | var stringifyPrimitive = function(v) {
|
9167 | if (typeof v === 'string')
|
9168 | return v;
|
9169 | if (typeof v === 'number' && isFinite(v))
|
9170 | return '' + v;
|
9171 | if (typeof v === 'boolean')
|
9172 | return v ? 'true' : 'false';
|
9173 | return '';
|
9174 | };
|
9175 |
|
9176 |
|
9177 | QueryString.stringify = QueryString.encode = function(obj, sep, eq, options) {
|
9178 | sep = sep || '&';
|
9179 | eq = eq || '=';
|
9180 |
|
9181 | var encode = QueryString.escape;
|
9182 | if (options && typeof options.encodeURIComponent === 'function') {
|
9183 | encode = options.encodeURIComponent;
|
9184 | }
|
9185 |
|
9186 | if (obj !== null && typeof obj === 'object') {
|
9187 | var keys = Object.keys(obj);
|
9188 | var len = keys.length;
|
9189 | var flast = len - 1;
|
9190 | var fields = '';
|
9191 | for (var i = 0; i < len; ++i) {
|
9192 | var k = keys[i];
|
9193 | var v = obj[k];
|
9194 | var ks = encode(stringifyPrimitive(k)) + eq;
|
9195 |
|
9196 | if (Array.isArray(v)) {
|
9197 | var vlen = v.length;
|
9198 | var vlast = vlen - 1;
|
9199 | for (var j = 0; j < vlen; ++j) {
|
9200 | fields += ks + encode(stringifyPrimitive(v[j]));
|
9201 | if (j < vlast)
|
9202 | fields += sep;
|
9203 | }
|
9204 | if (vlen && i < flast)
|
9205 | fields += sep;
|
9206 | } else {
|
9207 | fields += ks + encode(stringifyPrimitive(v));
|
9208 | if (i < flast)
|
9209 | fields += sep;
|
9210 | }
|
9211 | }
|
9212 | return fields;
|
9213 | }
|
9214 | return '';
|
9215 | };
|
9216 |
|
9217 |
|
9218 | QueryString.parse = QueryString.decode = function(qs, sep, eq, options) {
|
9219 | sep = sep || '&';
|
9220 | eq = eq || '=';
|
9221 |
|
9222 | var obj = {};
|
9223 |
|
9224 | if (typeof qs !== 'string' || qs.length === 0) {
|
9225 | return obj;
|
9226 | }
|
9227 |
|
9228 | if (typeof sep !== 'string')
|
9229 | sep += '';
|
9230 |
|
9231 | var eqLen = eq.length;
|
9232 | var sepLen = sep.length;
|
9233 |
|
9234 | var maxKeys = 1000;
|
9235 | if (options && typeof options.maxKeys === 'number') {
|
9236 | maxKeys = options.maxKeys;
|
9237 | }
|
9238 |
|
9239 | var pairs = Infinity;
|
9240 | if (maxKeys > 0)
|
9241 | pairs = maxKeys;
|
9242 |
|
9243 | var decode = QueryString.unescape;
|
9244 | if (options && typeof options.decodeURIComponent === 'function') {
|
9245 | decode = options.decodeURIComponent;
|
9246 | }
|
9247 | var customDecode = (decode !== qsUnescape);
|
9248 |
|
9249 | var keys = [];
|
9250 | var lastPos = 0;
|
9251 | var sepIdx = 0;
|
9252 | var eqIdx = 0;
|
9253 | var key = '';
|
9254 | var value = '';
|
9255 | var keyEncoded = customDecode;
|
9256 | var valEncoded = customDecode;
|
9257 | var encodeCheck = 0;
|
9258 | for (var i = 0; i < qs.length; ++i) {
|
9259 | var code = qs.charCodeAt(i);
|
9260 |
|
9261 |
|
9262 | if (code === sep.charCodeAt(sepIdx)) {
|
9263 | if (++sepIdx === sepLen) {
|
9264 |
|
9265 | var end = i - sepIdx + 1;
|
9266 | if (eqIdx < eqLen) {
|
9267 |
|
9268 |
|
9269 | if (lastPos < end)
|
9270 | key += qs.slice(lastPos, end);
|
9271 | } else if (lastPos < end)
|
9272 | value += qs.slice(lastPos, end);
|
9273 | if (keyEncoded)
|
9274 | key = decodeStr(key, decode);
|
9275 | if (valEncoded)
|
9276 | value = decodeStr(value, decode);
|
9277 |
|
9278 |
|
9279 | if (keys.indexOf(key) === -1) {
|
9280 | obj[key] = value;
|
9281 | keys[keys.length] = key;
|
9282 | } else {
|
9283 | var curValue = obj[key];
|
9284 |
|
9285 |
|
9286 |
|
9287 | if (curValue instanceof Array)
|
9288 | curValue[curValue.length] = value;
|
9289 | else
|
9290 | obj[key] = [curValue, value];
|
9291 | }
|
9292 | if (--pairs === 0)
|
9293 | break;
|
9294 | keyEncoded = valEncoded = customDecode;
|
9295 | encodeCheck = 0;
|
9296 | key = value = '';
|
9297 | lastPos = i + 1;
|
9298 | sepIdx = eqIdx = 0;
|
9299 | }
|
9300 | continue;
|
9301 | } else {
|
9302 | sepIdx = 0;
|
9303 | if (!valEncoded) {
|
9304 |
|
9305 |
|
9306 | if (code === 37) {
|
9307 | encodeCheck = 1;
|
9308 | } else if (encodeCheck > 0 &&
|
9309 | ((code >= 48 && code <= 57) ||
|
9310 | (code >= 65 && code <= 70) ||
|
9311 | (code >= 97 && code <= 102))) {
|
9312 | if (++encodeCheck === 3)
|
9313 | valEncoded = true;
|
9314 | } else {
|
9315 | encodeCheck = 0;
|
9316 | }
|
9317 | }
|
9318 | }
|
9319 |
|
9320 |
|
9321 | if (eqIdx < eqLen) {
|
9322 | if (code === eq.charCodeAt(eqIdx)) {
|
9323 | if (++eqIdx === eqLen) {
|
9324 |
|
9325 | var end = i - eqIdx + 1;
|
9326 | if (lastPos < end)
|
9327 | key += qs.slice(lastPos, end);
|
9328 | encodeCheck = 0;
|
9329 | lastPos = i + 1;
|
9330 | }
|
9331 | continue;
|
9332 | } else {
|
9333 | eqIdx = 0;
|
9334 | if (!keyEncoded) {
|
9335 |
|
9336 |
|
9337 | if (code === 37) {
|
9338 | encodeCheck = 1;
|
9339 | } else if (encodeCheck > 0 &&
|
9340 | ((code >= 48 && code <= 57) ||
|
9341 | (code >= 65 && code <= 70) ||
|
9342 | (code >= 97 && code <= 102))) {
|
9343 | if (++encodeCheck === 3)
|
9344 | keyEncoded = true;
|
9345 | } else {
|
9346 | encodeCheck = 0;
|
9347 | }
|
9348 | }
|
9349 | }
|
9350 | }
|
9351 |
|
9352 | if (code === 43) {
|
9353 | if (eqIdx < eqLen) {
|
9354 | if (i - lastPos > 0)
|
9355 | key += qs.slice(lastPos, i);
|
9356 | key += '%20';
|
9357 | keyEncoded = true;
|
9358 | } else {
|
9359 | if (i - lastPos > 0)
|
9360 | value += qs.slice(lastPos, i);
|
9361 | value += '%20';
|
9362 | valEncoded = true;
|
9363 | }
|
9364 | lastPos = i + 1;
|
9365 | }
|
9366 | }
|
9367 |
|
9368 |
|
9369 | if (pairs > 0 && (lastPos < qs.length || eqIdx > 0)) {
|
9370 | if (lastPos < qs.length) {
|
9371 | if (eqIdx < eqLen)
|
9372 | key += qs.slice(lastPos);
|
9373 | else if (sepIdx < sepLen)
|
9374 | value += qs.slice(lastPos);
|
9375 | }
|
9376 | if (keyEncoded)
|
9377 | key = decodeStr(key, decode);
|
9378 | if (valEncoded)
|
9379 | value = decodeStr(value, decode);
|
9380 |
|
9381 |
|
9382 | if (keys.indexOf(key) === -1) {
|
9383 | obj[key] = value;
|
9384 | keys[keys.length] = key;
|
9385 | } else {
|
9386 | var curValue = obj[key];
|
9387 |
|
9388 |
|
9389 |
|
9390 | if (curValue instanceof Array)
|
9391 | curValue[curValue.length] = value;
|
9392 | else
|
9393 | obj[key] = [curValue, value];
|
9394 | }
|
9395 | }
|
9396 |
|
9397 | return obj;
|
9398 | };
|
9399 |
|
9400 |
|
9401 |
|
9402 |
|
9403 | function decodeStr(s, decoder) {
|
9404 | try {
|
9405 | return decoder(s);
|
9406 | } catch (e) {
|
9407 | return QueryString.unescape(s, true);
|
9408 | }
|
9409 | }
|
9410 |
|
9411 | }),
|
9412 |
|
9413 | (function(module, exports, __webpack_require__) {
|
9414 |
|
9415 | module.exports = !__webpack_require__(16) && !__webpack_require__(28)(function () {
|
9416 | return Object.defineProperty(__webpack_require__(86)('div'), 'a', { get: function () { return 7; } }).a != 7;
|
9417 | });
|
9418 |
|
9419 |
|
9420 | }),
|
9421 |
|
9422 | (function(module, exports, __webpack_require__) {
|
9423 |
|
9424 | var dP = __webpack_require__(19);
|
9425 | var anObject = __webpack_require__(12);
|
9426 | var getKeys = __webpack_require__(40);
|
9427 |
|
9428 | module.exports = __webpack_require__(16) ? Object.defineProperties : function defineProperties(O, Properties) {
|
9429 | anObject(O);
|
9430 | var keys = getKeys(Properties);
|
9431 | var length = keys.length;
|
9432 | var i = 0;
|
9433 | var P;
|
9434 | while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
9435 | return O;
|
9436 | };
|
9437 |
|
9438 |
|
9439 | }),
|
9440 |
|
9441 | (function(module, exports, __webpack_require__) {
|
9442 |
|
9443 | var has = __webpack_require__(23);
|
9444 | var toIObject = __webpack_require__(24);
|
9445 | var arrayIndexOf = __webpack_require__(192)(false);
|
9446 | var IE_PROTO = __webpack_require__(91)('IE_PROTO');
|
9447 |
|
9448 | module.exports = function (object, names) {
|
9449 | var O = toIObject(object);
|
9450 | var i = 0;
|
9451 | var result = [];
|
9452 | var key;
|
9453 | for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
9454 |
|
9455 | while (names.length > i) if (has(O, key = names[i++])) {
|
9456 | ~arrayIndexOf(result, key) || result.push(key);
|
9457 | }
|
9458 | return result;
|
9459 | };
|
9460 |
|
9461 |
|
9462 | }),
|
9463 |
|
9464 | (function(module, exports, __webpack_require__) {
|
9465 |
|
9466 | "use strict";
|
9467 |
|
9468 | var $defineProperty = __webpack_require__(19);
|
9469 | var createDesc = __webpack_require__(49);
|
9470 |
|
9471 | module.exports = function (object, index, value) {
|
9472 | if (index in object) $defineProperty.f(object, index, createDesc(0, value));
|
9473 | else object[index] = value;
|
9474 | };
|
9475 |
|
9476 |
|
9477 | }),
|
9478 |
|
9479 | (function(module, exports, __webpack_require__) {
|
9480 |
|
9481 | module.exports = __webpack_require__(198);
|
9482 |
|
9483 | }),
|
9484 |
|
9485 | (function(module, exports, __webpack_require__) {
|
9486 |
|
9487 | module.exports = __webpack_require__(200);
|
9488 |
|
9489 | }),
|
9490 |
|
9491 | (function(module, exports, __webpack_require__) {
|
9492 |
|
9493 | "use strict";
|
9494 |
|
9495 |
|
9496 | var global = __webpack_require__(7);
|
9497 | var has = __webpack_require__(23);
|
9498 | var DESCRIPTORS = __webpack_require__(16);
|
9499 | var $export = __webpack_require__(6);
|
9500 | var redefine = __webpack_require__(96);
|
9501 | var META = __webpack_require__(66).KEY;
|
9502 | var $fails = __webpack_require__(28);
|
9503 | var shared = __webpack_require__(92);
|
9504 | var setToStringTag = __webpack_require__(54);
|
9505 | var uid = __webpack_require__(64);
|
9506 | var wks = __webpack_require__(11);
|
9507 | var wksExt = __webpack_require__(97);
|
9508 | var wksDefine = __webpack_require__(98);
|
9509 | var enumKeys = __webpack_require__(201);
|
9510 | var isArray = __webpack_require__(99);
|
9511 | var anObject = __webpack_require__(12);
|
9512 | var isObject = __webpack_require__(9);
|
9513 | var toObject = __webpack_require__(34);
|
9514 | var toIObject = __webpack_require__(24);
|
9515 | var toPrimitive = __webpack_require__(87);
|
9516 | var createDesc = __webpack_require__(49);
|
9517 | var _create = __webpack_require__(67);
|
9518 | var gOPNExt = __webpack_require__(202);
|
9519 | var $GOPD = __webpack_require__(52);
|
9520 | var $GOPS = __webpack_require__(65);
|
9521 | var $DP = __webpack_require__(19);
|
9522 | var $keys = __webpack_require__(40);
|
9523 | var gOPD = $GOPD.f;
|
9524 | var dP = $DP.f;
|
9525 | var gOPN = gOPNExt.f;
|
9526 | var $Symbol = global.Symbol;
|
9527 | var $JSON = global.JSON;
|
9528 | var _stringify = $JSON && $JSON.stringify;
|
9529 | var PROTOTYPE = 'prototype';
|
9530 | var HIDDEN = wks('_hidden');
|
9531 | var TO_PRIMITIVE = wks('toPrimitive');
|
9532 | var isEnum = {}.propertyIsEnumerable;
|
9533 | var SymbolRegistry = shared('symbol-registry');
|
9534 | var AllSymbols = shared('symbols');
|
9535 | var OPSymbols = shared('op-symbols');
|
9536 | var ObjectProto = Object[PROTOTYPE];
|
9537 | var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
|
9538 | var QObject = global.QObject;
|
9539 |
|
9540 | var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
9541 |
|
9542 |
|
9543 | var setSymbolDesc = DESCRIPTORS && $fails(function () {
|
9544 | return _create(dP({}, 'a', {
|
9545 | get: function () { return dP(this, 'a', { value: 7 }).a; }
|
9546 | })).a != 7;
|
9547 | }) ? function (it, key, D) {
|
9548 | var protoDesc = gOPD(ObjectProto, key);
|
9549 | if (protoDesc) delete ObjectProto[key];
|
9550 | dP(it, key, D);
|
9551 | if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
|
9552 | } : dP;
|
9553 |
|
9554 | var wrap = function (tag) {
|
9555 | var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
|
9556 | sym._k = tag;
|
9557 | return sym;
|
9558 | };
|
9559 |
|
9560 | var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
9561 | return typeof it == 'symbol';
|
9562 | } : function (it) {
|
9563 | return it instanceof $Symbol;
|
9564 | };
|
9565 |
|
9566 | var $defineProperty = function defineProperty(it, key, D) {
|
9567 | if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
|
9568 | anObject(it);
|
9569 | key = toPrimitive(key, true);
|
9570 | anObject(D);
|
9571 | if (has(AllSymbols, key)) {
|
9572 | if (!D.enumerable) {
|
9573 | if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
|
9574 | it[HIDDEN][key] = true;
|
9575 | } else {
|
9576 | if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
|
9577 | D = _create(D, { enumerable: createDesc(0, false) });
|
9578 | } return setSymbolDesc(it, key, D);
|
9579 | } return dP(it, key, D);
|
9580 | };
|
9581 | var $defineProperties = function defineProperties(it, P) {
|
9582 | anObject(it);
|
9583 | var keys = enumKeys(P = toIObject(P));
|
9584 | var i = 0;
|
9585 | var l = keys.length;
|
9586 | var key;
|
9587 | while (l > i) $defineProperty(it, key = keys[i++], P[key]);
|
9588 | return it;
|
9589 | };
|
9590 | var $create = function create(it, P) {
|
9591 | return P === undefined ? _create(it) : $defineProperties(_create(it), P);
|
9592 | };
|
9593 | var $propertyIsEnumerable = function propertyIsEnumerable(key) {
|
9594 | var E = isEnum.call(this, key = toPrimitive(key, true));
|
9595 | if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
|
9596 | return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
|
9597 | };
|
9598 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
|
9599 | it = toIObject(it);
|
9600 | key = toPrimitive(key, true);
|
9601 | if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
|
9602 | var D = gOPD(it, key);
|
9603 | if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
|
9604 | return D;
|
9605 | };
|
9606 | var $getOwnPropertyNames = function getOwnPropertyNames(it) {
|
9607 | var names = gOPN(toIObject(it));
|
9608 | var result = [];
|
9609 | var i = 0;
|
9610 | var key;
|
9611 | while (names.length > i) {
|
9612 | if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
|
9613 | } return result;
|
9614 | };
|
9615 | var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
|
9616 | var IS_OP = it === ObjectProto;
|
9617 | var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
|
9618 | var result = [];
|
9619 | var i = 0;
|
9620 | var key;
|
9621 | while (names.length > i) {
|
9622 | if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
|
9623 | } return result;
|
9624 | };
|
9625 |
|
9626 |
|
9627 | if (!USE_NATIVE) {
|
9628 | $Symbol = function Symbol() {
|
9629 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
|
9630 | var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
|
9631 | var $set = function (value) {
|
9632 | if (this === ObjectProto) $set.call(OPSymbols, value);
|
9633 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
9634 | setSymbolDesc(this, tag, createDesc(1, value));
|
9635 | };
|
9636 | if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
|
9637 | return wrap(tag);
|
9638 | };
|
9639 | redefine($Symbol[PROTOTYPE], 'toString', function toString() {
|
9640 | return this._k;
|
9641 | });
|
9642 |
|
9643 | $GOPD.f = $getOwnPropertyDescriptor;
|
9644 | $DP.f = $defineProperty;
|
9645 | __webpack_require__(94).f = gOPNExt.f = $getOwnPropertyNames;
|
9646 | __webpack_require__(53).f = $propertyIsEnumerable;
|
9647 | $GOPS.f = $getOwnPropertySymbols;
|
9648 |
|
9649 | if (DESCRIPTORS && !__webpack_require__(51)) {
|
9650 | redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
|
9651 | }
|
9652 |
|
9653 | wksExt.f = function (name) {
|
9654 | return wrap(wks(name));
|
9655 | };
|
9656 | }
|
9657 |
|
9658 | $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
|
9659 |
|
9660 | for (var es6Symbols = (
|
9661 |
|
9662 | 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
|
9663 | ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
|
9664 |
|
9665 | for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
|
9666 |
|
9667 | $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
9668 |
|
9669 | 'for': function (key) {
|
9670 | return has(SymbolRegistry, key += '')
|
9671 | ? SymbolRegistry[key]
|
9672 | : SymbolRegistry[key] = $Symbol(key);
|
9673 | },
|
9674 |
|
9675 | keyFor: function keyFor(sym) {
|
9676 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
|
9677 | for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
|
9678 | },
|
9679 | useSetter: function () { setter = true; },
|
9680 | useSimple: function () { setter = false; }
|
9681 | });
|
9682 |
|
9683 | $export($export.S + $export.F * !USE_NATIVE, 'Object', {
|
9684 |
|
9685 | create: $create,
|
9686 |
|
9687 | defineProperty: $defineProperty,
|
9688 |
|
9689 | defineProperties: $defineProperties,
|
9690 |
|
9691 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
9692 |
|
9693 | getOwnPropertyNames: $getOwnPropertyNames,
|
9694 |
|
9695 | getOwnPropertySymbols: $getOwnPropertySymbols
|
9696 | });
|
9697 |
|
9698 |
|
9699 |
|
9700 | var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
|
9701 |
|
9702 | $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
|
9703 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
9704 | return $GOPS.f(toObject(it));
|
9705 | }
|
9706 | });
|
9707 |
|
9708 |
|
9709 | $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
|
9710 | var S = $Symbol();
|
9711 |
|
9712 |
|
9713 |
|
9714 | return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
|
9715 | })), 'JSON', {
|
9716 | stringify: function stringify(it) {
|
9717 | var args = [it];
|
9718 | var i = 1;
|
9719 | var replacer, $replacer;
|
9720 | while (arguments.length > i) args.push(arguments[i++]);
|
9721 | $replacer = replacer = args[1];
|
9722 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
9723 | if (!isArray(replacer)) replacer = function (key, value) {
|
9724 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
9725 | if (!isSymbol(value)) return value;
|
9726 | };
|
9727 | args[1] = replacer;
|
9728 | return _stringify.apply($JSON, args);
|
9729 | }
|
9730 | });
|
9731 |
|
9732 |
|
9733 | $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(27)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
9734 |
|
9735 | setToStringTag($Symbol, 'Symbol');
|
9736 |
|
9737 | setToStringTag(Math, 'Math', true);
|
9738 |
|
9739 | setToStringTag(global.JSON, 'JSON', true);
|
9740 |
|
9741 |
|
9742 | }),
|
9743 |
|
9744 | (function(module, exports, __webpack_require__) {
|
9745 |
|
9746 | var document = __webpack_require__(7).document;
|
9747 | module.exports = document && document.documentElement;
|
9748 |
|
9749 |
|
9750 | }),
|
9751 |
|
9752 | (function(module, exports, __webpack_require__) {
|
9753 |
|
9754 | var defineProperty = __webpack_require__(205);
|
9755 |
|
9756 |
|
9757 |
|
9758 |
|
9759 |
|
9760 |
|
9761 |
|
9762 |
|
9763 |
|
9764 |
|
9765 | function baseAssignValue(object, key, value) {
|
9766 | if (key == '__proto__' && defineProperty) {
|
9767 | defineProperty(object, key, {
|
9768 | 'configurable': true,
|
9769 | 'enumerable': true,
|
9770 | 'value': value,
|
9771 | 'writable': true
|
9772 | });
|
9773 | } else {
|
9774 | object[key] = value;
|
9775 | }
|
9776 | }
|
9777 |
|
9778 | module.exports = baseAssignValue;
|
9779 |
|
9780 |
|
9781 | }),
|
9782 |
|
9783 | (function(module, exports) {
|
9784 |
|
9785 |
|
9786 |
|
9787 |
|
9788 |
|
9789 |
|
9790 |
|
9791 |
|
9792 |
|
9793 |
|
9794 |
|
9795 |
|
9796 |
|
9797 |
|
9798 |
|
9799 |
|
9800 |
|
9801 |
|
9802 |
|
9803 |
|
9804 |
|
9805 |
|
9806 |
|
9807 |
|
9808 |
|
9809 |
|
9810 |
|
9811 |
|
9812 |
|
9813 |
|
9814 |
|
9815 |
|
9816 |
|
9817 | function eq(value, other) {
|
9818 | return value === other || (value !== value && other !== other);
|
9819 | }
|
9820 |
|
9821 | module.exports = eq;
|
9822 |
|
9823 |
|
9824 | }),
|
9825 |
|
9826 | (function(module, exports, __webpack_require__) {
|
9827 |
|
9828 | var isFunction = __webpack_require__(30),
|
9829 | isLength = __webpack_require__(131);
|
9830 |
|
9831 |
|
9832 |
|
9833 |
|
9834 |
|
9835 |
|
9836 |
|
9837 |
|
9838 |
|
9839 |
|
9840 |
|
9841 |
|
9842 |
|
9843 |
|
9844 |
|
9845 |
|
9846 |
|
9847 |
|
9848 |
|
9849 |
|
9850 |
|
9851 |
|
9852 |
|
9853 |
|
9854 |
|
9855 |
|
9856 | function isArrayLike(value) {
|
9857 | return value != null && isLength(value.length) && !isFunction(value);
|
9858 | }
|
9859 |
|
9860 | module.exports = isArrayLike;
|
9861 |
|
9862 |
|
9863 | }),
|
9864 |
|
9865 | (function(module, exports) {
|
9866 |
|
9867 |
|
9868 | var objectProto = Object.prototype;
|
9869 |
|
9870 |
|
9871 |
|
9872 |
|
9873 |
|
9874 |
|
9875 | var nativeObjectToString = objectProto.toString;
|
9876 |
|
9877 |
|
9878 |
|
9879 |
|
9880 |
|
9881 |
|
9882 |
|
9883 |
|
9884 | function objectToString(value) {
|
9885 | return nativeObjectToString.call(value);
|
9886 | }
|
9887 |
|
9888 | module.exports = objectToString;
|
9889 |
|
9890 |
|
9891 | }),
|
9892 |
|
9893 | (function(module, exports) {
|
9894 |
|
9895 |
|
9896 | var MAX_SAFE_INTEGER = 9007199254740991;
|
9897 |
|
9898 |
|
9899 |
|
9900 |
|
9901 |
|
9902 |
|
9903 |
|
9904 |
|
9905 |
|
9906 |
|
9907 |
|
9908 |
|
9909 |
|
9910 |
|
9911 |
|
9912 |
|
9913 |
|
9914 |
|
9915 |
|
9916 |
|
9917 |
|
9918 |
|
9919 |
|
9920 |
|
9921 |
|
9922 |
|
9923 |
|
9924 | function isLength(value) {
|
9925 | return typeof value == 'number' &&
|
9926 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
9927 | }
|
9928 |
|
9929 | module.exports = isLength;
|
9930 |
|
9931 |
|
9932 | }),
|
9933 |
|
9934 | (function(module, exports) {
|
9935 |
|
9936 |
|
9937 |
|
9938 |
|
9939 |
|
9940 |
|
9941 |
|
9942 |
|
9943 |
|
9944 |
|
9945 |
|
9946 |
|
9947 |
|
9948 |
|
9949 | function stubFalse() {
|
9950 | return false;
|
9951 | }
|
9952 |
|
9953 | module.exports = stubFalse;
|
9954 |
|
9955 |
|
9956 | }),
|
9957 |
|
9958 | (function(module, exports) {
|
9959 |
|
9960 |
|
9961 |
|
9962 |
|
9963 |
|
9964 |
|
9965 |
|
9966 |
|
9967 |
|
9968 |
|
9969 |
|
9970 |
|
9971 |
|
9972 |
|
9973 |
|
9974 |
|
9975 |
|
9976 | function identity(value) {
|
9977 | return value;
|
9978 | }
|
9979 |
|
9980 | module.exports = identity;
|
9981 |
|
9982 |
|
9983 | }),
|
9984 |
|
9985 | (function(module, exports) {
|
9986 |
|
9987 |
|
9988 |
|
9989 |
|
9990 |
|
9991 |
|
9992 |
|
9993 |
|
9994 |
|
9995 |
|
9996 |
|
9997 |
|
9998 |
|
9999 |
|
10000 |
|
10001 |
|
10002 |
|
10003 | function identity(value) {
|
10004 | return value;
|
10005 | }
|
10006 |
|
10007 | module.exports = identity;
|
10008 |
|
10009 |
|
10010 | }),
|
10011 |
|
10012 | (function(module, exports) {
|
10013 |
|
10014 | module.exports = function(module) {
|
10015 | if (!module.webpackPolyfill) {
|
10016 | module.deprecate = function() {};
|
10017 | module.paths = [];
|
10018 |
|
10019 | if (!module.children) module.children = [];
|
10020 | Object.defineProperty(module, "loaded", {
|
10021 | enumerable: true,
|
10022 | get: function() {
|
10023 | return module.l;
|
10024 | }
|
10025 | });
|
10026 | Object.defineProperty(module, "id", {
|
10027 | enumerable: true,
|
10028 | get: function() {
|
10029 | return module.i;
|
10030 | }
|
10031 | });
|
10032 | module.webpackPolyfill = 1;
|
10033 | }
|
10034 | return module;
|
10035 | };
|
10036 |
|
10037 |
|
10038 | }),
|
10039 |
|
10040 | (function(module, exports, __webpack_require__) {
|
10041 |
|
10042 | module.exports = __webpack_require__(222);
|
10043 |
|
10044 | }),
|
10045 |
|
10046 | (function(module, exports, __webpack_require__) {
|
10047 |
|
10048 | "use strict";
|
10049 |
|
10050 | var LIBRARY = __webpack_require__(51);
|
10051 | var $export = __webpack_require__(6);
|
10052 | var redefine = __webpack_require__(96);
|
10053 | var hide = __webpack_require__(27);
|
10054 | var Iterators = __webpack_require__(41);
|
10055 | var $iterCreate = __webpack_require__(226);
|
10056 | var setToStringTag = __webpack_require__(54);
|
10057 | var getPrototypeOf = __webpack_require__(102);
|
10058 | var ITERATOR = __webpack_require__(11)('iterator');
|
10059 | var BUGGY = !([].keys && 'next' in [].keys());
|
10060 | var FF_ITERATOR = '@@iterator';
|
10061 | var KEYS = 'keys';
|
10062 | var VALUES = 'values';
|
10063 |
|
10064 | var returnThis = function () { return this; };
|
10065 |
|
10066 | module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
10067 | $iterCreate(Constructor, NAME, next);
|
10068 | var getMethod = function (kind) {
|
10069 | if (!BUGGY && kind in proto) return proto[kind];
|
10070 | switch (kind) {
|
10071 | case KEYS: return function keys() { return new Constructor(this, kind); };
|
10072 | case VALUES: return function values() { return new Constructor(this, kind); };
|
10073 | } return function entries() { return new Constructor(this, kind); };
|
10074 | };
|
10075 | var TAG = NAME + ' Iterator';
|
10076 | var DEF_VALUES = DEFAULT == VALUES;
|
10077 | var VALUES_BUG = false;
|
10078 | var proto = Base.prototype;
|
10079 | var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
10080 | var $default = $native || getMethod(DEFAULT);
|
10081 | var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
10082 | var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
10083 | var methods, key, IteratorPrototype;
|
10084 |
|
10085 | if ($anyNative) {
|
10086 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
10087 | if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
10088 |
|
10089 | setToStringTag(IteratorPrototype, TAG, true);
|
10090 |
|
10091 | if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
|
10092 | }
|
10093 | }
|
10094 |
|
10095 | if (DEF_VALUES && $native && $native.name !== VALUES) {
|
10096 | VALUES_BUG = true;
|
10097 | $default = function values() { return $native.call(this); };
|
10098 | }
|
10099 |
|
10100 | if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
10101 | hide(proto, ITERATOR, $default);
|
10102 | }
|
10103 |
|
10104 | Iterators[NAME] = $default;
|
10105 | Iterators[TAG] = returnThis;
|
10106 | if (DEFAULT) {
|
10107 | methods = {
|
10108 | values: DEF_VALUES ? $default : getMethod(VALUES),
|
10109 | keys: IS_SET ? $default : getMethod(KEYS),
|
10110 | entries: $entries
|
10111 | };
|
10112 | if (FORCED) for (key in methods) {
|
10113 | if (!(key in proto)) redefine(proto, key, methods[key]);
|
10114 | } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
10115 | }
|
10116 | return methods;
|
10117 | };
|
10118 |
|
10119 |
|
10120 | }),
|
10121 |
|
10122 | (function(module, exports, __webpack_require__) {
|
10123 |
|
10124 | module.exports = __webpack_require__(231);
|
10125 |
|
10126 | }),
|
10127 |
|
10128 | (function(module, exports, __webpack_require__) {
|
10129 |
|
10130 |
|
10131 | var anObject = __webpack_require__(12);
|
10132 | module.exports = function (iterator, fn, value, entries) {
|
10133 | try {
|
10134 | return entries ? fn(anObject(value)[0], value[1]) : fn(value);
|
10135 |
|
10136 | } catch (e) {
|
10137 | var ret = iterator['return'];
|
10138 | if (ret !== undefined) anObject(ret.call(iterator));
|
10139 | throw e;
|
10140 | }
|
10141 | };
|
10142 |
|
10143 |
|
10144 | }),
|
10145 |
|
10146 | (function(module, exports, __webpack_require__) {
|
10147 |
|
10148 |
|
10149 | var Iterators = __webpack_require__(41);
|
10150 | var ITERATOR = __webpack_require__(11)('iterator');
|
10151 | var ArrayProto = Array.prototype;
|
10152 |
|
10153 | module.exports = function (it) {
|
10154 | return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
10155 | };
|
10156 |
|
10157 |
|
10158 | }),
|
10159 |
|
10160 | (function(module, exports, __webpack_require__) {
|
10161 |
|
10162 | var ITERATOR = __webpack_require__(11)('iterator');
|
10163 | var SAFE_CLOSING = false;
|
10164 |
|
10165 | try {
|
10166 | var riter = [7][ITERATOR]();
|
10167 | riter['return'] = function () { SAFE_CLOSING = true; };
|
10168 |
|
10169 | Array.from(riter, function () { throw 2; });
|
10170 | } catch (e) { }
|
10171 |
|
10172 | module.exports = function (exec, skipClosing) {
|
10173 | if (!skipClosing && !SAFE_CLOSING) return false;
|
10174 | var safe = false;
|
10175 | try {
|
10176 | var arr = [7];
|
10177 | var iter = arr[ITERATOR]();
|
10178 | iter.next = function () { return { done: safe = true }; };
|
10179 | arr[ITERATOR] = function () { return iter; };
|
10180 | exec(arr);
|
10181 | } catch (e) { }
|
10182 | return safe;
|
10183 | };
|
10184 |
|
10185 |
|
10186 | }),
|
10187 |
|
10188 | (function(module, exports) {
|
10189 |
|
10190 | function _arrayLikeToArray(arr, len) {
|
10191 | if (len == null || len > arr.length) len = arr.length;
|
10192 |
|
10193 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
10194 | arr2[i] = arr[i];
|
10195 | }
|
10196 |
|
10197 | return arr2;
|
10198 | }
|
10199 |
|
10200 | module.exports = _arrayLikeToArray;
|
10201 |
|
10202 | }),
|
10203 |
|
10204 | (function(module, exports, __webpack_require__) {
|
10205 |
|
10206 | module.exports = __webpack_require__(243);
|
10207 |
|
10208 | }),
|
10209 |
|
10210 | (function(module, exports, __webpack_require__) {
|
10211 |
|
10212 |
|
10213 | var anObject = __webpack_require__(12);
|
10214 | var aFunction = __webpack_require__(33);
|
10215 | var SPECIES = __webpack_require__(11)('species');
|
10216 | module.exports = function (O, D) {
|
10217 | var C = anObject(O).constructor;
|
10218 | var S;
|
10219 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
|
10220 | };
|
10221 |
|
10222 |
|
10223 | }),
|
10224 |
|
10225 | (function(module, exports, __webpack_require__) {
|
10226 |
|
10227 | var ctx = __webpack_require__(26);
|
10228 | var invoke = __webpack_require__(146);
|
10229 | var html = __webpack_require__(126);
|
10230 | var cel = __webpack_require__(86);
|
10231 | var global = __webpack_require__(7);
|
10232 | var process = global.process;
|
10233 | var setTask = global.setImmediate;
|
10234 | var clearTask = global.clearImmediate;
|
10235 | var MessageChannel = global.MessageChannel;
|
10236 | var Dispatch = global.Dispatch;
|
10237 | var counter = 0;
|
10238 | var queue = {};
|
10239 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
10240 | var defer, channel, port;
|
10241 | var run = function () {
|
10242 | var id = +this;
|
10243 |
|
10244 | if (queue.hasOwnProperty(id)) {
|
10245 | var fn = queue[id];
|
10246 | delete queue[id];
|
10247 | fn();
|
10248 | }
|
10249 | };
|
10250 | var listener = function (event) {
|
10251 | run.call(event.data);
|
10252 | };
|
10253 |
|
10254 | if (!setTask || !clearTask) {
|
10255 | setTask = function setImmediate(fn) {
|
10256 | var args = [];
|
10257 | var i = 1;
|
10258 | while (arguments.length > i) args.push(arguments[i++]);
|
10259 | queue[++counter] = function () {
|
10260 |
|
10261 | invoke(typeof fn == 'function' ? fn : Function(fn), args);
|
10262 | };
|
10263 | defer(counter);
|
10264 | return counter;
|
10265 | };
|
10266 | clearTask = function clearImmediate(id) {
|
10267 | delete queue[id];
|
10268 | };
|
10269 |
|
10270 | if (__webpack_require__(50)(process) == 'process') {
|
10271 | defer = function (id) {
|
10272 | process.nextTick(ctx(run, id, 1));
|
10273 | };
|
10274 |
|
10275 | } else if (Dispatch && Dispatch.now) {
|
10276 | defer = function (id) {
|
10277 | Dispatch.now(ctx(run, id, 1));
|
10278 | };
|
10279 |
|
10280 | } else if (MessageChannel) {
|
10281 | channel = new MessageChannel();
|
10282 | port = channel.port2;
|
10283 | channel.port1.onmessage = listener;
|
10284 | defer = ctx(port.postMessage, port, 1);
|
10285 |
|
10286 |
|
10287 | } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
|
10288 | defer = function (id) {
|
10289 | global.postMessage(id + '', '*');
|
10290 | };
|
10291 | global.addEventListener('message', listener, false);
|
10292 |
|
10293 | } else if (ONREADYSTATECHANGE in cel('script')) {
|
10294 | defer = function (id) {
|
10295 | html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
|
10296 | html.removeChild(this);
|
10297 | run.call(id);
|
10298 | };
|
10299 | };
|
10300 |
|
10301 | } else {
|
10302 | defer = function (id) {
|
10303 | setTimeout(ctx(run, id, 1), 0);
|
10304 | };
|
10305 | }
|
10306 | }
|
10307 | module.exports = {
|
10308 | set: setTask,
|
10309 | clear: clearTask
|
10310 | };
|
10311 |
|
10312 |
|
10313 | /***/ }),
|
10314 | /* 146 */
|
10315 | /***/ (function(module, exports) {
|
10316 |
|
10317 |
|
10318 | module.exports = function (fn, args, that) {
|
10319 | var un = that === undefined;
|
10320 | switch (args.length) {
|
10321 | case 0: return un ? fn()
|
10322 | : fn.call(that);
|
10323 | case 1: return un ? fn(args[0])
|
10324 | : fn.call(that, args[0]);
|
10325 | case 2: return un ? fn(args[0], args[1])
|
10326 | : fn.call(that, args[0], args[1]);
|
10327 | case 3: return un ? fn(args[0], args[1], args[2])
|
10328 | : fn.call(that, args[0], args[1], args[2]);
|
10329 | case 4: return un ? fn(args[0], args[1], args[2], args[3])
|
10330 | : fn.call(that, args[0], args[1], args[2], args[3]);
|
10331 | } return fn.apply(that, args);
|
10332 | };
|
10333 |
|
10334 |
|
10335 | }),
|
10336 |
|
10337 | (function(module, exports) {
|
10338 |
|
10339 | module.exports = function (exec) {
|
10340 | try {
|
10341 | return { e: false, v: exec() };
|
10342 | } catch (e) {
|
10343 | return { e: true, v: e };
|
10344 | }
|
10345 | };
|
10346 |
|
10347 |
|
10348 | }),
|
10349 |
|
10350 | (function(module, exports, __webpack_require__) {
|
10351 |
|
10352 | var anObject = __webpack_require__(12);
|
10353 | var isObject = __webpack_require__(9);
|
10354 | var newPromiseCapability = __webpack_require__(108);
|
10355 |
|
10356 | module.exports = function (C, x) {
|
10357 | anObject(C);
|
10358 | if (isObject(x) && x.constructor === C) return x;
|
10359 | var promiseCapability = newPromiseCapability.f(C);
|
10360 | var resolve = promiseCapability.resolve;
|
10361 | resolve(x);
|
10362 | return promiseCapability.promise;
|
10363 | };
|
10364 |
|
10365 |
|
10366 | }),
|
10367 |
|
10368 | (function(module, exports, __webpack_require__) {
|
10369 |
|
10370 | "use strict";
|
10371 |
|
10372 |
|
10373 | var replace = String.prototype.replace;
|
10374 | var percentTwenties = /%20/g;
|
10375 |
|
10376 | var util = __webpack_require__(110);
|
10377 |
|
10378 | var Format = {
|
10379 | RFC1738: 'RFC1738',
|
10380 | RFC3986: 'RFC3986'
|
10381 | };
|
10382 |
|
10383 | module.exports = util.assign(
|
10384 | {
|
10385 | 'default': Format.RFC3986,
|
10386 | formatters: {
|
10387 | RFC1738: function (value) {
|
10388 | return replace.call(value, percentTwenties, '+');
|
10389 | },
|
10390 | RFC3986: function (value) {
|
10391 | return String(value);
|
10392 | }
|
10393 | }
|
10394 | },
|
10395 | Format
|
10396 | );
|
10397 |
|
10398 |
|
10399 | }),
|
10400 |
|
10401 | (function(module, exports, __webpack_require__) {
|
10402 |
|
10403 | "use strict";
|
10404 |
|
10405 |
|
10406 |
|
10407 |
|
10408 |
|
10409 |
|
10410 |
|
10411 |
|
10412 |
|
10413 |
|
10414 | var Schema = __webpack_require__(43);
|
10415 |
|
10416 |
|
10417 | module.exports = new Schema({
|
10418 | include: [
|
10419 | __webpack_require__(151)
|
10420 | ]
|
10421 | });
|
10422 |
|
10423 |
|
10424 | }),
|
10425 |
|
10426 | (function(module, exports, __webpack_require__) {
|
10427 |
|
10428 | "use strict";
|
10429 |
|
10430 |
|
10431 |
|
10432 |
|
10433 |
|
10434 |
|
10435 |
|
10436 |
|
10437 |
|
10438 |
|
10439 |
|
10440 | var Schema = __webpack_require__(43);
|
10441 |
|
10442 |
|
10443 | module.exports = new Schema({
|
10444 | include: [
|
10445 | __webpack_require__(111)
|
10446 | ],
|
10447 | implicit: [
|
10448 | __webpack_require__(262),
|
10449 | __webpack_require__(263),
|
10450 | __webpack_require__(264),
|
10451 | __webpack_require__(265)
|
10452 | ]
|
10453 | });
|
10454 |
|
10455 |
|
10456 | }),
|
10457 |
|
10458 | (function(module, exports, __webpack_require__) {
|
10459 |
|
10460 | var castPath = __webpack_require__(73),
|
10461 | toKey = __webpack_require__(112);
|
10462 |
|
10463 |
|
10464 |
|
10465 |
|
10466 |
|
10467 |
|
10468 |
|
10469 |
|
10470 |
|
10471 | function baseGet(object, path) {
|
10472 | path = castPath(path, object);
|
10473 |
|
10474 | var index = 0,
|
10475 | length = path.length;
|
10476 |
|
10477 | while (object != null && index < length) {
|
10478 | object = object[toKey(path[index++])];
|
10479 | }
|
10480 | return (index && index == length) ? object : undefined;
|
10481 | }
|
10482 |
|
10483 | module.exports = baseGet;
|
10484 |
|
10485 |
|
10486 | }),
|
10487 |
|
10488 | (function(module, exports) {
|
10489 |
|
10490 |
|
10491 | var MAX_SAFE_INTEGER = 9007199254740991;
|
10492 |
|
10493 |
|
10494 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
10495 |
|
10496 |
|
10497 |
|
10498 |
|
10499 |
|
10500 |
|
10501 |
|
10502 |
|
10503 |
|
10504 | function isIndex(value, length) {
|
10505 | var type = typeof value;
|
10506 | length = length == null ? MAX_SAFE_INTEGER : length;
|
10507 |
|
10508 | return !!length &&
|
10509 | (type == 'number' ||
|
10510 | (type != 'symbol' && reIsUint.test(value))) &&
|
10511 | (value > -1 && value % 1 == 0 && value < length);
|
10512 | }
|
10513 |
|
10514 | module.exports = isIndex;
|
10515 |
|
10516 |
|
10517 | }),
|
10518 |
|
10519 | (function(module, exports, __webpack_require__) {
|
10520 |
|
10521 | module.exports = __webpack_require__(299);
|
10522 |
|
10523 | }),
|
10524 |
|
10525 | (function(module, exports, __webpack_require__) {
|
10526 |
|
10527 | module.exports = __webpack_require__(305);
|
10528 |
|
10529 | }),
|
10530 |
|
10531 | (function(module, exports, __webpack_require__) {
|
10532 |
|
10533 | "use strict";
|
10534 |
|
10535 |
|
10536 | var DESCRIPTORS = __webpack_require__(16);
|
10537 | var getKeys = __webpack_require__(40);
|
10538 | var gOPS = __webpack_require__(65);
|
10539 | var pIE = __webpack_require__(53);
|
10540 | var toObject = __webpack_require__(34);
|
10541 | var IObject = __webpack_require__(88);
|
10542 | var $assign = Object.assign;
|
10543 |
|
10544 |
|
10545 | module.exports = !$assign || __webpack_require__(28)(function () {
|
10546 | var A = {};
|
10547 | var B = {};
|
10548 |
|
10549 | var S = Symbol();
|
10550 | var K = 'abcdefghijklmnopqrst';
|
10551 | A[S] = 7;
|
10552 | K.split('').forEach(function (k) { B[k] = k; });
|
10553 | return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
|
10554 | }) ? function assign(target, source) {
|
10555 | var T = toObject(target);
|
10556 | var aLen = arguments.length;
|
10557 | var index = 1;
|
10558 | var getSymbols = gOPS.f;
|
10559 | var isEnum = pIE.f;
|
10560 | while (aLen > index) {
|
10561 | var S = IObject(arguments[index++]);
|
10562 | var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
|
10563 | var length = keys.length;
|
10564 | var j = 0;
|
10565 | var key;
|
10566 | while (length > j) {
|
10567 | key = keys[j++];
|
10568 | if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
|
10569 | }
|
10570 | } return T;
|
10571 | } : $assign;
|
10572 |
|
10573 |
|
10574 | }),
|
10575 |
|
10576 | (function(module, exports) {
|
10577 |
|
10578 |
|
10579 |
|
10580 |
|
10581 |
|
10582 |
|
10583 |
|
10584 |
|
10585 |
|
10586 |
|
10587 |
|
10588 |
|
10589 |
|
10590 |
|
10591 |
|
10592 |
|
10593 |
|
10594 | function identity(value) {
|
10595 | return value;
|
10596 | }
|
10597 |
|
10598 | module.exports = identity;
|
10599 |
|
10600 |
|
10601 | }),
|
10602 |
|
10603 | (function(module, exports, __webpack_require__) {
|
10604 |
|
10605 | var overArg = __webpack_require__(100);
|
10606 |
|
10607 |
|
10608 | var getPrototype = overArg(Object.getPrototypeOf, Object);
|
10609 |
|
10610 | module.exports = getPrototype;
|
10611 |
|
10612 |
|
10613 | }),
|
10614 |
|
10615 | (function(module, exports, __webpack_require__) {
|
10616 |
|
10617 | module.exports = __webpack_require__(237);
|
10618 |
|
10619 | }),
|
10620 |
|
10621 | (function(module, __webpack_exports__, __webpack_require__) {
|
10622 |
|
10623 | "use strict";
|
10624 | __webpack_require__.r(__webpack_exports__);
|
10625 | __webpack_require__.d(__webpack_exports__, "patch", function() { return patch; });
|
10626 | var _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47);
|
10627 | var _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
|
10628 | var _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38);
|
10629 | var _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
|
10630 | var _babel_runtime_corejs2_helpers_get__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(161);
|
10631 | var _babel_runtime_corejs2_helpers_get__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_get__WEBPACK_IMPORTED_MODULE_2__);
|
10632 | var _babel_runtime_corejs2_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77);
|
10633 | var _babel_runtime_corejs2_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
|
10634 | var _babel_runtime_corejs2_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(162);
|
10635 | var _babel_runtime_corejs2_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
|
10636 | var _babel_runtime_corejs2_helpers_createSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(163);
|
10637 | var _babel_runtime_corejs2_helpers_createSuper__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createSuper__WEBPACK_IMPORTED_MODULE_5__);
|
10638 | var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30);
|
10639 | var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__);
|
10640 | var isomorphic_form_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(164);
|
10641 | var isomorphic_form_data__WEBPACK_IMPORTED_MODULE_7___default = __webpack_require__.n(isomorphic_form_data__WEBPACK_IMPORTED_MODULE_7__);
|
10642 |
|
10643 |
|
10644 |
|
10645 |
|
10646 |
|
10647 |
|
10648 |
|
10649 |
|
10650 |
|
10651 |
|
10652 | var patch = function patch(FormData) {
|
10653 | var createEntry = function createEntry(field, value) {
|
10654 | return {
|
10655 | name: field,
|
10656 | value: value
|
10657 | };
|
10658 | };
|
10659 | |
10660 |
|
10661 |
|
10662 |
|
10663 |
|
10664 |
|
10665 |
|
10666 |
|
10667 |
|
10668 |
|
10669 |
|
10670 | if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(FormData.prototype.set) || lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(FormData.prototype.get) || lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(FormData.prototype.getAll) || lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(FormData.prototype.has)) {
|
10671 | return FormData;
|
10672 | }
|
10673 |
|
10674 | var PatchedFormData = function (_FormData) {
|
10675 | _babel_runtime_corejs2_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(PatchedFormData, _FormData);
|
10676 |
|
10677 | var _super = _babel_runtime_corejs2_helpers_createSuper__WEBPACK_IMPORTED_MODULE_5___default()(PatchedFormData);
|
10678 |
|
10679 | function PatchedFormData(form) {
|
10680 | var _this;
|
10681 |
|
10682 | _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, PatchedFormData);
|
10683 |
|
10684 | _this = _super.call(this, form);
|
10685 | _this.entryList = [];
|
10686 | return _this;
|
10687 | }
|
10688 |
|
10689 | _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(PatchedFormData, [{
|
10690 | key: "append",
|
10691 | value: function append(field, value, options) {
|
10692 | this.entryList.push(createEntry(field, value));
|
10693 | return _babel_runtime_corejs2_helpers_get__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_corejs2_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(PatchedFormData.prototype), "append", this).call(this, field, value, options);
|
10694 | }
|
10695 | }, {
|
10696 | key: "set",
|
10697 | value: function set(field, value) {
|
10698 | var newEntry = createEntry(field, value);
|
10699 | this.entryList = this.entryList.filter(function (entry) {
|
10700 | return entry.name !== field;
|
10701 | });
|
10702 | this.entryList.push(newEntry);
|
10703 | }
|
10704 | }, {
|
10705 | key: "get",
|
10706 | value: function get(field) {
|
10707 | var foundEntry = this.entryList.find(function (entry) {
|
10708 | return entry.name === field;
|
10709 | });
|
10710 | return foundEntry === undefined ? null : foundEntry;
|
10711 | }
|
10712 | }, {
|
10713 | key: "getAll",
|
10714 | value: function getAll(field) {
|
10715 | return this.entryList.filter(function (entry) {
|
10716 | return entry.name === field;
|
10717 | }).map(function (entry) {
|
10718 | return entry.value;
|
10719 | });
|
10720 | }
|
10721 | }, {
|
10722 | key: "has",
|
10723 | value: function has(field) {
|
10724 | return this.entryList.some(function (entry) {
|
10725 | return entry.name === field;
|
10726 | });
|
10727 | }
|
10728 | }]);
|
10729 |
|
10730 | return PatchedFormData;
|
10731 | }(FormData);
|
10732 |
|
10733 | return PatchedFormData;
|
10734 | };
|
10735 | __webpack_exports__["default"] = (patch(isomorphic_form_data__WEBPACK_IMPORTED_MODULE_7___default.a));
|
10736 |
|
10737 | }),
|
10738 |
|
10739 | (function(module, exports, __webpack_require__) {
|
10740 |
|
10741 | var _Object$getOwnPropertyDescriptor = __webpack_require__(123);
|
10742 |
|
10743 | var _Reflect$get = __webpack_require__(292);
|
10744 |
|
10745 | var superPropBase = __webpack_require__(295);
|
10746 |
|
10747 | function _get(target, property, receiver) {
|
10748 | if (typeof Reflect !== "undefined" && _Reflect$get) {
|
10749 | module.exports = _get = _Reflect$get;
|
10750 | } else {
|
10751 | module.exports = _get = function _get(target, property, receiver) {
|
10752 | var base = superPropBase(target, property);
|
10753 | if (!base) return;
|
10754 |
|
10755 | var desc = _Object$getOwnPropertyDescriptor(base, property);
|
10756 |
|
10757 | if (desc.get) {
|
10758 | return desc.get.call(receiver);
|
10759 | }
|
10760 |
|
10761 | return desc.value;
|
10762 | };
|
10763 | }
|
10764 |
|
10765 | return _get(target, property, receiver || target);
|
10766 | }
|
10767 |
|
10768 | module.exports = _get;
|
10769 |
|
10770 | }),
|
10771 |
|
10772 | (function(module, exports, __webpack_require__) {
|
10773 |
|
10774 | var _Object$create = __webpack_require__(79);
|
10775 |
|
10776 | var setPrototypeOf = __webpack_require__(304);
|
10777 |
|
10778 | function _inherits(subClass, superClass) {
|
10779 | if (typeof superClass !== "function" && superClass !== null) {
|
10780 | throw new TypeError("Super expression must either be null or a function");
|
10781 | }
|
10782 |
|
10783 | subClass.prototype = _Object$create(superClass && superClass.prototype, {
|
10784 | constructor: {
|
10785 | value: subClass,
|
10786 | writable: true,
|
10787 | configurable: true
|
10788 | }
|
10789 | });
|
10790 | if (superClass) setPrototypeOf(subClass, superClass);
|
10791 | }
|
10792 |
|
10793 | module.exports = _inherits;
|
10794 |
|
10795 | }),
|
10796 |
|
10797 | (function(module, exports, __webpack_require__) {
|
10798 |
|
10799 | var _Reflect$construct = __webpack_require__(155);
|
10800 |
|
10801 | var getPrototypeOf = __webpack_require__(77);
|
10802 |
|
10803 | var isNativeReflectConstruct = __webpack_require__(308);
|
10804 |
|
10805 | var possibleConstructorReturn = __webpack_require__(309);
|
10806 |
|
10807 | function _createSuper(Derived) {
|
10808 | var hasNativeReflectConstruct = isNativeReflectConstruct();
|
10809 | return function _createSuperInternal() {
|
10810 | var Super = getPrototypeOf(Derived),
|
10811 | result;
|
10812 |
|
10813 | if (hasNativeReflectConstruct) {
|
10814 | var NewTarget = getPrototypeOf(this).constructor;
|
10815 | result = _Reflect$construct(Super, arguments, NewTarget);
|
10816 | } else {
|
10817 | result = Super.apply(this, arguments);
|
10818 | }
|
10819 |
|
10820 | return possibleConstructorReturn(this, result);
|
10821 | };
|
10822 | }
|
10823 |
|
10824 | module.exports = _createSuper;
|
10825 |
|
10826 | }),
|
10827 |
|
10828 | (function(module, exports) {
|
10829 |
|
10830 | module.exports = window.FormData
|
10831 |
|
10832 |
|
10833 | }),
|
10834 |
|
10835 | (function(module, exports, __webpack_require__) {
|
10836 |
|
10837 | var createFind = __webpack_require__(316),
|
10838 | findIndex = __webpack_require__(317);
|
10839 |
|
10840 |
|
10841 |
|
10842 |
|
10843 |
|
10844 |
|
10845 |
|
10846 |
|
10847 |
|
10848 |
|
10849 |
|
10850 |
|
10851 |
|
10852 |
|
10853 |
|
10854 |
|
10855 |
|
10856 |
|
10857 |
|
10858 |
|
10859 |
|
10860 |
|
10861 |
|
10862 |
|
10863 |
|
10864 |
|
10865 |
|
10866 |
|
10867 |
|
10868 |
|
10869 |
|
10870 |
|
10871 |
|
10872 |
|
10873 |
|
10874 |
|
10875 |
|
10876 | var find = createFind(findIndex);
|
10877 |
|
10878 | module.exports = find;
|
10879 |
|
10880 |
|
10881 | }),
|
10882 |
|
10883 | (function(module, exports, __webpack_require__) {
|
10884 |
|
10885 | "use strict";
|
10886 | (function(Buffer) { |
10887 |
|
10888 |
|
10889 |
|
10890 |
|
10891 |
|
10892 |
|
10893 |
|
10894 |
|
10895 |
|
10896 |
|
10897 |
|
10898 |
|
10899 |
|
10900 |
|
10901 |
|
10902 |
|
10903 |
|
10904 |
|
10905 |
|
10906 |
|
10907 |
|
10908 |
|
10909 |
|
10910 |
|
10911 |
|
10912 |
|
10913 |
|
10914 |
|
10915 | function isSpecificValue(val) {
|
10916 | return (
|
10917 | val instanceof Buffer
|
10918 | || val instanceof Date
|
10919 | || val instanceof RegExp
|
10920 | ) ? true : false;
|
10921 | }
|
10922 |
|
10923 | function cloneSpecificValue(val) {
|
10924 | if (val instanceof Buffer) {
|
10925 | var x = Buffer.alloc
|
10926 | ? Buffer.alloc(val.length)
|
10927 | : new Buffer(val.length);
|
10928 | val.copy(x);
|
10929 | return x;
|
10930 | } else if (val instanceof Date) {
|
10931 | return new Date(val.getTime());
|
10932 | } else if (val instanceof RegExp) {
|
10933 | return new RegExp(val);
|
10934 | } else {
|
10935 | throw new Error('Unexpected situation');
|
10936 | }
|
10937 | }
|
10938 |
|
10939 |
|
10940 |
|
10941 |
|
10942 | function deepCloneArray(arr) {
|
10943 | var clone = [];
|
10944 | arr.forEach(function (item, index) {
|
10945 | if (typeof item === 'object' && item !== null) {
|
10946 | if (Array.isArray(item)) {
|
10947 | clone[index] = deepCloneArray(item);
|
10948 | } else if (isSpecificValue(item)) {
|
10949 | clone[index] = cloneSpecificValue(item);
|
10950 | } else {
|
10951 | clone[index] = deepExtend({}, item);
|
10952 | }
|
10953 | } else {
|
10954 | clone[index] = item;
|
10955 | }
|
10956 | });
|
10957 | return clone;
|
10958 | }
|
10959 |
|
10960 | function safeGetProperty(object, property) {
|
10961 | return property === '__proto__' ? undefined : object[property];
|
10962 | }
|
10963 |
|
10964 |
|
10965 |
|
10966 |
|
10967 |
|
10968 |
|
10969 |
|
10970 |
|
10971 |
|
10972 |
|
10973 | var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) {
|
10974 | if (arguments.length < 1 || typeof arguments[0] !== 'object') {
|
10975 | return false;
|
10976 | }
|
10977 |
|
10978 | if (arguments.length < 2) {
|
10979 | return arguments[0];
|
10980 | }
|
10981 |
|
10982 | var target = arguments[0];
|
10983 |
|
10984 |
|
10985 | var args = Array.prototype.slice.call(arguments, 1);
|
10986 |
|
10987 | var val, src, clone;
|
10988 |
|
10989 | args.forEach(function (obj) {
|
10990 |
|
10991 | if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
|
10992 | return;
|
10993 | }
|
10994 |
|
10995 | Object.keys(obj).forEach(function (key) {
|
10996 | src = safeGetProperty(target, key);
|
10997 | val = safeGetProperty(obj, key);
|
10998 |
|
10999 |
|
11000 | if (val === target) {
|
11001 | return;
|
11002 |
|
11003 | |
11004 |
|
11005 |
|
11006 |
|
11007 | } else if (typeof val !== 'object' || val === null) {
|
11008 | target[key] = val;
|
11009 | return;
|
11010 |
|
11011 |
|
11012 | } else if (Array.isArray(val)) {
|
11013 | target[key] = deepCloneArray(val);
|
11014 | return;
|
11015 |
|
11016 |
|
11017 | } else if (isSpecificValue(val)) {
|
11018 | target[key] = cloneSpecificValue(val);
|
11019 | return;
|
11020 |
|
11021 |
|
11022 | } else if (typeof src !== 'object' || src === null || Array.isArray(src)) {
|
11023 | target[key] = deepExtend({}, val);
|
11024 | return;
|
11025 |
|
11026 |
|
11027 | } else {
|
11028 | target[key] = deepExtend(src, val);
|
11029 | return;
|
11030 | }
|
11031 | });
|
11032 | });
|
11033 |
|
11034 | return target;
|
11035 | };
|
11036 |
|
11037 | }.call(this, __webpack_require__(29).Buffer))
|
11038 |
|
11039 | }),
|
11040 |
|
11041 | (function(module, exports, __webpack_require__) {
|
11042 |
|
11043 | var baseClone = __webpack_require__(320);
|
11044 |
|
11045 |
|
11046 | var CLONE_DEEP_FLAG = 1,
|
11047 | CLONE_SYMBOLS_FLAG = 4;
|
11048 |
|
11049 |
|
11050 |
|
11051 |
|
11052 |
|
11053 |
|
11054 |
|
11055 |
|
11056 |
|
11057 |
|
11058 |
|
11059 |
|
11060 |
|
11061 |
|
11062 |
|
11063 |
|
11064 |
|
11065 |
|
11066 |
|
11067 | function cloneDeep(value) {
|
11068 | return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
11069 | }
|
11070 |
|
11071 | module.exports = cloneDeep;
|
11072 |
|
11073 |
|
11074 | }),
|
11075 |
|
11076 | (function(module, __webpack_exports__, __webpack_require__) {
|
11077 |
|
11078 | "use strict";
|
11079 | __webpack_require__.r(__webpack_exports__);
|
11080 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
11081 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
11082 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
11083 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1__);
|
11084 | var _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22);
|
11085 | var _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2__);
|
11086 | var _babel_runtime_corejs2_core_js_weak_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(169);
|
11087 | var _babel_runtime_corejs2_core_js_weak_map__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_weak_map__WEBPACK_IMPORTED_MODULE_3__);
|
11088 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
|
11089 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_4__);
|
11090 | var cross_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(170);
|
11091 | var cross_fetch__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(cross_fetch__WEBPACK_IMPORTED_MODULE_5__);
|
11092 | var js_yaml__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(78);
|
11093 | var js_yaml__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(js_yaml__WEBPACK_IMPORTED_MODULE_6__);
|
11094 | var querystring_browser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(118);
|
11095 | var querystring_browser__WEBPACK_IMPORTED_MODULE_7___default = __webpack_require__.n(querystring_browser__WEBPACK_IMPORTED_MODULE_7__);
|
11096 | var url__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(20);
|
11097 | var url__WEBPACK_IMPORTED_MODULE_8___default = __webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_8__);
|
11098 | var ___WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3);
|
11099 | var _create_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80);
|
11100 | var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(39);
|
11101 | var _constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(81);
|
11102 |
|
11103 |
|
11104 |
|
11105 |
|
11106 |
|
11107 |
|
11108 |
|
11109 |
|
11110 |
|
11111 |
|
11112 |
|
11113 |
|
11114 |
|
11115 | var ABSOLUTE_URL_REGEXP = new RegExp('^([a-z]+://|//)', 'i');
|
11116 | var JSONRefError = Object(_create_error__WEBPACK_IMPORTED_MODULE_10__["default"])('JSONRefError', function cb(message, extra, oriError) {
|
11117 | this.originalError = oriError;
|
11118 |
|
11119 | _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_4___default()(this, extra || {});
|
11120 | });
|
11121 | var docCache = {};
|
11122 | var specmapRefs = new _babel_runtime_corejs2_core_js_weak_map__WEBPACK_IMPORTED_MODULE_3___default.a();
|
11123 | var skipResolutionTestFns = [function (path) {
|
11124 | return (
|
11125 |
|
11126 | path[0] === 'paths' && path[3] === 'responses' && path[5] === 'content' && path[7] === 'example'
|
11127 | );
|
11128 | }, function (path) {
|
11129 | return (
|
11130 |
|
11131 | path[0] === 'paths' && path[3] === 'requestBody' && path[4] === 'content' && path[6] === 'example'
|
11132 | );
|
11133 | }];
|
11134 |
|
11135 | var shouldSkipResolution = function shouldSkipResolution(path) {
|
11136 | return skipResolutionTestFns.some(function (fn) {
|
11137 | return fn(path);
|
11138 | });
|
11139 | };
|
11140 |
|
11141 |
|
11142 |
|
11143 |
|
11144 |
|
11145 |
|
11146 |
|
11147 |
|
11148 |
|
11149 |
|
11150 |
|
11151 |
|
11152 |
|
11153 |
|
11154 |
|
11155 |
|
11156 |
|
11157 |
|
11158 |
|
11159 |
|
11160 |
|
11161 |
|
11162 |
|
11163 |
|
11164 | var plugin = {
|
11165 | key: '$ref',
|
11166 | plugin: function plugin(ref, key, fullPath, specmap) {
|
11167 | var specmapInstance = specmap.getInstance();
|
11168 | var parent = fullPath.slice(0, -1);
|
11169 |
|
11170 | if (Object(_helpers__WEBPACK_IMPORTED_MODULE_11__["isFreelyNamed"])(parent) || shouldSkipResolution(parent)) {
|
11171 | return undefined;
|
11172 | }
|
11173 |
|
11174 | var _specmap$getContext = specmap.getContext(fullPath),
|
11175 | baseDoc = _specmap$getContext.baseDoc;
|
11176 |
|
11177 | if (typeof ref !== 'string') {
|
11178 | return new JSONRefError('$ref: must be a string (JSON-Ref)', {
|
11179 | $ref: ref,
|
11180 | baseDoc: baseDoc,
|
11181 | fullPath: fullPath
|
11182 | });
|
11183 | }
|
11184 |
|
11185 | var splitString = split(ref);
|
11186 | var refPath = splitString[0];
|
11187 | var pointer = splitString[1] || '';
|
11188 | var basePath;
|
11189 |
|
11190 | try {
|
11191 | basePath = baseDoc || refPath ? absoluteify(refPath, baseDoc) : null;
|
11192 | } catch (e) {
|
11193 | return wrapError(e, {
|
11194 | pointer: pointer,
|
11195 | $ref: ref,
|
11196 | basePath: basePath,
|
11197 | fullPath: fullPath
|
11198 | });
|
11199 | }
|
11200 |
|
11201 | var promOrVal;
|
11202 | var tokens;
|
11203 |
|
11204 | if (pointerAlreadyInPath(pointer, basePath, parent, specmap)) {
|
11205 |
|
11206 |
|
11207 |
|
11208 |
|
11209 | if (!specmapInstance.useCircularStructures) {
|
11210 | var _absolutifiedRef = Object(_helpers__WEBPACK_IMPORTED_MODULE_11__["absolutifyPointer"])(ref, basePath);
|
11211 |
|
11212 | if (ref === _absolutifiedRef) {
|
11213 |
|
11214 |
|
11215 | return null;
|
11216 | }
|
11217 |
|
11218 | return ___WEBPACK_IMPORTED_MODULE_9__["default"].replace(fullPath, _absolutifiedRef);
|
11219 | }
|
11220 | }
|
11221 |
|
11222 | if (basePath == null) {
|
11223 | tokens = jsonPointerToArray(pointer);
|
11224 | promOrVal = specmap.get(tokens);
|
11225 |
|
11226 | if (typeof promOrVal === 'undefined') {
|
11227 | promOrVal = new JSONRefError("Could not resolve reference: ".concat(ref), {
|
11228 | pointer: pointer,
|
11229 | $ref: ref,
|
11230 | baseDoc: baseDoc,
|
11231 | fullPath: fullPath
|
11232 | });
|
11233 | }
|
11234 | } else {
|
11235 | promOrVal = extractFromDoc(basePath, pointer);
|
11236 |
|
11237 | if (promOrVal.__value != null) {
|
11238 | promOrVal = promOrVal.__value;
|
11239 | } else {
|
11240 | promOrVal = promOrVal.catch(function (e) {
|
11241 | throw wrapError(e, {
|
11242 | pointer: pointer,
|
11243 | $ref: ref,
|
11244 | baseDoc: baseDoc,
|
11245 | fullPath: fullPath
|
11246 | });
|
11247 | });
|
11248 | }
|
11249 | }
|
11250 |
|
11251 | if (promOrVal instanceof Error) {
|
11252 | return [___WEBPACK_IMPORTED_MODULE_9__["default"].remove(fullPath), promOrVal];
|
11253 | }
|
11254 |
|
11255 | var absolutifiedRef = Object(_helpers__WEBPACK_IMPORTED_MODULE_11__["absolutifyPointer"])(ref, basePath);
|
11256 | var patch = ___WEBPACK_IMPORTED_MODULE_9__["default"].replace(parent, promOrVal, {
|
11257 | $$ref: absolutifiedRef
|
11258 | });
|
11259 |
|
11260 | if (basePath && basePath !== baseDoc) {
|
11261 | return [patch, ___WEBPACK_IMPORTED_MODULE_9__["default"].context(parent, {
|
11262 | baseDoc: basePath
|
11263 | })];
|
11264 | }
|
11265 |
|
11266 | try {
|
11267 |
|
11268 |
|
11269 | if (!patchValueAlreadyInPath(specmap.state, patch) || specmapInstance.useCircularStructures) {
|
11270 | return patch;
|
11271 | }
|
11272 | } catch (e) {
|
11273 |
|
11274 |
|
11275 |
|
11276 |
|
11277 |
|
11278 |
|
11279 |
|
11280 |
|
11281 | return null;
|
11282 | }
|
11283 |
|
11284 | return undefined;
|
11285 | }
|
11286 | };
|
11287 |
|
11288 | var mod = _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_4___default()(plugin, {
|
11289 | docCache: docCache,
|
11290 | absoluteify: absoluteify,
|
11291 | clearCache: clearCache,
|
11292 | JSONRefError: JSONRefError,
|
11293 | wrapError: wrapError,
|
11294 | getDoc: getDoc,
|
11295 | split: split,
|
11296 | extractFromDoc: extractFromDoc,
|
11297 | fetchJSON: fetchJSON,
|
11298 | extract: extract,
|
11299 | jsonPointerToArray: jsonPointerToArray,
|
11300 | unescapeJsonPointerToken: unescapeJsonPointerToken
|
11301 | });
|
11302 |
|
11303 | __webpack_exports__["default"] = (mod);
|
11304 |
|
11305 |
|
11306 |
|
11307 |
|
11308 |
|
11309 |
|
11310 |
|
11311 |
|
11312 | function absoluteify(path, basePath) {
|
11313 | if (!ABSOLUTE_URL_REGEXP.test(path)) {
|
11314 | if (!basePath) {
|
11315 | throw new JSONRefError("Tried to resolve a relative URL, without having a basePath. path: '".concat(path, "' basePath: '").concat(basePath, "'"));
|
11316 | }
|
11317 |
|
11318 | return url__WEBPACK_IMPORTED_MODULE_8___default.a.resolve(basePath, path);
|
11319 | }
|
11320 |
|
11321 | return path;
|
11322 | }
|
11323 |
|
11324 |
|
11325 |
|
11326 |
|
11327 |
|
11328 |
|
11329 |
|
11330 |
|
11331 |
|
11332 | function wrapError(e, extra) {
|
11333 | var message;
|
11334 |
|
11335 | if (e && e.response && e.response.body) {
|
11336 | message = "".concat(e.response.body.code, " ").concat(e.response.body.message);
|
11337 | } else {
|
11338 | message = e.message;
|
11339 | }
|
11340 |
|
11341 | return new JSONRefError("Could not resolve reference: ".concat(message), extra, e);
|
11342 | }
|
11343 |
|
11344 |
|
11345 |
|
11346 |
|
11347 |
|
11348 |
|
11349 | function split(ref) {
|
11350 | return (ref + '').split('#');
|
11351 | }
|
11352 |
|
11353 |
|
11354 |
|
11355 |
|
11356 |
|
11357 |
|
11358 |
|
11359 |
|
11360 |
|
11361 | function extractFromDoc(docPath, pointer) {
|
11362 | var doc = docCache[docPath];
|
11363 |
|
11364 | if (doc && !___WEBPACK_IMPORTED_MODULE_9__["default"].isPromise(doc)) {
|
11365 |
|
11366 |
|
11367 |
|
11368 |
|
11369 |
|
11370 |
|
11371 | try {
|
11372 | var v = extract(pointer, doc);
|
11373 | return _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.resolve(v), {
|
11374 | __value: v
|
11375 | });
|
11376 | } catch (e) {
|
11377 | return _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.reject(e);
|
11378 | }
|
11379 | }
|
11380 |
|
11381 | return getDoc(docPath).then(function (_doc) {
|
11382 | return extract(pointer, _doc);
|
11383 | });
|
11384 | }
|
11385 |
|
11386 |
|
11387 |
|
11388 |
|
11389 |
|
11390 |
|
11391 |
|
11392 | function clearCache(item) {
|
11393 | if (typeof item !== 'undefined') {
|
11394 | delete docCache[item];
|
11395 | } else {
|
11396 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1___default()(docCache).forEach(function (key) {
|
11397 | delete docCache[key];
|
11398 | });
|
11399 | }
|
11400 | }
|
11401 |
|
11402 |
|
11403 |
|
11404 |
|
11405 |
|
11406 |
|
11407 |
|
11408 |
|
11409 | function getDoc(docPath) {
|
11410 | var val = docCache[docPath];
|
11411 |
|
11412 | if (val) {
|
11413 | return ___WEBPACK_IMPORTED_MODULE_9__["default"].isPromise(val) ? val : _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_2___default.a.resolve(val);
|
11414 | }
|
11415 |
|
11416 |
|
11417 |
|
11418 | docCache[docPath] = mod.fetchJSON(docPath).then(function (doc) {
|
11419 | docCache[docPath] = doc;
|
11420 | return doc;
|
11421 | });
|
11422 | return docCache[docPath];
|
11423 | }
|
11424 |
|
11425 |
|
11426 |
|
11427 |
|
11428 |
|
11429 |
|
11430 |
|
11431 |
|
11432 | function fetchJSON(docPath) {
|
11433 | return Object(cross_fetch__WEBPACK_IMPORTED_MODULE_5__["fetch"])(docPath, {
|
11434 | headers: {
|
11435 | Accept: _constants__WEBPACK_IMPORTED_MODULE_12__["ACCEPT_HEADER_VALUE_FOR_DOCUMENTS"]
|
11436 | },
|
11437 | loadSpec: true
|
11438 | }).then(function (res) {
|
11439 | return res.text();
|
11440 | }).then(function (text) {
|
11441 | return js_yaml__WEBPACK_IMPORTED_MODULE_6___default.a.safeLoad(text);
|
11442 | });
|
11443 | }
|
11444 |
|
11445 |
|
11446 |
|
11447 |
|
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 |
|
11453 | function extract(pointer, obj) {
|
11454 | var tokens = jsonPointerToArray(pointer);
|
11455 |
|
11456 | if (tokens.length < 1) {
|
11457 | return obj;
|
11458 | }
|
11459 |
|
11460 | var val = ___WEBPACK_IMPORTED_MODULE_9__["default"].getIn(obj, tokens);
|
11461 |
|
11462 | if (typeof val === 'undefined') {
|
11463 | throw new JSONRefError("Could not resolve pointer: ".concat(pointer, " does not exist in document"), {
|
11464 | pointer: pointer
|
11465 | });
|
11466 | }
|
11467 |
|
11468 | return val;
|
11469 | }
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 | function jsonPointerToArray(pointer) {
|
11477 | if (typeof pointer !== 'string') {
|
11478 | throw new TypeError("Expected a string, got a ".concat(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(pointer)));
|
11479 | }
|
11480 |
|
11481 | if (pointer[0] === '/') {
|
11482 | pointer = pointer.substr(1);
|
11483 | }
|
11484 |
|
11485 | if (pointer === '') {
|
11486 | return [];
|
11487 | }
|
11488 |
|
11489 | return pointer.split('/').map(unescapeJsonPointerToken);
|
11490 | }
|
11491 |
|
11492 |
|
11493 |
|
11494 |
|
11495 |
|
11496 |
|
11497 | function unescapeJsonPointerToken(token) {
|
11498 | if (typeof token !== 'string') {
|
11499 | return token;
|
11500 | }
|
11501 |
|
11502 | return querystring_browser__WEBPACK_IMPORTED_MODULE_7___default.a.unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));
|
11503 | }
|
11504 |
|
11505 |
|
11506 |
|
11507 |
|
11508 |
|
11509 |
|
11510 | function escapeJsonPointerToken(token) {
|
11511 | return querystring_browser__WEBPACK_IMPORTED_MODULE_7___default.a.escape(token.replace(/~/g, '~0').replace(/\//g, '~1'));
|
11512 | }
|
11513 |
|
11514 | function arrayToJsonPointer(arr) {
|
11515 | if (arr.length === 0) {
|
11516 | return '';
|
11517 | }
|
11518 |
|
11519 | return "/".concat(arr.map(escapeJsonPointerToken).join('/'));
|
11520 | }
|
11521 |
|
11522 | var pointerBoundaryChar = function pointerBoundaryChar(c) {
|
11523 | return !c || c === '/' || c === '#';
|
11524 | };
|
11525 |
|
11526 | function pointerIsAParent(pointer, parentPointer) {
|
11527 | if (pointerBoundaryChar(parentPointer)) {
|
11528 |
|
11529 | return true;
|
11530 | }
|
11531 |
|
11532 | var nextChar = pointer.charAt(parentPointer.length);
|
11533 | var lastParentChar = parentPointer.slice(-1);
|
11534 | return pointer.indexOf(parentPointer) === 0 && (!nextChar || nextChar === '/' || nextChar === '#') && lastParentChar !== '#';
|
11535 | }
|
11536 |
|
11537 |
|
11538 |
|
11539 |
|
11540 |
|
11541 |
|
11542 |
|
11543 |
|
11544 | function pointerAlreadyInPath(pointer, basePath, parent, specmap) {
|
11545 | var refs = specmapRefs.get(specmap);
|
11546 |
|
11547 | if (!refs) {
|
11548 |
|
11549 |
|
11550 | refs = {};
|
11551 | specmapRefs.set(specmap, refs);
|
11552 | }
|
11553 |
|
11554 | var parentPointer = arrayToJsonPointer(parent);
|
11555 | var fullyQualifiedPointer = "".concat(basePath || '<specmap-base>', "#").concat(pointer);
|
11556 |
|
11557 |
|
11558 |
|
11559 |
|
11560 |
|
11561 |
|
11562 |
|
11563 |
|
11564 |
|
11565 |
|
11566 | var safeParentPointer = parentPointer.replace(/allOf\/\d+\/?/g, '');
|
11567 |
|
11568 |
|
11569 |
|
11570 | var rootDoc = specmap.contextTree.get([]).baseDoc;
|
11571 |
|
11572 | if (basePath == rootDoc && pointerIsAParent(safeParentPointer, pointer)) {
|
11573 |
|
11574 | return true;
|
11575 | }
|
11576 |
|
11577 |
|
11578 |
|
11579 |
|
11580 |
|
11581 |
|
11582 | var currPath = '';
|
11583 | var hasIndirectCycle = parent.some(function (token) {
|
11584 | currPath = "".concat(currPath, "/").concat(escapeJsonPointerToken(token));
|
11585 | return refs[currPath] && refs[currPath].some(function (ref) {
|
11586 | return pointerIsAParent(ref, fullyQualifiedPointer) || pointerIsAParent(fullyQualifiedPointer, ref);
|
11587 | });
|
11588 | });
|
11589 |
|
11590 | if (hasIndirectCycle) {
|
11591 | return true;
|
11592 | }
|
11593 |
|
11594 |
|
11595 |
|
11596 | refs[safeParentPointer] = (refs[safeParentPointer] || []).concat(fullyQualifiedPointer);
|
11597 | return undefined;
|
11598 | }
|
11599 |
|
11600 |
|
11601 |
|
11602 |
|
11603 |
|
11604 | function patchValueAlreadyInPath(root, patch) {
|
11605 | var ancestors = [root];
|
11606 | patch.path.reduce(function (parent, p) {
|
11607 | ancestors.push(parent[p]);
|
11608 | return parent[p];
|
11609 | }, root);
|
11610 | return pointToAncestor(patch.value);
|
11611 |
|
11612 | function pointToAncestor(obj) {
|
11613 | return ___WEBPACK_IMPORTED_MODULE_9__["default"].isObject(obj) && (ancestors.indexOf(obj) >= 0 || _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1___default()(obj).some(function (k) {
|
11614 | return pointToAncestor(obj[k]);
|
11615 | }));
|
11616 | }
|
11617 | }
|
11618 |
|
11619 | }),
|
11620 |
|
11621 | (function(module, exports, __webpack_require__) {
|
11622 |
|
11623 | module.exports = __webpack_require__(349);
|
11624 |
|
11625 | }),
|
11626 |
|
11627 | (function(module, exports) {
|
11628 |
|
11629 | var __self__ = (function (root) {
|
11630 | function F() {
|
11631 | this.fetch = false;
|
11632 | this.DOMException = root.DOMException
|
11633 | }
|
11634 | F.prototype = root;
|
11635 | return new F();
|
11636 | })(typeof self !== 'undefined' ? self : this);
|
11637 | (function(self) {
|
11638 |
|
11639 | var irrelevant = (function (exports) {
|
11640 | var support = {
|
11641 | searchParams: 'URLSearchParams' in self,
|
11642 | iterable: 'Symbol' in self && 'iterator' in Symbol,
|
11643 | blob:
|
11644 | 'FileReader' in self &&
|
11645 | 'Blob' in self &&
|
11646 | (function() {
|
11647 | try {
|
11648 | new Blob();
|
11649 | return true
|
11650 | } catch (e) {
|
11651 | return false
|
11652 | }
|
11653 | })(),
|
11654 | formData: 'FormData' in self,
|
11655 | arrayBuffer: 'ArrayBuffer' in self
|
11656 | };
|
11657 |
|
11658 | function isDataView(obj) {
|
11659 | return obj && DataView.prototype.isPrototypeOf(obj)
|
11660 | }
|
11661 |
|
11662 | if (support.arrayBuffer) {
|
11663 | var viewClasses = [
|
11664 | '[object Int8Array]',
|
11665 | '[object Uint8Array]',
|
11666 | '[object Uint8ClampedArray]',
|
11667 | '[object Int16Array]',
|
11668 | '[object Uint16Array]',
|
11669 | '[object Int32Array]',
|
11670 | '[object Uint32Array]',
|
11671 | '[object Float32Array]',
|
11672 | '[object Float64Array]'
|
11673 | ];
|
11674 |
|
11675 | var isArrayBufferView =
|
11676 | ArrayBuffer.isView ||
|
11677 | function(obj) {
|
11678 | return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
11679 | };
|
11680 | }
|
11681 |
|
11682 | function normalizeName(name) {
|
11683 | if (typeof name !== 'string') {
|
11684 | name = String(name);
|
11685 | }
|
11686 | if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
11687 | throw new TypeError('Invalid character in header field name')
|
11688 | }
|
11689 | return name.toLowerCase()
|
11690 | }
|
11691 |
|
11692 | function normalizeValue(value) {
|
11693 | if (typeof value !== 'string') {
|
11694 | value = String(value);
|
11695 | }
|
11696 | return value
|
11697 | }
|
11698 |
|
11699 |
|
11700 | function iteratorFor(items) {
|
11701 | var iterator = {
|
11702 | next: function() {
|
11703 | var value = items.shift();
|
11704 | return {done: value === undefined, value: value}
|
11705 | }
|
11706 | };
|
11707 |
|
11708 | if (support.iterable) {
|
11709 | iterator[Symbol.iterator] = function() {
|
11710 | return iterator
|
11711 | };
|
11712 | }
|
11713 |
|
11714 | return iterator
|
11715 | }
|
11716 |
|
11717 | function Headers(headers) {
|
11718 | this.map = {};
|
11719 |
|
11720 | if (headers instanceof Headers) {
|
11721 | headers.forEach(function(value, name) {
|
11722 | this.append(name, value);
|
11723 | }, this);
|
11724 | } else if (Array.isArray(headers)) {
|
11725 | headers.forEach(function(header) {
|
11726 | this.append(header[0], header[1]);
|
11727 | }, this);
|
11728 | } else if (headers) {
|
11729 | Object.getOwnPropertyNames(headers).forEach(function(name) {
|
11730 | this.append(name, headers[name]);
|
11731 | }, this);
|
11732 | }
|
11733 | }
|
11734 |
|
11735 | Headers.prototype.append = function(name, value) {
|
11736 | name = normalizeName(name);
|
11737 | value = normalizeValue(value);
|
11738 | var oldValue = this.map[name];
|
11739 | this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
11740 | };
|
11741 |
|
11742 | Headers.prototype['delete'] = function(name) {
|
11743 | delete this.map[normalizeName(name)];
|
11744 | };
|
11745 |
|
11746 | Headers.prototype.get = function(name) {
|
11747 | name = normalizeName(name);
|
11748 | return this.has(name) ? this.map[name] : null
|
11749 | };
|
11750 |
|
11751 | Headers.prototype.has = function(name) {
|
11752 | return this.map.hasOwnProperty(normalizeName(name))
|
11753 | };
|
11754 |
|
11755 | Headers.prototype.set = function(name, value) {
|
11756 | this.map[normalizeName(name)] = normalizeValue(value);
|
11757 | };
|
11758 |
|
11759 | Headers.prototype.forEach = function(callback, thisArg) {
|
11760 | for (var name in this.map) {
|
11761 | if (this.map.hasOwnProperty(name)) {
|
11762 | callback.call(thisArg, this.map[name], name, this);
|
11763 | }
|
11764 | }
|
11765 | };
|
11766 |
|
11767 | Headers.prototype.keys = function() {
|
11768 | var items = [];
|
11769 | this.forEach(function(value, name) {
|
11770 | items.push(name);
|
11771 | });
|
11772 | return iteratorFor(items)
|
11773 | };
|
11774 |
|
11775 | Headers.prototype.values = function() {
|
11776 | var items = [];
|
11777 | this.forEach(function(value) {
|
11778 | items.push(value);
|
11779 | });
|
11780 | return iteratorFor(items)
|
11781 | };
|
11782 |
|
11783 | Headers.prototype.entries = function() {
|
11784 | var items = [];
|
11785 | this.forEach(function(value, name) {
|
11786 | items.push([name, value]);
|
11787 | });
|
11788 | return iteratorFor(items)
|
11789 | };
|
11790 |
|
11791 | if (support.iterable) {
|
11792 | Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
11793 | }
|
11794 |
|
11795 | function consumed(body) {
|
11796 | if (body.bodyUsed) {
|
11797 | return Promise.reject(new TypeError('Already read'))
|
11798 | }
|
11799 | body.bodyUsed = true;
|
11800 | }
|
11801 |
|
11802 | function fileReaderReady(reader) {
|
11803 | return new Promise(function(resolve, reject) {
|
11804 | reader.onload = function() {
|
11805 | resolve(reader.result);
|
11806 | };
|
11807 | reader.onerror = function() {
|
11808 | reject(reader.error);
|
11809 | };
|
11810 | })
|
11811 | }
|
11812 |
|
11813 | function readBlobAsArrayBuffer(blob) {
|
11814 | var reader = new FileReader();
|
11815 | var promise = fileReaderReady(reader);
|
11816 | reader.readAsArrayBuffer(blob);
|
11817 | return promise
|
11818 | }
|
11819 |
|
11820 | function readBlobAsText(blob) {
|
11821 | var reader = new FileReader();
|
11822 | var promise = fileReaderReady(reader);
|
11823 | reader.readAsText(blob);
|
11824 | return promise
|
11825 | }
|
11826 |
|
11827 | function readArrayBufferAsText(buf) {
|
11828 | var view = new Uint8Array(buf);
|
11829 | var chars = new Array(view.length);
|
11830 |
|
11831 | for (var i = 0; i < view.length; i++) {
|
11832 | chars[i] = String.fromCharCode(view[i]);
|
11833 | }
|
11834 | return chars.join('')
|
11835 | }
|
11836 |
|
11837 | function bufferClone(buf) {
|
11838 | if (buf.slice) {
|
11839 | return buf.slice(0)
|
11840 | } else {
|
11841 | var view = new Uint8Array(buf.byteLength);
|
11842 | view.set(new Uint8Array(buf));
|
11843 | return view.buffer
|
11844 | }
|
11845 | }
|
11846 |
|
11847 | function Body() {
|
11848 | this.bodyUsed = false;
|
11849 |
|
11850 | this._initBody = function(body) {
|
11851 | this._bodyInit = body;
|
11852 | if (!body) {
|
11853 | this._bodyText = '';
|
11854 | } else if (typeof body === 'string') {
|
11855 | this._bodyText = body;
|
11856 | } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
11857 | this._bodyBlob = body;
|
11858 | } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
11859 | this._bodyFormData = body;
|
11860 | } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
11861 | this._bodyText = body.toString();
|
11862 | } else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
11863 | this._bodyArrayBuffer = bufferClone(body.buffer);
|
11864 |
|
11865 | this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
11866 | } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
11867 | this._bodyArrayBuffer = bufferClone(body);
|
11868 | } else {
|
11869 | this._bodyText = body = Object.prototype.toString.call(body);
|
11870 | }
|
11871 |
|
11872 | if (!this.headers.get('content-type')) {
|
11873 | if (typeof body === 'string') {
|
11874 | this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
11875 | } else if (this._bodyBlob && this._bodyBlob.type) {
|
11876 | this.headers.set('content-type', this._bodyBlob.type);
|
11877 | } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
11878 | this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
11879 | }
|
11880 | }
|
11881 | };
|
11882 |
|
11883 | if (support.blob) {
|
11884 | this.blob = function() {
|
11885 | var rejected = consumed(this);
|
11886 | if (rejected) {
|
11887 | return rejected
|
11888 | }
|
11889 |
|
11890 | if (this._bodyBlob) {
|
11891 | return Promise.resolve(this._bodyBlob)
|
11892 | } else if (this._bodyArrayBuffer) {
|
11893 | return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
11894 | } else if (this._bodyFormData) {
|
11895 | throw new Error('could not read FormData body as blob')
|
11896 | } else {
|
11897 | return Promise.resolve(new Blob([this._bodyText]))
|
11898 | }
|
11899 | };
|
11900 |
|
11901 | this.arrayBuffer = function() {
|
11902 | if (this._bodyArrayBuffer) {
|
11903 | return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
11904 | } else {
|
11905 | return this.blob().then(readBlobAsArrayBuffer)
|
11906 | }
|
11907 | };
|
11908 | }
|
11909 |
|
11910 | this.text = function() {
|
11911 | var rejected = consumed(this);
|
11912 | if (rejected) {
|
11913 | return rejected
|
11914 | }
|
11915 |
|
11916 | if (this._bodyBlob) {
|
11917 | return readBlobAsText(this._bodyBlob)
|
11918 | } else if (this._bodyArrayBuffer) {
|
11919 | return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
11920 | } else if (this._bodyFormData) {
|
11921 | throw new Error('could not read FormData body as text')
|
11922 | } else {
|
11923 | return Promise.resolve(this._bodyText)
|
11924 | }
|
11925 | };
|
11926 |
|
11927 | if (support.formData) {
|
11928 | this.formData = function() {
|
11929 | return this.text().then(decode)
|
11930 | };
|
11931 | }
|
11932 |
|
11933 | this.json = function() {
|
11934 | return this.text().then(JSON.parse)
|
11935 | };
|
11936 |
|
11937 | return this
|
11938 | }
|
11939 |
|
11940 |
|
11941 | var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
11942 |
|
11943 | function normalizeMethod(method) {
|
11944 | var upcased = method.toUpperCase();
|
11945 | return methods.indexOf(upcased) > -1 ? upcased : method
|
11946 | }
|
11947 |
|
11948 | function Request(input, options) {
|
11949 | options = options || {};
|
11950 | var body = options.body;
|
11951 |
|
11952 | if (input instanceof Request) {
|
11953 | if (input.bodyUsed) {
|
11954 | throw new TypeError('Already read')
|
11955 | }
|
11956 | this.url = input.url;
|
11957 | this.credentials = input.credentials;
|
11958 | if (!options.headers) {
|
11959 | this.headers = new Headers(input.headers);
|
11960 | }
|
11961 | this.method = input.method;
|
11962 | this.mode = input.mode;
|
11963 | this.signal = input.signal;
|
11964 | if (!body && input._bodyInit != null) {
|
11965 | body = input._bodyInit;
|
11966 | input.bodyUsed = true;
|
11967 | }
|
11968 | } else {
|
11969 | this.url = String(input);
|
11970 | }
|
11971 |
|
11972 | this.credentials = options.credentials || this.credentials || 'same-origin';
|
11973 | if (options.headers || !this.headers) {
|
11974 | this.headers = new Headers(options.headers);
|
11975 | }
|
11976 | this.method = normalizeMethod(options.method || this.method || 'GET');
|
11977 | this.mode = options.mode || this.mode || null;
|
11978 | this.signal = options.signal || this.signal;
|
11979 | this.referrer = null;
|
11980 |
|
11981 | if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
11982 | throw new TypeError('Body not allowed for GET or HEAD requests')
|
11983 | }
|
11984 | this._initBody(body);
|
11985 | }
|
11986 |
|
11987 | Request.prototype.clone = function() {
|
11988 | return new Request(this, {body: this._bodyInit})
|
11989 | };
|
11990 |
|
11991 | function decode(body) {
|
11992 | var form = new FormData();
|
11993 | body
|
11994 | .trim()
|
11995 | .split('&')
|
11996 | .forEach(function(bytes) {
|
11997 | if (bytes) {
|
11998 | var split = bytes.split('=');
|
11999 | var name = split.shift().replace(/\+/g, ' ');
|
12000 | var value = split.join('=').replace(/\+/g, ' ');
|
12001 | form.append(decodeURIComponent(name), decodeURIComponent(value));
|
12002 | }
|
12003 | });
|
12004 | return form
|
12005 | }
|
12006 |
|
12007 | function parseHeaders(rawHeaders) {
|
12008 | var headers = new Headers();
|
12009 |
|
12010 |
|
12011 | var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
12012 | preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
|
12013 | var parts = line.split(':');
|
12014 | var key = parts.shift().trim();
|
12015 | if (key) {
|
12016 | var value = parts.join(':').trim();
|
12017 | headers.append(key, value);
|
12018 | }
|
12019 | });
|
12020 | return headers
|
12021 | }
|
12022 |
|
12023 | Body.call(Request.prototype);
|
12024 |
|
12025 | function Response(bodyInit, options) {
|
12026 | if (!options) {
|
12027 | options = {};
|
12028 | }
|
12029 |
|
12030 | this.type = 'default';
|
12031 | this.status = options.status === undefined ? 200 : options.status;
|
12032 | this.ok = this.status >= 200 && this.status < 300;
|
12033 | this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
12034 | this.headers = new Headers(options.headers);
|
12035 | this.url = options.url || '';
|
12036 | this._initBody(bodyInit);
|
12037 | }
|
12038 |
|
12039 | Body.call(Response.prototype);
|
12040 |
|
12041 | Response.prototype.clone = function() {
|
12042 | return new Response(this._bodyInit, {
|
12043 | status: this.status,
|
12044 | statusText: this.statusText,
|
12045 | headers: new Headers(this.headers),
|
12046 | url: this.url
|
12047 | })
|
12048 | };
|
12049 |
|
12050 | Response.error = function() {
|
12051 | var response = new Response(null, {status: 0, statusText: ''});
|
12052 | response.type = 'error';
|
12053 | return response
|
12054 | };
|
12055 |
|
12056 | var redirectStatuses = [301, 302, 303, 307, 308];
|
12057 |
|
12058 | Response.redirect = function(url, status) {
|
12059 | if (redirectStatuses.indexOf(status) === -1) {
|
12060 | throw new RangeError('Invalid status code')
|
12061 | }
|
12062 |
|
12063 | return new Response(null, {status: status, headers: {location: url}})
|
12064 | };
|
12065 |
|
12066 | exports.DOMException = self.DOMException;
|
12067 | try {
|
12068 | new exports.DOMException();
|
12069 | } catch (err) {
|
12070 | exports.DOMException = function(message, name) {
|
12071 | this.message = message;
|
12072 | this.name = name;
|
12073 | var error = Error(message);
|
12074 | this.stack = error.stack;
|
12075 | };
|
12076 | exports.DOMException.prototype = Object.create(Error.prototype);
|
12077 | exports.DOMException.prototype.constructor = exports.DOMException;
|
12078 | }
|
12079 |
|
12080 | function fetch(input, init) {
|
12081 | return new Promise(function(resolve, reject) {
|
12082 | var request = new Request(input, init);
|
12083 |
|
12084 | if (request.signal && request.signal.aborted) {
|
12085 | return reject(new exports.DOMException('Aborted', 'AbortError'))
|
12086 | }
|
12087 |
|
12088 | var xhr = new XMLHttpRequest();
|
12089 |
|
12090 | function abortXhr() {
|
12091 | xhr.abort();
|
12092 | }
|
12093 |
|
12094 | xhr.onload = function() {
|
12095 | var options = {
|
12096 | status: xhr.status,
|
12097 | statusText: xhr.statusText,
|
12098 | headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
12099 | };
|
12100 | options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
12101 | var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
12102 | resolve(new Response(body, options));
|
12103 | };
|
12104 |
|
12105 | xhr.onerror = function() {
|
12106 | reject(new TypeError('Network request failed'));
|
12107 | };
|
12108 |
|
12109 | xhr.ontimeout = function() {
|
12110 | reject(new TypeError('Network request failed'));
|
12111 | };
|
12112 |
|
12113 | xhr.onabort = function() {
|
12114 | reject(new exports.DOMException('Aborted', 'AbortError'));
|
12115 | };
|
12116 |
|
12117 | xhr.open(request.method, request.url, true);
|
12118 |
|
12119 | if (request.credentials === 'include') {
|
12120 | xhr.withCredentials = true;
|
12121 | } else if (request.credentials === 'omit') {
|
12122 | xhr.withCredentials = false;
|
12123 | }
|
12124 |
|
12125 | if ('responseType' in xhr && support.blob) {
|
12126 | xhr.responseType = 'blob';
|
12127 | }
|
12128 |
|
12129 | request.headers.forEach(function(value, name) {
|
12130 | xhr.setRequestHeader(name, value);
|
12131 | });
|
12132 |
|
12133 | if (request.signal) {
|
12134 | request.signal.addEventListener('abort', abortXhr);
|
12135 |
|
12136 | xhr.onreadystatechange = function() {
|
12137 |
|
12138 | if (xhr.readyState === 4) {
|
12139 | request.signal.removeEventListener('abort', abortXhr);
|
12140 | }
|
12141 | };
|
12142 | }
|
12143 |
|
12144 | xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
12145 | })
|
12146 | }
|
12147 |
|
12148 | fetch.polyfill = true;
|
12149 |
|
12150 | if (!self.fetch) {
|
12151 | self.fetch = fetch;
|
12152 | self.Headers = Headers;
|
12153 | self.Request = Request;
|
12154 | self.Response = Response;
|
12155 | }
|
12156 |
|
12157 | exports.Headers = Headers;
|
12158 | exports.Request = Request;
|
12159 | exports.Response = Response;
|
12160 | exports.fetch = fetch;
|
12161 |
|
12162 | return exports;
|
12163 |
|
12164 | }({}));
|
12165 | })(__self__);
|
12166 | delete __self__.fetch.polyfill
|
12167 | exports = __self__.fetch
|
12168 | exports.default = __self__.fetch
|
12169 | exports.fetch = __self__.fetch
|
12170 | exports.Headers = __self__.Headers
|
12171 | exports.Request = __self__.Request
|
12172 | exports.Response = __self__.Response
|
12173 | module.exports = exports
|
12174 |
|
12175 |
|
12176 | }),
|
12177 |
|
12178 | (function(module, exports) {
|
12179 |
|
12180 | var traverse = module.exports = function (obj) {
|
12181 | return new Traverse(obj);
|
12182 | };
|
12183 |
|
12184 | function Traverse (obj) {
|
12185 | this.value = obj;
|
12186 | }
|
12187 |
|
12188 | Traverse.prototype.get = function (ps) {
|
12189 | var node = this.value;
|
12190 | for (var i = 0; i < ps.length; i ++) {
|
12191 | var key = ps[i];
|
12192 | if (!node || !hasOwnProperty.call(node, key)) {
|
12193 | node = undefined;
|
12194 | break;
|
12195 | }
|
12196 | node = node[key];
|
12197 | }
|
12198 | return node;
|
12199 | };
|
12200 |
|
12201 | Traverse.prototype.has = function (ps) {
|
12202 | var node = this.value;
|
12203 | for (var i = 0; i < ps.length; i ++) {
|
12204 | var key = ps[i];
|
12205 | if (!node || !hasOwnProperty.call(node, key)) {
|
12206 | return false;
|
12207 | }
|
12208 | node = node[key];
|
12209 | }
|
12210 | return true;
|
12211 | };
|
12212 |
|
12213 | Traverse.prototype.set = function (ps, value) {
|
12214 | var node = this.value;
|
12215 | for (var i = 0; i < ps.length - 1; i ++) {
|
12216 | var key = ps[i];
|
12217 | if (!hasOwnProperty.call(node, key)) node[key] = {};
|
12218 | node = node[key];
|
12219 | }
|
12220 | node[ps[i]] = value;
|
12221 | return value;
|
12222 | };
|
12223 |
|
12224 | Traverse.prototype.map = function (cb) {
|
12225 | return walk(this.value, cb, true);
|
12226 | };
|
12227 |
|
12228 | Traverse.prototype.forEach = function (cb) {
|
12229 | this.value = walk(this.value, cb, false);
|
12230 | return this.value;
|
12231 | };
|
12232 |
|
12233 | Traverse.prototype.reduce = function (cb, init) {
|
12234 | var skip = arguments.length === 1;
|
12235 | var acc = skip ? this.value : init;
|
12236 | this.forEach(function (x) {
|
12237 | if (!this.isRoot || !skip) {
|
12238 | acc = cb.call(this, acc, x);
|
12239 | }
|
12240 | });
|
12241 | return acc;
|
12242 | };
|
12243 |
|
12244 | Traverse.prototype.paths = function () {
|
12245 | var acc = [];
|
12246 | this.forEach(function (x) {
|
12247 | acc.push(this.path);
|
12248 | });
|
12249 | return acc;
|
12250 | };
|
12251 |
|
12252 | Traverse.prototype.nodes = function () {
|
12253 | var acc = [];
|
12254 | this.forEach(function (x) {
|
12255 | acc.push(this.node);
|
12256 | });
|
12257 | return acc;
|
12258 | };
|
12259 |
|
12260 | Traverse.prototype.clone = function () {
|
12261 | var parents = [], nodes = [];
|
12262 |
|
12263 | return (function clone (src) {
|
12264 | for (var i = 0; i < parents.length; i++) {
|
12265 | if (parents[i] === src) {
|
12266 | return nodes[i];
|
12267 | }
|
12268 | }
|
12269 |
|
12270 | if (typeof src === 'object' && src !== null) {
|
12271 | var dst = copy(src);
|
12272 |
|
12273 | parents.push(src);
|
12274 | nodes.push(dst);
|
12275 |
|
12276 | forEach(objectKeys(src), function (key) {
|
12277 | dst[key] = clone(src[key]);
|
12278 | });
|
12279 |
|
12280 | parents.pop();
|
12281 | nodes.pop();
|
12282 | return dst;
|
12283 | }
|
12284 | else {
|
12285 | return src;
|
12286 | }
|
12287 | })(this.value);
|
12288 | };
|
12289 |
|
12290 | function walk (root, cb, immutable) {
|
12291 | var path = [];
|
12292 | var parents = [];
|
12293 | var alive = true;
|
12294 |
|
12295 | return (function walker (node_) {
|
12296 | var node = immutable ? copy(node_) : node_;
|
12297 | var modifiers = {};
|
12298 |
|
12299 | var keepGoing = true;
|
12300 |
|
12301 | var state = {
|
12302 | node : node,
|
12303 | node_ : node_,
|
12304 | path : [].concat(path),
|
12305 | parent : parents[parents.length - 1],
|
12306 | parents : parents,
|
12307 | key : path.slice(-1)[0],
|
12308 | isRoot : path.length === 0,
|
12309 | level : path.length,
|
12310 | circular : null,
|
12311 | update : function (x, stopHere) {
|
12312 | if (!state.isRoot) {
|
12313 | state.parent.node[state.key] = x;
|
12314 | }
|
12315 | state.node = x;
|
12316 | if (stopHere) keepGoing = false;
|
12317 | },
|
12318 | 'delete' : function (stopHere) {
|
12319 | delete state.parent.node[state.key];
|
12320 | if (stopHere) keepGoing = false;
|
12321 | },
|
12322 | remove : function (stopHere) {
|
12323 | if (isArray(state.parent.node)) {
|
12324 | state.parent.node.splice(state.key, 1);
|
12325 | }
|
12326 | else {
|
12327 | delete state.parent.node[state.key];
|
12328 | }
|
12329 | if (stopHere) keepGoing = false;
|
12330 | },
|
12331 | keys : null,
|
12332 | before : function (f) { modifiers.before = f },
|
12333 | after : function (f) { modifiers.after = f },
|
12334 | pre : function (f) { modifiers.pre = f },
|
12335 | post : function (f) { modifiers.post = f },
|
12336 | stop : function () { alive = false },
|
12337 | block : function () { keepGoing = false }
|
12338 | };
|
12339 |
|
12340 | if (!alive) return state;
|
12341 |
|
12342 | function updateState() {
|
12343 | if (typeof state.node === 'object' && state.node !== null) {
|
12344 | if (!state.keys || state.node_ !== state.node) {
|
12345 | state.keys = objectKeys(state.node)
|
12346 | }
|
12347 |
|
12348 | state.isLeaf = state.keys.length == 0;
|
12349 |
|
12350 | for (var i = 0; i < parents.length; i++) {
|
12351 | if (parents[i].node_ === node_) {
|
12352 | state.circular = parents[i];
|
12353 | break;
|
12354 | }
|
12355 | }
|
12356 | }
|
12357 | else {
|
12358 | state.isLeaf = true;
|
12359 | state.keys = null;
|
12360 | }
|
12361 |
|
12362 | state.notLeaf = !state.isLeaf;
|
12363 | state.notRoot = !state.isRoot;
|
12364 | }
|
12365 |
|
12366 | updateState();
|
12367 |
|
12368 |
|
12369 | var ret = cb.call(state, state.node);
|
12370 | if (ret !== undefined && state.update) state.update(ret);
|
12371 |
|
12372 | if (modifiers.before) modifiers.before.call(state, state.node);
|
12373 |
|
12374 | if (!keepGoing) return state;
|
12375 |
|
12376 | if (typeof state.node == 'object'
|
12377 | && state.node !== null && !state.circular) {
|
12378 | parents.push(state);
|
12379 |
|
12380 | updateState();
|
12381 |
|
12382 | forEach(state.keys, function (key, i) {
|
12383 | path.push(key);
|
12384 |
|
12385 | if (modifiers.pre) modifiers.pre.call(state, state.node[key], key);
|
12386 |
|
12387 | var child = walker(state.node[key]);
|
12388 | if (immutable && hasOwnProperty.call(state.node, key)) {
|
12389 | state.node[key] = child.node;
|
12390 | }
|
12391 |
|
12392 | child.isLast = i == state.keys.length - 1;
|
12393 | child.isFirst = i == 0;
|
12394 |
|
12395 | if (modifiers.post) modifiers.post.call(state, child);
|
12396 |
|
12397 | path.pop();
|
12398 | });
|
12399 | parents.pop();
|
12400 | }
|
12401 |
|
12402 | if (modifiers.after) modifiers.after.call(state, state.node);
|
12403 |
|
12404 | return state;
|
12405 | })(root).node;
|
12406 | }
|
12407 |
|
12408 | function copy (src) {
|
12409 | if (typeof src === 'object' && src !== null) {
|
12410 | var dst;
|
12411 |
|
12412 | if (isArray(src)) {
|
12413 | dst = [];
|
12414 | }
|
12415 | else if (isDate(src)) {
|
12416 | dst = new Date(src.getTime ? src.getTime() : src);
|
12417 | }
|
12418 | else if (isRegExp(src)) {
|
12419 | dst = new RegExp(src);
|
12420 | }
|
12421 | else if (isError(src)) {
|
12422 | dst = { message: src.message };
|
12423 | }
|
12424 | else if (isBoolean(src)) {
|
12425 | dst = new Boolean(src);
|
12426 | }
|
12427 | else if (isNumber(src)) {
|
12428 | dst = new Number(src);
|
12429 | }
|
12430 | else if (isString(src)) {
|
12431 | dst = new String(src);
|
12432 | }
|
12433 | else if (Object.create && Object.getPrototypeOf) {
|
12434 | dst = Object.create(Object.getPrototypeOf(src));
|
12435 | }
|
12436 | else if (src.constructor === Object) {
|
12437 | dst = {};
|
12438 | }
|
12439 | else {
|
12440 | var proto =
|
12441 | (src.constructor && src.constructor.prototype)
|
12442 | || src.__proto__
|
12443 | || {}
|
12444 | ;
|
12445 | var T = function () {};
|
12446 | T.prototype = proto;
|
12447 | dst = new T;
|
12448 | }
|
12449 |
|
12450 | forEach(objectKeys(src), function (key) {
|
12451 | dst[key] = src[key];
|
12452 | });
|
12453 | return dst;
|
12454 | }
|
12455 | else return src;
|
12456 | }
|
12457 |
|
12458 | var objectKeys = Object.keys || function keys (obj) {
|
12459 | var res = [];
|
12460 | for (var key in obj) res.push(key)
|
12461 | return res;
|
12462 | };
|
12463 |
|
12464 | function toS (obj) { return Object.prototype.toString.call(obj) }
|
12465 | function isDate (obj) { return toS(obj) === '[object Date]' }
|
12466 | function isRegExp (obj) { return toS(obj) === '[object RegExp]' }
|
12467 | function isError (obj) { return toS(obj) === '[object Error]' }
|
12468 | function isBoolean (obj) { return toS(obj) === '[object Boolean]' }
|
12469 | function isNumber (obj) { return toS(obj) === '[object Number]' }
|
12470 | function isString (obj) { return toS(obj) === '[object String]' }
|
12471 |
|
12472 | var isArray = Array.isArray || function isArray (xs) {
|
12473 | return Object.prototype.toString.call(xs) === '[object Array]';
|
12474 | };
|
12475 |
|
12476 | var forEach = function (xs, fn) {
|
12477 | if (xs.forEach) return xs.forEach(fn)
|
12478 | else for (var i = 0; i < xs.length; i++) {
|
12479 | fn(xs[i], i, xs);
|
12480 | }
|
12481 | };
|
12482 |
|
12483 | forEach(objectKeys(Traverse.prototype), function (key) {
|
12484 | traverse[key] = function (obj) {
|
12485 | var args = [].slice.call(arguments, 1);
|
12486 | var t = new Traverse(obj);
|
12487 | return t[key].apply(t, args);
|
12488 | };
|
12489 | });
|
12490 |
|
12491 | var hasOwnProperty = Object.hasOwnProperty || function (obj, key) {
|
12492 | return key in obj;
|
12493 | };
|
12494 |
|
12495 |
|
12496 | }),
|
12497 |
|
12498 | (function(module, __webpack_exports__, __webpack_require__) {
|
12499 |
|
12500 | "use strict";
|
12501 | __webpack_require__.r(__webpack_exports__);
|
12502 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
|
12503 | var _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
12504 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
12505 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__);
|
12506 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
12507 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__);
|
12508 | var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39);
|
12509 |
|
12510 |
|
12511 |
|
12512 |
|
12513 | __webpack_exports__["default"] = ({
|
12514 | key: 'allOf',
|
12515 | plugin: function plugin(val, key, fullPath, specmap, patch) {
|
12516 |
|
12517 |
|
12518 |
|
12519 | if (patch.meta && patch.meta.$$ref) {
|
12520 | return undefined;
|
12521 | }
|
12522 |
|
12523 | var parent = fullPath.slice(0, -1);
|
12524 |
|
12525 | if (Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["isFreelyNamed"])(parent)) {
|
12526 | return undefined;
|
12527 | }
|
12528 |
|
12529 | if (!_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default()(val)) {
|
12530 | var err = new TypeError('allOf must be an array');
|
12531 | err.fullPath = fullPath;
|
12532 |
|
12533 | return err;
|
12534 | }
|
12535 |
|
12536 | var alreadyAddError = false;
|
12537 |
|
12538 |
|
12539 | var originalDefinitionObj = patch.value;
|
12540 | parent.forEach(function (part) {
|
12541 | if (!originalDefinitionObj) return;
|
12542 |
|
12543 | originalDefinitionObj = originalDefinitionObj[part];
|
12544 | });
|
12545 | originalDefinitionObj = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()({}, originalDefinitionObj);
|
12546 | delete originalDefinitionObj.allOf;
|
12547 | var patches = [];
|
12548 |
|
12549 | patches.push(specmap.replace(parent, {}));
|
12550 | val.forEach(function (toMerge, i) {
|
12551 | if (!specmap.isObject(toMerge)) {
|
12552 | if (alreadyAddError) {
|
12553 | return null;
|
12554 | }
|
12555 |
|
12556 | alreadyAddError = true;
|
12557 |
|
12558 | var _err = new TypeError('Elements in allOf must be objects');
|
12559 |
|
12560 | _err.fullPath = fullPath;
|
12561 |
|
12562 | return patches.push(_err);
|
12563 | }
|
12564 |
|
12565 |
|
12566 | patches.push(specmap.mergeDeep(parent, toMerge));
|
12567 |
|
12568 |
|
12569 | var collapsedFullPath = fullPath.slice(0, -1);
|
12570 | var absoluteRefPatches = Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["generateAbsoluteRefPatches"])(toMerge, collapsedFullPath, {
|
12571 | getBaseUrlForNodePath: function getBaseUrlForNodePath(nodePath) {
|
12572 | return specmap.getContext([].concat(_babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(fullPath), [i], _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(nodePath))).baseDoc;
|
12573 | },
|
12574 | specmap: specmap
|
12575 | });
|
12576 | patches.push.apply(patches, _babel_runtime_corejs2_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(absoluteRefPatches));
|
12577 | return undefined;
|
12578 | });
|
12579 |
|
12580 | patches.push(specmap.mergeDeep(parent, originalDefinitionObj));
|
12581 |
|
12582 |
|
12583 | if (!originalDefinitionObj.$$ref) {
|
12584 | patches.push(specmap.remove([].concat(parent, '$$ref')));
|
12585 | }
|
12586 |
|
12587 | return patches;
|
12588 | }
|
12589 | });
|
12590 |
|
12591 | }),
|
12592 |
|
12593 | (function(module, __webpack_exports__, __webpack_require__) {
|
12594 |
|
12595 | "use strict";
|
12596 | __webpack_require__.r(__webpack_exports__);
|
12597 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
12598 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
|
12599 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
|
12600 | var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_1__);
|
12601 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
12602 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__);
|
12603 | var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
|
12604 |
|
12605 |
|
12606 |
|
12607 |
|
12608 | __webpack_exports__["default"] = ({
|
12609 | key: 'parameters',
|
12610 | plugin: function plugin(parameters, key, fullPath, specmap) {
|
12611 | if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default()(parameters) && parameters.length) {
|
12612 | var val = _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_1___default()([], parameters);
|
12613 |
|
12614 | var opPath = fullPath.slice(0, -1);
|
12615 |
|
12616 | var op = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, ___WEBPACK_IMPORTED_MODULE_3__["default"].getIn(specmap.spec, opPath));
|
12617 |
|
12618 | parameters.forEach(function (param, i) {
|
12619 | try {
|
12620 | val[i].default = specmap.parameterMacro(op, param);
|
12621 | } catch (e) {
|
12622 | var err = new Error(e);
|
12623 | err.fullPath = fullPath;
|
12624 | return err;
|
12625 | }
|
12626 |
|
12627 | return undefined;
|
12628 | });
|
12629 | return ___WEBPACK_IMPORTED_MODULE_3__["default"].replace(fullPath, val);
|
12630 | }
|
12631 |
|
12632 | return ___WEBPACK_IMPORTED_MODULE_3__["default"].replace(fullPath, parameters);
|
12633 | }
|
12634 | });
|
12635 |
|
12636 | }),
|
12637 |
|
12638 | (function(module, __webpack_exports__, __webpack_require__) {
|
12639 |
|
12640 | "use strict";
|
12641 | __webpack_require__.r(__webpack_exports__);
|
12642 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
12643 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
|
12644 | var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
12645 |
|
12646 |
|
12647 | __webpack_exports__["default"] = ({
|
12648 | key: 'properties',
|
12649 | plugin: function plugin(properties, key, fullPath, specmap) {
|
12650 | var val = _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, properties);
|
12651 |
|
12652 |
|
12653 | for (var k in properties) {
|
12654 | try {
|
12655 | val[k].default = specmap.modelPropertyMacro(val[k]);
|
12656 | } catch (e) {
|
12657 | var err = new Error(e);
|
12658 | err.fullPath = fullPath;
|
12659 |
|
12660 | return err;
|
12661 | }
|
12662 | }
|
12663 |
|
12664 | var patch = ___WEBPACK_IMPORTED_MODULE_1__["default"].replace(fullPath, val);
|
12665 | return patch;
|
12666 | }
|
12667 | });
|
12668 |
|
12669 | }),
|
12670 |
|
12671 | (function(module, __webpack_exports__, __webpack_require__) {
|
12672 |
|
12673 | "use strict";
|
12674 | __webpack_require__.r(__webpack_exports__);
|
12675 | __webpack_require__.d(__webpack_exports__, "default", function() { return ContextTree; });
|
12676 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
12677 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0__);
|
12678 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
12679 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__);
|
12680 | var _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(47);
|
12681 | var _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
|
12682 | var _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38);
|
12683 | var _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
|
12684 |
|
12685 |
|
12686 |
|
12687 |
|
12688 |
|
12689 | var ContextTree = function () {
|
12690 | function ContextTree(value) {
|
12691 | _babel_runtime_corejs2_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, ContextTree);
|
12692 |
|
12693 | this.root = createNode(value || {});
|
12694 | }
|
12695 |
|
12696 | _babel_runtime_corejs2_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(ContextTree, [{
|
12697 | key: "set",
|
12698 | value: function set(path, value) {
|
12699 | var parent = this.getParent(path, true);
|
12700 |
|
12701 | if (!parent) {
|
12702 | updateNode(this.root, value, null);
|
12703 | return;
|
12704 | }
|
12705 |
|
12706 | var key = path[path.length - 1];
|
12707 | var children = parent.children;
|
12708 |
|
12709 | if (children[key]) {
|
12710 | updateNode(children[key], value, parent);
|
12711 | return;
|
12712 | }
|
12713 |
|
12714 | children[key] = createNode(value, parent);
|
12715 | }
|
12716 |
|
12717 | }, {
|
12718 | key: "get",
|
12719 | value: function get(path) {
|
12720 | path = path || [];
|
12721 |
|
12722 | if (path.length < 1) {
|
12723 | return this.root.value;
|
12724 | }
|
12725 |
|
12726 | var branch = this.root;
|
12727 | var child;
|
12728 | var token;
|
12729 |
|
12730 | for (var i = 0; i < path.length; i += 1) {
|
12731 | token = path[i];
|
12732 | child = branch.children;
|
12733 |
|
12734 | if (!child[token]) {
|
12735 | break;
|
12736 | }
|
12737 |
|
12738 | branch = child[token];
|
12739 | }
|
12740 |
|
12741 | return branch && branch.protoValue;
|
12742 | }
|
12743 | }, {
|
12744 | key: "getParent",
|
12745 | value: function getParent(path, ensureExists) {
|
12746 | if (!path || path.length < 1) {
|
12747 | return null;
|
12748 | }
|
12749 |
|
12750 | if (path.length < 2) {
|
12751 | return this.root;
|
12752 | }
|
12753 |
|
12754 | return path.slice(0, -1).reduce(function (branch, token) {
|
12755 | if (!branch) {
|
12756 | return branch;
|
12757 | }
|
12758 |
|
12759 | var children = branch.children;
|
12760 |
|
12761 | if (!children[token] && ensureExists) {
|
12762 | children[token] = createNode(null, branch);
|
12763 | }
|
12764 |
|
12765 | return children[token];
|
12766 | }, this.root);
|
12767 | }
|
12768 | }]);
|
12769 |
|
12770 | return ContextTree;
|
12771 | }();
|
12772 |
|
12773 |
|
12774 |
|
12775 |
|
12776 |
|
12777 |
|
12778 | function createNode(value, parent) {
|
12779 | return updateNode({
|
12780 | children: {}
|
12781 | }, value, parent);
|
12782 | }
|
12783 |
|
12784 | function updateNode(node, value, parent) {
|
12785 | node.value = value || {};
|
12786 | node.protoValue = parent ? _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()({}, parent.protoValue), node.value) : node.value;
|
12787 |
|
12788 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(node.children).forEach(function (prop) {
|
12789 | var child = node.children[prop];
|
12790 | node.children[prop] = updateNode(child, child.value, node);
|
12791 | });
|
12792 |
|
12793 | return node;
|
12794 | }
|
12795 |
|
12796 | }),
|
12797 |
|
12798 | (function(module, __webpack_exports__, __webpack_require__) {
|
12799 |
|
12800 | "use strict";
|
12801 | __webpack_require__.r(__webpack_exports__);
|
12802 | __webpack_require__.d(__webpack_exports__, "default", function() { return resolveSubtree; });
|
12803 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
|
12804 | var _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0__);
|
12805 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
12806 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1__);
|
12807 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
12808 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2__);
|
12809 | var _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45);
|
12810 | var _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__);
|
12811 | var lodash_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31);
|
12812 | var lodash_get__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_4__);
|
12813 | var _resolver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(61);
|
12814 | var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13);
|
12815 |
|
12816 |
|
12817 |
|
12818 |
|
12819 |
|
12820 |
|
12821 |
|
12822 |
|
12823 |
|
12824 |
|
12825 |
|
12826 |
|
12827 |
|
12828 |
|
12829 |
|
12830 |
|
12831 |
|
12832 |
|
12833 |
|
12834 |
|
12835 |
|
12836 |
|
12837 |
|
12838 |
|
12839 |
|
12840 |
|
12841 |
|
12842 |
|
12843 |
|
12844 | function resolveSubtree(_x, _x2) {
|
12845 | return _resolveSubtree.apply(this, arguments);
|
12846 | }
|
12847 |
|
12848 | function _resolveSubtree() {
|
12849 | _resolveSubtree = _babel_runtime_corejs2_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3___default()( _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(obj, path) {
|
12850 | var opts,
|
12851 | returnEntireTree,
|
12852 | baseDoc,
|
12853 | requestInterceptor,
|
12854 | responseInterceptor,
|
12855 | parameterMacro,
|
12856 | modelPropertyMacro,
|
12857 | useCircularStructures,
|
12858 | resolveOptions,
|
12859 | _normalizeSwagger,
|
12860 | normalized,
|
12861 | result,
|
12862 | _args = arguments;
|
12863 |
|
12864 | return _babel_runtime_corejs2_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
|
12865 | while (1) {
|
12866 | switch (_context.prev = _context.next) {
|
12867 | case 0:
|
12868 | opts = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
|
12869 | returnEntireTree = opts.returnEntireTree, baseDoc = opts.baseDoc, requestInterceptor = opts.requestInterceptor, responseInterceptor = opts.responseInterceptor, parameterMacro = opts.parameterMacro, modelPropertyMacro = opts.modelPropertyMacro, useCircularStructures = opts.useCircularStructures;
|
12870 | resolveOptions = {
|
12871 | pathDiscriminator: path,
|
12872 | baseDoc: baseDoc,
|
12873 | requestInterceptor: requestInterceptor,
|
12874 | responseInterceptor: responseInterceptor,
|
12875 | parameterMacro: parameterMacro,
|
12876 | modelPropertyMacro: modelPropertyMacro,
|
12877 | useCircularStructures: useCircularStructures
|
12878 | };
|
12879 | _normalizeSwagger = Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["normalizeSwagger"])({
|
12880 | spec: obj
|
12881 | }), normalized = _normalizeSwagger.spec;
|
12882 | _context.next = 6;
|
12883 | return Object(_resolver__WEBPACK_IMPORTED_MODULE_5__["default"])(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_2___default()({}, resolveOptions), {}, {
|
12884 | spec: normalized,
|
12885 | allowMetaPatches: true,
|
12886 | skipNormalization: true
|
12887 | }));
|
12888 |
|
12889 | case 6:
|
12890 | result = _context.sent;
|
12891 |
|
12892 | if (!returnEntireTree && _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1___default()(path) && path.length) {
|
12893 | result.spec = lodash_get__WEBPACK_IMPORTED_MODULE_4___default()(result.spec, path) || null;
|
12894 | }
|
12895 |
|
12896 | return _context.abrupt("return", result);
|
12897 |
|
12898 | case 9:
|
12899 | case "end":
|
12900 | return _context.stop();
|
12901 | }
|
12902 | }
|
12903 | }, _callee);
|
12904 | }));
|
12905 | return _resolveSubtree.apply(this, arguments);
|
12906 | }
|
12907 |
|
12908 | }),
|
12909 |
|
12910 | (function(module, __webpack_exports__, __webpack_require__) {
|
12911 |
|
12912 | "use strict";
|
12913 | __webpack_require__.r(__webpack_exports__);
|
12914 | __webpack_require__.d(__webpack_exports__, "self", function() { return self; });
|
12915 | __webpack_require__.d(__webpack_exports__, "makeExecute", function() { return makeExecute; });
|
12916 | __webpack_require__.d(__webpack_exports__, "makeApisTagOperationsOperationExecute", function() { return makeApisTagOperationsOperationExecute; });
|
12917 | __webpack_require__.d(__webpack_exports__, "makeApisTagOperation", function() { return makeApisTagOperation; });
|
12918 | __webpack_require__.d(__webpack_exports__, "mapTagOperations", function() { return mapTagOperations; });
|
12919 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
12920 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
|
12921 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
12922 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1__);
|
12923 | var lodash_pick__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46);
|
12924 | var lodash_pick__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_2__);
|
12925 | var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13);
|
12926 |
|
12927 |
|
12928 |
|
12929 |
|
12930 |
|
12931 | var nullFn = function nullFn() {
|
12932 | return null;
|
12933 | };
|
12934 |
|
12935 | var normalizeArray = function normalizeArray(arg) {
|
12936 | return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_1___default()(arg) ? arg : [arg];
|
12937 | };
|
12938 |
|
12939 |
|
12940 | var self = {
|
12941 | mapTagOperations: mapTagOperations,
|
12942 | makeExecute: makeExecute
|
12943 | };
|
12944 |
|
12945 | function makeExecute() {
|
12946 | var swaggerJs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
12947 | return function (_ref) {
|
12948 | var pathName = _ref.pathName,
|
12949 | method = _ref.method,
|
12950 | operationId = _ref.operationId;
|
12951 | return function (parameters) {
|
12952 | var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
12953 | return swaggerJs.execute(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({
|
12954 | spec: swaggerJs.spec
|
12955 | }, lodash_pick__WEBPACK_IMPORTED_MODULE_2___default()(swaggerJs, 'requestInterceptor', 'responseInterceptor', 'userFetch')), {}, {
|
12956 | pathName: pathName,
|
12957 | method: method,
|
12958 | parameters: parameters,
|
12959 | operationId: operationId
|
12960 | }, opts));
|
12961 | };
|
12962 | };
|
12963 | }
|
12964 |
|
12965 |
|
12966 |
|
12967 |
|
12968 | function makeApisTagOperationsOperationExecute() {
|
12969 | var swaggerJs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
12970 |
|
12971 | var cb = self.makeExecute(swaggerJs);
|
12972 | var tagOperations = self.mapTagOperations({
|
12973 | v2OperationIdCompatibilityMode: swaggerJs.v2OperationIdCompatibilityMode,
|
12974 | spec: swaggerJs.spec,
|
12975 | cb: cb
|
12976 | });
|
12977 | var apis = {};
|
12978 |
|
12979 | for (var tag in tagOperations) {
|
12980 | apis[tag] = {
|
12981 | operations: {}
|
12982 | };
|
12983 |
|
12984 | for (var op in tagOperations[tag]) {
|
12985 | apis[tag].operations[op] = {
|
12986 | execute: tagOperations[tag][op]
|
12987 | };
|
12988 | }
|
12989 | }
|
12990 |
|
12991 | return {
|
12992 | apis: apis
|
12993 | };
|
12994 | }
|
12995 |
|
12996 | function makeApisTagOperation() {
|
12997 | var swaggerJs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
12998 | var cb = self.makeExecute(swaggerJs);
|
12999 | return {
|
13000 | apis: self.mapTagOperations({
|
13001 | v2OperationIdCompatibilityMode: swaggerJs.v2OperationIdCompatibilityMode,
|
13002 | spec: swaggerJs.spec,
|
13003 | cb: cb
|
13004 | })
|
13005 | };
|
13006 | }
|
13007 |
|
13008 |
|
13009 |
|
13010 |
|
13011 |
|
13012 |
|
13013 |
|
13014 |
|
13015 |
|
13016 |
|
13017 | function mapTagOperations(_ref2) {
|
13018 | var spec = _ref2.spec,
|
13019 | _ref2$cb = _ref2.cb,
|
13020 | cb = _ref2$cb === void 0 ? nullFn : _ref2$cb,
|
13021 | _ref2$defaultTag = _ref2.defaultTag,
|
13022 | defaultTag = _ref2$defaultTag === void 0 ? 'default' : _ref2$defaultTag,
|
13023 | v2OperationIdCompatibilityMode = _ref2.v2OperationIdCompatibilityMode;
|
13024 | var operationIdCounter = {};
|
13025 | var tagOperations = {};
|
13026 |
|
13027 | Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["eachOperation"])(spec, function (_ref3) {
|
13028 | var pathName = _ref3.pathName,
|
13029 | method = _ref3.method,
|
13030 | operation = _ref3.operation;
|
13031 | var tags = operation.tags ? normalizeArray(operation.tags) : [defaultTag];
|
13032 | tags.forEach(function (tag) {
|
13033 | if (typeof tag !== 'string') {
|
13034 | return;
|
13035 | }
|
13036 |
|
13037 | tagOperations[tag] = tagOperations[tag] || {};
|
13038 | var tagObj = tagOperations[tag];
|
13039 | var id = Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["opId"])(operation, pathName, method, {
|
13040 | v2OperationIdCompatibilityMode: v2OperationIdCompatibilityMode
|
13041 | });
|
13042 | var cbResult = cb({
|
13043 | spec: spec,
|
13044 | pathName: pathName,
|
13045 | method: method,
|
13046 | operation: operation,
|
13047 | operationId: id
|
13048 | });
|
13049 |
|
13050 | if (operationIdCounter[id]) {
|
13051 | operationIdCounter[id] += 1;
|
13052 | tagObj["".concat(id).concat(operationIdCounter[id])] = cbResult;
|
13053 | } else if (typeof tagObj[id] !== 'undefined') {
|
13054 |
|
13055 | var originalCounterValue = operationIdCounter[id] || 1;
|
13056 | operationIdCounter[id] = originalCounterValue + 1;
|
13057 |
|
13058 | tagObj["".concat(id).concat(operationIdCounter[id])] = cbResult;
|
13059 |
|
13060 | var temp = tagObj[id];
|
13061 | delete tagObj[id];
|
13062 | tagObj["".concat(id).concat(originalCounterValue)] = temp;
|
13063 | } else {
|
13064 |
|
13065 | tagObj[id] = cbResult;
|
13066 | }
|
13067 | });
|
13068 | });
|
13069 | return tagOperations;
|
13070 | }
|
13071 |
|
13072 | }),
|
13073 |
|
13074 | (function(module, exports, __webpack_require__) {
|
13075 |
|
13076 | var _Object$getOwnPropertySymbols = __webpack_require__(124);
|
13077 |
|
13078 | var objectWithoutPropertiesLoose = __webpack_require__(359);
|
13079 |
|
13080 | function _objectWithoutProperties(source, excluded) {
|
13081 | if (source == null) return {};
|
13082 | var target = objectWithoutPropertiesLoose(source, excluded);
|
13083 | var key, i;
|
13084 |
|
13085 | if (_Object$getOwnPropertySymbols) {
|
13086 | var sourceSymbolKeys = _Object$getOwnPropertySymbols(source);
|
13087 |
|
13088 | for (i = 0; i < sourceSymbolKeys.length; i++) {
|
13089 | key = sourceSymbolKeys[i];
|
13090 | if (excluded.indexOf(key) >= 0) continue;
|
13091 | if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
13092 | target[key] = source[key];
|
13093 | }
|
13094 | }
|
13095 |
|
13096 | return target;
|
13097 | }
|
13098 |
|
13099 | module.exports = _objectWithoutProperties;
|
13100 |
|
13101 | }),
|
13102 |
|
13103 | (function(module, exports, __webpack_require__) {
|
13104 |
|
13105 | var baseGetTag = __webpack_require__(130),
|
13106 | getPrototype = __webpack_require__(158),
|
13107 | isObjectLike = __webpack_require__(360);
|
13108 |
|
13109 |
|
13110 | var objectTag = '[object Object]';
|
13111 |
|
13112 |
|
13113 | var funcProto = Function.prototype,
|
13114 | objectProto = Object.prototype;
|
13115 |
|
13116 |
|
13117 | var funcToString = funcProto.toString;
|
13118 |
|
13119 |
|
13120 | var hasOwnProperty = objectProto.hasOwnProperty;
|
13121 |
|
13122 |
|
13123 | var objectCtorString = funcToString.call(Object);
|
13124 |
|
13125 |
|
13126 |
|
13127 |
|
13128 |
|
13129 |
|
13130 |
|
13131 |
|
13132 |
|
13133 |
|
13134 |
|
13135 |
|
13136 |
|
13137 |
|
13138 |
|
13139 |
|
13140 |
|
13141 |
|
13142 |
|
13143 |
|
13144 |
|
13145 |
|
13146 |
|
13147 |
|
13148 |
|
13149 |
|
13150 |
|
13151 |
|
13152 |
|
13153 | function isPlainObject(value) {
|
13154 | if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
13155 | return false;
|
13156 | }
|
13157 | var proto = getPrototype(value);
|
13158 | if (proto === null) {
|
13159 | return true;
|
13160 | }
|
13161 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
13162 | return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
13163 | funcToString.call(Ctor) == objectCtorString;
|
13164 | }
|
13165 |
|
13166 | module.exports = isPlainObject;
|
13167 |
|
13168 |
|
13169 | }),
|
13170 |
|
13171 | (function(module, exports, __webpack_require__) {
|
13172 |
|
13173 | "use strict";
|
13174 |
|
13175 |
|
13176 |
|
13177 |
|
13178 |
|
13179 |
|
13180 |
|
13181 |
|
13182 |
|
13183 |
|
13184 |
|
13185 |
|
13186 |
|
13187 |
|
13188 | exports.parse = parse;
|
13189 | exports.serialize = serialize;
|
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 | var decode = decodeURIComponent;
|
13197 | var encode = encodeURIComponent;
|
13198 | var pairSplitRegExp = /; */;
|
13199 |
|
13200 |
|
13201 |
|
13202 |
|
13203 |
|
13204 |
|
13205 |
|
13206 |
|
13207 |
|
13208 | var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
13209 |
|
13210 |
|
13211 |
|
13212 |
|
13213 |
|
13214 |
|
13215 |
|
13216 |
|
13217 |
|
13218 |
|
13219 |
|
13220 |
|
13221 |
|
13222 | function parse(str, options) {
|
13223 | if (typeof str !== 'string') {
|
13224 | throw new TypeError('argument str must be a string');
|
13225 | }
|
13226 |
|
13227 | var obj = {}
|
13228 | var opt = options || {};
|
13229 | var pairs = str.split(pairSplitRegExp);
|
13230 | var dec = opt.decode || decode;
|
13231 |
|
13232 | for (var i = 0; i < pairs.length; i++) {
|
13233 | var pair = pairs[i];
|
13234 | var eq_idx = pair.indexOf('=');
|
13235 |
|
13236 |
|
13237 | if (eq_idx < 0) {
|
13238 | continue;
|
13239 | }
|
13240 |
|
13241 | var key = pair.substr(0, eq_idx).trim()
|
13242 | var val = pair.substr(++eq_idx, pair.length).trim();
|
13243 |
|
13244 |
|
13245 | if ('"' == val[0]) {
|
13246 | val = val.slice(1, -1);
|
13247 | }
|
13248 |
|
13249 |
|
13250 | if (undefined == obj[key]) {
|
13251 | obj[key] = tryDecode(val, dec);
|
13252 | }
|
13253 | }
|
13254 |
|
13255 | return obj;
|
13256 | }
|
13257 |
|
13258 |
|
13259 |
|
13260 |
|
13261 |
|
13262 |
|
13263 |
|
13264 |
|
13265 |
|
13266 |
|
13267 |
|
13268 |
|
13269 |
|
13270 |
|
13271 |
|
13272 |
|
13273 |
|
13274 | function serialize(name, val, options) {
|
13275 | var opt = options || {};
|
13276 | var enc = opt.encode || encode;
|
13277 |
|
13278 | if (typeof enc !== 'function') {
|
13279 | throw new TypeError('option encode is invalid');
|
13280 | }
|
13281 |
|
13282 | if (!fieldContentRegExp.test(name)) {
|
13283 | throw new TypeError('argument name is invalid');
|
13284 | }
|
13285 |
|
13286 | var value = enc(val);
|
13287 |
|
13288 | if (value && !fieldContentRegExp.test(value)) {
|
13289 | throw new TypeError('argument val is invalid');
|
13290 | }
|
13291 |
|
13292 | var str = name + '=' + value;
|
13293 |
|
13294 | if (null != opt.maxAge) {
|
13295 | var maxAge = opt.maxAge - 0;
|
13296 |
|
13297 | if (isNaN(maxAge) || !isFinite(maxAge)) {
|
13298 | throw new TypeError('option maxAge is invalid')
|
13299 | }
|
13300 |
|
13301 | str += '; Max-Age=' + Math.floor(maxAge);
|
13302 | }
|
13303 |
|
13304 | if (opt.domain) {
|
13305 | if (!fieldContentRegExp.test(opt.domain)) {
|
13306 | throw new TypeError('option domain is invalid');
|
13307 | }
|
13308 |
|
13309 | str += '; Domain=' + opt.domain;
|
13310 | }
|
13311 |
|
13312 | if (opt.path) {
|
13313 | if (!fieldContentRegExp.test(opt.path)) {
|
13314 | throw new TypeError('option path is invalid');
|
13315 | }
|
13316 |
|
13317 | str += '; Path=' + opt.path;
|
13318 | }
|
13319 |
|
13320 | if (opt.expires) {
|
13321 | if (typeof opt.expires.toUTCString !== 'function') {
|
13322 | throw new TypeError('option expires is invalid');
|
13323 | }
|
13324 |
|
13325 | str += '; Expires=' + opt.expires.toUTCString();
|
13326 | }
|
13327 |
|
13328 | if (opt.httpOnly) {
|
13329 | str += '; HttpOnly';
|
13330 | }
|
13331 |
|
13332 | if (opt.secure) {
|
13333 | str += '; Secure';
|
13334 | }
|
13335 |
|
13336 | if (opt.sameSite) {
|
13337 | var sameSite = typeof opt.sameSite === 'string'
|
13338 | ? opt.sameSite.toLowerCase() : opt.sameSite;
|
13339 |
|
13340 | switch (sameSite) {
|
13341 | case true:
|
13342 | str += '; SameSite=Strict';
|
13343 | break;
|
13344 | case 'lax':
|
13345 | str += '; SameSite=Lax';
|
13346 | break;
|
13347 | case 'strict':
|
13348 | str += '; SameSite=Strict';
|
13349 | break;
|
13350 | case 'none':
|
13351 | str += '; SameSite=None';
|
13352 | break;
|
13353 | default:
|
13354 | throw new TypeError('option sameSite is invalid');
|
13355 | }
|
13356 | }
|
13357 |
|
13358 | return str;
|
13359 | }
|
13360 |
|
13361 |
|
13362 |
|
13363 |
|
13364 |
|
13365 |
|
13366 |
|
13367 |
|
13368 |
|
13369 | function tryDecode(str, decode) {
|
13370 | try {
|
13371 | return decode(str);
|
13372 | } catch (e) {
|
13373 | return str;
|
13374 | }
|
13375 | }
|
13376 |
|
13377 |
|
13378 | }),
|
13379 |
|
13380 | (function(module, __webpack_exports__, __webpack_require__) {
|
13381 |
|
13382 | "use strict";
|
13383 | __webpack_require__.r(__webpack_exports__);
|
13384 |
|
13385 |
|
13386 | __webpack_exports__["default"] = ({
|
13387 | body: bodyBuilder,
|
13388 | header: headerBuilder,
|
13389 | query: queryBuilder,
|
13390 | path: pathBuilder,
|
13391 | formData: formDataBuilder
|
13392 | });
|
13393 |
|
13394 | function bodyBuilder(_ref) {
|
13395 | var req = _ref.req,
|
13396 | value = _ref.value;
|
13397 | req.body = value;
|
13398 | }
|
13399 |
|
13400 |
|
13401 | function formDataBuilder(_ref2) {
|
13402 | var req = _ref2.req,
|
13403 | value = _ref2.value,
|
13404 | parameter = _ref2.parameter;
|
13405 |
|
13406 | if (value || parameter.allowEmptyValue) {
|
13407 | req.form = req.form || {};
|
13408 | req.form[parameter.name] = {
|
13409 | value: value,
|
13410 | allowEmptyValue: parameter.allowEmptyValue,
|
13411 | collectionFormat: parameter.collectionFormat
|
13412 | };
|
13413 | }
|
13414 | }
|
13415 |
|
13416 |
|
13417 | function headerBuilder(_ref3) {
|
13418 | var req = _ref3.req,
|
13419 | parameter = _ref3.parameter,
|
13420 | value = _ref3.value;
|
13421 | req.headers = req.headers || {};
|
13422 |
|
13423 | if (typeof value !== 'undefined') {
|
13424 | req.headers[parameter.name] = value;
|
13425 | }
|
13426 | }
|
13427 |
|
13428 |
|
13429 | function pathBuilder(_ref4) {
|
13430 | var req = _ref4.req,
|
13431 | value = _ref4.value,
|
13432 | parameter = _ref4.parameter;
|
13433 | req.url = req.url.split("{".concat(parameter.name, "}")).join(encodeURIComponent(value));
|
13434 | }
|
13435 |
|
13436 |
|
13437 | function queryBuilder(_ref5) {
|
13438 | var req = _ref5.req,
|
13439 | value = _ref5.value,
|
13440 | parameter = _ref5.parameter;
|
13441 | req.query = req.query || {};
|
13442 |
|
13443 | if (value === false && parameter.type === 'boolean') {
|
13444 | value = 'false';
|
13445 | }
|
13446 |
|
13447 | if (value === 0 && ['number', 'integer'].indexOf(parameter.type) > -1) {
|
13448 | value = '0';
|
13449 | }
|
13450 |
|
13451 | if (value) {
|
13452 | req.query[parameter.name] = {
|
13453 | collectionFormat: parameter.collectionFormat,
|
13454 | value: value
|
13455 | };
|
13456 | } else if (parameter.allowEmptyValue && value !== undefined) {
|
13457 | var paramName = parameter.name;
|
13458 | req.query[paramName] = req.query[paramName] || {};
|
13459 | req.query[paramName].allowEmptyValue = true;
|
13460 | }
|
13461 | }
|
13462 |
|
13463 | }),
|
13464 |
|
13465 | (function(module, __webpack_exports__, __webpack_require__) {
|
13466 |
|
13467 | "use strict";
|
13468 | __webpack_require__.r(__webpack_exports__);
|
13469 | __webpack_require__.d(__webpack_exports__, "path", function() { return path; });
|
13470 | __webpack_require__.d(__webpack_exports__, "query", function() { return query; });
|
13471 | __webpack_require__.d(__webpack_exports__, "header", function() { return header; });
|
13472 | __webpack_require__.d(__webpack_exports__, "cookie", function() { return cookie; });
|
13473 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
13474 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0__);
|
13475 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
13476 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
|
13477 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
|
13478 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2__);
|
13479 | var lodash_pick__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46);
|
13480 | var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
13481 | var _style_serializer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32);
|
13482 | var _content_serializer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(62);
|
13483 |
|
13484 |
|
13485 |
|
13486 |
|
13487 |
|
13488 |
|
13489 | function path(_ref) {
|
13490 | var req = _ref.req,
|
13491 | value = _ref.value,
|
13492 | parameter = _ref.parameter;
|
13493 | var name = parameter.name,
|
13494 | style = parameter.style,
|
13495 | explode = parameter.explode,
|
13496 | content = parameter.content;
|
13497 |
|
13498 | if (content) {
|
13499 | var effectiveMediaType = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(content)[0];
|
13500 |
|
13501 | req.url = req.url.split("{".concat(name, "}")).join(Object(_style_serializer__WEBPACK_IMPORTED_MODULE_4__["encodeDisallowedCharacters"])(Object(_content_serializer__WEBPACK_IMPORTED_MODULE_5__["default"])(value, effectiveMediaType), {
|
13502 | escape: true
|
13503 | }));
|
13504 | return;
|
13505 | }
|
13506 |
|
13507 | var styledValue = Object(_style_serializer__WEBPACK_IMPORTED_MODULE_4__["default"])({
|
13508 | key: parameter.name,
|
13509 | value: value,
|
13510 | style: style || 'simple',
|
13511 | explode: explode || false,
|
13512 | escape: true
|
13513 | });
|
13514 | req.url = req.url.split("{".concat(name, "}")).join(styledValue);
|
13515 | }
|
13516 | function query(_ref2) {
|
13517 | var req = _ref2.req,
|
13518 | value = _ref2.value,
|
13519 | parameter = _ref2.parameter;
|
13520 | req.query = req.query || {};
|
13521 |
|
13522 | if (parameter.content) {
|
13523 | var effectiveMediaType = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(parameter.content)[0];
|
13524 |
|
13525 | req.query[parameter.name] = Object(_content_serializer__WEBPACK_IMPORTED_MODULE_5__["default"])(value, effectiveMediaType);
|
13526 | return;
|
13527 | }
|
13528 |
|
13529 | if (value === false) {
|
13530 | value = 'false';
|
13531 | }
|
13532 |
|
13533 | if (value === 0) {
|
13534 | value = '0';
|
13535 | }
|
13536 |
|
13537 | if (value) {
|
13538 | req.query[parameter.name] = {
|
13539 | value: value,
|
13540 | serializationOption: lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parameter, ['style', 'explode', 'allowReserved'])
|
13541 | };
|
13542 | } else if (parameter.allowEmptyValue && value !== undefined) {
|
13543 | var paramName = parameter.name;
|
13544 | req.query[paramName] = req.query[paramName] || {};
|
13545 | req.query[paramName].allowEmptyValue = true;
|
13546 | }
|
13547 | }
|
13548 | var PARAMETER_HEADER_BLACKLIST = ['accept', 'authorization', 'content-type'];
|
13549 | function header(_ref3) {
|
13550 | var req = _ref3.req,
|
13551 | parameter = _ref3.parameter,
|
13552 | value = _ref3.value;
|
13553 | req.headers = req.headers || {};
|
13554 |
|
13555 | if (PARAMETER_HEADER_BLACKLIST.indexOf(parameter.name.toLowerCase()) > -1) {
|
13556 | return;
|
13557 | }
|
13558 |
|
13559 | if (parameter.content) {
|
13560 | var effectiveMediaType = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(parameter.content)[0];
|
13561 |
|
13562 | req.headers[parameter.name] = Object(_content_serializer__WEBPACK_IMPORTED_MODULE_5__["default"])(value, effectiveMediaType);
|
13563 | return;
|
13564 | }
|
13565 |
|
13566 | if (typeof value !== 'undefined') {
|
13567 | req.headers[parameter.name] = Object(_style_serializer__WEBPACK_IMPORTED_MODULE_4__["default"])({
|
13568 | key: parameter.name,
|
13569 | value: value,
|
13570 | style: parameter.style || 'simple',
|
13571 | explode: typeof parameter.explode === 'undefined' ? false : parameter.explode,
|
13572 | escape: false
|
13573 | });
|
13574 | }
|
13575 | }
|
13576 | function cookie(_ref4) {
|
13577 | var req = _ref4.req,
|
13578 | parameter = _ref4.parameter,
|
13579 | value = _ref4.value;
|
13580 | req.headers = req.headers || {};
|
13581 |
|
13582 | var type = _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(value);
|
13583 |
|
13584 | if (parameter.content) {
|
13585 | var effectiveMediaType = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(parameter.content)[0];
|
13586 |
|
13587 | req.headers.Cookie = "".concat(parameter.name, "=").concat(Object(_content_serializer__WEBPACK_IMPORTED_MODULE_5__["default"])(value, effectiveMediaType));
|
13588 | return;
|
13589 | }
|
13590 |
|
13591 | if (type !== 'undefined') {
|
13592 | var prefix = type === 'object' && !_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0___default()(value) && parameter.explode ? '' : "".concat(parameter.name, "=");
|
13593 | req.headers.Cookie = prefix + Object(_style_serializer__WEBPACK_IMPORTED_MODULE_4__["default"])({
|
13594 | key: parameter.name,
|
13595 | value: value,
|
13596 | escape: false,
|
13597 | style: parameter.style || 'form',
|
13598 | explode: typeof parameter.explode === 'undefined' ? false : parameter.explode
|
13599 | });
|
13600 | }
|
13601 | }
|
13602 |
|
13603 | }),
|
13604 |
|
13605 | (function(module, __webpack_exports__, __webpack_require__) {
|
13606 |
|
13607 | "use strict";
|
13608 | __webpack_require__.r(__webpack_exports__);
|
13609 | __webpack_require__.d(__webpack_exports__, "default", function() { return buildRequest; });
|
13610 | __webpack_require__.d(__webpack_exports__, "applySecurities", function() { return applySecurities; });
|
13611 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
13612 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0__);
|
13613 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
13614 | var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
|
13615 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
|
13616 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2__);
|
13617 | var lodash_assign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36);
|
13618 | var lodash_assign__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_3__);
|
13619 | var lodash_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31);
|
13620 | var lodash_get__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_4__);
|
13621 | var btoa__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82);
|
13622 | var btoa__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(btoa__WEBPACK_IMPORTED_MODULE_5__);
|
13623 |
|
13624 |
|
13625 |
|
13626 |
|
13627 |
|
13628 |
|
13629 |
|
13630 |
|
13631 | function buildRequest(options, req) {
|
13632 | var operation = options.operation,
|
13633 | requestBody = options.requestBody,
|
13634 | securities = options.securities,
|
13635 | spec = options.spec,
|
13636 | attachContentTypeForEmptyPayload = options.attachContentTypeForEmptyPayload;
|
13637 | var requestContentType = options.requestContentType;
|
13638 | req = applySecurities({
|
13639 | request: req,
|
13640 | securities: securities,
|
13641 | operation: operation,
|
13642 | spec: spec
|
13643 | });
|
13644 | var requestBodyDef = operation.requestBody || {};
|
13645 |
|
13646 | var requestBodyMediaTypes = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(requestBodyDef.content || {});
|
13647 |
|
13648 | var isExplicitContentTypeValid = requestContentType && requestBodyMediaTypes.indexOf(requestContentType) > -1;
|
13649 |
|
13650 | if (requestBody || attachContentTypeForEmptyPayload) {
|
13651 |
|
13652 | if (requestContentType && isExplicitContentTypeValid) {
|
13653 | req.headers['Content-Type'] = requestContentType;
|
13654 | } else if (!requestContentType) {
|
13655 | var firstMediaType = requestBodyMediaTypes[0];
|
13656 |
|
13657 | if (firstMediaType) {
|
13658 | req.headers['Content-Type'] = firstMediaType;
|
13659 | requestContentType = firstMediaType;
|
13660 | }
|
13661 | }
|
13662 | } else if (requestContentType && isExplicitContentTypeValid) {
|
13663 | req.headers['Content-Type'] = requestContentType;
|
13664 | }
|
13665 |
|
13666 |
|
13667 | if (requestBody) {
|
13668 | if (requestContentType) {
|
13669 | if (requestBodyMediaTypes.indexOf(requestContentType) > -1) {
|
13670 |
|
13671 |
|
13672 | if (requestContentType === 'application/x-www-form-urlencoded' || requestContentType === 'multipart/form-data') {
|
13673 | if (_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(requestBody) === 'object') {
|
13674 | var encoding = (requestBodyDef.content[requestContentType] || {}).encoding || {};
|
13675 | req.form = {};
|
13676 |
|
13677 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(requestBody).forEach(function (k) {
|
13678 | req.form[k] = {
|
13679 | value: requestBody[k],
|
13680 | encoding: encoding[k] || {}
|
13681 | };
|
13682 | });
|
13683 | } else {
|
13684 | req.form = requestBody;
|
13685 | }
|
13686 | } else {
|
13687 | req.body = requestBody;
|
13688 | }
|
13689 | }
|
13690 | } else {
|
13691 | req.body = requestBody;
|
13692 | }
|
13693 | }
|
13694 |
|
13695 | return req;
|
13696 | }
|
13697 |
|
13698 |
|
13699 | function applySecurities(_ref) {
|
13700 | var request = _ref.request,
|
13701 | _ref$securities = _ref.securities,
|
13702 | securities = _ref$securities === void 0 ? {} : _ref$securities,
|
13703 | _ref$operation = _ref.operation,
|
13704 | operation = _ref$operation === void 0 ? {} : _ref$operation,
|
13705 | spec = _ref.spec;
|
13706 | var result = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, request);
|
13707 | var _securities$authorize = securities.authorized,
|
13708 | authorized = _securities$authorize === void 0 ? {} : _securities$authorize;
|
13709 | var security = operation.security || spec.security || [];
|
13710 | var isAuthorized = authorized && !!_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(authorized).length;
|
13711 | var securityDef = lodash_get__WEBPACK_IMPORTED_MODULE_4___default()(spec, ['components', 'securitySchemes']) || {};
|
13712 | result.headers = result.headers || {};
|
13713 | result.query = result.query || {};
|
13714 |
|
13715 | if (!_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(securities).length || !isAuthorized || !security || _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_0___default()(operation.security) && !operation.security.length) {
|
13716 | return request;
|
13717 | }
|
13718 |
|
13719 | security.forEach(function (securityObj) {
|
13720 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(securityObj).forEach(function (key) {
|
13721 | var auth = authorized[key];
|
13722 | var schema = securityDef[key];
|
13723 |
|
13724 | if (!auth) {
|
13725 | return;
|
13726 | }
|
13727 |
|
13728 | var value = auth.value || auth;
|
13729 | var type = schema.type;
|
13730 |
|
13731 | if (auth) {
|
13732 | if (type === 'apiKey') {
|
13733 | if (schema.in === 'query') {
|
13734 | result.query[schema.name] = value;
|
13735 | }
|
13736 |
|
13737 | if (schema.in === 'header') {
|
13738 | result.headers[schema.name] = value;
|
13739 | }
|
13740 |
|
13741 | if (schema.in === 'cookie') {
|
13742 | result.cookies[schema.name] = value;
|
13743 | }
|
13744 | } else if (type === 'http') {
|
13745 | if (/^basic$/i.test(schema.scheme)) {
|
13746 | var username = value.username || '';
|
13747 | var password = value.password || '';
|
13748 | var encoded = btoa__WEBPACK_IMPORTED_MODULE_5___default()("".concat(username, ":").concat(password));
|
13749 | result.headers.Authorization = "Basic ".concat(encoded);
|
13750 | }
|
13751 |
|
13752 | if (/^bearer$/i.test(schema.scheme)) {
|
13753 | result.headers.Authorization = "Bearer ".concat(value);
|
13754 | }
|
13755 | } else if (type === 'oauth2') {
|
13756 | var token = auth.token || {};
|
13757 | var tokenName = schema['x-tokenName'] || 'access_token';
|
13758 | var tokenValue = token[tokenName];
|
13759 | var tokenType = token.token_type;
|
13760 |
|
13761 | if (!tokenType || tokenType.toLowerCase() === 'bearer') {
|
13762 | tokenType = 'Bearer';
|
13763 | }
|
13764 |
|
13765 | result.headers.Authorization = "".concat(tokenType, " ").concat(tokenValue);
|
13766 | }
|
13767 | }
|
13768 | });
|
13769 | });
|
13770 | return result;
|
13771 | }
|
13772 |
|
13773 | }),
|
13774 |
|
13775 | (function(module, __webpack_exports__, __webpack_require__) {
|
13776 |
|
13777 | "use strict";
|
13778 | __webpack_require__.r(__webpack_exports__);
|
13779 | __webpack_require__.d(__webpack_exports__, "default", function() { return buildRequest; });
|
13780 | __webpack_require__.d(__webpack_exports__, "applySecurities", function() { return applySecurities; });
|
13781 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
13782 | var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0__);
|
13783 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
|
13784 | var _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);
|
13785 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
13786 | var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2__);
|
13787 | var btoa__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82);
|
13788 | var btoa__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(btoa__WEBPACK_IMPORTED_MODULE_3__);
|
13789 | var lodash_assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36);
|
13790 | var lodash_assign__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_4__);
|
13791 |
|
13792 |
|
13793 |
|
13794 |
|
13795 |
|
13796 |
|
13797 |
|
13798 | function buildRequest(options, req) {
|
13799 | var spec = options.spec,
|
13800 | operation = options.operation,
|
13801 | securities = options.securities,
|
13802 | requestContentType = options.requestContentType,
|
13803 | attachContentTypeForEmptyPayload = options.attachContentTypeForEmptyPayload;
|
13804 |
|
13805 | req = applySecurities({
|
13806 | request: req,
|
13807 | securities: securities,
|
13808 | operation: operation,
|
13809 | spec: spec
|
13810 | });
|
13811 |
|
13812 | if (req.body || req.form || attachContentTypeForEmptyPayload) {
|
13813 |
|
13814 | if (requestContentType) {
|
13815 | req.headers['Content-Type'] = requestContentType;
|
13816 | } else if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default()(operation.consumes)) {
|
13817 | var _operation$consumes = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(operation.consumes, 1);
|
13818 |
|
13819 | req.headers['Content-Type'] = _operation$consumes[0];
|
13820 | } else if (_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default()(spec.consumes)) {
|
13821 | var _spec$consumes = _babel_runtime_corejs2_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(spec.consumes, 1);
|
13822 |
|
13823 | req.headers['Content-Type'] = _spec$consumes[0];
|
13824 | } else if (operation.parameters && operation.parameters.filter(function (p) {
|
13825 | return p.type === 'file';
|
13826 | }).length) {
|
13827 | req.headers['Content-Type'] = 'multipart/form-data';
|
13828 | } else if (operation.parameters && operation.parameters.filter(function (p) {
|
13829 | return p.in === 'formData';
|
13830 | }).length) {
|
13831 | req.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
13832 | }
|
13833 | } else if (requestContentType) {
|
13834 | var isBodyParamPresent = operation.parameters && operation.parameters.filter(function (p) {
|
13835 | return p.in === 'body';
|
13836 | }).length > 0;
|
13837 | var isFormDataParamPresent = operation.parameters && operation.parameters.filter(function (p) {
|
13838 | return p.in === 'formData';
|
13839 | }).length > 0;
|
13840 |
|
13841 | if (isBodyParamPresent || isFormDataParamPresent) {
|
13842 | req.headers['Content-Type'] = requestContentType;
|
13843 | }
|
13844 | }
|
13845 |
|
13846 | return req;
|
13847 | }
|
13848 |
|
13849 | function applySecurities(_ref) {
|
13850 | var request = _ref.request,
|
13851 | _ref$securities = _ref.securities,
|
13852 | securities = _ref$securities === void 0 ? {} : _ref$securities,
|
13853 | _ref$operation = _ref.operation,
|
13854 | operation = _ref$operation === void 0 ? {} : _ref$operation,
|
13855 | spec = _ref.spec;
|
13856 | var result = lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()({}, request);
|
13857 | var _securities$authorize = securities.authorized,
|
13858 | authorized = _securities$authorize === void 0 ? {} : _securities$authorize,
|
13859 | _securities$specSecur = securities.specSecurity,
|
13860 | specSecurity = _securities$specSecur === void 0 ? [] : _securities$specSecur;
|
13861 | var security = operation.security || specSecurity;
|
13862 | var isAuthorized = authorized && !!_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(authorized).length;
|
13863 | var securityDef = spec.securityDefinitions;
|
13864 | result.headers = result.headers || {};
|
13865 | result.query = result.query || {};
|
13866 |
|
13867 | if (!_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(securities).length || !isAuthorized || !security || _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_2___default()(operation.security) && !operation.security.length) {
|
13868 | return request;
|
13869 | }
|
13870 |
|
13871 | security.forEach(function (securityObj) {
|
13872 | _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(securityObj).forEach(function (key) {
|
13873 | var auth = authorized[key];
|
13874 |
|
13875 | if (!auth) {
|
13876 | return;
|
13877 | }
|
13878 |
|
13879 | var token = auth.token;
|
13880 | var value = auth.value || auth;
|
13881 | var schema = securityDef[key];
|
13882 | var type = schema.type;
|
13883 | var tokenName = schema['x-tokenName'] || 'access_token';
|
13884 | var oauthToken = token && token[tokenName];
|
13885 | var tokenType = token && token.token_type;
|
13886 |
|
13887 | if (auth) {
|
13888 | if (type === 'apiKey') {
|
13889 | var inType = schema.in === 'query' ? 'query' : 'headers';
|
13890 | result[inType] = result[inType] || {};
|
13891 | result[inType][schema.name] = value;
|
13892 | } else if (type === 'basic') {
|
13893 | if (value.header) {
|
13894 | result.headers.authorization = value.header;
|
13895 | } else {
|
13896 | var username = value.username || '';
|
13897 | var password = value.password || '';
|
13898 | value.base64 = btoa__WEBPACK_IMPORTED_MODULE_3___default()("".concat(username, ":").concat(password));
|
13899 | result.headers.authorization = "Basic ".concat(value.base64);
|
13900 | }
|
13901 | } else if (type === 'oauth2' && oauthToken) {
|
13902 | tokenType = !tokenType || tokenType.toLowerCase() === 'bearer' ? 'Bearer' : tokenType;
|
13903 | result.headers.authorization = "".concat(tokenType, " ").concat(oauthToken);
|
13904 | }
|
13905 | }
|
13906 | });
|
13907 | });
|
13908 | return result;
|
13909 | }
|
13910 |
|
13911 | }),
|
13912 |
|
13913 | (function(module, exports, __webpack_require__) {
|
13914 |
|
13915 | module.exports = __webpack_require__(186);
|
13916 |
|
13917 |
|
13918 | }),
|
13919 |
|
13920 | (function(module, __webpack_exports__, __webpack_require__) {
|
13921 |
|
13922 | "use strict";
|
13923 | __webpack_require__.r(__webpack_exports__);
|
13924 | __webpack_require__.d(__webpack_exports__, "helpers", function() { return helpers; });
|
13925 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
13926 | var _babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
|
13927 | var lodash_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
|
13928 | var lodash_assign__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_1__);
|
13929 | var lodash_startsWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60);
|
13930 | var lodash_startsWith__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(lodash_startsWith__WEBPACK_IMPORTED_MODULE_2__);
|
13931 | var url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
|
13932 | var url__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_3__);
|
13933 | var _http__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
|
13934 | var _resolver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(61);
|
13935 | var _subtree_resolver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(176);
|
13936 | var _interfaces__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(177);
|
13937 | var _execute__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84);
|
13938 | var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13);
|
13939 |
|
13940 |
|
13941 |
|
13942 |
|
13943 |
|
13944 |
|
13945 |
|
13946 |
|
13947 |
|
13948 |
|
13949 | Swagger.http = _http__WEBPACK_IMPORTED_MODULE_4__["default"];
|
13950 | Swagger.makeHttp = _http__WEBPACK_IMPORTED_MODULE_4__["makeHttp"].bind(null, Swagger.http);
|
13951 | Swagger.resolve = _resolver__WEBPACK_IMPORTED_MODULE_5__["default"];
|
13952 | Swagger.resolveSubtree = _subtree_resolver__WEBPACK_IMPORTED_MODULE_6__["default"];
|
13953 | Swagger.execute = _execute__WEBPACK_IMPORTED_MODULE_8__["execute"];
|
13954 | Swagger.serializeRes = _http__WEBPACK_IMPORTED_MODULE_4__["serializeRes"];
|
13955 | Swagger.serializeHeaders = _http__WEBPACK_IMPORTED_MODULE_4__["serializeHeaders"];
|
13956 | Swagger.clearCache = _resolver__WEBPACK_IMPORTED_MODULE_5__["clearCache"];
|
13957 | Swagger.makeApisTagOperation = _interfaces__WEBPACK_IMPORTED_MODULE_7__["makeApisTagOperation"];
|
13958 | Swagger.buildRequest = _execute__WEBPACK_IMPORTED_MODULE_8__["buildRequest"];
|
13959 | Swagger.helpers = {
|
13960 | opId: _helpers__WEBPACK_IMPORTED_MODULE_9__["opId"]
|
13961 | };
|
13962 | Swagger.getBaseUrl = _execute__WEBPACK_IMPORTED_MODULE_8__["baseUrl"];
|
13963 |
|
13964 | function Swagger(url) {
|
13965 | var _this = this;
|
13966 |
|
13967 | var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
13968 |
|
13969 |
|
13970 | if (typeof url === 'string') {
|
13971 | opts.url = url;
|
13972 | } else {
|
13973 | opts = url;
|
13974 | }
|
13975 |
|
13976 | if (!(this instanceof Swagger)) {
|
13977 | return new Swagger(opts);
|
13978 | }
|
13979 |
|
13980 | lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()(this, opts);
|
13981 | var prom = this.resolve().then(function () {
|
13982 | if (!_this.disableInterfaces) {
|
13983 | lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()(_this, Swagger.makeApisTagOperation(_this));
|
13984 | }
|
13985 |
|
13986 | return _this;
|
13987 | });
|
13988 |
|
13989 | prom.client = this;
|
13990 | return prom;
|
13991 | }
|
13992 |
|
13993 | Swagger.prototype = {
|
13994 | http: _http__WEBPACK_IMPORTED_MODULE_4__["default"],
|
13995 | execute: function execute(options) {
|
13996 | this.applyDefaults();
|
13997 | return Swagger.execute(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({
|
13998 | spec: this.spec,
|
13999 | http: this.http,
|
14000 | securities: {
|
14001 | authorized: this.authorizations
|
14002 | },
|
14003 | contextUrl: typeof this.url === 'string' ? this.url : undefined,
|
14004 | requestInterceptor: this.requestInterceptor || null,
|
14005 | responseInterceptor: this.responseInterceptor || null
|
14006 | }, options));
|
14007 | },
|
14008 | resolve: function resolve() {
|
14009 | var _this2 = this;
|
14010 |
|
14011 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
14012 | return Swagger.resolve(_babel_runtime_corejs2_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({
|
14013 | spec: this.spec,
|
14014 | url: this.url,
|
14015 | http: this.http || this.fetch,
|
14016 | allowMetaPatches: this.allowMetaPatches,
|
14017 | useCircularStructures: this.useCircularStructures,
|
14018 | requestInterceptor: this.requestInterceptor || null,
|
14019 | responseInterceptor: this.responseInterceptor || null
|
14020 | }, options)).then(function (obj) {
|
14021 | _this2.originalSpec = _this2.spec;
|
14022 | _this2.spec = obj.spec;
|
14023 | _this2.errors = obj.errors;
|
14024 | return _this2;
|
14025 | });
|
14026 | }
|
14027 | };
|
14028 |
|
14029 | Swagger.prototype.applyDefaults = function applyDefaults() {
|
14030 | var spec = this.spec;
|
14031 | var specUrl = this.url;
|
14032 |
|
14033 | if (specUrl && lodash_startsWith__WEBPACK_IMPORTED_MODULE_2___default()(specUrl, 'http')) {
|
14034 | var parsed = url__WEBPACK_IMPORTED_MODULE_3___default.a.parse(specUrl);
|
14035 |
|
14036 | if (!spec.host) {
|
14037 | spec.host = parsed.host;
|
14038 | }
|
14039 |
|
14040 | if (!spec.schemes) {
|
14041 | spec.schemes = [parsed.protocol.replace(':', '')];
|
14042 | }
|
14043 |
|
14044 | if (!spec.basePath) {
|
14045 | spec.basePath = '/';
|
14046 | }
|
14047 | }
|
14048 | };
|
14049 |
|
14050 |
|
14051 |
|
14052 | var helpers = Swagger.helpers;
|
14053 |
|
14054 | __webpack_exports__["default"] = (Swagger);
|
14055 |
|
14056 | }),
|
14057 |
|
14058 | (function(module, exports, __webpack_require__) {
|
14059 |
|
14060 | __webpack_require__(188);
|
14061 | var $Object = __webpack_require__(5).Object;
|
14062 | module.exports = function defineProperty(it, key, desc) {
|
14063 | return $Object.defineProperty(it, key, desc);
|
14064 | };
|
14065 |
|
14066 |
|
14067 | }),
|
14068 |
|
14069 | (function(module, exports, __webpack_require__) {
|
14070 |
|
14071 | var $export = __webpack_require__(6);
|
14072 |
|
14073 | $export($export.S + $export.F * !__webpack_require__(16), 'Object', { defineProperty: __webpack_require__(19).f });
|
14074 |
|
14075 |
|
14076 | }),
|
14077 |
|
14078 | (function(module, exports, __webpack_require__) {
|
14079 |
|
14080 | module.exports = __webpack_require__(190);
|
14081 |
|
14082 | }),
|
14083 |
|
14084 | (function(module, exports, __webpack_require__) {
|
14085 |
|
14086 | __webpack_require__(191);
|
14087 | var $Object = __webpack_require__(5).Object;
|
14088 | module.exports = function defineProperties(T, D) {
|
14089 | return $Object.defineProperties(T, D);
|
14090 | };
|
14091 |
|
14092 |
|
14093 | }),
|
14094 |
|
14095 | (function(module, exports, __webpack_require__) {
|
14096 |
|
14097 | var $export = __webpack_require__(6);
|
14098 |
|
14099 | $export($export.S + $export.F * !__webpack_require__(16), 'Object', { defineProperties: __webpack_require__(120) });
|
14100 |
|
14101 |
|
14102 | }),
|
14103 |
|
14104 | (function(module, exports, __webpack_require__) {
|
14105 |
|
14106 |
|
14107 |
|
14108 | var toIObject = __webpack_require__(24);
|
14109 | var toLength = __webpack_require__(63);
|
14110 | var toAbsoluteIndex = __webpack_require__(193);
|
14111 | module.exports = function (IS_INCLUDES) {
|
14112 | return function ($this, el, fromIndex) {
|
14113 | var O = toIObject($this);
|
14114 | var length = toLength(O.length);
|
14115 | var index = toAbsoluteIndex(fromIndex, length);
|
14116 | var value;
|
14117 |
|
14118 |
|
14119 | if (IS_INCLUDES && el != el) while (length > index) {
|
14120 | value = O[index++];
|
14121 |
|
14122 | if (value != value) return true;
|
14123 |
|
14124 | } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
14125 | if (O[index] === el) return IS_INCLUDES || index || 0;
|
14126 | } return !IS_INCLUDES && -1;
|
14127 | };
|
14128 | };
|
14129 |
|
14130 |
|
14131 | }),
|
14132 |
|
14133 | (function(module, exports, __webpack_require__) {
|
14134 |
|
14135 | var toInteger = __webpack_require__(90);
|
14136 | var max = Math.max;
|
14137 | var min = Math.min;
|
14138 | module.exports = function (index, length) {
|
14139 | index = toInteger(index);
|
14140 | return index < 0 ? max(index + length, 0) : min(index, length);
|
14141 | };
|
14142 |
|
14143 |
|
14144 | }),
|
14145 |
|
14146 | (function(module, exports, __webpack_require__) {
|
14147 |
|
14148 | module.exports = __webpack_require__(195);
|
14149 |
|
14150 | }),
|
14151 |
|
14152 | (function(module, exports, __webpack_require__) {
|
14153 |
|
14154 | __webpack_require__(196);
|
14155 | module.exports = __webpack_require__(5).Object.getOwnPropertyDescriptors;
|
14156 |
|
14157 |
|
14158 | }),
|
14159 |
|
14160 | (function(module, exports, __webpack_require__) {
|
14161 |
|
14162 |
|
14163 | var $export = __webpack_require__(6);
|
14164 | var ownKeys = __webpack_require__(197);
|
14165 | var toIObject = __webpack_require__(24);
|
14166 | var gOPD = __webpack_require__(52);
|
14167 | var createProperty = __webpack_require__(122);
|
14168 |
|
14169 | $export($export.S, 'Object', {
|
14170 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
14171 | var O = toIObject(object);
|
14172 | var getDesc = gOPD.f;
|
14173 | var keys = ownKeys(O);
|
14174 | var result = {};
|
14175 | var i = 0;
|
14176 | var key, desc;
|
14177 | while (keys.length > i) {
|
14178 | desc = getDesc(O, key = keys[i++]);
|
14179 | if (desc !== undefined) createProperty(result, key, desc);
|
14180 | }
|
14181 | return result;
|
14182 | }
|
14183 | });
|
14184 |
|
14185 |
|
14186 | }),
|
14187 |
|
14188 | (function(module, exports, __webpack_require__) {
|
14189 |
|
14190 |
|
14191 | var gOPN = __webpack_require__(94);
|
14192 | var gOPS = __webpack_require__(65);
|
14193 | var anObject = __webpack_require__(12);
|
14194 | var Reflect = __webpack_require__(7).Reflect;
|
14195 | module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
|
14196 | var keys = gOPN.f(anObject(it));
|
14197 | var getSymbols = gOPS.f;
|
14198 | return getSymbols ? keys.concat(getSymbols(it)) : keys;
|
14199 | };
|
14200 |
|
14201 |
|
14202 | }),
|
14203 |
|
14204 | (function(module, exports, __webpack_require__) {
|
14205 |
|
14206 | __webpack_require__(199);
|
14207 | var $Object = __webpack_require__(5).Object;
|
14208 | module.exports = function getOwnPropertyDescriptor(it, key) {
|
14209 | return $Object.getOwnPropertyDescriptor(it, key);
|
14210 | };
|
14211 |
|
14212 |
|
14213 | }),
|
14214 |
|
14215 | (function(module, exports, __webpack_require__) {
|
14216 |
|
14217 |
|
14218 | var toIObject = __webpack_require__(24);
|
14219 | var $getOwnPropertyDescriptor = __webpack_require__(52).f;
|
14220 |
|
14221 | __webpack_require__(95)('getOwnPropertyDescriptor', function () {
|
14222 | return function getOwnPropertyDescriptor(it, key) {
|
14223 | return $getOwnPropertyDescriptor(toIObject(it), key);
|
14224 | };
|
14225 | });
|
14226 |
|
14227 |
|
14228 | }),
|
14229 |
|
14230 | (function(module, exports, __webpack_require__) {
|
14231 |
|
14232 | __webpack_require__(125);
|
14233 | module.exports = __webpack_require__(5).Object.getOwnPropertySymbols;
|
14234 |
|
14235 |
|
14236 | }),
|
14237 |
|
14238 | (function(module, exports, __webpack_require__) {
|
14239 |
|
14240 |
|
14241 | var getKeys = __webpack_require__(40);
|
14242 | var gOPS = __webpack_require__(65);
|
14243 | var pIE = __webpack_require__(53);
|
14244 | module.exports = function (it) {
|
14245 | var result = getKeys(it);
|
14246 | var getSymbols = gOPS.f;
|
14247 | if (getSymbols) {
|
14248 | var symbols = getSymbols(it);
|
14249 | var isEnum = pIE.f;
|
14250 | var i = 0;
|
14251 | var key;
|
14252 | while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
|
14253 | } return result;
|
14254 | };
|
14255 |
|
14256 |
|
14257 | }),
|
14258 |
|
14259 | (function(module, exports, __webpack_require__) {
|
14260 |
|
14261 |
|
14262 | var toIObject = __webpack_require__(24);
|
14263 | var gOPN = __webpack_require__(94).f;
|
14264 | var toString = {}.toString;
|
14265 |
|
14266 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
14267 | ? Object.getOwnPropertyNames(window) : [];
|
14268 |
|
14269 | var getWindowNames = function (it) {
|
14270 | try {
|
14271 | return gOPN(it);
|
14272 | } catch (e) {
|
14273 | return windowNames.slice();
|
14274 | }
|
14275 | };
|
14276 |
|
14277 | module.exports.f = function getOwnPropertyNames(it) {
|
14278 | return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
14279 | };
|
14280 |
|
14281 |
|
14282 | }),
|
14283 |
|
14284 | (function(module, exports, __webpack_require__) {
|
14285 |
|
14286 | __webpack_require__(204);
|
14287 | module.exports = __webpack_require__(5).Object.keys;
|
14288 |
|
14289 |
|
14290 | }),
|
14291 |
|
14292 | (function(module, exports, __webpack_require__) {
|
14293 |
|
14294 |
|
14295 | var toObject = __webpack_require__(34);
|
14296 | var $keys = __webpack_require__(40);
|
14297 |
|
14298 | __webpack_require__(95)('keys', function () {
|
14299 | return function keys(it) {
|
14300 | return $keys(toObject(it));
|
14301 | };
|
14302 | });
|
14303 |
|
14304 |
|
14305 | }),
|
14306 |
|
14307 | (function(module, exports, __webpack_require__) {
|
14308 |
|
14309 | var getNative = __webpack_require__(206);
|
14310 |
|
14311 | var defineProperty = (function() {
|
14312 | try {
|
14313 | var func = getNative(Object, 'defineProperty');
|
14314 | func({}, '', {});
|
14315 | return func;
|
14316 | } catch (e) {}
|
14317 | }());
|
14318 |
|
14319 | module.exports = defineProperty;
|
14320 |
|
14321 |
|
14322 | }),
|
14323 |
|
14324 | (function(module, exports) {
|
14325 |
|
14326 |
|
14327 |
|
14328 |
|
14329 |
|
14330 |
|
14331 |
|
14332 |
|
14333 |
|
14334 | function getValue(object, key) {
|
14335 | return object == null ? undefined : object[key];
|
14336 | }
|
14337 |
|
14338 | module.exports = getValue;
|
14339 |
|
14340 |
|
14341 | }),
|
14342 |
|
14343 | (function(module, exports, __webpack_require__) {
|
14344 |
|
14345 | var baseRest = __webpack_require__(208),
|
14346 | isIterateeCall = __webpack_require__(213);
|
14347 |
|
14348 |
|
14349 |
|
14350 |
|
14351 |
|
14352 |
|
14353 |
|
14354 |
|
14355 | function createAssigner(assigner) {
|
14356 | return baseRest(function(object, sources) {
|
14357 | var index = -1,
|
14358 | length = sources.length,
|
14359 | customizer = length > 1 ? sources[length - 1] : undefined,
|
14360 | guard = length > 2 ? sources[2] : undefined;
|
14361 |
|
14362 | customizer = (assigner.length > 3 && typeof customizer == 'function')
|
14363 | ? (length--, customizer)
|
14364 | : undefined;
|
14365 |
|
14366 | if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
14367 | customizer = length < 3 ? undefined : customizer;
|
14368 | length = 1;
|
14369 | }
|
14370 | object = Object(object);
|
14371 | while (++index < length) {
|
14372 | var source = sources[index];
|
14373 | if (source) {
|
14374 | assigner(object, source, index, customizer);
|
14375 | }
|
14376 | }
|
14377 | return object;
|
14378 | });
|
14379 | }
|
14380 |
|
14381 | module.exports = createAssigner;
|
14382 |
|
14383 |
|
14384 | }),
|
14385 |
|
14386 | (function(module, exports, __webpack_require__) {
|
14387 |
|
14388 | var identity = __webpack_require__(209),
|
14389 | overRest = __webpack_require__(210),
|
14390 | setToString = __webpack_require__(212);
|
14391 |
|
14392 |
|
14393 |
|
14394 |
|
14395 |
|
14396 |
|
14397 |
|
14398 |
|
14399 |
|
14400 | function baseRest(func, start) {
|
14401 | return setToString(overRest(func, start, identity), func + '');
|
14402 | }
|
14403 |
|
14404 | module.exports = baseRest;
|
14405 |
|
14406 |
|
14407 | }),
|
14408 |
|
14409 | (function(module, exports) {
|
14410 |
|
14411 |
|
14412 |
|
14413 |
|
14414 |
|
14415 |
|
14416 |
|
14417 |
|
14418 |
|
14419 |
|
14420 |
|
14421 |
|
14422 |
|
14423 |
|
14424 |
|
14425 |
|
14426 |
|
14427 | function identity(value) {
|
14428 | return value;
|
14429 | }
|
14430 |
|
14431 | module.exports = identity;
|
14432 |
|
14433 |
|
14434 | }),
|
14435 |
|
14436 | (function(module, exports, __webpack_require__) {
|
14437 |
|
14438 | var apply = __webpack_require__(211);
|
14439 |
|
14440 |
|
14441 | var nativeMax = Math.max;
|
14442 |
|
14443 |
|
14444 |
|
14445 |
|
14446 |
|
14447 |
|
14448 |
|
14449 |
|
14450 |
|
14451 |
|
14452 | function overRest(func, start, transform) {
|
14453 | start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
14454 | return function() {
|
14455 | var args = arguments,
|
14456 | index = -1,
|
14457 | length = nativeMax(args.length - start, 0),
|
14458 | array = Array(length);
|
14459 |
|
14460 | while (++index < length) {
|
14461 | array[index] = args[start + index];
|
14462 | }
|
14463 | index = -1;
|
14464 | var otherArgs = Array(start + 1);
|
14465 | while (++index < start) {
|
14466 | otherArgs[index] = args[index];
|
14467 | }
|
14468 | otherArgs[start] = transform(array);
|
14469 | return apply(func, this, otherArgs);
|
14470 | };
|
14471 | }
|
14472 |
|
14473 | module.exports = overRest;
|
14474 |
|
14475 |
|
14476 | }),
|
14477 |
|
14478 | (function(module, exports) {
|
14479 |
|
14480 |
|
14481 |
|
14482 |
|
14483 |
|
14484 |
|
14485 |
|
14486 |
|
14487 |
|
14488 |
|
14489 |
|
14490 | function apply(func, thisArg, args) {
|
14491 | switch (args.length) {
|
14492 | case 0: return func.call(thisArg);
|
14493 | case 1: return func.call(thisArg, args[0]);
|
14494 | case 2: return func.call(thisArg, args[0], args[1]);
|
14495 | case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
14496 | }
|
14497 | return func.apply(thisArg, args);
|
14498 | }
|
14499 |
|
14500 | module.exports = apply;
|
14501 |
|
14502 |
|
14503 | }),
|
14504 |
|
14505 | (function(module, exports) {
|
14506 |
|
14507 |
|
14508 |
|
14509 |
|
14510 |
|
14511 |
|
14512 |
|
14513 |
|
14514 |
|
14515 |
|
14516 |
|
14517 |
|
14518 |
|
14519 |
|
14520 |
|
14521 |
|
14522 |
|
14523 | function identity(value) {
|
14524 | return value;
|
14525 | }
|
14526 |
|
14527 | module.exports = identity;
|
14528 |
|
14529 |
|
14530 | }),
|
14531 |
|
14532 | (function(module, exports) {
|
14533 |
|
14534 |
|
14535 |
|
14536 |
|
14537 |
|
14538 |
|
14539 |
|
14540 |
|
14541 |
|
14542 |
|
14543 |
|
14544 |
|
14545 |
|
14546 |
|
14547 | function stubFalse() {
|
14548 | return false;
|
14549 | }
|
14550 |
|
14551 | module.exports = stubFalse;
|
14552 |
|
14553 |
|
14554 | }),
|
14555 |
|
14556 | (function(module, exports) {
|
14557 |
|
14558 |
|
14559 |
|
14560 |
|
14561 |
|
14562 |
|
14563 |
|
14564 |
|
14565 |
|
14566 |
|
14567 | function baseClamp(number, lower, upper) {
|
14568 | if (number === number) {
|
14569 | if (upper !== undefined) {
|
14570 | number = number <= upper ? number : upper;
|
14571 | }
|
14572 | if (lower !== undefined) {
|
14573 | number = number >= lower ? number : lower;
|
14574 | }
|
14575 | }
|
14576 | return number;
|
14577 | }
|
14578 |
|
14579 | module.exports = baseClamp;
|
14580 |
|
14581 |
|
14582 | }),
|
14583 |
|
14584 | (function(module, exports) {
|
14585 |
|
14586 |
|
14587 |
|
14588 |
|
14589 |
|
14590 |
|
14591 |
|
14592 |
|
14593 |
|
14594 |
|
14595 |
|
14596 |
|
14597 |
|
14598 |
|
14599 |
|
14600 |
|
14601 |
|
14602 | function identity(value) {
|
14603 | return value;
|
14604 | }
|
14605 |
|
14606 | module.exports = identity;
|
14607 |
|
14608 |
|
14609 | }),
|
14610 |
|
14611 | (function(module, exports, __webpack_require__) {
|
14612 |
|
14613 | (function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;
|
14614 | ;(function(root) {
|
14615 |
|
14616 |
|
14617 | var freeExports = true && exports &&
|
14618 | !exports.nodeType && exports;
|
14619 | var freeModule = true && module &&
|
14620 | !module.nodeType && module;
|
14621 | var freeGlobal = typeof global == 'object' && global;
|
14622 | if (
|
14623 | freeGlobal.global === freeGlobal ||
|
14624 | freeGlobal.window === freeGlobal ||
|
14625 | freeGlobal.self === freeGlobal
|
14626 | ) {
|
14627 | root = freeGlobal;
|
14628 | }
|
14629 |
|
14630 | |
14631 |
|
14632 |
|
14633 |
|
14634 |
|
14635 | var punycode,
|
14636 |
|
14637 |
|
14638 | maxInt = 2147483647,
|
14639 |
|
14640 |
|
14641 | base = 36,
|
14642 | tMin = 1,
|
14643 | tMax = 26,
|
14644 | skew = 38,
|
14645 | damp = 700,
|
14646 | initialBias = 72,
|
14647 | initialN = 128,
|
14648 | delimiter = '-',
|
14649 |
|
14650 |
|
14651 | regexPunycode = /^xn--/,
|
14652 | regexNonASCII = /[^\x20-\x7E]/,
|
14653 | regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g,
|
14654 |
|
14655 |
|
14656 | errors = {
|
14657 | 'overflow': 'Overflow: input needs wider integers to process',
|
14658 | 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
14659 | 'invalid-input': 'Invalid input'
|
14660 | },
|
14661 |
|
14662 |
|
14663 | baseMinusTMin = base - tMin,
|
14664 | floor = Math.floor,
|
14665 | stringFromCharCode = String.fromCharCode,
|
14666 |
|
14667 |
|
14668 | key;
|
14669 |
|
14670 |
|
14671 |
|
14672 | |
14673 |
|
14674 |
|
14675 |
|
14676 |
|
14677 |
|
14678 | function error(type) {
|
14679 | throw RangeError(errors[type]);
|
14680 | }
|
14681 |
|
14682 | |
14683 |
|
14684 |
|
14685 |
|
14686 |
|
14687 |
|
14688 |
|
14689 |
|
14690 | function map(array, fn) {
|
14691 | var length = array.length;
|
14692 | var result = [];
|
14693 | while (length--) {
|
14694 | result[length] = fn(array[length]);
|
14695 | }
|
14696 | return result;
|
14697 | }
|
14698 |
|
14699 | |
14700 |
|
14701 |
|
14702 |
|
14703 |
|
14704 |
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 | function mapDomain(string, fn) {
|
14710 | var parts = string.split('@');
|
14711 | var result = '';
|
14712 | if (parts.length > 1) {
|
14713 |
|
14714 |
|
14715 | result = parts[0] + '@';
|
14716 | string = parts[1];
|
14717 | }
|
14718 |
|
14719 | string = string.replace(regexSeparators, '\x2E');
|
14720 | var labels = string.split('.');
|
14721 | var encoded = map(labels, fn).join('.');
|
14722 | return result + encoded;
|
14723 | }
|
14724 |
|
14725 | |
14726 |
|
14727 |
|
14728 |
|
14729 |
|
14730 |
|
14731 |
|
14732 |
|
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 |
|
14738 | function ucs2decode(string) {
|
14739 | var output = [],
|
14740 | counter = 0,
|
14741 | length = string.length,
|
14742 | value,
|
14743 | extra;
|
14744 | while (counter < length) {
|
14745 | value = string.charCodeAt(counter++);
|
14746 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
14747 |
|
14748 | extra = string.charCodeAt(counter++);
|
14749 | if ((extra & 0xFC00) == 0xDC00) {
|
14750 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
14751 | } else {
|
14752 |
|
14753 |
|
14754 | output.push(value);
|
14755 | counter--;
|
14756 | }
|
14757 | } else {
|
14758 | output.push(value);
|
14759 | }
|
14760 | }
|
14761 | return output;
|
14762 | }
|
14763 |
|
14764 | |
14765 |
|
14766 |
|
14767 |
|
14768 |
|
14769 |
|
14770 |
|
14771 |
|
14772 | function ucs2encode(array) {
|
14773 | return map(array, function(value) {
|
14774 | var output = '';
|
14775 | if (value > 0xFFFF) {
|
14776 | value -= 0x10000;
|
14777 | output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
14778 | value = 0xDC00 | value & 0x3FF;
|
14779 | }
|
14780 | output += stringFromCharCode(value);
|
14781 | return output;
|
14782 | }).join('');
|
14783 | }
|
14784 |
|
14785 | |
14786 |
|
14787 |
|
14788 |
|
14789 |
|
14790 |
|
14791 |
|
14792 |
|
14793 |
|
14794 | function basicToDigit(codePoint) {
|
14795 | if (codePoint - 48 < 10) {
|
14796 | return codePoint - 22;
|
14797 | }
|
14798 | if (codePoint - 65 < 26) {
|
14799 | return codePoint - 65;
|
14800 | }
|
14801 | if (codePoint - 97 < 26) {
|
14802 | return codePoint - 97;
|
14803 | }
|
14804 | return base;
|
14805 | }
|
14806 |
|
14807 | |
14808 |
|
14809 |
|
14810 |
|
14811 |
|
14812 |
|
14813 |
|
14814 |
|
14815 |
|
14816 |
|
14817 |
|
14818 | function digitToBasic(digit, flag) {
|
14819 |
|
14820 |
|
14821 | return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
14822 | }
|
14823 |
|
14824 | |
14825 |
|
14826 |
|
14827 |
|
14828 |
|
14829 | function adapt(delta, numPoints, firstTime) {
|
14830 | var k = 0;
|
14831 | delta = firstTime ? floor(delta / damp) : delta >> 1;
|
14832 | delta += floor(delta / numPoints);
|
14833 | for (; delta > baseMinusTMin * tMax >> 1; k += base) {
|
14834 | delta = floor(delta / baseMinusTMin);
|
14835 | }
|
14836 | return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
14837 | }
|
14838 |
|
14839 | |
14840 |
|
14841 |
|
14842 |
|
14843 |
|
14844 |
|
14845 |
|
14846 | function decode(input) {
|
14847 |
|
14848 | var output = [],
|
14849 | inputLength = input.length,
|
14850 | out,
|
14851 | i = 0,
|
14852 | n = initialN,
|
14853 | bias = initialBias,
|
14854 | basic,
|
14855 | j,
|
14856 | index,
|
14857 | oldi,
|
14858 | w,
|
14859 | k,
|
14860 | digit,
|
14861 | t,
|
14862 |
|
14863 | baseMinusT;
|
14864 |
|
14865 |
|
14866 |
|
14867 |
|
14868 |
|
14869 | basic = input.lastIndexOf(delimiter);
|
14870 | if (basic < 0) {
|
14871 | basic = 0;
|
14872 | }
|
14873 |
|
14874 | for (j = 0; j < basic; ++j) {
|
14875 |
|
14876 | if (input.charCodeAt(j) >= 0x80) {
|
14877 | error('not-basic');
|
14878 | }
|
14879 | output.push(input.charCodeAt(j));
|
14880 | }
|
14881 |
|
14882 |
|
14883 |
|
14884 |
|
14885 | for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
14886 |
|
14887 |
|
14888 |
|
14889 |
|
14890 |
|
14891 |
|
14892 | for (oldi = i, w = 1, k = base; ; k += base) {
|
14893 |
|
14894 | if (index >= inputLength) {
|
14895 | error('invalid-input');
|
14896 | }
|
14897 |
|
14898 | digit = basicToDigit(input.charCodeAt(index++));
|
14899 |
|
14900 | if (digit >= base || digit > floor((maxInt - i) / w)) {
|
14901 | error('overflow');
|
14902 | }
|
14903 |
|
14904 | i += digit * w;
|
14905 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
14906 |
|
14907 | if (digit < t) {
|
14908 | break;
|
14909 | }
|
14910 |
|
14911 | baseMinusT = base - t;
|
14912 | if (w > floor(maxInt / baseMinusT)) {
|
14913 | error('overflow');
|
14914 | }
|
14915 |
|
14916 | w *= baseMinusT;
|
14917 |
|
14918 | }
|
14919 |
|
14920 | out = output.length + 1;
|
14921 | bias = adapt(i - oldi, out, oldi == 0);
|
14922 |
|
14923 |
|
14924 |
|
14925 | if (floor(i / out) > maxInt - n) {
|
14926 | error('overflow');
|
14927 | }
|
14928 |
|
14929 | n += floor(i / out);
|
14930 | i %= out;
|
14931 |
|
14932 |
|
14933 | output.splice(i++, 0, n);
|
14934 |
|
14935 | }
|
14936 |
|
14937 | return ucs2encode(output);
|
14938 | }
|
14939 |
|
14940 | |
14941 |
|
14942 |
|
14943 |
|
14944 |
|
14945 |
|
14946 |
|
14947 | function encode(input) {
|
14948 | var n,
|
14949 | delta,
|
14950 | handledCPCount,
|
14951 | basicLength,
|
14952 | bias,
|
14953 | j,
|
14954 | m,
|
14955 | q,
|
14956 | k,
|
14957 | t,
|
14958 | currentValue,
|
14959 | output = [],
|
14960 |
|
14961 | inputLength,
|
14962 |
|
14963 | handledCPCountPlusOne,
|
14964 | baseMinusT,
|
14965 | qMinusT;
|
14966 |
|
14967 |
|
14968 | input = ucs2decode(input);
|
14969 |
|
14970 |
|
14971 | inputLength = input.length;
|
14972 |
|
14973 |
|
14974 | n = initialN;
|
14975 | delta = 0;
|
14976 | bias = initialBias;
|
14977 |
|
14978 |
|
14979 | for (j = 0; j < inputLength; ++j) {
|
14980 | currentValue = input[j];
|
14981 | if (currentValue < 0x80) {
|
14982 | output.push(stringFromCharCode(currentValue));
|
14983 | }
|
14984 | }
|
14985 |
|
14986 | handledCPCount = basicLength = output.length;
|
14987 |
|
14988 |
|
14989 |
|
14990 |
|
14991 |
|
14992 | if (basicLength) {
|
14993 | output.push(delimiter);
|
14994 | }
|
14995 |
|
14996 |
|
14997 | while (handledCPCount < inputLength) {
|
14998 |
|
14999 |
|
15000 |
|
15001 | for (m = maxInt, j = 0; j < inputLength; ++j) {
|
15002 | currentValue = input[j];
|
15003 | if (currentValue >= n && currentValue < m) {
|
15004 | m = currentValue;
|
15005 | }
|
15006 | }
|
15007 |
|
15008 |
|
15009 |
|
15010 | handledCPCountPlusOne = handledCPCount + 1;
|
15011 | if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
15012 | error('overflow');
|
15013 | }
|
15014 |
|
15015 | delta += (m - n) * handledCPCountPlusOne;
|
15016 | n = m;
|
15017 |
|
15018 | for (j = 0; j < inputLength; ++j) {
|
15019 | currentValue = input[j];
|
15020 |
|
15021 | if (currentValue < n && ++delta > maxInt) {
|
15022 | error('overflow');
|
15023 | }
|
15024 |
|
15025 | if (currentValue == n) {
|
15026 |
|
15027 | for (q = delta, k = base; ; k += base) {
|
15028 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
15029 | if (q < t) {
|
15030 | break;
|
15031 | }
|
15032 | qMinusT = q - t;
|
15033 | baseMinusT = base - t;
|
15034 | output.push(
|
15035 | stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
15036 | );
|
15037 | q = floor(qMinusT / baseMinusT);
|
15038 | }
|
15039 |
|
15040 | output.push(stringFromCharCode(digitToBasic(q, 0)));
|
15041 | bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
15042 | delta = 0;
|
15043 | ++handledCPCount;
|
15044 | }
|
15045 | }
|
15046 |
|
15047 | ++delta;
|
15048 | ++n;
|
15049 |
|
15050 | }
|
15051 | return output.join('');
|
15052 | }
|
15053 |
|
15054 | |
15055 |
|
15056 |
|
15057 |
|
15058 |
|
15059 |
|
15060 |
|
15061 |
|
15062 |
|
15063 |
|
15064 |
|
15065 | function toUnicode(input) {
|
15066 | return mapDomain(input, function(string) {
|
15067 | return regexPunycode.test(string)
|
15068 | ? decode(string.slice(4).toLowerCase())
|
15069 | : string;
|
15070 | });
|
15071 | }
|
15072 |
|
15073 | |
15074 |
|
15075 |
|
15076 |
|
15077 |
|
15078 |
|
15079 |
|
15080 |
|
15081 |
|
15082 |
|
15083 |
|
15084 | function toASCII(input) {
|
15085 | return mapDomain(input, function(string) {
|
15086 | return regexNonASCII.test(string)
|
15087 | ? 'xn--' + encode(string)
|
15088 | : string;
|
15089 | });
|
15090 | }
|
15091 |
|
15092 |
|
15093 |
|
15094 |
|
15095 | punycode = {
|
15096 | |
15097 |
|
15098 |
|
15099 |
|
15100 |
|
15101 | 'version': '1.3.2',
|
15102 | |
15103 |
|
15104 |
|
15105 |
|
15106 |
|
15107 |
|
15108 |
|
15109 | 'ucs2': {
|
15110 | 'decode': ucs2decode,
|
15111 | 'encode': ucs2encode
|
15112 | },
|
15113 | 'decode': decode,
|
15114 | 'encode': encode,
|
15115 | 'toASCII': toASCII,
|
15116 | 'toUnicode': toUnicode
|
15117 | };
|
15118 |
|
15119 |
|
15120 |
|
15121 |
|
15122 | if (
|
15123 | true
|
15124 | ) {
|
15125 | !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
|
15126 | return punycode;
|
15127 | }).call(exports, __webpack_require__, exports, module),
|
15128 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
15129 | } else {}
|
15130 |
|
15131 | }(this));
|
15132 |
|
15133 | }.call(this, __webpack_require__(135)(module), __webpack_require__(101)))
|
15134 |
|
15135 | }),
|
15136 |
|
15137 | (function(module, exports, __webpack_require__) {
|
15138 |
|
15139 | "use strict";
|
15140 |
|
15141 |
|
15142 | module.exports = {
|
15143 | isString: function(arg) {
|
15144 | return typeof(arg) === 'string';
|
15145 | },
|
15146 | isObject: function(arg) {
|
15147 | return typeof(arg) === 'object' && arg !== null;
|
15148 | },
|
15149 | isNull: function(arg) {
|
15150 | return arg === null;
|
15151 | },
|
15152 | isNullOrUndefined: function(arg) {
|
15153 | return arg == null;
|
15154 | }
|
15155 | };
|
15156 |
|
15157 |
|
15158 | }),
|
15159 |
|
15160 | (function(module, exports, __webpack_require__) {
|
15161 |
|
15162 | "use strict";
|
15163 |
|
15164 |
|
15165 | exports.decode = exports.parse = __webpack_require__(219);
|
15166 | exports.encode = exports.stringify = __webpack_require__(220);
|
15167 |
|
15168 |
|
15169 | }),
|
15170 |
|
15171 | (function(module, exports, __webpack_require__) {
|
15172 |
|
15173 | "use strict";
|
15174 |
|
15175 |
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 |
|
15182 |
|
15183 |
|
15184 |
|
15185 |
|
15186 |
|
15187 |
|
15188 |
|
15189 |
|
15190 |
|
15191 |
|
15192 |
|
15193 |
|
15194 |
|
15195 |
|
15196 |
|
15197 |
|
15198 |
|
15199 |
|
15200 | function hasOwnProperty(obj, prop) {
|
15201 | return Object.prototype.hasOwnProperty.call(obj, prop);
|
15202 | }
|
15203 |
|
15204 | module.exports = function(qs, sep, eq, options) {
|
15205 | sep = sep || '&';
|
15206 | eq = eq || '=';
|
15207 | var obj = {};
|
15208 |
|
15209 | if (typeof qs !== 'string' || qs.length === 0) {
|
15210 | return obj;
|
15211 | }
|
15212 |
|
15213 | var regexp = /\+/g;
|
15214 | qs = qs.split(sep);
|
15215 |
|
15216 | var maxKeys = 1000;
|
15217 | if (options && typeof options.maxKeys === 'number') {
|
15218 | maxKeys = options.maxKeys;
|
15219 | }
|
15220 |
|
15221 | var len = qs.length;
|
15222 |
|
15223 | if (maxKeys > 0 && len > maxKeys) {
|
15224 | len = maxKeys;
|
15225 | }
|
15226 |
|
15227 | for (var i = 0; i < len; ++i) {
|
15228 | var x = qs[i].replace(regexp, '%20'),
|
15229 | idx = x.indexOf(eq),
|
15230 | kstr, vstr, k, v;
|
15231 |
|
15232 | if (idx >= 0) {
|
15233 | kstr = x.substr(0, idx);
|
15234 | vstr = x.substr(idx + 1);
|
15235 | } else {
|
15236 | kstr = x;
|
15237 | vstr = '';
|
15238 | }
|
15239 |
|
15240 | k = decodeURIComponent(kstr);
|
15241 | v = decodeURIComponent(vstr);
|
15242 |
|
15243 | if (!hasOwnProperty(obj, k)) {
|
15244 | obj[k] = v;
|
15245 | } else if (isArray(obj[k])) {
|
15246 | obj[k].push(v);
|
15247 | } else {
|
15248 | obj[k] = [obj[k], v];
|
15249 | }
|
15250 | }
|
15251 |
|
15252 | return obj;
|
15253 | };
|
15254 |
|
15255 | var isArray = Array.isArray || function (xs) {
|
15256 | return Object.prototype.toString.call(xs) === '[object Array]';
|
15257 | };
|
15258 |
|
15259 |
|
15260 | }),
|
15261 |
|
15262 | (function(module, exports, __webpack_require__) {
|
15263 |
|
15264 | "use strict";
|
15265 |
|
15266 |
|
15267 |
|
15268 |
|
15269 |
|
15270 |
|
15271 |
|
15272 |
|
15273 |
|
15274 |
|
15275 |
|
15276 |
|
15277 |
|
15278 |
|
15279 |
|
15280 |
|
15281 |
|
15282 |
|
15283 |
|
15284 |
|
15285 |
|
15286 |
|
15287 |
|
15288 | var stringifyPrimitive = function(v) {
|
15289 | switch (typeof v) {
|
15290 | case 'string':
|
15291 | return v;
|
15292 |
|
15293 | case 'boolean':
|
15294 | return v ? 'true' : 'false';
|
15295 |
|
15296 | case 'number':
|
15297 | return isFinite(v) ? v : '';
|
15298 |
|
15299 | default:
|
15300 | return '';
|
15301 | }
|
15302 | };
|
15303 |
|
15304 | module.exports = function(obj, sep, eq, name) {
|
15305 | sep = sep || '&';
|
15306 | eq = eq || '=';
|
15307 | if (obj === null) {
|
15308 | obj = undefined;
|
15309 | }
|
15310 |
|
15311 | if (typeof obj === 'object') {
|
15312 | return map(objectKeys(obj), function(k) {
|
15313 | var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
15314 | if (isArray(obj[k])) {
|
15315 | return map(obj[k], function(v) {
|
15316 | return ks + encodeURIComponent(stringifyPrimitive(v));
|
15317 | }).join(sep);
|
15318 | } else {
|
15319 | return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
|
15320 | }
|
15321 | }).join(sep);
|
15322 |
|
15323 | }
|
15324 |
|
15325 | if (!name) return '';
|
15326 | return encodeURIComponent(stringifyPrimitive(name)) + eq +
|
15327 | encodeURIComponent(stringifyPrimitive(obj));
|
15328 | };
|
15329 |
|
15330 | var isArray = Array.isArray || function (xs) {
|
15331 | return Object.prototype.toString.call(xs) === '[object Array]';
|
15332 | };
|
15333 |
|
15334 | function map (xs, f) {
|
15335 | if (xs.map) return xs.map(f);
|
15336 | var res = [];
|
15337 | for (var i = 0; i < xs.length; i++) {
|
15338 | res.push(f(xs[i], i));
|
15339 | }
|
15340 | return res;
|
15341 | }
|
15342 |
|
15343 | var objectKeys = Object.keys || function (obj) {
|
15344 | var res = [];
|
15345 | for (var key in obj) {
|
15346 | if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
|
15347 | }
|
15348 | return res;
|
15349 | };
|
15350 |
|
15351 |
|
15352 | }),
|
15353 |
|
15354 | (function(module, exports, __webpack_require__) {
|
15355 |
|
15356 |
|
15357 |
|
15358 |
|
15359 |
|
15360 |
|
15361 |
|
15362 |
|
15363 | var runtime = (function (exports) {
|
15364 | "use strict";
|
15365 |
|
15366 | var Op = Object.prototype;
|
15367 | var hasOwn = Op.hasOwnProperty;
|
15368 | var undefined;
|
15369 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
15370 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
15371 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
15372 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
15373 |
|
15374 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
15375 |
|
15376 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
15377 | var generator = Object.create(protoGenerator.prototype);
|
15378 | var context = new Context(tryLocsList || []);
|
15379 |
|
15380 |
|
15381 |
|
15382 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
15383 |
|
15384 | return generator;
|
15385 | }
|
15386 | exports.wrap = wrap;
|
15387 |
|
15388 |
|
15389 |
|
15390 |
|
15391 |
|
15392 |
|
15393 |
|
15394 |
|
15395 |
|
15396 |
|
15397 |
|
15398 | function tryCatch(fn, obj, arg) {
|
15399 | try {
|
15400 | return { type: "normal", arg: fn.call(obj, arg) };
|
15401 | } catch (err) {
|
15402 | return { type: "throw", arg: err };
|
15403 | }
|
15404 | }
|
15405 |
|
15406 | var GenStateSuspendedStart = "suspendedStart";
|
15407 | var GenStateSuspendedYield = "suspendedYield";
|
15408 | var GenStateExecuting = "executing";
|
15409 | var GenStateCompleted = "completed";
|
15410 |
|
15411 |
|
15412 |
|
15413 | var ContinueSentinel = {};
|
15414 |
|
15415 |
|
15416 |
|
15417 |
|
15418 |
|
15419 | function Generator() {}
|
15420 | function GeneratorFunction() {}
|
15421 | function GeneratorFunctionPrototype() {}
|
15422 |
|
15423 |
|
15424 |
|
15425 | var IteratorPrototype = {};
|
15426 | IteratorPrototype[iteratorSymbol] = function () {
|
15427 | return this;
|
15428 | };
|
15429 |
|
15430 | var getProto = Object.getPrototypeOf;
|
15431 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
15432 | if (NativeIteratorPrototype &&
|
15433 | NativeIteratorPrototype !== Op &&
|
15434 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
15435 |
|
15436 |
|
15437 | IteratorPrototype = NativeIteratorPrototype;
|
15438 | }
|
15439 |
|
15440 | var Gp = GeneratorFunctionPrototype.prototype =
|
15441 | Generator.prototype = Object.create(IteratorPrototype);
|
15442 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
15443 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
15444 | GeneratorFunctionPrototype[toStringTagSymbol] =
|
15445 | GeneratorFunction.displayName = "GeneratorFunction";
|
15446 |
|
15447 |
|
15448 |
|
15449 | function defineIteratorMethods(prototype) {
|
15450 | ["next", "throw", "return"].forEach(function(method) {
|
15451 | prototype[method] = function(arg) {
|
15452 | return this._invoke(method, arg);
|
15453 | };
|
15454 | });
|
15455 | }
|
15456 |
|
15457 | exports.isGeneratorFunction = function(genFun) {
|
15458 | var ctor = typeof genFun === "function" && genFun.constructor;
|
15459 | return ctor
|
15460 | ? ctor === GeneratorFunction ||
|
15461 |
|
15462 |
|
15463 | (ctor.displayName || ctor.name) === "GeneratorFunction"
|
15464 | : false;
|
15465 | };
|
15466 |
|
15467 | exports.mark = function(genFun) {
|
15468 | if (Object.setPrototypeOf) {
|
15469 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
15470 | } else {
|
15471 | genFun.__proto__ = GeneratorFunctionPrototype;
|
15472 | if (!(toStringTagSymbol in genFun)) {
|
15473 | genFun[toStringTagSymbol] = "GeneratorFunction";
|
15474 | }
|
15475 | }
|
15476 | genFun.prototype = Object.create(Gp);
|
15477 | return genFun;
|
15478 | };
|
15479 |
|
15480 |
|
15481 |
|
15482 |
|
15483 |
|
15484 | exports.awrap = function(arg) {
|
15485 | return { __await: arg };
|
15486 | };
|
15487 |
|
15488 | function AsyncIterator(generator, PromiseImpl) {
|
15489 | function invoke(method, arg, resolve, reject) {
|
15490 | var record = tryCatch(generator[method], generator, arg);
|
15491 | if (record.type === "throw") {
|
15492 | reject(record.arg);
|
15493 | } else {
|
15494 | var result = record.arg;
|
15495 | var value = result.value;
|
15496 | if (value &&
|
15497 | typeof value === "object" &&
|
15498 | hasOwn.call(value, "__await")) {
|
15499 | return PromiseImpl.resolve(value.__await).then(function(value) {
|
15500 | invoke("next", value, resolve, reject);
|
15501 | }, function(err) {
|
15502 | invoke("throw", err, resolve, reject);
|
15503 | });
|
15504 | }
|
15505 |
|
15506 | return PromiseImpl.resolve(value).then(function(unwrapped) {
|
15507 |
|
15508 |
|
15509 |
|
15510 | result.value = unwrapped;
|
15511 | resolve(result);
|
15512 | }, function(error) {
|
15513 |
|
15514 |
|
15515 | return invoke("throw", error, resolve, reject);
|
15516 | });
|
15517 | }
|
15518 | }
|
15519 |
|
15520 | var previousPromise;
|
15521 |
|
15522 | function enqueue(method, arg) {
|
15523 | function callInvokeWithMethodAndArg() {
|
15524 | return new PromiseImpl(function(resolve, reject) {
|
15525 | invoke(method, arg, resolve, reject);
|
15526 | });
|
15527 | }
|
15528 |
|
15529 | return previousPromise =
|
15530 |
|
15531 |
|
15532 |
|
15533 |
|
15534 |
|
15535 |
|
15536 |
|
15537 |
|
15538 |
|
15539 |
|
15540 |
|
15541 |
|
15542 | previousPromise ? previousPromise.then(
|
15543 | callInvokeWithMethodAndArg,
|
15544 |
|
15545 |
|
15546 | callInvokeWithMethodAndArg
|
15547 | ) : callInvokeWithMethodAndArg();
|
15548 | }
|
15549 |
|
15550 |
|
15551 |
|
15552 | this._invoke = enqueue;
|
15553 | }
|
15554 |
|
15555 | defineIteratorMethods(AsyncIterator.prototype);
|
15556 | AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
15557 | return this;
|
15558 | };
|
15559 | exports.AsyncIterator = AsyncIterator;
|
15560 |
|
15561 |
|
15562 |
|
15563 |
|
15564 | exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
15565 | if (PromiseImpl === void 0) PromiseImpl = Promise;
|
15566 |
|
15567 | var iter = new AsyncIterator(
|
15568 | wrap(innerFn, outerFn, self, tryLocsList),
|
15569 | PromiseImpl
|
15570 | );
|
15571 |
|
15572 | return exports.isGeneratorFunction(outerFn)
|
15573 | ? iter
|
15574 | : iter.next().then(function(result) {
|
15575 | return result.done ? result.value : iter.next();
|
15576 | });
|
15577 | };
|
15578 |
|
15579 | function makeInvokeMethod(innerFn, self, context) {
|
15580 | var state = GenStateSuspendedStart;
|
15581 |
|
15582 | return function invoke(method, arg) {
|
15583 | if (state === GenStateExecuting) {
|
15584 | throw new Error("Generator is already running");
|
15585 | }
|
15586 |
|
15587 | if (state === GenStateCompleted) {
|
15588 | if (method === "throw") {
|
15589 | throw arg;
|
15590 | }
|
15591 |
|
15592 |
|
15593 |
|
15594 | return doneResult();
|
15595 | }
|
15596 |
|
15597 | context.method = method;
|
15598 | context.arg = arg;
|
15599 |
|
15600 | while (true) {
|
15601 | var delegate = context.delegate;
|
15602 | if (delegate) {
|
15603 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
15604 | if (delegateResult) {
|
15605 | if (delegateResult === ContinueSentinel) continue;
|
15606 | return delegateResult;
|
15607 | }
|
15608 | }
|
15609 |
|
15610 | if (context.method === "next") {
|
15611 |
|
15612 |
|
15613 | context.sent = context._sent = context.arg;
|
15614 |
|
15615 | } else if (context.method === "throw") {
|
15616 | if (state === GenStateSuspendedStart) {
|
15617 | state = GenStateCompleted;
|
15618 | throw context.arg;
|
15619 | }
|
15620 |
|
15621 | context.dispatchException(context.arg);
|
15622 |
|
15623 | } else if (context.method === "return") {
|
15624 | context.abrupt("return", context.arg);
|
15625 | }
|
15626 |
|
15627 | state = GenStateExecuting;
|
15628 |
|
15629 | var record = tryCatch(innerFn, self, context);
|
15630 | if (record.type === "normal") {
|
15631 |
|
15632 |
|
15633 | state = context.done
|
15634 | ? GenStateCompleted
|
15635 | : GenStateSuspendedYield;
|
15636 |
|
15637 | if (record.arg === ContinueSentinel) {
|
15638 | continue;
|
15639 | }
|
15640 |
|
15641 | return {
|
15642 | value: record.arg,
|
15643 | done: context.done
|
15644 | };
|
15645 |
|
15646 | } else if (record.type === "throw") {
|
15647 | state = GenStateCompleted;
|
15648 |
|
15649 |
|
15650 | context.method = "throw";
|
15651 | context.arg = record.arg;
|
15652 | }
|
15653 | }
|
15654 | };
|
15655 | }
|
15656 |
|
15657 |
|
15658 |
|
15659 |
|
15660 |
|
15661 | function maybeInvokeDelegate(delegate, context) {
|
15662 | var method = delegate.iterator[context.method];
|
15663 | if (method === undefined) {
|
15664 |
|
15665 |
|
15666 | context.delegate = null;
|
15667 |
|
15668 | if (context.method === "throw") {
|
15669 |
|
15670 | if (delegate.iterator["return"]) {
|
15671 |
|
15672 |
|
15673 | context.method = "return";
|
15674 | context.arg = undefined;
|
15675 | maybeInvokeDelegate(delegate, context);
|
15676 |
|
15677 | if (context.method === "throw") {
|
15678 |
|
15679 |
|
15680 | return ContinueSentinel;
|
15681 | }
|
15682 | }
|
15683 |
|
15684 | context.method = "throw";
|
15685 | context.arg = new TypeError(
|
15686 | "The iterator does not provide a 'throw' method");
|
15687 | }
|
15688 |
|
15689 | return ContinueSentinel;
|
15690 | }
|
15691 |
|
15692 | var record = tryCatch(method, delegate.iterator, context.arg);
|
15693 |
|
15694 | if (record.type === "throw") {
|
15695 | context.method = "throw";
|
15696 | context.arg = record.arg;
|
15697 | context.delegate = null;
|
15698 | return ContinueSentinel;
|
15699 | }
|
15700 |
|
15701 | var info = record.arg;
|
15702 |
|
15703 | if (! info) {
|
15704 | context.method = "throw";
|
15705 | context.arg = new TypeError("iterator result is not an object");
|
15706 | context.delegate = null;
|
15707 | return ContinueSentinel;
|
15708 | }
|
15709 |
|
15710 | if (info.done) {
|
15711 |
|
15712 |
|
15713 | context[delegate.resultName] = info.value;
|
15714 |
|
15715 |
|
15716 | context.next = delegate.nextLoc;
|
15717 |
|
15718 |
|
15719 |
|
15720 |
|
15721 |
|
15722 |
|
15723 |
|
15724 | if (context.method !== "return") {
|
15725 | context.method = "next";
|
15726 | context.arg = undefined;
|
15727 | }
|
15728 |
|
15729 | } else {
|
15730 |
|
15731 | return info;
|
15732 | }
|
15733 |
|
15734 |
|
15735 |
|
15736 | context.delegate = null;
|
15737 | return ContinueSentinel;
|
15738 | }
|
15739 |
|
15740 |
|
15741 |
|
15742 | defineIteratorMethods(Gp);
|
15743 |
|
15744 | Gp[toStringTagSymbol] = "Generator";
|
15745 |
|
15746 |
|
15747 |
|
15748 |
|
15749 |
|
15750 |
|
15751 | Gp[iteratorSymbol] = function() {
|
15752 | return this;
|
15753 | };
|
15754 |
|
15755 | Gp.toString = function() {
|
15756 | return "[object Generator]";
|
15757 | };
|
15758 |
|
15759 | function pushTryEntry(locs) {
|
15760 | var entry = { tryLoc: locs[0] };
|
15761 |
|
15762 | if (1 in locs) {
|
15763 | entry.catchLoc = locs[1];
|
15764 | }
|
15765 |
|
15766 | if (2 in locs) {
|
15767 | entry.finallyLoc = locs[2];
|
15768 | entry.afterLoc = locs[3];
|
15769 | }
|
15770 |
|
15771 | this.tryEntries.push(entry);
|
15772 | }
|
15773 |
|
15774 | function resetTryEntry(entry) {
|
15775 | var record = entry.completion || {};
|
15776 | record.type = "normal";
|
15777 | delete record.arg;
|
15778 | entry.completion = record;
|
15779 | }
|
15780 |
|
15781 | function Context(tryLocsList) {
|
15782 |
|
15783 |
|
15784 |
|
15785 | this.tryEntries = [{ tryLoc: "root" }];
|
15786 | tryLocsList.forEach(pushTryEntry, this);
|
15787 | this.reset(true);
|
15788 | }
|
15789 |
|
15790 | exports.keys = function(object) {
|
15791 | var keys = [];
|
15792 | for (var key in object) {
|
15793 | keys.push(key);
|
15794 | }
|
15795 | keys.reverse();
|
15796 |
|
15797 |
|
15798 |
|
15799 | return function next() {
|
15800 | while (keys.length) {
|
15801 | var key = keys.pop();
|
15802 | if (key in object) {
|
15803 | next.value = key;
|
15804 | next.done = false;
|
15805 | return next;
|
15806 | }
|
15807 | }
|
15808 |
|
15809 |
|
15810 |
|
15811 |
|
15812 | next.done = true;
|
15813 | return next;
|
15814 | };
|
15815 | };
|
15816 |
|
15817 | function values(iterable) {
|
15818 | if (iterable) {
|
15819 | var iteratorMethod = iterable[iteratorSymbol];
|
15820 | if (iteratorMethod) {
|
15821 | return iteratorMethod.call(iterable);
|
15822 | }
|
15823 |
|
15824 | if (typeof iterable.next === "function") {
|
15825 | return iterable;
|
15826 | }
|
15827 |
|
15828 | if (!isNaN(iterable.length)) {
|
15829 | var i = -1, next = function next() {
|
15830 | while (++i < iterable.length) {
|
15831 | if (hasOwn.call(iterable, i)) {
|
15832 | next.value = iterable[i];
|
15833 | next.done = false;
|
15834 | return next;
|
15835 | }
|
15836 | }
|
15837 |
|
15838 | next.value = undefined;
|
15839 | next.done = true;
|
15840 |
|
15841 | return next;
|
15842 | };
|
15843 |
|
15844 | return next.next = next;
|
15845 | }
|
15846 | }
|
15847 |
|
15848 |
|
15849 | return { next: doneResult };
|
15850 | }
|
15851 | exports.values = values;
|
15852 |
|
15853 | function doneResult() {
|
15854 | return { value: undefined, done: true };
|
15855 | }
|
15856 |
|
15857 | Context.prototype = {
|
15858 | constructor: Context,
|
15859 |
|
15860 | reset: function(skipTempReset) {
|
15861 | this.prev = 0;
|
15862 | this.next = 0;
|
15863 |
|
15864 |
|
15865 | this.sent = this._sent = undefined;
|
15866 | this.done = false;
|
15867 | this.delegate = null;
|
15868 |
|
15869 | this.method = "next";
|
15870 | this.arg = undefined;
|
15871 |
|
15872 | this.tryEntries.forEach(resetTryEntry);
|
15873 |
|
15874 | if (!skipTempReset) {
|
15875 | for (var name in this) {
|
15876 |
|
15877 | if (name.charAt(0) === "t" &&
|
15878 | hasOwn.call(this, name) &&
|
15879 | !isNaN(+name.slice(1))) {
|
15880 | this[name] = undefined;
|
15881 | }
|
15882 | }
|
15883 | }
|
15884 | },
|
15885 |
|
15886 | stop: function() {
|
15887 | this.done = true;
|
15888 |
|
15889 | var rootEntry = this.tryEntries[0];
|
15890 | var rootRecord = rootEntry.completion;
|
15891 | if (rootRecord.type === "throw") {
|
15892 | throw rootRecord.arg;
|
15893 | }
|
15894 |
|
15895 | return this.rval;
|
15896 | },
|
15897 |
|
15898 | dispatchException: function(exception) {
|
15899 | if (this.done) {
|
15900 | throw exception;
|
15901 | }
|
15902 |
|
15903 | var context = this;
|
15904 | function handle(loc, caught) {
|
15905 | record.type = "throw";
|
15906 | record.arg = exception;
|
15907 | context.next = loc;
|
15908 |
|
15909 | if (caught) {
|
15910 |
|
15911 |
|
15912 | context.method = "next";
|
15913 | context.arg = undefined;
|
15914 | }
|
15915 |
|
15916 | return !! caught;
|
15917 | }
|
15918 |
|
15919 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
15920 | var entry = this.tryEntries[i];
|
15921 | var record = entry.completion;
|
15922 |
|
15923 | if (entry.tryLoc === "root") {
|
15924 |
|
15925 |
|
15926 |
|
15927 | return handle("end");
|
15928 | }
|
15929 |
|
15930 | if (entry.tryLoc <= this.prev) {
|
15931 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
15932 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
15933 |
|
15934 | if (hasCatch && hasFinally) {
|
15935 | if (this.prev < entry.catchLoc) {
|
15936 | return handle(entry.catchLoc, true);
|
15937 | } else if (this.prev < entry.finallyLoc) {
|
15938 | return handle(entry.finallyLoc);
|
15939 | }
|
15940 |
|
15941 | } else if (hasCatch) {
|
15942 | if (this.prev < entry.catchLoc) {
|
15943 | return handle(entry.catchLoc, true);
|
15944 | }
|
15945 |
|
15946 | } else if (hasFinally) {
|
15947 | if (this.prev < entry.finallyLoc) {
|
15948 | return handle(entry.finallyLoc);
|
15949 | }
|
15950 |
|
15951 | } else {
|
15952 | throw new Error("try statement without catch or finally");
|
15953 | }
|
15954 | }
|
15955 | }
|
15956 | },
|
15957 |
|
15958 | abrupt: function(type, arg) {
|
15959 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
15960 | var entry = this.tryEntries[i];
|
15961 | if (entry.tryLoc <= this.prev &&
|
15962 | hasOwn.call(entry, "finallyLoc") &&
|
15963 | this.prev < entry.finallyLoc) {
|
15964 | var finallyEntry = entry;
|
15965 | break;
|
15966 | }
|
15967 | }
|
15968 |
|
15969 | if (finallyEntry &&
|
15970 | (type === "break" ||
|
15971 | type === "continue") &&
|
15972 | finallyEntry.tryLoc <= arg &&
|
15973 | arg <= finallyEntry.finallyLoc) {
|
15974 |
|
15975 |
|
15976 | finallyEntry = null;
|
15977 | }
|
15978 |
|
15979 | var record = finallyEntry ? finallyEntry.completion : {};
|
15980 | record.type = type;
|
15981 | record.arg = arg;
|
15982 |
|
15983 | if (finallyEntry) {
|
15984 | this.method = "next";
|
15985 | this.next = finallyEntry.finallyLoc;
|
15986 | return ContinueSentinel;
|
15987 | }
|
15988 |
|
15989 | return this.complete(record);
|
15990 | },
|
15991 |
|
15992 | complete: function(record, afterLoc) {
|
15993 | if (record.type === "throw") {
|
15994 | throw record.arg;
|
15995 | }
|
15996 |
|
15997 | if (record.type === "break" ||
|
15998 | record.type === "continue") {
|
15999 | this.next = record.arg;
|
16000 | } else if (record.type === "return") {
|
16001 | this.rval = this.arg = record.arg;
|
16002 | this.method = "return";
|
16003 | this.next = "end";
|
16004 | } else if (record.type === "normal" && afterLoc) {
|
16005 | this.next = afterLoc;
|
16006 | }
|
16007 |
|
16008 | return ContinueSentinel;
|
16009 | },
|
16010 |
|
16011 | finish: function(finallyLoc) {
|
16012 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
16013 | var entry = this.tryEntries[i];
|
16014 | if (entry.finallyLoc === finallyLoc) {
|
16015 | this.complete(entry.completion, entry.afterLoc);
|
16016 | resetTryEntry(entry);
|
16017 | return ContinueSentinel;
|
16018 | }
|
16019 | }
|
16020 | },
|
16021 |
|
16022 | "catch": function(tryLoc) {
|
16023 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
16024 | var entry = this.tryEntries[i];
|
16025 | if (entry.tryLoc === tryLoc) {
|
16026 | var record = entry.completion;
|
16027 | if (record.type === "throw") {
|
16028 | var thrown = record.arg;
|
16029 | resetTryEntry(entry);
|
16030 | }
|
16031 | return thrown;
|
16032 | }
|
16033 | }
|
16034 |
|
16035 |
|
16036 |
|
16037 | throw new Error("illegal catch attempt");
|
16038 | },
|
16039 |
|
16040 | delegateYield: function(iterable, resultName, nextLoc) {
|
16041 | this.delegate = {
|
16042 | iterator: values(iterable),
|
16043 | resultName: resultName,
|
16044 | nextLoc: nextLoc
|
16045 | };
|
16046 |
|
16047 | if (this.method === "next") {
|
16048 |
|
16049 |
|
16050 | this.arg = undefined;
|
16051 | }
|
16052 |
|
16053 | return ContinueSentinel;
|
16054 | }
|
16055 | };
|
16056 |
|
16057 |
|
16058 |
|
16059 |
|
16060 |
|
16061 | return exports;
|
16062 |
|
16063 | }(
|
16064 |
|
16065 |
|
16066 |
|
16067 |
|
16068 | true ? module.exports : undefined
|
16069 | ));
|
16070 |
|
16071 | try {
|
16072 | regeneratorRuntime = runtime;
|
16073 | } catch (accidentalStrictMode) {
|
16074 |
|
16075 |
|
16076 |
|
16077 |
|
16078 |
|
16079 |
|
16080 |
|
16081 |
|
16082 |
|
16083 | Function("r", "regeneratorRuntime = r")(runtime);
|
16084 | }
|
16085 |
|
16086 |
|
16087 | }),
|
16088 |
|
16089 | (function(module, exports, __webpack_require__) {
|
16090 |
|
16091 | __webpack_require__(56);
|
16092 | __webpack_require__(57);
|
16093 | module.exports = __webpack_require__(228);
|
16094 |
|
16095 |
|
16096 | }),
|
16097 |
|
16098 | (function(module, exports, __webpack_require__) {
|
16099 |
|
16100 | "use strict";
|
16101 |
|
16102 | var addToUnscopables = __webpack_require__(224);
|
16103 | var step = __webpack_require__(225);
|
16104 | var Iterators = __webpack_require__(41);
|
16105 | var toIObject = __webpack_require__(24);
|
16106 |
|
16107 |
|
16108 |
|
16109 |
|
16110 |
|
16111 | module.exports = __webpack_require__(137)(Array, 'Array', function (iterated, kind) {
|
16112 | this._t = toIObject(iterated);
|
16113 | this._i = 0;
|
16114 | this._k = kind;
|
16115 |
|
16116 | }, function () {
|
16117 | var O = this._t;
|
16118 | var kind = this._k;
|
16119 | var index = this._i++;
|
16120 | if (!O || index >= O.length) {
|
16121 | this._t = undefined;
|
16122 | return step(1);
|
16123 | }
|
16124 | if (kind == 'keys') return step(0, index);
|
16125 | if (kind == 'values') return step(0, O[index]);
|
16126 | return step(0, [index, O[index]]);
|
16127 | }, 'values');
|
16128 |
|
16129 |
|
16130 | Iterators.Arguments = Iterators.Array;
|
16131 |
|
16132 | addToUnscopables('keys');
|
16133 | addToUnscopables('values');
|
16134 | addToUnscopables('entries');
|
16135 |
|
16136 |
|
16137 | }),
|
16138 |
|
16139 | (function(module, exports) {
|
16140 |
|
16141 | module.exports = function () { };
|
16142 |
|
16143 |
|
16144 | }),
|
16145 |
|
16146 | (function(module, exports) {
|
16147 |
|
16148 | module.exports = function (done, value) {
|
16149 | return { value: value, done: !!done };
|
16150 | };
|
16151 |
|
16152 |
|
16153 | }),
|
16154 |
|
16155 | (function(module, exports, __webpack_require__) {
|
16156 |
|
16157 | "use strict";
|
16158 |
|
16159 | var create = __webpack_require__(67);
|
16160 | var descriptor = __webpack_require__(49);
|
16161 | var setToStringTag = __webpack_require__(54);
|
16162 | var IteratorPrototype = {};
|
16163 |
|
16164 |
|
16165 | __webpack_require__(27)(IteratorPrototype, __webpack_require__(11)('iterator'), function () { return this; });
|
16166 |
|
16167 | module.exports = function (Constructor, NAME, next) {
|
16168 | Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
16169 | setToStringTag(Constructor, NAME + ' Iterator');
|
16170 | };
|
16171 |
|
16172 |
|
16173 | }),
|
16174 |
|
16175 | (function(module, exports, __webpack_require__) {
|
16176 |
|
16177 | var toInteger = __webpack_require__(90);
|
16178 | var defined = __webpack_require__(89);
|
16179 |
|
16180 |
|
16181 | module.exports = function (TO_STRING) {
|
16182 | return function (that, pos) {
|
16183 | var s = String(defined(that));
|
16184 | var i = toInteger(pos);
|
16185 | var l = s.length;
|
16186 | var a, b;
|
16187 | if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
|
16188 | a = s.charCodeAt(i);
|
16189 | return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
|
16190 | ? TO_STRING ? s.charAt(i) : a
|
16191 | : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
|
16192 | };
|
16193 | };
|
16194 |
|
16195 |
|
16196 | }),
|
16197 |
|
16198 | (function(module, exports, __webpack_require__) {
|
16199 |
|
16200 | var anObject = __webpack_require__(12);
|
16201 | var get = __webpack_require__(103);
|
16202 | module.exports = __webpack_require__(5).getIterator = function (it) {
|
16203 | var iterFn = get(it);
|
16204 | if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
|
16205 | return anObject(iterFn.call(it));
|
16206 | };
|
16207 |
|
16208 |
|
16209 | /***/ }),
|
16210 | /* 229 */
|
16211 | /***/ (function(module, exports, __webpack_require__) {
|
16212 |
|
16213 | __webpack_require__(230);
|
16214 | module.exports = __webpack_require__(5).Array.isArray;
|
16215 |
|
16216 |
|
16217 | }),
|
16218 |
|
16219 | (function(module, exports, __webpack_require__) {
|
16220 |
|
16221 |
|
16222 | var $export = __webpack_require__(6);
|
16223 |
|
16224 | $export($export.S, 'Array', { isArray: __webpack_require__(99) });
|
16225 |
|
16226 |
|
16227 | }),
|
16228 |
|
16229 | (function(module, exports, __webpack_require__) {
|
16230 |
|
16231 | __webpack_require__(57);
|
16232 | __webpack_require__(56);
|
16233 | module.exports = __webpack_require__(97).f('iterator');
|
16234 |
|
16235 |
|
16236 | }),
|
16237 |
|
16238 | (function(module, exports, __webpack_require__) {
|
16239 |
|
16240 | __webpack_require__(125);
|
16241 | __webpack_require__(105);
|
16242 | __webpack_require__(233);
|
16243 | __webpack_require__(234);
|
16244 | module.exports = __webpack_require__(5).Symbol;
|
16245 |
|
16246 |
|
16247 | }),
|
16248 |
|
16249 | (function(module, exports, __webpack_require__) {
|
16250 |
|
16251 | __webpack_require__(98)('asyncIterator');
|
16252 |
|
16253 |
|
16254 | }),
|
16255 |
|
16256 | (function(module, exports, __webpack_require__) {
|
16257 |
|
16258 | __webpack_require__(98)('observable');
|
16259 |
|
16260 |
|
16261 | }),
|
16262 |
|
16263 | (function(module, exports, __webpack_require__) {
|
16264 |
|
16265 | __webpack_require__(57);
|
16266 | __webpack_require__(236);
|
16267 | module.exports = __webpack_require__(5).Array.from;
|
16268 |
|
16269 |
|
16270 | }),
|
16271 |
|
16272 | (function(module, exports, __webpack_require__) {
|
16273 |
|
16274 | "use strict";
|
16275 |
|
16276 | var ctx = __webpack_require__(26);
|
16277 | var $export = __webpack_require__(6);
|
16278 | var toObject = __webpack_require__(34);
|
16279 | var call = __webpack_require__(139);
|
16280 | var isArrayIter = __webpack_require__(140);
|
16281 | var toLength = __webpack_require__(63);
|
16282 | var createProperty = __webpack_require__(122);
|
16283 | var getIterFn = __webpack_require__(103);
|
16284 |
|
16285 | $export($export.S + $export.F * !__webpack_require__(141)(function (iter) { Array.from(iter); }), 'Array', {
|
16286 |
|
16287 | from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
16288 | var O = toObject(arrayLike);
|
16289 | var C = typeof this == 'function' ? this : Array;
|
16290 | var aLen = arguments.length;
|
16291 | var mapfn = aLen > 1 ? arguments[1] : undefined;
|
16292 | var mapping = mapfn !== undefined;
|
16293 | var index = 0;
|
16294 | var iterFn = getIterFn(O);
|
16295 | var length, result, step, iterator;
|
16296 | if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
|
16297 |
|
16298 | if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
|
16299 | for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
|
16300 | createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
|
16301 | }
|
16302 | } else {
|
16303 | length = toLength(O.length);
|
16304 | for (result = new C(length); length > index; index++) {
|
16305 | createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
|
16306 | }
|
16307 | }
|
16308 | result.length = index;
|
16309 | return result;
|
16310 | }
|
16311 | });
|
16312 |
|
16313 |
|
16314 | }),
|
16315 |
|
16316 | (function(module, exports, __webpack_require__) {
|
16317 |
|
16318 | __webpack_require__(238);
|
16319 | module.exports = __webpack_require__(5).Object.entries;
|
16320 |
|
16321 |
|
16322 | }),
|
16323 |
|
16324 | (function(module, exports, __webpack_require__) {
|
16325 |
|
16326 |
|
16327 | var $export = __webpack_require__(6);
|
16328 | var $entries = __webpack_require__(239)(true);
|
16329 |
|
16330 | $export($export.S, 'Object', {
|
16331 | entries: function entries(it) {
|
16332 | return $entries(it);
|
16333 | }
|
16334 | });
|
16335 |
|
16336 |
|
16337 | }),
|
16338 |
|
16339 | (function(module, exports, __webpack_require__) {
|
16340 |
|
16341 | var DESCRIPTORS = __webpack_require__(16);
|
16342 | var getKeys = __webpack_require__(40);
|
16343 | var toIObject = __webpack_require__(24);
|
16344 | var isEnum = __webpack_require__(53).f;
|
16345 | module.exports = function (isEntries) {
|
16346 | return function (it) {
|
16347 | var O = toIObject(it);
|
16348 | var keys = getKeys(O);
|
16349 | var length = keys.length;
|
16350 | var i = 0;
|
16351 | var result = [];
|
16352 | var key;
|
16353 | while (length > i) {
|
16354 | key = keys[i++];
|
16355 | if (!DESCRIPTORS || isEnum.call(O, key)) {
|
16356 | result.push(isEntries ? [key, O[key]] : O[key]);
|
16357 | }
|
16358 | }
|
16359 | return result;
|
16360 | };
|
16361 | };
|
16362 |
|
16363 |
|
16364 | }),
|
16365 |
|
16366 | (function(module, exports, __webpack_require__) {
|
16367 |
|
16368 | var core = __webpack_require__(5);
|
16369 | var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
|
16370 | module.exports = function stringify(it) {
|
16371 | return $JSON.stringify.apply($JSON, arguments);
|
16372 | };
|
16373 |
|
16374 |
|
16375 | }),
|
16376 |
|
16377 | (function(module, exports, __webpack_require__) {
|
16378 |
|
16379 | var _Array$isArray = __webpack_require__(0);
|
16380 |
|
16381 | function _arrayWithHoles(arr) {
|
16382 | if (_Array$isArray(arr)) return arr;
|
16383 | }
|
16384 |
|
16385 | module.exports = _arrayWithHoles;
|
16386 |
|
16387 | }),
|
16388 |
|
16389 | (function(module, exports, __webpack_require__) {
|
16390 |
|
16391 | var _getIterator = __webpack_require__(136);
|
16392 |
|
16393 | var _isIterable = __webpack_require__(143);
|
16394 |
|
16395 | var _Symbol = __webpack_require__(70);
|
16396 |
|
16397 | function _iterableToArrayLimit(arr, i) {
|
16398 | if (typeof _Symbol === "undefined" || !_isIterable(Object(arr))) return;
|
16399 | var _arr = [];
|
16400 | var _n = true;
|
16401 | var _d = false;
|
16402 | var _e = undefined;
|
16403 |
|
16404 | try {
|
16405 | for (var _i = _getIterator(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
16406 | _arr.push(_s.value);
|
16407 |
|
16408 | if (i && _arr.length === i) break;
|
16409 | }
|
16410 | } catch (err) {
|
16411 | _d = true;
|
16412 | _e = err;
|
16413 | } finally {
|
16414 | try {
|
16415 | if (!_n && _i["return"] != null) _i["return"]();
|
16416 | } finally {
|
16417 | if (_d) throw _e;
|
16418 | }
|
16419 | }
|
16420 |
|
16421 | return _arr;
|
16422 | }
|
16423 |
|
16424 | module.exports = _iterableToArrayLimit;
|
16425 |
|
16426 | }),
|
16427 |
|
16428 | (function(module, exports, __webpack_require__) {
|
16429 |
|
16430 | __webpack_require__(56);
|
16431 | __webpack_require__(57);
|
16432 | module.exports = __webpack_require__(244);
|
16433 |
|
16434 |
|
16435 | }),
|
16436 |
|
16437 | (function(module, exports, __webpack_require__) {
|
16438 |
|
16439 | var classof = __webpack_require__(104);
|
16440 | var ITERATOR = __webpack_require__(11)('iterator');
|
16441 | var Iterators = __webpack_require__(41);
|
16442 | module.exports = __webpack_require__(5).isIterable = function (it) {
|
16443 | var O = Object(it);
|
16444 | return O[ITERATOR] !== undefined
|
16445 | || '@@iterator' in O
|
16446 |
|
16447 | || Iterators.hasOwnProperty(classof(O));
|
16448 | };
|
16449 |
|
16450 |
|
16451 | }),
|
16452 |
|
16453 | (function(module, exports) {
|
16454 |
|
16455 | function _nonIterableRest() {
|
16456 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
16457 | }
|
16458 |
|
16459 | module.exports = _nonIterableRest;
|
16460 |
|
16461 | }),
|
16462 |
|
16463 | (function(module, exports, __webpack_require__) {
|
16464 |
|
16465 | __webpack_require__(105);
|
16466 | __webpack_require__(57);
|
16467 | __webpack_require__(56);
|
16468 | __webpack_require__(247);
|
16469 | __webpack_require__(251);
|
16470 | __webpack_require__(252);
|
16471 | module.exports = __webpack_require__(5).Promise;
|
16472 |
|
16473 |
|
16474 | }),
|
16475 |
|
16476 | (function(module, exports, __webpack_require__) {
|
16477 |
|
16478 | "use strict";
|
16479 |
|
16480 | var LIBRARY = __webpack_require__(51);
|
16481 | var global = __webpack_require__(7);
|
16482 | var ctx = __webpack_require__(26);
|
16483 | var classof = __webpack_require__(104);
|
16484 | var $export = __webpack_require__(6);
|
16485 | var isObject = __webpack_require__(9);
|
16486 | var aFunction = __webpack_require__(33);
|
16487 | var anInstance = __webpack_require__(107);
|
16488 | var forOf = __webpack_require__(71);
|
16489 | var speciesConstructor = __webpack_require__(144);
|
16490 | var task = __webpack_require__(145).set;
|
16491 | var microtask = __webpack_require__(248)();
|
16492 | var newPromiseCapabilityModule = __webpack_require__(108);
|
16493 | var perform = __webpack_require__(147);
|
16494 | var userAgent = __webpack_require__(249);
|
16495 | var promiseResolve = __webpack_require__(148);
|
16496 | var PROMISE = 'Promise';
|
16497 | var TypeError = global.TypeError;
|
16498 | var process = global.process;
|
16499 | var versions = process && process.versions;
|
16500 | var v8 = versions && versions.v8 || '';
|
16501 | var $Promise = global[PROMISE];
|
16502 | var isNode = classof(process) == 'process';
|
16503 | var empty = function () { };
|
16504 | var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
|
16505 | var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
|
16506 |
|
16507 | var USE_NATIVE = !!function () {
|
16508 | try {
|
16509 |
|
16510 | var promise = $Promise.resolve(1);
|
16511 | var FakePromise = (promise.constructor = {})[__webpack_require__(11)('species')] = function (exec) {
|
16512 | exec(empty, empty);
|
16513 | };
|
16514 |
|
16515 | return (isNode || typeof PromiseRejectionEvent == 'function')
|
16516 | && promise.then(empty) instanceof FakePromise
|
16517 |
|
16518 |
|
16519 |
|
16520 | && v8.indexOf('6.6') !== 0
|
16521 | && userAgent.indexOf('Chrome/66') === -1;
|
16522 | } catch (e) { }
|
16523 | }();
|
16524 |
|
16525 |
|
16526 | var isThenable = function (it) {
|
16527 | var then;
|
16528 | return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
16529 | };
|
16530 | var notify = function (promise, isReject) {
|
16531 | if (promise._n) return;
|
16532 | promise._n = true;
|
16533 | var chain = promise._c;
|
16534 | microtask(function () {
|
16535 | var value = promise._v;
|
16536 | var ok = promise._s == 1;
|
16537 | var i = 0;
|
16538 | var run = function (reaction) {
|
16539 | var handler = ok ? reaction.ok : reaction.fail;
|
16540 | var resolve = reaction.resolve;
|
16541 | var reject = reaction.reject;
|
16542 | var domain = reaction.domain;
|
16543 | var result, then, exited;
|
16544 | try {
|
16545 | if (handler) {
|
16546 | if (!ok) {
|
16547 | if (promise._h == 2) onHandleUnhandled(promise);
|
16548 | promise._h = 1;
|
16549 | }
|
16550 | if (handler === true) result = value;
|
16551 | else {
|
16552 | if (domain) domain.enter();
|
16553 | result = handler(value);
|
16554 | if (domain) {
|
16555 | domain.exit();
|
16556 | exited = true;
|
16557 | }
|
16558 | }
|
16559 | if (result === reaction.promise) {
|
16560 | reject(TypeError('Promise-chain cycle'));
|
16561 | } else if (then = isThenable(result)) {
|
16562 | then.call(result, resolve, reject);
|
16563 | } else resolve(result);
|
16564 | } else reject(value);
|
16565 | } catch (e) {
|
16566 | if (domain && !exited) domain.exit();
|
16567 | reject(e);
|
16568 | }
|
16569 | };
|
16570 | while (chain.length > i) run(chain[i++]);
|
16571 | promise._c = [];
|
16572 | promise._n = false;
|
16573 | if (isReject && !promise._h) onUnhandled(promise);
|
16574 | });
|
16575 | };
|
16576 | var onUnhandled = function (promise) {
|
16577 | task.call(global, function () {
|
16578 | var value = promise._v;
|
16579 | var unhandled = isUnhandled(promise);
|
16580 | var result, handler, console;
|
16581 | if (unhandled) {
|
16582 | result = perform(function () {
|
16583 | if (isNode) {
|
16584 | process.emit('unhandledRejection', value, promise);
|
16585 | } else if (handler = global.onunhandledrejection) {
|
16586 | handler({ promise: promise, reason: value });
|
16587 | } else if ((console = global.console) && console.error) {
|
16588 | console.error('Unhandled promise rejection', value);
|
16589 | }
|
16590 | });
|
16591 |
|
16592 | promise._h = isNode || isUnhandled(promise) ? 2 : 1;
|
16593 | } promise._a = undefined;
|
16594 | if (unhandled && result.e) throw result.v;
|
16595 | });
|
16596 | };
|
16597 | var isUnhandled = function (promise) {
|
16598 | return promise._h !== 1 && (promise._a || promise._c).length === 0;
|
16599 | };
|
16600 | var onHandleUnhandled = function (promise) {
|
16601 | task.call(global, function () {
|
16602 | var handler;
|
16603 | if (isNode) {
|
16604 | process.emit('rejectionHandled', promise);
|
16605 | } else if (handler = global.onrejectionhandled) {
|
16606 | handler({ promise: promise, reason: promise._v });
|
16607 | }
|
16608 | });
|
16609 | };
|
16610 | var $reject = function (value) {
|
16611 | var promise = this;
|
16612 | if (promise._d) return;
|
16613 | promise._d = true;
|
16614 | promise = promise._w || promise;
|
16615 | promise._v = value;
|
16616 | promise._s = 2;
|
16617 | if (!promise._a) promise._a = promise._c.slice();
|
16618 | notify(promise, true);
|
16619 | };
|
16620 | var $resolve = function (value) {
|
16621 | var promise = this;
|
16622 | var then;
|
16623 | if (promise._d) return;
|
16624 | promise._d = true;
|
16625 | promise = promise._w || promise;
|
16626 | try {
|
16627 | if (promise === value) throw TypeError("Promise can't be resolved itself");
|
16628 | if (then = isThenable(value)) {
|
16629 | microtask(function () {
|
16630 | var wrapper = { _w: promise, _d: false };
|
16631 | try {
|
16632 | then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
|
16633 | } catch (e) {
|
16634 | $reject.call(wrapper, e);
|
16635 | }
|
16636 | });
|
16637 | } else {
|
16638 | promise._v = value;
|
16639 | promise._s = 1;
|
16640 | notify(promise, false);
|
16641 | }
|
16642 | } catch (e) {
|
16643 | $reject.call({ _w: promise, _d: false }, e);
|
16644 | }
|
16645 | };
|
16646 |
|
16647 |
|
16648 | if (!USE_NATIVE) {
|
16649 |
|
16650 | $Promise = function Promise(executor) {
|
16651 | anInstance(this, $Promise, PROMISE, '_h');
|
16652 | aFunction(executor);
|
16653 | Internal.call(this);
|
16654 | try {
|
16655 | executor(ctx($resolve, this, 1), ctx($reject, this, 1));
|
16656 | } catch (err) {
|
16657 | $reject.call(this, err);
|
16658 | }
|
16659 | };
|
16660 |
|
16661 | Internal = function Promise(executor) {
|
16662 | this._c = [];
|
16663 | this._a = undefined;
|
16664 | this._s = 0;
|
16665 | this._d = false;
|
16666 | this._v = undefined;
|
16667 | this._h = 0;
|
16668 | this._n = false;
|
16669 | };
|
16670 | Internal.prototype = __webpack_require__(109)($Promise.prototype, {
|
16671 |
|
16672 | then: function then(onFulfilled, onRejected) {
|
16673 | var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
|
16674 | reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
16675 | reaction.fail = typeof onRejected == 'function' && onRejected;
|
16676 | reaction.domain = isNode ? process.domain : undefined;
|
16677 | this._c.push(reaction);
|
16678 | if (this._a) this._a.push(reaction);
|
16679 | if (this._s) notify(this, false);
|
16680 | return reaction.promise;
|
16681 | },
|
16682 |
|
16683 | 'catch': function (onRejected) {
|
16684 | return this.then(undefined, onRejected);
|
16685 | }
|
16686 | });
|
16687 | OwnPromiseCapability = function () {
|
16688 | var promise = new Internal();
|
16689 | this.promise = promise;
|
16690 | this.resolve = ctx($resolve, promise, 1);
|
16691 | this.reject = ctx($reject, promise, 1);
|
16692 | };
|
16693 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
16694 | return C === $Promise || C === Wrapper
|
16695 | ? new OwnPromiseCapability(C)
|
16696 | : newGenericPromiseCapability(C);
|
16697 | };
|
16698 | }
|
16699 |
|
16700 | $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
|
16701 | __webpack_require__(54)($Promise, PROMISE);
|
16702 | __webpack_require__(250)(PROMISE);
|
16703 | Wrapper = __webpack_require__(5)[PROMISE];
|
16704 |
|
16705 |
|
16706 | $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
|
16707 |
|
16708 | reject: function reject(r) {
|
16709 | var capability = newPromiseCapability(this);
|
16710 | var $$reject = capability.reject;
|
16711 | $$reject(r);
|
16712 | return capability.promise;
|
16713 | }
|
16714 | });
|
16715 | $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
|
16716 |
|
16717 | resolve: function resolve(x) {
|
16718 | return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
|
16719 | }
|
16720 | });
|
16721 | $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(141)(function (iter) {
|
16722 | $Promise.all(iter)['catch'](empty);
|
16723 | })), PROMISE, {
|
16724 |
|
16725 | all: function all(iterable) {
|
16726 | var C = this;
|
16727 | var capability = newPromiseCapability(C);
|
16728 | var resolve = capability.resolve;
|
16729 | var reject = capability.reject;
|
16730 | var result = perform(function () {
|
16731 | var values = [];
|
16732 | var index = 0;
|
16733 | var remaining = 1;
|
16734 | forOf(iterable, false, function (promise) {
|
16735 | var $index = index++;
|
16736 | var alreadyCalled = false;
|
16737 | values.push(undefined);
|
16738 | remaining++;
|
16739 | C.resolve(promise).then(function (value) {
|
16740 | if (alreadyCalled) return;
|
16741 | alreadyCalled = true;
|
16742 | values[$index] = value;
|
16743 | --remaining || resolve(values);
|
16744 | }, reject);
|
16745 | });
|
16746 | --remaining || resolve(values);
|
16747 | });
|
16748 | if (result.e) reject(result.v);
|
16749 | return capability.promise;
|
16750 | },
|
16751 |
|
16752 | race: function race(iterable) {
|
16753 | var C = this;
|
16754 | var capability = newPromiseCapability(C);
|
16755 | var reject = capability.reject;
|
16756 | var result = perform(function () {
|
16757 | forOf(iterable, false, function (promise) {
|
16758 | C.resolve(promise).then(capability.resolve, reject);
|
16759 | });
|
16760 | });
|
16761 | if (result.e) reject(result.v);
|
16762 | return capability.promise;
|
16763 | }
|
16764 | });
|
16765 |
|
16766 |
|
16767 | }),
|
16768 |
|
16769 | (function(module, exports, __webpack_require__) {
|
16770 |
|
16771 | var global = __webpack_require__(7);
|
16772 | var macrotask = __webpack_require__(145).set;
|
16773 | var Observer = global.MutationObserver || global.WebKitMutationObserver;
|
16774 | var process = global.process;
|
16775 | var Promise = global.Promise;
|
16776 | var isNode = __webpack_require__(50)(process) == 'process';
|
16777 |
|
16778 | module.exports = function () {
|
16779 | var head, last, notify;
|
16780 |
|
16781 | var flush = function () {
|
16782 | var parent, fn;
|
16783 | if (isNode && (parent = process.domain)) parent.exit();
|
16784 | while (head) {
|
16785 | fn = head.fn;
|
16786 | head = head.next;
|
16787 | try {
|
16788 | fn();
|
16789 | } catch (e) {
|
16790 | if (head) notify();
|
16791 | else last = undefined;
|
16792 | throw e;
|
16793 | }
|
16794 | } last = undefined;
|
16795 | if (parent) parent.enter();
|
16796 | };
|
16797 |
|
16798 |
|
16799 | if (isNode) {
|
16800 | notify = function () {
|
16801 | process.nextTick(flush);
|
16802 | };
|
16803 |
|
16804 | } else if (Observer && !(global.navigator && global.navigator.standalone)) {
|
16805 | var toggle = true;
|
16806 | var node = document.createTextNode('');
|
16807 | new Observer(flush).observe(node, { characterData: true });
|
16808 | notify = function () {
|
16809 | node.data = toggle = !toggle;
|
16810 | };
|
16811 |
|
16812 | } else if (Promise && Promise.resolve) {
|
16813 |
|
16814 | var promise = Promise.resolve(undefined);
|
16815 | notify = function () {
|
16816 | promise.then(flush);
|
16817 | };
|
16818 |
|
16819 |
|
16820 |
|
16821 |
|
16822 |
|
16823 |
|
16824 | } else {
|
16825 | notify = function () {
|
16826 |
|
16827 | macrotask.call(global, flush);
|
16828 | };
|
16829 | }
|
16830 |
|
16831 | return function (fn) {
|
16832 | var task = { fn: fn, next: undefined };
|
16833 | if (last) last.next = task;
|
16834 | if (!head) {
|
16835 | head = task;
|
16836 | notify();
|
16837 | } last = task;
|
16838 | };
|
16839 | };
|
16840 |
|
16841 |
|
16842 | }),
|
16843 |
|
16844 | (function(module, exports, __webpack_require__) {
|
16845 |
|
16846 | var global = __webpack_require__(7);
|
16847 | var navigator = global.navigator;
|
16848 |
|
16849 | module.exports = navigator && navigator.userAgent || '';
|
16850 |
|
16851 |
|
16852 | }),
|
16853 |
|
16854 | (function(module, exports, __webpack_require__) {
|
16855 |
|
16856 | "use strict";
|
16857 |
|
16858 | var global = __webpack_require__(7);
|
16859 | var core = __webpack_require__(5);
|
16860 | var dP = __webpack_require__(19);
|
16861 | var DESCRIPTORS = __webpack_require__(16);
|
16862 | var SPECIES = __webpack_require__(11)('species');
|
16863 |
|
16864 | module.exports = function (KEY) {
|
16865 | var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
|
16866 | if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
|
16867 | configurable: true,
|
16868 | get: function () { return this; }
|
16869 | });
|
16870 | };
|
16871 |
|
16872 |
|
16873 | }),
|
16874 |
|
16875 | (function(module, exports, __webpack_require__) {
|
16876 |
|
16877 | "use strict";
|
16878 |
|
16879 |
|
16880 | var $export = __webpack_require__(6);
|
16881 | var core = __webpack_require__(5);
|
16882 | var global = __webpack_require__(7);
|
16883 | var speciesConstructor = __webpack_require__(144);
|
16884 | var promiseResolve = __webpack_require__(148);
|
16885 |
|
16886 | $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
|
16887 | var C = speciesConstructor(this, core.Promise || global.Promise);
|
16888 | var isFunction = typeof onFinally == 'function';
|
16889 | return this.then(
|
16890 | isFunction ? function (x) {
|
16891 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
16892 | } : onFinally,
|
16893 | isFunction ? function (e) {
|
16894 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
16895 | } : onFinally
|
16896 | );
|
16897 | } });
|
16898 |
|
16899 |
|
16900 | }),
|
16901 |
|
16902 | (function(module, exports, __webpack_require__) {
|
16903 |
|
16904 | "use strict";
|
16905 |
|
16906 |
|
16907 | var $export = __webpack_require__(6);
|
16908 | var newPromiseCapability = __webpack_require__(108);
|
16909 | var perform = __webpack_require__(147);
|
16910 |
|
16911 | $export($export.S, 'Promise', { 'try': function (callbackfn) {
|
16912 | var promiseCapability = newPromiseCapability.f(this);
|
16913 | var result = perform(callbackfn);
|
16914 | (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
|
16915 | return promiseCapability.promise;
|
16916 | } });
|
16917 |
|
16918 |
|
16919 | }),
|
16920 |
|
16921 | (function(module, exports) {
|
16922 |
|
16923 | (function(self) {
|
16924 |
|
16925 | var irrelevant = (function (exports) {
|
16926 | var support = {
|
16927 | searchParams: 'URLSearchParams' in self,
|
16928 | iterable: 'Symbol' in self && 'iterator' in Symbol,
|
16929 | blob:
|
16930 | 'FileReader' in self &&
|
16931 | 'Blob' in self &&
|
16932 | (function() {
|
16933 | try {
|
16934 | new Blob();
|
16935 | return true
|
16936 | } catch (e) {
|
16937 | return false
|
16938 | }
|
16939 | })(),
|
16940 | formData: 'FormData' in self,
|
16941 | arrayBuffer: 'ArrayBuffer' in self
|
16942 | };
|
16943 |
|
16944 | function isDataView(obj) {
|
16945 | return obj && DataView.prototype.isPrototypeOf(obj)
|
16946 | }
|
16947 |
|
16948 | if (support.arrayBuffer) {
|
16949 | var viewClasses = [
|
16950 | '[object Int8Array]',
|
16951 | '[object Uint8Array]',
|
16952 | '[object Uint8ClampedArray]',
|
16953 | '[object Int16Array]',
|
16954 | '[object Uint16Array]',
|
16955 | '[object Int32Array]',
|
16956 | '[object Uint32Array]',
|
16957 | '[object Float32Array]',
|
16958 | '[object Float64Array]'
|
16959 | ];
|
16960 |
|
16961 | var isArrayBufferView =
|
16962 | ArrayBuffer.isView ||
|
16963 | function(obj) {
|
16964 | return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
16965 | };
|
16966 | }
|
16967 |
|
16968 | function normalizeName(name) {
|
16969 | if (typeof name !== 'string') {
|
16970 | name = String(name);
|
16971 | }
|
16972 | if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
16973 | throw new TypeError('Invalid character in header field name')
|
16974 | }
|
16975 | return name.toLowerCase()
|
16976 | }
|
16977 |
|
16978 | function normalizeValue(value) {
|
16979 | if (typeof value !== 'string') {
|
16980 | value = String(value);
|
16981 | }
|
16982 | return value
|
16983 | }
|
16984 |
|
16985 |
|
16986 | function iteratorFor(items) {
|
16987 | var iterator = {
|
16988 | next: function() {
|
16989 | var value = items.shift();
|
16990 | return {done: value === undefined, value: value}
|
16991 | }
|
16992 | };
|
16993 |
|
16994 | if (support.iterable) {
|
16995 | iterator[Symbol.iterator] = function() {
|
16996 | return iterator
|
16997 | };
|
16998 | }
|
16999 |
|
17000 | return iterator
|
17001 | }
|
17002 |
|
17003 | function Headers(headers) {
|
17004 | this.map = {};
|
17005 |
|
17006 | if (headers instanceof Headers) {
|
17007 | headers.forEach(function(value, name) {
|
17008 | this.append(name, value);
|
17009 | }, this);
|
17010 | } else if (Array.isArray(headers)) {
|
17011 | headers.forEach(function(header) {
|
17012 | this.append(header[0], header[1]);
|
17013 | }, this);
|
17014 | } else if (headers) {
|
17015 | Object.getOwnPropertyNames(headers).forEach(function(name) {
|
17016 | this.append(name, headers[name]);
|
17017 | }, this);
|
17018 | }
|
17019 | }
|
17020 |
|
17021 | Headers.prototype.append = function(name, value) {
|
17022 | name = normalizeName(name);
|
17023 | value = normalizeValue(value);
|
17024 | var oldValue = this.map[name];
|
17025 | this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
17026 | };
|
17027 |
|
17028 | Headers.prototype['delete'] = function(name) {
|
17029 | delete this.map[normalizeName(name)];
|
17030 | };
|
17031 |
|
17032 | Headers.prototype.get = function(name) {
|
17033 | name = normalizeName(name);
|
17034 | return this.has(name) ? this.map[name] : null
|
17035 | };
|
17036 |
|
17037 | Headers.prototype.has = function(name) {
|
17038 | return this.map.hasOwnProperty(normalizeName(name))
|
17039 | };
|
17040 |
|
17041 | Headers.prototype.set = function(name, value) {
|
17042 | this.map[normalizeName(name)] = normalizeValue(value);
|
17043 | };
|
17044 |
|
17045 | Headers.prototype.forEach = function(callback, thisArg) {
|
17046 | for (var name in this.map) {
|
17047 | if (this.map.hasOwnProperty(name)) {
|
17048 | callback.call(thisArg, this.map[name], name, this);
|
17049 | }
|
17050 | }
|
17051 | };
|
17052 |
|
17053 | Headers.prototype.keys = function() {
|
17054 | var items = [];
|
17055 | this.forEach(function(value, name) {
|
17056 | items.push(name);
|
17057 | });
|
17058 | return iteratorFor(items)
|
17059 | };
|
17060 |
|
17061 | Headers.prototype.values = function() {
|
17062 | var items = [];
|
17063 | this.forEach(function(value) {
|
17064 | items.push(value);
|
17065 | });
|
17066 | return iteratorFor(items)
|
17067 | };
|
17068 |
|
17069 | Headers.prototype.entries = function() {
|
17070 | var items = [];
|
17071 | this.forEach(function(value, name) {
|
17072 | items.push([name, value]);
|
17073 | });
|
17074 | return iteratorFor(items)
|
17075 | };
|
17076 |
|
17077 | if (support.iterable) {
|
17078 | Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
17079 | }
|
17080 |
|
17081 | function consumed(body) {
|
17082 | if (body.bodyUsed) {
|
17083 | return Promise.reject(new TypeError('Already read'))
|
17084 | }
|
17085 | body.bodyUsed = true;
|
17086 | }
|
17087 |
|
17088 | function fileReaderReady(reader) {
|
17089 | return new Promise(function(resolve, reject) {
|
17090 | reader.onload = function() {
|
17091 | resolve(reader.result);
|
17092 | };
|
17093 | reader.onerror = function() {
|
17094 | reject(reader.error);
|
17095 | };
|
17096 | })
|
17097 | }
|
17098 |
|
17099 | function readBlobAsArrayBuffer(blob) {
|
17100 | var reader = new FileReader();
|
17101 | var promise = fileReaderReady(reader);
|
17102 | reader.readAsArrayBuffer(blob);
|
17103 | return promise
|
17104 | }
|
17105 |
|
17106 | function readBlobAsText(blob) {
|
17107 | var reader = new FileReader();
|
17108 | var promise = fileReaderReady(reader);
|
17109 | reader.readAsText(blob);
|
17110 | return promise
|
17111 | }
|
17112 |
|
17113 | function readArrayBufferAsText(buf) {
|
17114 | var view = new Uint8Array(buf);
|
17115 | var chars = new Array(view.length);
|
17116 |
|
17117 | for (var i = 0; i < view.length; i++) {
|
17118 | chars[i] = String.fromCharCode(view[i]);
|
17119 | }
|
17120 | return chars.join('')
|
17121 | }
|
17122 |
|
17123 | function bufferClone(buf) {
|
17124 | if (buf.slice) {
|
17125 | return buf.slice(0)
|
17126 | } else {
|
17127 | var view = new Uint8Array(buf.byteLength);
|
17128 | view.set(new Uint8Array(buf));
|
17129 | return view.buffer
|
17130 | }
|
17131 | }
|
17132 |
|
17133 | function Body() {
|
17134 | this.bodyUsed = false;
|
17135 |
|
17136 | this._initBody = function(body) {
|
17137 | this._bodyInit = body;
|
17138 | if (!body) {
|
17139 | this._bodyText = '';
|
17140 | } else if (typeof body === 'string') {
|
17141 | this._bodyText = body;
|
17142 | } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
17143 | this._bodyBlob = body;
|
17144 | } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
17145 | this._bodyFormData = body;
|
17146 | } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
17147 | this._bodyText = body.toString();
|
17148 | } else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
17149 | this._bodyArrayBuffer = bufferClone(body.buffer);
|
17150 |
|
17151 | this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
17152 | } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
17153 | this._bodyArrayBuffer = bufferClone(body);
|
17154 | } else {
|
17155 | this._bodyText = body = Object.prototype.toString.call(body);
|
17156 | }
|
17157 |
|
17158 | if (!this.headers.get('content-type')) {
|
17159 | if (typeof body === 'string') {
|
17160 | this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
17161 | } else if (this._bodyBlob && this._bodyBlob.type) {
|
17162 | this.headers.set('content-type', this._bodyBlob.type);
|
17163 | } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
17164 | this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
17165 | }
|
17166 | }
|
17167 | };
|
17168 |
|
17169 | if (support.blob) {
|
17170 | this.blob = function() {
|
17171 | var rejected = consumed(this);
|
17172 | if (rejected) {
|
17173 | return rejected
|
17174 | }
|
17175 |
|
17176 | if (this._bodyBlob) {
|
17177 | return Promise.resolve(this._bodyBlob)
|
17178 | } else if (this._bodyArrayBuffer) {
|
17179 | return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
17180 | } else if (this._bodyFormData) {
|
17181 | throw new Error('could not read FormData body as blob')
|
17182 | } else {
|
17183 | return Promise.resolve(new Blob([this._bodyText]))
|
17184 | }
|
17185 | };
|
17186 |
|
17187 | this.arrayBuffer = function() {
|
17188 | if (this._bodyArrayBuffer) {
|
17189 | return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
17190 | } else {
|
17191 | return this.blob().then(readBlobAsArrayBuffer)
|
17192 | }
|
17193 | };
|
17194 | }
|
17195 |
|
17196 | this.text = function() {
|
17197 | var rejected = consumed(this);
|
17198 | if (rejected) {
|
17199 | return rejected
|
17200 | }
|
17201 |
|
17202 | if (this._bodyBlob) {
|
17203 | return readBlobAsText(this._bodyBlob)
|
17204 | } else if (this._bodyArrayBuffer) {
|
17205 | return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
17206 | } else if (this._bodyFormData) {
|
17207 | throw new Error('could not read FormData body as text')
|
17208 | } else {
|
17209 | return Promise.resolve(this._bodyText)
|
17210 | }
|
17211 | };
|
17212 |
|
17213 | if (support.formData) {
|
17214 | this.formData = function() {
|
17215 | return this.text().then(decode)
|
17216 | };
|
17217 | }
|
17218 |
|
17219 | this.json = function() {
|
17220 | return this.text().then(JSON.parse)
|
17221 | };
|
17222 |
|
17223 | return this
|
17224 | }
|
17225 |
|
17226 |
|
17227 | var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
17228 |
|
17229 | function normalizeMethod(method) {
|
17230 | var upcased = method.toUpperCase();
|
17231 | return methods.indexOf(upcased) > -1 ? upcased : method
|
17232 | }
|
17233 |
|
17234 | function Request(input, options) {
|
17235 | options = options || {};
|
17236 | var body = options.body;
|
17237 |
|
17238 | if (input instanceof Request) {
|
17239 | if (input.bodyUsed) {
|
17240 | throw new TypeError('Already read')
|
17241 | }
|
17242 | this.url = input.url;
|
17243 | this.credentials = input.credentials;
|
17244 | if (!options.headers) {
|
17245 | this.headers = new Headers(input.headers);
|
17246 | }
|
17247 | this.method = input.method;
|
17248 | this.mode = input.mode;
|
17249 | this.signal = input.signal;
|
17250 | if (!body && input._bodyInit != null) {
|
17251 | body = input._bodyInit;
|
17252 | input.bodyUsed = true;
|
17253 | }
|
17254 | } else {
|
17255 | this.url = String(input);
|
17256 | }
|
17257 |
|
17258 | this.credentials = options.credentials || this.credentials || 'same-origin';
|
17259 | if (options.headers || !this.headers) {
|
17260 | this.headers = new Headers(options.headers);
|
17261 | }
|
17262 | this.method = normalizeMethod(options.method || this.method || 'GET');
|
17263 | this.mode = options.mode || this.mode || null;
|
17264 | this.signal = options.signal || this.signal;
|
17265 | this.referrer = null;
|
17266 |
|
17267 | if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
17268 | throw new TypeError('Body not allowed for GET or HEAD requests')
|
17269 | }
|
17270 | this._initBody(body);
|
17271 | }
|
17272 |
|
17273 | Request.prototype.clone = function() {
|
17274 | return new Request(this, {body: this._bodyInit})
|
17275 | };
|
17276 |
|
17277 | function decode(body) {
|
17278 | var form = new FormData();
|
17279 | body
|
17280 | .trim()
|
17281 | .split('&')
|
17282 | .forEach(function(bytes) {
|
17283 | if (bytes) {
|
17284 | var split = bytes.split('=');
|
17285 | var name = split.shift().replace(/\+/g, ' ');
|
17286 | var value = split.join('=').replace(/\+/g, ' ');
|
17287 | form.append(decodeURIComponent(name), decodeURIComponent(value));
|
17288 | }
|
17289 | });
|
17290 | return form
|
17291 | }
|
17292 |
|
17293 | function parseHeaders(rawHeaders) {
|
17294 | var headers = new Headers();
|
17295 |
|
17296 |
|
17297 | var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
17298 | preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
|
17299 | var parts = line.split(':');
|
17300 | var key = parts.shift().trim();
|
17301 | if (key) {
|
17302 | var value = parts.join(':').trim();
|
17303 | headers.append(key, value);
|
17304 | }
|
17305 | });
|
17306 | return headers
|
17307 | }
|
17308 |
|
17309 | Body.call(Request.prototype);
|
17310 |
|
17311 | function Response(bodyInit, options) {
|
17312 | if (!options) {
|
17313 | options = {};
|
17314 | }
|
17315 |
|
17316 | this.type = 'default';
|
17317 | this.status = options.status === undefined ? 200 : options.status;
|
17318 | this.ok = this.status >= 200 && this.status < 300;
|
17319 | this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
17320 | this.headers = new Headers(options.headers);
|
17321 | this.url = options.url || '';
|
17322 | this._initBody(bodyInit);
|
17323 | }
|
17324 |
|
17325 | Body.call(Response.prototype);
|
17326 |
|
17327 | Response.prototype.clone = function() {
|
17328 | return new Response(this._bodyInit, {
|
17329 | status: this.status,
|
17330 | statusText: this.statusText,
|
17331 | headers: new Headers(this.headers),
|
17332 | url: this.url
|
17333 | })
|
17334 | };
|
17335 |
|
17336 | Response.error = function() {
|
17337 | var response = new Response(null, {status: 0, statusText: ''});
|
17338 | response.type = 'error';
|
17339 | return response
|
17340 | };
|
17341 |
|
17342 | var redirectStatuses = [301, 302, 303, 307, 308];
|
17343 |
|
17344 | Response.redirect = function(url, status) {
|
17345 | if (redirectStatuses.indexOf(status) === -1) {
|
17346 | throw new RangeError('Invalid status code')
|
17347 | }
|
17348 |
|
17349 | return new Response(null, {status: status, headers: {location: url}})
|
17350 | };
|
17351 |
|
17352 | exports.DOMException = self.DOMException;
|
17353 | try {
|
17354 | new exports.DOMException();
|
17355 | } catch (err) {
|
17356 | exports.DOMException = function(message, name) {
|
17357 | this.message = message;
|
17358 | this.name = name;
|
17359 | var error = Error(message);
|
17360 | this.stack = error.stack;
|
17361 | };
|
17362 | exports.DOMException.prototype = Object.create(Error.prototype);
|
17363 | exports.DOMException.prototype.constructor = exports.DOMException;
|
17364 | }
|
17365 |
|
17366 | function fetch(input, init) {
|
17367 | return new Promise(function(resolve, reject) {
|
17368 | var request = new Request(input, init);
|
17369 |
|
17370 | if (request.signal && request.signal.aborted) {
|
17371 | return reject(new exports.DOMException('Aborted', 'AbortError'))
|
17372 | }
|
17373 |
|
17374 | var xhr = new XMLHttpRequest();
|
17375 |
|
17376 | function abortXhr() {
|
17377 | xhr.abort();
|
17378 | }
|
17379 |
|
17380 | xhr.onload = function() {
|
17381 | var options = {
|
17382 | status: xhr.status,
|
17383 | statusText: xhr.statusText,
|
17384 | headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
17385 | };
|
17386 | options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
17387 | var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
17388 | resolve(new Response(body, options));
|
17389 | };
|
17390 |
|
17391 | xhr.onerror = function() {
|
17392 | reject(new TypeError('Network request failed'));
|
17393 | };
|
17394 |
|
17395 | xhr.ontimeout = function() {
|
17396 | reject(new TypeError('Network request failed'));
|
17397 | };
|
17398 |
|
17399 | xhr.onabort = function() {
|
17400 | reject(new exports.DOMException('Aborted', 'AbortError'));
|
17401 | };
|
17402 |
|
17403 | xhr.open(request.method, request.url, true);
|
17404 |
|
17405 | if (request.credentials === 'include') {
|
17406 | xhr.withCredentials = true;
|
17407 | } else if (request.credentials === 'omit') {
|
17408 | xhr.withCredentials = false;
|
17409 | }
|
17410 |
|
17411 | if ('responseType' in xhr && support.blob) {
|
17412 | xhr.responseType = 'blob';
|
17413 | }
|
17414 |
|
17415 | request.headers.forEach(function(value, name) {
|
17416 | xhr.setRequestHeader(name, value);
|
17417 | });
|
17418 |
|
17419 | if (request.signal) {
|
17420 | request.signal.addEventListener('abort', abortXhr);
|
17421 |
|
17422 | xhr.onreadystatechange = function() {
|
17423 |
|
17424 | if (xhr.readyState === 4) {
|
17425 | request.signal.removeEventListener('abort', abortXhr);
|
17426 | }
|
17427 | };
|
17428 | }
|
17429 |
|
17430 | xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
17431 | })
|
17432 | }
|
17433 |
|
17434 | fetch.polyfill = true;
|
17435 |
|
17436 | if (!self.fetch) {
|
17437 | self.fetch = fetch;
|
17438 | self.Headers = Headers;
|
17439 | self.Request = Request;
|
17440 | self.Response = Response;
|
17441 | }
|
17442 |
|
17443 | exports.Headers = Headers;
|
17444 | exports.Request = Request;
|
17445 | exports.Response = Response;
|
17446 | exports.fetch = fetch;
|
17447 |
|
17448 | return exports;
|
17449 |
|
17450 | }({}));
|
17451 | })(typeof self !== 'undefined' ? self : this);
|
17452 |
|
17453 |
|
17454 | }),
|
17455 |
|
17456 | (function(module, exports, __webpack_require__) {
|
17457 |
|
17458 | "use strict";
|
17459 |
|
17460 |
|
17461 | var utils = __webpack_require__(110);
|
17462 | var formats = __webpack_require__(149);
|
17463 | var has = Object.prototype.hasOwnProperty;
|
17464 |
|
17465 | var arrayPrefixGenerators = {
|
17466 | brackets: function brackets(prefix) {
|
17467 | return prefix + '[]';
|
17468 | },
|
17469 | comma: 'comma',
|
17470 | indices: function indices(prefix, key) {
|
17471 | return prefix + '[' + key + ']';
|
17472 | },
|
17473 | repeat: function repeat(prefix) {
|
17474 | return prefix;
|
17475 | }
|
17476 | };
|
17477 |
|
17478 | var isArray = Array.isArray;
|
17479 | var push = Array.prototype.push;
|
17480 | var pushToArray = function (arr, valueOrArray) {
|
17481 | push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
17482 | };
|
17483 |
|
17484 | var toISO = Date.prototype.toISOString;
|
17485 |
|
17486 | var defaultFormat = formats['default'];
|
17487 | var defaults = {
|
17488 | addQueryPrefix: false,
|
17489 | allowDots: false,
|
17490 | charset: 'utf-8',
|
17491 | charsetSentinel: false,
|
17492 | delimiter: '&',
|
17493 | encode: true,
|
17494 | encoder: utils.encode,
|
17495 | encodeValuesOnly: false,
|
17496 | format: defaultFormat,
|
17497 | formatter: formats.formatters[defaultFormat],
|
17498 |
|
17499 | indices: false,
|
17500 | serializeDate: function serializeDate(date) {
|
17501 | return toISO.call(date);
|
17502 | },
|
17503 | skipNulls: false,
|
17504 | strictNullHandling: false
|
17505 | };
|
17506 |
|
17507 | var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
17508 | return typeof v === 'string'
|
17509 | || typeof v === 'number'
|
17510 | || typeof v === 'boolean'
|
17511 | || typeof v === 'symbol'
|
17512 | || typeof v === 'bigint';
|
17513 | };
|
17514 |
|
17515 | var stringify = function stringify(
|
17516 | object,
|
17517 | prefix,
|
17518 | generateArrayPrefix,
|
17519 | strictNullHandling,
|
17520 | skipNulls,
|
17521 | encoder,
|
17522 | filter,
|
17523 | sort,
|
17524 | allowDots,
|
17525 | serializeDate,
|
17526 | formatter,
|
17527 | encodeValuesOnly,
|
17528 | charset
|
17529 | ) {
|
17530 | var obj = object;
|
17531 | if (typeof filter === 'function') {
|
17532 | obj = filter(prefix, obj);
|
17533 | } else if (obj instanceof Date) {
|
17534 | obj = serializeDate(obj);
|
17535 | } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
17536 | obj = utils.maybeMap(obj, function (value) {
|
17537 | if (value instanceof Date) {
|
17538 | return serializeDate(value);
|
17539 | }
|
17540 | return value;
|
17541 | }).join(',');
|
17542 | }
|
17543 |
|
17544 | if (obj === null) {
|
17545 | if (strictNullHandling) {
|
17546 | return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
|
17547 | }
|
17548 |
|
17549 | obj = '';
|
17550 | }
|
17551 |
|
17552 | if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
17553 | if (encoder) {
|
17554 | var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
|
17555 | return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
|
17556 | }
|
17557 | return [formatter(prefix) + '=' + formatter(String(obj))];
|
17558 | }
|
17559 |
|
17560 | var values = [];
|
17561 |
|
17562 | if (typeof obj === 'undefined') {
|
17563 | return values;
|
17564 | }
|
17565 |
|
17566 | var objKeys;
|
17567 | if (isArray(filter)) {
|
17568 | objKeys = filter;
|
17569 | } else {
|
17570 | var keys = Object.keys(obj);
|
17571 | objKeys = sort ? keys.sort(sort) : keys;
|
17572 | }
|
17573 |
|
17574 | for (var i = 0; i < objKeys.length; ++i) {
|
17575 | var key = objKeys[i];
|
17576 | var value = obj[key];
|
17577 |
|
17578 | if (skipNulls && value === null) {
|
17579 | continue;
|
17580 | }
|
17581 |
|
17582 | var keyPrefix = isArray(obj)
|
17583 | ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
|
17584 | : prefix + (allowDots ? '.' + key : '[' + key + ']');
|
17585 |
|
17586 | pushToArray(values, stringify(
|
17587 | value,
|
17588 | keyPrefix,
|
17589 | generateArrayPrefix,
|
17590 | strictNullHandling,
|
17591 | skipNulls,
|
17592 | encoder,
|
17593 | filter,
|
17594 | sort,
|
17595 | allowDots,
|
17596 | serializeDate,
|
17597 | formatter,
|
17598 | encodeValuesOnly,
|
17599 | charset
|
17600 | ));
|
17601 | }
|
17602 |
|
17603 | return values;
|
17604 | };
|
17605 |
|
17606 | var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
17607 | if (!opts) {
|
17608 | return defaults;
|
17609 | }
|
17610 |
|
17611 | if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
17612 | throw new TypeError('Encoder has to be a function.');
|
17613 | }
|
17614 |
|
17615 | var charset = opts.charset || defaults.charset;
|
17616 | if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
17617 | throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
17618 | }
|
17619 |
|
17620 | var format = formats['default'];
|
17621 | if (typeof opts.format !== 'undefined') {
|
17622 | if (!has.call(formats.formatters, opts.format)) {
|
17623 | throw new TypeError('Unknown format option provided.');
|
17624 | }
|
17625 | format = opts.format;
|
17626 | }
|
17627 | var formatter = formats.formatters[format];
|
17628 |
|
17629 | var filter = defaults.filter;
|
17630 | if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
17631 | filter = opts.filter;
|
17632 | }
|
17633 |
|
17634 | return {
|
17635 | addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
17636 | allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
17637 | charset: charset,
|
17638 | charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
17639 | delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
17640 | encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
17641 | encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
17642 | encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
17643 | filter: filter,
|
17644 | formatter: formatter,
|
17645 | serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
17646 | skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
17647 | sort: typeof opts.sort === 'function' ? opts.sort : null,
|
17648 | strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
17649 | };
|
17650 | };
|
17651 |
|
17652 | module.exports = function (object, opts) {
|
17653 | var obj = object;
|
17654 | var options = normalizeStringifyOptions(opts);
|
17655 |
|
17656 | var objKeys;
|
17657 | var filter;
|
17658 |
|
17659 | if (typeof options.filter === 'function') {
|
17660 | filter = options.filter;
|
17661 | obj = filter('', obj);
|
17662 | } else if (isArray(options.filter)) {
|
17663 | filter = options.filter;
|
17664 | objKeys = filter;
|
17665 | }
|
17666 |
|
17667 | var keys = [];
|
17668 |
|
17669 | if (typeof obj !== 'object' || obj === null) {
|
17670 | return '';
|
17671 | }
|
17672 |
|
17673 | var arrayFormat;
|
17674 | if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
17675 | arrayFormat = opts.arrayFormat;
|
17676 | } else if (opts && 'indices' in opts) {
|
17677 | arrayFormat = opts.indices ? 'indices' : 'repeat';
|
17678 | } else {
|
17679 | arrayFormat = 'indices';
|
17680 | }
|
17681 |
|
17682 | var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
17683 |
|
17684 | if (!objKeys) {
|
17685 | objKeys = Object.keys(obj);
|
17686 | }
|
17687 |
|
17688 | if (options.sort) {
|
17689 | objKeys.sort(options.sort);
|
17690 | }
|
17691 |
|
17692 | for (var i = 0; i < objKeys.length; ++i) {
|
17693 | var key = objKeys[i];
|
17694 |
|
17695 | if (options.skipNulls && obj[key] === null) {
|
17696 | continue;
|
17697 | }
|
17698 | pushToArray(keys, stringify(
|
17699 | obj[key],
|
17700 | key,
|
17701 | generateArrayPrefix,
|
17702 | options.strictNullHandling,
|
17703 | options.skipNulls,
|
17704 | options.encode ? options.encoder : null,
|
17705 | options.filter,
|
17706 | options.sort,
|
17707 | options.allowDots,
|
17708 | options.serializeDate,
|
17709 | options.formatter,
|
17710 | options.encodeValuesOnly,
|
17711 | options.charset
|
17712 | ));
|
17713 | }
|
17714 |
|
17715 | var joined = keys.join(options.delimiter);
|
17716 | var prefix = options.addQueryPrefix === true ? '?' : '';
|
17717 |
|
17718 | if (options.charsetSentinel) {
|
17719 | if (options.charset === 'iso-8859-1') {
|
17720 |
|
17721 | prefix += 'utf8=%26%2310003%3B&';
|
17722 | } else {
|
17723 |
|
17724 | prefix += 'utf8=%E2%9C%93&';
|
17725 | }
|
17726 | }
|
17727 |
|
17728 | return joined.length > 0 ? prefix + joined : '';
|
17729 | };
|
17730 |
|
17731 |
|
17732 | }),
|
17733 |
|
17734 | (function(module, exports, __webpack_require__) {
|
17735 |
|
17736 | "use strict";
|
17737 |
|
17738 |
|
17739 | var utils = __webpack_require__(110);
|
17740 |
|
17741 | var has = Object.prototype.hasOwnProperty;
|
17742 | var isArray = Array.isArray;
|
17743 |
|
17744 | var defaults = {
|
17745 | allowDots: false,
|
17746 | allowPrototypes: false,
|
17747 | arrayLimit: 20,
|
17748 | charset: 'utf-8',
|
17749 | charsetSentinel: false,
|
17750 | comma: false,
|
17751 | decoder: utils.decode,
|
17752 | delimiter: '&',
|
17753 | depth: 5,
|
17754 | ignoreQueryPrefix: false,
|
17755 | interpretNumericEntities: false,
|
17756 | parameterLimit: 1000,
|
17757 | parseArrays: true,
|
17758 | plainObjects: false,
|
17759 | strictNullHandling: false
|
17760 | };
|
17761 |
|
17762 | var interpretNumericEntities = function (str) {
|
17763 | return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
17764 | return String.fromCharCode(parseInt(numberStr, 10));
|
17765 | });
|
17766 | };
|
17767 |
|
17768 | var parseArrayValue = function (val, options) {
|
17769 | if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
17770 | return val.split(',');
|
17771 | }
|
17772 |
|
17773 | return val;
|
17774 | };
|
17775 |
|
17776 |
|
17777 |
|
17778 |
|
17779 |
|
17780 |
|
17781 | var isoSentinel = 'utf8=%26%2310003%3B';
|
17782 |
|
17783 |
|
17784 | var charsetSentinel = 'utf8=%E2%9C%93';
|
17785 |
|
17786 | var parseValues = function parseQueryStringValues(str, options) {
|
17787 | var obj = {};
|
17788 | var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
17789 | var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
17790 | var parts = cleanStr.split(options.delimiter, limit);
|
17791 | var skipIndex = -1;
|
17792 | var i;
|
17793 |
|
17794 | var charset = options.charset;
|
17795 | if (options.charsetSentinel) {
|
17796 | for (i = 0; i < parts.length; ++i) {
|
17797 | if (parts[i].indexOf('utf8=') === 0) {
|
17798 | if (parts[i] === charsetSentinel) {
|
17799 | charset = 'utf-8';
|
17800 | } else if (parts[i] === isoSentinel) {
|
17801 | charset = 'iso-8859-1';
|
17802 | }
|
17803 | skipIndex = i;
|
17804 | i = parts.length;
|
17805 | }
|
17806 | }
|
17807 | }
|
17808 |
|
17809 | for (i = 0; i < parts.length; ++i) {
|
17810 | if (i === skipIndex) {
|
17811 | continue;
|
17812 | }
|
17813 | var part = parts[i];
|
17814 |
|
17815 | var bracketEqualsPos = part.indexOf(']=');
|
17816 | var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
17817 |
|
17818 | var key, val;
|
17819 | if (pos === -1) {
|
17820 | key = options.decoder(part, defaults.decoder, charset, 'key');
|
17821 | val = options.strictNullHandling ? null : '';
|
17822 | } else {
|
17823 | key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
17824 | val = utils.maybeMap(
|
17825 | parseArrayValue(part.slice(pos + 1), options),
|
17826 | function (encodedVal) {
|
17827 | return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
17828 | }
|
17829 | );
|
17830 | }
|
17831 |
|
17832 | if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
17833 | val = interpretNumericEntities(val);
|
17834 | }
|
17835 |
|
17836 | if (part.indexOf('[]=') > -1) {
|
17837 | val = isArray(val) ? [val] : val;
|
17838 | }
|
17839 |
|
17840 | if (has.call(obj, key)) {
|
17841 | obj[key] = utils.combine(obj[key], val);
|
17842 | } else {
|
17843 | obj[key] = val;
|
17844 | }
|
17845 | }
|
17846 |
|
17847 | return obj;
|
17848 | };
|
17849 |
|
17850 | var parseObject = function (chain, val, options, valuesParsed) {
|
17851 | var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
17852 |
|
17853 | for (var i = chain.length - 1; i >= 0; --i) {
|
17854 | var obj;
|
17855 | var root = chain[i];
|
17856 |
|
17857 | if (root === '[]' && options.parseArrays) {
|
17858 | obj = [].concat(leaf);
|
17859 | } else {
|
17860 | obj = options.plainObjects ? Object.create(null) : {};
|
17861 | var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
17862 | var index = parseInt(cleanRoot, 10);
|
17863 | if (!options.parseArrays && cleanRoot === '') {
|
17864 | obj = { 0: leaf };
|
17865 | } else if (
|
17866 | !isNaN(index)
|
17867 | && root !== cleanRoot
|
17868 | && String(index) === cleanRoot
|
17869 | && index >= 0
|
17870 | && (options.parseArrays && index <= options.arrayLimit)
|
17871 | ) {
|
17872 | obj = [];
|
17873 | obj[index] = leaf;
|
17874 | } else {
|
17875 | obj[cleanRoot] = leaf;
|
17876 | }
|
17877 | }
|
17878 |
|
17879 | leaf = obj;
|
17880 | }
|
17881 |
|
17882 | return leaf;
|
17883 | };
|
17884 |
|
17885 | var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
17886 | if (!givenKey) {
|
17887 | return;
|
17888 | }
|
17889 |
|
17890 |
|
17891 | var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
17892 |
|
17893 |
|
17894 |
|
17895 | var brackets = /(\[[^[\]]*])/;
|
17896 | var child = /(\[[^[\]]*])/g;
|
17897 |
|
17898 |
|
17899 |
|
17900 | var segment = options.depth > 0 && brackets.exec(key);
|
17901 | var parent = segment ? key.slice(0, segment.index) : key;
|
17902 |
|
17903 |
|
17904 |
|
17905 | var keys = [];
|
17906 | if (parent) {
|
17907 |
|
17908 | if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
17909 | if (!options.allowPrototypes) {
|
17910 | return;
|
17911 | }
|
17912 | }
|
17913 |
|
17914 | keys.push(parent);
|
17915 | }
|
17916 |
|
17917 |
|
17918 |
|
17919 | var i = 0;
|
17920 | while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
17921 | i += 1;
|
17922 | if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
17923 | if (!options.allowPrototypes) {
|
17924 | return;
|
17925 | }
|
17926 | }
|
17927 | keys.push(segment[1]);
|
17928 | }
|
17929 |
|
17930 |
|
17931 |
|
17932 | if (segment) {
|
17933 | keys.push('[' + key.slice(segment.index) + ']');
|
17934 | }
|
17935 |
|
17936 | return parseObject(keys, val, options, valuesParsed);
|
17937 | };
|
17938 |
|
17939 | var normalizeParseOptions = function normalizeParseOptions(opts) {
|
17940 | if (!opts) {
|
17941 | return defaults;
|
17942 | }
|
17943 |
|
17944 | if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
17945 | throw new TypeError('Decoder has to be a function.');
|
17946 | }
|
17947 |
|
17948 | if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
17949 | throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
17950 | }
|
17951 | var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
17952 |
|
17953 | return {
|
17954 | allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
17955 | allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
17956 | arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
17957 | charset: charset,
|
17958 | charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
17959 | comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
17960 | decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
17961 | delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
17962 |
|
17963 | depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
17964 | ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
17965 | interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
17966 | parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
17967 | parseArrays: opts.parseArrays !== false,
|
17968 | plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
17969 | strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
17970 | };
|
17971 | };
|
17972 |
|
17973 | module.exports = function (str, opts) {
|
17974 | var options = normalizeParseOptions(opts);
|
17975 |
|
17976 | if (str === '' || str === null || typeof str === 'undefined') {
|
17977 | return options.plainObjects ? Object.create(null) : {};
|
17978 | }
|
17979 |
|
17980 | var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
17981 | var obj = options.plainObjects ? Object.create(null) : {};
|
17982 |
|
17983 |
|
17984 |
|
17985 | var keys = Object.keys(tempObj);
|
17986 | for (var i = 0; i < keys.length; ++i) {
|
17987 | var key = keys[i];
|
17988 | var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
17989 | obj = utils.merge(obj, newObj, options);
|
17990 | }
|
17991 |
|
17992 | return utils.compact(obj);
|
17993 | };
|
17994 |
|
17995 |
|
17996 | }),
|
17997 |
|
17998 | (function(module, exports, __webpack_require__) {
|
17999 |
|
18000 | "use strict";
|
18001 |
|
18002 |
|
18003 |
|
18004 | var loader = __webpack_require__(257);
|
18005 | var dumper = __webpack_require__(279);
|
18006 |
|
18007 |
|
18008 | function deprecated(name) {
|
18009 | return function () {
|
18010 | throw new Error('Function ' + name + ' is deprecated and cannot be used.');
|
18011 | };
|
18012 | }
|
18013 |
|
18014 |
|
18015 | module.exports.Type = __webpack_require__(8);
|
18016 | module.exports.Schema = __webpack_require__(43);
|
18017 | module.exports.FAILSAFE_SCHEMA = __webpack_require__(111);
|
18018 | module.exports.JSON_SCHEMA = __webpack_require__(151);
|
18019 | module.exports.CORE_SCHEMA = __webpack_require__(150);
|
18020 | module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(59);
|
18021 | module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(72);
|
18022 | module.exports.load = loader.load;
|
18023 | module.exports.loadAll = loader.loadAll;
|
18024 | module.exports.safeLoad = loader.safeLoad;
|
18025 | module.exports.safeLoadAll = loader.safeLoadAll;
|
18026 | module.exports.dump = dumper.dump;
|
18027 | module.exports.safeDump = dumper.safeDump;
|
18028 | module.exports.YAMLException = __webpack_require__(58);
|
18029 |
|
18030 |
|
18031 | module.exports.MINIMAL_SCHEMA = __webpack_require__(111);
|
18032 | module.exports.SAFE_SCHEMA = __webpack_require__(59);
|
18033 | module.exports.DEFAULT_SCHEMA = __webpack_require__(72);
|
18034 |
|
18035 |
|
18036 | module.exports.scan = deprecated('scan');
|
18037 | module.exports.parse = deprecated('parse');
|
18038 | module.exports.compose = deprecated('compose');
|
18039 | module.exports.addConstructor = deprecated('addConstructor');
|
18040 |
|
18041 |
|
18042 | }),
|
18043 |
|
18044 | (function(module, exports, __webpack_require__) {
|
18045 |
|
18046 | "use strict";
|
18047 |
|
18048 |
|
18049 |
|
18050 |
|
18051 | var common = __webpack_require__(42);
|
18052 | var YAMLException = __webpack_require__(58);
|
18053 | var Mark = __webpack_require__(258);
|
18054 | var DEFAULT_SAFE_SCHEMA = __webpack_require__(59);
|
18055 | var DEFAULT_FULL_SCHEMA = __webpack_require__(72);
|
18056 |
|
18057 |
|
18058 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
18059 |
|
18060 |
|
18061 | var CONTEXT_FLOW_IN = 1;
|
18062 | var CONTEXT_FLOW_OUT = 2;
|
18063 | var CONTEXT_BLOCK_IN = 3;
|
18064 | var CONTEXT_BLOCK_OUT = 4;
|
18065 |
|
18066 |
|
18067 | var CHOMPING_CLIP = 1;
|
18068 | var CHOMPING_STRIP = 2;
|
18069 | var CHOMPING_KEEP = 3;
|
18070 |
|
18071 |
|
18072 | var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
18073 | var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
18074 | var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
18075 | var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
18076 | var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
18077 |
|
18078 |
|
18079 | function _class(obj) { return Object.prototype.toString.call(obj); }
|
18080 |
|
18081 | function is_EOL(c) {
|
18082 | return (c === 0x0A) || (c === 0x0D);
|
18083 | }
|
18084 |
|
18085 | function is_WHITE_SPACE(c) {
|
18086 | return (c === 0x09) || (c === 0x20);
|
18087 | }
|
18088 |
|
18089 | function is_WS_OR_EOL(c) {
|
18090 | return (c === 0x09) ||
|
18091 | (c === 0x20) ||
|
18092 | (c === 0x0A) ||
|
18093 | (c === 0x0D);
|
18094 | }
|
18095 |
|
18096 | function is_FLOW_INDICATOR(c) {
|
18097 | return c === 0x2C ||
|
18098 | c === 0x5B ||
|
18099 | c === 0x5D ||
|
18100 | c === 0x7B ||
|
18101 | c === 0x7D;
|
18102 | }
|
18103 |
|
18104 | function fromHexCode(c) {
|
18105 | var lc;
|
18106 |
|
18107 | if ((0x30 <= c) && (c <= 0x39)) {
|
18108 | return c - 0x30;
|
18109 | }
|
18110 |
|
18111 |
|
18112 | lc = c | 0x20;
|
18113 |
|
18114 | if ((0x61 <= lc) && (lc <= 0x66)) {
|
18115 | return lc - 0x61 + 10;
|
18116 | }
|
18117 |
|
18118 | return -1;
|
18119 | }
|
18120 |
|
18121 | function escapedHexLen(c) {
|
18122 | if (c === 0x78) { return 2; }
|
18123 | if (c === 0x75) { return 4; }
|
18124 | if (c === 0x55) { return 8; }
|
18125 | return 0;
|
18126 | }
|
18127 |
|
18128 | function fromDecimalCode(c) {
|
18129 | if ((0x30 <= c) && (c <= 0x39)) {
|
18130 | return c - 0x30;
|
18131 | }
|
18132 |
|
18133 | return -1;
|
18134 | }
|
18135 |
|
18136 | function simpleEscapeSequence(c) {
|
18137 |
|
18138 | return (c === 0x30) ? '\x00' :
|
18139 | (c === 0x61) ? '\x07' :
|
18140 | (c === 0x62) ? '\x08' :
|
18141 | (c === 0x74) ? '\x09' :
|
18142 | (c === 0x09) ? '\x09' :
|
18143 | (c === 0x6E) ? '\x0A' :
|
18144 | (c === 0x76) ? '\x0B' :
|
18145 | (c === 0x66) ? '\x0C' :
|
18146 | (c === 0x72) ? '\x0D' :
|
18147 | (c === 0x65) ? '\x1B' :
|
18148 | (c === 0x20) ? ' ' :
|
18149 | (c === 0x22) ? '\x22' :
|
18150 | (c === 0x2F) ? '/' :
|
18151 | (c === 0x5C) ? '\x5C' :
|
18152 | (c === 0x4E) ? '\x85' :
|
18153 | (c === 0x5F) ? '\xA0' :
|
18154 | (c === 0x4C) ? '\u2028' :
|
18155 | (c === 0x50) ? '\u2029' : '';
|
18156 | }
|
18157 |
|
18158 | function charFromCodepoint(c) {
|
18159 | if (c <= 0xFFFF) {
|
18160 | return String.fromCharCode(c);
|
18161 | }
|
18162 |
|
18163 |
|
18164 | return String.fromCharCode(
|
18165 | ((c - 0x010000) >> 10) + 0xD800,
|
18166 | ((c - 0x010000) & 0x03FF) + 0xDC00
|
18167 | );
|
18168 | }
|
18169 |
|
18170 | var simpleEscapeCheck = new Array(256);
|
18171 | var simpleEscapeMap = new Array(256);
|
18172 | for (var i = 0; i < 256; i++) {
|
18173 | simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
18174 | simpleEscapeMap[i] = simpleEscapeSequence(i);
|
18175 | }
|
18176 |
|
18177 |
|
18178 | function State(input, options) {
|
18179 | this.input = input;
|
18180 |
|
18181 | this.filename = options['filename'] || null;
|
18182 | this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
18183 | this.onWarning = options['onWarning'] || null;
|
18184 | this.legacy = options['legacy'] || false;
|
18185 | this.json = options['json'] || false;
|
18186 | this.listener = options['listener'] || null;
|
18187 |
|
18188 | this.implicitTypes = this.schema.compiledImplicit;
|
18189 | this.typeMap = this.schema.compiledTypeMap;
|
18190 |
|
18191 | this.length = input.length;
|
18192 | this.position = 0;
|
18193 | this.line = 0;
|
18194 | this.lineStart = 0;
|
18195 | this.lineIndent = 0;
|
18196 |
|
18197 | this.documents = [];
|
18198 |
|
18199 | |
18200 |
|
18201 |
|
18202 |
|
18203 |
|
18204 |
|
18205 |
|
18206 |
|
18207 |
|
18208 |
|
18209 | }
|
18210 |
|
18211 |
|
18212 | function generateError(state, message) {
|
18213 | return new YAMLException(
|
18214 | message,
|
18215 | new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
|
18216 | }
|
18217 |
|
18218 | function throwError(state, message) {
|
18219 | throw generateError(state, message);
|
18220 | }
|
18221 |
|
18222 | function throwWarning(state, message) {
|
18223 | if (state.onWarning) {
|
18224 | state.onWarning.call(null, generateError(state, message));
|
18225 | }
|
18226 | }
|
18227 |
|
18228 |
|
18229 | var directiveHandlers = {
|
18230 |
|
18231 | YAML: function handleYamlDirective(state, name, args) {
|
18232 |
|
18233 | var match, major, minor;
|
18234 |
|
18235 | if (state.version !== null) {
|
18236 | throwError(state, 'duplication of %YAML directive');
|
18237 | }
|
18238 |
|
18239 | if (args.length !== 1) {
|
18240 | throwError(state, 'YAML directive accepts exactly one argument');
|
18241 | }
|
18242 |
|
18243 | match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
18244 |
|
18245 | if (match === null) {
|
18246 | throwError(state, 'ill-formed argument of the YAML directive');
|
18247 | }
|
18248 |
|
18249 | major = parseInt(match[1], 10);
|
18250 | minor = parseInt(match[2], 10);
|
18251 |
|
18252 | if (major !== 1) {
|
18253 | throwError(state, 'unacceptable YAML version of the document');
|
18254 | }
|
18255 |
|
18256 | state.version = args[0];
|
18257 | state.checkLineBreaks = (minor < 2);
|
18258 |
|
18259 | if (minor !== 1 && minor !== 2) {
|
18260 | throwWarning(state, 'unsupported YAML version of the document');
|
18261 | }
|
18262 | },
|
18263 |
|
18264 | TAG: function handleTagDirective(state, name, args) {
|
18265 |
|
18266 | var handle, prefix;
|
18267 |
|
18268 | if (args.length !== 2) {
|
18269 | throwError(state, 'TAG directive accepts exactly two arguments');
|
18270 | }
|
18271 |
|
18272 | handle = args[0];
|
18273 | prefix = args[1];
|
18274 |
|
18275 | if (!PATTERN_TAG_HANDLE.test(handle)) {
|
18276 | throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
|
18277 | }
|
18278 |
|
18279 | if (_hasOwnProperty.call(state.tagMap, handle)) {
|
18280 | throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
18281 | }
|
18282 |
|
18283 | if (!PATTERN_TAG_URI.test(prefix)) {
|
18284 | throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
|
18285 | }
|
18286 |
|
18287 | state.tagMap[handle] = prefix;
|
18288 | }
|
18289 | };
|
18290 |
|
18291 |
|
18292 | function captureSegment(state, start, end, checkJson) {
|
18293 | var _position, _length, _character, _result;
|
18294 |
|
18295 | if (start < end) {
|
18296 | _result = state.input.slice(start, end);
|
18297 |
|
18298 | if (checkJson) {
|
18299 | for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
18300 | _character = _result.charCodeAt(_position);
|
18301 | if (!(_character === 0x09 ||
|
18302 | (0x20 <= _character && _character <= 0x10FFFF))) {
|
18303 | throwError(state, 'expected valid JSON character');
|
18304 | }
|
18305 | }
|
18306 | } else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
18307 | throwError(state, 'the stream contains non-printable characters');
|
18308 | }
|
18309 |
|
18310 | state.result += _result;
|
18311 | }
|
18312 | }
|
18313 |
|
18314 | function mergeMappings(state, destination, source, overridableKeys) {
|
18315 | var sourceKeys, key, index, quantity;
|
18316 |
|
18317 | if (!common.isObject(source)) {
|
18318 | throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
|
18319 | }
|
18320 |
|
18321 | sourceKeys = Object.keys(source);
|
18322 |
|
18323 | for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
18324 | key = sourceKeys[index];
|
18325 |
|
18326 | if (!_hasOwnProperty.call(destination, key)) {
|
18327 | destination[key] = source[key];
|
18328 | overridableKeys[key] = true;
|
18329 | }
|
18330 | }
|
18331 | }
|
18332 |
|
18333 | function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
|
18334 | var index, quantity;
|
18335 |
|
18336 |
|
18337 |
|
18338 |
|
18339 | if (Array.isArray(keyNode)) {
|
18340 | keyNode = Array.prototype.slice.call(keyNode);
|
18341 |
|
18342 | for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
18343 | if (Array.isArray(keyNode[index])) {
|
18344 | throwError(state, 'nested arrays are not supported inside keys');
|
18345 | }
|
18346 |
|
18347 | if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
|
18348 | keyNode[index] = '[object Object]';
|
18349 | }
|
18350 | }
|
18351 | }
|
18352 |
|
18353 |
|
18354 |
|
18355 |
|
18356 | if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
|
18357 | keyNode = '[object Object]';
|
18358 | }
|
18359 |
|
18360 |
|
18361 | keyNode = String(keyNode);
|
18362 |
|
18363 | if (_result === null) {
|
18364 | _result = {};
|
18365 | }
|
18366 |
|
18367 | if (keyTag === 'tag:yaml.org,2002:merge') {
|
18368 | if (Array.isArray(valueNode)) {
|
18369 | for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
18370 | mergeMappings(state, _result, valueNode[index], overridableKeys);
|
18371 | }
|
18372 | } else {
|
18373 | mergeMappings(state, _result, valueNode, overridableKeys);
|
18374 | }
|
18375 | } else {
|
18376 | if (!state.json &&
|
18377 | !_hasOwnProperty.call(overridableKeys, keyNode) &&
|
18378 | _hasOwnProperty.call(_result, keyNode)) {
|
18379 | state.line = startLine || state.line;
|
18380 | state.position = startPos || state.position;
|
18381 | throwError(state, 'duplicated mapping key');
|
18382 | }
|
18383 | _result[keyNode] = valueNode;
|
18384 | delete overridableKeys[keyNode];
|
18385 | }
|
18386 |
|
18387 | return _result;
|
18388 | }
|
18389 |
|
18390 | function readLineBreak(state) {
|
18391 | var ch;
|
18392 |
|
18393 | ch = state.input.charCodeAt(state.position);
|
18394 |
|
18395 | if (ch === 0x0A) {
|
18396 | state.position++;
|
18397 | } else if (ch === 0x0D) {
|
18398 | state.position++;
|
18399 | if (state.input.charCodeAt(state.position) === 0x0A) {
|
18400 | state.position++;
|
18401 | }
|
18402 | } else {
|
18403 | throwError(state, 'a line break is expected');
|
18404 | }
|
18405 |
|
18406 | state.line += 1;
|
18407 | state.lineStart = state.position;
|
18408 | }
|
18409 |
|
18410 | function skipSeparationSpace(state, allowComments, checkIndent) {
|
18411 | var lineBreaks = 0,
|
18412 | ch = state.input.charCodeAt(state.position);
|
18413 |
|
18414 | while (ch !== 0) {
|
18415 | while (is_WHITE_SPACE(ch)) {
|
18416 | ch = state.input.charCodeAt(++state.position);
|
18417 | }
|
18418 |
|
18419 | if (allowComments && ch === 0x23) {
|
18420 | do {
|
18421 | ch = state.input.charCodeAt(++state.position);
|
18422 | } while (ch !== 0x0A && ch !== 0x0D && ch !== 0);
|
18423 | }
|
18424 |
|
18425 | if (is_EOL(ch)) {
|
18426 | readLineBreak(state);
|
18427 |
|
18428 | ch = state.input.charCodeAt(state.position);
|
18429 | lineBreaks++;
|
18430 | state.lineIndent = 0;
|
18431 |
|
18432 | while (ch === 0x20) {
|
18433 | state.lineIndent++;
|
18434 | ch = state.input.charCodeAt(++state.position);
|
18435 | }
|
18436 | } else {
|
18437 | break;
|
18438 | }
|
18439 | }
|
18440 |
|
18441 | if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
18442 | throwWarning(state, 'deficient indentation');
|
18443 | }
|
18444 |
|
18445 | return lineBreaks;
|
18446 | }
|
18447 |
|
18448 | function testDocumentSeparator(state) {
|
18449 | var _position = state.position,
|
18450 | ch;
|
18451 |
|
18452 | ch = state.input.charCodeAt(_position);
|
18453 |
|
18454 |
|
18455 |
|
18456 | if ((ch === 0x2D || ch === 0x2E) &&
|
18457 | ch === state.input.charCodeAt(_position + 1) &&
|
18458 | ch === state.input.charCodeAt(_position + 2)) {
|
18459 |
|
18460 | _position += 3;
|
18461 |
|
18462 | ch = state.input.charCodeAt(_position);
|
18463 |
|
18464 | if (ch === 0 || is_WS_OR_EOL(ch)) {
|
18465 | return true;
|
18466 | }
|
18467 | }
|
18468 |
|
18469 | return false;
|
18470 | }
|
18471 |
|
18472 | function writeFoldedLines(state, count) {
|
18473 | if (count === 1) {
|
18474 | state.result += ' ';
|
18475 | } else if (count > 1) {
|
18476 | state.result += common.repeat('\n', count - 1);
|
18477 | }
|
18478 | }
|
18479 |
|
18480 |
|
18481 | function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
18482 | var preceding,
|
18483 | following,
|
18484 | captureStart,
|
18485 | captureEnd,
|
18486 | hasPendingContent,
|
18487 | _line,
|
18488 | _lineStart,
|
18489 | _lineIndent,
|
18490 | _kind = state.kind,
|
18491 | _result = state.result,
|
18492 | ch;
|
18493 |
|
18494 | ch = state.input.charCodeAt(state.position);
|
18495 |
|
18496 | if (is_WS_OR_EOL(ch) ||
|
18497 | is_FLOW_INDICATOR(ch) ||
|
18498 | ch === 0x23 ||
|
18499 | ch === 0x26 ||
|
18500 | ch === 0x2A ||
|
18501 | ch === 0x21 ||
|
18502 | ch === 0x7C ||
|
18503 | ch === 0x3E ||
|
18504 | ch === 0x27 ||
|
18505 | ch === 0x22 ||
|
18506 | ch === 0x25 ||
|
18507 | ch === 0x40 ||
|
18508 | ch === 0x60) {
|
18509 | return false;
|
18510 | }
|
18511 |
|
18512 | if (ch === 0x3F || ch === 0x2D) {
|
18513 | following = state.input.charCodeAt(state.position + 1);
|
18514 |
|
18515 | if (is_WS_OR_EOL(following) ||
|
18516 | withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
18517 | return false;
|
18518 | }
|
18519 | }
|
18520 |
|
18521 | state.kind = 'scalar';
|
18522 | state.result = '';
|
18523 | captureStart = captureEnd = state.position;
|
18524 | hasPendingContent = false;
|
18525 |
|
18526 | while (ch !== 0) {
|
18527 | if (ch === 0x3A) {
|
18528 | following = state.input.charCodeAt(state.position + 1);
|
18529 |
|
18530 | if (is_WS_OR_EOL(following) ||
|
18531 | withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
18532 | break;
|
18533 | }
|
18534 |
|
18535 | } else if (ch === 0x23) {
|
18536 | preceding = state.input.charCodeAt(state.position - 1);
|
18537 |
|
18538 | if (is_WS_OR_EOL(preceding)) {
|
18539 | break;
|
18540 | }
|
18541 |
|
18542 | } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
|
18543 | withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
18544 | break;
|
18545 |
|
18546 | } else if (is_EOL(ch)) {
|
18547 | _line = state.line;
|
18548 | _lineStart = state.lineStart;
|
18549 | _lineIndent = state.lineIndent;
|
18550 | skipSeparationSpace(state, false, -1);
|
18551 |
|
18552 | if (state.lineIndent >= nodeIndent) {
|
18553 | hasPendingContent = true;
|
18554 | ch = state.input.charCodeAt(state.position);
|
18555 | continue;
|
18556 | } else {
|
18557 | state.position = captureEnd;
|
18558 | state.line = _line;
|
18559 | state.lineStart = _lineStart;
|
18560 | state.lineIndent = _lineIndent;
|
18561 | break;
|
18562 | }
|
18563 | }
|
18564 |
|
18565 | if (hasPendingContent) {
|
18566 | captureSegment(state, captureStart, captureEnd, false);
|
18567 | writeFoldedLines(state, state.line - _line);
|
18568 | captureStart = captureEnd = state.position;
|
18569 | hasPendingContent = false;
|
18570 | }
|
18571 |
|
18572 | if (!is_WHITE_SPACE(ch)) {
|
18573 | captureEnd = state.position + 1;
|
18574 | }
|
18575 |
|
18576 | ch = state.input.charCodeAt(++state.position);
|
18577 | }
|
18578 |
|
18579 | captureSegment(state, captureStart, captureEnd, false);
|
18580 |
|
18581 | if (state.result) {
|
18582 | return true;
|
18583 | }
|
18584 |
|
18585 | state.kind = _kind;
|
18586 | state.result = _result;
|
18587 | return false;
|
18588 | }
|
18589 |
|
18590 | function readSingleQuotedScalar(state, nodeIndent) {
|
18591 | var ch,
|
18592 | captureStart, captureEnd;
|
18593 |
|
18594 | ch = state.input.charCodeAt(state.position);
|
18595 |
|
18596 | if (ch !== 0x27) {
|
18597 | return false;
|
18598 | }
|
18599 |
|
18600 | state.kind = 'scalar';
|
18601 | state.result = '';
|
18602 | state.position++;
|
18603 | captureStart = captureEnd = state.position;
|
18604 |
|
18605 | while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
18606 | if (ch === 0x27) {
|
18607 | captureSegment(state, captureStart, state.position, true);
|
18608 | ch = state.input.charCodeAt(++state.position);
|
18609 |
|
18610 | if (ch === 0x27) {
|
18611 | captureStart = state.position;
|
18612 | state.position++;
|
18613 | captureEnd = state.position;
|
18614 | } else {
|
18615 | return true;
|
18616 | }
|
18617 |
|
18618 | } else if (is_EOL(ch)) {
|
18619 | captureSegment(state, captureStart, captureEnd, true);
|
18620 | writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
18621 | captureStart = captureEnd = state.position;
|
18622 |
|
18623 | } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
18624 | throwError(state, 'unexpected end of the document within a single quoted scalar');
|
18625 |
|
18626 | } else {
|
18627 | state.position++;
|
18628 | captureEnd = state.position;
|
18629 | }
|
18630 | }
|
18631 |
|
18632 | throwError(state, 'unexpected end of the stream within a single quoted scalar');
|
18633 | }
|
18634 |
|
18635 | function readDoubleQuotedScalar(state, nodeIndent) {
|
18636 | var captureStart,
|
18637 | captureEnd,
|
18638 | hexLength,
|
18639 | hexResult,
|
18640 | tmp,
|
18641 | ch;
|
18642 |
|
18643 | ch = state.input.charCodeAt(state.position);
|
18644 |
|
18645 | if (ch !== 0x22) {
|
18646 | return false;
|
18647 | }
|
18648 |
|
18649 | state.kind = 'scalar';
|
18650 | state.result = '';
|
18651 | state.position++;
|
18652 | captureStart = captureEnd = state.position;
|
18653 |
|
18654 | while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
18655 | if (ch === 0x22) {
|
18656 | captureSegment(state, captureStart, state.position, true);
|
18657 | state.position++;
|
18658 | return true;
|
18659 |
|
18660 | } else if (ch === 0x5C) {
|
18661 | captureSegment(state, captureStart, state.position, true);
|
18662 | ch = state.input.charCodeAt(++state.position);
|
18663 |
|
18664 | if (is_EOL(ch)) {
|
18665 | skipSeparationSpace(state, false, nodeIndent);
|
18666 |
|
18667 |
|
18668 | } else if (ch < 256 && simpleEscapeCheck[ch]) {
|
18669 | state.result += simpleEscapeMap[ch];
|
18670 | state.position++;
|
18671 |
|
18672 | } else if ((tmp = escapedHexLen(ch)) > 0) {
|
18673 | hexLength = tmp;
|
18674 | hexResult = 0;
|
18675 |
|
18676 | for (; hexLength > 0; hexLength--) {
|
18677 | ch = state.input.charCodeAt(++state.position);
|
18678 |
|
18679 | if ((tmp = fromHexCode(ch)) >= 0) {
|
18680 | hexResult = (hexResult << 4) + tmp;
|
18681 |
|
18682 | } else {
|
18683 | throwError(state, 'expected hexadecimal character');
|
18684 | }
|
18685 | }
|
18686 |
|
18687 | state.result += charFromCodepoint(hexResult);
|
18688 |
|
18689 | state.position++;
|
18690 |
|
18691 | } else {
|
18692 | throwError(state, 'unknown escape sequence');
|
18693 | }
|
18694 |
|
18695 | captureStart = captureEnd = state.position;
|
18696 |
|
18697 | } else if (is_EOL(ch)) {
|
18698 | captureSegment(state, captureStart, captureEnd, true);
|
18699 | writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
18700 | captureStart = captureEnd = state.position;
|
18701 |
|
18702 | } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
18703 | throwError(state, 'unexpected end of the document within a double quoted scalar');
|
18704 |
|
18705 | } else {
|
18706 | state.position++;
|
18707 | captureEnd = state.position;
|
18708 | }
|
18709 | }
|
18710 |
|
18711 | throwError(state, 'unexpected end of the stream within a double quoted scalar');
|
18712 | }
|
18713 |
|
18714 | function readFlowCollection(state, nodeIndent) {
|
18715 | var readNext = true,
|
18716 | _line,
|
18717 | _tag = state.tag,
|
18718 | _result,
|
18719 | _anchor = state.anchor,
|
18720 | following,
|
18721 | terminator,
|
18722 | isPair,
|
18723 | isExplicitPair,
|
18724 | isMapping,
|
18725 | overridableKeys = {},
|
18726 | keyNode,
|
18727 | keyTag,
|
18728 | valueNode,
|
18729 | ch;
|
18730 |
|
18731 | ch = state.input.charCodeAt(state.position);
|
18732 |
|
18733 | if (ch === 0x5B) {
|
18734 | terminator = 0x5D;
|
18735 | isMapping = false;
|
18736 | _result = [];
|
18737 | } else if (ch === 0x7B) {
|
18738 | terminator = 0x7D;
|
18739 | isMapping = true;
|
18740 | _result = {};
|
18741 | } else {
|
18742 | return false;
|
18743 | }
|
18744 |
|
18745 | if (state.anchor !== null) {
|
18746 | state.anchorMap[state.anchor] = _result;
|
18747 | }
|
18748 |
|
18749 | ch = state.input.charCodeAt(++state.position);
|
18750 |
|
18751 | while (ch !== 0) {
|
18752 | skipSeparationSpace(state, true, nodeIndent);
|
18753 |
|
18754 | ch = state.input.charCodeAt(state.position);
|
18755 |
|
18756 | if (ch === terminator) {
|
18757 | state.position++;
|
18758 | state.tag = _tag;
|
18759 | state.anchor = _anchor;
|
18760 | state.kind = isMapping ? 'mapping' : 'sequence';
|
18761 | state.result = _result;
|
18762 | return true;
|
18763 | } else if (!readNext) {
|
18764 | throwError(state, 'missed comma between flow collection entries');
|
18765 | }
|
18766 |
|
18767 | keyTag = keyNode = valueNode = null;
|
18768 | isPair = isExplicitPair = false;
|
18769 |
|
18770 | if (ch === 0x3F) {
|
18771 | following = state.input.charCodeAt(state.position + 1);
|
18772 |
|
18773 | if (is_WS_OR_EOL(following)) {
|
18774 | isPair = isExplicitPair = true;
|
18775 | state.position++;
|
18776 | skipSeparationSpace(state, true, nodeIndent);
|
18777 | }
|
18778 | }
|
18779 |
|
18780 | _line = state.line;
|
18781 | composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
18782 | keyTag = state.tag;
|
18783 | keyNode = state.result;
|
18784 | skipSeparationSpace(state, true, nodeIndent);
|
18785 |
|
18786 | ch = state.input.charCodeAt(state.position);
|
18787 |
|
18788 | if ((isExplicitPair || state.line === _line) && ch === 0x3A) {
|
18789 | isPair = true;
|
18790 | ch = state.input.charCodeAt(++state.position);
|
18791 | skipSeparationSpace(state, true, nodeIndent);
|
18792 | composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
18793 | valueNode = state.result;
|
18794 | }
|
18795 |
|
18796 | if (isMapping) {
|
18797 | storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
|
18798 | } else if (isPair) {
|
18799 | _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
|
18800 | } else {
|
18801 | _result.push(keyNode);
|
18802 | }
|
18803 |
|
18804 | skipSeparationSpace(state, true, nodeIndent);
|
18805 |
|
18806 | ch = state.input.charCodeAt(state.position);
|
18807 |
|
18808 | if (ch === 0x2C) {
|
18809 | readNext = true;
|
18810 | ch = state.input.charCodeAt(++state.position);
|
18811 | } else {
|
18812 | readNext = false;
|
18813 | }
|
18814 | }
|
18815 |
|
18816 | throwError(state, 'unexpected end of the stream within a flow collection');
|
18817 | }
|
18818 |
|
18819 | function readBlockScalar(state, nodeIndent) {
|
18820 | var captureStart,
|
18821 | folding,
|
18822 | chomping = CHOMPING_CLIP,
|
18823 | didReadContent = false,
|
18824 | detectedIndent = false,
|
18825 | textIndent = nodeIndent,
|
18826 | emptyLines = 0,
|
18827 | atMoreIndented = false,
|
18828 | tmp,
|
18829 | ch;
|
18830 |
|
18831 | ch = state.input.charCodeAt(state.position);
|
18832 |
|
18833 | if (ch === 0x7C) {
|
18834 | folding = false;
|
18835 | } else if (ch === 0x3E) {
|
18836 | folding = true;
|
18837 | } else {
|
18838 | return false;
|
18839 | }
|
18840 |
|
18841 | state.kind = 'scalar';
|
18842 | state.result = '';
|
18843 |
|
18844 | while (ch !== 0) {
|
18845 | ch = state.input.charCodeAt(++state.position);
|
18846 |
|
18847 | if (ch === 0x2B || ch === 0x2D) {
|
18848 | if (CHOMPING_CLIP === chomping) {
|
18849 | chomping = (ch === 0x2B) ? CHOMPING_KEEP : CHOMPING_STRIP;
|
18850 | } else {
|
18851 | throwError(state, 'repeat of a chomping mode identifier');
|
18852 | }
|
18853 |
|
18854 | } else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
18855 | if (tmp === 0) {
|
18856 | throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
|
18857 | } else if (!detectedIndent) {
|
18858 | textIndent = nodeIndent + tmp - 1;
|
18859 | detectedIndent = true;
|
18860 | } else {
|
18861 | throwError(state, 'repeat of an indentation width identifier');
|
18862 | }
|
18863 |
|
18864 | } else {
|
18865 | break;
|
18866 | }
|
18867 | }
|
18868 |
|
18869 | if (is_WHITE_SPACE(ch)) {
|
18870 | do { ch = state.input.charCodeAt(++state.position); }
|
18871 | while (is_WHITE_SPACE(ch));
|
18872 |
|
18873 | if (ch === 0x23) {
|
18874 | do { ch = state.input.charCodeAt(++state.position); }
|
18875 | while (!is_EOL(ch) && (ch !== 0));
|
18876 | }
|
18877 | }
|
18878 |
|
18879 | while (ch !== 0) {
|
18880 | readLineBreak(state);
|
18881 | state.lineIndent = 0;
|
18882 |
|
18883 | ch = state.input.charCodeAt(state.position);
|
18884 |
|
18885 | while ((!detectedIndent || state.lineIndent < textIndent) &&
|
18886 | (ch === 0x20)) {
|
18887 | state.lineIndent++;
|
18888 | ch = state.input.charCodeAt(++state.position);
|
18889 | }
|
18890 |
|
18891 | if (!detectedIndent && state.lineIndent > textIndent) {
|
18892 | textIndent = state.lineIndent;
|
18893 | }
|
18894 |
|
18895 | if (is_EOL(ch)) {
|
18896 | emptyLines++;
|
18897 | continue;
|
18898 | }
|
18899 |
|
18900 |
|
18901 | if (state.lineIndent < textIndent) {
|
18902 |
|
18903 |
|
18904 | if (chomping === CHOMPING_KEEP) {
|
18905 | state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
|
18906 | } else if (chomping === CHOMPING_CLIP) {
|
18907 | if (didReadContent) {
|
18908 | state.result += '\n';
|
18909 | }
|
18910 | }
|
18911 |
|
18912 |
|
18913 | break;
|
18914 | }
|
18915 |
|
18916 |
|
18917 | if (folding) {
|
18918 |
|
18919 |
|
18920 | if (is_WHITE_SPACE(ch)) {
|
18921 | atMoreIndented = true;
|
18922 |
|
18923 | state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
|
18924 |
|
18925 |
|
18926 | } else if (atMoreIndented) {
|
18927 | atMoreIndented = false;
|
18928 | state.result += common.repeat('\n', emptyLines + 1);
|
18929 |
|
18930 |
|
18931 | } else if (emptyLines === 0) {
|
18932 | if (didReadContent) {
|
18933 | state.result += ' ';
|
18934 | }
|
18935 |
|
18936 |
|
18937 | } else {
|
18938 | state.result += common.repeat('\n', emptyLines);
|
18939 | }
|
18940 |
|
18941 |
|
18942 | } else {
|
18943 |
|
18944 | state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
|
18945 | }
|
18946 |
|
18947 | didReadContent = true;
|
18948 | detectedIndent = true;
|
18949 | emptyLines = 0;
|
18950 | captureStart = state.position;
|
18951 |
|
18952 | while (!is_EOL(ch) && (ch !== 0)) {
|
18953 | ch = state.input.charCodeAt(++state.position);
|
18954 | }
|
18955 |
|
18956 | captureSegment(state, captureStart, state.position, false);
|
18957 | }
|
18958 |
|
18959 | return true;
|
18960 | }
|
18961 |
|
18962 | function readBlockSequence(state, nodeIndent) {
|
18963 | var _line,
|
18964 | _tag = state.tag,
|
18965 | _anchor = state.anchor,
|
18966 | _result = [],
|
18967 | following,
|
18968 | detected = false,
|
18969 | ch;
|
18970 |
|
18971 | if (state.anchor !== null) {
|
18972 | state.anchorMap[state.anchor] = _result;
|
18973 | }
|
18974 |
|
18975 | ch = state.input.charCodeAt(state.position);
|
18976 |
|
18977 | while (ch !== 0) {
|
18978 |
|
18979 | if (ch !== 0x2D) {
|
18980 | break;
|
18981 | }
|
18982 |
|
18983 | following = state.input.charCodeAt(state.position + 1);
|
18984 |
|
18985 | if (!is_WS_OR_EOL(following)) {
|
18986 | break;
|
18987 | }
|
18988 |
|
18989 | detected = true;
|
18990 | state.position++;
|
18991 |
|
18992 | if (skipSeparationSpace(state, true, -1)) {
|
18993 | if (state.lineIndent <= nodeIndent) {
|
18994 | _result.push(null);
|
18995 | ch = state.input.charCodeAt(state.position);
|
18996 | continue;
|
18997 | }
|
18998 | }
|
18999 |
|
19000 | _line = state.line;
|
19001 | composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
19002 | _result.push(state.result);
|
19003 | skipSeparationSpace(state, true, -1);
|
19004 |
|
19005 | ch = state.input.charCodeAt(state.position);
|
19006 |
|
19007 | if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
|
19008 | throwError(state, 'bad indentation of a sequence entry');
|
19009 | } else if (state.lineIndent < nodeIndent) {
|
19010 | break;
|
19011 | }
|
19012 | }
|
19013 |
|
19014 | if (detected) {
|
19015 | state.tag = _tag;
|
19016 | state.anchor = _anchor;
|
19017 | state.kind = 'sequence';
|
19018 | state.result = _result;
|
19019 | return true;
|
19020 | }
|
19021 | return false;
|
19022 | }
|
19023 |
|
19024 | function readBlockMapping(state, nodeIndent, flowIndent) {
|
19025 | var following,
|
19026 | allowCompact,
|
19027 | _line,
|
19028 | _pos,
|
19029 | _tag = state.tag,
|
19030 | _anchor = state.anchor,
|
19031 | _result = {},
|
19032 | overridableKeys = {},
|
19033 | keyTag = null,
|
19034 | keyNode = null,
|
19035 | valueNode = null,
|
19036 | atExplicitKey = false,
|
19037 | detected = false,
|
19038 | ch;
|
19039 |
|
19040 | if (state.anchor !== null) {
|
19041 | state.anchorMap[state.anchor] = _result;
|
19042 | }
|
19043 |
|
19044 | ch = state.input.charCodeAt(state.position);
|
19045 |
|
19046 | while (ch !== 0) {
|
19047 | following = state.input.charCodeAt(state.position + 1);
|
19048 | _line = state.line;
|
19049 | _pos = state.position;
|
19050 |
|
19051 |
|
19052 |
|
19053 |
|
19054 |
|
19055 | if ((ch === 0x3F || ch === 0x3A) && is_WS_OR_EOL(following)) {
|
19056 |
|
19057 | if (ch === 0x3F) {
|
19058 | if (atExplicitKey) {
|
19059 | storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
19060 | keyTag = keyNode = valueNode = null;
|
19061 | }
|
19062 |
|
19063 | detected = true;
|
19064 | atExplicitKey = true;
|
19065 | allowCompact = true;
|
19066 |
|
19067 | } else if (atExplicitKey) {
|
19068 |
|
19069 | atExplicitKey = false;
|
19070 | allowCompact = true;
|
19071 |
|
19072 | } else {
|
19073 | throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
|
19074 | }
|
19075 |
|
19076 | state.position += 1;
|
19077 | ch = following;
|
19078 |
|
19079 |
|
19080 |
|
19081 |
|
19082 | } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
19083 |
|
19084 | if (state.line === _line) {
|
19085 | ch = state.input.charCodeAt(state.position);
|
19086 |
|
19087 | while (is_WHITE_SPACE(ch)) {
|
19088 | ch = state.input.charCodeAt(++state.position);
|
19089 | }
|
19090 |
|
19091 | if (ch === 0x3A) {
|
19092 | ch = state.input.charCodeAt(++state.position);
|
19093 |
|
19094 | if (!is_WS_OR_EOL(ch)) {
|
19095 | throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
|
19096 | }
|
19097 |
|
19098 | if (atExplicitKey) {
|
19099 | storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
19100 | keyTag = keyNode = valueNode = null;
|
19101 | }
|
19102 |
|
19103 | detected = true;
|
19104 | atExplicitKey = false;
|
19105 | allowCompact = false;
|
19106 | keyTag = state.tag;
|
19107 | keyNode = state.result;
|
19108 |
|
19109 | } else if (detected) {
|
19110 | throwError(state, 'can not read an implicit mapping pair; a colon is missed');
|
19111 |
|
19112 | } else {
|
19113 | state.tag = _tag;
|
19114 | state.anchor = _anchor;
|
19115 | return true;
|
19116 | }
|
19117 |
|
19118 | } else if (detected) {
|
19119 | throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
|
19120 |
|
19121 | } else {
|
19122 | state.tag = _tag;
|
19123 | state.anchor = _anchor;
|
19124 | return true;
|
19125 | }
|
19126 |
|
19127 | } else {
|
19128 | break;
|
19129 | }
|
19130 |
|
19131 |
|
19132 |
|
19133 |
|
19134 | if (state.line === _line || state.lineIndent > nodeIndent) {
|
19135 | if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
19136 | if (atExplicitKey) {
|
19137 | keyNode = state.result;
|
19138 | } else {
|
19139 | valueNode = state.result;
|
19140 | }
|
19141 | }
|
19142 |
|
19143 | if (!atExplicitKey) {
|
19144 | storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
19145 | keyTag = keyNode = valueNode = null;
|
19146 | }
|
19147 |
|
19148 | skipSeparationSpace(state, true, -1);
|
19149 | ch = state.input.charCodeAt(state.position);
|
19150 | }
|
19151 |
|
19152 | if (state.lineIndent > nodeIndent && (ch !== 0)) {
|
19153 | throwError(state, 'bad indentation of a mapping entry');
|
19154 | } else if (state.lineIndent < nodeIndent) {
|
19155 | break;
|
19156 | }
|
19157 | }
|
19158 |
|
19159 |
|
19160 |
|
19161 |
|
19162 |
|
19163 |
|
19164 | if (atExplicitKey) {
|
19165 | storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
19166 | }
|
19167 |
|
19168 |
|
19169 | if (detected) {
|
19170 | state.tag = _tag;
|
19171 | state.anchor = _anchor;
|
19172 | state.kind = 'mapping';
|
19173 | state.result = _result;
|
19174 | }
|
19175 |
|
19176 | return detected;
|
19177 | }
|
19178 |
|
19179 | function readTagProperty(state) {
|
19180 | var _position,
|
19181 | isVerbatim = false,
|
19182 | isNamed = false,
|
19183 | tagHandle,
|
19184 | tagName,
|
19185 | ch;
|
19186 |
|
19187 | ch = state.input.charCodeAt(state.position);
|
19188 |
|
19189 | if (ch !== 0x21) return false;
|
19190 |
|
19191 | if (state.tag !== null) {
|
19192 | throwError(state, 'duplication of a tag property');
|
19193 | }
|
19194 |
|
19195 | ch = state.input.charCodeAt(++state.position);
|
19196 |
|
19197 | if (ch === 0x3C) {
|
19198 | isVerbatim = true;
|
19199 | ch = state.input.charCodeAt(++state.position);
|
19200 |
|
19201 | } else if (ch === 0x21) {
|
19202 | isNamed = true;
|
19203 | tagHandle = '!!';
|
19204 | ch = state.input.charCodeAt(++state.position);
|
19205 |
|
19206 | } else {
|
19207 | tagHandle = '!';
|
19208 | }
|
19209 |
|
19210 | _position = state.position;
|
19211 |
|
19212 | if (isVerbatim) {
|
19213 | do { ch = state.input.charCodeAt(++state.position); }
|
19214 | while (ch !== 0 && ch !== 0x3E);
|
19215 |
|
19216 | if (state.position < state.length) {
|
19217 | tagName = state.input.slice(_position, state.position);
|
19218 | ch = state.input.charCodeAt(++state.position);
|
19219 | } else {
|
19220 | throwError(state, 'unexpected end of the stream within a verbatim tag');
|
19221 | }
|
19222 | } else {
|
19223 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
19224 |
|
19225 | if (ch === 0x21) {
|
19226 | if (!isNamed) {
|
19227 | tagHandle = state.input.slice(_position - 1, state.position + 1);
|
19228 |
|
19229 | if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
19230 | throwError(state, 'named tag handle cannot contain such characters');
|
19231 | }
|
19232 |
|
19233 | isNamed = true;
|
19234 | _position = state.position + 1;
|
19235 | } else {
|
19236 | throwError(state, 'tag suffix cannot contain exclamation marks');
|
19237 | }
|
19238 | }
|
19239 |
|
19240 | ch = state.input.charCodeAt(++state.position);
|
19241 | }
|
19242 |
|
19243 | tagName = state.input.slice(_position, state.position);
|
19244 |
|
19245 | if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
19246 | throwError(state, 'tag suffix cannot contain flow indicator characters');
|
19247 | }
|
19248 | }
|
19249 |
|
19250 | if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
19251 | throwError(state, 'tag name cannot contain such characters: ' + tagName);
|
19252 | }
|
19253 |
|
19254 | if (isVerbatim) {
|
19255 | state.tag = tagName;
|
19256 |
|
19257 | } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
19258 | state.tag = state.tagMap[tagHandle] + tagName;
|
19259 |
|
19260 | } else if (tagHandle === '!') {
|
19261 | state.tag = '!' + tagName;
|
19262 |
|
19263 | } else if (tagHandle === '!!') {
|
19264 | state.tag = 'tag:yaml.org,2002:' + tagName;
|
19265 |
|
19266 | } else {
|
19267 | throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
19268 | }
|
19269 |
|
19270 | return true;
|
19271 | }
|
19272 |
|
19273 | function readAnchorProperty(state) {
|
19274 | var _position,
|
19275 | ch;
|
19276 |
|
19277 | ch = state.input.charCodeAt(state.position);
|
19278 |
|
19279 | if (ch !== 0x26) return false;
|
19280 |
|
19281 | if (state.anchor !== null) {
|
19282 | throwError(state, 'duplication of an anchor property');
|
19283 | }
|
19284 |
|
19285 | ch = state.input.charCodeAt(++state.position);
|
19286 | _position = state.position;
|
19287 |
|
19288 | while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
19289 | ch = state.input.charCodeAt(++state.position);
|
19290 | }
|
19291 |
|
19292 | if (state.position === _position) {
|
19293 | throwError(state, 'name of an anchor node must contain at least one character');
|
19294 | }
|
19295 |
|
19296 | state.anchor = state.input.slice(_position, state.position);
|
19297 | return true;
|
19298 | }
|
19299 |
|
19300 | function readAlias(state) {
|
19301 | var _position, alias,
|
19302 | ch;
|
19303 |
|
19304 | ch = state.input.charCodeAt(state.position);
|
19305 |
|
19306 | if (ch !== 0x2A) return false;
|
19307 |
|
19308 | ch = state.input.charCodeAt(++state.position);
|
19309 | _position = state.position;
|
19310 |
|
19311 | while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
19312 | ch = state.input.charCodeAt(++state.position);
|
19313 | }
|
19314 |
|
19315 | if (state.position === _position) {
|
19316 | throwError(state, 'name of an alias node must contain at least one character');
|
19317 | }
|
19318 |
|
19319 | alias = state.input.slice(_position, state.position);
|
19320 |
|
19321 | if (!state.anchorMap.hasOwnProperty(alias)) {
|
19322 | throwError(state, 'unidentified alias "' + alias + '"');
|
19323 | }
|
19324 |
|
19325 | state.result = state.anchorMap[alias];
|
19326 | skipSeparationSpace(state, true, -1);
|
19327 | return true;
|
19328 | }
|
19329 |
|
19330 | function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
19331 | var allowBlockStyles,
|
19332 | allowBlockScalars,
|
19333 | allowBlockCollections,
|
19334 | indentStatus = 1,
|
19335 | atNewLine = false,
|
19336 | hasContent = false,
|
19337 | typeIndex,
|
19338 | typeQuantity,
|
19339 | type,
|
19340 | flowIndent,
|
19341 | blockIndent;
|
19342 |
|
19343 | if (state.listener !== null) {
|
19344 | state.listener('open', state);
|
19345 | }
|
19346 |
|
19347 | state.tag = null;
|
19348 | state.anchor = null;
|
19349 | state.kind = null;
|
19350 | state.result = null;
|
19351 |
|
19352 | allowBlockStyles = allowBlockScalars = allowBlockCollections =
|
19353 | CONTEXT_BLOCK_OUT === nodeContext ||
|
19354 | CONTEXT_BLOCK_IN === nodeContext;
|
19355 |
|
19356 | if (allowToSeek) {
|
19357 | if (skipSeparationSpace(state, true, -1)) {
|
19358 | atNewLine = true;
|
19359 |
|
19360 | if (state.lineIndent > parentIndent) {
|
19361 | indentStatus = 1;
|
19362 | } else if (state.lineIndent === parentIndent) {
|
19363 | indentStatus = 0;
|
19364 | } else if (state.lineIndent < parentIndent) {
|
19365 | indentStatus = -1;
|
19366 | }
|
19367 | }
|
19368 | }
|
19369 |
|
19370 | if (indentStatus === 1) {
|
19371 | while (readTagProperty(state) || readAnchorProperty(state)) {
|
19372 | if (skipSeparationSpace(state, true, -1)) {
|
19373 | atNewLine = true;
|
19374 | allowBlockCollections = allowBlockStyles;
|
19375 |
|
19376 | if (state.lineIndent > parentIndent) {
|
19377 | indentStatus = 1;
|
19378 | } else if (state.lineIndent === parentIndent) {
|
19379 | indentStatus = 0;
|
19380 | } else if (state.lineIndent < parentIndent) {
|
19381 | indentStatus = -1;
|
19382 | }
|
19383 | } else {
|
19384 | allowBlockCollections = false;
|
19385 | }
|
19386 | }
|
19387 | }
|
19388 |
|
19389 | if (allowBlockCollections) {
|
19390 | allowBlockCollections = atNewLine || allowCompact;
|
19391 | }
|
19392 |
|
19393 | if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
19394 | if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
19395 | flowIndent = parentIndent;
|
19396 | } else {
|
19397 | flowIndent = parentIndent + 1;
|
19398 | }
|
19399 |
|
19400 | blockIndent = state.position - state.lineStart;
|
19401 |
|
19402 | if (indentStatus === 1) {
|
19403 | if (allowBlockCollections &&
|
19404 | (readBlockSequence(state, blockIndent) ||
|
19405 | readBlockMapping(state, blockIndent, flowIndent)) ||
|
19406 | readFlowCollection(state, flowIndent)) {
|
19407 | hasContent = true;
|
19408 | } else {
|
19409 | if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
|
19410 | readSingleQuotedScalar(state, flowIndent) ||
|
19411 | readDoubleQuotedScalar(state, flowIndent)) {
|
19412 | hasContent = true;
|
19413 |
|
19414 | } else if (readAlias(state)) {
|
19415 | hasContent = true;
|
19416 |
|
19417 | if (state.tag !== null || state.anchor !== null) {
|
19418 | throwError(state, 'alias node should not have any properties');
|
19419 | }
|
19420 |
|
19421 | } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
19422 | hasContent = true;
|
19423 |
|
19424 | if (state.tag === null) {
|
19425 | state.tag = '?';
|
19426 | }
|
19427 | }
|
19428 |
|
19429 | if (state.anchor !== null) {
|
19430 | state.anchorMap[state.anchor] = state.result;
|
19431 | }
|
19432 | }
|
19433 | } else if (indentStatus === 0) {
|
19434 |
|
19435 |
|
19436 | hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
19437 | }
|
19438 | }
|
19439 |
|
19440 | if (state.tag !== null && state.tag !== '!') {
|
19441 | if (state.tag === '?') {
|
19442 |
|
19443 |
|
19444 |
|
19445 |
|
19446 |
|
19447 |
|
19448 | if (state.result !== null && state.kind !== 'scalar') {
|
19449 | throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
19450 | }
|
19451 |
|
19452 | for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
19453 | type = state.implicitTypes[typeIndex];
|
19454 |
|
19455 | if (type.resolve(state.result)) {
|
19456 | state.result = type.construct(state.result);
|
19457 | state.tag = type.tag;
|
19458 | if (state.anchor !== null) {
|
19459 | state.anchorMap[state.anchor] = state.result;
|
19460 | }
|
19461 | break;
|
19462 | }
|
19463 | }
|
19464 | } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
|
19465 | type = state.typeMap[state.kind || 'fallback'][state.tag];
|
19466 |
|
19467 | if (state.result !== null && type.kind !== state.kind) {
|
19468 | throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
19469 | }
|
19470 |
|
19471 | if (!type.resolve(state.result)) {
|
19472 | throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
|
19473 | } else {
|
19474 | state.result = type.construct(state.result);
|
19475 | if (state.anchor !== null) {
|
19476 | state.anchorMap[state.anchor] = state.result;
|
19477 | }
|
19478 | }
|
19479 | } else {
|
19480 | throwError(state, 'unknown tag !<' + state.tag + '>');
|
19481 | }
|
19482 | }
|
19483 |
|
19484 | if (state.listener !== null) {
|
19485 | state.listener('close', state);
|
19486 | }
|
19487 | return state.tag !== null || state.anchor !== null || hasContent;
|
19488 | }
|
19489 |
|
19490 | function readDocument(state) {
|
19491 | var documentStart = state.position,
|
19492 | _position,
|
19493 | directiveName,
|
19494 | directiveArgs,
|
19495 | hasDirectives = false,
|
19496 | ch;
|
19497 |
|
19498 | state.version = null;
|
19499 | state.checkLineBreaks = state.legacy;
|
19500 | state.tagMap = {};
|
19501 | state.anchorMap = {};
|
19502 |
|
19503 | while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
19504 | skipSeparationSpace(state, true, -1);
|
19505 |
|
19506 | ch = state.input.charCodeAt(state.position);
|
19507 |
|
19508 | if (state.lineIndent > 0 || ch !== 0x25) {
|
19509 | break;
|
19510 | }
|
19511 |
|
19512 | hasDirectives = true;
|
19513 | ch = state.input.charCodeAt(++state.position);
|
19514 | _position = state.position;
|
19515 |
|
19516 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
19517 | ch = state.input.charCodeAt(++state.position);
|
19518 | }
|
19519 |
|
19520 | directiveName = state.input.slice(_position, state.position);
|
19521 | directiveArgs = [];
|
19522 |
|
19523 | if (directiveName.length < 1) {
|
19524 | throwError(state, 'directive name must not be less than one character in length');
|
19525 | }
|
19526 |
|
19527 | while (ch !== 0) {
|
19528 | while (is_WHITE_SPACE(ch)) {
|
19529 | ch = state.input.charCodeAt(++state.position);
|
19530 | }
|
19531 |
|
19532 | if (ch === 0x23) {
|
19533 | do { ch = state.input.charCodeAt(++state.position); }
|
19534 | while (ch !== 0 && !is_EOL(ch));
|
19535 | break;
|
19536 | }
|
19537 |
|
19538 | if (is_EOL(ch)) break;
|
19539 |
|
19540 | _position = state.position;
|
19541 |
|
19542 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
19543 | ch = state.input.charCodeAt(++state.position);
|
19544 | }
|
19545 |
|
19546 | directiveArgs.push(state.input.slice(_position, state.position));
|
19547 | }
|
19548 |
|
19549 | if (ch !== 0) readLineBreak(state);
|
19550 |
|
19551 | if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
19552 | directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
19553 | } else {
|
19554 | throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
19555 | }
|
19556 | }
|
19557 |
|
19558 | skipSeparationSpace(state, true, -1);
|
19559 |
|
19560 | if (state.lineIndent === 0 &&
|
19561 | state.input.charCodeAt(state.position) === 0x2D &&
|
19562 | state.input.charCodeAt(state.position + 1) === 0x2D &&
|
19563 | state.input.charCodeAt(state.position + 2) === 0x2D) {
|
19564 | state.position += 3;
|
19565 | skipSeparationSpace(state, true, -1);
|
19566 |
|
19567 | } else if (hasDirectives) {
|
19568 | throwError(state, 'directives end mark is expected');
|
19569 | }
|
19570 |
|
19571 | composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
19572 | skipSeparationSpace(state, true, -1);
|
19573 |
|
19574 | if (state.checkLineBreaks &&
|
19575 | PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
19576 | throwWarning(state, 'non-ASCII line breaks are interpreted as content');
|
19577 | }
|
19578 |
|
19579 | state.documents.push(state.result);
|
19580 |
|
19581 | if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
19582 |
|
19583 | if (state.input.charCodeAt(state.position) === 0x2E) {
|
19584 | state.position += 3;
|
19585 | skipSeparationSpace(state, true, -1);
|
19586 | }
|
19587 | return;
|
19588 | }
|
19589 |
|
19590 | if (state.position < (state.length - 1)) {
|
19591 | throwError(state, 'end of the stream or a document separator is expected');
|
19592 | } else {
|
19593 | return;
|
19594 | }
|
19595 | }
|
19596 |
|
19597 |
|
19598 | function loadDocuments(input, options) {
|
19599 | input = String(input);
|
19600 | options = options || {};
|
19601 |
|
19602 | if (input.length !== 0) {
|
19603 |
|
19604 |
|
19605 | if (input.charCodeAt(input.length - 1) !== 0x0A &&
|
19606 | input.charCodeAt(input.length - 1) !== 0x0D) {
|
19607 | input += '\n';
|
19608 | }
|
19609 |
|
19610 |
|
19611 | if (input.charCodeAt(0) === 0xFEFF) {
|
19612 | input = input.slice(1);
|
19613 | }
|
19614 | }
|
19615 |
|
19616 | var state = new State(input, options);
|
19617 |
|
19618 | var nullpos = input.indexOf('\0');
|
19619 |
|
19620 | if (nullpos !== -1) {
|
19621 | state.position = nullpos;
|
19622 | throwError(state, 'null byte is not allowed in input');
|
19623 | }
|
19624 |
|
19625 |
|
19626 | state.input += '\0';
|
19627 |
|
19628 | while (state.input.charCodeAt(state.position) === 0x20) {
|
19629 | state.lineIndent += 1;
|
19630 | state.position += 1;
|
19631 | }
|
19632 |
|
19633 | while (state.position < (state.length - 1)) {
|
19634 | readDocument(state);
|
19635 | }
|
19636 |
|
19637 | return state.documents;
|
19638 | }
|
19639 |
|
19640 |
|
19641 | function loadAll(input, iterator, options) {
|
19642 | if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
|
19643 | options = iterator;
|
19644 | iterator = null;
|
19645 | }
|
19646 |
|
19647 | var documents = loadDocuments(input, options);
|
19648 |
|
19649 | if (typeof iterator !== 'function') {
|
19650 | return documents;
|
19651 | }
|
19652 |
|
19653 | for (var index = 0, length = documents.length; index < length; index += 1) {
|
19654 | iterator(documents[index]);
|
19655 | }
|
19656 | }
|
19657 |
|
19658 |
|
19659 | function load(input, options) {
|
19660 | var documents = loadDocuments(input, options);
|
19661 |
|
19662 | if (documents.length === 0) {
|
19663 |
|
19664 | return undefined;
|
19665 | } else if (documents.length === 1) {
|
19666 | return documents[0];
|
19667 | }
|
19668 | throw new YAMLException('expected a single document in the stream, but found more');
|
19669 | }
|
19670 |
|
19671 |
|
19672 | function safeLoadAll(input, iterator, options) {
|
19673 | if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
|
19674 | options = iterator;
|
19675 | iterator = null;
|
19676 | }
|
19677 |
|
19678 | return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
19679 | }
|
19680 |
|
19681 |
|
19682 | function safeLoad(input, options) {
|
19683 | return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
19684 | }
|
19685 |
|
19686 |
|
19687 | module.exports.loadAll = loadAll;
|
19688 | module.exports.load = load;
|
19689 | module.exports.safeLoadAll = safeLoadAll;
|
19690 | module.exports.safeLoad = safeLoad;
|
19691 |
|
19692 |
|
19693 | }),
|
19694 |
|
19695 | (function(module, exports, __webpack_require__) {
|
19696 |
|
19697 | "use strict";
|
19698 |
|
19699 |
|
19700 |
|
19701 | var common = __webpack_require__(42);
|
19702 |
|
19703 |
|
19704 | function Mark(name, buffer, position, line, column) {
|
19705 | this.name = name;
|
19706 | this.buffer = buffer;
|
19707 | this.position = position;
|
19708 | this.line = line;
|
19709 | this.column = column;
|
19710 | }
|
19711 |
|
19712 |
|
19713 | Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
|
19714 | var head, start, tail, end, snippet;
|
19715 |
|
19716 | if (!this.buffer) return null;
|
19717 |
|
19718 | indent = indent || 4;
|
19719 | maxLength = maxLength || 75;
|
19720 |
|
19721 | head = '';
|
19722 | start = this.position;
|
19723 |
|
19724 | while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
|
19725 | start -= 1;
|
19726 | if (this.position - start > (maxLength / 2 - 1)) {
|
19727 | head = ' ... ';
|
19728 | start += 5;
|
19729 | break;
|
19730 | }
|
19731 | }
|
19732 |
|
19733 | tail = '';
|
19734 | end = this.position;
|
19735 |
|
19736 | while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
|
19737 | end += 1;
|
19738 | if (end - this.position > (maxLength / 2 - 1)) {
|
19739 | tail = ' ... ';
|
19740 | end -= 5;
|
19741 | break;
|
19742 | }
|
19743 | }
|
19744 |
|
19745 | snippet = this.buffer.slice(start, end);
|
19746 |
|
19747 | return common.repeat(' ', indent) + head + snippet + tail + '\n' +
|
19748 | common.repeat(' ', indent + this.position - start + head.length) + '^';
|
19749 | };
|
19750 |
|
19751 |
|
19752 | Mark.prototype.toString = function toString(compact) {
|
19753 | var snippet, where = '';
|
19754 |
|
19755 | if (this.name) {
|
19756 | where += 'in "' + this.name + '" ';
|
19757 | }
|
19758 |
|
19759 | where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
|
19760 |
|
19761 | if (!compact) {
|
19762 | snippet = this.getSnippet();
|
19763 |
|
19764 | if (snippet) {
|
19765 | where += ':\n' + snippet;
|
19766 | }
|
19767 | }
|
19768 |
|
19769 | return where;
|
19770 | };
|
19771 |
|
19772 |
|
19773 | module.exports = Mark;
|
19774 |
|
19775 |
|
19776 | }),
|
19777 |
|
19778 | (function(module, exports, __webpack_require__) {
|
19779 |
|
19780 | "use strict";
|
19781 |
|
19782 |
|
19783 | var Type = __webpack_require__(8);
|
19784 |
|
19785 | module.exports = new Type('tag:yaml.org,2002:str', {
|
19786 | kind: 'scalar',
|
19787 | construct: function (data) { return data !== null ? data : ''; }
|
19788 | });
|
19789 |
|
19790 |
|
19791 | }),
|
19792 |
|
19793 | (function(module, exports, __webpack_require__) {
|
19794 |
|
19795 | "use strict";
|
19796 |
|
19797 |
|
19798 | var Type = __webpack_require__(8);
|
19799 |
|
19800 | module.exports = new Type('tag:yaml.org,2002:seq', {
|
19801 | kind: 'sequence',
|
19802 | construct: function (data) { return data !== null ? data : []; }
|
19803 | });
|
19804 |
|
19805 |
|
19806 | }),
|
19807 |
|
19808 | (function(module, exports, __webpack_require__) {
|
19809 |
|
19810 | "use strict";
|
19811 |
|
19812 |
|
19813 | var Type = __webpack_require__(8);
|
19814 |
|
19815 | module.exports = new Type('tag:yaml.org,2002:map', {
|
19816 | kind: 'mapping',
|
19817 | construct: function (data) { return data !== null ? data : {}; }
|
19818 | });
|
19819 |
|
19820 |
|
19821 | }),
|
19822 |
|
19823 | (function(module, exports, __webpack_require__) {
|
19824 |
|
19825 | "use strict";
|
19826 |
|
19827 |
|
19828 | var Type = __webpack_require__(8);
|
19829 |
|
19830 | function resolveYamlNull(data) {
|
19831 | if (data === null) return true;
|
19832 |
|
19833 | var max = data.length;
|
19834 |
|
19835 | return (max === 1 && data === '~') ||
|
19836 | (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
|
19837 | }
|
19838 |
|
19839 | function constructYamlNull() {
|
19840 | return null;
|
19841 | }
|
19842 |
|
19843 | function isNull(object) {
|
19844 | return object === null;
|
19845 | }
|
19846 |
|
19847 | module.exports = new Type('tag:yaml.org,2002:null', {
|
19848 | kind: 'scalar',
|
19849 | resolve: resolveYamlNull,
|
19850 | construct: constructYamlNull,
|
19851 | predicate: isNull,
|
19852 | represent: {
|
19853 | canonical: function () { return '~'; },
|
19854 | lowercase: function () { return 'null'; },
|
19855 | uppercase: function () { return 'NULL'; },
|
19856 | camelcase: function () { return 'Null'; }
|
19857 | },
|
19858 | defaultStyle: 'lowercase'
|
19859 | });
|
19860 |
|
19861 |
|
19862 | }),
|
19863 |
|
19864 | (function(module, exports, __webpack_require__) {
|
19865 |
|
19866 | "use strict";
|
19867 |
|
19868 |
|
19869 | var Type = __webpack_require__(8);
|
19870 |
|
19871 | function resolveYamlBoolean(data) {
|
19872 | if (data === null) return false;
|
19873 |
|
19874 | var max = data.length;
|
19875 |
|
19876 | return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
|
19877 | (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
|
19878 | }
|
19879 |
|
19880 | function constructYamlBoolean(data) {
|
19881 | return data === 'true' ||
|
19882 | data === 'True' ||
|
19883 | data === 'TRUE';
|
19884 | }
|
19885 |
|
19886 | function isBoolean(object) {
|
19887 | return Object.prototype.toString.call(object) === '[object Boolean]';
|
19888 | }
|
19889 |
|
19890 | module.exports = new Type('tag:yaml.org,2002:bool', {
|
19891 | kind: 'scalar',
|
19892 | resolve: resolveYamlBoolean,
|
19893 | construct: constructYamlBoolean,
|
19894 | predicate: isBoolean,
|
19895 | represent: {
|
19896 | lowercase: function (object) { return object ? 'true' : 'false'; },
|
19897 | uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
|
19898 | camelcase: function (object) { return object ? 'True' : 'False'; }
|
19899 | },
|
19900 | defaultStyle: 'lowercase'
|
19901 | });
|
19902 |
|
19903 |
|
19904 | }),
|
19905 |
|
19906 | (function(module, exports, __webpack_require__) {
|
19907 |
|
19908 | "use strict";
|
19909 |
|
19910 |
|
19911 | var common = __webpack_require__(42);
|
19912 | var Type = __webpack_require__(8);
|
19913 |
|
19914 | function isHexCode(c) {
|
19915 | return ((0x30 <= c) && (c <= 0x39)) ||
|
19916 | ((0x41 <= c) && (c <= 0x46)) ||
|
19917 | ((0x61 <= c) && (c <= 0x66));
|
19918 | }
|
19919 |
|
19920 | function isOctCode(c) {
|
19921 | return ((0x30 <= c) && (c <= 0x37));
|
19922 | }
|
19923 |
|
19924 | function isDecCode(c) {
|
19925 | return ((0x30 <= c) && (c <= 0x39));
|
19926 | }
|
19927 |
|
19928 | function resolveYamlInteger(data) {
|
19929 | if (data === null) return false;
|
19930 |
|
19931 | var max = data.length,
|
19932 | index = 0,
|
19933 | hasDigits = false,
|
19934 | ch;
|
19935 |
|
19936 | if (!max) return false;
|
19937 |
|
19938 | ch = data[index];
|
19939 |
|
19940 |
|
19941 | if (ch === '-' || ch === '+') {
|
19942 | ch = data[++index];
|
19943 | }
|
19944 |
|
19945 | if (ch === '0') {
|
19946 |
|
19947 | if (index + 1 === max) return true;
|
19948 | ch = data[++index];
|
19949 |
|
19950 |
|
19951 |
|
19952 | if (ch === 'b') {
|
19953 |
|
19954 | index++;
|
19955 |
|
19956 | for (; index < max; index++) {
|
19957 | ch = data[index];
|
19958 | if (ch === '_') continue;
|
19959 | if (ch !== '0' && ch !== '1') return false;
|
19960 | hasDigits = true;
|
19961 | }
|
19962 | return hasDigits && ch !== '_';
|
19963 | }
|
19964 |
|
19965 |
|
19966 | if (ch === 'x') {
|
19967 |
|
19968 | index++;
|
19969 |
|
19970 | for (; index < max; index++) {
|
19971 | ch = data[index];
|
19972 | if (ch === '_') continue;
|
19973 | if (!isHexCode(data.charCodeAt(index))) return false;
|
19974 | hasDigits = true;
|
19975 | }
|
19976 | return hasDigits && ch !== '_';
|
19977 | }
|
19978 |
|
19979 |
|
19980 | for (; index < max; index++) {
|
19981 | ch = data[index];
|
19982 | if (ch === '_') continue;
|
19983 | if (!isOctCode(data.charCodeAt(index))) return false;
|
19984 | hasDigits = true;
|
19985 | }
|
19986 | return hasDigits && ch !== '_';
|
19987 | }
|
19988 |
|
19989 |
|
19990 |
|
19991 |
|
19992 | if (ch === '_') return false;
|
19993 |
|
19994 | for (; index < max; index++) {
|
19995 | ch = data[index];
|
19996 | if (ch === '_') continue;
|
19997 | if (ch === ':') break;
|
19998 | if (!isDecCode(data.charCodeAt(index))) {
|
19999 | return false;
|
20000 | }
|
20001 | hasDigits = true;
|
20002 | }
|
20003 |
|
20004 |
|
20005 | if (!hasDigits || ch === '_') return false;
|
20006 |
|
20007 |
|
20008 | if (ch !== ':') return true;
|
20009 |
|
20010 |
|
20011 | return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
|
20012 | }
|
20013 |
|
20014 | function constructYamlInteger(data) {
|
20015 | var value = data, sign = 1, ch, base, digits = [];
|
20016 |
|
20017 | if (value.indexOf('_') !== -1) {
|
20018 | value = value.replace(/_/g, '');
|
20019 | }
|
20020 |
|
20021 | ch = value[0];
|
20022 |
|
20023 | if (ch === '-' || ch === '+') {
|
20024 | if (ch === '-') sign = -1;
|
20025 | value = value.slice(1);
|
20026 | ch = value[0];
|
20027 | }
|
20028 |
|
20029 | if (value === '0') return 0;
|
20030 |
|
20031 | if (ch === '0') {
|
20032 | if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
|
20033 | if (value[1] === 'x') return sign * parseInt(value, 16);
|
20034 | return sign * parseInt(value, 8);
|
20035 | }
|
20036 |
|
20037 | if (value.indexOf(':') !== -1) {
|
20038 | value.split(':').forEach(function (v) {
|
20039 | digits.unshift(parseInt(v, 10));
|
20040 | });
|
20041 |
|
20042 | value = 0;
|
20043 | base = 1;
|
20044 |
|
20045 | digits.forEach(function (d) {
|
20046 | value += (d * base);
|
20047 | base *= 60;
|
20048 | });
|
20049 |
|
20050 | return sign * value;
|
20051 |
|
20052 | }
|
20053 |
|
20054 | return sign * parseInt(value, 10);
|
20055 | }
|
20056 |
|
20057 | function isInteger(object) {
|
20058 | return (Object.prototype.toString.call(object)) === '[object Number]' &&
|
20059 | (object % 1 === 0 && !common.isNegativeZero(object));
|
20060 | }
|
20061 |
|
20062 | module.exports = new Type('tag:yaml.org,2002:int', {
|
20063 | kind: 'scalar',
|
20064 | resolve: resolveYamlInteger,
|
20065 | construct: constructYamlInteger,
|
20066 | predicate: isInteger,
|
20067 | represent: {
|
20068 | binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
|
20069 | octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
|
20070 | decimal: function (obj) { return obj.toString(10); },
|
20071 |
|
20072 | hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
|
20073 | },
|
20074 | defaultStyle: 'decimal',
|
20075 | styleAliases: {
|
20076 | binary: [ 2, 'bin' ],
|
20077 | octal: [ 8, 'oct' ],
|
20078 | decimal: [ 10, 'dec' ],
|
20079 | hexadecimal: [ 16, 'hex' ]
|
20080 | }
|
20081 | });
|
20082 |
|
20083 |
|
20084 | }),
|
20085 |
|
20086 | (function(module, exports, __webpack_require__) {
|
20087 |
|
20088 | "use strict";
|
20089 |
|
20090 |
|
20091 | var common = __webpack_require__(42);
|
20092 | var Type = __webpack_require__(8);
|
20093 |
|
20094 | var YAML_FLOAT_PATTERN = new RegExp(
|
20095 |
|
20096 | '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
|
20097 |
|
20098 |
|
20099 | '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
|
20100 |
|
20101 | '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
|
20102 |
|
20103 | '|[-+]?\\.(?:inf|Inf|INF)' +
|
20104 |
|
20105 | '|\\.(?:nan|NaN|NAN))$');
|
20106 |
|
20107 | function resolveYamlFloat(data) {
|
20108 | if (data === null) return false;
|
20109 |
|
20110 | if (!YAML_FLOAT_PATTERN.test(data) ||
|
20111 |
|
20112 |
|
20113 | data[data.length - 1] === '_') {
|
20114 | return false;
|
20115 | }
|
20116 |
|
20117 | return true;
|
20118 | }
|
20119 |
|
20120 | function constructYamlFloat(data) {
|
20121 | var value, sign, base, digits;
|
20122 |
|
20123 | value = data.replace(/_/g, '').toLowerCase();
|
20124 | sign = value[0] === '-' ? -1 : 1;
|
20125 | digits = [];
|
20126 |
|
20127 | if ('+-'.indexOf(value[0]) >= 0) {
|
20128 | value = value.slice(1);
|
20129 | }
|
20130 |
|
20131 | if (value === '.inf') {
|
20132 | return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
20133 |
|
20134 | } else if (value === '.nan') {
|
20135 | return NaN;
|
20136 |
|
20137 | } else if (value.indexOf(':') >= 0) {
|
20138 | value.split(':').forEach(function (v) {
|
20139 | digits.unshift(parseFloat(v, 10));
|
20140 | });
|
20141 |
|
20142 | value = 0.0;
|
20143 | base = 1;
|
20144 |
|
20145 | digits.forEach(function (d) {
|
20146 | value += d * base;
|
20147 | base *= 60;
|
20148 | });
|
20149 |
|
20150 | return sign * value;
|
20151 |
|
20152 | }
|
20153 | return sign * parseFloat(value, 10);
|
20154 | }
|
20155 |
|
20156 |
|
20157 | var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
20158 |
|
20159 | function representYamlFloat(object, style) {
|
20160 | var res;
|
20161 |
|
20162 | if (isNaN(object)) {
|
20163 | switch (style) {
|
20164 | case 'lowercase': return '.nan';
|
20165 | case 'uppercase': return '.NAN';
|
20166 | case 'camelcase': return '.NaN';
|
20167 | }
|
20168 | } else if (Number.POSITIVE_INFINITY === object) {
|
20169 | switch (style) {
|
20170 | case 'lowercase': return '.inf';
|
20171 | case 'uppercase': return '.INF';
|
20172 | case 'camelcase': return '.Inf';
|
20173 | }
|
20174 | } else if (Number.NEGATIVE_INFINITY === object) {
|
20175 | switch (style) {
|
20176 | case 'lowercase': return '-.inf';
|
20177 | case 'uppercase': return '-.INF';
|
20178 | case 'camelcase': return '-.Inf';
|
20179 | }
|
20180 | } else if (common.isNegativeZero(object)) {
|
20181 | return '-0.0';
|
20182 | }
|
20183 |
|
20184 | res = object.toString(10);
|
20185 |
|
20186 |
|
20187 |
|
20188 |
|
20189 | return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
|
20190 | }
|
20191 |
|
20192 | function isFloat(object) {
|
20193 | return (Object.prototype.toString.call(object) === '[object Number]') &&
|
20194 | (object % 1 !== 0 || common.isNegativeZero(object));
|
20195 | }
|
20196 |
|
20197 | module.exports = new Type('tag:yaml.org,2002:float', {
|
20198 | kind: 'scalar',
|
20199 | resolve: resolveYamlFloat,
|
20200 | construct: constructYamlFloat,
|
20201 | predicate: isFloat,
|
20202 | represent: representYamlFloat,
|
20203 | defaultStyle: 'lowercase'
|
20204 | });
|
20205 |
|
20206 |
|
20207 | }),
|
20208 |
|
20209 | (function(module, exports, __webpack_require__) {
|
20210 |
|
20211 | "use strict";
|
20212 |
|
20213 |
|
20214 | var Type = __webpack_require__(8);
|
20215 |
|
20216 | var YAML_DATE_REGEXP = new RegExp(
|
20217 | '^([0-9][0-9][0-9][0-9])' +
|
20218 | '-([0-9][0-9])' +
|
20219 | '-([0-9][0-9])$');
|
20220 |
|
20221 | var YAML_TIMESTAMP_REGEXP = new RegExp(
|
20222 | '^([0-9][0-9][0-9][0-9])' +
|
20223 | '-([0-9][0-9]?)' +
|
20224 | '-([0-9][0-9]?)' +
|
20225 | '(?:[Tt]|[ \\t]+)' +
|
20226 | '([0-9][0-9]?)' +
|
20227 | ':([0-9][0-9])' +
|
20228 | ':([0-9][0-9])' +
|
20229 | '(?:\\.([0-9]*))?' +
|
20230 | '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' +
|
20231 | '(?::([0-9][0-9]))?))?$');
|
20232 |
|
20233 | function resolveYamlTimestamp(data) {
|
20234 | if (data === null) return false;
|
20235 | if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
20236 | if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
20237 | return false;
|
20238 | }
|
20239 |
|
20240 | function constructYamlTimestamp(data) {
|
20241 | var match, year, month, day, hour, minute, second, fraction = 0,
|
20242 | delta = null, tz_hour, tz_minute, date;
|
20243 |
|
20244 | match = YAML_DATE_REGEXP.exec(data);
|
20245 | if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
20246 |
|
20247 | if (match === null) throw new Error('Date resolve error');
|
20248 |
|
20249 |
|
20250 |
|
20251 | year = +(match[1]);
|
20252 | month = +(match[2]) - 1;
|
20253 | day = +(match[3]);
|
20254 |
|
20255 | if (!match[4]) {
|
20256 | return new Date(Date.UTC(year, month, day));
|
20257 | }
|
20258 |
|
20259 |
|
20260 |
|
20261 | hour = +(match[4]);
|
20262 | minute = +(match[5]);
|
20263 | second = +(match[6]);
|
20264 |
|
20265 | if (match[7]) {
|
20266 | fraction = match[7].slice(0, 3);
|
20267 | while (fraction.length < 3) {
|
20268 | fraction += '0';
|
20269 | }
|
20270 | fraction = +fraction;
|
20271 | }
|
20272 |
|
20273 |
|
20274 |
|
20275 | if (match[9]) {
|
20276 | tz_hour = +(match[10]);
|
20277 | tz_minute = +(match[11] || 0);
|
20278 | delta = (tz_hour * 60 + tz_minute) * 60000;
|
20279 | if (match[9] === '-') delta = -delta;
|
20280 | }
|
20281 |
|
20282 | date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
20283 |
|
20284 | if (delta) date.setTime(date.getTime() - delta);
|
20285 |
|
20286 | return date;
|
20287 | }
|
20288 |
|
20289 | function representYamlTimestamp(object /*, style*/) {
|
20290 | return object.toISOString();
|
20291 | }
|
20292 |
|
20293 | module.exports = new Type('tag:yaml.org,2002:timestamp', {
|
20294 | kind: 'scalar',
|
20295 | resolve: resolveYamlTimestamp,
|
20296 | construct: constructYamlTimestamp,
|
20297 | instanceOf: Date,
|
20298 | represent: representYamlTimestamp
|
20299 | });
|
20300 |
|
20301 |
|
20302 | }),
|
20303 |
|
20304 | (function(module, exports, __webpack_require__) {
|
20305 |
|
20306 | "use strict";
|
20307 |
|
20308 |
|
20309 | var Type = __webpack_require__(8);
|
20310 |
|
20311 | function resolveYamlMerge(data) {
|
20312 | return data === '<<' || data === null;
|
20313 | }
|
20314 |
|
20315 | module.exports = new Type('tag:yaml.org,2002:merge', {
|
20316 | kind: 'scalar',
|
20317 | resolve: resolveYamlMerge
|
20318 | });
|
20319 |
|
20320 |
|
20321 | }),
|
20322 |
|
20323 | (function(module, exports, __webpack_require__) {
|
20324 |
|
20325 | "use strict";
|
20326 | var require;
|
20327 |
|
20328 |
|
20329 |
|
20330 | var NodeBuffer;
|
20331 |
|
20332 | try {
|
20333 |
|
20334 | var _require = require;
|
20335 | NodeBuffer = __webpack_require__(29).Buffer;
|
20336 | } catch (__) {}
|
20337 |
|
20338 | var Type = __webpack_require__(8);
|
20339 |
|
20340 |
|
20341 |
|
20342 | var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
|
20343 |
|
20344 |
|
20345 | function resolveYamlBinary(data) {
|
20346 | if (data === null) return false;
|
20347 |
|
20348 | var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
20349 |
|
20350 |
|
20351 | for (idx = 0; idx < max; idx++) {
|
20352 | code = map.indexOf(data.charAt(idx));
|
20353 |
|
20354 |
|
20355 | if (code > 64) continue;
|
20356 |
|
20357 |
|
20358 | if (code < 0) return false;
|
20359 |
|
20360 | bitlen += 6;
|
20361 | }
|
20362 |
|
20363 |
|
20364 | return (bitlen % 8) === 0;
|
20365 | }
|
20366 |
|
20367 | function constructYamlBinary(data) {
|
20368 | var idx, tailbits,
|
20369 | input = data.replace(/[\r\n=]/g, ''),
|
20370 | max = input.length,
|
20371 | map = BASE64_MAP,
|
20372 | bits = 0,
|
20373 | result = [];
|
20374 |
|
20375 |
|
20376 |
|
20377 | for (idx = 0; idx < max; idx++) {
|
20378 | if ((idx % 4 === 0) && idx) {
|
20379 | result.push((bits >> 16) & 0xFF);
|
20380 | result.push((bits >> 8) & 0xFF);
|
20381 | result.push(bits & 0xFF);
|
20382 | }
|
20383 |
|
20384 | bits = (bits << 6) | map.indexOf(input.charAt(idx));
|
20385 | }
|
20386 |
|
20387 |
|
20388 |
|
20389 | tailbits = (max % 4) * 6;
|
20390 |
|
20391 | if (tailbits === 0) {
|
20392 | result.push((bits >> 16) & 0xFF);
|
20393 | result.push((bits >> 8) & 0xFF);
|
20394 | result.push(bits & 0xFF);
|
20395 | } else if (tailbits === 18) {
|
20396 | result.push((bits >> 10) & 0xFF);
|
20397 | result.push((bits >> 2) & 0xFF);
|
20398 | } else if (tailbits === 12) {
|
20399 | result.push((bits >> 4) & 0xFF);
|
20400 | }
|
20401 |
|
20402 |
|
20403 | if (NodeBuffer) {
|
20404 |
|
20405 | return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
20406 | }
|
20407 |
|
20408 | return result;
|
20409 | }
|
20410 |
|
20411 | function representYamlBinary(object /*, style*/) {
|
20412 | var result = '', bits = 0, idx, tail,
|
20413 | max = object.length,
|
20414 | map = BASE64_MAP;
|
20415 |
|
20416 |
|
20417 |
|
20418 | for (idx = 0; idx < max; idx++) {
|
20419 | if ((idx % 3 === 0) && idx) {
|
20420 | result += map[(bits >> 18) & 0x3F];
|
20421 | result += map[(bits >> 12) & 0x3F];
|
20422 | result += map[(bits >> 6) & 0x3F];
|
20423 | result += map[bits & 0x3F];
|
20424 | }
|
20425 |
|
20426 | bits = (bits << 8) + object[idx];
|
20427 | }
|
20428 |
|
20429 |
|
20430 |
|
20431 | tail = max % 3;
|
20432 |
|
20433 | if (tail === 0) {
|
20434 | result += map[(bits >> 18) & 0x3F];
|
20435 | result += map[(bits >> 12) & 0x3F];
|
20436 | result += map[(bits >> 6) & 0x3F];
|
20437 | result += map[bits & 0x3F];
|
20438 | } else if (tail === 2) {
|
20439 | result += map[(bits >> 10) & 0x3F];
|
20440 | result += map[(bits >> 4) & 0x3F];
|
20441 | result += map[(bits << 2) & 0x3F];
|
20442 | result += map[64];
|
20443 | } else if (tail === 1) {
|
20444 | result += map[(bits >> 2) & 0x3F];
|
20445 | result += map[(bits << 4) & 0x3F];
|
20446 | result += map[64];
|
20447 | result += map[64];
|
20448 | }
|
20449 |
|
20450 | return result;
|
20451 | }
|
20452 |
|
20453 | function isBinary(object) {
|
20454 | return NodeBuffer && NodeBuffer.isBuffer(object);
|
20455 | }
|
20456 |
|
20457 | module.exports = new Type('tag:yaml.org,2002:binary', {
|
20458 | kind: 'scalar',
|
20459 | resolve: resolveYamlBinary,
|
20460 | construct: constructYamlBinary,
|
20461 | predicate: isBinary,
|
20462 | represent: representYamlBinary
|
20463 | });
|
20464 |
|
20465 |
|
20466 | }),
|
20467 |
|
20468 | (function(module, exports, __webpack_require__) {
|
20469 |
|
20470 | "use strict";
|
20471 |
|
20472 |
|
20473 | exports.byteLength = byteLength
|
20474 | exports.toByteArray = toByteArray
|
20475 | exports.fromByteArray = fromByteArray
|
20476 |
|
20477 | var lookup = []
|
20478 | var revLookup = []
|
20479 | var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
|
20480 |
|
20481 | var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
20482 | for (var i = 0, len = code.length; i < len; ++i) {
|
20483 | lookup[i] = code[i]
|
20484 | revLookup[code.charCodeAt(i)] = i
|
20485 | }
|
20486 |
|
20487 |
|
20488 |
|
20489 | revLookup['-'.charCodeAt(0)] = 62
|
20490 | revLookup['_'.charCodeAt(0)] = 63
|
20491 |
|
20492 | function getLens (b64) {
|
20493 | var len = b64.length
|
20494 |
|
20495 | if (len % 4 > 0) {
|
20496 | throw new Error('Invalid string. Length must be a multiple of 4')
|
20497 | }
|
20498 |
|
20499 |
|
20500 |
|
20501 | var validLen = b64.indexOf('=')
|
20502 | if (validLen === -1) validLen = len
|
20503 |
|
20504 | var placeHoldersLen = validLen === len
|
20505 | ? 0
|
20506 | : 4 - (validLen % 4)
|
20507 |
|
20508 | return [validLen, placeHoldersLen]
|
20509 | }
|
20510 |
|
20511 |
|
20512 | function byteLength (b64) {
|
20513 | var lens = getLens(b64)
|
20514 | var validLen = lens[0]
|
20515 | var placeHoldersLen = lens[1]
|
20516 | return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
20517 | }
|
20518 |
|
20519 | function _byteLength (b64, validLen, placeHoldersLen) {
|
20520 | return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
20521 | }
|
20522 |
|
20523 | function toByteArray (b64) {
|
20524 | var tmp
|
20525 | var lens = getLens(b64)
|
20526 | var validLen = lens[0]
|
20527 | var placeHoldersLen = lens[1]
|
20528 |
|
20529 | var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
20530 |
|
20531 | var curByte = 0
|
20532 |
|
20533 |
|
20534 | var len = placeHoldersLen > 0
|
20535 | ? validLen - 4
|
20536 | : validLen
|
20537 |
|
20538 | var i
|
20539 | for (i = 0; i < len; i += 4) {
|
20540 | tmp =
|
20541 | (revLookup[b64.charCodeAt(i)] << 18) |
|
20542 | (revLookup[b64.charCodeAt(i + 1)] << 12) |
|
20543 | (revLookup[b64.charCodeAt(i + 2)] << 6) |
|
20544 | revLookup[b64.charCodeAt(i + 3)]
|
20545 | arr[curByte++] = (tmp >> 16) & 0xFF
|
20546 | arr[curByte++] = (tmp >> 8) & 0xFF
|
20547 | arr[curByte++] = tmp & 0xFF
|
20548 | }
|
20549 |
|
20550 | if (placeHoldersLen === 2) {
|
20551 | tmp =
|
20552 | (revLookup[b64.charCodeAt(i)] << 2) |
|
20553 | (revLookup[b64.charCodeAt(i + 1)] >> 4)
|
20554 | arr[curByte++] = tmp & 0xFF
|
20555 | }
|
20556 |
|
20557 | if (placeHoldersLen === 1) {
|
20558 | tmp =
|
20559 | (revLookup[b64.charCodeAt(i)] << 10) |
|
20560 | (revLookup[b64.charCodeAt(i + 1)] << 4) |
|
20561 | (revLookup[b64.charCodeAt(i + 2)] >> 2)
|
20562 | arr[curByte++] = (tmp >> 8) & 0xFF
|
20563 | arr[curByte++] = tmp & 0xFF
|
20564 | }
|
20565 |
|
20566 | return arr
|
20567 | }
|
20568 |
|
20569 | function tripletToBase64 (num) {
|
20570 | return lookup[num >> 18 & 0x3F] +
|
20571 | lookup[num >> 12 & 0x3F] +
|
20572 | lookup[num >> 6 & 0x3F] +
|
20573 | lookup[num & 0x3F]
|
20574 | }
|
20575 |
|
20576 | function encodeChunk (uint8, start, end) {
|
20577 | var tmp
|
20578 | var output = []
|
20579 | for (var i = start; i < end; i += 3) {
|
20580 | tmp =
|
20581 | ((uint8[i] << 16) & 0xFF0000) +
|
20582 | ((uint8[i + 1] << 8) & 0xFF00) +
|
20583 | (uint8[i + 2] & 0xFF)
|
20584 | output.push(tripletToBase64(tmp))
|
20585 | }
|
20586 | return output.join('')
|
20587 | }
|
20588 |
|
20589 | function fromByteArray (uint8) {
|
20590 | var tmp
|
20591 | var len = uint8.length
|
20592 | var extraBytes = len % 3
|
20593 | var parts = []
|
20594 | var maxChunkLength = 16383
|
20595 |
|
20596 |
|
20597 | for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
20598 | parts.push(encodeChunk(
|
20599 | uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
|
20600 | ))
|
20601 | }
|
20602 |
|
20603 |
|
20604 | if (extraBytes === 1) {
|
20605 | tmp = uint8[len - 1]
|
20606 | parts.push(
|
20607 | lookup[tmp >> 2] +
|
20608 | lookup[(tmp << 4) & 0x3F] +
|
20609 | '=='
|
20610 | )
|
20611 | } else if (extraBytes === 2) {
|
20612 | tmp = (uint8[len - 2] << 8) + uint8[len - 1]
|
20613 | parts.push(
|
20614 | lookup[tmp >> 10] +
|
20615 | lookup[(tmp >> 4) & 0x3F] +
|
20616 | lookup[(tmp << 2) & 0x3F] +
|
20617 | '='
|
20618 | )
|
20619 | }
|
20620 |
|
20621 | return parts.join('')
|
20622 | }
|
20623 |
|
20624 |
|
20625 | }),
|
20626 |
|
20627 | (function(module, exports) {
|
20628 |
|
20629 | exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
20630 | var e, m
|
20631 | var eLen = (nBytes * 8) - mLen - 1
|
20632 | var eMax = (1 << eLen) - 1
|
20633 | var eBias = eMax >> 1
|
20634 | var nBits = -7
|
20635 | var i = isLE ? (nBytes - 1) : 0
|
20636 | var d = isLE ? -1 : 1
|
20637 | var s = buffer[offset + i]
|
20638 |
|
20639 | i += d
|
20640 |
|
20641 | e = s & ((1 << (-nBits)) - 1)
|
20642 | s >>= (-nBits)
|
20643 | nBits += eLen
|
20644 | for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
|
20645 |
|
20646 | m = e & ((1 << (-nBits)) - 1)
|
20647 | e >>= (-nBits)
|
20648 | nBits += mLen
|
20649 | for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
|
20650 |
|
20651 | if (e === 0) {
|
20652 | e = 1 - eBias
|
20653 | } else if (e === eMax) {
|
20654 | return m ? NaN : ((s ? -1 : 1) * Infinity)
|
20655 | } else {
|
20656 | m = m + Math.pow(2, mLen)
|
20657 | e = e - eBias
|
20658 | }
|
20659 | return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
|
20660 | }
|
20661 |
|
20662 | exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
20663 | var e, m, c
|
20664 | var eLen = (nBytes * 8) - mLen - 1
|
20665 | var eMax = (1 << eLen) - 1
|
20666 | var eBias = eMax >> 1
|
20667 | var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
|
20668 | var i = isLE ? 0 : (nBytes - 1)
|
20669 | var d = isLE ? 1 : -1
|
20670 | var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
|
20671 |
|
20672 | value = Math.abs(value)
|
20673 |
|
20674 | if (isNaN(value) || value === Infinity) {
|
20675 | m = isNaN(value) ? 1 : 0
|
20676 | e = eMax
|
20677 | } else {
|
20678 | e = Math.floor(Math.log(value) / Math.LN2)
|
20679 | if (value * (c = Math.pow(2, -e)) < 1) {
|
20680 | e--
|
20681 | c *= 2
|
20682 | }
|
20683 | if (e + eBias >= 1) {
|
20684 | value += rt / c
|
20685 | } else {
|
20686 | value += rt * Math.pow(2, 1 - eBias)
|
20687 | }
|
20688 | if (value * c >= 2) {
|
20689 | e++
|
20690 | c /= 2
|
20691 | }
|
20692 |
|
20693 | if (e + eBias >= eMax) {
|
20694 | m = 0
|
20695 | e = eMax
|
20696 | } else if (e + eBias >= 1) {
|
20697 | m = ((value * c) - 1) * Math.pow(2, mLen)
|
20698 | e = e + eBias
|
20699 | } else {
|
20700 | m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
|
20701 | e = 0
|
20702 | }
|
20703 | }
|
20704 |
|
20705 | for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
|
20706 |
|
20707 | e = (e << mLen) | m
|
20708 | eLen += mLen
|
20709 | for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
|
20710 |
|
20711 | buffer[offset + i - d] |= s * 128
|
20712 | }
|
20713 |
|
20714 |
|
20715 | }),
|
20716 |
|
20717 | (function(module, exports) {
|
20718 |
|
20719 | var toString = {}.toString;
|
20720 |
|
20721 | module.exports = Array.isArray || function (arr) {
|
20722 | return toString.call(arr) == '[object Array]';
|
20723 | };
|
20724 |
|
20725 |
|
20726 | }),
|
20727 |
|
20728 | (function(module, exports, __webpack_require__) {
|
20729 |
|
20730 | "use strict";
|
20731 |
|
20732 |
|
20733 | var Type = __webpack_require__(8);
|
20734 |
|
20735 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
20736 | var _toString = Object.prototype.toString;
|
20737 |
|
20738 | function resolveYamlOmap(data) {
|
20739 | if (data === null) return true;
|
20740 |
|
20741 | var objectKeys = [], index, length, pair, pairKey, pairHasKey,
|
20742 | object = data;
|
20743 |
|
20744 | for (index = 0, length = object.length; index < length; index += 1) {
|
20745 | pair = object[index];
|
20746 | pairHasKey = false;
|
20747 |
|
20748 | if (_toString.call(pair) !== '[object Object]') return false;
|
20749 |
|
20750 | for (pairKey in pair) {
|
20751 | if (_hasOwnProperty.call(pair, pairKey)) {
|
20752 | if (!pairHasKey) pairHasKey = true;
|
20753 | else return false;
|
20754 | }
|
20755 | }
|
20756 |
|
20757 | if (!pairHasKey) return false;
|
20758 |
|
20759 | if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
20760 | else return false;
|
20761 | }
|
20762 |
|
20763 | return true;
|
20764 | }
|
20765 |
|
20766 | function constructYamlOmap(data) {
|
20767 | return data !== null ? data : [];
|
20768 | }
|
20769 |
|
20770 | module.exports = new Type('tag:yaml.org,2002:omap', {
|
20771 | kind: 'sequence',
|
20772 | resolve: resolveYamlOmap,
|
20773 | construct: constructYamlOmap
|
20774 | });
|
20775 |
|
20776 |
|
20777 | }),
|
20778 |
|
20779 | (function(module, exports, __webpack_require__) {
|
20780 |
|
20781 | "use strict";
|
20782 |
|
20783 |
|
20784 | var Type = __webpack_require__(8);
|
20785 |
|
20786 | var _toString = Object.prototype.toString;
|
20787 |
|
20788 | function resolveYamlPairs(data) {
|
20789 | if (data === null) return true;
|
20790 |
|
20791 | var index, length, pair, keys, result,
|
20792 | object = data;
|
20793 |
|
20794 | result = new Array(object.length);
|
20795 |
|
20796 | for (index = 0, length = object.length; index < length; index += 1) {
|
20797 | pair = object[index];
|
20798 |
|
20799 | if (_toString.call(pair) !== '[object Object]') return false;
|
20800 |
|
20801 | keys = Object.keys(pair);
|
20802 |
|
20803 | if (keys.length !== 1) return false;
|
20804 |
|
20805 | result[index] = [ keys[0], pair[keys[0]] ];
|
20806 | }
|
20807 |
|
20808 | return true;
|
20809 | }
|
20810 |
|
20811 | function constructYamlPairs(data) {
|
20812 | if (data === null) return [];
|
20813 |
|
20814 | var index, length, pair, keys, result,
|
20815 | object = data;
|
20816 |
|
20817 | result = new Array(object.length);
|
20818 |
|
20819 | for (index = 0, length = object.length; index < length; index += 1) {
|
20820 | pair = object[index];
|
20821 |
|
20822 | keys = Object.keys(pair);
|
20823 |
|
20824 | result[index] = [ keys[0], pair[keys[0]] ];
|
20825 | }
|
20826 |
|
20827 | return result;
|
20828 | }
|
20829 |
|
20830 | module.exports = new Type('tag:yaml.org,2002:pairs', {
|
20831 | kind: 'sequence',
|
20832 | resolve: resolveYamlPairs,
|
20833 | construct: constructYamlPairs
|
20834 | });
|
20835 |
|
20836 |
|
20837 | }),
|
20838 |
|
20839 | (function(module, exports, __webpack_require__) {
|
20840 |
|
20841 | "use strict";
|
20842 |
|
20843 |
|
20844 | var Type = __webpack_require__(8);
|
20845 |
|
20846 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
20847 |
|
20848 | function resolveYamlSet(data) {
|
20849 | if (data === null) return true;
|
20850 |
|
20851 | var key, object = data;
|
20852 |
|
20853 | for (key in object) {
|
20854 | if (_hasOwnProperty.call(object, key)) {
|
20855 | if (object[key] !== null) return false;
|
20856 | }
|
20857 | }
|
20858 |
|
20859 | return true;
|
20860 | }
|
20861 |
|
20862 | function constructYamlSet(data) {
|
20863 | return data !== null ? data : {};
|
20864 | }
|
20865 |
|
20866 | module.exports = new Type('tag:yaml.org,2002:set', {
|
20867 | kind: 'mapping',
|
20868 | resolve: resolveYamlSet,
|
20869 | construct: constructYamlSet
|
20870 | });
|
20871 |
|
20872 |
|
20873 | }),
|
20874 |
|
20875 | (function(module, exports, __webpack_require__) {
|
20876 |
|
20877 | "use strict";
|
20878 |
|
20879 |
|
20880 | var Type = __webpack_require__(8);
|
20881 |
|
20882 | function resolveJavascriptUndefined() {
|
20883 | return true;
|
20884 | }
|
20885 |
|
20886 | function constructJavascriptUndefined() {
|
20887 |
|
20888 | return undefined;
|
20889 | }
|
20890 |
|
20891 | function representJavascriptUndefined() {
|
20892 | return '';
|
20893 | }
|
20894 |
|
20895 | function isUndefined(object) {
|
20896 | return typeof object === 'undefined';
|
20897 | }
|
20898 |
|
20899 | module.exports = new Type('tag:yaml.org,2002:js/undefined', {
|
20900 | kind: 'scalar',
|
20901 | resolve: resolveJavascriptUndefined,
|
20902 | construct: constructJavascriptUndefined,
|
20903 | predicate: isUndefined,
|
20904 | represent: representJavascriptUndefined
|
20905 | });
|
20906 |
|
20907 |
|
20908 | }),
|
20909 |
|
20910 | (function(module, exports, __webpack_require__) {
|
20911 |
|
20912 | "use strict";
|
20913 |
|
20914 |
|
20915 | var Type = __webpack_require__(8);
|
20916 |
|
20917 | function resolveJavascriptRegExp(data) {
|
20918 | if (data === null) return false;
|
20919 | if (data.length === 0) return false;
|
20920 |
|
20921 | var regexp = data,
|
20922 | tail = /\/([gim]*)$/.exec(data),
|
20923 | modifiers = '';
|
20924 |
|
20925 |
|
20926 |
|
20927 | if (regexp[0] === '/') {
|
20928 | if (tail) modifiers = tail[1];
|
20929 |
|
20930 | if (modifiers.length > 3) return false;
|
20931 |
|
20932 | if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
|
20933 | }
|
20934 |
|
20935 | return true;
|
20936 | }
|
20937 |
|
20938 | function constructJavascriptRegExp(data) {
|
20939 | var regexp = data,
|
20940 | tail = /\/([gim]*)$/.exec(data),
|
20941 | modifiers = '';
|
20942 |
|
20943 |
|
20944 | if (regexp[0] === '/') {
|
20945 | if (tail) modifiers = tail[1];
|
20946 | regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
|
20947 | }
|
20948 |
|
20949 | return new RegExp(regexp, modifiers);
|
20950 | }
|
20951 |
|
20952 | function representJavascriptRegExp(object /*, style*/) {
|
20953 | var result = '/' + object.source + '/';
|
20954 |
|
20955 | if (object.global) result += 'g';
|
20956 | if (object.multiline) result += 'm';
|
20957 | if (object.ignoreCase) result += 'i';
|
20958 |
|
20959 | return result;
|
20960 | }
|
20961 |
|
20962 | function isRegExp(object) {
|
20963 | return Object.prototype.toString.call(object) === '[object RegExp]';
|
20964 | }
|
20965 |
|
20966 | module.exports = new Type('tag:yaml.org,2002:js/regexp', {
|
20967 | kind: 'scalar',
|
20968 | resolve: resolveJavascriptRegExp,
|
20969 | construct: constructJavascriptRegExp,
|
20970 | predicate: isRegExp,
|
20971 | represent: representJavascriptRegExp
|
20972 | });
|
20973 |
|
20974 |
|
20975 | }),
|
20976 |
|
20977 | (function(module, exports, __webpack_require__) {
|
20978 |
|
20979 | "use strict";
|
20980 | var require;
|
20981 |
|
20982 | var esprima;
|
20983 |
|
20984 |
|
20985 |
|
20986 |
|
20987 |
|
20988 |
|
20989 |
|
20990 |
|
20991 | try {
|
20992 |
|
20993 | var _require = require;
|
20994 | esprima = __webpack_require__(278);
|
20995 | } catch (_) {
|
20996 |
|
20997 |
|
20998 | if (typeof window !== 'undefined') esprima = window.esprima;
|
20999 | }
|
21000 |
|
21001 | var Type = __webpack_require__(8);
|
21002 |
|
21003 | function resolveJavascriptFunction(data) {
|
21004 | if (data === null) return false;
|
21005 |
|
21006 | try {
|
21007 | var source = '(' + data + ')',
|
21008 | ast = esprima.parse(source, { range: true });
|
21009 |
|
21010 | if (ast.type !== 'Program' ||
|
21011 | ast.body.length !== 1 ||
|
21012 | ast.body[0].type !== 'ExpressionStatement' ||
|
21013 | (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
|
21014 | ast.body[0].expression.type !== 'FunctionExpression')) {
|
21015 | return false;
|
21016 | }
|
21017 |
|
21018 | return true;
|
21019 | } catch (err) {
|
21020 | return false;
|
21021 | }
|
21022 | }
|
21023 |
|
21024 | function constructJavascriptFunction(data) {
|
21025 |
|
21026 |
|
21027 | var source = '(' + data + ')',
|
21028 | ast = esprima.parse(source, { range: true }),
|
21029 | params = [],
|
21030 | body;
|
21031 |
|
21032 | if (ast.type !== 'Program' ||
|
21033 | ast.body.length !== 1 ||
|
21034 | ast.body[0].type !== 'ExpressionStatement' ||
|
21035 | (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
|
21036 | ast.body[0].expression.type !== 'FunctionExpression')) {
|
21037 | throw new Error('Failed to resolve function');
|
21038 | }
|
21039 |
|
21040 | ast.body[0].expression.params.forEach(function (param) {
|
21041 | params.push(param.name);
|
21042 | });
|
21043 |
|
21044 | body = ast.body[0].expression.body.range;
|
21045 |
|
21046 |
|
21047 |
|
21048 | if (ast.body[0].expression.body.type === 'BlockStatement') {
|
21049 |
|
21050 | return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
21051 | }
|
21052 |
|
21053 |
|
21054 |
|
21055 | return new Function(params, 'return ' + source.slice(body[0], body[1]));
|
21056 | }
|
21057 |
|
21058 | function representJavascriptFunction(object /*, style*/) {
|
21059 | return object.toString();
|
21060 | }
|
21061 |
|
21062 | function isFunction(object) {
|
21063 | return Object.prototype.toString.call(object) === '[object Function]';
|
21064 | }
|
21065 |
|
21066 | module.exports = new Type('tag:yaml.org,2002:js/function', {
|
21067 | kind: 'scalar',
|
21068 | resolve: resolveJavascriptFunction,
|
21069 | construct: constructJavascriptFunction,
|
21070 | predicate: isFunction,
|
21071 | represent: representJavascriptFunction
|
21072 | });
|
21073 |
|
21074 |
|
21075 | }),
|
21076 |
|
21077 | (function(module, exports) {
|
21078 |
|
21079 | if(typeof __WEBPACK_EXTERNAL_MODULE__278__ === 'undefined') {var e = new Error("Cannot find module 'esprima'"); e.code = 'MODULE_NOT_FOUND'; throw e;}
|
21080 | module.exports = __WEBPACK_EXTERNAL_MODULE__278__;
|
21081 |
|
21082 | }),
|
21083 |
|
21084 | (function(module, exports, __webpack_require__) {
|
21085 |
|
21086 | "use strict";
|
21087 |
|
21088 |
|
21089 |
|
21090 |
|
21091 | var common = __webpack_require__(42);
|
21092 | var YAMLException = __webpack_require__(58);
|
21093 | var DEFAULT_FULL_SCHEMA = __webpack_require__(72);
|
21094 | var DEFAULT_SAFE_SCHEMA = __webpack_require__(59);
|
21095 |
|
21096 | var _toString = Object.prototype.toString;
|
21097 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
21098 |
|
21099 | var CHAR_TAB = 0x09;
|
21100 | var CHAR_LINE_FEED = 0x0A;
|
21101 | var CHAR_CARRIAGE_RETURN = 0x0D;
|
21102 | var CHAR_SPACE = 0x20;
|
21103 | var CHAR_EXCLAMATION = 0x21;
|
21104 | var CHAR_DOUBLE_QUOTE = 0x22;
|
21105 | var CHAR_SHARP = 0x23;
|
21106 | var CHAR_PERCENT = 0x25;
|
21107 | var CHAR_AMPERSAND = 0x26;
|
21108 | var CHAR_SINGLE_QUOTE = 0x27;
|
21109 | var CHAR_ASTERISK = 0x2A;
|
21110 | var CHAR_COMMA = 0x2C;
|
21111 | var CHAR_MINUS = 0x2D;
|
21112 | var CHAR_COLON = 0x3A;
|
21113 | var CHAR_EQUALS = 0x3D;
|
21114 | var CHAR_GREATER_THAN = 0x3E;
|
21115 | var CHAR_QUESTION = 0x3F;
|
21116 | var CHAR_COMMERCIAL_AT = 0x40;
|
21117 | var CHAR_LEFT_SQUARE_BRACKET = 0x5B;
|
21118 | var CHAR_RIGHT_SQUARE_BRACKET = 0x5D;
|
21119 | var CHAR_GRAVE_ACCENT = 0x60;
|
21120 | var CHAR_LEFT_CURLY_BRACKET = 0x7B;
|
21121 | var CHAR_VERTICAL_LINE = 0x7C;
|
21122 | var CHAR_RIGHT_CURLY_BRACKET = 0x7D;
|
21123 |
|
21124 | var ESCAPE_SEQUENCES = {};
|
21125 |
|
21126 | ESCAPE_SEQUENCES[0x00] = '\\0';
|
21127 | ESCAPE_SEQUENCES[0x07] = '\\a';
|
21128 | ESCAPE_SEQUENCES[0x08] = '\\b';
|
21129 | ESCAPE_SEQUENCES[0x09] = '\\t';
|
21130 | ESCAPE_SEQUENCES[0x0A] = '\\n';
|
21131 | ESCAPE_SEQUENCES[0x0B] = '\\v';
|
21132 | ESCAPE_SEQUENCES[0x0C] = '\\f';
|
21133 | ESCAPE_SEQUENCES[0x0D] = '\\r';
|
21134 | ESCAPE_SEQUENCES[0x1B] = '\\e';
|
21135 | ESCAPE_SEQUENCES[0x22] = '\\"';
|
21136 | ESCAPE_SEQUENCES[0x5C] = '\\\\';
|
21137 | ESCAPE_SEQUENCES[0x85] = '\\N';
|
21138 | ESCAPE_SEQUENCES[0xA0] = '\\_';
|
21139 | ESCAPE_SEQUENCES[0x2028] = '\\L';
|
21140 | ESCAPE_SEQUENCES[0x2029] = '\\P';
|
21141 |
|
21142 | var DEPRECATED_BOOLEANS_SYNTAX = [
|
21143 | 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
|
21144 | 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
|
21145 | ];
|
21146 |
|
21147 | function compileStyleMap(schema, map) {
|
21148 | var result, keys, index, length, tag, style, type;
|
21149 |
|
21150 | if (map === null) return {};
|
21151 |
|
21152 | result = {};
|
21153 | keys = Object.keys(map);
|
21154 |
|
21155 | for (index = 0, length = keys.length; index < length; index += 1) {
|
21156 | tag = keys[index];
|
21157 | style = String(map[tag]);
|
21158 |
|
21159 | if (tag.slice(0, 2) === '!!') {
|
21160 | tag = 'tag:yaml.org,2002:' + tag.slice(2);
|
21161 | }
|
21162 | type = schema.compiledTypeMap['fallback'][tag];
|
21163 |
|
21164 | if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
21165 | style = type.styleAliases[style];
|
21166 | }
|
21167 |
|
21168 | result[tag] = style;
|
21169 | }
|
21170 |
|
21171 | return result;
|
21172 | }
|
21173 |
|
21174 | function encodeHex(character) {
|
21175 | var string, handle, length;
|
21176 |
|
21177 | string = character.toString(16).toUpperCase();
|
21178 |
|
21179 | if (character <= 0xFF) {
|
21180 | handle = 'x';
|
21181 | length = 2;
|
21182 | } else if (character <= 0xFFFF) {
|
21183 | handle = 'u';
|
21184 | length = 4;
|
21185 | } else if (character <= 0xFFFFFFFF) {
|
21186 | handle = 'U';
|
21187 | length = 8;
|
21188 | } else {
|
21189 | throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
|
21190 | }
|
21191 |
|
21192 | return '\\' + handle + common.repeat('0', length - string.length) + string;
|
21193 | }
|
21194 |
|
21195 | function State(options) {
|
21196 | this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
21197 | this.indent = Math.max(1, (options['indent'] || 2));
|
21198 | this.noArrayIndent = options['noArrayIndent'] || false;
|
21199 | this.skipInvalid = options['skipInvalid'] || false;
|
21200 | this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
|
21201 | this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
|
21202 | this.sortKeys = options['sortKeys'] || false;
|
21203 | this.lineWidth = options['lineWidth'] || 80;
|
21204 | this.noRefs = options['noRefs'] || false;
|
21205 | this.noCompatMode = options['noCompatMode'] || false;
|
21206 | this.condenseFlow = options['condenseFlow'] || false;
|
21207 |
|
21208 | this.implicitTypes = this.schema.compiledImplicit;
|
21209 | this.explicitTypes = this.schema.compiledExplicit;
|
21210 |
|
21211 | this.tag = null;
|
21212 | this.result = '';
|
21213 |
|
21214 | this.duplicates = [];
|
21215 | this.usedDuplicates = null;
|
21216 | }
|
21217 |
|
21218 |
|
21219 | function indentString(string, spaces) {
|
21220 | var ind = common.repeat(' ', spaces),
|
21221 | position = 0,
|
21222 | next = -1,
|
21223 | result = '',
|
21224 | line,
|
21225 | length = string.length;
|
21226 |
|
21227 | while (position < length) {
|
21228 | next = string.indexOf('\n', position);
|
21229 | if (next === -1) {
|
21230 | line = string.slice(position);
|
21231 | position = length;
|
21232 | } else {
|
21233 | line = string.slice(position, next + 1);
|
21234 | position = next + 1;
|
21235 | }
|
21236 |
|
21237 | if (line.length && line !== '\n') result += ind;
|
21238 |
|
21239 | result += line;
|
21240 | }
|
21241 |
|
21242 | return result;
|
21243 | }
|
21244 |
|
21245 | function generateNextLine(state, level) {
|
21246 | return '\n' + common.repeat(' ', state.indent * level);
|
21247 | }
|
21248 |
|
21249 | function testImplicitResolving(state, str) {
|
21250 | var index, length, type;
|
21251 |
|
21252 | for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
21253 | type = state.implicitTypes[index];
|
21254 |
|
21255 | if (type.resolve(str)) {
|
21256 | return true;
|
21257 | }
|
21258 | }
|
21259 |
|
21260 | return false;
|
21261 | }
|
21262 |
|
21263 |
|
21264 | function isWhitespace(c) {
|
21265 | return c === CHAR_SPACE || c === CHAR_TAB;
|
21266 | }
|
21267 |
|
21268 |
|
21269 |
|
21270 |
|
21271 |
|
21272 | function isPrintable(c) {
|
21273 | return (0x00020 <= c && c <= 0x00007E)
|
21274 | || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
|
21275 | || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF )
|
21276 | || (0x10000 <= c && c <= 0x10FFFF);
|
21277 | }
|
21278 |
|
21279 |
|
21280 |
|
21281 |
|
21282 |
|
21283 |
|
21284 |
|
21285 | function isNsChar(c) {
|
21286 | return isPrintable(c) && !isWhitespace(c)
|
21287 |
|
21288 | && c !== 0xFEFF
|
21289 |
|
21290 | && c !== CHAR_CARRIAGE_RETURN
|
21291 | && c !== CHAR_LINE_FEED;
|
21292 | }
|
21293 |
|
21294 |
|
21295 | function isPlainSafe(c, prev) {
|
21296 |
|
21297 |
|
21298 | return isPrintable(c) && c !== 0xFEFF
|
21299 |
|
21300 | && c !== CHAR_COMMA
|
21301 | && c !== CHAR_LEFT_SQUARE_BRACKET
|
21302 | && c !== CHAR_RIGHT_SQUARE_BRACKET
|
21303 | && c !== CHAR_LEFT_CURLY_BRACKET
|
21304 | && c !== CHAR_RIGHT_CURLY_BRACKET
|
21305 |
|
21306 |
|
21307 | && c !== CHAR_COLON
|
21308 | && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));
|
21309 | }
|
21310 |
|
21311 |
|
21312 | function isPlainSafeFirst(c) {
|
21313 |
|
21314 |
|
21315 | return isPrintable(c) && c !== 0xFEFF
|
21316 | && !isWhitespace(c)
|
21317 |
|
21318 |
|
21319 | && c !== CHAR_MINUS
|
21320 | && c !== CHAR_QUESTION
|
21321 | && c !== CHAR_COLON
|
21322 | && c !== CHAR_COMMA
|
21323 | && c !== CHAR_LEFT_SQUARE_BRACKET
|
21324 | && c !== CHAR_RIGHT_SQUARE_BRACKET
|
21325 | && c !== CHAR_LEFT_CURLY_BRACKET
|
21326 | && c !== CHAR_RIGHT_CURLY_BRACKET
|
21327 |
|
21328 | && c !== CHAR_SHARP
|
21329 | && c !== CHAR_AMPERSAND
|
21330 | && c !== CHAR_ASTERISK
|
21331 | && c !== CHAR_EXCLAMATION
|
21332 | && c !== CHAR_VERTICAL_LINE
|
21333 | && c !== CHAR_EQUALS
|
21334 | && c !== CHAR_GREATER_THAN
|
21335 | && c !== CHAR_SINGLE_QUOTE
|
21336 | && c !== CHAR_DOUBLE_QUOTE
|
21337 |
|
21338 | && c !== CHAR_PERCENT
|
21339 | && c !== CHAR_COMMERCIAL_AT
|
21340 | && c !== CHAR_GRAVE_ACCENT;
|
21341 | }
|
21342 |
|
21343 |
|
21344 | function needIndentIndicator(string) {
|
21345 | var leadingSpaceRe = /^\n* /;
|
21346 | return leadingSpaceRe.test(string);
|
21347 | }
|
21348 |
|
21349 | var STYLE_PLAIN = 1,
|
21350 | STYLE_SINGLE = 2,
|
21351 | STYLE_LITERAL = 3,
|
21352 | STYLE_FOLDED = 4,
|
21353 | STYLE_DOUBLE = 5;
|
21354 |
|
21355 |
|
21356 |
|
21357 |
|
21358 |
|
21359 |
|
21360 |
|
21361 |
|
21362 | function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
21363 | var i;
|
21364 | var char, prev_char;
|
21365 | var hasLineBreak = false;
|
21366 | var hasFoldableLine = false;
|
21367 | var shouldTrackWidth = lineWidth !== -1;
|
21368 | var previousLineBreak = -1;
|
21369 | var plain = isPlainSafeFirst(string.charCodeAt(0))
|
21370 | && !isWhitespace(string.charCodeAt(string.length - 1));
|
21371 |
|
21372 | if (singleLineOnly) {
|
21373 |
|
21374 |
|
21375 | for (i = 0; i < string.length; i++) {
|
21376 | char = string.charCodeAt(i);
|
21377 | if (!isPrintable(char)) {
|
21378 | return STYLE_DOUBLE;
|
21379 | }
|
21380 | prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
21381 | plain = plain && isPlainSafe(char, prev_char);
|
21382 | }
|
21383 | } else {
|
21384 |
|
21385 | for (i = 0; i < string.length; i++) {
|
21386 | char = string.charCodeAt(i);
|
21387 | if (char === CHAR_LINE_FEED) {
|
21388 | hasLineBreak = true;
|
21389 |
|
21390 | if (shouldTrackWidth) {
|
21391 | hasFoldableLine = hasFoldableLine ||
|
21392 |
|
21393 | (i - previousLineBreak - 1 > lineWidth &&
|
21394 | string[previousLineBreak + 1] !== ' ');
|
21395 | previousLineBreak = i;
|
21396 | }
|
21397 | } else if (!isPrintable(char)) {
|
21398 | return STYLE_DOUBLE;
|
21399 | }
|
21400 | prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
21401 | plain = plain && isPlainSafe(char, prev_char);
|
21402 | }
|
21403 |
|
21404 | hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
|
21405 | (i - previousLineBreak - 1 > lineWidth &&
|
21406 | string[previousLineBreak + 1] !== ' '));
|
21407 | }
|
21408 |
|
21409 |
|
21410 |
|
21411 | if (!hasLineBreak && !hasFoldableLine) {
|
21412 |
|
21413 |
|
21414 | return plain && !testAmbiguousType(string)
|
21415 | ? STYLE_PLAIN : STYLE_SINGLE;
|
21416 | }
|
21417 |
|
21418 | if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
21419 | return STYLE_DOUBLE;
|
21420 | }
|
21421 |
|
21422 |
|
21423 | return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
21424 | }
|
21425 |
|
21426 |
|
21427 |
|
21428 |
|
21429 |
|
21430 |
|
21431 |
|
21432 | function writeScalar(state, string, level, iskey) {
|
21433 | state.dump = (function () {
|
21434 | if (string.length === 0) {
|
21435 | return "''";
|
21436 | }
|
21437 | if (!state.noCompatMode &&
|
21438 | DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
|
21439 | return "'" + string + "'";
|
21440 | }
|
21441 |
|
21442 | var indent = state.indent * Math.max(1, level);
|
21443 |
|
21444 |
|
21445 |
|
21446 |
|
21447 |
|
21448 |
|
21449 |
|
21450 | var lineWidth = state.lineWidth === -1
|
21451 | ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
21452 |
|
21453 |
|
21454 | var singleLineOnly = iskey
|
21455 |
|
21456 | || (state.flowLevel > -1 && level >= state.flowLevel);
|
21457 | function testAmbiguity(string) {
|
21458 | return testImplicitResolving(state, string);
|
21459 | }
|
21460 |
|
21461 | switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
|
21462 | case STYLE_PLAIN:
|
21463 | return string;
|
21464 | case STYLE_SINGLE:
|
21465 | return "'" + string.replace(/'/g, "''") + "'";
|
21466 | case STYLE_LITERAL:
|
21467 | return '|' + blockHeader(string, state.indent)
|
21468 | + dropEndingNewline(indentString(string, indent));
|
21469 | case STYLE_FOLDED:
|
21470 | return '>' + blockHeader(string, state.indent)
|
21471 | + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
21472 | case STYLE_DOUBLE:
|
21473 | return '"' + escapeString(string, lineWidth) + '"';
|
21474 | default:
|
21475 | throw new YAMLException('impossible error: invalid scalar style');
|
21476 | }
|
21477 | }());
|
21478 | }
|
21479 |
|
21480 |
|
21481 | function blockHeader(string, indentPerLevel) {
|
21482 | var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
|
21483 |
|
21484 |
|
21485 | var clip = string[string.length - 1] === '\n';
|
21486 | var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
|
21487 | var chomp = keep ? '+' : (clip ? '' : '-');
|
21488 |
|
21489 | return indentIndicator + chomp + '\n';
|
21490 | }
|
21491 |
|
21492 |
|
21493 | function dropEndingNewline(string) {
|
21494 | return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
|
21495 | }
|
21496 |
|
21497 |
|
21498 |
|
21499 | function foldString(string, width) {
|
21500 |
|
21501 |
|
21502 |
|
21503 |
|
21504 | var lineRe = /(\n+)([^\n]*)/g;
|
21505 |
|
21506 |
|
21507 | var result = (function () {
|
21508 | var nextLF = string.indexOf('\n');
|
21509 | nextLF = nextLF !== -1 ? nextLF : string.length;
|
21510 | lineRe.lastIndex = nextLF;
|
21511 | return foldLine(string.slice(0, nextLF), width);
|
21512 | }());
|
21513 |
|
21514 | var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
|
21515 | var moreIndented;
|
21516 |
|
21517 |
|
21518 | var match;
|
21519 | while ((match = lineRe.exec(string))) {
|
21520 | var prefix = match[1], line = match[2];
|
21521 | moreIndented = (line[0] === ' ');
|
21522 | result += prefix
|
21523 | + (!prevMoreIndented && !moreIndented && line !== ''
|
21524 | ? '\n' : '')
|
21525 | + foldLine(line, width);
|
21526 | prevMoreIndented = moreIndented;
|
21527 | }
|
21528 |
|
21529 | return result;
|
21530 | }
|
21531 |
|
21532 |
|
21533 |
|
21534 |
|
21535 |
|
21536 | function foldLine(line, width) {
|
21537 | if (line === '' || line[0] === ' ') return line;
|
21538 |
|
21539 |
|
21540 | var breakRe = / [^ ]/g;
|
21541 | var match;
|
21542 |
|
21543 | var start = 0, end, curr = 0, next = 0;
|
21544 | var result = '';
|
21545 |
|
21546 |
|
21547 |
|
21548 |
|
21549 |
|
21550 | while ((match = breakRe.exec(line))) {
|
21551 | next = match.index;
|
21552 |
|
21553 | if (next - start > width) {
|
21554 | end = (curr > start) ? curr : next;
|
21555 | result += '\n' + line.slice(start, end);
|
21556 |
|
21557 | start = end + 1;
|
21558 | }
|
21559 | curr = next;
|
21560 | }
|
21561 |
|
21562 |
|
21563 |
|
21564 | result += '\n';
|
21565 |
|
21566 | if (line.length - start > width && curr > start) {
|
21567 | result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
|
21568 | } else {
|
21569 | result += line.slice(start);
|
21570 | }
|
21571 |
|
21572 | return result.slice(1);
|
21573 | }
|
21574 |
|
21575 |
|
21576 | function escapeString(string) {
|
21577 | var result = '';
|
21578 | var char, nextChar;
|
21579 | var escapeSeq;
|
21580 |
|
21581 | for (var i = 0; i < string.length; i++) {
|
21582 | char = string.charCodeAt(i);
|
21583 |
|
21584 | if (char >= 0xD800 && char <= 0xDBFF) {
|
21585 | nextChar = string.charCodeAt(i + 1);
|
21586 | if (nextChar >= 0xDC00 && nextChar <= 0xDFFF) {
|
21587 |
|
21588 | result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
|
21589 |
|
21590 | i++; continue;
|
21591 | }
|
21592 | }
|
21593 | escapeSeq = ESCAPE_SEQUENCES[char];
|
21594 | result += !escapeSeq && isPrintable(char)
|
21595 | ? string[i]
|
21596 | : escapeSeq || encodeHex(char);
|
21597 | }
|
21598 |
|
21599 | return result;
|
21600 | }
|
21601 |
|
21602 | function writeFlowSequence(state, level, object) {
|
21603 | var _result = '',
|
21604 | _tag = state.tag,
|
21605 | index,
|
21606 | length;
|
21607 |
|
21608 | for (index = 0, length = object.length; index < length; index += 1) {
|
21609 |
|
21610 | if (writeNode(state, level, object[index], false, false)) {
|
21611 | if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
|
21612 | _result += state.dump;
|
21613 | }
|
21614 | }
|
21615 |
|
21616 | state.tag = _tag;
|
21617 | state.dump = '[' + _result + ']';
|
21618 | }
|
21619 |
|
21620 | function writeBlockSequence(state, level, object, compact) {
|
21621 | var _result = '',
|
21622 | _tag = state.tag,
|
21623 | index,
|
21624 | length;
|
21625 |
|
21626 | for (index = 0, length = object.length; index < length; index += 1) {
|
21627 |
|
21628 | if (writeNode(state, level + 1, object[index], true, true)) {
|
21629 | if (!compact || index !== 0) {
|
21630 | _result += generateNextLine(state, level);
|
21631 | }
|
21632 |
|
21633 | if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
21634 | _result += '-';
|
21635 | } else {
|
21636 | _result += '- ';
|
21637 | }
|
21638 |
|
21639 | _result += state.dump;
|
21640 | }
|
21641 | }
|
21642 |
|
21643 | state.tag = _tag;
|
21644 | state.dump = _result || '[]';
|
21645 | }
|
21646 |
|
21647 | function writeFlowMapping(state, level, object) {
|
21648 | var _result = '',
|
21649 | _tag = state.tag,
|
21650 | objectKeyList = Object.keys(object),
|
21651 | index,
|
21652 | length,
|
21653 | objectKey,
|
21654 | objectValue,
|
21655 | pairBuffer;
|
21656 |
|
21657 | for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
21658 |
|
21659 | pairBuffer = '';
|
21660 | if (index !== 0) pairBuffer += ', ';
|
21661 |
|
21662 | if (state.condenseFlow) pairBuffer += '"';
|
21663 |
|
21664 | objectKey = objectKeyList[index];
|
21665 | objectValue = object[objectKey];
|
21666 |
|
21667 | if (!writeNode(state, level, objectKey, false, false)) {
|
21668 | continue;
|
21669 | }
|
21670 |
|
21671 | if (state.dump.length > 1024) pairBuffer += '? ';
|
21672 |
|
21673 | pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
|
21674 |
|
21675 | if (!writeNode(state, level, objectValue, false, false)) {
|
21676 | continue;
|
21677 | }
|
21678 |
|
21679 | pairBuffer += state.dump;
|
21680 |
|
21681 |
|
21682 | _result += pairBuffer;
|
21683 | }
|
21684 |
|
21685 | state.tag = _tag;
|
21686 | state.dump = '{' + _result + '}';
|
21687 | }
|
21688 |
|
21689 | function writeBlockMapping(state, level, object, compact) {
|
21690 | var _result = '',
|
21691 | _tag = state.tag,
|
21692 | objectKeyList = Object.keys(object),
|
21693 | index,
|
21694 | length,
|
21695 | objectKey,
|
21696 | objectValue,
|
21697 | explicitPair,
|
21698 | pairBuffer;
|
21699 |
|
21700 |
|
21701 | if (state.sortKeys === true) {
|
21702 |
|
21703 | objectKeyList.sort();
|
21704 | } else if (typeof state.sortKeys === 'function') {
|
21705 |
|
21706 | objectKeyList.sort(state.sortKeys);
|
21707 | } else if (state.sortKeys) {
|
21708 |
|
21709 | throw new YAMLException('sortKeys must be a boolean or a function');
|
21710 | }
|
21711 |
|
21712 | for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
21713 | pairBuffer = '';
|
21714 |
|
21715 | if (!compact || index !== 0) {
|
21716 | pairBuffer += generateNextLine(state, level);
|
21717 | }
|
21718 |
|
21719 | objectKey = objectKeyList[index];
|
21720 | objectValue = object[objectKey];
|
21721 |
|
21722 | if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
21723 | continue;
|
21724 | }
|
21725 |
|
21726 | explicitPair = (state.tag !== null && state.tag !== '?') ||
|
21727 | (state.dump && state.dump.length > 1024);
|
21728 |
|
21729 | if (explicitPair) {
|
21730 | if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
21731 | pairBuffer += '?';
|
21732 | } else {
|
21733 | pairBuffer += '? ';
|
21734 | }
|
21735 | }
|
21736 |
|
21737 | pairBuffer += state.dump;
|
21738 |
|
21739 | if (explicitPair) {
|
21740 | pairBuffer += generateNextLine(state, level);
|
21741 | }
|
21742 |
|
21743 | if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
21744 | continue;
|
21745 | }
|
21746 |
|
21747 | if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
21748 | pairBuffer += ':';
|
21749 | } else {
|
21750 | pairBuffer += ': ';
|
21751 | }
|
21752 |
|
21753 | pairBuffer += state.dump;
|
21754 |
|
21755 |
|
21756 | _result += pairBuffer;
|
21757 | }
|
21758 |
|
21759 | state.tag = _tag;
|
21760 | state.dump = _result || '{}';
|
21761 | }
|
21762 |
|
21763 | function detectType(state, object, explicit) {
|
21764 | var _result, typeList, index, length, type, style;
|
21765 |
|
21766 | typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
21767 |
|
21768 | for (index = 0, length = typeList.length; index < length; index += 1) {
|
21769 | type = typeList[index];
|
21770 |
|
21771 | if ((type.instanceOf || type.predicate) &&
|
21772 | (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
|
21773 | (!type.predicate || type.predicate(object))) {
|
21774 |
|
21775 | state.tag = explicit ? type.tag : '?';
|
21776 |
|
21777 | if (type.represent) {
|
21778 | style = state.styleMap[type.tag] || type.defaultStyle;
|
21779 |
|
21780 | if (_toString.call(type.represent) === '[object Function]') {
|
21781 | _result = type.represent(object, style);
|
21782 | } else if (_hasOwnProperty.call(type.represent, style)) {
|
21783 | _result = type.represent[style](object, style);
|
21784 | } else {
|
21785 | throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
|
21786 | }
|
21787 |
|
21788 | state.dump = _result;
|
21789 | }
|
21790 |
|
21791 | return true;
|
21792 | }
|
21793 | }
|
21794 |
|
21795 | return false;
|
21796 | }
|
21797 |
|
21798 |
|
21799 |
|
21800 |
|
21801 | function writeNode(state, level, object, block, compact, iskey) {
|
21802 | state.tag = null;
|
21803 | state.dump = object;
|
21804 |
|
21805 | if (!detectType(state, object, false)) {
|
21806 | detectType(state, object, true);
|
21807 | }
|
21808 |
|
21809 | var type = _toString.call(state.dump);
|
21810 |
|
21811 | if (block) {
|
21812 | block = (state.flowLevel < 0 || state.flowLevel > level);
|
21813 | }
|
21814 |
|
21815 | var objectOrArray = type === '[object Object]' || type === '[object Array]',
|
21816 | duplicateIndex,
|
21817 | duplicate;
|
21818 |
|
21819 | if (objectOrArray) {
|
21820 | duplicateIndex = state.duplicates.indexOf(object);
|
21821 | duplicate = duplicateIndex !== -1;
|
21822 | }
|
21823 |
|
21824 | if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
|
21825 | compact = false;
|
21826 | }
|
21827 |
|
21828 | if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
21829 | state.dump = '*ref_' + duplicateIndex;
|
21830 | } else {
|
21831 | if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
21832 | state.usedDuplicates[duplicateIndex] = true;
|
21833 | }
|
21834 | if (type === '[object Object]') {
|
21835 | if (block && (Object.keys(state.dump).length !== 0)) {
|
21836 | writeBlockMapping(state, level, state.dump, compact);
|
21837 | if (duplicate) {
|
21838 | state.dump = '&ref_' + duplicateIndex + state.dump;
|
21839 | }
|
21840 | } else {
|
21841 | writeFlowMapping(state, level, state.dump);
|
21842 | if (duplicate) {
|
21843 | state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
|
21844 | }
|
21845 | }
|
21846 | } else if (type === '[object Array]') {
|
21847 | var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
|
21848 | if (block && (state.dump.length !== 0)) {
|
21849 | writeBlockSequence(state, arrayLevel, state.dump, compact);
|
21850 | if (duplicate) {
|
21851 | state.dump = '&ref_' + duplicateIndex + state.dump;
|
21852 | }
|
21853 | } else {
|
21854 | writeFlowSequence(state, arrayLevel, state.dump);
|
21855 | if (duplicate) {
|
21856 | state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
|
21857 | }
|
21858 | }
|
21859 | } else if (type === '[object String]') {
|
21860 | if (state.tag !== '?') {
|
21861 | writeScalar(state, state.dump, level, iskey);
|
21862 | }
|
21863 | } else {
|
21864 | if (state.skipInvalid) return false;
|
21865 | throw new YAMLException('unacceptable kind of an object to dump ' + type);
|
21866 | }
|
21867 |
|
21868 | if (state.tag !== null && state.tag !== '?') {
|
21869 | state.dump = '!<' + state.tag + '> ' + state.dump;
|
21870 | }
|
21871 | }
|
21872 |
|
21873 | return true;
|
21874 | }
|
21875 |
|
21876 | function getDuplicateReferences(object, state) {
|
21877 | var objects = [],
|
21878 | duplicatesIndexes = [],
|
21879 | index,
|
21880 | length;
|
21881 |
|
21882 | inspectNode(object, objects, duplicatesIndexes);
|
21883 |
|
21884 | for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
21885 | state.duplicates.push(objects[duplicatesIndexes[index]]);
|
21886 | }
|
21887 | state.usedDuplicates = new Array(length);
|
21888 | }
|
21889 |
|
21890 | function inspectNode(object, objects, duplicatesIndexes) {
|
21891 | var objectKeyList,
|
21892 | index,
|
21893 | length;
|
21894 |
|
21895 | if (object !== null && typeof object === 'object') {
|
21896 | index = objects.indexOf(object);
|
21897 | if (index !== -1) {
|
21898 | if (duplicatesIndexes.indexOf(index) === -1) {
|
21899 | duplicatesIndexes.push(index);
|
21900 | }
|
21901 | } else {
|
21902 | objects.push(object);
|
21903 |
|
21904 | if (Array.isArray(object)) {
|
21905 | for (index = 0, length = object.length; index < length; index += 1) {
|
21906 | inspectNode(object[index], objects, duplicatesIndexes);
|
21907 | }
|
21908 | } else {
|
21909 | objectKeyList = Object.keys(object);
|
21910 |
|
21911 | for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
21912 | inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
21913 | }
|
21914 | }
|
21915 | }
|
21916 | }
|
21917 | }
|
21918 |
|
21919 | function dump(input, options) {
|
21920 | options = options || {};
|
21921 |
|
21922 | var state = new State(options);
|
21923 |
|
21924 | if (!state.noRefs) getDuplicateReferences(input, state);
|
21925 |
|
21926 | if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
|
21927 |
|
21928 | return '';
|
21929 | }
|
21930 |
|
21931 | function safeDump(input, options) {
|
21932 | return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
21933 | }
|
21934 |
|
21935 | module.exports.dump = dump;
|
21936 | module.exports.safeDump = safeDump;
|
21937 |
|
21938 |
|
21939 | }),
|
21940 |
|
21941 | (function(module, exports, __webpack_require__) {
|
21942 |
|
21943 | var basePickBy = __webpack_require__(281),
|
21944 | hasIn = __webpack_require__(287);
|
21945 |
|
21946 |
|
21947 |
|
21948 |
|
21949 |
|
21950 |
|
21951 |
|
21952 |
|
21953 |
|
21954 |
|
21955 | function basePick(object, paths) {
|
21956 | return basePickBy(object, paths, function(value, path) {
|
21957 | return hasIn(object, path);
|
21958 | });
|
21959 | }
|
21960 |
|
21961 | module.exports = basePick;
|
21962 |
|
21963 |
|
21964 | }),
|
21965 |
|
21966 | (function(module, exports, __webpack_require__) {
|
21967 |
|
21968 | var baseGet = __webpack_require__(152),
|
21969 | baseSet = __webpack_require__(286),
|
21970 | castPath = __webpack_require__(73);
|
21971 |
|
21972 |
|
21973 |
|
21974 |
|
21975 |
|
21976 |
|
21977 |
|
21978 |
|
21979 |
|
21980 |
|
21981 | function basePickBy(object, paths, predicate) {
|
21982 | var index = -1,
|
21983 | length = paths.length,
|
21984 | result = {};
|
21985 |
|
21986 | while (++index < length) {
|
21987 | var path = paths[index],
|
21988 | value = baseGet(object, path);
|
21989 |
|
21990 | if (predicate(value, path)) {
|
21991 | baseSet(result, castPath(path, object), value);
|
21992 | }
|
21993 | }
|
21994 | return result;
|
21995 | }
|
21996 |
|
21997 | module.exports = basePickBy;
|
21998 |
|
21999 |
|
22000 | }),
|
22001 |
|
22002 | (function(module, exports, __webpack_require__) {
|
22003 |
|
22004 | var isArray = __webpack_require__(44),
|
22005 | isSymbol = __webpack_require__(283);
|
22006 |
|
22007 |
|
22008 | var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
22009 | reIsPlainProp = /^\w*$/;
|
22010 |
|
22011 |
|
22012 |
|
22013 |
|
22014 |
|
22015 |
|
22016 |
|
22017 |
|
22018 |
|
22019 | function isKey(value, object) {
|
22020 | if (isArray(value)) {
|
22021 | return false;
|
22022 | }
|
22023 | var type = typeof value;
|
22024 | if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
22025 | value == null || isSymbol(value)) {
|
22026 | return true;
|
22027 | }
|
22028 | return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
22029 | (object != null && value in Object(object));
|
22030 | }
|
22031 |
|
22032 | module.exports = isKey;
|
22033 |
|
22034 |
|
22035 | }),
|
22036 |
|
22037 | (function(module, exports) {
|
22038 |
|
22039 |
|
22040 |
|
22041 |
|
22042 |
|
22043 |
|
22044 |
|
22045 |
|
22046 |
|
22047 |
|
22048 |
|
22049 |
|
22050 |
|
22051 |
|
22052 | function stubFalse() {
|
22053 | return false;
|
22054 | }
|
22055 |
|
22056 | module.exports = stubFalse;
|
22057 |
|
22058 |
|
22059 | }),
|
22060 |
|
22061 | (function(module, exports, __webpack_require__) {
|
22062 |
|
22063 | var memoizeCapped = __webpack_require__(285);
|
22064 |
|
22065 |
|
22066 | var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
22067 |
|
22068 |
|
22069 | var reEscapeChar = /\\(\\)?/g;
|
22070 |
|
22071 |
|
22072 |
|
22073 |
|
22074 |
|
22075 |
|
22076 |
|
22077 |
|
22078 | var stringToPath = memoizeCapped(function(string) {
|
22079 | var result = [];
|
22080 | if (string.charCodeAt(0) === 46 ) {
|
22081 | result.push('');
|
22082 | }
|
22083 | string.replace(rePropName, function(match, number, quote, subString) {
|
22084 | result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
22085 | });
|
22086 | return result;
|
22087 | });
|
22088 |
|
22089 | module.exports = stringToPath;
|
22090 |
|
22091 |
|
22092 | }),
|
22093 |
|
22094 | (function(module, exports) {
|
22095 |
|
22096 |
|
22097 |
|
22098 |
|
22099 |
|
22100 |
|
22101 |
|
22102 |
|
22103 |
|
22104 |
|
22105 |
|
22106 |
|
22107 |
|
22108 |
|
22109 |
|
22110 |
|
22111 |
|
22112 | function identity(value) {
|
22113 | return value;
|
22114 | }
|
22115 |
|
22116 | module.exports = identity;
|
22117 |
|
22118 |
|
22119 | }),
|
22120 |
|
22121 | (function(module, exports, __webpack_require__) {
|
22122 |
|
22123 | var assignValue = __webpack_require__(68),
|
22124 | castPath = __webpack_require__(73),
|
22125 | isIndex = __webpack_require__(153),
|
22126 | isObject = __webpack_require__(35),
|
22127 | toKey = __webpack_require__(112);
|
22128 |
|
22129 |
|
22130 |
|
22131 |
|
22132 |
|
22133 |
|
22134 |
|
22135 |
|
22136 |
|
22137 |
|
22138 |
|
22139 | function baseSet(object, path, value, customizer) {
|
22140 | if (!isObject(object)) {
|
22141 | return object;
|
22142 | }
|
22143 | path = castPath(path, object);
|
22144 |
|
22145 | var index = -1,
|
22146 | length = path.length,
|
22147 | lastIndex = length - 1,
|
22148 | nested = object;
|
22149 |
|
22150 | while (nested != null && ++index < length) {
|
22151 | var key = toKey(path[index]),
|
22152 | newValue = value;
|
22153 |
|
22154 | if (index != lastIndex) {
|
22155 | var objValue = nested[key];
|
22156 | newValue = customizer ? customizer(objValue, key, nested) : undefined;
|
22157 | if (newValue === undefined) {
|
22158 | newValue = isObject(objValue)
|
22159 | ? objValue
|
22160 | : (isIndex(path[index + 1]) ? [] : {});
|
22161 | }
|
22162 | }
|
22163 | assignValue(nested, key, newValue);
|
22164 | nested = nested[key];
|
22165 | }
|
22166 | return object;
|
22167 | }
|
22168 |
|
22169 | module.exports = baseSet;
|
22170 |
|
22171 |
|
22172 | }),
|
22173 |
|
22174 | (function(module, exports, __webpack_require__) {
|
22175 |
|
22176 | var baseHasIn = __webpack_require__(288),
|
22177 | hasPath = __webpack_require__(289);
|
22178 |
|
22179 |
|
22180 |
|
22181 |
|
22182 |
|
22183 |
|
22184 |
|
22185 |
|
22186 |
|
22187 |
|
22188 |
|
22189 |
|
22190 |
|
22191 |
|
22192 |
|
22193 |
|
22194 |
|
22195 |
|
22196 |
|
22197 |
|
22198 |
|
22199 |
|
22200 |
|
22201 |
|
22202 |
|
22203 |
|
22204 |
|
22205 | function hasIn(object, path) {
|
22206 | return object != null && hasPath(object, path, baseHasIn);
|
22207 | }
|
22208 |
|
22209 | module.exports = hasIn;
|
22210 |
|
22211 |
|
22212 | }),
|
22213 |
|
22214 | (function(module, exports) {
|
22215 |
|
22216 |
|
22217 |
|
22218 |
|
22219 |
|
22220 |
|
22221 |
|
22222 |
|
22223 |
|
22224 | function baseHasIn(object, key) {
|
22225 | return object != null && key in Object(object);
|
22226 | }
|
22227 |
|
22228 | module.exports = baseHasIn;
|
22229 |
|
22230 |
|
22231 | }),
|
22232 |
|
22233 | (function(module, exports, __webpack_require__) {
|
22234 |
|
22235 | var castPath = __webpack_require__(73),
|
22236 | isArguments = __webpack_require__(290),
|
22237 | isArray = __webpack_require__(44),
|
22238 | isIndex = __webpack_require__(153),
|
22239 | isLength = __webpack_require__(131),
|
22240 | toKey = __webpack_require__(112);
|
22241 |
|
22242 |
|
22243 |
|
22244 |
|
22245 |
|
22246 |
|
22247 |
|
22248 |
|
22249 |
|
22250 |
|
22251 | function hasPath(object, path, hasFunc) {
|
22252 | path = castPath(path, object);
|
22253 |
|
22254 | var index = -1,
|
22255 | length = path.length,
|
22256 | result = false;
|
22257 |
|
22258 | while (++index < length) {
|
22259 | var key = toKey(path[index]);
|
22260 | if (!(result = object != null && hasFunc(object, key))) {
|
22261 | break;
|
22262 | }
|
22263 | object = object[key];
|
22264 | }
|
22265 | if (result || ++index != length) {
|
22266 | return result;
|
22267 | }
|
22268 | length = object == null ? 0 : object.length;
|
22269 | return !!length && isLength(length) && isIndex(key, length) &&
|
22270 | (isArray(object) || isArguments(object));
|
22271 | }
|
22272 |
|
22273 | module.exports = hasPath;
|
22274 |
|
22275 |
|
22276 | }),
|
22277 |
|
22278 | (function(module, exports) {
|
22279 |
|
22280 |
|
22281 |
|
22282 |
|
22283 |
|
22284 |
|
22285 |
|
22286 |
|
22287 |
|
22288 |
|
22289 |
|
22290 |
|
22291 |
|
22292 |
|
22293 | function stubFalse() {
|
22294 | return false;
|
22295 | }
|
22296 |
|
22297 | module.exports = stubFalse;
|
22298 |
|
22299 |
|
22300 | }),
|
22301 |
|
22302 | (function(module, exports) {
|
22303 |
|
22304 |
|
22305 |
|
22306 |
|
22307 |
|
22308 |
|
22309 |
|
22310 |
|
22311 |
|
22312 |
|
22313 |
|
22314 |
|
22315 |
|
22316 |
|
22317 |
|
22318 |
|
22319 |
|
22320 | function identity(value) {
|
22321 | return value;
|
22322 | }
|
22323 |
|
22324 | module.exports = identity;
|
22325 |
|
22326 |
|
22327 | }),
|
22328 |
|
22329 | (function(module, exports, __webpack_require__) {
|
22330 |
|
22331 | module.exports = __webpack_require__(293);
|
22332 |
|
22333 | }),
|
22334 |
|
22335 | (function(module, exports, __webpack_require__) {
|
22336 |
|
22337 | __webpack_require__(294);
|
22338 | module.exports = __webpack_require__(5).Reflect.get;
|
22339 |
|
22340 |
|
22341 | }),
|
22342 |
|
22343 | (function(module, exports, __webpack_require__) {
|
22344 |
|
22345 |
|
22346 | var gOPD = __webpack_require__(52);
|
22347 | var getPrototypeOf = __webpack_require__(102);
|
22348 | var has = __webpack_require__(23);
|
22349 | var $export = __webpack_require__(6);
|
22350 | var isObject = __webpack_require__(9);
|
22351 | var anObject = __webpack_require__(12);
|
22352 |
|
22353 | function get(target, propertyKey /* , receiver */) {
|
22354 | var receiver = arguments.length < 3 ? target : arguments[2];
|
22355 | var desc, proto;
|
22356 | if (anObject(target) === receiver) return target[propertyKey];
|
22357 | if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
|
22358 | ? desc.value
|
22359 | : desc.get !== undefined
|
22360 | ? desc.get.call(receiver)
|
22361 | : undefined;
|
22362 | if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
|
22363 | }
|
22364 |
|
22365 | $export($export.S, 'Reflect', { get: get });
|
22366 |
|
22367 |
|
22368 | /***/ }),
|
22369 | /* 295 */
|
22370 | /***/ (function(module, exports, __webpack_require__) {
|
22371 |
|
22372 | var getPrototypeOf = __webpack_require__(77);
|
22373 |
|
22374 | function _superPropBase(object, property) {
|
22375 | while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
22376 | object = getPrototypeOf(object);
|
22377 | if (object === null) break;
|
22378 | }
|
22379 |
|
22380 | return object;
|
22381 | }
|
22382 |
|
22383 | module.exports = _superPropBase;
|
22384 |
|
22385 | }),
|
22386 |
|
22387 | (function(module, exports, __webpack_require__) {
|
22388 |
|
22389 | module.exports = __webpack_require__(297);
|
22390 |
|
22391 | }),
|
22392 |
|
22393 | (function(module, exports, __webpack_require__) {
|
22394 |
|
22395 | __webpack_require__(298);
|
22396 | module.exports = __webpack_require__(5).Object.getPrototypeOf;
|
22397 |
|
22398 |
|
22399 | }),
|
22400 |
|
22401 | (function(module, exports, __webpack_require__) {
|
22402 |
|
22403 |
|
22404 | var toObject = __webpack_require__(34);
|
22405 | var $getPrototypeOf = __webpack_require__(102);
|
22406 |
|
22407 | __webpack_require__(95)('getPrototypeOf', function () {
|
22408 | return function getPrototypeOf(it) {
|
22409 | return $getPrototypeOf(toObject(it));
|
22410 | };
|
22411 | });
|
22412 |
|
22413 |
|
22414 | }),
|
22415 |
|
22416 | (function(module, exports, __webpack_require__) {
|
22417 |
|
22418 | __webpack_require__(300);
|
22419 | module.exports = __webpack_require__(5).Object.setPrototypeOf;
|
22420 |
|
22421 |
|
22422 | }),
|
22423 |
|
22424 | (function(module, exports, __webpack_require__) {
|
22425 |
|
22426 |
|
22427 | var $export = __webpack_require__(6);
|
22428 | $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(301).set });
|
22429 |
|
22430 |
|
22431 | }),
|
22432 |
|
22433 | (function(module, exports, __webpack_require__) {
|
22434 |
|
22435 |
|
22436 |
|
22437 | var isObject = __webpack_require__(9);
|
22438 | var anObject = __webpack_require__(12);
|
22439 | var check = function (O, proto) {
|
22440 | anObject(O);
|
22441 | if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
|
22442 | };
|
22443 | module.exports = {
|
22444 | set: Object.setPrototypeOf || ('__proto__' in {} ?
|
22445 | function (test, buggy, set) {
|
22446 | try {
|
22447 | set = __webpack_require__(26)(Function.call, __webpack_require__(52).f(Object.prototype, '__proto__').set, 2);
|
22448 | set(test, []);
|
22449 | buggy = !(test instanceof Array);
|
22450 | } catch (e) { buggy = true; }
|
22451 | return function setPrototypeOf(O, proto) {
|
22452 | check(O, proto);
|
22453 | if (buggy) O.__proto__ = proto;
|
22454 | else set(O, proto);
|
22455 | return O;
|
22456 | };
|
22457 | }({}, false) : undefined),
|
22458 | check: check
|
22459 | };
|
22460 |
|
22461 |
|
22462 | }),
|
22463 |
|
22464 | (function(module, exports, __webpack_require__) {
|
22465 |
|
22466 | __webpack_require__(303);
|
22467 | var $Object = __webpack_require__(5).Object;
|
22468 | module.exports = function create(P, D) {
|
22469 | return $Object.create(P, D);
|
22470 | };
|
22471 |
|
22472 |
|
22473 | }),
|
22474 |
|
22475 | (function(module, exports, __webpack_require__) {
|
22476 |
|
22477 | var $export = __webpack_require__(6);
|
22478 |
|
22479 | $export($export.S, 'Object', { create: __webpack_require__(67) });
|
22480 |
|
22481 |
|
22482 | }),
|
22483 |
|
22484 | (function(module, exports, __webpack_require__) {
|
22485 |
|
22486 | var _Object$setPrototypeOf = __webpack_require__(154);
|
22487 |
|
22488 | function _setPrototypeOf(o, p) {
|
22489 | module.exports = _setPrototypeOf = _Object$setPrototypeOf || function _setPrototypeOf(o, p) {
|
22490 | o.__proto__ = p;
|
22491 | return o;
|
22492 | };
|
22493 |
|
22494 | return _setPrototypeOf(o, p);
|
22495 | }
|
22496 |
|
22497 | module.exports = _setPrototypeOf;
|
22498 |
|
22499 | }),
|
22500 |
|
22501 | (function(module, exports, __webpack_require__) {
|
22502 |
|
22503 | __webpack_require__(306);
|
22504 | module.exports = __webpack_require__(5).Reflect.construct;
|
22505 |
|
22506 |
|
22507 | }),
|
22508 |
|
22509 | (function(module, exports, __webpack_require__) {
|
22510 |
|
22511 |
|
22512 | var $export = __webpack_require__(6);
|
22513 | var create = __webpack_require__(67);
|
22514 | var aFunction = __webpack_require__(33);
|
22515 | var anObject = __webpack_require__(12);
|
22516 | var isObject = __webpack_require__(9);
|
22517 | var fails = __webpack_require__(28);
|
22518 | var bind = __webpack_require__(307);
|
22519 | var rConstruct = (__webpack_require__(7).Reflect || {}).construct;
|
22520 |
|
22521 |
|
22522 |
|
22523 | var NEW_TARGET_BUG = fails(function () {
|
22524 | function F() { }
|
22525 | return !(rConstruct(function () { }, [], F) instanceof F);
|
22526 | });
|
22527 | var ARGS_BUG = !fails(function () {
|
22528 | rConstruct(function () { });
|
22529 | });
|
22530 |
|
22531 | $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
|
22532 | construct: function construct(Target, args /* , newTarget */) {
|
22533 | aFunction(Target);
|
22534 | anObject(args);
|
22535 | var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
|
22536 | if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
|
22537 | if (Target == newTarget) {
|
22538 |
|
22539 | switch (args.length) {
|
22540 | case 0: return new Target();
|
22541 | case 1: return new Target(args[0]);
|
22542 | case 2: return new Target(args[0], args[1]);
|
22543 | case 3: return new Target(args[0], args[1], args[2]);
|
22544 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
22545 | }
|
22546 |
|
22547 | var $args = [null];
|
22548 | $args.push.apply($args, args);
|
22549 | return new (bind.apply(Target, $args))();
|
22550 | }
|
22551 |
|
22552 | var proto = newTarget.prototype;
|
22553 | var instance = create(isObject(proto) ? proto : Object.prototype);
|
22554 | var result = Function.apply.call(Target, instance, args);
|
22555 | return isObject(result) ? result : instance;
|
22556 | }
|
22557 | });
|
22558 |
|
22559 |
|
22560 | }),
|
22561 |
|
22562 | (function(module, exports, __webpack_require__) {
|
22563 |
|
22564 | "use strict";
|
22565 |
|
22566 | var aFunction = __webpack_require__(33);
|
22567 | var isObject = __webpack_require__(9);
|
22568 | var invoke = __webpack_require__(146);
|
22569 | var arraySlice = [].slice;
|
22570 | var factories = {};
|
22571 |
|
22572 | var construct = function (F, len, args) {
|
22573 | if (!(len in factories)) {
|
22574 | for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
|
22575 |
|
22576 | factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
|
22577 | } return factories[len](F, args);
|
22578 | };
|
22579 |
|
22580 | module.exports = Function.bind || function bind(that /* , ...args */) {
|
22581 | var fn = aFunction(this);
|
22582 | var partArgs = arraySlice.call(arguments, 1);
|
22583 | var bound = function (/* args... */) {
|
22584 | var args = partArgs.concat(arraySlice.call(arguments));
|
22585 | return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
|
22586 | };
|
22587 | if (isObject(fn.prototype)) bound.prototype = fn.prototype;
|
22588 | return bound;
|
22589 | };
|
22590 |
|
22591 |
|
22592 | }),
|
22593 |
|
22594 | (function(module, exports, __webpack_require__) {
|
22595 |
|
22596 | var _Reflect$construct = __webpack_require__(155);
|
22597 |
|
22598 | function _isNativeReflectConstruct() {
|
22599 | if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
|
22600 | if (_Reflect$construct.sham) return false;
|
22601 | if (typeof Proxy === "function") return true;
|
22602 |
|
22603 | try {
|
22604 | Date.prototype.toString.call(_Reflect$construct(Date, [], function () {}));
|
22605 | return true;
|
22606 | } catch (e) {
|
22607 | return false;
|
22608 | }
|
22609 | }
|
22610 |
|
22611 | module.exports = _isNativeReflectConstruct;
|
22612 |
|
22613 | }),
|
22614 |
|
22615 | (function(module, exports, __webpack_require__) {
|
22616 |
|
22617 | var _typeof = __webpack_require__(4);
|
22618 |
|
22619 | var assertThisInitialized = __webpack_require__(310);
|
22620 |
|
22621 | function _possibleConstructorReturn(self, call) {
|
22622 | if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
22623 | return call;
|
22624 | }
|
22625 |
|
22626 | return assertThisInitialized(self);
|
22627 | }
|
22628 |
|
22629 | module.exports = _possibleConstructorReturn;
|
22630 |
|
22631 | }),
|
22632 |
|
22633 | (function(module, exports) {
|
22634 |
|
22635 | function _assertThisInitialized(self) {
|
22636 | if (self === void 0) {
|
22637 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
22638 | }
|
22639 |
|
22640 | return self;
|
22641 | }
|
22642 |
|
22643 | module.exports = _assertThisInitialized;
|
22644 |
|
22645 | }),
|
22646 |
|
22647 | (function(module, exports, __webpack_require__) {
|
22648 |
|
22649 | var _Array$isArray = __webpack_require__(0);
|
22650 |
|
22651 | var arrayLikeToArray = __webpack_require__(142);
|
22652 |
|
22653 | function _arrayWithoutHoles(arr) {
|
22654 | if (_Array$isArray(arr)) return arrayLikeToArray(arr);
|
22655 | }
|
22656 |
|
22657 | module.exports = _arrayWithoutHoles;
|
22658 |
|
22659 | }),
|
22660 |
|
22661 | (function(module, exports, __webpack_require__) {
|
22662 |
|
22663 | var _Array$from = __webpack_require__(76);
|
22664 |
|
22665 | var _isIterable = __webpack_require__(143);
|
22666 |
|
22667 | var _Symbol = __webpack_require__(70);
|
22668 |
|
22669 | function _iterableToArray(iter) {
|
22670 | if (typeof _Symbol !== "undefined" && _isIterable(Object(iter))) return _Array$from(iter);
|
22671 | }
|
22672 |
|
22673 | module.exports = _iterableToArray;
|
22674 |
|
22675 | }),
|
22676 |
|
22677 | (function(module, exports) {
|
22678 |
|
22679 | function _nonIterableSpread() {
|
22680 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
22681 | }
|
22682 |
|
22683 | module.exports = _nonIterableSpread;
|
22684 |
|
22685 | }),
|
22686 |
|
22687 | (function(module, exports, __webpack_require__) {
|
22688 |
|
22689 | __webpack_require__(315);
|
22690 | module.exports = __webpack_require__(5).Object.assign;
|
22691 |
|
22692 |
|
22693 | }),
|
22694 |
|
22695 | (function(module, exports, __webpack_require__) {
|
22696 |
|
22697 |
|
22698 | var $export = __webpack_require__(6);
|
22699 |
|
22700 | $export($export.S + $export.F, 'Object', { assign: __webpack_require__(156) });
|
22701 |
|
22702 |
|
22703 | }),
|
22704 |
|
22705 | (function(module, exports, __webpack_require__) {
|
22706 |
|
22707 | var baseIteratee = __webpack_require__(157),
|
22708 | isArrayLike = __webpack_require__(129),
|
22709 | keys = __webpack_require__(69);
|
22710 |
|
22711 |
|
22712 |
|
22713 |
|
22714 |
|
22715 |
|
22716 |
|
22717 |
|
22718 | function createFind(findIndexFunc) {
|
22719 | return function(collection, predicate, fromIndex) {
|
22720 | var iterable = Object(collection);
|
22721 | if (!isArrayLike(collection)) {
|
22722 | var iteratee = baseIteratee(predicate, 3);
|
22723 | collection = keys(collection);
|
22724 | predicate = function(key) { return iteratee(iterable[key], key, iterable); };
|
22725 | }
|
22726 | var index = findIndexFunc(collection, predicate, fromIndex);
|
22727 | return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
22728 | };
|
22729 | }
|
22730 |
|
22731 | module.exports = createFind;
|
22732 |
|
22733 |
|
22734 | }),
|
22735 |
|
22736 | (function(module, exports, __webpack_require__) {
|
22737 |
|
22738 | var baseFindIndex = __webpack_require__(318),
|
22739 | baseIteratee = __webpack_require__(157),
|
22740 | toInteger = __webpack_require__(133);
|
22741 |
|
22742 |
|
22743 | var nativeMax = Math.max;
|
22744 |
|
22745 |
|
22746 |
|
22747 |
|
22748 |
|
22749 |
|
22750 |
|
22751 |
|
22752 |
|
22753 |
|
22754 |
|
22755 |
|
22756 |
|
22757 |
|
22758 |
|
22759 |
|
22760 |
|
22761 |
|
22762 |
|
22763 |
|
22764 |
|
22765 |
|
22766 |
|
22767 |
|
22768 |
|
22769 |
|
22770 |
|
22771 |
|
22772 |
|
22773 |
|
22774 |
|
22775 |
|
22776 |
|
22777 |
|
22778 |
|
22779 |
|
22780 | function findIndex(array, predicate, fromIndex) {
|
22781 | var length = array == null ? 0 : array.length;
|
22782 | if (!length) {
|
22783 | return -1;
|
22784 | }
|
22785 | var index = fromIndex == null ? 0 : toInteger(fromIndex);
|
22786 | if (index < 0) {
|
22787 | index = nativeMax(length + index, 0);
|
22788 | }
|
22789 | return baseFindIndex(array, baseIteratee(predicate, 3), index);
|
22790 | }
|
22791 |
|
22792 | module.exports = findIndex;
|
22793 |
|
22794 |
|
22795 | }),
|
22796 |
|
22797 | (function(module, exports) {
|
22798 |
|
22799 |
|
22800 |
|
22801 |
|
22802 |
|
22803 |
|
22804 |
|
22805 |
|
22806 |
|
22807 |
|
22808 |
|
22809 |
|
22810 | function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
22811 | var length = array.length,
|
22812 | index = fromIndex + (fromRight ? 1 : -1);
|
22813 |
|
22814 | while ((fromRight ? index-- : ++index < length)) {
|
22815 | if (predicate(array[index], index, array)) {
|
22816 | return index;
|
22817 | }
|
22818 | }
|
22819 | return -1;
|
22820 | }
|
22821 |
|
22822 | module.exports = baseFindIndex;
|
22823 |
|
22824 |
|
22825 | }),
|
22826 |
|
22827 | (function(module, exports, __webpack_require__) {
|
22828 |
|
22829 | "use strict";
|
22830 |
|
22831 |
|
22832 | var isArray = Array.isArray;
|
22833 | var keyList = Object.keys;
|
22834 | var hasProp = Object.prototype.hasOwnProperty;
|
22835 |
|
22836 | module.exports = function equal(a, b) {
|
22837 | if (a === b) return true;
|
22838 |
|
22839 | if (a && b && typeof a == 'object' && typeof b == 'object') {
|
22840 | var arrA = isArray(a)
|
22841 | , arrB = isArray(b)
|
22842 | , i
|
22843 | , length
|
22844 | , key;
|
22845 |
|
22846 | if (arrA && arrB) {
|
22847 | length = a.length;
|
22848 | if (length != b.length) return false;
|
22849 | for (i = length; i-- !== 0;)
|
22850 | if (!equal(a[i], b[i])) return false;
|
22851 | return true;
|
22852 | }
|
22853 |
|
22854 | if (arrA != arrB) return false;
|
22855 |
|
22856 | var dateA = a instanceof Date
|
22857 | , dateB = b instanceof Date;
|
22858 | if (dateA != dateB) return false;
|
22859 | if (dateA && dateB) return a.getTime() == b.getTime();
|
22860 |
|
22861 | var regexpA = a instanceof RegExp
|
22862 | , regexpB = b instanceof RegExp;
|
22863 | if (regexpA != regexpB) return false;
|
22864 | if (regexpA && regexpB) return a.toString() == b.toString();
|
22865 |
|
22866 | var keys = keyList(a);
|
22867 | length = keys.length;
|
22868 |
|
22869 | if (length !== keyList(b).length)
|
22870 | return false;
|
22871 |
|
22872 | for (i = length; i-- !== 0;)
|
22873 | if (!hasProp.call(b, keys[i])) return false;
|
22874 |
|
22875 | for (i = length; i-- !== 0;) {
|
22876 | key = keys[i];
|
22877 | if (!equal(a[key], b[key])) return false;
|
22878 | }
|
22879 |
|
22880 | return true;
|
22881 | }
|
22882 |
|
22883 | return a!==a && b!==b;
|
22884 | };
|
22885 |
|
22886 |
|
22887 | }),
|
22888 |
|
22889 | (function(module, exports, __webpack_require__) {
|
22890 |
|
22891 | var Stack = __webpack_require__(321),
|
22892 | arrayEach = __webpack_require__(327),
|
22893 | assignValue = __webpack_require__(68),
|
22894 | baseAssign = __webpack_require__(328),
|
22895 | baseAssignIn = __webpack_require__(329),
|
22896 | cloneBuffer = __webpack_require__(331),
|
22897 | copyArray = __webpack_require__(334),
|
22898 | copySymbols = __webpack_require__(335),
|
22899 | copySymbolsIn = __webpack_require__(337),
|
22900 | getAllKeys = __webpack_require__(339),
|
22901 | getAllKeysIn = __webpack_require__(340),
|
22902 | getTag = __webpack_require__(341),
|
22903 | initCloneArray = __webpack_require__(342),
|
22904 | initCloneByTag = __webpack_require__(343),
|
22905 | initCloneObject = __webpack_require__(344),
|
22906 | isArray = __webpack_require__(44),
|
22907 | isBuffer = __webpack_require__(346),
|
22908 | isMap = __webpack_require__(347),
|
22909 | isObject = __webpack_require__(35),
|
22910 | isSet = __webpack_require__(348),
|
22911 | keys = __webpack_require__(69);
|
22912 |
|
22913 |
|
22914 | var CLONE_DEEP_FLAG = 1,
|
22915 | CLONE_FLAT_FLAG = 2,
|
22916 | CLONE_SYMBOLS_FLAG = 4;
|
22917 |
|
22918 |
|
22919 | var argsTag = '[object Arguments]',
|
22920 | arrayTag = '[object Array]',
|
22921 | boolTag = '[object Boolean]',
|
22922 | dateTag = '[object Date]',
|
22923 | errorTag = '[object Error]',
|
22924 | funcTag = '[object Function]',
|
22925 | genTag = '[object GeneratorFunction]',
|
22926 | mapTag = '[object Map]',
|
22927 | numberTag = '[object Number]',
|
22928 | objectTag = '[object Object]',
|
22929 | regexpTag = '[object RegExp]',
|
22930 | setTag = '[object Set]',
|
22931 | stringTag = '[object String]',
|
22932 | symbolTag = '[object Symbol]',
|
22933 | weakMapTag = '[object WeakMap]';
|
22934 |
|
22935 | var arrayBufferTag = '[object ArrayBuffer]',
|
22936 | dataViewTag = '[object DataView]',
|
22937 | float32Tag = '[object Float32Array]',
|
22938 | float64Tag = '[object Float64Array]',
|
22939 | int8Tag = '[object Int8Array]',
|
22940 | int16Tag = '[object Int16Array]',
|
22941 | int32Tag = '[object Int32Array]',
|
22942 | uint8Tag = '[object Uint8Array]',
|
22943 | uint8ClampedTag = '[object Uint8ClampedArray]',
|
22944 | uint16Tag = '[object Uint16Array]',
|
22945 | uint32Tag = '[object Uint32Array]';
|
22946 |
|
22947 |
|
22948 | var cloneableTags = {};
|
22949 | cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
22950 | cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
22951 | cloneableTags[boolTag] = cloneableTags[dateTag] =
|
22952 | cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
22953 | cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
22954 | cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
22955 | cloneableTags[numberTag] = cloneableTags[objectTag] =
|
22956 | cloneableTags[regexpTag] = cloneableTags[setTag] =
|
22957 | cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
22958 | cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
22959 | cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
22960 | cloneableTags[errorTag] = cloneableTags[funcTag] =
|
22961 | cloneableTags[weakMapTag] = false;
|
22962 |
|
22963 |
|
22964 |
|
22965 |
|
22966 |
|
22967 |
|
22968 |
|
22969 |
|
22970 |
|
22971 |
|
22972 |
|
22973 |
|
22974 |
|
22975 |
|
22976 |
|
22977 |
|
22978 |
|
22979 | function baseClone(value, bitmask, customizer, key, object, stack) {
|
22980 | var result,
|
22981 | isDeep = bitmask & CLONE_DEEP_FLAG,
|
22982 | isFlat = bitmask & CLONE_FLAT_FLAG,
|
22983 | isFull = bitmask & CLONE_SYMBOLS_FLAG;
|
22984 |
|
22985 | if (customizer) {
|
22986 | result = object ? customizer(value, key, object, stack) : customizer(value);
|
22987 | }
|
22988 | if (result !== undefined) {
|
22989 | return result;
|
22990 | }
|
22991 | if (!isObject(value)) {
|
22992 | return value;
|
22993 | }
|
22994 | var isArr = isArray(value);
|
22995 | if (isArr) {
|
22996 | result = initCloneArray(value);
|
22997 | if (!isDeep) {
|
22998 | return copyArray(value, result);
|
22999 | }
|
23000 | } else {
|
23001 | var tag = getTag(value),
|
23002 | isFunc = tag == funcTag || tag == genTag;
|
23003 |
|
23004 | if (isBuffer(value)) {
|
23005 | return cloneBuffer(value, isDeep);
|
23006 | }
|
23007 | if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
|
23008 | result = (isFlat || isFunc) ? {} : initCloneObject(value);
|
23009 | if (!isDeep) {
|
23010 | return isFlat
|
23011 | ? copySymbolsIn(value, baseAssignIn(result, value))
|
23012 | : copySymbols(value, baseAssign(result, value));
|
23013 | }
|
23014 | } else {
|
23015 | if (!cloneableTags[tag]) {
|
23016 | return object ? value : {};
|
23017 | }
|
23018 | result = initCloneByTag(value, tag, isDeep);
|
23019 | }
|
23020 | }
|
23021 |
|
23022 | stack || (stack = new Stack);
|
23023 | var stacked = stack.get(value);
|
23024 | if (stacked) {
|
23025 | return stacked;
|
23026 | }
|
23027 | stack.set(value, result);
|
23028 |
|
23029 | if (isSet(value)) {
|
23030 | value.forEach(function(subValue) {
|
23031 | result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
23032 | });
|
23033 | } else if (isMap(value)) {
|
23034 | value.forEach(function(subValue, key) {
|
23035 | result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
|
23036 | });
|
23037 | }
|
23038 |
|
23039 | var keysFunc = isFull
|
23040 | ? (isFlat ? getAllKeysIn : getAllKeys)
|
23041 | : (isFlat ? keysIn : keys);
|
23042 |
|
23043 | var props = isArr ? undefined : keysFunc(value);
|
23044 | arrayEach(props || value, function(subValue, key) {
|
23045 | if (props) {
|
23046 | key = subValue;
|
23047 | subValue = value[key];
|
23048 | }
|
23049 |
|
23050 | assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
|
23051 | });
|
23052 | return result;
|
23053 | }
|
23054 |
|
23055 | module.exports = baseClone;
|
23056 |
|
23057 |
|
23058 | }),
|
23059 |
|
23060 | (function(module, exports, __webpack_require__) {
|
23061 |
|
23062 | var listCacheClear = __webpack_require__(322),
|
23063 | listCacheDelete = __webpack_require__(323),
|
23064 | listCacheGet = __webpack_require__(324),
|
23065 | listCacheHas = __webpack_require__(325),
|
23066 | listCacheSet = __webpack_require__(326);
|
23067 |
|
23068 |
|
23069 |
|
23070 |
|
23071 |
|
23072 |
|
23073 |
|
23074 |
|
23075 | function ListCache(entries) {
|
23076 | var index = -1,
|
23077 | length = entries == null ? 0 : entries.length;
|
23078 |
|
23079 | this.clear();
|
23080 | while (++index < length) {
|
23081 | var entry = entries[index];
|
23082 | this.set(entry[0], entry[1]);
|
23083 | }
|
23084 | }
|
23085 |
|
23086 |
|
23087 | ListCache.prototype.clear = listCacheClear;
|
23088 | ListCache.prototype['delete'] = listCacheDelete;
|
23089 | ListCache.prototype.get = listCacheGet;
|
23090 | ListCache.prototype.has = listCacheHas;
|
23091 | ListCache.prototype.set = listCacheSet;
|
23092 |
|
23093 | module.exports = ListCache;
|
23094 |
|
23095 |
|
23096 | }),
|
23097 |
|
23098 | (function(module, exports) {
|
23099 |
|
23100 |
|
23101 |
|
23102 |
|
23103 |
|
23104 |
|
23105 |
|
23106 |
|
23107 | function listCacheClear() {
|
23108 | this.__data__ = [];
|
23109 | this.size = 0;
|
23110 | }
|
23111 |
|
23112 | module.exports = listCacheClear;
|
23113 |
|
23114 |
|
23115 | }),
|
23116 |
|
23117 | (function(module, exports, __webpack_require__) {
|
23118 |
|
23119 | var assocIndexOf = __webpack_require__(75);
|
23120 |
|
23121 |
|
23122 | var arrayProto = Array.prototype;
|
23123 |
|
23124 |
|
23125 | var splice = arrayProto.splice;
|
23126 |
|
23127 |
|
23128 |
|
23129 |
|
23130 |
|
23131 |
|
23132 |
|
23133 |
|
23134 |
|
23135 |
|
23136 | function listCacheDelete(key) {
|
23137 | var data = this.__data__,
|
23138 | index = assocIndexOf(data, key);
|
23139 |
|
23140 | if (index < 0) {
|
23141 | return false;
|
23142 | }
|
23143 | var lastIndex = data.length - 1;
|
23144 | if (index == lastIndex) {
|
23145 | data.pop();
|
23146 | } else {
|
23147 | splice.call(data, index, 1);
|
23148 | }
|
23149 | --this.size;
|
23150 | return true;
|
23151 | }
|
23152 |
|
23153 | module.exports = listCacheDelete;
|
23154 |
|
23155 |
|
23156 | }),
|
23157 |
|
23158 | (function(module, exports, __webpack_require__) {
|
23159 |
|
23160 | var assocIndexOf = __webpack_require__(75);
|
23161 |
|
23162 |
|
23163 |
|
23164 |
|
23165 |
|
23166 |
|
23167 |
|
23168 |
|
23169 |
|
23170 |
|
23171 | function listCacheGet(key) {
|
23172 | var data = this.__data__,
|
23173 | index = assocIndexOf(data, key);
|
23174 |
|
23175 | return index < 0 ? undefined : data[index][1];
|
23176 | }
|
23177 |
|
23178 | module.exports = listCacheGet;
|
23179 |
|
23180 |
|
23181 | }),
|
23182 |
|
23183 | (function(module, exports, __webpack_require__) {
|
23184 |
|
23185 | var assocIndexOf = __webpack_require__(75);
|
23186 |
|
23187 |
|
23188 |
|
23189 |
|
23190 |
|
23191 |
|
23192 |
|
23193 |
|
23194 |
|
23195 |
|
23196 | function listCacheHas(key) {
|
23197 | return assocIndexOf(this.__data__, key) > -1;
|
23198 | }
|
23199 |
|
23200 | module.exports = listCacheHas;
|
23201 |
|
23202 |
|
23203 | }),
|
23204 |
|
23205 | (function(module, exports, __webpack_require__) {
|
23206 |
|
23207 | var assocIndexOf = __webpack_require__(75);
|
23208 |
|
23209 |
|
23210 |
|
23211 |
|
23212 |
|
23213 |
|
23214 |
|
23215 |
|
23216 |
|
23217 |
|
23218 |
|
23219 | function listCacheSet(key, value) {
|
23220 | var data = this.__data__,
|
23221 | index = assocIndexOf(data, key);
|
23222 |
|
23223 | if (index < 0) {
|
23224 | ++this.size;
|
23225 | data.push([key, value]);
|
23226 | } else {
|
23227 | data[index][1] = value;
|
23228 | }
|
23229 | return this;
|
23230 | }
|
23231 |
|
23232 | module.exports = listCacheSet;
|
23233 |
|
23234 |
|
23235 | }),
|
23236 |
|
23237 | (function(module, exports) {
|
23238 |
|
23239 |
|
23240 |
|
23241 |
|
23242 |
|
23243 |
|
23244 |
|
23245 |
|
23246 |
|
23247 |
|
23248 | function arrayEach(array, iteratee) {
|
23249 | var index = -1,
|
23250 | length = array == null ? 0 : array.length;
|
23251 |
|
23252 | while (++index < length) {
|
23253 | if (iteratee(array[index], index, array) === false) {
|
23254 | break;
|
23255 | }
|
23256 | }
|
23257 | return array;
|
23258 | }
|
23259 |
|
23260 | module.exports = arrayEach;
|
23261 |
|
23262 |
|
23263 | }),
|
23264 |
|
23265 | (function(module, exports, __webpack_require__) {
|
23266 |
|
23267 | var copyObject = __webpack_require__(55),
|
23268 | keys = __webpack_require__(69);
|
23269 |
|
23270 |
|
23271 |
|
23272 |
|
23273 |
|
23274 |
|
23275 |
|
23276 |
|
23277 |
|
23278 |
|
23279 | function baseAssign(object, source) {
|
23280 | return object && copyObject(source, keys(source), object);
|
23281 | }
|
23282 |
|
23283 | module.exports = baseAssign;
|
23284 |
|
23285 |
|
23286 | }),
|
23287 |
|
23288 | (function(module, exports, __webpack_require__) {
|
23289 |
|
23290 | var copyObject = __webpack_require__(55),
|
23291 | keysIn = __webpack_require__(330);
|
23292 |
|
23293 |
|
23294 |
|
23295 |
|
23296 |
|
23297 |
|
23298 |
|
23299 |
|
23300 |
|
23301 |
|
23302 | function baseAssignIn(object, source) {
|
23303 | return object && copyObject(source, keysIn(source), object);
|
23304 | }
|
23305 |
|
23306 | module.exports = baseAssignIn;
|
23307 |
|
23308 |
|
23309 | }),
|
23310 |
|
23311 | (function(module, exports) {
|
23312 |
|
23313 |
|
23314 |
|
23315 |
|
23316 |
|
23317 |
|
23318 |
|
23319 |
|
23320 |
|
23321 |
|
23322 | function nativeKeysIn(object) {
|
23323 | var result = [];
|
23324 | if (object != null) {
|
23325 | for (var key in Object(object)) {
|
23326 | result.push(key);
|
23327 | }
|
23328 | }
|
23329 | return result;
|
23330 | }
|
23331 |
|
23332 | module.exports = nativeKeysIn;
|
23333 |
|
23334 |
|
23335 | }),
|
23336 |
|
23337 | (function(module, exports, __webpack_require__) {
|
23338 |
|
23339 | (function(module) {var root = __webpack_require__(332);
|
23340 |
|
23341 |
|
23342 | var freeExports = true && exports && !exports.nodeType && exports;
|
23343 |
|
23344 |
|
23345 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
23346 |
|
23347 |
|
23348 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
23349 |
|
23350 |
|
23351 | var Buffer = moduleExports ? root.Buffer : undefined,
|
23352 | allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
23353 |
|
23354 |
|
23355 |
|
23356 |
|
23357 |
|
23358 |
|
23359 |
|
23360 |
|
23361 |
|
23362 | function cloneBuffer(buffer, isDeep) {
|
23363 | if (isDeep) {
|
23364 | return buffer.slice();
|
23365 | }
|
23366 | var length = buffer.length,
|
23367 | result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
23368 |
|
23369 | buffer.copy(result);
|
23370 | return result;
|
23371 | }
|
23372 |
|
23373 | module.exports = cloneBuffer;
|
23374 |
|
23375 | }.call(this, __webpack_require__(135)(module)))
|
23376 |
|
23377 | }),
|
23378 |
|
23379 | (function(module, exports, __webpack_require__) {
|
23380 |
|
23381 | var freeGlobal = __webpack_require__(333);
|
23382 |
|
23383 |
|
23384 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
23385 |
|
23386 |
|
23387 | var root = freeGlobal || freeSelf || Function('return this')();
|
23388 |
|
23389 | module.exports = root;
|
23390 |
|
23391 |
|
23392 | }),
|
23393 |
|
23394 | (function(module, exports, __webpack_require__) {
|
23395 |
|
23396 | (function(global) {
|
23397 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
23398 |
|
23399 | module.exports = freeGlobal;
|
23400 |
|
23401 | }.call(this, __webpack_require__(101)))
|
23402 |
|
23403 | }),
|
23404 |
|
23405 | (function(module, exports) {
|
23406 |
|
23407 |
|
23408 |
|
23409 |
|
23410 |
|
23411 |
|
23412 |
|
23413 |
|
23414 |
|
23415 | function copyArray(source, array) {
|
23416 | var index = -1,
|
23417 | length = source.length;
|
23418 |
|
23419 | array || (array = Array(length));
|
23420 | while (++index < length) {
|
23421 | array[index] = source[index];
|
23422 | }
|
23423 | return array;
|
23424 | }
|
23425 |
|
23426 | module.exports = copyArray;
|
23427 |
|
23428 |
|
23429 | }),
|
23430 |
|
23431 | (function(module, exports, __webpack_require__) {
|
23432 |
|
23433 | var copyObject = __webpack_require__(55),
|
23434 | getSymbols = __webpack_require__(336);
|
23435 |
|
23436 |
|
23437 |
|
23438 |
|
23439 |
|
23440 |
|
23441 |
|
23442 |
|
23443 |
|
23444 | function copySymbols(source, object) {
|
23445 | return copyObject(source, getSymbols(source), object);
|
23446 | }
|
23447 |
|
23448 | module.exports = copySymbols;
|
23449 |
|
23450 |
|
23451 | }),
|
23452 |
|
23453 | (function(module, exports) {
|
23454 |
|
23455 |
|
23456 |
|
23457 |
|
23458 |
|
23459 |
|
23460 |
|
23461 |
|
23462 |
|
23463 |
|
23464 |
|
23465 |
|
23466 |
|
23467 |
|
23468 |
|
23469 |
|
23470 |
|
23471 |
|
23472 |
|
23473 | function stubArray() {
|
23474 | return [];
|
23475 | }
|
23476 |
|
23477 | module.exports = stubArray;
|
23478 |
|
23479 |
|
23480 | }),
|
23481 |
|
23482 | (function(module, exports, __webpack_require__) {
|
23483 |
|
23484 | var copyObject = __webpack_require__(55),
|
23485 | getSymbolsIn = __webpack_require__(338);
|
23486 |
|
23487 |
|
23488 |
|
23489 |
|
23490 |
|
23491 |
|
23492 |
|
23493 |
|
23494 |
|
23495 | function copySymbolsIn(source, object) {
|
23496 | return copyObject(source, getSymbolsIn(source), object);
|
23497 | }
|
23498 |
|
23499 | module.exports = copySymbolsIn;
|
23500 |
|
23501 |
|
23502 | }),
|
23503 |
|
23504 | (function(module, exports) {
|
23505 |
|
23506 |
|
23507 |
|
23508 |
|
23509 |
|
23510 |
|
23511 |
|
23512 |
|
23513 |
|
23514 |
|
23515 |
|
23516 |
|
23517 |
|
23518 |
|
23519 |
|
23520 |
|
23521 |
|
23522 |
|
23523 |
|
23524 | function stubArray() {
|
23525 | return [];
|
23526 | }
|
23527 |
|
23528 | module.exports = stubArray;
|
23529 |
|
23530 |
|
23531 | }),
|
23532 |
|
23533 | (function(module, exports, __webpack_require__) {
|
23534 |
|
23535 | var overArg = __webpack_require__(100);
|
23536 |
|
23537 |
|
23538 | var nativeKeys = overArg(Object.keys, Object);
|
23539 |
|
23540 | module.exports = nativeKeys;
|
23541 |
|
23542 |
|
23543 | }),
|
23544 |
|
23545 | (function(module, exports) {
|
23546 |
|
23547 |
|
23548 |
|
23549 |
|
23550 |
|
23551 |
|
23552 |
|
23553 |
|
23554 |
|
23555 |
|
23556 | function nativeKeysIn(object) {
|
23557 | var result = [];
|
23558 | if (object != null) {
|
23559 | for (var key in Object(object)) {
|
23560 | result.push(key);
|
23561 | }
|
23562 | }
|
23563 | return result;
|
23564 | }
|
23565 |
|
23566 | module.exports = nativeKeysIn;
|
23567 |
|
23568 |
|
23569 | }),
|
23570 |
|
23571 | (function(module, exports) {
|
23572 |
|
23573 |
|
23574 | var objectProto = Object.prototype;
|
23575 |
|
23576 |
|
23577 |
|
23578 |
|
23579 |
|
23580 |
|
23581 | var nativeObjectToString = objectProto.toString;
|
23582 |
|
23583 |
|
23584 |
|
23585 |
|
23586 |
|
23587 |
|
23588 |
|
23589 |
|
23590 | function objectToString(value) {
|
23591 | return nativeObjectToString.call(value);
|
23592 | }
|
23593 |
|
23594 | module.exports = objectToString;
|
23595 |
|
23596 |
|
23597 | }),
|
23598 |
|
23599 | (function(module, exports) {
|
23600 |
|
23601 |
|
23602 | var objectProto = Object.prototype;
|
23603 |
|
23604 |
|
23605 | var hasOwnProperty = objectProto.hasOwnProperty;
|
23606 |
|
23607 |
|
23608 |
|
23609 |
|
23610 |
|
23611 |
|
23612 |
|
23613 |
|
23614 | function initCloneArray(array) {
|
23615 | var length = array.length,
|
23616 | result = new array.constructor(length);
|
23617 |
|
23618 |
|
23619 | if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
23620 | result.index = array.index;
|
23621 | result.input = array.input;
|
23622 | }
|
23623 | return result;
|
23624 | }
|
23625 |
|
23626 | module.exports = initCloneArray;
|
23627 |
|
23628 |
|
23629 | }),
|
23630 |
|
23631 | (function(module, exports) {
|
23632 |
|
23633 |
|
23634 |
|
23635 |
|
23636 |
|
23637 |
|
23638 |
|
23639 |
|
23640 |
|
23641 |
|
23642 |
|
23643 |
|
23644 |
|
23645 |
|
23646 |
|
23647 |
|
23648 |
|
23649 | function identity(value) {
|
23650 | return value;
|
23651 | }
|
23652 |
|
23653 | module.exports = identity;
|
23654 |
|
23655 |
|
23656 | }),
|
23657 |
|
23658 | (function(module, exports, __webpack_require__) {
|
23659 |
|
23660 | var baseCreate = __webpack_require__(345),
|
23661 | getPrototype = __webpack_require__(158),
|
23662 | isPrototype = __webpack_require__(132);
|
23663 |
|
23664 |
|
23665 |
|
23666 |
|
23667 |
|
23668 |
|
23669 |
|
23670 |
|
23671 | function initCloneObject(object) {
|
23672 | return (typeof object.constructor == 'function' && !isPrototype(object))
|
23673 | ? baseCreate(getPrototype(object))
|
23674 | : {};
|
23675 | }
|
23676 |
|
23677 | module.exports = initCloneObject;
|
23678 |
|
23679 |
|
23680 | }),
|
23681 |
|
23682 | (function(module, exports, __webpack_require__) {
|
23683 |
|
23684 | var isObject = __webpack_require__(35);
|
23685 |
|
23686 |
|
23687 | var objectCreate = Object.create;
|
23688 |
|
23689 |
|
23690 |
|
23691 |
|
23692 |
|
23693 |
|
23694 |
|
23695 |
|
23696 |
|
23697 | var baseCreate = (function() {
|
23698 | function object() {}
|
23699 | return function(proto) {
|
23700 | if (!isObject(proto)) {
|
23701 | return {};
|
23702 | }
|
23703 | if (objectCreate) {
|
23704 | return objectCreate(proto);
|
23705 | }
|
23706 | object.prototype = proto;
|
23707 | var result = new object;
|
23708 | object.prototype = undefined;
|
23709 | return result;
|
23710 | };
|
23711 | }());
|
23712 |
|
23713 | module.exports = baseCreate;
|
23714 |
|
23715 |
|
23716 | }),
|
23717 |
|
23718 | (function(module, exports) {
|
23719 |
|
23720 |
|
23721 |
|
23722 |
|
23723 |
|
23724 |
|
23725 |
|
23726 |
|
23727 |
|
23728 |
|
23729 |
|
23730 |
|
23731 |
|
23732 |
|
23733 | function stubFalse() {
|
23734 | return false;
|
23735 | }
|
23736 |
|
23737 | module.exports = stubFalse;
|
23738 |
|
23739 |
|
23740 | }),
|
23741 |
|
23742 | (function(module, exports) {
|
23743 |
|
23744 |
|
23745 |
|
23746 |
|
23747 |
|
23748 |
|
23749 |
|
23750 |
|
23751 |
|
23752 |
|
23753 |
|
23754 |
|
23755 |
|
23756 |
|
23757 | function stubFalse() {
|
23758 | return false;
|
23759 | }
|
23760 |
|
23761 | module.exports = stubFalse;
|
23762 |
|
23763 |
|
23764 | }),
|
23765 |
|
23766 | (function(module, exports) {
|
23767 |
|
23768 |
|
23769 |
|
23770 |
|
23771 |
|
23772 |
|
23773 |
|
23774 |
|
23775 |
|
23776 |
|
23777 |
|
23778 |
|
23779 |
|
23780 |
|
23781 | function stubFalse() {
|
23782 | return false;
|
23783 | }
|
23784 |
|
23785 | module.exports = stubFalse;
|
23786 |
|
23787 |
|
23788 | }),
|
23789 |
|
23790 | (function(module, exports, __webpack_require__) {
|
23791 |
|
23792 | __webpack_require__(105);
|
23793 | __webpack_require__(56);
|
23794 | __webpack_require__(350);
|
23795 | __webpack_require__(355);
|
23796 | __webpack_require__(357);
|
23797 | module.exports = __webpack_require__(5).WeakMap;
|
23798 |
|
23799 |
|
23800 | }),
|
23801 |
|
23802 | (function(module, exports, __webpack_require__) {
|
23803 |
|
23804 | "use strict";
|
23805 |
|
23806 | var global = __webpack_require__(7);
|
23807 | var each = __webpack_require__(114)(0);
|
23808 | var redefine = __webpack_require__(96);
|
23809 | var meta = __webpack_require__(66);
|
23810 | var assign = __webpack_require__(156);
|
23811 | var weak = __webpack_require__(353);
|
23812 | var isObject = __webpack_require__(9);
|
23813 | var validate = __webpack_require__(115);
|
23814 | var NATIVE_WEAK_MAP = __webpack_require__(115);
|
23815 | var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
|
23816 | var WEAK_MAP = 'WeakMap';
|
23817 | var getWeak = meta.getWeak;
|
23818 | var isExtensible = Object.isExtensible;
|
23819 | var uncaughtFrozenStore = weak.ufstore;
|
23820 | var InternalMap;
|
23821 |
|
23822 | var wrapper = function (get) {
|
23823 | return function WeakMap() {
|
23824 | return get(this, arguments.length > 0 ? arguments[0] : undefined);
|
23825 | };
|
23826 | };
|
23827 |
|
23828 | var methods = {
|
23829 |
|
23830 | get: function get(key) {
|
23831 | if (isObject(key)) {
|
23832 | var data = getWeak(key);
|
23833 | if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
|
23834 | return data ? data[this._i] : undefined;
|
23835 | }
|
23836 | },
|
23837 |
|
23838 | set: function set(key, value) {
|
23839 | return weak.def(validate(this, WEAK_MAP), key, value);
|
23840 | }
|
23841 | };
|
23842 |
|
23843 |
|
23844 | var $WeakMap = module.exports = __webpack_require__(354)(WEAK_MAP, wrapper, methods, weak, true, true);
|
23845 |
|
23846 |
|
23847 | if (NATIVE_WEAK_MAP && IS_IE11) {
|
23848 | InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
|
23849 | assign(InternalMap.prototype, methods);
|
23850 | meta.NEED = true;
|
23851 | each(['delete', 'has', 'get', 'set'], function (key) {
|
23852 | var proto = $WeakMap.prototype;
|
23853 | var method = proto[key];
|
23854 | redefine(proto, key, function (a, b) {
|
23855 |
|
23856 | if (isObject(a) && !isExtensible(a)) {
|
23857 | if (!this._f) this._f = new InternalMap();
|
23858 | var result = this._f[key](a, b);
|
23859 | return key == 'set' ? this : result;
|
23860 |
|
23861 | } return method.call(this, a, b);
|
23862 | });
|
23863 | });
|
23864 | }
|
23865 |
|
23866 |
|
23867 | }),
|
23868 |
|
23869 | (function(module, exports, __webpack_require__) {
|
23870 |
|
23871 |
|
23872 | var speciesConstructor = __webpack_require__(352);
|
23873 |
|
23874 | module.exports = function (original, length) {
|
23875 | return new (speciesConstructor(original))(length);
|
23876 | };
|
23877 |
|
23878 |
|
23879 | }),
|
23880 |
|
23881 | (function(module, exports, __webpack_require__) {
|
23882 |
|
23883 | var isObject = __webpack_require__(9);
|
23884 | var isArray = __webpack_require__(99);
|
23885 | var SPECIES = __webpack_require__(11)('species');
|
23886 |
|
23887 | module.exports = function (original) {
|
23888 | var C;
|
23889 | if (isArray(original)) {
|
23890 | C = original.constructor;
|
23891 |
|
23892 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
23893 | if (isObject(C)) {
|
23894 | C = C[SPECIES];
|
23895 | if (C === null) C = undefined;
|
23896 | }
|
23897 | } return C === undefined ? Array : C;
|
23898 | };
|
23899 |
|
23900 |
|
23901 | }),
|
23902 |
|
23903 | (function(module, exports, __webpack_require__) {
|
23904 |
|
23905 | "use strict";
|
23906 |
|
23907 | var redefineAll = __webpack_require__(109);
|
23908 | var getWeak = __webpack_require__(66).getWeak;
|
23909 | var anObject = __webpack_require__(12);
|
23910 | var isObject = __webpack_require__(9);
|
23911 | var anInstance = __webpack_require__(107);
|
23912 | var forOf = __webpack_require__(71);
|
23913 | var createArrayMethod = __webpack_require__(114);
|
23914 | var $has = __webpack_require__(23);
|
23915 | var validate = __webpack_require__(115);
|
23916 | var arrayFind = createArrayMethod(5);
|
23917 | var arrayFindIndex = createArrayMethod(6);
|
23918 | var id = 0;
|
23919 |
|
23920 |
|
23921 | var uncaughtFrozenStore = function (that) {
|
23922 | return that._l || (that._l = new UncaughtFrozenStore());
|
23923 | };
|
23924 | var UncaughtFrozenStore = function () {
|
23925 | this.a = [];
|
23926 | };
|
23927 | var findUncaughtFrozen = function (store, key) {
|
23928 | return arrayFind(store.a, function (it) {
|
23929 | return it[0] === key;
|
23930 | });
|
23931 | };
|
23932 | UncaughtFrozenStore.prototype = {
|
23933 | get: function (key) {
|
23934 | var entry = findUncaughtFrozen(this, key);
|
23935 | if (entry) return entry[1];
|
23936 | },
|
23937 | has: function (key) {
|
23938 | return !!findUncaughtFrozen(this, key);
|
23939 | },
|
23940 | set: function (key, value) {
|
23941 | var entry = findUncaughtFrozen(this, key);
|
23942 | if (entry) entry[1] = value;
|
23943 | else this.a.push([key, value]);
|
23944 | },
|
23945 | 'delete': function (key) {
|
23946 | var index = arrayFindIndex(this.a, function (it) {
|
23947 | return it[0] === key;
|
23948 | });
|
23949 | if (~index) this.a.splice(index, 1);
|
23950 | return !!~index;
|
23951 | }
|
23952 | };
|
23953 |
|
23954 | module.exports = {
|
23955 | getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
|
23956 | var C = wrapper(function (that, iterable) {
|
23957 | anInstance(that, C, NAME, '_i');
|
23958 | that._t = NAME;
|
23959 | that._i = id++;
|
23960 | that._l = undefined;
|
23961 | if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
|
23962 | });
|
23963 | redefineAll(C.prototype, {
|
23964 |
|
23965 |
|
23966 | 'delete': function (key) {
|
23967 | if (!isObject(key)) return false;
|
23968 | var data = getWeak(key);
|
23969 | if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
|
23970 | return data && $has(data, this._i) && delete data[this._i];
|
23971 | },
|
23972 |
|
23973 |
|
23974 | has: function has(key) {
|
23975 | if (!isObject(key)) return false;
|
23976 | var data = getWeak(key);
|
23977 | if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
|
23978 | return data && $has(data, this._i);
|
23979 | }
|
23980 | });
|
23981 | return C;
|
23982 | },
|
23983 | def: function (that, key, value) {
|
23984 | var data = getWeak(anObject(key), true);
|
23985 | if (data === true) uncaughtFrozenStore(that).set(key, value);
|
23986 | else data[that._i] = value;
|
23987 | return that;
|
23988 | },
|
23989 | ufstore: uncaughtFrozenStore
|
23990 | };
|
23991 |
|
23992 |
|
23993 | }),
|
23994 |
|
23995 | (function(module, exports, __webpack_require__) {
|
23996 |
|
23997 | "use strict";
|
23998 |
|
23999 | var global = __webpack_require__(7);
|
24000 | var $export = __webpack_require__(6);
|
24001 | var meta = __webpack_require__(66);
|
24002 | var fails = __webpack_require__(28);
|
24003 | var hide = __webpack_require__(27);
|
24004 | var redefineAll = __webpack_require__(109);
|
24005 | var forOf = __webpack_require__(71);
|
24006 | var anInstance = __webpack_require__(107);
|
24007 | var isObject = __webpack_require__(9);
|
24008 | var setToStringTag = __webpack_require__(54);
|
24009 | var dP = __webpack_require__(19).f;
|
24010 | var each = __webpack_require__(114)(0);
|
24011 | var DESCRIPTORS = __webpack_require__(16);
|
24012 |
|
24013 | module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
|
24014 | var Base = global[NAME];
|
24015 | var C = Base;
|
24016 | var ADDER = IS_MAP ? 'set' : 'add';
|
24017 | var proto = C && C.prototype;
|
24018 | var O = {};
|
24019 | if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
|
24020 | new C().entries().next();
|
24021 | }))) {
|
24022 |
|
24023 | C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
|
24024 | redefineAll(C.prototype, methods);
|
24025 | meta.NEED = true;
|
24026 | } else {
|
24027 | C = wrapper(function (target, iterable) {
|
24028 | anInstance(target, C, NAME, '_c');
|
24029 | target._c = new Base();
|
24030 | if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
|
24031 | });
|
24032 | each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
|
24033 | var IS_ADDER = KEY == 'add' || KEY == 'set';
|
24034 | if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
|
24035 | anInstance(this, C, KEY);
|
24036 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
|
24037 | var result = this._c[KEY](a === 0 ? 0 : a, b);
|
24038 | return IS_ADDER ? this : result;
|
24039 | });
|
24040 | });
|
24041 | IS_WEAK || dP(C.prototype, 'size', {
|
24042 | get: function () {
|
24043 | return this._c.size;
|
24044 | }
|
24045 | });
|
24046 | }
|
24047 |
|
24048 | setToStringTag(C, NAME);
|
24049 |
|
24050 | O[NAME] = C;
|
24051 | $export($export.G + $export.W + $export.F, O);
|
24052 |
|
24053 | if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
|
24054 |
|
24055 | return C;
|
24056 | };
|
24057 |
|
24058 |
|
24059 | }),
|
24060 |
|
24061 | (function(module, exports, __webpack_require__) {
|
24062 |
|
24063 |
|
24064 | __webpack_require__(356)('WeakMap');
|
24065 |
|
24066 |
|
24067 | }),
|
24068 |
|
24069 | (function(module, exports, __webpack_require__) {
|
24070 |
|
24071 | "use strict";
|
24072 |
|
24073 |
|
24074 | var $export = __webpack_require__(6);
|
24075 |
|
24076 | module.exports = function (COLLECTION) {
|
24077 | $export($export.S, COLLECTION, { of: function of() {
|
24078 | var length = arguments.length;
|
24079 | var A = new Array(length);
|
24080 | while (length--) A[length] = arguments[length];
|
24081 | return new this(A);
|
24082 | } });
|
24083 | };
|
24084 |
|
24085 |
|
24086 | }),
|
24087 |
|
24088 | (function(module, exports, __webpack_require__) {
|
24089 |
|
24090 |
|
24091 | __webpack_require__(358)('WeakMap');
|
24092 |
|
24093 |
|
24094 | }),
|
24095 |
|
24096 | (function(module, exports, __webpack_require__) {
|
24097 |
|
24098 | "use strict";
|
24099 |
|
24100 |
|
24101 | var $export = __webpack_require__(6);
|
24102 | var aFunction = __webpack_require__(33);
|
24103 | var ctx = __webpack_require__(26);
|
24104 | var forOf = __webpack_require__(71);
|
24105 |
|
24106 | module.exports = function (COLLECTION) {
|
24107 | $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
|
24108 | var mapFn = arguments[1];
|
24109 | var mapping, A, n, cb;
|
24110 | aFunction(this);
|
24111 | mapping = mapFn !== undefined;
|
24112 | if (mapping) aFunction(mapFn);
|
24113 | if (source == undefined) return new this();
|
24114 | A = [];
|
24115 | if (mapping) {
|
24116 | n = 0;
|
24117 | cb = ctx(mapFn, arguments[2], 2);
|
24118 | forOf(source, false, function (nextItem) {
|
24119 | A.push(cb(nextItem, n++));
|
24120 | });
|
24121 | } else {
|
24122 | forOf(source, false, A.push, A);
|
24123 | }
|
24124 | return new this(A);
|
24125 | } });
|
24126 | };
|
24127 |
|
24128 |
|
24129 | }),
|
24130 |
|
24131 | (function(module, exports, __webpack_require__) {
|
24132 |
|
24133 | var _Object$keys = __webpack_require__(1);
|
24134 |
|
24135 | function _objectWithoutPropertiesLoose(source, excluded) {
|
24136 | if (source == null) return {};
|
24137 | var target = {};
|
24138 |
|
24139 | var sourceKeys = _Object$keys(source);
|
24140 |
|
24141 | var key, i;
|
24142 |
|
24143 | for (i = 0; i < sourceKeys.length; i++) {
|
24144 | key = sourceKeys[i];
|
24145 | if (excluded.indexOf(key) >= 0) continue;
|
24146 | target[key] = source[key];
|
24147 | }
|
24148 |
|
24149 | return target;
|
24150 | }
|
24151 |
|
24152 | module.exports = _objectWithoutPropertiesLoose;
|
24153 |
|
24154 | }),
|
24155 |
|
24156 | (function(module, exports) {
|
24157 |
|
24158 |
|
24159 |
|
24160 |
|
24161 |
|
24162 |
|
24163 |
|
24164 |
|
24165 |
|
24166 |
|
24167 |
|
24168 |
|
24169 |
|
24170 |
|
24171 |
|
24172 |
|
24173 |
|
24174 |
|
24175 |
|
24176 |
|
24177 |
|
24178 |
|
24179 |
|
24180 |
|
24181 |
|
24182 | function isObjectLike(value) {
|
24183 | return value != null && typeof value == 'object';
|
24184 | }
|
24185 |
|
24186 | module.exports = isObjectLike;
|
24187 |
|
24188 |
|
24189 | })
|
24190 | ])["default"];
|
24191 | }); |
\ | No newline at end of file |