PluginProbe ʕ •ᴥ•ʔ
Conditional Fields for Contact Form 7 / 2.1.1
Conditional Fields for Contact Form 7 v2.1.1
2.7.10 2.7.9 2.7.8 2.7.7 2.7.6 2.7.5 2.7.4 2.7.3 2.7.2 0.2.4 0.2.5 0.2.6 0.2.7 0.2.8 0.2.9 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.4 1.4.1 1.4.2 1.4.3 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6.1 1.6.2 1.6.3 1.6.5 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.8 1.7.9 1.8 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.8.7 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2 2.2.1 2.2.10 2.2.11 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.10 2.3.11 2.3.12 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.7 2.7.1 trunk 0.1 0.1.1 0.1.2 0.1.3 0.1.4 0.1.5 0.1.6 0.1.7 0.2 0.2.1 0.2.2 0.2.3
cf7-conditional-fields / js / scripts.js
cf7-conditional-fields / js Last commit date
scripts.js 4 years ago scripts.js.map 4 years ago scripts_admin.js 5 years ago scripts_admin_all_pages.js 5 years ago scripts_es6.js 4 years ago
scripts.js
4052 lines
1 /******/ (function(modules) { // webpackBootstrap
2 /******/ // The module cache
3 /******/ var installedModules = {};
4 /******/
5 /******/ // The require function
6 /******/ function __webpack_require__(moduleId) {
7 /******/
8 /******/ // Check if module is in cache
9 /******/ if(installedModules[moduleId]) {
10 /******/ return installedModules[moduleId].exports;
11 /******/ }
12 /******/ // Create a new module (and put it into the cache)
13 /******/ var module = installedModules[moduleId] = {
14 /******/ i: moduleId,
15 /******/ l: false,
16 /******/ exports: {}
17 /******/ };
18 /******/
19 /******/ // Execute the module function
20 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21 /******/
22 /******/ // Flag the module as loaded
23 /******/ module.l = true;
24 /******/
25 /******/ // Return the exports of the module
26 /******/ return module.exports;
27 /******/ }
28 /******/
29 /******/
30 /******/ // expose the modules object (__webpack_modules__)
31 /******/ __webpack_require__.m = modules;
32 /******/
33 /******/ // expose the module cache
34 /******/ __webpack_require__.c = installedModules;
35 /******/
36 /******/ // define getter function for harmony exports
37 /******/ __webpack_require__.d = function(exports, name, getter) {
38 /******/ if(!__webpack_require__.o(exports, name)) {
39 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
40 /******/ }
41 /******/ };
42 /******/
43 /******/ // define __esModule on exports
44 /******/ __webpack_require__.r = function(exports) {
45 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47 /******/ }
48 /******/ Object.defineProperty(exports, '__esModule', { value: true });
49 /******/ };
50 /******/
51 /******/ // create a fake namespace object
52 /******/ // mode & 1: value is a module id, require it
53 /******/ // mode & 2: merge all properties of value into the ns
54 /******/ // mode & 4: return value when already ns object
55 /******/ // mode & 8|1: behave like require
56 /******/ __webpack_require__.t = function(value, mode) {
57 /******/ if(mode & 1) value = __webpack_require__(value);
58 /******/ if(mode & 8) return value;
59 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60 /******/ var ns = Object.create(null);
61 /******/ __webpack_require__.r(ns);
62 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64 /******/ return ns;
65 /******/ };
66 /******/
67 /******/ // getDefaultExport function for compatibility with non-harmony modules
68 /******/ __webpack_require__.n = function(module) {
69 /******/ var getter = module && module.__esModule ?
70 /******/ function getDefault() { return module['default']; } :
71 /******/ function getModuleExports() { return module; };
72 /******/ __webpack_require__.d(getter, 'a', getter);
73 /******/ return getter;
74 /******/ };
75 /******/
76 /******/ // Object.prototype.hasOwnProperty.call
77 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78 /******/
79 /******/ // __webpack_public_path__
80 /******/ __webpack_require__.p = "";
81 /******/
82 /******/
83 /******/ // Load entry module and return exports
84 /******/ return __webpack_require__(__webpack_require__.s = 0);
85 /******/ })
86 /************************************************************************/
87 /******/ ({
88
89 /***/ "./js/scripts_es6.js":
90 /*!***************************!*\
91 !*** ./js/scripts_es6.js ***!
92 \***************************/
93 /*! no exports provided */
94 /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
96 "use strict";
97 __webpack_require__.r(__webpack_exports__);
98 /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
99 /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
100 /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
101 /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);
102 /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
103 /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);
104 /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
105 /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);
106 /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
107 /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__);
108
109
110
111
112
113
114
115
116 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
117
118 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
119
120 var cf7signature_resized = 0; // for compatibility with contact-form-7-signature-addon
121
122 var wpcf7cf_timeout;
123 var wpcf7cf_change_time_ms = 100;
124
125 if (window.wpcf7 && !wpcf7.setStatus) {
126 wpcf7.setStatus = function (form, status) {
127 form = form.length ? form[0] : form; // if form is a jQuery object, only grab te html-element
128
129 var defaultStatuses = new Map([// 0: Status in API response, 1: Status in HTML class
130 ['init', 'init'], ['validation_failed', 'invalid'], ['acceptance_missing', 'unaccepted'], ['spam', 'spam'], ['aborted', 'aborted'], ['mail_sent', 'sent'], ['mail_failed', 'failed'], ['submitting', 'submitting'], ['resetting', 'resetting']]);
131
132 if (defaultStatuses.has(status)) {
133 status = defaultStatuses.get(status);
134 }
135
136 if (!Array.from(defaultStatuses.values()).includes(status)) {
137 status = status.replace(/[^0-9a-z]+/i, ' ').trim();
138 status = status.replace(/\s+/, '-');
139 status = "custom-".concat(status);
140 }
141
142 var prevStatus = form.getAttribute('data-status');
143 form.wpcf7.status = status;
144 form.setAttribute('data-status', status);
145 form.classList.add(status);
146
147 if (prevStatus && prevStatus !== status) {
148 form.classList.remove(prevStatus);
149 }
150
151 return status;
152 };
153 }
154
155 if (window.wpcf7cf_running_tests) {
156 jQuery('input[name="_wpcf7cf_options"]').each(function (e) {
157 var $input = jQuery(this);
158 var opt = JSON.parse($input.val());
159 opt.settings.animation_intime = 0;
160 opt.settings.animation_outtime = 0;
161 $input.val(JSON.stringify(opt));
162 });
163 wpcf7cf_change_time_ms = 0;
164 }
165
166 var wpcf7cf_show_animation = {
167 "height": "show",
168 "marginTop": "show",
169 "marginBottom": "show",
170 "paddingTop": "show",
171 "paddingBottom": "show"
172 };
173 var wpcf7cf_hide_animation = {
174 "height": "hide",
175 "marginTop": "hide",
176 "marginBottom": "hide",
177 "paddingTop": "hide",
178 "paddingBottom": "hide"
179 };
180 var wpcf7cf_show_step_animation = {
181 "opacity": "show"
182 };
183 var wpcf7cf_hide_step_animation = {
184 "opacity": "hide"
185 };
186 var wpcf7cf_change_events = 'input.wpcf7cf paste.wpcf7cf change.wpcf7cf click.wpcf7cf propertychange.wpcf7cf changedisabledprop.wpcf7cf';
187 var wpcf7cf_forms = [];
188 window.wpcf7cf_dom = {};
189
190 var wpcf7cf_reload_dom = function wpcf7cf_reload_dom($form) {
191 wpcf7cf_dom = wpcf7cf.get_simplified_dom_model($form[0]);
192 };
193
194 var wpcf7cf_getFieldsByOriginalName = function wpcf7cf_getFieldsByOriginalName(originalName) {
195 return Object.values(wpcf7cf_dom).filter(function (inputField) {
196 return inputField.original_name === originalName || inputField.original_name === originalName + '[]';
197 });
198 };
199
200 var wpcf7cf_getFieldByName = function wpcf7cf_getFieldByName(name) {
201 return wpcf7cf_dom[name] || wpcf7cf_dom[name + '[]'];
202 }; // endsWith polyfill
203
204
205 if (!String.prototype.endsWith) {
206 String.prototype.endsWith = function (search, this_len) {
207 if (this_len === undefined || this_len > this.length) {
208 this_len = this.length;
209 }
210
211 return this.substring(this_len - search.length, this_len) === search;
212 };
213 } // Object.values polyfill
214
215
216 if (!Object.values) Object.values = function (o) {
217 return Object.keys(o).map(function (k) {
218 return o[k];
219 });
220 }; // Array.from polyfill
221
222 if (!Array.from) {
223 Array.from = function () {
224 var toStr = Object.prototype.toString;
225
226 var isCallable = function isCallable(fn) {
227 return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
228 };
229
230 var toInteger = function toInteger(value) {
231 var number = Number(value);
232
233 if (isNaN(number)) {
234 return 0;
235 }
236
237 if (number === 0 || !isFinite(number)) {
238 return number;
239 }
240
241 return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
242 };
243
244 var maxSafeInteger = Math.pow(2, 53) - 1;
245
246 var toLength = function toLength(value) {
247 var len = toInteger(value);
248 return Math.min(Math.max(len, 0), maxSafeInteger);
249 }; // The length property of the from method is 1.
250
251
252 return function from(arrayLike
253 /*, mapFn, thisArg */
254 ) {
255 // 1. Let C be the this value.
256 var C = this; // 2. Let items be ToObject(arrayLike).
257
258 var items = Object(arrayLike); // 3. ReturnIfAbrupt(items).
259
260 if (arrayLike == null) {
261 throw new TypeError("Array.from requires an array-like object - not null or undefined");
262 } // 4. If mapfn is undefined, then let mapping be false.
263
264
265 var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
266 var T;
267
268 if (typeof mapFn !== 'undefined') {
269 // 5. else
270 // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
271 if (!isCallable(mapFn)) {
272 throw new TypeError('Array.from: when provided, the second argument must be a function');
273 } // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
274
275
276 if (arguments.length > 2) {
277 T = arguments[2];
278 }
279 } // 10. Let lenValue be Get(items, "length").
280 // 11. Let len be ToLength(lenValue).
281
282
283 var len = toLength(items.length); // 13. If IsConstructor(C) is true, then
284 // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len.
285 // 14. a. Else, Let A be ArrayCreate(len).
286
287 var A = isCallable(C) ? Object(new C(len)) : new Array(len); // 16. Let k be 0.
288
289 var k = 0; // 17. Repeat, while k < len… (also steps a - h)
290
291 var kValue;
292
293 while (k < len) {
294 kValue = items[k];
295
296 if (mapFn) {
297 A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
298 } else {
299 A[k] = kValue;
300 }
301
302 k += 1;
303 } // 18. Let putStatus be Put(A, "length", len, true).
304
305
306 A.length = len; // 20. Return A.
307
308 return A;
309 };
310 }();
311 }
312
313 var Wpcf7cfForm = function Wpcf7cfForm($form) {
314 var options_element = $form.find('input[name="_wpcf7cf_options"]').eq(0);
315
316 if (!options_element.length || !options_element.val()) {
317 // doesn't look like a CF7 form created with conditional fields plugin enabled.
318 return false;
319 }
320
321 var form = this;
322 var form_options = JSON.parse(options_element.val());
323 form.$form = $form;
324 form.$input_hidden_group_fields = $form.find('[name="_wpcf7cf_hidden_group_fields"]');
325 form.$input_hidden_groups = $form.find('[name="_wpcf7cf_hidden_groups"]');
326 form.$input_visible_groups = $form.find('[name="_wpcf7cf_visible_groups"]');
327 form.$input_repeaters = $form.find('[name="_wpcf7cf_repeaters"]');
328 form.$input_steps = $form.find('[name="_wpcf7cf_steps"]');
329 form.unit_tag = $form.closest('.wpcf7').attr('id');
330 form.conditions = form_options['conditions']; // Wrapper around jQuery(selector, form.$form)
331
332 form.get = function (selector) {
333 // TODO: implement some caching here.
334 return jQuery(selector, form.$form);
335 }; // compatibility with conditional forms created with older versions of the plugin ( < 1.4 )
336
337
338 for (var i = 0; i < form.conditions.length; i++) {
339 var condition = form.conditions[i];
340
341 if (!('and_rules' in condition)) {
342 condition.and_rules = [{
343 'if_field': condition.if_field,
344 'if_value': condition.if_value,
345 'operator': condition.operator
346 }];
347 }
348 }
349
350 form.initial_conditions = form.conditions;
351 form.settings = form_options['settings'];
352 form.$groups = jQuery(); // empty jQuery set
353
354 form.repeaters = [];
355 form.multistep = null;
356 form.fields = [];
357 form.settings.animation_intime = parseInt(form.settings.animation_intime);
358 form.settings.animation_outtime = parseInt(form.settings.animation_outtime);
359
360 if (form.settings.animation === 'no') {
361 form.settings.animation_intime = 0;
362 form.settings.animation_outtime = 0;
363 }
364
365 form.updateGroups();
366 form.updateEventListeners();
367 form.displayFields(); // bring form in initial state if the reset event is fired on it.
368 // (CF7 triggers the 'reset' event by default on each successfully submitted form)
369
370 form.$form.on('reset.wpcf7cf', form, function (e) {
371 var form = e.data;
372 setTimeout(function () {
373 form.displayFields();
374 form.resetRepeaters();
375
376 if (form.multistep != null) {
377 form.multistep.moveToStep(1, false);
378 }
379
380 setTimeout(function () {
381 if (form.$form.hasClass('sent')) {
382 jQuery('.wpcf7-response-output', form.$form)[0].scrollIntoView({
383 behavior: "smooth",
384 block: "nearest",
385 inline: "nearest"
386 });
387 }
388 }, 400);
389 }, 200);
390 }); // PRO ONLY
391
392 form.get('.wpcf7cf_repeater:not(.wpcf7cf_repeater .wpcf7cf_repeater)').each(function () {
393 form.repeaters.push(new Wpcf7cfRepeater(jQuery(this), form));
394 });
395 form.$input_repeaters.val(JSON.stringify(form.repeaters.map(function (item) {
396 return item.params.$repeater.id;
397 })));
398 var $multistep = form.get('.wpcf7cf_multistep');
399
400 if ($multistep.length) {
401 form.multistep = new Wpcf7cfMultistep($multistep, form); // window.wpcf7cf.updateMultistepState(form.multistep);
402 } // END PRO ONLY
403
404 };
405 /**
406 * reset initial number of subs for each repeater.
407 * (does not clear values)
408 */
409
410
411 Wpcf7cfForm.prototype.resetRepeaters = function () {
412 var form = this;
413 form.repeaters.forEach(function (repeater) {
414 repeater.updateSubs(repeater.params.$repeater.initial_subs);
415 });
416 };
417
418 Wpcf7cfForm.prototype.displayFields = function () {
419 var form = this;
420 var wpcf7cf_conditions = this.conditions;
421 var wpcf7cf_settings = this.settings; //for compatibility with contact-form-7-signature-addon
422
423 if (cf7signature_resized === 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0) {
424 for (var i = 0; i < signatures.length; i++) {
425 if (signatures[i].canvas.width === 0) {
426 var $sig_canvas = jQuery(".wpcf7-form-control-signature-body>canvas");
427 var $sig_wrap = jQuery(".wpcf7-form-control-signature-wrap");
428 $sig_canvas.eq(i).attr('width', $sig_wrap.width());
429 $sig_canvas.eq(i).attr('height', $sig_wrap.height());
430 cf7signature_resized = 1;
431 }
432 }
433 }
434
435 form.$groups.addClass('wpcf7cf-hidden');
436 wpcf7cf_reload_dom(form.$form);
437
438 for (var i = 0; i < wpcf7cf_conditions.length; i++) {
439 var condition = wpcf7cf_conditions[i];
440 var show_group = window.wpcf7cf.should_group_be_shown(condition, form);
441
442 if (show_group) {
443 form.get('[data-id="' + condition.then_field + '"]').removeClass('wpcf7cf-hidden');
444 }
445 }
446
447 var animation_intime = wpcf7cf_settings.animation_intime;
448 var animation_outtime = wpcf7cf_settings.animation_outtime;
449 form.$groups.each(function (index) {
450 var $group = jQuery(this);
451
452 if ($group.is(':animated')) {
453 $group.finish(); // stop any current animations on the group
454 }
455
456 if ($group.css('display') === 'none' && !$group.hasClass('wpcf7cf-hidden')) {
457 if ($group.prop('tagName') === 'SPAN') {
458 $group.show().trigger('wpcf7cf_show_group'); // show instantly
459 } else {
460 $group.animate(wpcf7cf_show_animation, animation_intime).trigger('wpcf7cf_show_group'); // show with animation
461 }
462
463 if ($group.attr('data-disable_on_hide') !== undefined) {
464 $group.find(':input').prop('disabled', false).trigger('changedisabledprop.wpcf7cf');
465 $group.find('.wpcf7-form-control-wrap').removeClass('wpcf7cf-disabled');
466 }
467 } else if ($group.css('display') !== 'none' && $group.hasClass('wpcf7cf-hidden')) {
468 if ($group.attr('data-clear_on_hide') !== undefined) {
469 var $inputs = jQuery(':input', $group).not(':button, :submit, :reset, :hidden');
470 $inputs.each(function () {
471 var $this = jQuery(this);
472 $this.val(this.defaultValue);
473 $this.prop('checked', this.defaultChecked);
474 });
475 jQuery('option', $group).each(function () {
476 this.selected = this.defaultSelected;
477 });
478 jQuery('select', $group).each(function () {
479 var $select = jQuery(this);
480
481 if ($select.val() === null) {
482 $select.val(jQuery("option:first", $select).val());
483 }
484 });
485 $inputs.each(function () {
486 this.dispatchEvent(new Event("change", {
487 "bubbles": true
488 }));
489 });
490 }
491
492 if ($group.prop('tagName') === 'SPAN') {
493 $group.hide().trigger('wpcf7cf_hide_group');
494 } else {
495 $group.animate(wpcf7cf_hide_animation, animation_outtime).trigger('wpcf7cf_hide_group'); // hide
496 }
497 }
498 });
499 form.updateHiddenFields();
500 form.updateSummaryFields();
501 };
502
503 Wpcf7cfForm.prototype.updateSummaryFields = function () {
504 var form = this;
505 var $summary = form.get('.wpcf7cf-summary');
506 if ($summary.length == 0 || !$summary.is(':visible')) return;
507 var fd = new FormData();
508 var formdata = form.$form.serializeArray();
509 jQuery.each(formdata, function (key, input) {
510 fd.append(input.name, input.value);
511 }); // Make sure to add file fields to FormData
512
513 jQuery.each(form.$form.find('input[type="file"]'), function (index, el) {
514 if (!el.files.length) return true; // continue
515
516 var fieldName = el.name;
517 fd.append(fieldName, new Blob(), Array.from(el.files).map(function (file) {
518 return file.name;
519 }).join(', '));
520 }); // add file fields to form-data
521
522 jQuery.ajax({
523 url: wpcf7cf_global_settings.ajaxurl + '?action=wpcf7cf_get_summary',
524 type: 'POST',
525 data: fd,
526 processData: false,
527 contentType: false,
528 dataType: 'json',
529 success: function success(json) {
530 $summary.html(json.summaryHtml);
531 }
532 });
533 };
534
535 Wpcf7cfForm.prototype.updateHiddenFields = function () {
536 var form = this;
537 var hidden_fields = [];
538 var hidden_groups = [];
539 var visible_groups = [];
540 var disabled_fields = [];
541 form.$groups.each(function () {
542 var $group = jQuery(this);
543
544 if ($group.hasClass('wpcf7cf-hidden')) {
545 hidden_groups.push($group.attr('data-id'));
546
547 if ($group.attr('data-disable_on_hide') !== undefined) {
548 // fields inside hidden disable_on_hide group
549 $group.find('input,select,textarea').each(function () {
550 var $this = jQuery(this);
551
552 if (!$this.prop('disabled')) {
553 $this.prop('disabled', true).trigger('changedisabledprop.wpcf7cf');
554 } // if there's no other field with the same name visible in the form
555 // then push this field to hidden_fields
556
557
558 if (form.$form.find("[data-class=\"wpcf7cf_group\"]:not(.wpcf7cf-hidden) [name='".concat($this.attr('name'), "']")).length === 0) {
559 hidden_fields.push($this.attr('name'));
560 }
561 });
562 $group.find('.wpcf7-form-control-wrap').addClass('wpcf7cf-disabled');
563 } else {
564 // fields inside regular hidden group are all pushed to hidden_fields
565 $group.find('input,select,textarea').each(function () {
566 hidden_fields.push(jQuery(this).attr('name'));
567 });
568 }
569 } else {
570 visible_groups.push($group.attr('data-id'));
571 }
572 });
573 form.hidden_fields = hidden_fields;
574 form.hidden_groups = hidden_groups;
575 form.visible_groups = visible_groups;
576 form.$input_hidden_group_fields.val(JSON.stringify(hidden_fields));
577 form.$input_hidden_groups.val(JSON.stringify(hidden_groups));
578 form.$input_visible_groups.val(JSON.stringify(visible_groups));
579 return true;
580 };
581
582 Wpcf7cfForm.prototype.updateGroups = function () {
583 var form = this;
584 form.$groups = form.$form.find('[data-class="wpcf7cf_group"]');
585 form.$groups.height('auto');
586 form.conditions = window.wpcf7cf.get_nested_conditions(form.initial_conditions, form.$form);
587 };
588
589 Wpcf7cfForm.prototype.updateEventListeners = function () {
590 var form = this; // monitor input changes, and call displayFields() if something has changed
591
592 form.get('input, select, textarea, button').not('.wpcf7cf_add, .wpcf7cf_remove').off(wpcf7cf_change_events).on(wpcf7cf_change_events, form, function (e) {
593 var form = e.data;
594 clearTimeout(wpcf7cf_timeout);
595 wpcf7cf_timeout = setTimeout(function () {
596 form.displayFields();
597 }, wpcf7cf_change_time_ms);
598 }); // PRO ONLY
599
600 form.get('.wpcf7cf-togglebutton').off('click.toggle_wpcf7cf').on('click.toggle_wpcf7cf', function () {
601 var $this = jQuery(this);
602
603 if ($this.text() === $this.attr('data-val-1')) {
604 $this.text($this.attr('data-val-2'));
605 $this.val($this.attr('data-val-2'));
606 } else {
607 $this.text($this.attr('data-val-1'));
608 $this.val($this.attr('data-val-1'));
609 }
610 }); // END PRO ONLY
611 }; // PRO ONLY
612
613
614 function Wpcf7cfRepeater($repeater, form) {
615 var $ = jQuery;
616 var repeater = this;
617 var wpcf7cf_settings = form.settings;
618 repeater.form = form;
619 $repeater.parentRepeaters = Array.from($repeater.parents('.wpcf7cf_repeater').map(function () {
620 return this.getAttribute('data-id');
621 })).reverse();
622 $repeater.num_subs = 0;
623 $repeater.id = $repeater.attr('data-id');
624 $repeater.orig_id = $repeater.attr('data-orig_data_id');
625 $repeater.min = typeof $repeater.attr('data-min') !== 'undefined' ? parseInt($repeater.attr('data-min')) : 1;
626 $repeater.max = typeof $repeater.attr('data-max') !== 'undefined' ? parseInt($repeater.attr('data-max')) : 200;
627 $repeater.initial_subs = typeof $repeater.attr('data-initial') !== 'undefined' ? parseInt($repeater.attr('data-initial')) : $repeater.min;
628 if ($repeater.initial_subs > $repeater.max) $repeater.initial_subs = $repeater.max;
629 var $repeater_sub = $repeater.children('.wpcf7cf_repeater_sub').eq(0);
630 var $repeater_controls = $repeater.children('.wpcf7cf_repeater_controls').eq(0);
631 var $repeater_sub_clone = $repeater_sub.clone();
632 $repeater_sub_clone.find('.wpcf7cf_repeater_sub').addBack('.wpcf7cf_repeater_sub').each(function () {
633 var $this = jQuery(this);
634 var prev_suffix = $this.attr('data-repeater_sub_suffix');
635 var new_suffix = prev_suffix + '__{{repeater_sub_suffix}}';
636 $this.attr('data-repeater_sub_suffix', new_suffix);
637 });
638 $repeater_sub_clone.find('[name]').each(function () {
639 var $this = jQuery(this);
640 var prev_name = $this.attr('name');
641 var new_name = repeater.getNewName(prev_name);
642 var orig_name = $this.attr('data-orig_name') != null ? $this.attr('data-orig_name') : prev_name;
643 $this.attr('name', new_name);
644 $this.attr('data-orig_name', orig_name);
645 $this.closest('.wpcf7-form-control-wrap').addClass(new_name.replace('[]', ''));
646 });
647 $repeater_sub_clone.find('.wpcf7cf_repeater,[data-class="wpcf7cf_group"]').each(function () {
648 var $this = jQuery(this);
649 var prev_data_id = $this.attr('data-id');
650 var orig_data_id = $this.attr('data-orig_data_id') != null ? $this.attr('data-orig_data_id') : prev_data_id;
651 var new_data_id = repeater.getNewName(prev_data_id);
652
653 if (prev_data_id.endsWith('_count')) {
654 new_data_id = prev_data_id.replace('_count', '__{{repeater_sub_suffix}}_count');
655 }
656
657 $this.attr('data-id', new_data_id);
658 $this.attr('data-orig_data_id', orig_data_id);
659 });
660 $repeater_sub_clone.find('[id]').each(function () {
661 var $this = jQuery(this);
662 var prev_id = $this.attr('id');
663 var orig_id = $this.attr('data-orig_id') != null ? $this.attr('data-orig_id') : prev_id;
664 var new_id = repeater.getNewName(prev_id);
665 $this.attr('id', new_id);
666 $this.attr('data-orig_id', orig_id);
667 });
668 $repeater_sub_clone.find('[for]').each(function () {
669 var $this = jQuery(this);
670 var prev_for = $this.attr('for');
671 var orig_for = $this.attr('data-orig_for') != null ? $this.attr('data-orig_for') : prev_for;
672 var new_for = repeater.getNewName(prev_for);
673 $this.attr('for', new_for);
674 $this.attr('data-orig_for', orig_for);
675 });
676 var repeater_sub_html = $repeater_sub_clone[0].outerHTML;
677 var $repeater_count_field = $repeater.find('[name=' + $repeater.id + '_count]').eq(0);
678 var $button_add = $repeater_controls.find('.wpcf7cf_add').eq(0);
679 var $button_remove = $repeater_controls.find('.wpcf7cf_remove').eq(0);
680 var params = {
681 $repeater: $repeater,
682 $repeater_count_field: $repeater_count_field,
683 repeater_sub_html: repeater_sub_html,
684 $repeater_controls: $repeater_controls,
685 $button_add: $button_add,
686 $button_remove: $button_remove,
687 wpcf7cf_settings: wpcf7cf_settings
688 };
689 this.params = params;
690 $button_add.on('click', null, repeater, function (e) {
691 var repeater = e.data;
692 repeater.updateSubs(params.$repeater.num_subs + 1);
693 });
694 $button_remove.on('click', null, repeater, function (e) {
695 var repeater = e.data;
696 repeater.updateSubs(params.$repeater.num_subs - 1);
697 });
698 jQuery('> .wpcf7cf_repeater_sub', params.$repeater).eq(0).remove(); // remove the first sub, it's just a template.
699
700 repeater.updateSubs($repeater.initial_subs);
701 repeater.updateButtons();
702 }
703
704 Wpcf7cfRepeater.prototype.getNewName = function (previousName) {
705 var prev_parts = previousName.split('[');
706 previousName = prev_parts[0];
707 var prev_suff = prev_parts.length > 1 ? '[' + prev_parts.splice(1).join('[') : '';
708 var newName = previousName + '__{{repeater_sub_suffix}}' + prev_suff;
709
710 if (previousName.endsWith('_count')) {
711 newName = previousName.replace('_count', '__{{repeater_sub_suffix}}_count');
712 }
713
714 return newName;
715 };
716
717 Wpcf7cfRepeater.prototype.updateButtons = function () {
718 var repeater = this;
719 var params = repeater.params;
720 var num_subs = params.$repeater.num_subs;
721 var showButtonRemove = false;
722 var showButtonAdd = false;
723
724 if (params.$repeater.num_subs < params.$repeater.max) {
725 showButtonAdd = true;
726 }
727
728 if (params.$repeater.num_subs > params.$repeater.min) {
729 showButtonRemove = true;
730 }
731
732 if (showButtonAdd) {
733 params.$button_add.show();
734 } else {
735 params.$button_add.hide();
736 }
737
738 if (showButtonRemove) {
739 params.$button_remove.show();
740 } else {
741 params.$button_remove.hide();
742 }
743
744 params.$repeater_count_field.val(num_subs);
745 };
746
747 Wpcf7cfRepeater.prototype.updateSubs = function (subs_to_show) {
748 var repeater = this;
749 var params = repeater.params; // make sure subs_to_show is a valid number
750
751 subs_to_show = subs_to_show < params.$repeater.min ? params.$repeater.min : subs_to_show;
752 subs_to_show = subs_to_show > params.$repeater.max ? params.$repeater.max : subs_to_show;
753 var subs_to_add = subs_to_show - params.$repeater.num_subs;
754
755 if (subs_to_add < 0) {
756 repeater.removeSubs(-subs_to_add);
757 } else if (subs_to_add > 0) {
758 repeater.addSubs(subs_to_add);
759 }
760 };
761 /**
762 * add Subs to repeater
763 * @param {Number} subs_to_add
764 * @param {Number} index - zero-based. leave blank (or null) to append at the end
765 */
766
767
768 Wpcf7cfRepeater.prototype.addSubs = function (subs_to_add) {
769 var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
770 var $ = jQuery;
771 var params = this.params;
772 var repeater = this;
773 var form = repeater.form;
774 var $repeater = params.$repeater;
775 var $repeater_controls = params.$repeater_controls;
776
777 if (subs_to_add + $repeater.num_subs > $repeater.max) {
778 subs_to_add = $repeater.max - $repeater.num_subs;
779 }
780
781 var html_str = '';
782
783 for (var i = 1; i <= subs_to_add; i++) {
784 var sub_suffix = $repeater.num_subs + i;
785 html_str += params.repeater_sub_html.replace(/\{\{repeater_sub_suffix\}\}/g, sub_suffix).replace(new RegExp('\{\{' + $repeater.orig_id + '_index\}\}', 'g'), '<span class="wpcf7cf-index wpcf7cf__' + $repeater.orig_id + '">' + sub_suffix + '</span>');
786 }
787
788 var $html = jQuery(html_str);
789 jQuery('> .wpcf7cf_repeater_sub', $repeater).finish(); // finish any currently running animations immediately.
790 // Add the newly created fields to the form
791
792 if (index === null) {
793 $html.hide().insertBefore($repeater_controls).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime).trigger('wpcf7cf_repeater_added');
794 } else {
795 $html.hide().insertBefore(jQuery('> .wpcf7cf_repeater_sub', $repeater).eq(index)).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime).trigger('wpcf7cf_repeater_added');
796 } // enable all new fields
797
798
799 $html.find('.wpcf7cf-disabled :input').prop('disabled', false).trigger('changedisabledprop.wpcf7cf');
800 $html.find('.wpcf7-form-control-wrap').removeClass('wpcf7cf-disabled');
801 jQuery('.wpcf7cf_repeater', $html).each(function () {
802 form.repeaters.push(new Wpcf7cfRepeater(jQuery(this), form));
803 });
804 form.$input_repeaters.val(JSON.stringify(form.repeaters.map(function (item) {
805 return item.params.$repeater.id;
806 })));
807 $repeater.num_subs += subs_to_add;
808
809 if (index !== null) {
810 repeater.updateSuffixes();
811 }
812
813 window.wpcf7cf.updateMultistepState(form.multistep);
814 form.updateGroups();
815 form.updateEventListeners();
816 form.displayFields();
817 repeater.updateButtons(); // Exclusive Checkbox
818
819 $html.on('click', '.wpcf7-exclusive-checkbox input:checkbox', function () {
820 var name = $(this).attr('name');
821 $html.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
822 }); //basic compatibility with material-design-for-contact-form-7
823
824 if (typeof window.cf7mdInit === "function") {
825 window.cf7mdInit();
826 }
827
828 return false;
829 };
830 /** TODO: implement this */
831
832
833 Wpcf7cfRepeater.prototype.updateSuffixes = function () {
834 // Loop trough all subs
835 // -- 1. update all fields, groups and repeaters names, id's, for's, ...
836 // -- 2. loop trough all repeaters
837 // -- update sub_html template for nested repeater
838 // -- call updateSuffixes() for nested repeater
839 var $repeater = this.params.$repeater;
840 var num_subs = this.params.$repeater.num_subs;
841 var form = this.form;
842 var orig_id = $repeater.attr('data-orig_data_id');
843 var repeater_id = $repeater.attr('data-id');
844 var repeater_suffix = repeater_id.replace(orig_id, '');
845 var simplifiedDomArray = Object.values(wpcf7cf.get_simplified_dom_model(form.$form[0]));
846
847 var _loop = function _loop(i) {
848 var $sub = jQuery('> .wpcf7cf_repeater_sub', $repeater).eq(i);
849 var newIndex = i + 1;
850 var currentSuffix = $sub.attr('data-repeater_sub_suffix');
851 var newSuffix = repeater_suffix + '__' + newIndex;
852 $sub.attr('data-repeater_sub_suffix', newSuffix); // update sub attr
853
854 $sub.find('.wpcf7cf__' + orig_id).html(newIndex); // update {{r_index}} parts
855
856 simplifiedDomArray.forEach(function (el) {
857 if (el.suffix !== currentSuffix) return; // TODO: may need an extra check to verify that the element is inside the current repeater
858 // (orig_id) . Otherwise problems may occur if there are repeaters on the same level.
859
860 var newName = el.name.replace(currentSuffix, newSuffix);
861 var pureElName = el.name.replace('[]', '');
862 var pureNewName = newName.replace('[]', '');
863 jQuery('[name="' + el.name + '"]', $sub).attr('name', newName);
864 jQuery('[id="' + el.name + '"]', $sub).attr('id', newName);
865 jQuery('label[for="' + el.name + '"]', $sub).attr('for', newName);
866 var $nested_repeater = jQuery('[data-id="' + el.name + '"]', $sub);
867 $nested_repeater.attr('data-id', newName);
868 jQuery('.wpcf7-form-control-wrap.' + pureElName, $sub).removeClass(pureElName).addClass(pureNewName);
869
870 if (el.type === 'repeater') {
871 var nested_repeater = form.repeaters.find(function (repeater) {
872 return repeater.params.$repeater.get(0) === $nested_repeater.get(0);
873 });
874 if (!nested_repeater) return;
875 nested_repeater.params.repeater_sub_html = wpcf7cf.updateRepeaterSubHTML(nested_repeater.params.repeater_sub_html, currentSuffix, newSuffix, nested_repeater.params.$repeater.parentRepeaters);
876 nested_repeater.updateSuffixes();
877 }
878 });
879 };
880
881 for (var i = 0; i < num_subs; i++) {
882 _loop(i);
883 }
884 };
885 /**
886 * Return the parent repeaters, order is not guaranteed.
887 */
888
889
890 Wpcf7cfRepeater.prototype.getParentRepeaters = function () {
891 var simplifiedDomArray = Object.values(wpcf7cf.get_simplified_dom_model(form.$form[0]));
892 form.repeaters.map(function (repeater) {});
893 };
894
895 Wpcf7cfRepeater.prototype.removeSubs = function (subs_to_remove) {
896 var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
897 var $ = jQuery;
898 var repeater = this;
899 var params = repeater.params;
900 var form = repeater.form;
901 var $repeater = params.$repeater;
902
903 if ($repeater.num_subs - subs_to_remove < $repeater.min) {
904 subs_to_remove = $repeater.num_subs - $repeater.min;
905 }
906
907 if (index === null) {
908 index = $repeater.num_subs - subs_to_remove;
909 }
910
911 $repeater.num_subs -= subs_to_remove;
912 jQuery('> .wpcf7cf_repeater_sub', $repeater).finish(); // finish any currently running animations immediately.
913
914 jQuery('> .wpcf7cf_repeater_sub', $repeater).slice(index, index + subs_to_remove).animate(wpcf7cf_hide_animation, {
915 duration: params.wpcf7cf_settings.animation_intime,
916 done: function done() {
917 var $this = jQuery(this); //remove the actual fields from the form
918
919 $this.remove();
920 params.$repeater.trigger('wpcf7cf_repeater_removed');
921 window.wpcf7cf.updateMultistepState(form.multistep);
922 form.updateGroups();
923 form.updateEventListeners();
924 form.displayFields();
925 repeater.updateButtons();
926
927 if (index !== null) {
928 repeater.updateSuffixes();
929 }
930 }
931 });
932 return false;
933 };
934
935 function Wpcf7cfMultistep($multistep, form) {
936 var multistep = this;
937 multistep.$multistep = $multistep;
938 multistep.form = form;
939 multistep.$steps = $multistep.find('.wpcf7cf_step');
940 multistep.$btn_next = $multistep.find('.wpcf7cf_next');
941 multistep.$btn_prev = $multistep.find('.wpcf7cf_prev');
942 multistep.$dots = $multistep.find('.wpcf7cf_steps-dots');
943 multistep.currentStep = 0;
944 multistep.numSteps = multistep.$steps.length;
945 multistep.$dots.html('');
946
947 for (var i = 1; i <= multistep.numSteps; i++) {
948 multistep.$dots.append("\n <div class=\"dot\" data-step=\"".concat(i, "\">\n <div class=\"step-index\">").concat(i, "</div>\n <div class=\"step-title\">").concat(multistep.$steps.eq(i - 1).attr('data-title'), "</div>\n </div>\n "));
949 }
950
951 multistep.$btn_next.on('click.wpcf7cf_step', /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee() {
952 var result;
953 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee$(_context) {
954 while (1) {
955 switch (_context.prev = _context.next) {
956 case 0:
957 multistep.$btn_next.addClass('disabled').attr('disabled', true);
958 _context.next = 3;
959 return multistep.validateStep(multistep.currentStep);
960
961 case 3:
962 result = _context.sent;
963
964 if (result === 'success') {
965 multistep.moveToStep(multistep.currentStep + 1);
966 }
967
968 case 5:
969 case "end":
970 return _context.stop();
971 }
972 }
973 }, _callee);
974 }))); // If form is submitted (by pressing Enter for example), and if we are not on the last step,
975 // then trigger click event on the $btn_next button instead.
976
977 multistep.form.$form.on('submit.wpcf7cf_step', function (e) {
978 if (multistep.currentStep !== multistep.numSteps) {
979 multistep.$btn_next.trigger('click.wpcf7cf_step');
980 e.stopImmediatePropagation();
981 return false;
982 }
983 });
984 multistep.$btn_prev.on('click', function () {
985 multistep.moveToStep(multistep.currentStep - 1);
986 });
987 multistep.moveToStep(1);
988 }
989
990 Wpcf7cfMultistep.prototype.validateStep = function (step_index) {
991 var multistep = this;
992 var $multistep = multistep.$multistep;
993 var $form = multistep.form.$form;
994 var form = multistep.form;
995 $form.find('.wpcf7-response-output').addClass('wpcf7-display-none');
996 return new Promise(function (resolve) {
997 var fd = new FormData(); // Make sure to add file fields to FormData
998
999 jQuery.each($form.find('[data-id="step-' + step_index + '"] input[type="file"]'), function (index, el) {
1000 if (!el.files.length) return true; // = continue
1001
1002 var file = el.files[0];
1003 var fieldName = el.name;
1004 fd.append(fieldName, file);
1005 });
1006 var formdata = $form.serializeArray();
1007 jQuery.each(formdata, function (key, input) {
1008 fd.append(input.name, input.value);
1009 });
1010 jQuery.ajax({
1011 url: wpcf7cf_global_settings.ajaxurl + '?action=wpcf7cf_validate_step',
1012 type: 'POST',
1013 data: fd,
1014 processData: false,
1015 contentType: false,
1016 dataType: 'json'
1017 }).done(function (json) {
1018 $multistep.find('.wpcf7-form-control-wrap .wpcf7-not-valid-tip').remove();
1019 $multistep.find('.wpcf7-not-valid').removeClass('wpcf7-not-valid');
1020 $multistep.find('.wpcf7-response-output').remove();
1021 $multistep.find('.wpcf7-response-output.wpcf7-validation-errors').removeClass('wpcf7-validation-errors');
1022 multistep.$btn_next.removeClass('disabled').attr('disabled', false);
1023
1024 if (!json.success) {
1025 var checkError = 0;
1026 jQuery.each(json.invalid_fields, function (index, el) {
1027 if ($multistep.find('input[name="' + index + '"]').length || $multistep.find('input[name="' + index + '[]"]').length || $multistep.find('select[name="' + index + '"]').length || $multistep.find('select[name="' + index + '[]"]').length || $multistep.find('textarea[name="' + index + '"]').length || $multistep.find('textarea[name="' + index + '[]"]').length) {
1028 checkError = checkError + 1;
1029 var controlWrap = form.get('.wpcf7-form-control-wrap.' + index);
1030 controlWrap.find('.wpcf7-form-control').addClass('wpcf7-not-valid');
1031 controlWrap.find('span.wpcf7-not-valid-tip').remove();
1032 controlWrap.append('<span role="alert" class="wpcf7-not-valid-tip">' + el.reason + '</span>');
1033 }
1034 });
1035 resolve('failed');
1036 $multistep.parent().find('.wpcf7-response-output').removeClass('wpcf7-display-none').html(json.message);
1037 wpcf7.setStatus($form, 'invalid');
1038 multistep.$steps.trigger('wpcf7cf_step_invalid'); // wpcf7.triggerEvent( data.into, 'invalid', detail );
1039 } else if (json.success) {
1040 wpcf7.setStatus($form, 'init');
1041 resolve('success');
1042 return false;
1043 }
1044 }).fail(function () {
1045 resolve('error');
1046 }).always(function () {// do nothing
1047 });
1048 });
1049 };
1050
1051 Wpcf7cfMultistep.prototype.moveToStep = function (step_index) {
1052 var scrollToTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1053 var multistep = this;
1054 var previousStep = multistep.currentStep;
1055 multistep.currentStep = step_index > multistep.numSteps ? multistep.numSteps : step_index < 1 ? 1 : step_index; // ANIMATION DISABLED FOR NOW cause it's ugly
1056 // multistep.$steps.animate(wpcf7cf_hide_step_animation, multistep.form.settings.animation_outtime);
1057 // multistep.$steps.eq(multistep.currentStep-1).animate(wpcf7cf_show_step_animation, multistep.form.settings.animation_intime);
1058
1059 multistep.$multistep.attr('data-current_step', multistep.currentStep);
1060 multistep.$steps.hide();
1061 multistep.$steps.eq(multistep.currentStep - 1).show().trigger('wpcf7cf_change_step', [previousStep, multistep.currentStep]);
1062
1063 if (scrollToTop) {
1064 var formEl = multistep.form.$form[0];
1065 var topOffset = formEl.getBoundingClientRect().top;
1066
1067 if (topOffset < 0 && previousStep > 0) {
1068 formEl.scrollIntoView({
1069 behavior: "smooth"
1070 });
1071 }
1072 }
1073
1074 multistep.form.updateSummaryFields();
1075 window.wpcf7cf.updateMultistepState(multistep);
1076 };
1077
1078 Wpcf7cfMultistep.prototype.getFieldsInStep = function (step_index) {
1079 wpcf7cf_reload_dom(this.form.$form);
1080 var inStep = false;
1081 return Object.values(wpcf7cf_dom).filter(function (item, i) {
1082 if (item.type == 'step') {
1083 inStep = item.val == step_index + '';
1084 }
1085
1086 return inStep && item.type == 'input';
1087 }).map(function (item) {
1088 return item.name;
1089 });
1090 }; // END PRO ONLY
1091
1092 /**
1093 * @global
1094 * @namespace wpcf7cf
1095 */
1096
1097
1098 window.wpcf7cf = {
1099 hideGroup: function hideGroup($group, animate) {},
1100 showGroup: function showGroup($group, animate) {},
1101 updateRepeaterSubHTML: function updateRepeaterSubHTML(html, oldSuffix, newSuffix, parentRepeaters) {
1102 var oldIndexes = oldSuffix.split('__');
1103 oldIndexes.shift(); // remove first empty element
1104
1105 var newIndexes = newSuffix.split('__');
1106 newIndexes.shift(); // remove first empty element
1107
1108 var returnHtml = html;
1109
1110 if (oldIndexes && newIndexes && oldIndexes.length === parentRepeaters.length && newIndexes.length === parentRepeaters.length) {
1111 var parentRepeatersInfo = parentRepeaters.map(function (repeaterId, i) {
1112 return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()({}, repeaterId.split('__')[0], [oldIndexes[i], newIndexes[i]]);
1113 });
1114 var length = parentRepeatersInfo.length;
1115 var replacements = oldIndexes.map(function (oldIndex, i) {
1116 return ['__' + oldIndexes.slice(0, length - i).join('__'), '__' + newIndexes.slice(0, length - i).join('__')];
1117 });
1118
1119 for (var i = 0; i < length; i++) {
1120 var id = Object.keys(parentRepeatersInfo[i])[0];
1121 var find = parentRepeatersInfo[i][id][0];
1122 var repl = parentRepeatersInfo[i][id][1];
1123 replacements.push(["<span class=\"wpcf7cf-index wpcf7cf__".concat(id, "\">").concat(find, "<\\/span>"), "<span class=\"wpcf7cf-index wpcf7cf__".concat(id, "\">").concat(repl, "</span>")]);
1124 }
1125
1126 replacements.forEach(function (_ref3) {
1127 var _ref4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_ref3, 2),
1128 oldSuffix = _ref4[0],
1129 newSuffix = _ref4[1];
1130
1131 returnHtml = returnHtml.replace(new RegExp(oldSuffix, 'g'), newSuffix);
1132 });
1133 }
1134
1135 return returnHtml;
1136 },
1137 // keep this for backwards compatibility
1138 initForm: function initForm($forms) {
1139 $forms.each(function () {
1140 var $form = jQuery(this); // only add form is its class is "wpcf7-form" and if the form was not previously added
1141
1142 if ($form.hasClass('wpcf7-form') && !wpcf7cf_forms.some(function (form) {
1143 return form.$form.get(0) === $form.get(0);
1144 })) {
1145 wpcf7cf_forms.push(new Wpcf7cfForm($form));
1146 }
1147 });
1148 },
1149 getWpcf7cfForm: function getWpcf7cfForm($form) {
1150 var matched_forms = wpcf7cf_forms.filter(function (form) {
1151 var f1 = form.$form.get(0);
1152 var f2 = $form.get(0);
1153 return form.$form.get(0) === $form.get(0);
1154 });
1155
1156 if (matched_forms.length) {
1157 return matched_forms[0];
1158 }
1159
1160 return false;
1161 },
1162 get_nested_conditions: function get_nested_conditions(conditions, $current_form) {
1163 //loop trough conditions. Then loop trough the dom, and each repeater we pass we should update all sub_values we encounter with __index
1164 wpcf7cf_reload_dom($current_form);
1165 var groups = Object.values(wpcf7cf_dom).filter(function (item, i) {
1166 return item.type === 'group';
1167 });
1168 var sub_conditions = [];
1169
1170 for (var i = 0; i < groups.length; i++) {
1171 var g = groups[i];
1172 var relevant_conditions = conditions.filter(function (condition, i) {
1173 return condition.then_field === g.original_name;
1174 });
1175 var relevant_conditions = relevant_conditions.map(function (item, i) {
1176 return {
1177 then_field: g.name,
1178 and_rules: item.and_rules.map(function (and_rule, i) {
1179 return {
1180 if_field: and_rule.if_field + g.suffix,
1181 if_value: and_rule.if_value,
1182 operator: and_rule.operator
1183 };
1184 })
1185 };
1186 });
1187 sub_conditions = sub_conditions.concat(relevant_conditions);
1188 }
1189
1190 return sub_conditions;
1191 },
1192 get_simplified_dom_model: function get_simplified_dom_model(currentNode) {
1193 var simplified_dom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1194 var parentGroups = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1195 var parentRepeaters = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
1196 var type = currentNode.classList && currentNode.classList.contains('wpcf7cf_repeater') ? 'repeater' : currentNode.dataset["class"] == 'wpcf7cf_group' ? 'group' : currentNode.className == 'wpcf7cf_step' ? 'step' : currentNode.hasAttribute('name') && !currentNode.disabled ? 'input' : false;
1197
1198 var newParentRepeaters = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(parentRepeaters);
1199
1200 var newParentGroups = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(parentGroups);
1201
1202 if (type) {
1203 var name = type === 'input' ? currentNode.getAttribute('name') : currentNode.dataset.id;
1204
1205 if (type === 'repeater') {
1206 newParentRepeaters.push(name);
1207 }
1208
1209 if (type === 'group') {
1210 newParentGroups.push(name);
1211 } // skip _wpcf7 hidden fields
1212
1213
1214 if (name.substring(0, 6) === '_wpcf7') return {};
1215 var original_name = type === 'repeater' || type === 'group' ? currentNode.dataset.orig_data_id : type === 'input' ? currentNode.getAttribute('data-orig_name') || name : name;
1216 var nameWithoutBrackets = name.replace('[]', '');
1217 var originalNameWithoutBrackets = original_name.replace('[]', '');
1218 var val = type === 'step' ? [currentNode.dataset.id.substring(5)] : [];
1219 var parentGroup = 'parent-group';
1220 var suffix = nameWithoutBrackets.replace(originalNameWithoutBrackets, '');
1221
1222 if (!simplified_dom[name]) {
1223 // init entry
1224 simplified_dom[name] = {
1225 name: name,
1226 type: type,
1227 original_name: original_name,
1228 suffix: suffix,
1229 val: val,
1230 parentGroups: parentGroups,
1231 parentRepeaters: parentRepeaters
1232 };
1233 }
1234
1235 if (type === 'input') {
1236 // skip unchecked checkboxes and radiobuttons
1237 if ((currentNode.type === 'checkbox' || currentNode.type === 'radio') && !currentNode.checked) return {}; // if multiselect, make sure to add all the values
1238
1239 if (currentNode.multiple && currentNode.options) {
1240 simplified_dom[name].val = Object.values(currentNode.options).filter(function (o) {
1241 return o.selected;
1242 }).map(function (o) {
1243 return o.value;
1244 });
1245 } else {
1246 simplified_dom[name].val.push(currentNode.value);
1247 }
1248 }
1249 }
1250
1251 Array.from(currentNode.children).forEach(function (childNode) {
1252 var dom = wpcf7cf.get_simplified_dom_model(childNode, simplified_dom, newParentGroups, newParentRepeaters);
1253 simplified_dom = _objectSpread(_objectSpread({}, dom), simplified_dom);
1254 });
1255 return simplified_dom;
1256 },
1257 updateMultistepState: function updateMultistepState(multistep) {
1258 if (multistep == null) return; // update hidden input field
1259
1260 var stepsData = {
1261 currentStep: multistep.currentStep,
1262 numSteps: multistep.numSteps,
1263 fieldsInCurrentStep: multistep.getFieldsInStep(multistep.currentStep)
1264 };
1265 multistep.form.$input_steps.val(JSON.stringify(stepsData)); // update Buttons
1266
1267 multistep.$btn_prev.removeClass('disabled').attr('disabled', false);
1268 multistep.$btn_next.removeClass('disabled').attr('disabled', false);
1269
1270 if (multistep.currentStep == multistep.numSteps) {
1271 multistep.$btn_next.addClass('disabled').attr('disabled', true);
1272 }
1273
1274 if (multistep.currentStep == 1) {
1275 multistep.$btn_prev.addClass('disabled').attr('disabled', true);
1276 } // replace next button with submit button on last step.
1277 // TODO: make this depend on a setting
1278
1279
1280 var $submit_button = multistep.form.$form.find('input[type="submit"]').eq(0);
1281 var $ajax_loader = multistep.form.$form.find('.ajax-loader').eq(0);
1282
1283 if (multistep.currentStep == multistep.numSteps) {
1284 multistep.$btn_next.hide();
1285 $ajax_loader.detach().appendTo(multistep.$btn_next.parent());
1286 $submit_button.detach().appendTo(multistep.$btn_next.parent());
1287 $submit_button.show();
1288 } else {
1289 $submit_button.hide();
1290 multistep.$btn_next.show();
1291 } // update dots
1292
1293
1294 var $dots = multistep.$dots.find('.dot');
1295 $dots.removeClass('active').removeClass('completed');
1296
1297 for (var step = 1; step <= multistep.numSteps; step++) {
1298 if (step < multistep.currentStep) {
1299 $dots.eq(step - 1).addClass('completed');
1300 } else if (step == multistep.currentStep) {
1301 $dots.eq(step - 1).addClass('active');
1302 }
1303 }
1304 },
1305 should_group_be_shown: function should_group_be_shown(condition) {
1306 var show_group = true;
1307
1308 for (var and_rule_i = 0; and_rule_i < condition.and_rules.length; and_rule_i++) {
1309 var condition_ok = false;
1310 var condition_and_rule = condition.and_rules[and_rule_i];
1311 var inputField = wpcf7cf_getFieldByName(condition_and_rule.if_field);
1312 if (!inputField) continue; // field not found
1313
1314 var if_val = condition_and_rule.if_value;
1315 var operator = condition_and_rule.operator; //backwards compat
1316
1317 operator = operator === '' ? 'less than or equals' : operator;
1318 operator = operator === '' ? 'greater than or equals' : operator;
1319 operator = operator === '>' ? 'greater than' : operator;
1320 operator = operator === '<' ? 'less than' : operator;
1321 var $field = operator === 'function' && jQuery("[name=\"".concat(inputField.name, "\"]")).eq(0);
1322 condition_ok = this.isConditionTrue(inputField.val, operator, if_val, $field);
1323 show_group = show_group && condition_ok;
1324 }
1325
1326 return show_group;
1327 },
1328 isConditionTrue: function isConditionTrue(values, operator) {
1329 var testValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
1330 var $field = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : jQuery();
1331
1332 if (!Array.isArray(values)) {
1333 values = [values];
1334 }
1335
1336 var condition_ok = false; // start by assuming that the condition is not met
1337 // Considered EMPTY: [] [''] [null] ['',null] [,,'']
1338 // Considered NOT EMPTY: [0] ['ab','c'] ['',0,null]
1339
1340 var valuesAreEmpty = values.length === 0 || values.every(function (v) {
1341 return !v && v !== 0;
1342 }); // 0 is not considered empty
1343 // special cases: [] equals '' => TRUE; [] not equals '' => FALSE
1344
1345 if (operator === 'equals' && testValue === '' && valuesAreEmpty) {
1346 return true;
1347 }
1348
1349 if (operator === 'not equals' && testValue === '' && valuesAreEmpty) {
1350 return false;
1351 }
1352
1353 if (valuesAreEmpty) {
1354 if (operator === 'is empty') {
1355 condition_ok = true;
1356 }
1357 } else {
1358 if (operator === 'not empty') {
1359 condition_ok = true;
1360 }
1361 }
1362
1363 var testValueNumber = isFinite(parseFloat(testValue)) ? parseFloat(testValue) : NaN;
1364
1365 if (operator === 'not equals' || operator === 'not equals (regex)') {
1366 // start by assuming that the condition is met
1367 condition_ok = true;
1368 }
1369
1370 if (operator === 'function' && typeof window[testValue] == 'function' && window[testValue]($field) // here we call the actual user defined function
1371 ) {
1372 condition_ok = true;
1373 }
1374
1375 var regex_patt = /.*/i; // fallback regex pattern
1376
1377 var isValidRegex = true;
1378
1379 if (operator === 'equals (regex)' || operator === 'not equals (regex)') {
1380 try {
1381 regex_patt = new RegExp(testValue, 'i');
1382 } catch (e) {
1383 isValidRegex = false;
1384 }
1385 }
1386
1387 for (var i = 0; i < values.length; i++) {
1388 var value = values[i];
1389 var valueNumber = isFinite(parseFloat(value)) ? parseFloat(value) : NaN;
1390 var valsAreNumbers = !isNaN(valueNumber) && !isNaN(testValueNumber);
1391
1392 if (operator === 'equals' && value === testValue || operator === 'equals (regex)' && regex_patt.test(value) || operator === 'greater than' && valsAreNumbers && valueNumber > testValueNumber || operator === 'less than' && valsAreNumbers && valueNumber < testValueNumber || operator === 'greater than or equals' && valsAreNumbers && valueNumber >= testValueNumber || operator === 'less than or equals' && valsAreNumbers && valueNumber <= testValueNumber) {
1393 condition_ok = true;
1394 break;
1395 } else if (operator === 'not equals' && value === testValue || operator === 'not equals (regex)' && regex_patt.test(value)) {
1396 condition_ok = false;
1397 break;
1398 }
1399 }
1400
1401 return condition_ok;
1402 },
1403 getFormObj: function getFormObj($form) {
1404 if (typeof $form === 'string') {
1405 $form = jQuery($form).eq(0);
1406 }
1407
1408 return wpcf7cf.getWpcf7cfForm($form);
1409 },
1410 getRepeaterObj: function getRepeaterObj($form, repeaterDataId) {
1411 var form = wpcf7cf.getFormObj($form);
1412 var repeater = form.repeaters.find(function (repeater) {
1413 return repeater.params.$repeater.attr('data-id') === repeaterDataId;
1414 });
1415 return repeater;
1416 },
1417 getMultiStepObj: function getMultiStepObj($form) {
1418 var form = wpcf7cf.getFormObj($form);
1419 return form.multistep;
1420 },
1421
1422 /**
1423 * Append a new sub-entry to the repeater with the name `repeaterDataId` inside the form `$form`
1424 * @memberof wpcf7cf
1425 * @function wpcf7cf.repeaterAddSub
1426 * @link
1427 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1428 * @param {String} repeaterDataId - *data-id* attribute of the repeater. Normally this is simply the name of the repeater. However, in case of a nested repeater you need to append the name with the correct suffix. For example `my-nested-repeater__1__3`. Hint (check the `data-id` attribute in the HTML code to find the correct suffix)
1429 */
1430 repeaterAddSub: function repeaterAddSub($form, repeaterDataId) {
1431 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1432 repeater.updateSubs(repeater.params.$repeater.num_subs + 1);
1433 },
1434
1435 /**
1436 * Insert a new sub-entry at the given `index` of the repeater with the name `repeaterDataId` inside the form `$form`
1437 * @memberof wpcf7cf
1438 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1439 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1440 * @param {Number} index - position where to insert the new sub-entry within the repeater
1441 */
1442 repeaterAddSubAtIndex: function repeaterAddSubAtIndex($form, repeaterDataId, index) {
1443 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1444 repeater.addSubs(1, index);
1445 },
1446
1447 /**
1448 * Remove the sub-entry at the given `index` of the repeater with the *data-id* attribute of `repeaterDataId` inside the form `$form`
1449 * @memberof wpcf7cf
1450 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1451 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1452 * @param {Number} index - position where to insert the new sub-entry within the repeater
1453 */
1454 repeaterRemoveSubAtIndex: function repeaterRemoveSubAtIndex($form, repeaterDataId, index) {
1455 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1456 repeater.removeSubs(1, index);
1457 },
1458
1459 /**
1460 * Remove the last sub-entry from the repeater with the *data-id* attribute of `repeaterDataId` inside the form `$form`
1461 * @memberof wpcf7cf
1462 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1463 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1464 * @param {Number} index - position where to insert the new sub-entry within the repeater
1465 */
1466 repeaterRemoveSub: function repeaterRemoveSub($form, repeaterDataId) {
1467 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1468 repeater.updateSubs(repeater.params.$repeater.num_subs - 1);
1469 },
1470
1471 /**
1472 * Set the number of subs for the repeater with the *data-id* attribute of `repeaterDataId` inside the form `$form`.
1473 * Subs are either appended to or removed from the end of the repeater.
1474 * @memberof wpcf7cf
1475 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1476 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1477 * @param {Number} numberOfSubs - position where to insert the new sub-entry within the repeater
1478 */
1479 repeaterSetNumberOfSubs: function repeaterSetNumberOfSubs($form, repeaterDataId, numberOfSubs) {
1480 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1481 repeater.updateSubs(numberOfSubs);
1482 },
1483
1484 /**
1485 * Move to step number `step`, ignoring any validation.
1486 * @memberof wpcf7cf
1487 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1488 * @param {*} step
1489 */
1490 multistepMoveToStep: function multistepMoveToStep($form, step) {
1491 var multistep = wpcf7cf.getMultiStepObj($form);
1492 multistep.moveToStep(step);
1493 },
1494
1495 /**
1496 * Validate the current step, and move to step number `step` if validation passes.
1497 * @memberof wpcf7cf
1498 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1499 * @param {Number} step
1500 */
1501 multistepMoveToStepWithValidation: function multistepMoveToStepWithValidation($form, step) {
1502 return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee2() {
1503 var multistep, result;
1504 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee2$(_context2) {
1505 while (1) {
1506 switch (_context2.prev = _context2.next) {
1507 case 0:
1508 multistep = wpcf7cf.getMultiStepObj($form);
1509 _context2.next = 3;
1510 return multistep.validateStep(multistep.currentStep);
1511
1512 case 3:
1513 result = _context2.sent;
1514
1515 if (result === 'success') {
1516 multistep.moveToStep(step);
1517 }
1518
1519 case 5:
1520 case "end":
1521 return _context2.stop();
1522 }
1523 }
1524 }, _callee2);
1525 }))();
1526 }
1527 };
1528 jQuery('.wpcf7-form').each(function () {
1529 wpcf7cf_forms.push(new Wpcf7cfForm(jQuery(this)));
1530 }); // Call displayFields again on all forms
1531 // Necessary in case some theme or plugin changed a form value by the time the entire page is fully loaded.
1532
1533 jQuery('document').on('ready', function () {
1534 wpcf7cf_forms.forEach(function (f) {
1535 f.displayFields();
1536 });
1537 }); // fix for exclusive checkboxes in IE (this will call the change-event again after all other checkboxes are unchecked, triggering the display_fields() function)
1538
1539 var old_wpcf7ExclusiveCheckbox = jQuery.fn.wpcf7ExclusiveCheckbox;
1540
1541 jQuery.fn.wpcf7ExclusiveCheckbox = function () {
1542 return this.find('input:checkbox').on('click', function () {
1543 var name = jQuery(this).attr('name');
1544 jQuery(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false).eq(0).change();
1545 });
1546 };
1547
1548 /***/ }),
1549
1550 /***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
1551 /*!*****************************************************************!*\
1552 !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
1553 \*****************************************************************/
1554 /*! no static exports found */
1555 /***/ (function(module, exports) {
1556
1557 function _arrayLikeToArray(arr, len) {
1558 if (len == null || len > arr.length) len = arr.length;
1559
1560 for (var i = 0, arr2 = new Array(len); i < len; i++) {
1561 arr2[i] = arr[i];
1562 }
1563
1564 return arr2;
1565 }
1566
1567 module.exports = _arrayLikeToArray;
1568
1569 /***/ }),
1570
1571 /***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
1572 /*!***************************************************************!*\
1573 !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
1574 \***************************************************************/
1575 /*! no static exports found */
1576 /***/ (function(module, exports) {
1577
1578 function _arrayWithHoles(arr) {
1579 if (Array.isArray(arr)) return arr;
1580 }
1581
1582 module.exports = _arrayWithHoles;
1583
1584 /***/ }),
1585
1586 /***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
1587 /*!******************************************************************!*\
1588 !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
1589 \******************************************************************/
1590 /*! no static exports found */
1591 /***/ (function(module, exports, __webpack_require__) {
1592
1593 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
1594
1595 function _arrayWithoutHoles(arr) {
1596 if (Array.isArray(arr)) return arrayLikeToArray(arr);
1597 }
1598
1599 module.exports = _arrayWithoutHoles;
1600
1601 /***/ }),
1602
1603 /***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
1604 /*!*****************************************************************!*\
1605 !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
1606 \*****************************************************************/
1607 /*! no static exports found */
1608 /***/ (function(module, exports) {
1609
1610 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1611 try {
1612 var info = gen[key](arg);
1613 var value = info.value;
1614 } catch (error) {
1615 reject(error);
1616 return;
1617 }
1618
1619 if (info.done) {
1620 resolve(value);
1621 } else {
1622 Promise.resolve(value).then(_next, _throw);
1623 }
1624 }
1625
1626 function _asyncToGenerator(fn) {
1627 return function () {
1628 var self = this,
1629 args = arguments;
1630 return new Promise(function (resolve, reject) {
1631 var gen = fn.apply(self, args);
1632
1633 function _next(value) {
1634 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1635 }
1636
1637 function _throw(err) {
1638 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1639 }
1640
1641 _next(undefined);
1642 });
1643 };
1644 }
1645
1646 module.exports = _asyncToGenerator;
1647
1648 /***/ }),
1649
1650 /***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
1651 /*!***************************************************************!*\
1652 !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
1653 \***************************************************************/
1654 /*! no static exports found */
1655 /***/ (function(module, exports) {
1656
1657 function _defineProperty(obj, key, value) {
1658 if (key in obj) {
1659 Object.defineProperty(obj, key, {
1660 value: value,
1661 enumerable: true,
1662 configurable: true,
1663 writable: true
1664 });
1665 } else {
1666 obj[key] = value;
1667 }
1668
1669 return obj;
1670 }
1671
1672 module.exports = _defineProperty;
1673
1674 /***/ }),
1675
1676 /***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
1677 /*!****************************************************************!*\
1678 !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
1679 \****************************************************************/
1680 /*! no static exports found */
1681 /***/ (function(module, exports) {
1682
1683 function _iterableToArray(iter) {
1684 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
1685 }
1686
1687 module.exports = _iterableToArray;
1688
1689 /***/ }),
1690
1691 /***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
1692 /*!*********************************************************************!*\
1693 !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
1694 \*********************************************************************/
1695 /*! no static exports found */
1696 /***/ (function(module, exports) {
1697
1698 function _iterableToArrayLimit(arr, i) {
1699 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
1700 var _arr = [];
1701 var _n = true;
1702 var _d = false;
1703 var _e = undefined;
1704
1705 try {
1706 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
1707 _arr.push(_s.value);
1708
1709 if (i && _arr.length === i) break;
1710 }
1711 } catch (err) {
1712 _d = true;
1713 _e = err;
1714 } finally {
1715 try {
1716 if (!_n && _i["return"] != null) _i["return"]();
1717 } finally {
1718 if (_d) throw _e;
1719 }
1720 }
1721
1722 return _arr;
1723 }
1724
1725 module.exports = _iterableToArrayLimit;
1726
1727 /***/ }),
1728
1729 /***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
1730 /*!****************************************************************!*\
1731 !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
1732 \****************************************************************/
1733 /*! no static exports found */
1734 /***/ (function(module, exports) {
1735
1736 function _nonIterableRest() {
1737 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1738 }
1739
1740 module.exports = _nonIterableRest;
1741
1742 /***/ }),
1743
1744 /***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
1745 /*!******************************************************************!*\
1746 !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
1747 \******************************************************************/
1748 /*! no static exports found */
1749 /***/ (function(module, exports) {
1750
1751 function _nonIterableSpread() {
1752 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1753 }
1754
1755 module.exports = _nonIterableSpread;
1756
1757 /***/ }),
1758
1759 /***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
1760 /*!**************************************************************!*\
1761 !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
1762 \**************************************************************/
1763 /*! no static exports found */
1764 /***/ (function(module, exports, __webpack_require__) {
1765
1766 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js");
1767
1768 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
1769
1770 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
1771
1772 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/nonIterableRest.js");
1773
1774 function _slicedToArray(arr, i) {
1775 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
1776 }
1777
1778 module.exports = _slicedToArray;
1779
1780 /***/ }),
1781
1782 /***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
1783 /*!******************************************************************!*\
1784 !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
1785 \******************************************************************/
1786 /*! no static exports found */
1787 /***/ (function(module, exports, __webpack_require__) {
1788
1789 var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
1790
1791 var iterableToArray = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/iterableToArray.js");
1792
1793 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
1794
1795 var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js");
1796
1797 function _toConsumableArray(arr) {
1798 return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
1799 }
1800
1801 module.exports = _toConsumableArray;
1802
1803 /***/ }),
1804
1805 /***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
1806 /*!***************************************************************************!*\
1807 !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
1808 \***************************************************************************/
1809 /*! no static exports found */
1810 /***/ (function(module, exports, __webpack_require__) {
1811
1812 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
1813
1814 function _unsupportedIterableToArray(o, minLen) {
1815 if (!o) return;
1816 if (typeof o === "string") return arrayLikeToArray(o, minLen);
1817 var n = Object.prototype.toString.call(o).slice(8, -1);
1818 if (n === "Object" && o.constructor) n = o.constructor.name;
1819 if (n === "Map" || n === "Set") return Array.from(o);
1820 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
1821 }
1822
1823 module.exports = _unsupportedIterableToArray;
1824
1825 /***/ }),
1826
1827 /***/ "./node_modules/@babel/runtime/regenerator/index.js":
1828 /*!**********************************************************!*\
1829 !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
1830 \**********************************************************/
1831 /*! no static exports found */
1832 /***/ (function(module, exports, __webpack_require__) {
1833
1834 module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
1835
1836 /***/ }),
1837
1838 /***/ "./node_modules/es6-promise-promise/index.js":
1839 /*!***************************************************!*\
1840 !*** ./node_modules/es6-promise-promise/index.js ***!
1841 \***************************************************/
1842 /*! no static exports found */
1843 /***/ (function(module, exports, __webpack_require__) {
1844
1845 module.exports = __webpack_require__(/*! es6-promise */ "./node_modules/es6-promise/dist/es6-promise.js").Promise;
1846
1847 /***/ }),
1848
1849 /***/ "./node_modules/es6-promise/dist/es6-promise.js":
1850 /*!******************************************************!*\
1851 !*** ./node_modules/es6-promise/dist/es6-promise.js ***!
1852 \******************************************************/
1853 /*! no static exports found */
1854 /***/ (function(module, exports, __webpack_require__) {
1855
1856 /* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1857
1858 /*!
1859 * @overview es6-promise - a tiny implementation of Promises/A+.
1860 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
1861 * @license Licensed under MIT license
1862 * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
1863 * @version 3.3.1
1864 */
1865 (function (global, factory) {
1866 ( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1867 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1868 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
1869 __WEBPACK_AMD_DEFINE_FACTORY__),
1870 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
1871 })(this, function () {
1872 'use strict';
1873
1874 function objectOrFunction(x) {
1875 return typeof x === 'function' || _typeof(x) === 'object' && x !== null;
1876 }
1877
1878 function isFunction(x) {
1879 return typeof x === 'function';
1880 }
1881
1882 var _isArray = undefined;
1883
1884 if (!Array.isArray) {
1885 _isArray = function _isArray(x) {
1886 return Object.prototype.toString.call(x) === '[object Array]';
1887 };
1888 } else {
1889 _isArray = Array.isArray;
1890 }
1891
1892 var isArray = _isArray;
1893 var len = 0;
1894 var vertxNext = undefined;
1895 var customSchedulerFn = undefined;
1896
1897 var asap = function asap(callback, arg) {
1898 queue[len] = callback;
1899 queue[len + 1] = arg;
1900 len += 2;
1901
1902 if (len === 2) {
1903 // If len is 2, that means that we need to schedule an async flush.
1904 // If additional callbacks are queued before the queue is flushed, they
1905 // will be processed by this flush that we are scheduling.
1906 if (customSchedulerFn) {
1907 customSchedulerFn(flush);
1908 } else {
1909 scheduleFlush();
1910 }
1911 }
1912 };
1913
1914 function setScheduler(scheduleFn) {
1915 customSchedulerFn = scheduleFn;
1916 }
1917
1918 function setAsap(asapFn) {
1919 asap = asapFn;
1920 }
1921
1922 var browserWindow = typeof window !== 'undefined' ? window : undefined;
1923 var browserGlobal = browserWindow || {};
1924 var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
1925 var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10
1926
1927 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node
1928
1929 function useNextTick() {
1930 // node version 0.10.x displays a deprecation warning when nextTick is used recursively
1931 // see https://github.com/cujojs/when/issues/410 for details
1932 return function () {
1933 return process.nextTick(flush);
1934 };
1935 } // vertx
1936
1937
1938 function useVertxTimer() {
1939 return function () {
1940 vertxNext(flush);
1941 };
1942 }
1943
1944 function useMutationObserver() {
1945 var iterations = 0;
1946 var observer = new BrowserMutationObserver(flush);
1947 var node = document.createTextNode('');
1948 observer.observe(node, {
1949 characterData: true
1950 });
1951 return function () {
1952 node.data = iterations = ++iterations % 2;
1953 };
1954 } // web worker
1955
1956
1957 function useMessageChannel() {
1958 var channel = new MessageChannel();
1959 channel.port1.onmessage = flush;
1960 return function () {
1961 return channel.port2.postMessage(0);
1962 };
1963 }
1964
1965 function useSetTimeout() {
1966 // Store setTimeout reference so es6-promise will be unaffected by
1967 // other code modifying setTimeout (like sinon.useFakeTimers())
1968 var globalSetTimeout = setTimeout;
1969 return function () {
1970 return globalSetTimeout(flush, 1);
1971 };
1972 }
1973
1974 var queue = new Array(1000);
1975
1976 function flush() {
1977 for (var i = 0; i < len; i += 2) {
1978 var callback = queue[i];
1979 var arg = queue[i + 1];
1980 callback(arg);
1981 queue[i] = undefined;
1982 queue[i + 1] = undefined;
1983 }
1984
1985 len = 0;
1986 }
1987
1988 function attemptVertx() {
1989 try {
1990 var r = require;
1991 var vertx = __webpack_require__(/*! vertx */ 1);
1992 vertxNext = vertx.runOnLoop || vertx.runOnContext;
1993 return useVertxTimer();
1994 } catch (e) {
1995 return useSetTimeout();
1996 }
1997 }
1998
1999 var scheduleFlush = undefined; // Decide what async method to use to triggering processing of queued callbacks:
2000
2001 if (isNode) {
2002 scheduleFlush = useNextTick();
2003 } else if (BrowserMutationObserver) {
2004 scheduleFlush = useMutationObserver();
2005 } else if (isWorker) {
2006 scheduleFlush = useMessageChannel();
2007 } else if (browserWindow === undefined && "function" === 'function') {
2008 scheduleFlush = attemptVertx();
2009 } else {
2010 scheduleFlush = useSetTimeout();
2011 }
2012
2013 function then(onFulfillment, onRejection) {
2014 var _arguments = arguments;
2015 var parent = this;
2016 var child = new this.constructor(noop);
2017
2018 if (child[PROMISE_ID] === undefined) {
2019 makePromise(child);
2020 }
2021
2022 var _state = parent._state;
2023
2024 if (_state) {
2025 (function () {
2026 var callback = _arguments[_state - 1];
2027 asap(function () {
2028 return invokeCallback(_state, child, callback, parent._result);
2029 });
2030 })();
2031 } else {
2032 subscribe(parent, child, onFulfillment, onRejection);
2033 }
2034
2035 return child;
2036 }
2037 /**
2038 `Promise.resolve` returns a promise that will become resolved with the
2039 passed `value`. It is shorthand for the following:
2040
2041 ```javascript
2042 let promise = new Promise(function(resolve, reject){
2043 resolve(1);
2044 });
2045
2046 promise.then(function(value){
2047 // value === 1
2048 });
2049 ```
2050
2051 Instead of writing the above, your code now simply becomes the following:
2052
2053 ```javascript
2054 let promise = Promise.resolve(1);
2055
2056 promise.then(function(value){
2057 // value === 1
2058 });
2059 ```
2060
2061 @method resolve
2062 @static
2063 @param {Any} value value that the returned promise will be resolved with
2064 Useful for tooling.
2065 @return {Promise} a promise that will become fulfilled with the given
2066 `value`
2067 */
2068
2069
2070 function resolve(object) {
2071 /*jshint validthis:true */
2072 var Constructor = this;
2073
2074 if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
2075 return object;
2076 }
2077
2078 var promise = new Constructor(noop);
2079
2080 _resolve(promise, object);
2081
2082 return promise;
2083 }
2084
2085 var PROMISE_ID = Math.random().toString(36).substring(16);
2086
2087 function noop() {}
2088
2089 var PENDING = void 0;
2090 var FULFILLED = 1;
2091 var REJECTED = 2;
2092 var GET_THEN_ERROR = new ErrorObject();
2093
2094 function selfFulfillment() {
2095 return new TypeError("You cannot resolve a promise with itself");
2096 }
2097
2098 function cannotReturnOwn() {
2099 return new TypeError('A promises callback cannot return that same promise.');
2100 }
2101
2102 function getThen(promise) {
2103 try {
2104 return promise.then;
2105 } catch (error) {
2106 GET_THEN_ERROR.error = error;
2107 return GET_THEN_ERROR;
2108 }
2109 }
2110
2111 function tryThen(then, value, fulfillmentHandler, rejectionHandler) {
2112 try {
2113 then.call(value, fulfillmentHandler, rejectionHandler);
2114 } catch (e) {
2115 return e;
2116 }
2117 }
2118
2119 function handleForeignThenable(promise, thenable, then) {
2120 asap(function (promise) {
2121 var sealed = false;
2122 var error = tryThen(then, thenable, function (value) {
2123 if (sealed) {
2124 return;
2125 }
2126
2127 sealed = true;
2128
2129 if (thenable !== value) {
2130 _resolve(promise, value);
2131 } else {
2132 fulfill(promise, value);
2133 }
2134 }, function (reason) {
2135 if (sealed) {
2136 return;
2137 }
2138
2139 sealed = true;
2140
2141 _reject(promise, reason);
2142 }, 'Settle: ' + (promise._label || ' unknown promise'));
2143
2144 if (!sealed && error) {
2145 sealed = true;
2146
2147 _reject(promise, error);
2148 }
2149 }, promise);
2150 }
2151
2152 function handleOwnThenable(promise, thenable) {
2153 if (thenable._state === FULFILLED) {
2154 fulfill(promise, thenable._result);
2155 } else if (thenable._state === REJECTED) {
2156 _reject(promise, thenable._result);
2157 } else {
2158 subscribe(thenable, undefined, function (value) {
2159 return _resolve(promise, value);
2160 }, function (reason) {
2161 return _reject(promise, reason);
2162 });
2163 }
2164 }
2165
2166 function handleMaybeThenable(promise, maybeThenable, then$$) {
2167 if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {
2168 handleOwnThenable(promise, maybeThenable);
2169 } else {
2170 if (then$$ === GET_THEN_ERROR) {
2171 _reject(promise, GET_THEN_ERROR.error);
2172 } else if (then$$ === undefined) {
2173 fulfill(promise, maybeThenable);
2174 } else if (isFunction(then$$)) {
2175 handleForeignThenable(promise, maybeThenable, then$$);
2176 } else {
2177 fulfill(promise, maybeThenable);
2178 }
2179 }
2180 }
2181
2182 function _resolve(promise, value) {
2183 if (promise === value) {
2184 _reject(promise, selfFulfillment());
2185 } else if (objectOrFunction(value)) {
2186 handleMaybeThenable(promise, value, getThen(value));
2187 } else {
2188 fulfill(promise, value);
2189 }
2190 }
2191
2192 function publishRejection(promise) {
2193 if (promise._onerror) {
2194 promise._onerror(promise._result);
2195 }
2196
2197 publish(promise);
2198 }
2199
2200 function fulfill(promise, value) {
2201 if (promise._state !== PENDING) {
2202 return;
2203 }
2204
2205 promise._result = value;
2206 promise._state = FULFILLED;
2207
2208 if (promise._subscribers.length !== 0) {
2209 asap(publish, promise);
2210 }
2211 }
2212
2213 function _reject(promise, reason) {
2214 if (promise._state !== PENDING) {
2215 return;
2216 }
2217
2218 promise._state = REJECTED;
2219 promise._result = reason;
2220 asap(publishRejection, promise);
2221 }
2222
2223 function subscribe(parent, child, onFulfillment, onRejection) {
2224 var _subscribers = parent._subscribers;
2225 var length = _subscribers.length;
2226 parent._onerror = null;
2227 _subscribers[length] = child;
2228 _subscribers[length + FULFILLED] = onFulfillment;
2229 _subscribers[length + REJECTED] = onRejection;
2230
2231 if (length === 0 && parent._state) {
2232 asap(publish, parent);
2233 }
2234 }
2235
2236 function publish(promise) {
2237 var subscribers = promise._subscribers;
2238 var settled = promise._state;
2239
2240 if (subscribers.length === 0) {
2241 return;
2242 }
2243
2244 var child = undefined,
2245 callback = undefined,
2246 detail = promise._result;
2247
2248 for (var i = 0; i < subscribers.length; i += 3) {
2249 child = subscribers[i];
2250 callback = subscribers[i + settled];
2251
2252 if (child) {
2253 invokeCallback(settled, child, callback, detail);
2254 } else {
2255 callback(detail);
2256 }
2257 }
2258
2259 promise._subscribers.length = 0;
2260 }
2261
2262 function ErrorObject() {
2263 this.error = null;
2264 }
2265
2266 var TRY_CATCH_ERROR = new ErrorObject();
2267
2268 function tryCatch(callback, detail) {
2269 try {
2270 return callback(detail);
2271 } catch (e) {
2272 TRY_CATCH_ERROR.error = e;
2273 return TRY_CATCH_ERROR;
2274 }
2275 }
2276
2277 function invokeCallback(settled, promise, callback, detail) {
2278 var hasCallback = isFunction(callback),
2279 value = undefined,
2280 error = undefined,
2281 succeeded = undefined,
2282 failed = undefined;
2283
2284 if (hasCallback) {
2285 value = tryCatch(callback, detail);
2286
2287 if (value === TRY_CATCH_ERROR) {
2288 failed = true;
2289 error = value.error;
2290 value = null;
2291 } else {
2292 succeeded = true;
2293 }
2294
2295 if (promise === value) {
2296 _reject(promise, cannotReturnOwn());
2297
2298 return;
2299 }
2300 } else {
2301 value = detail;
2302 succeeded = true;
2303 }
2304
2305 if (promise._state !== PENDING) {// noop
2306 } else if (hasCallback && succeeded) {
2307 _resolve(promise, value);
2308 } else if (failed) {
2309 _reject(promise, error);
2310 } else if (settled === FULFILLED) {
2311 fulfill(promise, value);
2312 } else if (settled === REJECTED) {
2313 _reject(promise, value);
2314 }
2315 }
2316
2317 function initializePromise(promise, resolver) {
2318 try {
2319 resolver(function resolvePromise(value) {
2320 _resolve(promise, value);
2321 }, function rejectPromise(reason) {
2322 _reject(promise, reason);
2323 });
2324 } catch (e) {
2325 _reject(promise, e);
2326 }
2327 }
2328
2329 var id = 0;
2330
2331 function nextId() {
2332 return id++;
2333 }
2334
2335 function makePromise(promise) {
2336 promise[PROMISE_ID] = id++;
2337 promise._state = undefined;
2338 promise._result = undefined;
2339 promise._subscribers = [];
2340 }
2341
2342 function Enumerator(Constructor, input) {
2343 this._instanceConstructor = Constructor;
2344 this.promise = new Constructor(noop);
2345
2346 if (!this.promise[PROMISE_ID]) {
2347 makePromise(this.promise);
2348 }
2349
2350 if (isArray(input)) {
2351 this._input = input;
2352 this.length = input.length;
2353 this._remaining = input.length;
2354 this._result = new Array(this.length);
2355
2356 if (this.length === 0) {
2357 fulfill(this.promise, this._result);
2358 } else {
2359 this.length = this.length || 0;
2360
2361 this._enumerate();
2362
2363 if (this._remaining === 0) {
2364 fulfill(this.promise, this._result);
2365 }
2366 }
2367 } else {
2368 _reject(this.promise, validationError());
2369 }
2370 }
2371
2372 function validationError() {
2373 return new Error('Array Methods must be provided an Array');
2374 }
2375
2376 ;
2377
2378 Enumerator.prototype._enumerate = function () {
2379 var length = this.length;
2380 var _input = this._input;
2381
2382 for (var i = 0; this._state === PENDING && i < length; i++) {
2383 this._eachEntry(_input[i], i);
2384 }
2385 };
2386
2387 Enumerator.prototype._eachEntry = function (entry, i) {
2388 var c = this._instanceConstructor;
2389 var resolve$$ = c.resolve;
2390
2391 if (resolve$$ === resolve) {
2392 var _then = getThen(entry);
2393
2394 if (_then === then && entry._state !== PENDING) {
2395 this._settledAt(entry._state, i, entry._result);
2396 } else if (typeof _then !== 'function') {
2397 this._remaining--;
2398 this._result[i] = entry;
2399 } else if (c === Promise) {
2400 var promise = new c(noop);
2401 handleMaybeThenable(promise, entry, _then);
2402
2403 this._willSettleAt(promise, i);
2404 } else {
2405 this._willSettleAt(new c(function (resolve$$) {
2406 return resolve$$(entry);
2407 }), i);
2408 }
2409 } else {
2410 this._willSettleAt(resolve$$(entry), i);
2411 }
2412 };
2413
2414 Enumerator.prototype._settledAt = function (state, i, value) {
2415 var promise = this.promise;
2416
2417 if (promise._state === PENDING) {
2418 this._remaining--;
2419
2420 if (state === REJECTED) {
2421 _reject(promise, value);
2422 } else {
2423 this._result[i] = value;
2424 }
2425 }
2426
2427 if (this._remaining === 0) {
2428 fulfill(promise, this._result);
2429 }
2430 };
2431
2432 Enumerator.prototype._willSettleAt = function (promise, i) {
2433 var enumerator = this;
2434 subscribe(promise, undefined, function (value) {
2435 return enumerator._settledAt(FULFILLED, i, value);
2436 }, function (reason) {
2437 return enumerator._settledAt(REJECTED, i, reason);
2438 });
2439 };
2440 /**
2441 `Promise.all` accepts an array of promises, and returns a new promise which
2442 is fulfilled with an array of fulfillment values for the passed promises, or
2443 rejected with the reason of the first passed promise to be rejected. It casts all
2444 elements of the passed iterable to promises as it runs this algorithm.
2445
2446 Example:
2447
2448 ```javascript
2449 let promise1 = resolve(1);
2450 let promise2 = resolve(2);
2451 let promise3 = resolve(3);
2452 let promises = [ promise1, promise2, promise3 ];
2453
2454 Promise.all(promises).then(function(array){
2455 // The array here would be [ 1, 2, 3 ];
2456 });
2457 ```
2458
2459 If any of the `promises` given to `all` are rejected, the first promise
2460 that is rejected will be given as an argument to the returned promises's
2461 rejection handler. For example:
2462
2463 Example:
2464
2465 ```javascript
2466 let promise1 = resolve(1);
2467 let promise2 = reject(new Error("2"));
2468 let promise3 = reject(new Error("3"));
2469 let promises = [ promise1, promise2, promise3 ];
2470
2471 Promise.all(promises).then(function(array){
2472 // Code here never runs because there are rejected promises!
2473 }, function(error) {
2474 // error.message === "2"
2475 });
2476 ```
2477
2478 @method all
2479 @static
2480 @param {Array} entries array of promises
2481 @param {String} label optional string for labeling the promise.
2482 Useful for tooling.
2483 @return {Promise} promise that is fulfilled when all `promises` have been
2484 fulfilled, or rejected if any of them become rejected.
2485 @static
2486 */
2487
2488
2489 function all(entries) {
2490 return new Enumerator(this, entries).promise;
2491 }
2492 /**
2493 `Promise.race` returns a new promise which is settled in the same way as the
2494 first passed promise to settle.
2495
2496 Example:
2497
2498 ```javascript
2499 let promise1 = new Promise(function(resolve, reject){
2500 setTimeout(function(){
2501 resolve('promise 1');
2502 }, 200);
2503 });
2504
2505 let promise2 = new Promise(function(resolve, reject){
2506 setTimeout(function(){
2507 resolve('promise 2');
2508 }, 100);
2509 });
2510
2511 Promise.race([promise1, promise2]).then(function(result){
2512 // result === 'promise 2' because it was resolved before promise1
2513 // was resolved.
2514 });
2515 ```
2516
2517 `Promise.race` is deterministic in that only the state of the first
2518 settled promise matters. For example, even if other promises given to the
2519 `promises` array argument are resolved, but the first settled promise has
2520 become rejected before the other promises became fulfilled, the returned
2521 promise will become rejected:
2522
2523 ```javascript
2524 let promise1 = new Promise(function(resolve, reject){
2525 setTimeout(function(){
2526 resolve('promise 1');
2527 }, 200);
2528 });
2529
2530 let promise2 = new Promise(function(resolve, reject){
2531 setTimeout(function(){
2532 reject(new Error('promise 2'));
2533 }, 100);
2534 });
2535
2536 Promise.race([promise1, promise2]).then(function(result){
2537 // Code here never runs
2538 }, function(reason){
2539 // reason.message === 'promise 2' because promise 2 became rejected before
2540 // promise 1 became fulfilled
2541 });
2542 ```
2543
2544 An example real-world use case is implementing timeouts:
2545
2546 ```javascript
2547 Promise.race([ajax('foo.json'), timeout(5000)])
2548 ```
2549
2550 @method race
2551 @static
2552 @param {Array} promises array of promises to observe
2553 Useful for tooling.
2554 @return {Promise} a promise which settles in the same way as the first passed
2555 promise to settle.
2556 */
2557
2558
2559 function race(entries) {
2560 /*jshint validthis:true */
2561 var Constructor = this;
2562
2563 if (!isArray(entries)) {
2564 return new Constructor(function (_, reject) {
2565 return reject(new TypeError('You must pass an array to race.'));
2566 });
2567 } else {
2568 return new Constructor(function (resolve, reject) {
2569 var length = entries.length;
2570
2571 for (var i = 0; i < length; i++) {
2572 Constructor.resolve(entries[i]).then(resolve, reject);
2573 }
2574 });
2575 }
2576 }
2577 /**
2578 `Promise.reject` returns a promise rejected with the passed `reason`.
2579 It is shorthand for the following:
2580
2581 ```javascript
2582 let promise = new Promise(function(resolve, reject){
2583 reject(new Error('WHOOPS'));
2584 });
2585
2586 promise.then(function(value){
2587 // Code here doesn't run because the promise is rejected!
2588 }, function(reason){
2589 // reason.message === 'WHOOPS'
2590 });
2591 ```
2592
2593 Instead of writing the above, your code now simply becomes the following:
2594
2595 ```javascript
2596 let promise = Promise.reject(new Error('WHOOPS'));
2597
2598 promise.then(function(value){
2599 // Code here doesn't run because the promise is rejected!
2600 }, function(reason){
2601 // reason.message === 'WHOOPS'
2602 });
2603 ```
2604
2605 @method reject
2606 @static
2607 @param {Any} reason value that the returned promise will be rejected with.
2608 Useful for tooling.
2609 @return {Promise} a promise rejected with the given `reason`.
2610 */
2611
2612
2613 function reject(reason) {
2614 /*jshint validthis:true */
2615 var Constructor = this;
2616 var promise = new Constructor(noop);
2617
2618 _reject(promise, reason);
2619
2620 return promise;
2621 }
2622
2623 function needsResolver() {
2624 throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
2625 }
2626
2627 function needsNew() {
2628 throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
2629 }
2630 /**
2631 Promise objects represent the eventual result of an asynchronous operation. The
2632 primary way of interacting with a promise is through its `then` method, which
2633 registers callbacks to receive either a promise's eventual value or the reason
2634 why the promise cannot be fulfilled.
2635
2636 Terminology
2637 -----------
2638
2639 - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
2640 - `thenable` is an object or function that defines a `then` method.
2641 - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
2642 - `exception` is a value that is thrown using the throw statement.
2643 - `reason` is a value that indicates why a promise was rejected.
2644 - `settled` the final resting state of a promise, fulfilled or rejected.
2645
2646 A promise can be in one of three states: pending, fulfilled, or rejected.
2647
2648 Promises that are fulfilled have a fulfillment value and are in the fulfilled
2649 state. Promises that are rejected have a rejection reason and are in the
2650 rejected state. A fulfillment value is never a thenable.
2651
2652 Promises can also be said to *resolve* a value. If this value is also a
2653 promise, then the original promise's settled state will match the value's
2654 settled state. So a promise that *resolves* a promise that rejects will
2655 itself reject, and a promise that *resolves* a promise that fulfills will
2656 itself fulfill.
2657
2658
2659 Basic Usage:
2660 ------------
2661
2662 ```js
2663 let promise = new Promise(function(resolve, reject) {
2664 // on success
2665 resolve(value);
2666
2667 // on failure
2668 reject(reason);
2669 });
2670
2671 promise.then(function(value) {
2672 // on fulfillment
2673 }, function(reason) {
2674 // on rejection
2675 });
2676 ```
2677
2678 Advanced Usage:
2679 ---------------
2680
2681 Promises shine when abstracting away asynchronous interactions such as
2682 `XMLHttpRequest`s.
2683
2684 ```js
2685 function getJSON(url) {
2686 return new Promise(function(resolve, reject){
2687 let xhr = new XMLHttpRequest();
2688
2689 xhr.open('GET', url);
2690 xhr.onreadystatechange = handler;
2691 xhr.responseType = 'json';
2692 xhr.setRequestHeader('Accept', 'application/json');
2693 xhr.send();
2694
2695 function handler() {
2696 if (this.readyState === this.DONE) {
2697 if (this.status === 200) {
2698 resolve(this.response);
2699 } else {
2700 reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
2701 }
2702 }
2703 };
2704 });
2705 }
2706
2707 getJSON('/posts.json').then(function(json) {
2708 // on fulfillment
2709 }, function(reason) {
2710 // on rejection
2711 });
2712 ```
2713
2714 Unlike callbacks, promises are great composable primitives.
2715
2716 ```js
2717 Promise.all([
2718 getJSON('/posts'),
2719 getJSON('/comments')
2720 ]).then(function(values){
2721 values[0] // => postsJSON
2722 values[1] // => commentsJSON
2723
2724 return values;
2725 });
2726 ```
2727
2728 @class Promise
2729 @param {function} resolver
2730 Useful for tooling.
2731 @constructor
2732 */
2733
2734
2735 function Promise(resolver) {
2736 this[PROMISE_ID] = nextId();
2737 this._result = this._state = undefined;
2738 this._subscribers = [];
2739
2740 if (noop !== resolver) {
2741 typeof resolver !== 'function' && needsResolver();
2742 this instanceof Promise ? initializePromise(this, resolver) : needsNew();
2743 }
2744 }
2745
2746 Promise.all = all;
2747 Promise.race = race;
2748 Promise.resolve = resolve;
2749 Promise.reject = reject;
2750 Promise._setScheduler = setScheduler;
2751 Promise._setAsap = setAsap;
2752 Promise._asap = asap;
2753 Promise.prototype = {
2754 constructor: Promise,
2755
2756 /**
2757 The primary way of interacting with a promise is through its `then` method,
2758 which registers callbacks to receive either a promise's eventual value or the
2759 reason why the promise cannot be fulfilled.
2760
2761 ```js
2762 findUser().then(function(user){
2763 // user is available
2764 }, function(reason){
2765 // user is unavailable, and you are given the reason why
2766 });
2767 ```
2768
2769 Chaining
2770 --------
2771
2772 The return value of `then` is itself a promise. This second, 'downstream'
2773 promise is resolved with the return value of the first promise's fulfillment
2774 or rejection handler, or rejected if the handler throws an exception.
2775
2776 ```js
2777 findUser().then(function (user) {
2778 return user.name;
2779 }, function (reason) {
2780 return 'default name';
2781 }).then(function (userName) {
2782 // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
2783 // will be `'default name'`
2784 });
2785
2786 findUser().then(function (user) {
2787 throw new Error('Found user, but still unhappy');
2788 }, function (reason) {
2789 throw new Error('`findUser` rejected and we're unhappy');
2790 }).then(function (value) {
2791 // never reached
2792 }, function (reason) {
2793 // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
2794 // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
2795 });
2796 ```
2797 If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
2798
2799 ```js
2800 findUser().then(function (user) {
2801 throw new PedagogicalException('Upstream error');
2802 }).then(function (value) {
2803 // never reached
2804 }).then(function (value) {
2805 // never reached
2806 }, function (reason) {
2807 // The `PedgagocialException` is propagated all the way down to here
2808 });
2809 ```
2810
2811 Assimilation
2812 ------------
2813
2814 Sometimes the value you want to propagate to a downstream promise can only be
2815 retrieved asynchronously. This can be achieved by returning a promise in the
2816 fulfillment or rejection handler. The downstream promise will then be pending
2817 until the returned promise is settled. This is called *assimilation*.
2818
2819 ```js
2820 findUser().then(function (user) {
2821 return findCommentsByAuthor(user);
2822 }).then(function (comments) {
2823 // The user's comments are now available
2824 });
2825 ```
2826
2827 If the assimliated promise rejects, then the downstream promise will also reject.
2828
2829 ```js
2830 findUser().then(function (user) {
2831 return findCommentsByAuthor(user);
2832 }).then(function (comments) {
2833 // If `findCommentsByAuthor` fulfills, we'll have the value here
2834 }, function (reason) {
2835 // If `findCommentsByAuthor` rejects, we'll have the reason here
2836 });
2837 ```
2838
2839 Simple Example
2840 --------------
2841
2842 Synchronous Example
2843
2844 ```javascript
2845 let result;
2846
2847 try {
2848 result = findResult();
2849 // success
2850 } catch(reason) {
2851 // failure
2852 }
2853 ```
2854
2855 Errback Example
2856
2857 ```js
2858 findResult(function(result, err){
2859 if (err) {
2860 // failure
2861 } else {
2862 // success
2863 }
2864 });
2865 ```
2866
2867 Promise Example;
2868
2869 ```javascript
2870 findResult().then(function(result){
2871 // success
2872 }, function(reason){
2873 // failure
2874 });
2875 ```
2876
2877 Advanced Example
2878 --------------
2879
2880 Synchronous Example
2881
2882 ```javascript
2883 let author, books;
2884
2885 try {
2886 author = findAuthor();
2887 books = findBooksByAuthor(author);
2888 // success
2889 } catch(reason) {
2890 // failure
2891 }
2892 ```
2893
2894 Errback Example
2895
2896 ```js
2897
2898 function foundBooks(books) {
2899
2900 }
2901
2902 function failure(reason) {
2903
2904 }
2905
2906 findAuthor(function(author, err){
2907 if (err) {
2908 failure(err);
2909 // failure
2910 } else {
2911 try {
2912 findBoooksByAuthor(author, function(books, err) {
2913 if (err) {
2914 failure(err);
2915 } else {
2916 try {
2917 foundBooks(books);
2918 } catch(reason) {
2919 failure(reason);
2920 }
2921 }
2922 });
2923 } catch(error) {
2924 failure(err);
2925 }
2926 // success
2927 }
2928 });
2929 ```
2930
2931 Promise Example;
2932
2933 ```javascript
2934 findAuthor().
2935 then(findBooksByAuthor).
2936 then(function(books){
2937 // found books
2938 }).catch(function(reason){
2939 // something went wrong
2940 });
2941 ```
2942
2943 @method then
2944 @param {Function} onFulfilled
2945 @param {Function} onRejected
2946 Useful for tooling.
2947 @return {Promise}
2948 */
2949 then: then,
2950
2951 /**
2952 `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
2953 as the catch block of a try/catch statement.
2954
2955 ```js
2956 function findAuthor(){
2957 throw new Error('couldn't find that author');
2958 }
2959
2960 // synchronous
2961 try {
2962 findAuthor();
2963 } catch(reason) {
2964 // something went wrong
2965 }
2966
2967 // async with promises
2968 findAuthor().catch(function(reason){
2969 // something went wrong
2970 });
2971 ```
2972
2973 @method catch
2974 @param {Function} onRejection
2975 Useful for tooling.
2976 @return {Promise}
2977 */
2978 'catch': function _catch(onRejection) {
2979 return this.then(null, onRejection);
2980 }
2981 };
2982
2983 function polyfill() {
2984 var local = undefined;
2985
2986 if (typeof global !== 'undefined') {
2987 local = global;
2988 } else if (typeof self !== 'undefined') {
2989 local = self;
2990 } else {
2991 try {
2992 local = Function('return this')();
2993 } catch (e) {
2994 throw new Error('polyfill failed because global object is unavailable in this environment');
2995 }
2996 }
2997
2998 var P = local.Promise;
2999
3000 if (P) {
3001 var promiseToString = null;
3002
3003 try {
3004 promiseToString = Object.prototype.toString.call(P.resolve());
3005 } catch (e) {// silently ignored
3006 }
3007
3008 if (promiseToString === '[object Promise]' && !P.cast) {
3009 return;
3010 }
3011 }
3012
3013 local.Promise = Promise;
3014 }
3015
3016 polyfill(); // Strange compat..
3017
3018 Promise.polyfill = polyfill;
3019 Promise.Promise = Promise;
3020 return Promise;
3021 });
3022 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
3023
3024 /***/ }),
3025
3026 /***/ "./node_modules/process/browser.js":
3027 /*!*****************************************!*\
3028 !*** ./node_modules/process/browser.js ***!
3029 \*****************************************/
3030 /*! no static exports found */
3031 /***/ (function(module, exports) {
3032
3033 // shim for using process in browser
3034 var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
3035 // don't break things. But we need to wrap it in a try catch in case it is
3036 // wrapped in strict mode code which doesn't define any globals. It's inside a
3037 // function because try/catches deoptimize in certain engines.
3038
3039 var cachedSetTimeout;
3040 var cachedClearTimeout;
3041
3042 function defaultSetTimout() {
3043 throw new Error('setTimeout has not been defined');
3044 }
3045
3046 function defaultClearTimeout() {
3047 throw new Error('clearTimeout has not been defined');
3048 }
3049
3050 (function () {
3051 try {
3052 if (typeof setTimeout === 'function') {
3053 cachedSetTimeout = setTimeout;
3054 } else {
3055 cachedSetTimeout = defaultSetTimout;
3056 }
3057 } catch (e) {
3058 cachedSetTimeout = defaultSetTimout;
3059 }
3060
3061 try {
3062 if (typeof clearTimeout === 'function') {
3063 cachedClearTimeout = clearTimeout;
3064 } else {
3065 cachedClearTimeout = defaultClearTimeout;
3066 }
3067 } catch (e) {
3068 cachedClearTimeout = defaultClearTimeout;
3069 }
3070 })();
3071
3072 function runTimeout(fun) {
3073 if (cachedSetTimeout === setTimeout) {
3074 //normal enviroments in sane situations
3075 return setTimeout(fun, 0);
3076 } // if setTimeout wasn't available but was latter defined
3077
3078
3079 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
3080 cachedSetTimeout = setTimeout;
3081 return setTimeout(fun, 0);
3082 }
3083
3084 try {
3085 // when when somebody has screwed with setTimeout but no I.E. maddness
3086 return cachedSetTimeout(fun, 0);
3087 } catch (e) {
3088 try {
3089 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3090 return cachedSetTimeout.call(null, fun, 0);
3091 } catch (e) {
3092 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
3093 return cachedSetTimeout.call(this, fun, 0);
3094 }
3095 }
3096 }
3097
3098 function runClearTimeout(marker) {
3099 if (cachedClearTimeout === clearTimeout) {
3100 //normal enviroments in sane situations
3101 return clearTimeout(marker);
3102 } // if clearTimeout wasn't available but was latter defined
3103
3104
3105 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
3106 cachedClearTimeout = clearTimeout;
3107 return clearTimeout(marker);
3108 }
3109
3110 try {
3111 // when when somebody has screwed with setTimeout but no I.E. maddness
3112 return cachedClearTimeout(marker);
3113 } catch (e) {
3114 try {
3115 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3116 return cachedClearTimeout.call(null, marker);
3117 } catch (e) {
3118 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
3119 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
3120 return cachedClearTimeout.call(this, marker);
3121 }
3122 }
3123 }
3124
3125 var queue = [];
3126 var draining = false;
3127 var currentQueue;
3128 var queueIndex = -1;
3129
3130 function cleanUpNextTick() {
3131 if (!draining || !currentQueue) {
3132 return;
3133 }
3134
3135 draining = false;
3136
3137 if (currentQueue.length) {
3138 queue = currentQueue.concat(queue);
3139 } else {
3140 queueIndex = -1;
3141 }
3142
3143 if (queue.length) {
3144 drainQueue();
3145 }
3146 }
3147
3148 function drainQueue() {
3149 if (draining) {
3150 return;
3151 }
3152
3153 var timeout = runTimeout(cleanUpNextTick);
3154 draining = true;
3155 var len = queue.length;
3156
3157 while (len) {
3158 currentQueue = queue;
3159 queue = [];
3160
3161 while (++queueIndex < len) {
3162 if (currentQueue) {
3163 currentQueue[queueIndex].run();
3164 }
3165 }
3166
3167 queueIndex = -1;
3168 len = queue.length;
3169 }
3170
3171 currentQueue = null;
3172 draining = false;
3173 runClearTimeout(timeout);
3174 }
3175
3176 process.nextTick = function (fun) {
3177 var args = new Array(arguments.length - 1);
3178
3179 if (arguments.length > 1) {
3180 for (var i = 1; i < arguments.length; i++) {
3181 args[i - 1] = arguments[i];
3182 }
3183 }
3184
3185 queue.push(new Item(fun, args));
3186
3187 if (queue.length === 1 && !draining) {
3188 runTimeout(drainQueue);
3189 }
3190 }; // v8 likes predictible objects
3191
3192
3193 function Item(fun, array) {
3194 this.fun = fun;
3195 this.array = array;
3196 }
3197
3198 Item.prototype.run = function () {
3199 this.fun.apply(null, this.array);
3200 };
3201
3202 process.title = 'browser';
3203 process.browser = true;
3204 process.env = {};
3205 process.argv = [];
3206 process.version = ''; // empty string to avoid regexp issues
3207
3208 process.versions = {};
3209
3210 function noop() {}
3211
3212 process.on = noop;
3213 process.addListener = noop;
3214 process.once = noop;
3215 process.off = noop;
3216 process.removeListener = noop;
3217 process.removeAllListeners = noop;
3218 process.emit = noop;
3219 process.prependListener = noop;
3220 process.prependOnceListener = noop;
3221
3222 process.listeners = function (name) {
3223 return [];
3224 };
3225
3226 process.binding = function (name) {
3227 throw new Error('process.binding is not supported');
3228 };
3229
3230 process.cwd = function () {
3231 return '/';
3232 };
3233
3234 process.chdir = function (dir) {
3235 throw new Error('process.chdir is not supported');
3236 };
3237
3238 process.umask = function () {
3239 return 0;
3240 };
3241
3242 /***/ }),
3243
3244 /***/ "./node_modules/regenerator-runtime/runtime.js":
3245 /*!*****************************************************!*\
3246 !*** ./node_modules/regenerator-runtime/runtime.js ***!
3247 \*****************************************************/
3248 /*! no static exports found */
3249 /***/ (function(module, exports, __webpack_require__) {
3250
3251 /* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3252
3253 /**
3254 * Copyright (c) 2014-present, Facebook, Inc.
3255 *
3256 * This source code is licensed under the MIT license found in the
3257 * LICENSE file in the root directory of this source tree.
3258 */
3259 var runtime = function (exports) {
3260 "use strict";
3261
3262 var Op = Object.prototype;
3263 var hasOwn = Op.hasOwnProperty;
3264 var undefined; // More compressible than void 0.
3265
3266 var $Symbol = typeof Symbol === "function" ? Symbol : {};
3267 var iteratorSymbol = $Symbol.iterator || "@@iterator";
3268 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
3269 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3270
3271 function wrap(innerFn, outerFn, self, tryLocsList) {
3272 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
3273 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
3274 var generator = Object.create(protoGenerator.prototype);
3275 var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
3276 // .throw, and .return methods.
3277
3278 generator._invoke = makeInvokeMethod(innerFn, self, context);
3279 return generator;
3280 }
3281
3282 exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
3283 // record like context.tryEntries[i].completion. This interface could
3284 // have been (and was previously) designed to take a closure to be
3285 // invoked without arguments, but in all the cases we care about we
3286 // already have an existing method we want to call, so there's no need
3287 // to create a new function object. We can even get away with assuming
3288 // the method takes exactly one argument, since that happens to be true
3289 // in every case, so we don't have to touch the arguments object. The
3290 // only additional allocation required is the completion record, which
3291 // has a stable shape and so hopefully should be cheap to allocate.
3292
3293 function tryCatch(fn, obj, arg) {
3294 try {
3295 return {
3296 type: "normal",
3297 arg: fn.call(obj, arg)
3298 };
3299 } catch (err) {
3300 return {
3301 type: "throw",
3302 arg: err
3303 };
3304 }
3305 }
3306
3307 var GenStateSuspendedStart = "suspendedStart";
3308 var GenStateSuspendedYield = "suspendedYield";
3309 var GenStateExecuting = "executing";
3310 var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
3311 // breaking out of the dispatch switch statement.
3312
3313 var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
3314 // .constructor.prototype properties for functions that return Generator
3315 // objects. For full spec compliance, you may wish to configure your
3316 // minifier not to mangle the names of these two functions.
3317
3318 function Generator() {}
3319
3320 function GeneratorFunction() {}
3321
3322 function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
3323 // don't natively support it.
3324
3325
3326 var IteratorPrototype = {};
3327
3328 IteratorPrototype[iteratorSymbol] = function () {
3329 return this;
3330 };
3331
3332 var getProto = Object.getPrototypeOf;
3333 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3334
3335 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
3336 // This environment has a native %IteratorPrototype%; use it instead
3337 // of the polyfill.
3338 IteratorPrototype = NativeIteratorPrototype;
3339 }
3340
3341 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
3342 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
3343 GeneratorFunctionPrototype.constructor = GeneratorFunction;
3344 GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
3345 // Iterator interface in terms of a single ._invoke method.
3346
3347 function defineIteratorMethods(prototype) {
3348 ["next", "throw", "return"].forEach(function (method) {
3349 prototype[method] = function (arg) {
3350 return this._invoke(method, arg);
3351 };
3352 });
3353 }
3354
3355 exports.isGeneratorFunction = function (genFun) {
3356 var ctor = typeof genFun === "function" && genFun.constructor;
3357 return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
3358 // do is to check its .name property.
3359 (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
3360 };
3361
3362 exports.mark = function (genFun) {
3363 if (Object.setPrototypeOf) {
3364 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
3365 } else {
3366 genFun.__proto__ = GeneratorFunctionPrototype;
3367
3368 if (!(toStringTagSymbol in genFun)) {
3369 genFun[toStringTagSymbol] = "GeneratorFunction";
3370 }
3371 }
3372
3373 genFun.prototype = Object.create(Gp);
3374 return genFun;
3375 }; // Within the body of any async function, `await x` is transformed to
3376 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
3377 // `hasOwn.call(value, "__await")` to determine if the yielded value is
3378 // meant to be awaited.
3379
3380
3381 exports.awrap = function (arg) {
3382 return {
3383 __await: arg
3384 };
3385 };
3386
3387 function AsyncIterator(generator, PromiseImpl) {
3388 function invoke(method, arg, resolve, reject) {
3389 var record = tryCatch(generator[method], generator, arg);
3390
3391 if (record.type === "throw") {
3392 reject(record.arg);
3393 } else {
3394 var result = record.arg;
3395 var value = result.value;
3396
3397 if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
3398 return PromiseImpl.resolve(value.__await).then(function (value) {
3399 invoke("next", value, resolve, reject);
3400 }, function (err) {
3401 invoke("throw", err, resolve, reject);
3402 });
3403 }
3404
3405 return PromiseImpl.resolve(value).then(function (unwrapped) {
3406 // When a yielded Promise is resolved, its final value becomes
3407 // the .value of the Promise<{value,done}> result for the
3408 // current iteration.
3409 result.value = unwrapped;
3410 resolve(result);
3411 }, function (error) {
3412 // If a rejected Promise was yielded, throw the rejection back
3413 // into the async generator function so it can be handled there.
3414 return invoke("throw", error, resolve, reject);
3415 });
3416 }
3417 }
3418
3419 var previousPromise;
3420
3421 function enqueue(method, arg) {
3422 function callInvokeWithMethodAndArg() {
3423 return new PromiseImpl(function (resolve, reject) {
3424 invoke(method, arg, resolve, reject);
3425 });
3426 }
3427
3428 return previousPromise = // If enqueue has been called before, then we want to wait until
3429 // all previous Promises have been resolved before calling invoke,
3430 // so that results are always delivered in the correct order. If
3431 // enqueue has not been called before, then it is important to
3432 // call invoke immediately, without waiting on a callback to fire,
3433 // so that the async generator function has the opportunity to do
3434 // any necessary setup in a predictable way. This predictability
3435 // is why the Promise constructor synchronously invokes its
3436 // executor callback, and why async functions synchronously
3437 // execute code before the first await. Since we implement simple
3438 // async functions in terms of async generators, it is especially
3439 // important to get this right, even though it requires care.
3440 previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
3441 // invocations of the iterator.
3442 callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
3443 } // Define the unified helper method that is used to implement .next,
3444 // .throw, and .return (see defineIteratorMethods).
3445
3446
3447 this._invoke = enqueue;
3448 }
3449
3450 defineIteratorMethods(AsyncIterator.prototype);
3451
3452 AsyncIterator.prototype[asyncIteratorSymbol] = function () {
3453 return this;
3454 };
3455
3456 exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
3457 // AsyncIterator objects; they just return a Promise for the value of
3458 // the final result produced by the iterator.
3459
3460 exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
3461 if (PromiseImpl === void 0) PromiseImpl = Promise;
3462 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
3463 return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
3464 : iter.next().then(function (result) {
3465 return result.done ? result.value : iter.next();
3466 });
3467 };
3468
3469 function makeInvokeMethod(innerFn, self, context) {
3470 var state = GenStateSuspendedStart;
3471 return function invoke(method, arg) {
3472 if (state === GenStateExecuting) {
3473 throw new Error("Generator is already running");
3474 }
3475
3476 if (state === GenStateCompleted) {
3477 if (method === "throw") {
3478 throw arg;
3479 } // Be forgiving, per 25.3.3.3.3 of the spec:
3480 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
3481
3482
3483 return doneResult();
3484 }
3485
3486 context.method = method;
3487 context.arg = arg;
3488
3489 while (true) {
3490 var delegate = context.delegate;
3491
3492 if (delegate) {
3493 var delegateResult = maybeInvokeDelegate(delegate, context);
3494
3495 if (delegateResult) {
3496 if (delegateResult === ContinueSentinel) continue;
3497 return delegateResult;
3498 }
3499 }
3500
3501 if (context.method === "next") {
3502 // Setting context._sent for legacy support of Babel's
3503 // function.sent implementation.
3504 context.sent = context._sent = context.arg;
3505 } else if (context.method === "throw") {
3506 if (state === GenStateSuspendedStart) {
3507 state = GenStateCompleted;
3508 throw context.arg;
3509 }
3510
3511 context.dispatchException(context.arg);
3512 } else if (context.method === "return") {
3513 context.abrupt("return", context.arg);
3514 }
3515
3516 state = GenStateExecuting;
3517 var record = tryCatch(innerFn, self, context);
3518
3519 if (record.type === "normal") {
3520 // If an exception is thrown from innerFn, we leave state ===
3521 // GenStateExecuting and loop back for another invocation.
3522 state = context.done ? GenStateCompleted : GenStateSuspendedYield;
3523
3524 if (record.arg === ContinueSentinel) {
3525 continue;
3526 }
3527
3528 return {
3529 value: record.arg,
3530 done: context.done
3531 };
3532 } else if (record.type === "throw") {
3533 state = GenStateCompleted; // Dispatch the exception by looping back around to the
3534 // context.dispatchException(context.arg) call above.
3535
3536 context.method = "throw";
3537 context.arg = record.arg;
3538 }
3539 }
3540 };
3541 } // Call delegate.iterator[context.method](context.arg) and handle the
3542 // result, either by returning a { value, done } result from the
3543 // delegate iterator, or by modifying context.method and context.arg,
3544 // setting context.delegate to null, and returning the ContinueSentinel.
3545
3546
3547 function maybeInvokeDelegate(delegate, context) {
3548 var method = delegate.iterator[context.method];
3549
3550 if (method === undefined) {
3551 // A .throw or .return when the delegate iterator has no .throw
3552 // method always terminates the yield* loop.
3553 context.delegate = null;
3554
3555 if (context.method === "throw") {
3556 // Note: ["return"] must be used for ES3 parsing compatibility.
3557 if (delegate.iterator["return"]) {
3558 // If the delegate iterator has a return method, give it a
3559 // chance to clean up.
3560 context.method = "return";
3561 context.arg = undefined;
3562 maybeInvokeDelegate(delegate, context);
3563
3564 if (context.method === "throw") {
3565 // If maybeInvokeDelegate(context) changed context.method from
3566 // "return" to "throw", let that override the TypeError below.
3567 return ContinueSentinel;
3568 }
3569 }
3570
3571 context.method = "throw";
3572 context.arg = new TypeError("The iterator does not provide a 'throw' method");
3573 }
3574
3575 return ContinueSentinel;
3576 }
3577
3578 var record = tryCatch(method, delegate.iterator, context.arg);
3579
3580 if (record.type === "throw") {
3581 context.method = "throw";
3582 context.arg = record.arg;
3583 context.delegate = null;
3584 return ContinueSentinel;
3585 }
3586
3587 var info = record.arg;
3588
3589 if (!info) {
3590 context.method = "throw";
3591 context.arg = new TypeError("iterator result is not an object");
3592 context.delegate = null;
3593 return ContinueSentinel;
3594 }
3595
3596 if (info.done) {
3597 // Assign the result of the finished delegate to the temporary
3598 // variable specified by delegate.resultName (see delegateYield).
3599 context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
3600
3601 context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
3602 // exception, let the outer generator proceed normally. If
3603 // context.method was "next", forget context.arg since it has been
3604 // "consumed" by the delegate iterator. If context.method was
3605 // "return", allow the original .return call to continue in the
3606 // outer generator.
3607
3608 if (context.method !== "return") {
3609 context.method = "next";
3610 context.arg = undefined;
3611 }
3612 } else {
3613 // Re-yield the result returned by the delegate method.
3614 return info;
3615 } // The delegate iterator is finished, so forget it and continue with
3616 // the outer generator.
3617
3618
3619 context.delegate = null;
3620 return ContinueSentinel;
3621 } // Define Generator.prototype.{next,throw,return} in terms of the
3622 // unified ._invoke helper method.
3623
3624
3625 defineIteratorMethods(Gp);
3626 Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
3627 // @@iterator function is called on it. Some browsers' implementations of the
3628 // iterator prototype chain incorrectly implement this, causing the Generator
3629 // object to not be returned from this call. This ensures that doesn't happen.
3630 // See https://github.com/facebook/regenerator/issues/274 for more details.
3631
3632 Gp[iteratorSymbol] = function () {
3633 return this;
3634 };
3635
3636 Gp.toString = function () {
3637 return "[object Generator]";
3638 };
3639
3640 function pushTryEntry(locs) {
3641 var entry = {
3642 tryLoc: locs[0]
3643 };
3644
3645 if (1 in locs) {
3646 entry.catchLoc = locs[1];
3647 }
3648
3649 if (2 in locs) {
3650 entry.finallyLoc = locs[2];
3651 entry.afterLoc = locs[3];
3652 }
3653
3654 this.tryEntries.push(entry);
3655 }
3656
3657 function resetTryEntry(entry) {
3658 var record = entry.completion || {};
3659 record.type = "normal";
3660 delete record.arg;
3661 entry.completion = record;
3662 }
3663
3664 function Context(tryLocsList) {
3665 // The root entry object (effectively a try statement without a catch
3666 // or a finally block) gives us a place to store values thrown from
3667 // locations where there is no enclosing try statement.
3668 this.tryEntries = [{
3669 tryLoc: "root"
3670 }];
3671 tryLocsList.forEach(pushTryEntry, this);
3672 this.reset(true);
3673 }
3674
3675 exports.keys = function (object) {
3676 var keys = [];
3677
3678 for (var key in object) {
3679 keys.push(key);
3680 }
3681
3682 keys.reverse(); // Rather than returning an object with a next method, we keep
3683 // things simple and return the next function itself.
3684
3685 return function next() {
3686 while (keys.length) {
3687 var key = keys.pop();
3688
3689 if (key in object) {
3690 next.value = key;
3691 next.done = false;
3692 return next;
3693 }
3694 } // To avoid creating an additional object, we just hang the .value
3695 // and .done properties off the next function object itself. This
3696 // also ensures that the minifier will not anonymize the function.
3697
3698
3699 next.done = true;
3700 return next;
3701 };
3702 };
3703
3704 function values(iterable) {
3705 if (iterable) {
3706 var iteratorMethod = iterable[iteratorSymbol];
3707
3708 if (iteratorMethod) {
3709 return iteratorMethod.call(iterable);
3710 }
3711
3712 if (typeof iterable.next === "function") {
3713 return iterable;
3714 }
3715
3716 if (!isNaN(iterable.length)) {
3717 var i = -1,
3718 next = function next() {
3719 while (++i < iterable.length) {
3720 if (hasOwn.call(iterable, i)) {
3721 next.value = iterable[i];
3722 next.done = false;
3723 return next;
3724 }
3725 }
3726
3727 next.value = undefined;
3728 next.done = true;
3729 return next;
3730 };
3731
3732 return next.next = next;
3733 }
3734 } // Return an iterator with no values.
3735
3736
3737 return {
3738 next: doneResult
3739 };
3740 }
3741
3742 exports.values = values;
3743
3744 function doneResult() {
3745 return {
3746 value: undefined,
3747 done: true
3748 };
3749 }
3750
3751 Context.prototype = {
3752 constructor: Context,
3753 reset: function reset(skipTempReset) {
3754 this.prev = 0;
3755 this.next = 0; // Resetting context._sent for legacy support of Babel's
3756 // function.sent implementation.
3757
3758 this.sent = this._sent = undefined;
3759 this.done = false;
3760 this.delegate = null;
3761 this.method = "next";
3762 this.arg = undefined;
3763 this.tryEntries.forEach(resetTryEntry);
3764
3765 if (!skipTempReset) {
3766 for (var name in this) {
3767 // Not sure about the optimal order of these conditions:
3768 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
3769 this[name] = undefined;
3770 }
3771 }
3772 }
3773 },
3774 stop: function stop() {
3775 this.done = true;
3776 var rootEntry = this.tryEntries[0];
3777 var rootRecord = rootEntry.completion;
3778
3779 if (rootRecord.type === "throw") {
3780 throw rootRecord.arg;
3781 }
3782
3783 return this.rval;
3784 },
3785 dispatchException: function dispatchException(exception) {
3786 if (this.done) {
3787 throw exception;
3788 }
3789
3790 var context = this;
3791
3792 function handle(loc, caught) {
3793 record.type = "throw";
3794 record.arg = exception;
3795 context.next = loc;
3796
3797 if (caught) {
3798 // If the dispatched exception was caught by a catch block,
3799 // then let that catch block handle the exception normally.
3800 context.method = "next";
3801 context.arg = undefined;
3802 }
3803
3804 return !!caught;
3805 }
3806
3807 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3808 var entry = this.tryEntries[i];
3809 var record = entry.completion;
3810
3811 if (entry.tryLoc === "root") {
3812 // Exception thrown outside of any try block that could handle
3813 // it, so set the completion value of the entire function to
3814 // throw the exception.
3815 return handle("end");
3816 }
3817
3818 if (entry.tryLoc <= this.prev) {
3819 var hasCatch = hasOwn.call(entry, "catchLoc");
3820 var hasFinally = hasOwn.call(entry, "finallyLoc");
3821
3822 if (hasCatch && hasFinally) {
3823 if (this.prev < entry.catchLoc) {
3824 return handle(entry.catchLoc, true);
3825 } else if (this.prev < entry.finallyLoc) {
3826 return handle(entry.finallyLoc);
3827 }
3828 } else if (hasCatch) {
3829 if (this.prev < entry.catchLoc) {
3830 return handle(entry.catchLoc, true);
3831 }
3832 } else if (hasFinally) {
3833 if (this.prev < entry.finallyLoc) {
3834 return handle(entry.finallyLoc);
3835 }
3836 } else {
3837 throw new Error("try statement without catch or finally");
3838 }
3839 }
3840 }
3841 },
3842 abrupt: function abrupt(type, arg) {
3843 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3844 var entry = this.tryEntries[i];
3845
3846 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
3847 var finallyEntry = entry;
3848 break;
3849 }
3850 }
3851
3852 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
3853 // Ignore the finally entry if control is not jumping to a
3854 // location outside the try/catch block.
3855 finallyEntry = null;
3856 }
3857
3858 var record = finallyEntry ? finallyEntry.completion : {};
3859 record.type = type;
3860 record.arg = arg;
3861
3862 if (finallyEntry) {
3863 this.method = "next";
3864 this.next = finallyEntry.finallyLoc;
3865 return ContinueSentinel;
3866 }
3867
3868 return this.complete(record);
3869 },
3870 complete: function complete(record, afterLoc) {
3871 if (record.type === "throw") {
3872 throw record.arg;
3873 }
3874
3875 if (record.type === "break" || record.type === "continue") {
3876 this.next = record.arg;
3877 } else if (record.type === "return") {
3878 this.rval = this.arg = record.arg;
3879 this.method = "return";
3880 this.next = "end";
3881 } else if (record.type === "normal" && afterLoc) {
3882 this.next = afterLoc;
3883 }
3884
3885 return ContinueSentinel;
3886 },
3887 finish: function finish(finallyLoc) {
3888 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3889 var entry = this.tryEntries[i];
3890
3891 if (entry.finallyLoc === finallyLoc) {
3892 this.complete(entry.completion, entry.afterLoc);
3893 resetTryEntry(entry);
3894 return ContinueSentinel;
3895 }
3896 }
3897 },
3898 "catch": function _catch(tryLoc) {
3899 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3900 var entry = this.tryEntries[i];
3901
3902 if (entry.tryLoc === tryLoc) {
3903 var record = entry.completion;
3904
3905 if (record.type === "throw") {
3906 var thrown = record.arg;
3907 resetTryEntry(entry);
3908 }
3909
3910 return thrown;
3911 }
3912 } // The context.catch method must only be called with a location
3913 // argument that corresponds to a known catch block.
3914
3915
3916 throw new Error("illegal catch attempt");
3917 },
3918 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
3919 this.delegate = {
3920 iterator: values(iterable),
3921 resultName: resultName,
3922 nextLoc: nextLoc
3923 };
3924
3925 if (this.method === "next") {
3926 // Deliberately forget the last sent value so that we don't
3927 // accidentally pass it on to the delegate.
3928 this.arg = undefined;
3929 }
3930
3931 return ContinueSentinel;
3932 }
3933 }; // Regardless of whether this script is executing as a CommonJS module
3934 // or not, return the runtime object so that we can declare the variable
3935 // regeneratorRuntime in the outer scope, which allows this module to be
3936 // injected easily by `bin/regenerator --include-runtime script.js`.
3937
3938 return exports;
3939 }( // If this script is executing as a CommonJS module, use module.exports
3940 // as the regeneratorRuntime namespace. Otherwise create a new empty
3941 // object. Either way, the resulting object will be used to initialize
3942 // the regeneratorRuntime variable at the top of this file.
3943 ( false ? undefined : _typeof(module)) === "object" ? module.exports : {});
3944
3945 try {
3946 regeneratorRuntime = runtime;
3947 } catch (accidentalStrictMode) {
3948 // This module should not be running in strict mode, so the above
3949 // assignment should always work unless something is misconfigured. Just
3950 // in case runtime.js accidentally runs in strict mode, we can escape
3951 // strict mode using a global Function call. This could conceivably fail
3952 // if a Content Security Policy forbids using Function, but in that case
3953 // the proper solution is to fix the accidental strict mode problem. If
3954 // you've misconfigured your bundler to force strict mode and applied a
3955 // CSP to forbid Function, and you're not willing to fix either of those
3956 // problems, please detail your unique predicament in a GitHub issue.
3957 Function("r", "regeneratorRuntime = r")(runtime);
3958 }
3959 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
3960
3961 /***/ }),
3962
3963 /***/ "./node_modules/webpack/buildin/global.js":
3964 /*!***********************************!*\
3965 !*** (webpack)/buildin/global.js ***!
3966 \***********************************/
3967 /*! no static exports found */
3968 /***/ (function(module, exports) {
3969
3970 function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3971
3972 var g; // This works in non-strict mode
3973
3974 g = function () {
3975 return this;
3976 }();
3977
3978 try {
3979 // This works if eval is allowed (see CSP)
3980 g = g || new Function("return this")();
3981 } catch (e) {
3982 // This works if the window reference is available
3983 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
3984 } // g can still be undefined, but nothing to do about it...
3985 // We return undefined, instead of nothing here, so it's
3986 // easier to handle this case. if(!global) { ...}
3987
3988
3989 module.exports = g;
3990
3991 /***/ }),
3992
3993 /***/ "./node_modules/webpack/buildin/module.js":
3994 /*!***********************************!*\
3995 !*** (webpack)/buildin/module.js ***!
3996 \***********************************/
3997 /*! no static exports found */
3998 /***/ (function(module, exports) {
3999
4000 module.exports = function (module) {
4001 if (!module.webpackPolyfill) {
4002 module.deprecate = function () {};
4003
4004 module.paths = []; // module.parent = undefined by default
4005
4006 if (!module.children) module.children = [];
4007 Object.defineProperty(module, "loaded", {
4008 enumerable: true,
4009 get: function get() {
4010 return module.l;
4011 }
4012 });
4013 Object.defineProperty(module, "id", {
4014 enumerable: true,
4015 get: function get() {
4016 return module.i;
4017 }
4018 });
4019 module.webpackPolyfill = 1;
4020 }
4021
4022 return module;
4023 };
4024
4025 /***/ }),
4026
4027 /***/ 0:
4028 /*!*****************************************************!*\
4029 !*** multi es6-promise-promise ./js/scripts_es6.js ***!
4030 \*****************************************************/
4031 /*! no static exports found */
4032 /***/ (function(module, exports, __webpack_require__) {
4033
4034 __webpack_require__(/*! es6-promise-promise */"./node_modules/es6-promise-promise/index.js");
4035 module.exports = __webpack_require__(/*! ./js/scripts_es6.js */"./js/scripts_es6.js");
4036
4037
4038 /***/ }),
4039
4040 /***/ 1:
4041 /*!***********************!*\
4042 !*** vertx (ignored) ***!
4043 \***********************/
4044 /*! no static exports found */
4045 /***/ (function(module, exports) {
4046
4047 /* (ignored) */
4048
4049 /***/ })
4050
4051 /******/ });
4052 //# sourceMappingURL=scripts.js.map