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