Version Description
- Fix - Additional security for AJAX calls
Download this release
Release Info
Developer | mailerlite |
Plugin | Official MailerLite Sign Up Forms |
Version | 1.4.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 1.4.5
- assets/js/block.build.js +12373 -10204
assets/js/block.build.js
CHANGED
@@ -60,45 +60,18 @@
|
|
60 |
/******/ __webpack_require__.p = "";
|
61 |
/******/
|
62 |
/******/ // Load entry module and return exports
|
63 |
-
/******/ return __webpack_require__(__webpack_require__.s =
|
64 |
/******/ })
|
65 |
/************************************************************************/
|
66 |
/******/ ([
|
67 |
/* 0 */
|
68 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
69 |
-
|
70 |
-
"use strict";
|
71 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__react__ = __webpack_require__(79);
|
72 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["a"]; });
|
73 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["b"]; });
|
74 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["c"]; });
|
75 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["e"]; });
|
76 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["f"]; });
|
77 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["g"]; });
|
78 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["h"]; });
|
79 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["i"]; });
|
80 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["j"]; });
|
81 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["k"]; });
|
82 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react_platform__ = __webpack_require__(363);
|
83 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react_platform__["a"]; });
|
84 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(371);
|
85 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2__utils__["a"]; });
|
86 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__serialize__ = __webpack_require__(372);
|
87 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_3__serialize__["a"]; });
|
88 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__raw_html__ = __webpack_require__(108);
|
89 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_4__raw_html__["a"]; });
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
//# sourceMappingURL=index.js.map
|
96 |
-
|
97 |
-
/***/ }),
|
98 |
-
/* 1 */
|
99 |
/***/ (function(module, exports, __webpack_require__) {
|
100 |
|
101 |
/* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
|
|
|
|
|
|
|
|
|
102 |
|
103 |
;(function (global, factory) {
|
104 |
true ? module.exports = factory() :
|
@@ -108,33 +81,43 @@
|
|
108 |
|
109 |
var hookCallback;
|
110 |
|
111 |
-
function hooks
|
112 |
return hookCallback.apply(null, arguments);
|
113 |
}
|
114 |
|
115 |
// This is done to register the method called with moment()
|
116 |
// without creating circular dependencies.
|
117 |
-
function setHookCallback
|
118 |
hookCallback = callback;
|
119 |
}
|
120 |
|
121 |
function isArray(input) {
|
122 |
-
return
|
|
|
|
|
|
|
123 |
}
|
124 |
|
125 |
function isObject(input) {
|
126 |
// IE8 will treat undefined and null as object if it wasn't for
|
127 |
// input != null
|
128 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
|
131 |
function isObjectEmpty(obj) {
|
132 |
if (Object.getOwnPropertyNames) {
|
133 |
-
return
|
134 |
} else {
|
135 |
var k;
|
136 |
for (k in obj) {
|
137 |
-
if (obj
|
138 |
return false;
|
139 |
}
|
140 |
}
|
@@ -147,25 +130,28 @@
|
|
147 |
}
|
148 |
|
149 |
function isNumber(input) {
|
150 |
-
return
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
function isDate(input) {
|
154 |
-
return
|
|
|
|
|
|
|
155 |
}
|
156 |
|
157 |
function map(arr, fn) {
|
158 |
-
var res = [],
|
|
|
159 |
for (i = 0; i < arr.length; ++i) {
|
160 |
res.push(fn(arr[i], i));
|
161 |
}
|
162 |
return res;
|
163 |
}
|
164 |
|
165 |
-
function hasOwnProp(a, b) {
|
166 |
-
return Object.prototype.hasOwnProperty.call(a, b);
|
167 |
-
}
|
168 |
-
|
169 |
function extend(a, b) {
|
170 |
for (var i in b) {
|
171 |
if (hasOwnProp(b, i)) {
|
@@ -184,27 +170,29 @@
|
|
184 |
return a;
|
185 |
}
|
186 |
|
187 |
-
function createUTC
|
188 |
return createLocalOrUTC(input, format, locale, strict, true).utc();
|
189 |
}
|
190 |
|
191 |
function defaultParsingFlags() {
|
192 |
// We need to deep clone this object.
|
193 |
return {
|
194 |
-
empty
|
195 |
-
unusedTokens
|
196 |
-
unusedInput
|
197 |
-
overflow
|
198 |
-
charsLeftOver
|
199 |
-
nullInput
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
208 |
};
|
209 |
}
|
210 |
|
@@ -220,10 +208,11 @@
|
|
220 |
some = Array.prototype.some;
|
221 |
} else {
|
222 |
some = function (fun) {
|
223 |
-
var t = Object(this)
|
224 |
-
|
|
|
225 |
|
226 |
-
for (
|
227 |
if (i in t && fun.call(this, t[i], i, t)) {
|
228 |
return true;
|
229 |
}
|
@@ -235,23 +224,26 @@
|
|
235 |
|
236 |
function isValid(m) {
|
237 |
if (m._isValid == null) {
|
238 |
-
var flags = getParsingFlags(m)
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
|
|
|
|
252 |
|
253 |
if (m._strict) {
|
254 |
-
isNowValid =
|
|
|
255 |
flags.charsLeftOver === 0 &&
|
256 |
flags.unusedTokens.length === 0 &&
|
257 |
flags.bigHour === undefined;
|
@@ -259,20 +251,18 @@
|
|
259 |
|
260 |
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
261 |
m._isValid = isNowValid;
|
262 |
-
}
|
263 |
-
else {
|
264 |
return isNowValid;
|
265 |
}
|
266 |
}
|
267 |
return m._isValid;
|
268 |
}
|
269 |
|
270 |
-
function createInvalid
|
271 |
var m = createUTC(NaN);
|
272 |
if (flags != null) {
|
273 |
extend(getParsingFlags(m), flags);
|
274 |
-
}
|
275 |
-
else {
|
276 |
getParsingFlags(m).userInvalidated = true;
|
277 |
}
|
278 |
|
@@ -281,7 +271,8 @@
|
|
281 |
|
282 |
// Plugins that add properties should also add the key here (null value),
|
283 |
// so we can properly clone ourselves.
|
284 |
-
var momentProperties = hooks.momentProperties = []
|
|
|
285 |
|
286 |
function copyConfig(to, from) {
|
287 |
var i, prop, val;
|
@@ -330,8 +321,6 @@
|
|
330 |
return to;
|
331 |
}
|
332 |
|
333 |
-
var updateInProgress = false;
|
334 |
-
|
335 |
// Moment prototype object
|
336 |
function Moment(config) {
|
337 |
copyConfig(this, config);
|
@@ -348,48 +337,18 @@
|
|
348 |
}
|
349 |
}
|
350 |
|
351 |
-
function isMoment
|
352 |
-
return
|
353 |
-
|
354 |
-
|
355 |
-
function absFloor (number) {
|
356 |
-
if (number < 0) {
|
357 |
-
// -0 -> 0
|
358 |
-
return Math.ceil(number) || 0;
|
359 |
-
} else {
|
360 |
-
return Math.floor(number);
|
361 |
-
}
|
362 |
-
}
|
363 |
-
|
364 |
-
function toInt(argumentForCoercion) {
|
365 |
-
var coercedNumber = +argumentForCoercion,
|
366 |
-
value = 0;
|
367 |
-
|
368 |
-
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
369 |
-
value = absFloor(coercedNumber);
|
370 |
-
}
|
371 |
-
|
372 |
-
return value;
|
373 |
-
}
|
374 |
-
|
375 |
-
// compare two arrays, return the number of differences
|
376 |
-
function compareArrays(array1, array2, dontConvert) {
|
377 |
-
var len = Math.min(array1.length, array2.length),
|
378 |
-
lengthDiff = Math.abs(array1.length - array2.length),
|
379 |
-
diffs = 0,
|
380 |
-
i;
|
381 |
-
for (i = 0; i < len; i++) {
|
382 |
-
if ((dontConvert && array1[i] !== array2[i]) ||
|
383 |
-
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
|
384 |
-
diffs++;
|
385 |
-
}
|
386 |
-
}
|
387 |
-
return diffs + lengthDiff;
|
388 |
}
|
389 |
|
390 |
function warn(msg) {
|
391 |
-
if (
|
392 |
-
|
|
|
|
|
|
|
393 |
console.warn('Deprecation warning: ' + msg);
|
394 |
}
|
395 |
}
|
@@ -402,14 +361,18 @@
|
|
402 |
hooks.deprecationHandler(null, msg);
|
403 |
}
|
404 |
if (firstTime) {
|
405 |
-
var args = []
|
406 |
-
|
407 |
-
|
|
|
|
|
408 |
arg = '';
|
409 |
if (typeof arguments[i] === 'object') {
|
410 |
arg += '\n[' + i + '] ';
|
411 |
-
for (
|
412 |
-
|
|
|
|
|
413 |
}
|
414 |
arg = arg.slice(0, -2); // Remove trailing comma and space
|
415 |
} else {
|
@@ -417,7 +380,13 @@
|
|
417 |
}
|
418 |
args.push(arg);
|
419 |
}
|
420 |
-
warn(
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
firstTime = false;
|
422 |
}
|
423 |
return fn.apply(this, arguments);
|
@@ -440,17 +409,22 @@
|
|
440 |
hooks.deprecationHandler = null;
|
441 |
|
442 |
function isFunction(input) {
|
443 |
-
return
|
|
|
|
|
|
|
444 |
}
|
445 |
|
446 |
-
function set
|
447 |
var prop, i;
|
448 |
for (i in config) {
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
|
|
|
|
454 |
}
|
455 |
}
|
456 |
this._config = config;
|
@@ -459,11 +433,14 @@
|
|
459 |
// TODO: Remove "ordinalParse" fallback in next major release.
|
460 |
this._dayOfMonthOrdinalParseLenient = new RegExp(
|
461 |
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
|
462 |
-
'|' +
|
|
|
|
|
463 |
}
|
464 |
|
465 |
function mergeConfigs(parentConfig, childConfig) {
|
466 |
-
var res = extend({}, parentConfig),
|
|
|
467 |
for (prop in childConfig) {
|
468 |
if (hasOwnProp(childConfig, prop)) {
|
469 |
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
@@ -478,9 +455,11 @@
|
|
478 |
}
|
479 |
}
|
480 |
for (prop in parentConfig) {
|
481 |
-
if (
|
482 |
-
|
483 |
-
|
|
|
|
|
484 |
// make sure changes to properties don't modify parent config
|
485 |
res[prop] = extend({}, res[prop]);
|
486 |
}
|
@@ -500,7 +479,8 @@
|
|
500 |
keys = Object.keys;
|
501 |
} else {
|
502 |
keys = function (obj) {
|
503 |
-
var i,
|
|
|
504 |
for (i in obj) {
|
505 |
if (hasOwnProp(obj, i)) {
|
506 |
res.push(i);
|
@@ -511,151 +491,40 @@
|
|
511 |
}
|
512 |
|
513 |
var defaultCalendar = {
|
514 |
-
sameDay
|
515 |
-
nextDay
|
516 |
-
nextWeek
|
517 |
-
lastDay
|
518 |
-
lastWeek
|
519 |
-
sameElse
|
520 |
};
|
521 |
|
522 |
-
function calendar
|
523 |
var output = this._calendar[key] || this._calendar['sameElse'];
|
524 |
return isFunction(output) ? output.call(mom, now) : output;
|
525 |
}
|
526 |
|
527 |
-
var defaultLongDateFormat = {
|
528 |
-
LTS : 'h:mm:ss A',
|
529 |
-
LT : 'h:mm A',
|
530 |
-
L : 'MM/DD/YYYY',
|
531 |
-
LL : 'MMMM D, YYYY',
|
532 |
-
LLL : 'MMMM D, YYYY h:mm A',
|
533 |
-
LLLL : 'dddd, MMMM D, YYYY h:mm A'
|
534 |
-
};
|
535 |
-
|
536 |
-
function longDateFormat (key) {
|
537 |
-
var format = this._longDateFormat[key],
|
538 |
-
formatUpper = this._longDateFormat[key.toUpperCase()];
|
539 |
-
|
540 |
-
if (format || !formatUpper) {
|
541 |
-
return format;
|
542 |
-
}
|
543 |
-
|
544 |
-
this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
|
545 |
-
return val.slice(1);
|
546 |
-
});
|
547 |
-
|
548 |
-
return this._longDateFormat[key];
|
549 |
-
}
|
550 |
-
|
551 |
-
var defaultInvalidDate = 'Invalid date';
|
552 |
-
|
553 |
-
function invalidDate () {
|
554 |
-
return this._invalidDate;
|
555 |
-
}
|
556 |
-
|
557 |
-
var defaultOrdinal = '%d';
|
558 |
-
var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
559 |
-
|
560 |
-
function ordinal (number) {
|
561 |
-
return this._ordinal.replace('%d', number);
|
562 |
-
}
|
563 |
-
|
564 |
-
var defaultRelativeTime = {
|
565 |
-
future : 'in %s',
|
566 |
-
past : '%s ago',
|
567 |
-
s : 'a few seconds',
|
568 |
-
ss : '%d seconds',
|
569 |
-
m : 'a minute',
|
570 |
-
mm : '%d minutes',
|
571 |
-
h : 'an hour',
|
572 |
-
hh : '%d hours',
|
573 |
-
d : 'a day',
|
574 |
-
dd : '%d days',
|
575 |
-
M : 'a month',
|
576 |
-
MM : '%d months',
|
577 |
-
y : 'a year',
|
578 |
-
yy : '%d years'
|
579 |
-
};
|
580 |
-
|
581 |
-
function relativeTime (number, withoutSuffix, string, isFuture) {
|
582 |
-
var output = this._relativeTime[string];
|
583 |
-
return (isFunction(output)) ?
|
584 |
-
output(number, withoutSuffix, string, isFuture) :
|
585 |
-
output.replace(/%d/i, number);
|
586 |
-
}
|
587 |
-
|
588 |
-
function pastFuture (diff, output) {
|
589 |
-
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
590 |
-
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
591 |
-
}
|
592 |
-
|
593 |
-
var aliases = {};
|
594 |
-
|
595 |
-
function addUnitAlias (unit, shorthand) {
|
596 |
-
var lowerCase = unit.toLowerCase();
|
597 |
-
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
|
598 |
-
}
|
599 |
-
|
600 |
-
function normalizeUnits(units) {
|
601 |
-
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
|
602 |
-
}
|
603 |
-
|
604 |
-
function normalizeObjectUnits(inputObject) {
|
605 |
-
var normalizedInput = {},
|
606 |
-
normalizedProp,
|
607 |
-
prop;
|
608 |
-
|
609 |
-
for (prop in inputObject) {
|
610 |
-
if (hasOwnProp(inputObject, prop)) {
|
611 |
-
normalizedProp = normalizeUnits(prop);
|
612 |
-
if (normalizedProp) {
|
613 |
-
normalizedInput[normalizedProp] = inputObject[prop];
|
614 |
-
}
|
615 |
-
}
|
616 |
-
}
|
617 |
-
|
618 |
-
return normalizedInput;
|
619 |
-
}
|
620 |
-
|
621 |
-
var priorities = {};
|
622 |
-
|
623 |
-
function addUnitPriority(unit, priority) {
|
624 |
-
priorities[unit] = priority;
|
625 |
-
}
|
626 |
-
|
627 |
-
function getPrioritizedUnits(unitsObj) {
|
628 |
-
var units = [];
|
629 |
-
for (var u in unitsObj) {
|
630 |
-
units.push({unit: u, priority: priorities[u]});
|
631 |
-
}
|
632 |
-
units.sort(function (a, b) {
|
633 |
-
return a.priority - b.priority;
|
634 |
-
});
|
635 |
-
return units;
|
636 |
-
}
|
637 |
-
|
638 |
function zeroFill(number, targetLength, forceSign) {
|
639 |
var absNumber = '' + Math.abs(number),
|
640 |
zerosToFill = targetLength - absNumber.length,
|
641 |
sign = number >= 0;
|
642 |
-
return (
|
643 |
-
|
|
|
|
|
|
|
644 |
}
|
645 |
|
646 |
-
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
var formatFunctions = {};
|
651 |
-
|
652 |
-
var formatTokenFunctions = {};
|
653 |
|
654 |
// token: 'M'
|
655 |
// padded: ['MM', 2]
|
656 |
// ordinal: 'Mo'
|
657 |
// callback: function () { this.month() + 1 }
|
658 |
-
function addFormatToken
|
659 |
var func = callback;
|
660 |
if (typeof callback === 'string') {
|
661 |
func = function () {
|
@@ -672,7 +541,10 @@
|
|
672 |
}
|
673 |
if (ordinal) {
|
674 |
formatTokenFunctions[ordinal] = function () {
|
675 |
-
return this.localeData().ordinal(
|
|
|
|
|
|
|
676 |
};
|
677 |
}
|
678 |
}
|
@@ -685,7 +557,9 @@
|
|
685 |
}
|
686 |
|
687 |
function makeFormatFunction(format) {
|
688 |
-
var array = format.match(formattingTokens),
|
|
|
|
|
689 |
|
690 |
for (i = 0, length = array.length; i < length; i++) {
|
691 |
if (formatTokenFunctions[array[i]]) {
|
@@ -696,9 +570,12 @@
|
|
696 |
}
|
697 |
|
698 |
return function (mom) {
|
699 |
-
var output = '',
|
|
|
700 |
for (i = 0; i < length; i++) {
|
701 |
-
output += isFunction(array[i])
|
|
|
|
|
702 |
}
|
703 |
return output;
|
704 |
};
|
@@ -711,7 +588,8 @@
|
|
711 |
}
|
712 |
|
713 |
format = expandFormat(format, m.localeData());
|
714 |
-
formatFunctions[format] =
|
|
|
715 |
|
716 |
return formatFunctions[format](m);
|
717 |
}
|
@@ -725,7 +603,10 @@
|
|
725 |
|
726 |
localFormattingTokens.lastIndex = 0;
|
727 |
while (i >= 0 && localFormattingTokens.test(format)) {
|
728 |
-
format = format.replace(
|
|
|
|
|
|
|
729 |
localFormattingTokens.lastIndex = 0;
|
730 |
i -= 1;
|
731 |
}
|
@@ -733,164 +614,160 @@
|
|
733 |
return format;
|
734 |
}
|
735 |
|
736 |
-
var
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
var match1to3 = /\d{1,3}/; // 0 - 999
|
745 |
-
var match1to4 = /\d{1,4}/; // 0 - 9999
|
746 |
-
var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
|
747 |
-
|
748 |
-
var matchUnsigned = /\d+/; // 0 - inf
|
749 |
-
var matchSigned = /[+-]?\d+/; // -inf - inf
|
750 |
-
|
751 |
-
var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
|
752 |
-
var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
|
753 |
|
754 |
-
|
|
|
|
|
755 |
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
|
760 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
761 |
|
762 |
-
|
763 |
-
regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
|
764 |
-
return (isStrict && strictRegex) ? strictRegex : regex;
|
765 |
-
};
|
766 |
}
|
767 |
|
768 |
-
|
769 |
-
if (!hasOwnProp(regexes, token)) {
|
770 |
-
return new RegExp(unescapeFormat(token));
|
771 |
-
}
|
772 |
|
773 |
-
|
|
|
774 |
}
|
775 |
|
776 |
-
|
777 |
-
|
778 |
-
return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
|
779 |
-
return p1 || p2 || p3 || p4;
|
780 |
-
}));
|
781 |
-
}
|
782 |
|
783 |
-
function
|
784 |
-
return
|
785 |
}
|
786 |
|
787 |
-
var
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
|
|
|
|
803 |
|
804 |
-
function
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
}
|
810 |
|
811 |
-
function
|
812 |
-
|
813 |
-
|
814 |
-
}
|
815 |
}
|
816 |
|
817 |
-
var
|
818 |
-
var MONTH = 1;
|
819 |
-
var DATE = 2;
|
820 |
-
var HOUR = 3;
|
821 |
-
var MINUTE = 4;
|
822 |
-
var SECOND = 5;
|
823 |
-
var MILLISECOND = 6;
|
824 |
-
var WEEK = 7;
|
825 |
-
var WEEKDAY = 8;
|
826 |
-
|
827 |
-
// FORMATTING
|
828 |
-
|
829 |
-
addFormatToken('Y', 0, 0, function () {
|
830 |
-
var y = this.year();
|
831 |
-
return y <= 9999 ? '' + y : '+' + y;
|
832 |
-
});
|
833 |
-
|
834 |
-
addFormatToken(0, ['YY', 2], 0, function () {
|
835 |
-
return this.year() % 100;
|
836 |
-
});
|
837 |
-
|
838 |
-
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
839 |
-
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
840 |
-
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
841 |
-
|
842 |
-
// ALIASES
|
843 |
|
844 |
-
addUnitAlias(
|
|
|
|
|
|
|
845 |
|
846 |
-
|
|
|
|
|
|
|
|
|
847 |
|
848 |
-
|
|
|
|
|
|
|
849 |
|
850 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
851 |
|
852 |
-
|
853 |
-
|
854 |
-
addRegexToken('YYYY', match1to4, match4);
|
855 |
-
addRegexToken('YYYYY', match1to6, match6);
|
856 |
-
addRegexToken('YYYYYY', match1to6, match6);
|
857 |
|
858 |
-
|
859 |
-
addParseToken('YYYY', function (input, array) {
|
860 |
-
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
861 |
-
});
|
862 |
-
addParseToken('YY', function (input, array) {
|
863 |
-
array[YEAR] = hooks.parseTwoDigitYear(input);
|
864 |
-
});
|
865 |
-
addParseToken('Y', function (input, array) {
|
866 |
-
array[YEAR] = parseInt(input, 10);
|
867 |
-
});
|
868 |
|
869 |
-
|
|
|
|
|
870 |
|
871 |
-
function
|
872 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
873 |
}
|
874 |
|
875 |
function isLeapYear(year) {
|
876 |
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
877 |
}
|
878 |
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
|
|
|
|
|
|
884 |
|
885 |
-
|
|
|
|
|
886 |
|
887 |
-
|
|
|
|
|
888 |
|
889 |
-
|
890 |
-
return isLeapYear(this.year());
|
891 |
}
|
892 |
|
893 |
-
function makeGetSet
|
894 |
return function (value) {
|
895 |
if (value != null) {
|
896 |
set$1(this, unit, value);
|
@@ -902,17 +779,27 @@
|
|
902 |
};
|
903 |
}
|
904 |
|
905 |
-
function get
|
906 |
-
return mom.isValid()
|
907 |
-
mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
|
|
|
908 |
}
|
909 |
|
910 |
-
function set$1
|
911 |
if (mom.isValid() && !isNaN(value)) {
|
912 |
-
if (
|
913 |
-
|
914 |
-
|
915 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
916 |
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
917 |
}
|
918 |
}
|
@@ -920,7 +807,7 @@
|
|
920 |
|
921 |
// MOMENTS
|
922 |
|
923 |
-
function stringGet
|
924 |
units = normalizeUnits(units);
|
925 |
if (isFunction(this[units])) {
|
926 |
return this[units]();
|
@@ -928,12 +815,12 @@
|
|
928 |
return this;
|
929 |
}
|
930 |
|
931 |
-
|
932 |
-
function stringSet (units, value) {
|
933 |
if (typeof units === 'object') {
|
934 |
units = normalizeObjectUnits(units);
|
935 |
-
var prioritized = getPrioritizedUnits(units)
|
936 |
-
|
|
|
937 |
this[prioritized[i].unit](units[prioritized[i].unit]);
|
938 |
}
|
939 |
} else {
|
@@ -945,6 +832,107 @@
|
|
945 |
return this;
|
946 |
}
|
947 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
948 |
function mod(n, x) {
|
949 |
return ((n % x) + x) % x;
|
950 |
}
|
@@ -972,7 +960,11 @@
|
|
972 |
}
|
973 |
var modMonth = mod(month, 12);
|
974 |
year += (month - modMonth) / 12;
|
975 |
-
return modMonth === 1
|
|
|
|
|
|
|
|
|
976 |
}
|
977 |
|
978 |
// FORMATTING
|
@@ -999,9 +991,9 @@
|
|
999 |
|
1000 |
// PARSING
|
1001 |
|
1002 |
-
addRegexToken('M',
|
1003 |
-
addRegexToken('MM',
|
1004 |
-
addRegexToken('MMM',
|
1005 |
return locale.monthsShortRegex(isStrict);
|
1006 |
});
|
1007 |
addRegexToken('MMMM', function (isStrict, locale) {
|
@@ -1024,29 +1016,49 @@
|
|
1024 |
|
1025 |
// LOCALES
|
1026 |
|
1027 |
-
var
|
1028 |
-
|
1029 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1030 |
if (!m) {
|
1031 |
-
return isArray(this._months)
|
1032 |
-
this._months
|
|
|
1033 |
}
|
1034 |
-
return isArray(this._months)
|
1035 |
-
this._months[
|
|
|
|
|
|
|
|
|
|
|
1036 |
}
|
1037 |
|
1038 |
-
|
1039 |
-
function localeMonthsShort (m, format) {
|
1040 |
if (!m) {
|
1041 |
-
return isArray(this._monthsShort)
|
1042 |
-
this._monthsShort
|
|
|
1043 |
}
|
1044 |
-
return isArray(this._monthsShort)
|
1045 |
-
this._monthsShort[
|
|
|
|
|
|
|
1046 |
}
|
1047 |
|
1048 |
function handleStrictParse(monthName, format, strict) {
|
1049 |
-
var i,
|
|
|
|
|
|
|
1050 |
if (!this._monthsParse) {
|
1051 |
// this is not used
|
1052 |
this._monthsParse = [];
|
@@ -1054,7 +1066,10 @@
|
|
1054 |
this._shortMonthsParse = [];
|
1055 |
for (i = 0; i < 12; ++i) {
|
1056 |
mom = createUTC([2000, i]);
|
1057 |
-
this._shortMonthsParse[i] = this.monthsShort(
|
|
|
|
|
|
|
1058 |
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
|
1059 |
}
|
1060 |
}
|
@@ -1086,7 +1101,7 @@
|
|
1086 |
}
|
1087 |
}
|
1088 |
|
1089 |
-
function localeMonthsParse
|
1090 |
var i, mom, regex;
|
1091 |
|
1092 |
if (this._monthsParseExact) {
|
@@ -1106,17 +1121,32 @@
|
|
1106 |
// make the regex if we don't have it already
|
1107 |
mom = createUTC([2000, i]);
|
1108 |
if (strict && !this._longMonthsParse[i]) {
|
1109 |
-
this._longMonthsParse[i] = new RegExp(
|
1110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1111 |
}
|
1112 |
if (!strict && !this._monthsParse[i]) {
|
1113 |
-
regex =
|
|
|
1114 |
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
1115 |
}
|
1116 |
// test the regex
|
1117 |
-
if (
|
|
|
|
|
|
|
|
|
1118 |
return i;
|
1119 |
-
} else if (
|
|
|
|
|
|
|
|
|
1120 |
return i;
|
1121 |
} else if (!strict && this._monthsParse[i].test(monthName)) {
|
1122 |
return i;
|
@@ -1126,7 +1156,7 @@
|
|
1126 |
|
1127 |
// MOMENTS
|
1128 |
|
1129 |
-
function setMonth
|
1130 |
var dayOfMonth;
|
1131 |
|
1132 |
if (!mom.isValid()) {
|
@@ -1151,7 +1181,7 @@
|
|
1151 |
return mom;
|
1152 |
}
|
1153 |
|
1154 |
-
function getSetMonth
|
1155 |
if (value != null) {
|
1156 |
setMonth(this, value);
|
1157 |
hooks.updateOffset(this, true);
|
@@ -1161,12 +1191,11 @@
|
|
1161 |
}
|
1162 |
}
|
1163 |
|
1164 |
-
function getDaysInMonth
|
1165 |
return daysInMonth(this.year(), this.month());
|
1166 |
}
|
1167 |
|
1168 |
-
|
1169 |
-
function monthsShortRegex (isStrict) {
|
1170 |
if (this._monthsParseExact) {
|
1171 |
if (!hasOwnProp(this, '_monthsRegex')) {
|
1172 |
computeMonthsParse.call(this);
|
@@ -1180,13 +1209,13 @@
|
|
1180 |
if (!hasOwnProp(this, '_monthsShortRegex')) {
|
1181 |
this._monthsShortRegex = defaultMonthsShortRegex;
|
1182 |
}
|
1183 |
-
return this._monthsShortStrictRegex && isStrict
|
1184 |
-
this._monthsShortStrictRegex
|
|
|
1185 |
}
|
1186 |
}
|
1187 |
|
1188 |
-
|
1189 |
-
function monthsRegex (isStrict) {
|
1190 |
if (this._monthsParseExact) {
|
1191 |
if (!hasOwnProp(this, '_monthsRegex')) {
|
1192 |
computeMonthsParse.call(this);
|
@@ -1200,18 +1229,22 @@
|
|
1200 |
if (!hasOwnProp(this, '_monthsRegex')) {
|
1201 |
this._monthsRegex = defaultMonthsRegex;
|
1202 |
}
|
1203 |
-
return this._monthsStrictRegex && isStrict
|
1204 |
-
this._monthsStrictRegex
|
|
|
1205 |
}
|
1206 |
}
|
1207 |
|
1208 |
-
function computeMonthsParse
|
1209 |
function cmpLenRev(a, b) {
|
1210 |
return b.length - a.length;
|
1211 |
}
|
1212 |
|
1213 |
-
var shortPieces = [],
|
1214 |
-
|
|
|
|
|
|
|
1215 |
for (i = 0; i < 12; i++) {
|
1216 |
// make the regex if we don't have it already
|
1217 |
mom = createUTC([2000, i]);
|
@@ -1235,29 +1268,112 @@
|
|
1235 |
|
1236 |
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
1237 |
this._monthsShortRegex = this._monthsRegex;
|
1238 |
-
this._monthsStrictRegex = new RegExp(
|
1239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1240 |
}
|
1241 |
|
1242 |
-
function createDate
|
1243 |
// can't just apply() to create a date:
|
1244 |
// https://stackoverflow.com/q/181348
|
1245 |
-
var date
|
1246 |
-
|
1247 |
// the date constructor remaps years 0-99 to 1900-1999
|
1248 |
-
if (y < 100 && y >= 0
|
1249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1250 |
}
|
|
|
1251 |
return date;
|
1252 |
}
|
1253 |
|
1254 |
-
function createUTCDate
|
1255 |
-
var date
|
1256 |
-
|
1257 |
// the Date.UTC function remaps years 0-99 to 1900-1999
|
1258 |
-
if (y < 100 && y >= 0
|
1259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1260 |
}
|
|
|
1261 |
return date;
|
1262 |
}
|
1263 |
|
@@ -1276,7 +1392,8 @@
|
|
1276 |
var localWeekday = (7 + weekday - dow) % 7,
|
1277 |
weekOffset = firstWeekOffset(year, dow, doy),
|
1278 |
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
|
1279 |
-
resYear,
|
|
|
1280 |
|
1281 |
if (dayOfYear <= 0) {
|
1282 |
resYear = year - 1;
|
@@ -1291,14 +1408,15 @@
|
|
1291 |
|
1292 |
return {
|
1293 |
year: resYear,
|
1294 |
-
dayOfYear: resDayOfYear
|
1295 |
};
|
1296 |
}
|
1297 |
|
1298 |
function weekOfYear(mom, dow, doy) {
|
1299 |
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
|
1300 |
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
|
1301 |
-
resWeek,
|
|
|
1302 |
|
1303 |
if (week < 1) {
|
1304 |
resYear = mom.year() - 1;
|
@@ -1313,7 +1431,7 @@
|
|
1313 |
|
1314 |
return {
|
1315 |
week: resWeek,
|
1316 |
-
year: resYear
|
1317 |
};
|
1318 |
}
|
1319 |
|
@@ -1340,12 +1458,17 @@
|
|
1340 |
|
1341 |
// PARSING
|
1342 |
|
1343 |
-
addRegexToken('w',
|
1344 |
addRegexToken('ww', match1to2, match2);
|
1345 |
-
addRegexToken('W',
|
1346 |
addRegexToken('WW', match1to2, match2);
|
1347 |
|
1348 |
-
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
|
|
|
|
|
|
|
|
|
|
|
1349 |
week[token.substr(0, 1)] = toInt(input);
|
1350 |
});
|
1351 |
|
@@ -1353,31 +1476,31 @@
|
|
1353 |
|
1354 |
// LOCALES
|
1355 |
|
1356 |
-
function localeWeek
|
1357 |
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
1358 |
}
|
1359 |
|
1360 |
var defaultLocaleWeek = {
|
1361 |
-
dow
|
1362 |
-
doy
|
1363 |
};
|
1364 |
|
1365 |
-
function localeFirstDayOfWeek
|
1366 |
return this._week.dow;
|
1367 |
}
|
1368 |
|
1369 |
-
function localeFirstDayOfYear
|
1370 |
return this._week.doy;
|
1371 |
}
|
1372 |
|
1373 |
// MOMENTS
|
1374 |
|
1375 |
-
function getSetWeek
|
1376 |
var week = this.localeData().week(this);
|
1377 |
return input == null ? week : this.add((input - week) * 7, 'd');
|
1378 |
}
|
1379 |
|
1380 |
-
function getSetISOWeek
|
1381 |
var week = weekOfYear(this, 1, 4).week;
|
1382 |
return input == null ? week : this.add((input - week) * 7, 'd');
|
1383 |
}
|
@@ -1414,16 +1537,16 @@
|
|
1414 |
|
1415 |
// PARSING
|
1416 |
|
1417 |
-
addRegexToken('d',
|
1418 |
-
addRegexToken('e',
|
1419 |
-
addRegexToken('E',
|
1420 |
-
addRegexToken('dd',
|
1421 |
return locale.weekdaysMinRegex(isStrict);
|
1422 |
});
|
1423 |
-
addRegexToken('ddd',
|
1424 |
return locale.weekdaysShortRegex(isStrict);
|
1425 |
});
|
1426 |
-
addRegexToken('dddd',
|
1427 |
return locale.weekdaysRegex(isStrict);
|
1428 |
});
|
1429 |
|
@@ -1468,29 +1591,55 @@
|
|
1468 |
}
|
1469 |
|
1470 |
// LOCALES
|
1471 |
-
|
1472 |
-
|
1473 |
-
function localeWeekdays (m, format) {
|
1474 |
-
if (!m) {
|
1475 |
-
return isArray(this._weekdays) ? this._weekdays :
|
1476 |
-
this._weekdays['standalone'];
|
1477 |
-
}
|
1478 |
-
return isArray(this._weekdays) ? this._weekdays[m.day()] :
|
1479 |
-
this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
|
1480 |
-
}
|
1481 |
-
|
1482 |
-
var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
|
1483 |
-
function localeWeekdaysShort (m) {
|
1484 |
-
return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
|
1485 |
}
|
1486 |
|
1487 |
-
var
|
1488 |
-
|
1489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1490 |
}
|
1491 |
|
1492 |
function handleStrictParse$1(weekdayName, format, strict) {
|
1493 |
-
var i,
|
|
|
|
|
|
|
1494 |
if (!this._weekdaysParse) {
|
1495 |
this._weekdaysParse = [];
|
1496 |
this._shortWeekdaysParse = [];
|
@@ -1498,8 +1647,14 @@
|
|
1498 |
|
1499 |
for (i = 0; i < 7; ++i) {
|
1500 |
mom = createUTC([2000, 1]).day(i);
|
1501 |
-
this._minWeekdaysParse[i] = this.weekdaysMin(
|
1502 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1503 |
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
|
1504 |
}
|
1505 |
}
|
@@ -1553,7 +1708,7 @@
|
|
1553 |
}
|
1554 |
}
|
1555 |
|
1556 |
-
function localeWeekdaysParse
|
1557 |
var i, mom, regex;
|
1558 |
|
1559 |
if (this._weekdaysParseExact) {
|
@@ -1572,20 +1727,47 @@
|
|
1572 |
|
1573 |
mom = createUTC([2000, 1]).day(i);
|
1574 |
if (strict && !this._fullWeekdaysParse[i]) {
|
1575 |
-
this._fullWeekdaysParse[i] = new RegExp(
|
1576 |
-
|
1577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1578 |
}
|
1579 |
if (!this._weekdaysParse[i]) {
|
1580 |
-
regex =
|
|
|
|
|
|
|
|
|
|
|
|
|
1581 |
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
1582 |
}
|
1583 |
// test the regex
|
1584 |
-
if (
|
|
|
|
|
|
|
|
|
1585 |
return i;
|
1586 |
-
} else if (
|
|
|
|
|
|
|
|
|
1587 |
return i;
|
1588 |
-
} else if (
|
|
|
|
|
|
|
|
|
1589 |
return i;
|
1590 |
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
1591 |
return i;
|
@@ -1595,7 +1777,7 @@
|
|
1595 |
|
1596 |
// MOMENTS
|
1597 |
|
1598 |
-
function getSetDayOfWeek
|
1599 |
if (!this.isValid()) {
|
1600 |
return input != null ? this : NaN;
|
1601 |
}
|
@@ -1608,7 +1790,7 @@
|
|
1608 |
}
|
1609 |
}
|
1610 |
|
1611 |
-
function getSetLocaleDayOfWeek
|
1612 |
if (!this.isValid()) {
|
1613 |
return input != null ? this : NaN;
|
1614 |
}
|
@@ -1616,7 +1798,7 @@
|
|
1616 |
return input == null ? weekday : this.add(input - weekday, 'd');
|
1617 |
}
|
1618 |
|
1619 |
-
function getSetISODayOfWeek
|
1620 |
if (!this.isValid()) {
|
1621 |
return input != null ? this : NaN;
|
1622 |
}
|
@@ -1633,8 +1815,7 @@
|
|
1633 |
}
|
1634 |
}
|
1635 |
|
1636 |
-
|
1637 |
-
function weekdaysRegex (isStrict) {
|
1638 |
if (this._weekdaysParseExact) {
|
1639 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1640 |
computeWeekdaysParse.call(this);
|
@@ -1648,13 +1829,13 @@
|
|
1648 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1649 |
this._weekdaysRegex = defaultWeekdaysRegex;
|
1650 |
}
|
1651 |
-
return this._weekdaysStrictRegex && isStrict
|
1652 |
-
this._weekdaysStrictRegex
|
|
|
1653 |
}
|
1654 |
}
|
1655 |
|
1656 |
-
|
1657 |
-
function weekdaysShortRegex (isStrict) {
|
1658 |
if (this._weekdaysParseExact) {
|
1659 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1660 |
computeWeekdaysParse.call(this);
|
@@ -1668,13 +1849,13 @@
|
|
1668 |
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
|
1669 |
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
1670 |
}
|
1671 |
-
return this._weekdaysShortStrictRegex && isStrict
|
1672 |
-
this._weekdaysShortStrictRegex
|
|
|
1673 |
}
|
1674 |
}
|
1675 |
|
1676 |
-
|
1677 |
-
function weekdaysMinRegex (isStrict) {
|
1678 |
if (this._weekdaysParseExact) {
|
1679 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1680 |
computeWeekdaysParse.call(this);
|
@@ -1688,25 +1869,32 @@
|
|
1688 |
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
|
1689 |
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
1690 |
}
|
1691 |
-
return this._weekdaysMinStrictRegex && isStrict
|
1692 |
-
this._weekdaysMinStrictRegex
|
|
|
1693 |
}
|
1694 |
}
|
1695 |
|
1696 |
-
|
1697 |
-
function computeWeekdaysParse () {
|
1698 |
function cmpLenRev(a, b) {
|
1699 |
return b.length - a.length;
|
1700 |
}
|
1701 |
|
1702 |
-
var minPieces = [],
|
1703 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1704 |
for (i = 0; i < 7; i++) {
|
1705 |
// make the regex if we don't have it already
|
1706 |
mom = createUTC([2000, 1]).day(i);
|
1707 |
-
minp = this.weekdaysMin(mom, '');
|
1708 |
-
shortp = this.weekdaysShort(mom, '');
|
1709 |
-
longp = this.weekdays(mom, '');
|
1710 |
minPieces.push(minp);
|
1711 |
shortPieces.push(shortp);
|
1712 |
longPieces.push(longp);
|
@@ -1720,19 +1908,23 @@
|
|
1720 |
shortPieces.sort(cmpLenRev);
|
1721 |
longPieces.sort(cmpLenRev);
|
1722 |
mixedPieces.sort(cmpLenRev);
|
1723 |
-
for (i = 0; i < 7; i++) {
|
1724 |
-
shortPieces[i] = regexEscape(shortPieces[i]);
|
1725 |
-
longPieces[i] = regexEscape(longPieces[i]);
|
1726 |
-
mixedPieces[i] = regexEscape(mixedPieces[i]);
|
1727 |
-
}
|
1728 |
|
1729 |
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
1730 |
this._weekdaysShortRegex = this._weekdaysRegex;
|
1731 |
this._weekdaysMinRegex = this._weekdaysRegex;
|
1732 |
|
1733 |
-
this._weekdaysStrictRegex = new RegExp(
|
1734 |
-
|
1735 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1736 |
}
|
1737 |
|
1738 |
// FORMATTING
|
@@ -1754,8 +1946,12 @@
|
|
1754 |
});
|
1755 |
|
1756 |
addFormatToken('hmmss', 0, 0, function () {
|
1757 |
-
return
|
1758 |
-
|
|
|
|
|
|
|
|
|
1759 |
});
|
1760 |
|
1761 |
addFormatToken('Hmm', 0, 0, function () {
|
@@ -1763,13 +1959,21 @@
|
|
1763 |
});
|
1764 |
|
1765 |
addFormatToken('Hmmss', 0, 0, function () {
|
1766 |
-
return
|
1767 |
-
|
|
|
|
|
|
|
|
|
1768 |
});
|
1769 |
|
1770 |
-
function meridiem
|
1771 |
addFormatToken(token, 0, 0, function () {
|
1772 |
-
return this.localeData().meridiem(
|
|
|
|
|
|
|
|
|
1773 |
});
|
1774 |
}
|
1775 |
|
@@ -1785,15 +1989,15 @@
|
|
1785 |
|
1786 |
// PARSING
|
1787 |
|
1788 |
-
function matchMeridiem
|
1789 |
return locale._meridiemParse;
|
1790 |
}
|
1791 |
|
1792 |
-
addRegexToken('a',
|
1793 |
-
addRegexToken('A',
|
1794 |
-
addRegexToken('H',
|
1795 |
-
addRegexToken('h',
|
1796 |
-
addRegexToken('k',
|
1797 |
addRegexToken('HH', match1to2, match2);
|
1798 |
addRegexToken('hh', match1to2, match2);
|
1799 |
addRegexToken('kk', match1to2, match2);
|
@@ -1823,8 +2027,8 @@
|
|
1823 |
getParsingFlags(config).bigHour = true;
|
1824 |
});
|
1825 |
addParseToken('hmmss', function (input, array, config) {
|
1826 |
-
var pos1 = input.length - 4
|
1827 |
-
|
1828 |
array[HOUR] = toInt(input.substr(0, pos1));
|
1829 |
array[MINUTE] = toInt(input.substr(pos1, 2));
|
1830 |
array[SECOND] = toInt(input.substr(pos2));
|
@@ -1836,8 +2040,8 @@
|
|
1836 |
array[MINUTE] = toInt(input.substr(pos));
|
1837 |
});
|
1838 |
addParseToken('Hmmss', function (input, array, config) {
|
1839 |
-
var pos1 = input.length - 4
|
1840 |
-
|
1841 |
array[HOUR] = toInt(input.substr(0, pos1));
|
1842 |
array[MINUTE] = toInt(input.substr(pos1, 2));
|
1843 |
array[SECOND] = toInt(input.substr(pos2));
|
@@ -1845,14 +2049,20 @@
|
|
1845 |
|
1846 |
// LOCALES
|
1847 |
|
1848 |
-
function localeIsPM
|
1849 |
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
|
1850 |
// Using charAt should be more compatible.
|
1851 |
-
return (
|
1852 |
}
|
1853 |
|
1854 |
-
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i
|
1855 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1856 |
if (hours > 11) {
|
1857 |
return isLower ? 'pm' : 'PM';
|
1858 |
} else {
|
@@ -1860,15 +2070,6 @@
|
|
1860 |
}
|
1861 |
}
|
1862 |
|
1863 |
-
|
1864 |
-
// MOMENTS
|
1865 |
-
|
1866 |
-
// Setting the hour should keep the time, because the user explicitly
|
1867 |
-
// specified which hour they want. So trying to maintain the same hour (in
|
1868 |
-
// a new timezone) makes sense. Adding/subtracting hours does not follow
|
1869 |
-
// this rule.
|
1870 |
-
var getSetHour = makeGetSet('Hours', true);
|
1871 |
-
|
1872 |
var baseConfig = {
|
1873 |
calendar: defaultCalendar,
|
1874 |
longDateFormat: defaultLongDateFormat,
|
@@ -1886,13 +2087,24 @@
|
|
1886 |
weekdaysMin: defaultLocaleWeekdaysMin,
|
1887 |
weekdaysShort: defaultLocaleWeekdaysShort,
|
1888 |
|
1889 |
-
meridiemParse: defaultLocaleMeridiemParse
|
1890 |
};
|
1891 |
|
1892 |
// internal storage for locale config files
|
1893 |
-
var locales = {}
|
1894 |
-
|
1895 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1896 |
|
1897 |
function normalizeLocale(key) {
|
1898 |
return key ? key.toLowerCase().replace('_', '-') : key;
|
@@ -1902,7 +2114,11 @@
|
|
1902 |
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
|
1903 |
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
|
1904 |
function chooseLocale(names) {
|
1905 |
-
var i = 0,
|
|
|
|
|
|
|
|
|
1906 |
|
1907 |
while (i < names.length) {
|
1908 |
split = normalizeLocale(names[i]).split('-');
|
@@ -1914,7 +2130,11 @@
|
|
1914 |
if (locale) {
|
1915 |
return locale;
|
1916 |
}
|
1917 |
-
if (
|
|
|
|
|
|
|
|
|
1918 |
//the next array item is better than a shallower substring of this one
|
1919 |
break;
|
1920 |
}
|
@@ -1926,16 +2146,25 @@
|
|
1926 |
}
|
1927 |
|
1928 |
function loadLocale(name) {
|
1929 |
-
var oldLocale = null
|
|
|
1930 |
// TODO: Find a better way to register and load all the locales in Node
|
1931 |
-
if (
|
1932 |
-
|
|
|
|
|
|
|
|
|
1933 |
try {
|
1934 |
oldLocale = globalLocale._abbr;
|
1935 |
-
|
1936 |
-
__webpack_require__(
|
1937 |
getSetGlobalLocale(oldLocale);
|
1938 |
-
} catch (e) {
|
|
|
|
|
|
|
|
|
1939 |
}
|
1940 |
return locales[name];
|
1941 |
}
|
@@ -1943,24 +2172,24 @@
|
|
1943 |
// This function will load locale and then set the global locale. If
|
1944 |
// no arguments are passed in, it will simply return the current global
|
1945 |
// locale key.
|
1946 |
-
function getSetGlobalLocale
|
1947 |
var data;
|
1948 |
if (key) {
|
1949 |
if (isUndefined(values)) {
|
1950 |
data = getLocale(key);
|
1951 |
-
}
|
1952 |
-
else {
|
1953 |
data = defineLocale(key, values);
|
1954 |
}
|
1955 |
|
1956 |
if (data) {
|
1957 |
// moment.duration._locale = moment._locale = data;
|
1958 |
globalLocale = data;
|
1959 |
-
}
|
1960 |
-
|
1961 |
-
if ((typeof console !== 'undefined') && console.warn) {
|
1962 |
//warn user if arguments are passed but the locale could not be set
|
1963 |
-
console.warn(
|
|
|
|
|
1964 |
}
|
1965 |
}
|
1966 |
}
|
@@ -1968,16 +2197,19 @@
|
|
1968 |
return globalLocale._abbr;
|
1969 |
}
|
1970 |
|
1971 |
-
function defineLocale
|
1972 |
if (config !== null) {
|
1973 |
-
var locale,
|
|
|
1974 |
config.abbr = name;
|
1975 |
if (locales[name] != null) {
|
1976 |
-
deprecateSimple(
|
1977 |
-
|
|
|
1978 |
'an existing locale. moment.defineLocale(localeName, ' +
|
1979 |
'config) should only be used for creating a new locale ' +
|
1980 |
-
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
|
|
|
1981 |
parentConfig = locales[name]._config;
|
1982 |
} else if (config.parentLocale != null) {
|
1983 |
if (locales[config.parentLocale] != null) {
|
@@ -1992,7 +2224,7 @@
|
|
1992 |
}
|
1993 |
localeFamilies[config.parentLocale].push({
|
1994 |
name: name,
|
1995 |
-
config: config
|
1996 |
});
|
1997 |
return null;
|
1998 |
}
|
@@ -2011,7 +2243,6 @@
|
|
2011 |
// created, so we won't end up with the child locale set.
|
2012 |
getSetGlobalLocale(name);
|
2013 |
|
2014 |
-
|
2015 |
return locales[name];
|
2016 |
} else {
|
2017 |
// useful for testing
|
@@ -2022,16 +2253,30 @@
|
|
2022 |
|
2023 |
function updateLocale(name, config) {
|
2024 |
if (config != null) {
|
2025 |
-
var locale,
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2030 |
}
|
2031 |
-
config = mergeConfigs(parentConfig, config);
|
2032 |
-
locale = new Locale(config);
|
2033 |
-
locale.parentLocale = locales[name];
|
2034 |
-
locales[name] = locale;
|
2035 |
|
2036 |
// backwards compat for now: also set the locale
|
2037 |
getSetGlobalLocale(name);
|
@@ -2040,6 +2285,9 @@
|
|
2040 |
if (locales[name] != null) {
|
2041 |
if (locales[name].parentLocale != null) {
|
2042 |
locales[name] = locales[name].parentLocale;
|
|
|
|
|
|
|
2043 |
} else if (locales[name] != null) {
|
2044 |
delete locales[name];
|
2045 |
}
|
@@ -2049,7 +2297,7 @@
|
|
2049 |
}
|
2050 |
|
2051 |
// returns locale data
|
2052 |
-
function getLocale
|
2053 |
var locale;
|
2054 |
|
2055 |
if (key && key._locale && key._locale._abbr) {
|
@@ -2076,21 +2324,35 @@
|
|
2076 |
return keys(locales);
|
2077 |
}
|
2078 |
|
2079 |
-
function checkOverflow
|
2080 |
-
var overflow
|
2081 |
-
|
2082 |
|
2083 |
if (a && getParsingFlags(m).overflow === -2) {
|
2084 |
overflow =
|
2085 |
-
a[MONTH]
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2094 |
overflow = DATE;
|
2095 |
}
|
2096 |
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
@@ -2106,199 +2368,64 @@
|
|
2106 |
return m;
|
2107 |
}
|
2108 |
|
2109 |
-
// Pick the first defined of two or three arguments.
|
2110 |
-
function defaults(a, b, c) {
|
2111 |
-
if (a != null) {
|
2112 |
-
return a;
|
2113 |
-
}
|
2114 |
-
if (b != null) {
|
2115 |
-
return b;
|
2116 |
-
}
|
2117 |
-
return c;
|
2118 |
-
}
|
2119 |
-
|
2120 |
-
function currentDateArray(config) {
|
2121 |
-
// hooks is actually the exported moment object
|
2122 |
-
var nowValue = new Date(hooks.now());
|
2123 |
-
if (config._useUTC) {
|
2124 |
-
return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
|
2125 |
-
}
|
2126 |
-
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
2127 |
-
}
|
2128 |
-
|
2129 |
-
// convert an array to a date.
|
2130 |
-
// the array should mirror the parameters below
|
2131 |
-
// note: all values past the year are optional and will default to the lowest possible value.
|
2132 |
-
// [year, month, day , hour, minute, second, millisecond]
|
2133 |
-
function configFromArray (config) {
|
2134 |
-
var i, date, input = [], currentDate, expectedWeekday, yearToUse;
|
2135 |
-
|
2136 |
-
if (config._d) {
|
2137 |
-
return;
|
2138 |
-
}
|
2139 |
-
|
2140 |
-
currentDate = currentDateArray(config);
|
2141 |
-
|
2142 |
-
//compute day of the year from weeks and weekdays
|
2143 |
-
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
2144 |
-
dayOfYearFromWeekInfo(config);
|
2145 |
-
}
|
2146 |
-
|
2147 |
-
//if the day of the year is set, figure out what it is
|
2148 |
-
if (config._dayOfYear != null) {
|
2149 |
-
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
2150 |
-
|
2151 |
-
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
|
2152 |
-
getParsingFlags(config)._overflowDayOfYear = true;
|
2153 |
-
}
|
2154 |
-
|
2155 |
-
date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
2156 |
-
config._a[MONTH] = date.getUTCMonth();
|
2157 |
-
config._a[DATE] = date.getUTCDate();
|
2158 |
-
}
|
2159 |
-
|
2160 |
-
// Default to current date.
|
2161 |
-
// * if no year, month, day of month are given, default to today
|
2162 |
-
// * if day of month is given, default month and year
|
2163 |
-
// * if month is given, default only year
|
2164 |
-
// * if year is given, don't default anything
|
2165 |
-
for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
2166 |
-
config._a[i] = input[i] = currentDate[i];
|
2167 |
-
}
|
2168 |
-
|
2169 |
-
// Zero out whatever was not defaulted, including time
|
2170 |
-
for (; i < 7; i++) {
|
2171 |
-
config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
|
2172 |
-
}
|
2173 |
-
|
2174 |
-
// Check for 24:00:00.000
|
2175 |
-
if (config._a[HOUR] === 24 &&
|
2176 |
-
config._a[MINUTE] === 0 &&
|
2177 |
-
config._a[SECOND] === 0 &&
|
2178 |
-
config._a[MILLISECOND] === 0) {
|
2179 |
-
config._nextDay = true;
|
2180 |
-
config._a[HOUR] = 0;
|
2181 |
-
}
|
2182 |
-
|
2183 |
-
config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
|
2184 |
-
expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
|
2185 |
-
|
2186 |
-
// Apply timezone offset from input. The actual utcOffset can be changed
|
2187 |
-
// with parseZone.
|
2188 |
-
if (config._tzm != null) {
|
2189 |
-
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
2190 |
-
}
|
2191 |
-
|
2192 |
-
if (config._nextDay) {
|
2193 |
-
config._a[HOUR] = 24;
|
2194 |
-
}
|
2195 |
-
|
2196 |
-
// check for mismatching day of week
|
2197 |
-
if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
|
2198 |
-
getParsingFlags(config).weekdayMismatch = true;
|
2199 |
-
}
|
2200 |
-
}
|
2201 |
-
|
2202 |
-
function dayOfYearFromWeekInfo(config) {
|
2203 |
-
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
|
2204 |
-
|
2205 |
-
w = config._w;
|
2206 |
-
if (w.GG != null || w.W != null || w.E != null) {
|
2207 |
-
dow = 1;
|
2208 |
-
doy = 4;
|
2209 |
-
|
2210 |
-
// TODO: We need to take the current isoWeekYear, but that depends on
|
2211 |
-
// how we interpret now (local, utc, fixed offset). So create
|
2212 |
-
// a now version of current config (take local/utc/offset flags, and
|
2213 |
-
// create now).
|
2214 |
-
weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
|
2215 |
-
week = defaults(w.W, 1);
|
2216 |
-
weekday = defaults(w.E, 1);
|
2217 |
-
if (weekday < 1 || weekday > 7) {
|
2218 |
-
weekdayOverflow = true;
|
2219 |
-
}
|
2220 |
-
} else {
|
2221 |
-
dow = config._locale._week.dow;
|
2222 |
-
doy = config._locale._week.doy;
|
2223 |
-
|
2224 |
-
var curWeek = weekOfYear(createLocal(), dow, doy);
|
2225 |
-
|
2226 |
-
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
2227 |
-
|
2228 |
-
// Default to current week.
|
2229 |
-
week = defaults(w.w, curWeek.week);
|
2230 |
-
|
2231 |
-
if (w.d != null) {
|
2232 |
-
// weekday -- low day numbers are considered next week
|
2233 |
-
weekday = w.d;
|
2234 |
-
if (weekday < 0 || weekday > 6) {
|
2235 |
-
weekdayOverflow = true;
|
2236 |
-
}
|
2237 |
-
} else if (w.e != null) {
|
2238 |
-
// local weekday -- counting starts from beginning of week
|
2239 |
-
weekday = w.e + dow;
|
2240 |
-
if (w.e < 0 || w.e > 6) {
|
2241 |
-
weekdayOverflow = true;
|
2242 |
-
}
|
2243 |
-
} else {
|
2244 |
-
// default to beginning of week
|
2245 |
-
weekday = dow;
|
2246 |
-
}
|
2247 |
-
}
|
2248 |
-
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
2249 |
-
getParsingFlags(config)._overflowWeeks = true;
|
2250 |
-
} else if (weekdayOverflow != null) {
|
2251 |
-
getParsingFlags(config)._overflowWeekday = true;
|
2252 |
-
} else {
|
2253 |
-
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
2254 |
-
config._a[YEAR] = temp.year;
|
2255 |
-
config._dayOfYear = temp.dayOfYear;
|
2256 |
-
}
|
2257 |
-
}
|
2258 |
-
|
2259 |
// iso 8601 regex
|
2260 |
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
|
2261 |
-
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2295 |
|
2296 |
// date from iso format
|
2297 |
function configFromISO(config) {
|
2298 |
-
var i,
|
|
|
2299 |
string = config._i,
|
2300 |
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
|
2301 |
-
allowTime,
|
|
|
|
|
|
|
2302 |
|
2303 |
if (match) {
|
2304 |
getParsingFlags(config).iso = true;
|
@@ -2346,16 +2473,20 @@
|
|
2346 |
}
|
2347 |
}
|
2348 |
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
|
|
|
|
|
|
|
|
2353 |
var result = [
|
2354 |
untruncateYear(yearStr),
|
2355 |
defaultLocaleMonthsShort.indexOf(monthStr),
|
2356 |
parseInt(dayStr, 10),
|
2357 |
parseInt(hourStr, 10),
|
2358 |
-
parseInt(minuteStr, 10)
|
2359 |
];
|
2360 |
|
2361 |
if (secondStr) {
|
@@ -2377,14 +2508,22 @@
|
|
2377 |
|
2378 |
function preprocessRFC2822(s) {
|
2379 |
// Remove comments and folding whitespace and replace multiple-spaces with a single space
|
2380 |
-
return s
|
|
|
|
|
|
|
|
|
2381 |
}
|
2382 |
|
2383 |
function checkWeekday(weekdayStr, parsedInput, config) {
|
2384 |
if (weekdayStr) {
|
2385 |
-
// TODO: Replace the vanilla JS Date object with an
|
2386 |
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
|
2387 |
-
weekdayActual = new Date(
|
|
|
|
|
|
|
|
|
2388 |
if (weekdayProvided !== weekdayActual) {
|
2389 |
getParsingFlags(config).weekdayMismatch = true;
|
2390 |
config._isValid = false;
|
@@ -2394,19 +2533,6 @@
|
|
2394 |
return true;
|
2395 |
}
|
2396 |
|
2397 |
-
var obsOffsets = {
|
2398 |
-
UT: 0,
|
2399 |
-
GMT: 0,
|
2400 |
-
EDT: -4 * 60,
|
2401 |
-
EST: -5 * 60,
|
2402 |
-
CDT: -5 * 60,
|
2403 |
-
CST: -6 * 60,
|
2404 |
-
MDT: -6 * 60,
|
2405 |
-
MST: -7 * 60,
|
2406 |
-
PDT: -7 * 60,
|
2407 |
-
PST: -8 * 60
|
2408 |
-
};
|
2409 |
-
|
2410 |
function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
2411 |
if (obsOffset) {
|
2412 |
return obsOffsets[obsOffset];
|
@@ -2414,17 +2540,26 @@
|
|
2414 |
// the only allowed military tz is Z
|
2415 |
return 0;
|
2416 |
} else {
|
2417 |
-
var hm = parseInt(numOffset, 10)
|
2418 |
-
|
|
|
2419 |
return h * 60 + m;
|
2420 |
}
|
2421 |
}
|
2422 |
|
2423 |
// date and time from ref 2822 format
|
2424 |
function configFromRFC2822(config) {
|
2425 |
-
var match = rfc2822.exec(preprocessRFC2822(config._i))
|
|
|
2426 |
if (match) {
|
2427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2428 |
if (!checkWeekday(match[1], parsedArray, config)) {
|
2429 |
return;
|
2430 |
}
|
@@ -2441,10 +2576,9 @@
|
|
2441 |
}
|
2442 |
}
|
2443 |
|
2444 |
-
// date from
|
2445 |
function configFromString(config) {
|
2446 |
var matched = aspNetJsonRegex.exec(config._i);
|
2447 |
-
|
2448 |
if (matched !== null) {
|
2449 |
config._d = new Date(+matched[1]);
|
2450 |
return;
|
@@ -2464,20 +2598,202 @@
|
|
2464 |
return;
|
2465 |
}
|
2466 |
|
2467 |
-
|
2468 |
-
|
|
|
|
|
|
|
|
|
2469 |
}
|
2470 |
|
2471 |
hooks.createFromInputFallback = deprecate(
|
2472 |
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
function (config) {
|
2477 |
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
|
2478 |
}
|
2479 |
);
|
2480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2481 |
// constant that refers to the ISO standard
|
2482 |
hooks.ISO_8601 = function () {};
|
2483 |
|
@@ -2500,64 +2816,81 @@
|
|
2500 |
|
2501 |
// This array is used to make a Date, either with `new Date` or `Date.UTC`
|
2502 |
var string = '' + config._i,
|
2503 |
-
i,
|
|
|
|
|
|
|
|
|
2504 |
stringLength = string.length,
|
2505 |
-
totalParsedInputLength = 0
|
|
|
2506 |
|
2507 |
-
tokens =
|
|
|
2508 |
|
2509 |
for (i = 0; i < tokens.length; i++) {
|
2510 |
token = tokens[i];
|
2511 |
-
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
|
2512 |
-
|
2513 |
-
// 'regex', getParseRegexForToken(token, config));
|
2514 |
if (parsedInput) {
|
2515 |
skipped = string.substr(0, string.indexOf(parsedInput));
|
2516 |
if (skipped.length > 0) {
|
2517 |
getParsingFlags(config).unusedInput.push(skipped);
|
2518 |
}
|
2519 |
-
string = string.slice(
|
|
|
|
|
2520 |
totalParsedInputLength += parsedInput.length;
|
2521 |
}
|
2522 |
// don't parse if it's not a known token
|
2523 |
if (formatTokenFunctions[token]) {
|
2524 |
if (parsedInput) {
|
2525 |
getParsingFlags(config).empty = false;
|
2526 |
-
}
|
2527 |
-
else {
|
2528 |
getParsingFlags(config).unusedTokens.push(token);
|
2529 |
}
|
2530 |
addTimeToArrayFromToken(token, parsedInput, config);
|
2531 |
-
}
|
2532 |
-
else if (config._strict && !parsedInput) {
|
2533 |
getParsingFlags(config).unusedTokens.push(token);
|
2534 |
}
|
2535 |
}
|
2536 |
|
2537 |
// add remaining unparsed input length to the string
|
2538 |
-
getParsingFlags(config).charsLeftOver =
|
|
|
2539 |
if (string.length > 0) {
|
2540 |
getParsingFlags(config).unusedInput.push(string);
|
2541 |
}
|
2542 |
|
2543 |
// clear _12h flag if hour is <= 12
|
2544 |
-
if (
|
|
|
2545 |
getParsingFlags(config).bigHour === true &&
|
2546 |
-
config._a[HOUR] > 0
|
|
|
2547 |
getParsingFlags(config).bigHour = undefined;
|
2548 |
}
|
2549 |
|
2550 |
getParsingFlags(config).parsedDateParts = config._a.slice(0);
|
2551 |
getParsingFlags(config).meridiem = config._meridiem;
|
2552 |
// handle meridiem
|
2553 |
-
config._a[HOUR] = meridiemFixWrap(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2554 |
|
2555 |
configFromArray(config);
|
2556 |
checkOverflow(config);
|
2557 |
}
|
2558 |
|
2559 |
-
|
2560 |
-
function meridiemFixWrap (locale, hour, meridiem) {
|
2561 |
var isPm;
|
2562 |
|
2563 |
if (meridiem == null) {
|
@@ -2586,10 +2919,11 @@
|
|
2586 |
function configFromStringAndArray(config) {
|
2587 |
var tempConfig,
|
2588 |
bestMoment,
|
2589 |
-
|
2590 |
scoreToBeat,
|
2591 |
i,
|
2592 |
-
currentScore
|
|
|
|
|
2593 |
|
2594 |
if (config._f.length === 0) {
|
2595 |
getParsingFlags(config).invalidFormat = true;
|
@@ -2599,6 +2933,7 @@
|
|
2599 |
|
2600 |
for (i = 0; i < config._f.length; i++) {
|
2601 |
currentScore = 0;
|
|
|
2602 |
tempConfig = copyConfig({}, config);
|
2603 |
if (config._useUTC != null) {
|
2604 |
tempConfig._useUTC = config._useUTC;
|
@@ -2606,8 +2941,8 @@
|
|
2606 |
tempConfig._f = config._f[i];
|
2607 |
configFromStringAndFormat(tempConfig);
|
2608 |
|
2609 |
-
if (
|
2610 |
-
|
2611 |
}
|
2612 |
|
2613 |
// if there is any input that was not parsed add a penalty for that format
|
@@ -2618,9 +2953,23 @@
|
|
2618 |
|
2619 |
getParsingFlags(tempConfig).score = currentScore;
|
2620 |
|
2621 |
-
if (
|
2622 |
-
|
2623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2624 |
}
|
2625 |
}
|
2626 |
|
@@ -2632,15 +2981,19 @@
|
|
2632 |
return;
|
2633 |
}
|
2634 |
|
2635 |
-
var i = normalizeObjectUnits(config._i)
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
|
|
|
|
|
|
|
|
2639 |
|
2640 |
configFromArray(config);
|
2641 |
}
|
2642 |
|
2643 |
-
function createFromConfig
|
2644 |
var res = new Moment(checkOverflow(prepareConfig(config)));
|
2645 |
if (res._nextDay) {
|
2646 |
// Adding is smart enough around DST
|
@@ -2651,14 +3004,14 @@
|
|
2651 |
return res;
|
2652 |
}
|
2653 |
|
2654 |
-
function prepareConfig
|
2655 |
var input = config._i,
|
2656 |
format = config._f;
|
2657 |
|
2658 |
config._locale = config._locale || getLocale(config._l);
|
2659 |
|
2660 |
if (input === null || (format === undefined && input === '')) {
|
2661 |
-
return createInvalid({nullInput: true});
|
2662 |
}
|
2663 |
|
2664 |
if (typeof input === 'string') {
|
@@ -2673,7 +3026,7 @@
|
|
2673 |
configFromStringAndArray(config);
|
2674 |
} else if (format) {
|
2675 |
configFromStringAndFormat(config);
|
2676 |
-
}
|
2677 |
configFromInput(config);
|
2678 |
}
|
2679 |
|
@@ -2707,16 +3060,23 @@
|
|
2707 |
}
|
2708 |
}
|
2709 |
|
2710 |
-
function createLocalOrUTC
|
2711 |
var c = {};
|
2712 |
|
|
|
|
|
|
|
|
|
|
|
2713 |
if (locale === true || locale === false) {
|
2714 |
strict = locale;
|
2715 |
locale = undefined;
|
2716 |
}
|
2717 |
|
2718 |
-
if (
|
2719 |
-
|
|
|
|
|
2720 |
input = undefined;
|
2721 |
}
|
2722 |
// object construction must be done this way.
|
@@ -2731,33 +3091,32 @@
|
|
2731 |
return createFromConfig(c);
|
2732 |
}
|
2733 |
|
2734 |
-
function createLocal
|
2735 |
return createLocalOrUTC(input, format, locale, strict, false);
|
2736 |
}
|
2737 |
|
2738 |
var prototypeMin = deprecate(
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
|
|
2746 |
}
|
2747 |
-
|
2748 |
-
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
return createInvalid();
|
2758 |
}
|
2759 |
-
|
2760 |
-
);
|
2761 |
|
2762 |
// Pick a moment m from moments so that m[fn](other) is true for all
|
2763 |
// other. This relies on the function fn to be transitive.
|
@@ -2782,33 +3141,51 @@
|
|
2782 |
}
|
2783 |
|
2784 |
// TODO: Use [].sort instead?
|
2785 |
-
function min
|
2786 |
var args = [].slice.call(arguments, 0);
|
2787 |
|
2788 |
return pickBy('isBefore', args);
|
2789 |
}
|
2790 |
|
2791 |
-
function max
|
2792 |
var args = [].slice.call(arguments, 0);
|
2793 |
|
2794 |
return pickBy('isAfter', args);
|
2795 |
}
|
2796 |
|
2797 |
var now = function () {
|
2798 |
-
return Date.now ? Date.now() : +
|
2799 |
};
|
2800 |
|
2801 |
-
var ordering = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2802 |
|
2803 |
function isDurationValid(m) {
|
2804 |
-
|
2805 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2806 |
return false;
|
2807 |
}
|
2808 |
}
|
2809 |
|
2810 |
-
|
2811 |
-
for (var i = 0; i < ordering.length; ++i) {
|
2812 |
if (m[ordering[i]]) {
|
2813 |
if (unitHasDecimal) {
|
2814 |
return false; // only allow non-integers for smallest unit
|
@@ -2830,7 +3207,7 @@
|
|
2830 |
return createDuration(NaN);
|
2831 |
}
|
2832 |
|
2833 |
-
function Duration
|
2834 |
var normalizedInput = normalizeObjectUnits(duration),
|
2835 |
years = normalizedInput.year || 0,
|
2836 |
quarters = normalizedInput.quarter || 0,
|
@@ -2845,20 +3222,18 @@
|
|
2845 |
this._isValid = isDurationValid(normalizedInput);
|
2846 |
|
2847 |
// representation for dateAddRemove
|
2848 |
-
this._milliseconds =
|
|
|
2849 |
seconds * 1e3 + // 1000
|
2850 |
minutes * 6e4 + // 1000 * 60
|
2851 |
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
|
2852 |
// Because of dateAddRemove treats 24 hours as different from a
|
2853 |
// day when working around DST, we need to store them separately
|
2854 |
-
this._days = +days +
|
2855 |
-
weeks * 7;
|
2856 |
// It is impossible to translate months into days without knowing
|
2857 |
// which months you are are talking about, so we have to store
|
2858 |
// it separately.
|
2859 |
-
this._months = +months +
|
2860 |
-
quarters * 3 +
|
2861 |
-
years * 12;
|
2862 |
|
2863 |
this._data = {};
|
2864 |
|
@@ -2867,11 +3242,11 @@
|
|
2867 |
this._bubble();
|
2868 |
}
|
2869 |
|
2870 |
-
function isDuration
|
2871 |
return obj instanceof Duration;
|
2872 |
}
|
2873 |
|
2874 |
-
function absRound
|
2875 |
if (number < 0) {
|
2876 |
return Math.round(-1 * number) * -1;
|
2877 |
} else {
|
@@ -2879,17 +3254,39 @@
|
|
2879 |
}
|
2880 |
}
|
2881 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2882 |
// FORMATTING
|
2883 |
|
2884 |
-
function offset
|
2885 |
addFormatToken(token, 0, 0, function () {
|
2886 |
-
var offset = this.utcOffset()
|
2887 |
-
|
2888 |
if (offset < 0) {
|
2889 |
offset = -offset;
|
2890 |
sign = '-';
|
2891 |
}
|
2892 |
-
return
|
|
|
|
|
|
|
|
|
|
|
2893 |
});
|
2894 |
}
|
2895 |
|
@@ -2898,7 +3295,7 @@
|
|
2898 |
|
2899 |
// PARSING
|
2900 |
|
2901 |
-
addRegexToken('Z',
|
2902 |
addRegexToken('ZZ', matchShortOffset);
|
2903 |
addParseToken(['Z', 'ZZ'], function (input, array, config) {
|
2904 |
config._useUTC = true;
|
@@ -2913,19 +3310,20 @@
|
|
2913 |
var chunkOffset = /([\+\-]|\d\d)/gi;
|
2914 |
|
2915 |
function offsetFromString(matcher, string) {
|
2916 |
-
var matches = (string || '').match(matcher)
|
|
|
|
|
|
|
2917 |
|
2918 |
if (matches === null) {
|
2919 |
return null;
|
2920 |
}
|
2921 |
|
2922 |
-
|
2923 |
-
|
2924 |
-
|
2925 |
|
2926 |
-
return minutes === 0 ?
|
2927 |
-
0 :
|
2928 |
-
parts[0] === '+' ? minutes : -minutes;
|
2929 |
}
|
2930 |
|
2931 |
// Return a moment from input, that is local/utc/zone equivalent to model.
|
@@ -2933,7 +3331,10 @@
|
|
2933 |
var res, diff;
|
2934 |
if (model._isUTC) {
|
2935 |
res = model.clone();
|
2936 |
-
diff =
|
|
|
|
|
|
|
2937 |
// Use low-level api, because this fn is low-level api.
|
2938 |
res._d.setTime(res._d.valueOf() + diff);
|
2939 |
hooks.updateOffset(res, false);
|
@@ -2943,10 +3344,10 @@
|
|
2943 |
}
|
2944 |
}
|
2945 |
|
2946 |
-
function getDateOffset
|
2947 |
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
|
2948 |
// https://github.com/moment/moment/pull/1871
|
2949 |
-
return -Math.round(m._d.getTimezoneOffset()
|
2950 |
}
|
2951 |
|
2952 |
// HOOKS
|
@@ -2967,7 +3368,7 @@
|
|
2967 |
// a second time. In case it wants us to change the offset again
|
2968 |
// _changeInProgress == true case, then we have to adjust, because
|
2969 |
// there is no such time in the given timezone.
|
2970 |
-
function getSetOffset
|
2971 |
var offset = this._offset || 0,
|
2972 |
localAdjust;
|
2973 |
if (!this.isValid()) {
|
@@ -2992,7 +3393,12 @@
|
|
2992 |
}
|
2993 |
if (offset !== input) {
|
2994 |
if (!keepLocalTime || this._changeInProgress) {
|
2995 |
-
addSubtract(
|
|
|
|
|
|
|
|
|
|
|
2996 |
} else if (!this._changeInProgress) {
|
2997 |
this._changeInProgress = true;
|
2998 |
hooks.updateOffset(this, true);
|
@@ -3005,7 +3411,7 @@
|
|
3005 |
}
|
3006 |
}
|
3007 |
|
3008 |
-
function getSetZone
|
3009 |
if (input != null) {
|
3010 |
if (typeof input !== 'string') {
|
3011 |
input = -input;
|
@@ -3019,11 +3425,11 @@
|
|
3019 |
}
|
3020 |
}
|
3021 |
|
3022 |
-
function setOffsetToUTC
|
3023 |
return this.utcOffset(0, keepLocalTime);
|
3024 |
}
|
3025 |
|
3026 |
-
function setOffsetToLocal
|
3027 |
if (this._isUTC) {
|
3028 |
this.utcOffset(0, keepLocalTime);
|
3029 |
this._isUTC = false;
|
@@ -3035,22 +3441,21 @@
|
|
3035 |
return this;
|
3036 |
}
|
3037 |
|
3038 |
-
function setOffsetToParsedOffset
|
3039 |
if (this._tzm != null) {
|
3040 |
this.utcOffset(this._tzm, false, true);
|
3041 |
} else if (typeof this._i === 'string') {
|
3042 |
var tZone = offsetFromString(matchOffset, this._i);
|
3043 |
if (tZone != null) {
|
3044 |
this.utcOffset(tZone);
|
3045 |
-
}
|
3046 |
-
else {
|
3047 |
this.utcOffset(0, true);
|
3048 |
}
|
3049 |
}
|
3050 |
return this;
|
3051 |
}
|
3052 |
|
3053 |
-
function hasAlignedHourOffset
|
3054 |
if (!this.isValid()) {
|
3055 |
return false;
|
3056 |
}
|
@@ -3059,27 +3464,28 @@
|
|
3059 |
return (this.utcOffset() - input) % 60 === 0;
|
3060 |
}
|
3061 |
|
3062 |
-
function isDaylightSavingTime
|
3063 |
return (
|
3064 |
this.utcOffset() > this.clone().month(0).utcOffset() ||
|
3065 |
this.utcOffset() > this.clone().month(5).utcOffset()
|
3066 |
);
|
3067 |
}
|
3068 |
|
3069 |
-
function isDaylightSavingTimeShifted
|
3070 |
if (!isUndefined(this._isDSTShifted)) {
|
3071 |
return this._isDSTShifted;
|
3072 |
}
|
3073 |
|
3074 |
-
var c = {}
|
|
|
3075 |
|
3076 |
copyConfig(c, this);
|
3077 |
c = prepareConfig(c);
|
3078 |
|
3079 |
if (c._a) {
|
3080 |
-
|
3081 |
-
this._isDSTShifted =
|
3082 |
-
compareArrays(c._a, other.toArray()) > 0;
|
3083 |
} else {
|
3084 |
this._isDSTShifted = false;
|
3085 |
}
|
@@ -3087,27 +3493,26 @@
|
|
3087 |
return this._isDSTShifted;
|
3088 |
}
|
3089 |
|
3090 |
-
function isLocal
|
3091 |
return this.isValid() ? !this._isUTC : false;
|
3092 |
}
|
3093 |
|
3094 |
-
function isUtcOffset
|
3095 |
return this.isValid() ? this._isUTC : false;
|
3096 |
}
|
3097 |
|
3098 |
-
function isUtc
|
3099 |
return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
3100 |
}
|
3101 |
|
3102 |
// ASP.NET json date format regex
|
3103 |
-
var aspNetRegex = /^(
|
|
|
|
|
|
|
|
|
3104 |
|
3105 |
-
|
3106 |
-
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
|
3107 |
-
// and further modified to allow for strings containing both week and day
|
3108 |
-
var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
3109 |
-
|
3110 |
-
function createDuration (input, key) {
|
3111 |
var duration = input,
|
3112 |
// matching against regexp is expensive, do it on demand
|
3113 |
match = null,
|
@@ -3117,42 +3522,49 @@
|
|
3117 |
|
3118 |
if (isDuration(input)) {
|
3119 |
duration = {
|
3120 |
-
ms
|
3121 |
-
d
|
3122 |
-
M
|
3123 |
};
|
3124 |
-
} else if (isNumber(input)) {
|
3125 |
duration = {};
|
3126 |
if (key) {
|
3127 |
-
duration[key] = input;
|
3128 |
} else {
|
3129 |
-
duration.milliseconds = input;
|
3130 |
}
|
3131 |
-
} else if (
|
3132 |
-
sign =
|
3133 |
duration = {
|
3134 |
-
y
|
3135 |
-
d
|
3136 |
-
h
|
3137 |
-
m
|
3138 |
-
s
|
3139 |
-
ms
|
3140 |
};
|
3141 |
-
} else if (
|
3142 |
-
sign =
|
3143 |
duration = {
|
3144 |
-
y
|
3145 |
-
M
|
3146 |
-
w
|
3147 |
-
d
|
3148 |
-
h
|
3149 |
-
m
|
3150 |
-
s
|
3151 |
};
|
3152 |
-
} else if (duration == null) {
|
|
|
3153 |
duration = {};
|
3154 |
-
} else if (
|
3155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3156 |
|
3157 |
duration = {};
|
3158 |
duration.ms = diffRes.milliseconds;
|
@@ -3165,13 +3577,17 @@
|
|
3165 |
ret._locale = input._locale;
|
3166 |
}
|
3167 |
|
|
|
|
|
|
|
|
|
3168 |
return ret;
|
3169 |
}
|
3170 |
|
3171 |
createDuration.fn = Duration.prototype;
|
3172 |
createDuration.invalid = createInvalid$1;
|
3173 |
|
3174 |
-
function parseIso
|
3175 |
// We'd normally use ~~inp for this, but unfortunately it also
|
3176 |
// converts floats to ints.
|
3177 |
// inp may be undefined, so careful calling replace on it.
|
@@ -3181,15 +3597,15 @@
|
|
3181 |
}
|
3182 |
|
3183 |
function positiveMomentsDifference(base, other) {
|
3184 |
-
var res = {
|
3185 |
|
3186 |
-
res.months =
|
3187 |
-
(other.year() - base.year()) * 12;
|
3188 |
if (base.clone().add(res.months, 'M').isAfter(other)) {
|
3189 |
--res.months;
|
3190 |
}
|
3191 |
|
3192 |
-
res.milliseconds = +other - +
|
3193 |
|
3194 |
return res;
|
3195 |
}
|
@@ -3197,7 +3613,7 @@
|
|
3197 |
function momentsDifference(base, other) {
|
3198 |
var res;
|
3199 |
if (!(base.isValid() && other.isValid())) {
|
3200 |
-
return {milliseconds: 0, months: 0};
|
3201 |
}
|
3202 |
|
3203 |
other = cloneWithOffset(other, base);
|
@@ -3218,19 +3634,27 @@
|
|
3218 |
var dur, tmp;
|
3219 |
//invert the arguments, but complain about it
|
3220 |
if (period !== null && !isNaN(+period)) {
|
3221 |
-
deprecateSimple(
|
3222 |
-
|
3223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3224 |
}
|
3225 |
|
3226 |
-
val = typeof val === 'string' ? +val : val;
|
3227 |
dur = createDuration(val, period);
|
3228 |
addSubtract(this, dur, direction);
|
3229 |
return this;
|
3230 |
};
|
3231 |
}
|
3232 |
|
3233 |
-
function addSubtract
|
3234 |
var milliseconds = duration._milliseconds,
|
3235 |
days = absRound(duration._days),
|
3236 |
months = absRound(duration._months);
|
@@ -3256,36 +3680,150 @@
|
|
3256 |
}
|
3257 |
}
|
3258 |
|
3259 |
-
var add
|
3260 |
-
|
3261 |
|
3262 |
-
function
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3270 |
}
|
3271 |
|
3272 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3273 |
// We want to compare the start of today, vs this.
|
3274 |
// Getting start-of-today depends on whether we're local/utc/offset or not.
|
3275 |
var now = time || createLocal(),
|
3276 |
sod = cloneWithOffset(now, this).startOf('day'),
|
3277 |
-
format = hooks.calendarFormat(this, sod) || 'sameElse'
|
3278 |
-
|
3279 |
-
|
3280 |
-
|
3281 |
-
|
|
|
|
|
|
|
|
|
|
|
3282 |
}
|
3283 |
|
3284 |
-
function clone
|
3285 |
return new Moment(this);
|
3286 |
}
|
3287 |
|
3288 |
-
function isAfter
|
3289 |
var localInput = isMoment(input) ? input : createLocal(input);
|
3290 |
if (!(this.isValid() && localInput.isValid())) {
|
3291 |
return false;
|
@@ -3298,7 +3836,7 @@
|
|
3298 |
}
|
3299 |
}
|
3300 |
|
3301 |
-
function isBefore
|
3302 |
var localInput = isMoment(input) ? input : createLocal(input);
|
3303 |
if (!(this.isValid() && localInput.isValid())) {
|
3304 |
return false;
|
@@ -3311,18 +3849,24 @@
|
|
3311 |
}
|
3312 |
}
|
3313 |
|
3314 |
-
function isBetween
|
3315 |
var localFrom = isMoment(from) ? from : createLocal(from),
|
3316 |
localTo = isMoment(to) ? to : createLocal(to);
|
3317 |
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
3318 |
return false;
|
3319 |
}
|
3320 |
inclusivity = inclusivity || '()';
|
3321 |
-
return (
|
3322 |
-
(inclusivity[
|
|
|
|
|
|
|
|
|
|
|
|
|
3323 |
}
|
3324 |
|
3325 |
-
function isSame
|
3326 |
var localInput = isMoment(input) ? input : createLocal(input),
|
3327 |
inputMs;
|
3328 |
if (!(this.isValid() && localInput.isValid())) {
|
@@ -3333,22 +3877,23 @@
|
|
3333 |
return this.valueOf() === localInput.valueOf();
|
3334 |
} else {
|
3335 |
inputMs = localInput.valueOf();
|
3336 |
-
return
|
|
|
|
|
|
|
3337 |
}
|
3338 |
}
|
3339 |
|
3340 |
-
function isSameOrAfter
|
3341 |
return this.isSame(input, units) || this.isAfter(input, units);
|
3342 |
}
|
3343 |
|
3344 |
-
function isSameOrBefore
|
3345 |
return this.isSame(input, units) || this.isBefore(input, units);
|
3346 |
}
|
3347 |
|
3348 |
-
function diff
|
3349 |
-
var that,
|
3350 |
-
zoneDelta,
|
3351 |
-
output;
|
3352 |
|
3353 |
if (!this.isValid()) {
|
3354 |
return NaN;
|
@@ -3365,26 +3910,49 @@
|
|
3365 |
units = normalizeUnits(units);
|
3366 |
|
3367 |
switch (units) {
|
3368 |
-
case 'year':
|
3369 |
-
|
3370 |
-
|
3371 |
-
case '
|
3372 |
-
|
3373 |
-
|
3374 |
-
case '
|
3375 |
-
|
3376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3377 |
}
|
3378 |
|
3379 |
return asFloat ? output : absFloor(output);
|
3380 |
}
|
3381 |
|
3382 |
-
function monthDiff
|
|
|
|
|
|
|
|
|
|
|
3383 |
// difference in months
|
3384 |
-
var wholeMonthDiff = (
|
3385 |
// b is in (anchor - 1 month, anchor + 1 month)
|
3386 |
anchor = a.clone().add(wholeMonthDiff, 'months'),
|
3387 |
-
anchor2,
|
|
|
3388 |
|
3389 |
if (b - anchor < 0) {
|
3390 |
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
|
@@ -3403,7 +3971,7 @@
|
|
3403 |
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
3404 |
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
|
3405 |
|
3406 |
-
function toString
|
3407 |
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
|
3408 |
}
|
3409 |
|
@@ -3411,20 +3979,30 @@
|
|
3411 |
if (!this.isValid()) {
|
3412 |
return null;
|
3413 |
}
|
3414 |
-
var utc = keepOffset !== true
|
3415 |
-
|
3416 |
if (m.year() < 0 || m.year() > 9999) {
|
3417 |
-
return formatMoment(
|
|
|
|
|
|
|
|
|
|
|
3418 |
}
|
3419 |
if (isFunction(Date.prototype.toISOString)) {
|
3420 |
// native implementation is ~50x faster, use it when we can
|
3421 |
if (utc) {
|
3422 |
return this.toDate().toISOString();
|
3423 |
} else {
|
3424 |
-
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
|
|
|
|
|
3425 |
}
|
3426 |
}
|
3427 |
-
return formatMoment(
|
|
|
|
|
|
|
3428 |
}
|
3429 |
|
3430 |
/**
|
@@ -3433,64 +4011,76 @@
|
|
3433 |
*
|
3434 |
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
|
3435 |
*/
|
3436 |
-
function inspect
|
3437 |
if (!this.isValid()) {
|
3438 |
return 'moment.invalid(/* ' + this._i + ' */)';
|
3439 |
}
|
3440 |
-
var func = 'moment'
|
3441 |
-
|
|
|
|
|
|
|
|
|
3442 |
if (!this.isLocal()) {
|
3443 |
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
|
3444 |
zone = 'Z';
|
3445 |
}
|
3446 |
-
|
3447 |
-
|
3448 |
-
|
3449 |
-
|
3450 |
|
3451 |
return this.format(prefix + year + datetime + suffix);
|
3452 |
}
|
3453 |
|
3454 |
-
function format
|
3455 |
if (!inputString) {
|
3456 |
-
inputString = this.isUtc()
|
|
|
|
|
3457 |
}
|
3458 |
var output = formatMoment(this, inputString);
|
3459 |
return this.localeData().postformat(output);
|
3460 |
}
|
3461 |
|
3462 |
-
function from
|
3463 |
-
if (
|
3464 |
-
|
3465 |
-
|
3466 |
-
|
|
|
|
|
|
|
3467 |
} else {
|
3468 |
return this.localeData().invalidDate();
|
3469 |
}
|
3470 |
}
|
3471 |
|
3472 |
-
function fromNow
|
3473 |
return this.from(createLocal(), withoutSuffix);
|
3474 |
}
|
3475 |
|
3476 |
-
function to
|
3477 |
-
if (
|
3478 |
-
|
3479 |
-
|
3480 |
-
|
|
|
|
|
|
|
3481 |
} else {
|
3482 |
return this.localeData().invalidDate();
|
3483 |
}
|
3484 |
}
|
3485 |
|
3486 |
-
function toNow
|
3487 |
return this.to(createLocal(), withoutSuffix);
|
3488 |
}
|
3489 |
|
3490 |
// If passed a locale key, it will set the locale for this
|
3491 |
// instance. Otherwise, it will return the locale configuration
|
3492 |
// variables for this instance.
|
3493 |
-
function locale
|
3494 |
var newLocaleData;
|
3495 |
|
3496 |
if (key === undefined) {
|
@@ -3515,86 +4105,198 @@
|
|
3515 |
}
|
3516 |
);
|
3517 |
|
3518 |
-
function localeData
|
3519 |
return this._locale;
|
3520 |
}
|
3521 |
|
3522 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3523 |
units = normalizeUnits(units);
|
3524 |
-
|
3525 |
-
|
|
|
|
|
|
|
|
|
3526 |
switch (units) {
|
3527 |
case 'year':
|
3528 |
-
this.
|
3529 |
-
|
3530 |
case 'quarter':
|
|
|
|
|
|
|
|
|
|
|
|
|
3531 |
case 'month':
|
3532 |
-
this.
|
3533 |
-
|
3534 |
case 'week':
|
|
|
|
|
|
|
|
|
|
|
|
|
3535 |
case 'isoWeek':
|
|
|
|
|
|
|
|
|
|
|
|
|
3536 |
case 'day':
|
3537 |
case 'date':
|
3538 |
-
this.
|
3539 |
-
|
3540 |
case 'hour':
|
3541 |
-
this.
|
3542 |
-
|
|
|
|
|
|
|
|
|
3543 |
case 'minute':
|
3544 |
-
this.
|
3545 |
-
|
|
|
3546 |
case 'second':
|
3547 |
-
this.
|
3548 |
-
|
3549 |
-
|
3550 |
-
// weeks are a special case
|
3551 |
-
if (units === 'week') {
|
3552 |
-
this.weekday(0);
|
3553 |
-
}
|
3554 |
-
if (units === 'isoWeek') {
|
3555 |
-
this.isoWeekday(1);
|
3556 |
-
}
|
3557 |
-
|
3558 |
-
// quarters are also special
|
3559 |
-
if (units === 'quarter') {
|
3560 |
-
this.month(Math.floor(this.month() / 3) * 3);
|
3561 |
}
|
3562 |
|
|
|
|
|
3563 |
return this;
|
3564 |
}
|
3565 |
|
3566 |
-
function endOf
|
|
|
3567 |
units = normalizeUnits(units);
|
3568 |
-
if (units === undefined || units === 'millisecond') {
|
3569 |
return this;
|
3570 |
}
|
3571 |
|
3572 |
-
|
3573 |
-
|
3574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3575 |
}
|
3576 |
|
3577 |
-
|
|
|
|
|
3578 |
}
|
3579 |
|
3580 |
-
function valueOf
|
3581 |
-
return this._d.valueOf() - (
|
3582 |
}
|
3583 |
|
3584 |
-
function unix
|
3585 |
return Math.floor(this.valueOf() / 1000);
|
3586 |
}
|
3587 |
|
3588 |
-
function toDate
|
3589 |
return new Date(this.valueOf());
|
3590 |
}
|
3591 |
|
3592 |
-
function toArray
|
3593 |
var m = this;
|
3594 |
-
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3595 |
}
|
3596 |
|
3597 |
-
function toObject
|
3598 |
var m = this;
|
3599 |
return {
|
3600 |
years: m.year(),
|
@@ -3603,24 +4305,24 @@
|
|
3603 |
hours: m.hours(),
|
3604 |
minutes: m.minutes(),
|
3605 |
seconds: m.seconds(),
|
3606 |
-
milliseconds: m.milliseconds()
|
3607 |
};
|
3608 |
}
|
3609 |
|
3610 |
-
function toJSON
|
3611 |
// new Date(NaN).toJSON() === null
|
3612 |
return this.isValid() ? this.toISOString() : null;
|
3613 |
}
|
3614 |
|
3615 |
-
function isValid$2
|
3616 |
return isValid(this);
|
3617 |
}
|
3618 |
|
3619 |
-
function parsingFlags
|
3620 |
return extend({}, getParsingFlags(this));
|
3621 |
}
|
3622 |
|
3623 |
-
function invalidAt
|
3624 |
return getParsingFlags(this).overflow;
|
3625 |
}
|
3626 |
|
@@ -3630,10 +4332,291 @@
|
|
3630 |
format: this._f,
|
3631 |
locale: this._locale,
|
3632 |
isUTC: this._isUTC,
|
3633 |
-
strict: this._strict
|
3634 |
};
|
3635 |
}
|
3636 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3637 |
// FORMATTING
|
3638 |
|
3639 |
addFormatToken(0, ['gg', 2], 0, function () {
|
@@ -3644,13 +4627,13 @@
|
|
3644 |
return this.isoWeekYear() % 100;
|
3645 |
});
|
3646 |
|
3647 |
-
function addWeekYearFormatToken
|
3648 |
addFormatToken(0, [token, token.length], 0, getter);
|
3649 |
}
|
3650 |
|
3651 |
-
addWeekYearFormatToken('gggg',
|
3652 |
-
addWeekYearFormatToken('ggggg',
|
3653 |
-
addWeekYearFormatToken('GGGG',
|
3654 |
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
|
3655 |
|
3656 |
// ALIASES
|
@@ -3663,19 +4646,23 @@
|
|
3663 |
addUnitPriority('weekYear', 1);
|
3664 |
addUnitPriority('isoWeekYear', 1);
|
3665 |
|
3666 |
-
|
3667 |
// PARSING
|
3668 |
|
3669 |
-
addRegexToken('G',
|
3670 |
-
addRegexToken('g',
|
3671 |
-
addRegexToken('GG',
|
3672 |
-
addRegexToken('gg',
|
3673 |
-
addRegexToken('GGGG',
|
3674 |
-
addRegexToken('gggg',
|
3675 |
-
addRegexToken('GGGGG',
|
3676 |
-
addRegexToken('ggggg',
|
3677 |
-
|
3678 |
-
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
|
|
|
|
|
|
|
|
|
|
|
3679 |
week[token.substr(0, 2)] = toInt(input);
|
3680 |
});
|
3681 |
|
@@ -3685,29 +4672,46 @@
|
|
3685 |
|
3686 |
// MOMENTS
|
3687 |
|
3688 |
-
function getSetWeekYear
|
3689 |
-
return getSetWeekYearHelper.call(
|
3690 |
-
|
3691 |
-
|
3692 |
-
|
3693 |
-
|
3694 |
-
|
|
|
|
|
3695 |
}
|
3696 |
|
3697 |
-
function getSetISOWeekYear
|
3698 |
-
return getSetWeekYearHelper.call(
|
3699 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3700 |
}
|
3701 |
|
3702 |
-
function getISOWeeksInYear
|
3703 |
return weeksInYear(this.year(), 1, 4);
|
3704 |
}
|
3705 |
|
3706 |
-
function
|
|
|
|
|
|
|
|
|
3707 |
var weekInfo = this.localeData()._week;
|
3708 |
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
3709 |
}
|
3710 |
|
|
|
|
|
|
|
|
|
|
|
3711 |
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
3712 |
var weeksTarget;
|
3713 |
if (input == null) {
|
@@ -3752,8 +4756,10 @@
|
|
3752 |
|
3753 |
// MOMENTS
|
3754 |
|
3755 |
-
function getSetQuarter
|
3756 |
-
return input == null
|
|
|
|
|
3757 |
}
|
3758 |
|
3759 |
// FORMATTING
|
@@ -3769,13 +4775,13 @@
|
|
3769 |
|
3770 |
// PARSING
|
3771 |
|
3772 |
-
addRegexToken('D',
|
3773 |
addRegexToken('DD', match1to2, match2);
|
3774 |
addRegexToken('Do', function (isStrict, locale) {
|
3775 |
// TODO: Remove "ordinalParse" fallback in next major release.
|
3776 |
-
return isStrict
|
3777 |
-
|
3778 |
-
|
3779 |
});
|
3780 |
|
3781 |
addParseToken(['D', 'DD'], DATE);
|
@@ -3800,7 +4806,7 @@
|
|
3800 |
|
3801 |
// PARSING
|
3802 |
|
3803 |
-
addRegexToken('DDD',
|
3804 |
addRegexToken('DDDD', match3);
|
3805 |
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
|
3806 |
config._dayOfYear = toInt(input);
|
@@ -3810,9 +4816,12 @@
|
|
3810 |
|
3811 |
// MOMENTS
|
3812 |
|
3813 |
-
function getSetDayOfYear
|
3814 |
-
var dayOfYear =
|
3815 |
-
|
|
|
|
|
|
|
3816 |
}
|
3817 |
|
3818 |
// FORMATTING
|
@@ -3829,7 +4838,7 @@
|
|
3829 |
|
3830 |
// PARSING
|
3831 |
|
3832 |
-
addRegexToken('m',
|
3833 |
addRegexToken('mm', match1to2, match2);
|
3834 |
addParseToken(['m', 'mm'], MINUTE);
|
3835 |
|
@@ -3851,7 +4860,7 @@
|
|
3851 |
|
3852 |
// PARSING
|
3853 |
|
3854 |
-
addRegexToken('s',
|
3855 |
addRegexToken('ss', match1to2, match2);
|
3856 |
addParseToken(['s', 'ss'], SECOND);
|
3857 |
|
@@ -3889,7 +4898,6 @@
|
|
3889 |
return this.millisecond() * 1000000;
|
3890 |
});
|
3891 |
|
3892 |
-
|
3893 |
// ALIASES
|
3894 |
|
3895 |
addUnitAlias('millisecond', 'ms');
|
@@ -3900,11 +4908,11 @@
|
|
3900 |
|
3901 |
// PARSING
|
3902 |
|
3903 |
-
addRegexToken('S',
|
3904 |
-
addRegexToken('SS',
|
3905 |
-
addRegexToken('SSS',
|
3906 |
|
3907 |
-
var token;
|
3908 |
for (token = 'SSSS'; token.length <= 9; token += 'S') {
|
3909 |
addRegexToken(token, matchUnsigned);
|
3910 |
}
|
@@ -3916,155 +4924,186 @@
|
|
3916 |
for (token = 'S'; token.length <= 9; token += 'S') {
|
3917 |
addParseToken(token, parseMs);
|
3918 |
}
|
3919 |
-
// MOMENTS
|
3920 |
|
3921 |
-
|
3922 |
|
3923 |
// FORMATTING
|
3924 |
|
3925 |
-
addFormatToken('z',
|
3926 |
addFormatToken('zz', 0, 0, 'zoneName');
|
3927 |
|
3928 |
// MOMENTS
|
3929 |
|
3930 |
-
function getZoneAbbr
|
3931 |
return this._isUTC ? 'UTC' : '';
|
3932 |
}
|
3933 |
|
3934 |
-
function getZoneName
|
3935 |
return this._isUTC ? 'Coordinated Universal Time' : '';
|
3936 |
}
|
3937 |
|
3938 |
var proto = Moment.prototype;
|
3939 |
|
3940 |
-
proto.add
|
3941 |
-
proto.calendar
|
3942 |
-
proto.clone
|
3943 |
-
proto.diff
|
3944 |
-
proto.endOf
|
3945 |
-
proto.format
|
3946 |
-
proto.from
|
3947 |
-
proto.fromNow
|
3948 |
-
proto.to
|
3949 |
-
proto.toNow
|
3950 |
-
proto.get
|
3951 |
-
proto.invalidAt
|
3952 |
-
proto.isAfter
|
3953 |
-
proto.isBefore
|
3954 |
-
proto.isBetween
|
3955 |
-
proto.isSame
|
3956 |
-
proto.isSameOrAfter
|
3957 |
-
proto.isSameOrBefore
|
3958 |
-
proto.isValid
|
3959 |
-
proto.lang
|
3960 |
-
proto.locale
|
3961 |
-
proto.localeData
|
3962 |
-
proto.max
|
3963 |
-
proto.min
|
3964 |
-
proto.parsingFlags
|
3965 |
-
proto.set
|
3966 |
-
proto.startOf
|
3967 |
-
proto.subtract
|
3968 |
-
proto.toArray
|
3969 |
-
proto.toObject
|
3970 |
-
proto.toDate
|
3971 |
-
proto.toISOString
|
3972 |
-
proto.inspect
|
3973 |
-
|
3974 |
-
|
3975 |
-
|
3976 |
-
|
3977 |
-
|
3978 |
-
proto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3979 |
proto.isLeapYear = getIsLeapYear;
|
3980 |
-
proto.weekYear
|
3981 |
proto.isoWeekYear = getSetISOWeekYear;
|
3982 |
proto.quarter = proto.quarters = getSetQuarter;
|
3983 |
-
proto.month
|
3984 |
proto.daysInMonth = getDaysInMonth;
|
3985 |
-
proto.week
|
3986 |
-
proto.isoWeek
|
3987 |
-
proto.weeksInYear
|
|
|
3988 |
proto.isoWeeksInYear = getISOWeeksInYear;
|
3989 |
-
proto.
|
3990 |
-
proto.
|
3991 |
-
proto.
|
|
|
3992 |
proto.isoWeekday = getSetISODayOfWeek;
|
3993 |
-
proto.dayOfYear
|
3994 |
proto.hour = proto.hours = getSetHour;
|
3995 |
proto.minute = proto.minutes = getSetMinute;
|
3996 |
proto.second = proto.seconds = getSetSecond;
|
3997 |
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
3998 |
-
proto.utcOffset
|
3999 |
-
proto.utc
|
4000 |
-
proto.local
|
4001 |
-
proto.parseZone
|
4002 |
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
4003 |
-
proto.isDST
|
4004 |
-
proto.isLocal
|
4005 |
-
proto.isUtcOffset
|
4006 |
-
proto.isUtc
|
4007 |
-
proto.isUTC
|
4008 |
proto.zoneAbbr = getZoneAbbr;
|
4009 |
proto.zoneName = getZoneName;
|
4010 |
-
proto.dates
|
4011 |
-
|
4012 |
-
|
4013 |
-
|
4014 |
-
proto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4015 |
|
4016 |
-
function createUnix
|
4017 |
return createLocal(input * 1000);
|
4018 |
}
|
4019 |
|
4020 |
-
function createInZone
|
4021 |
return createLocal.apply(null, arguments).parseZone();
|
4022 |
}
|
4023 |
|
4024 |
-
function preParsePostFormat
|
4025 |
return string;
|
4026 |
}
|
4027 |
|
4028 |
var proto$1 = Locale.prototype;
|
4029 |
|
4030 |
-
proto$1.calendar
|
4031 |
-
proto$1.longDateFormat
|
4032 |
-
proto$1.invalidDate
|
4033 |
-
proto$1.ordinal
|
4034 |
-
proto$1.preparse
|
4035 |
-
proto$1.postformat
|
4036 |
-
proto$1.relativeTime
|
4037 |
-
proto$1.pastFuture
|
4038 |
-
proto$1.set
|
4039 |
-
|
4040 |
-
proto$1.
|
4041 |
-
proto$1.
|
4042 |
-
proto$1.
|
4043 |
-
proto$1.
|
4044 |
-
proto$1.
|
|
|
|
|
|
|
|
|
|
|
|
|
4045 |
proto$1.week = localeWeek;
|
4046 |
proto$1.firstDayOfYear = localeFirstDayOfYear;
|
4047 |
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
4048 |
|
4049 |
-
proto$1.weekdays
|
4050 |
-
proto$1.weekdaysMin
|
4051 |
-
proto$1.weekdaysShort
|
4052 |
-
proto$1.weekdaysParse
|
4053 |
|
4054 |
-
proto$1.weekdaysRegex
|
4055 |
-
proto$1.weekdaysShortRegex
|
4056 |
-
proto$1.weekdaysMinRegex
|
4057 |
|
4058 |
proto$1.isPM = localeIsPM;
|
4059 |
proto$1.meridiem = localeMeridiem;
|
4060 |
|
4061 |
-
function get$1
|
4062 |
-
var locale = getLocale()
|
4063 |
-
|
4064 |
return locale[field](utc, format);
|
4065 |
}
|
4066 |
|
4067 |
-
function listMonthsImpl
|
4068 |
if (isNumber(format)) {
|
4069 |
index = format;
|
4070 |
format = undefined;
|
@@ -4076,8 +5115,8 @@
|
|
4076 |
return get$1(format, index, field, 'month');
|
4077 |
}
|
4078 |
|
4079 |
-
var i
|
4080 |
-
|
4081 |
for (i = 0; i < 12; i++) {
|
4082 |
out[i] = get$1(format, i, field, 'month');
|
4083 |
}
|
@@ -4092,7 +5131,7 @@
|
|
4092 |
// (true, 5)
|
4093 |
// (true, fmt, 5)
|
4094 |
// (true, fmt)
|
4095 |
-
function listWeekdaysImpl
|
4096 |
if (typeof localeSorted === 'boolean') {
|
4097 |
if (isNumber(format)) {
|
4098 |
index = format;
|
@@ -4114,97 +5153,127 @@
|
|
4114 |
}
|
4115 |
|
4116 |
var locale = getLocale(),
|
4117 |
-
shift = localeSorted ? locale._week.dow : 0
|
|
|
|
|
4118 |
|
4119 |
if (index != null) {
|
4120 |
return get$1(format, (index + shift) % 7, field, 'day');
|
4121 |
}
|
4122 |
|
4123 |
-
var i;
|
4124 |
-
var out = [];
|
4125 |
for (i = 0; i < 7; i++) {
|
4126 |
out[i] = get$1(format, (i + shift) % 7, field, 'day');
|
4127 |
}
|
4128 |
return out;
|
4129 |
}
|
4130 |
|
4131 |
-
function listMonths
|
4132 |
return listMonthsImpl(format, index, 'months');
|
4133 |
}
|
4134 |
|
4135 |
-
function listMonthsShort
|
4136 |
return listMonthsImpl(format, index, 'monthsShort');
|
4137 |
}
|
4138 |
|
4139 |
-
function listWeekdays
|
4140 |
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
|
4141 |
}
|
4142 |
|
4143 |
-
function listWeekdaysShort
|
4144 |
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
|
4145 |
}
|
4146 |
|
4147 |
-
function listWeekdaysMin
|
4148 |
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
|
4149 |
}
|
4150 |
|
4151 |
getSetGlobalLocale('en', {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4152 |
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
4153 |
-
ordinal
|
4154 |
var b = number % 10,
|
4155 |
-
output =
|
4156 |
-
|
4157 |
-
|
4158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4159 |
return number + output;
|
4160 |
-
}
|
4161 |
});
|
4162 |
|
4163 |
// Side effect imports
|
4164 |
|
4165 |
-
hooks.lang = deprecate(
|
4166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4167 |
|
4168 |
var mathAbs = Math.abs;
|
4169 |
|
4170 |
-
function abs
|
4171 |
-
var data
|
4172 |
|
4173 |
this._milliseconds = mathAbs(this._milliseconds);
|
4174 |
-
this._days
|
4175 |
-
this._months
|
4176 |
|
4177 |
-
data.milliseconds
|
4178 |
-
data.seconds
|
4179 |
-
data.minutes
|
4180 |
-
data.hours
|
4181 |
-
data.months
|
4182 |
-
data.years
|
4183 |
|
4184 |
return this;
|
4185 |
}
|
4186 |
|
4187 |
-
function addSubtract$1
|
4188 |
var other = createDuration(input, value);
|
4189 |
|
4190 |
duration._milliseconds += direction * other._milliseconds;
|
4191 |
-
duration._days
|
4192 |
-
duration._months
|
4193 |
|
4194 |
return duration._bubble();
|
4195 |
}
|
4196 |
|
4197 |
// supports only 2.0-style add(1, 's') or add(duration)
|
4198 |
-
function add$1
|
4199 |
return addSubtract$1(this, input, value, 1);
|
4200 |
}
|
4201 |
|
4202 |
// supports only 2.0-style subtract(1, 's') or subtract(duration)
|
4203 |
-
function subtract$1
|
4204 |
return addSubtract$1(this, input, value, -1);
|
4205 |
}
|
4206 |
|
4207 |
-
function absCeil
|
4208 |
if (number < 0) {
|
4209 |
return Math.floor(number);
|
4210 |
} else {
|
@@ -4212,17 +5281,25 @@
|
|
4212 |
}
|
4213 |
}
|
4214 |
|
4215 |
-
function bubble
|
4216 |
-
var milliseconds = this._milliseconds
|
4217 |
-
|
4218 |
-
|
4219 |
-
|
4220 |
-
|
|
|
|
|
|
|
|
|
4221 |
|
4222 |
// if we have a mix of positive and negative values, bubble down first
|
4223 |
// check: https://github.com/moment/moment/issues/2166
|
4224 |
-
if (
|
4225 |
-
|
|
|
|
|
|
|
|
|
4226 |
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
|
4227 |
days = 0;
|
4228 |
months = 0;
|
@@ -4232,14 +5309,14 @@
|
|
4232 |
// examples of what that means.
|
4233 |
data.milliseconds = milliseconds % 1000;
|
4234 |
|
4235 |
-
seconds
|
4236 |
-
data.seconds
|
4237 |
|
4238 |
-
minutes
|
4239 |
-
data.minutes
|
4240 |
|
4241 |
-
hours
|
4242 |
-
data.hours
|
4243 |
|
4244 |
days += absFloor(hours / 24);
|
4245 |
|
@@ -4252,56 +5329,70 @@
|
|
4252 |
years = absFloor(months / 12);
|
4253 |
months %= 12;
|
4254 |
|
4255 |
-
data.days
|
4256 |
data.months = months;
|
4257 |
-
data.years
|
4258 |
|
4259 |
return this;
|
4260 |
}
|
4261 |
|
4262 |
-
function daysToMonths
|
4263 |
// 400 years have 146097 days (taking into account leap year rules)
|
4264 |
// 400 years have 12 months === 4800
|
4265 |
-
return days * 4800 / 146097;
|
4266 |
}
|
4267 |
|
4268 |
-
function monthsToDays
|
4269 |
// the reverse of daysToMonths
|
4270 |
-
return months * 146097 / 4800;
|
4271 |
}
|
4272 |
|
4273 |
-
function as
|
4274 |
if (!this.isValid()) {
|
4275 |
return NaN;
|
4276 |
}
|
4277 |
-
var days
|
4278 |
-
|
4279 |
-
|
4280 |
|
4281 |
units = normalizeUnits(units);
|
4282 |
|
4283 |
-
if (units === 'month' || units === 'year') {
|
4284 |
-
days
|
4285 |
months = this._months + daysToMonths(days);
|
4286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4287 |
} else {
|
4288 |
// handle milliseconds separately because of floating point math errors (issue #1867)
|
4289 |
days = this._days + Math.round(monthsToDays(this._months));
|
4290 |
switch (units) {
|
4291 |
-
case 'week'
|
4292 |
-
|
4293 |
-
case '
|
4294 |
-
|
4295 |
-
case '
|
|
|
|
|
|
|
|
|
|
|
4296 |
// Math.floor prevents floating point math errors here
|
4297 |
-
case 'millisecond':
|
4298 |
-
|
|
|
|
|
4299 |
}
|
4300 |
}
|
4301 |
}
|
4302 |
|
4303 |
// TODO: Use this.as('ms')?
|
4304 |
-
function valueOf$1
|
4305 |
if (!this.isValid()) {
|
4306 |
return NaN;
|
4307 |
}
|
@@ -4313,26 +5404,27 @@
|
|
4313 |
);
|
4314 |
}
|
4315 |
|
4316 |
-
function makeAs
|
4317 |
return function () {
|
4318 |
return this.as(alias);
|
4319 |
};
|
4320 |
}
|
4321 |
|
4322 |
-
var asMilliseconds = makeAs('ms')
|
4323 |
-
|
4324 |
-
|
4325 |
-
|
4326 |
-
|
4327 |
-
|
4328 |
-
|
4329 |
-
|
|
|
4330 |
|
4331 |
-
function clone$1
|
4332 |
return createDuration(this);
|
4333 |
}
|
4334 |
|
4335 |
-
function get$2
|
4336 |
units = normalizeUnits(units);
|
4337 |
return this.isValid() ? this[units + 's']() : NaN;
|
4338 |
}
|
@@ -4343,53 +5435,63 @@
|
|
4343 |
};
|
4344 |
}
|
4345 |
|
4346 |
-
var milliseconds = makeGetter('milliseconds')
|
4347 |
-
|
4348 |
-
|
4349 |
-
|
4350 |
-
|
4351 |
-
|
4352 |
-
|
4353 |
|
4354 |
-
function weeks
|
4355 |
return absFloor(this.days() / 7);
|
4356 |
}
|
4357 |
|
4358 |
-
var round = Math.round
|
4359 |
-
|
4360 |
-
|
4361 |
-
|
4362 |
-
|
4363 |
-
|
4364 |
-
|
4365 |
-
|
4366 |
-
|
|
|
4367 |
|
4368 |
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
|
4369 |
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
|
4370 |
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
|
4371 |
}
|
4372 |
|
4373 |
-
function relativeTime$1
|
4374 |
-
var duration = createDuration(posNegDuration).abs()
|
4375 |
-
|
4376 |
-
|
4377 |
-
|
4378 |
-
|
4379 |
-
|
4380 |
-
|
4381 |
-
|
4382 |
-
|
4383 |
-
seconds
|
4384 |
-
|
4385 |
-
minutes
|
4386 |
-
|
4387 |
-
hours
|
4388 |
-
|
4389 |
-
days
|
4390 |
-
|
4391 |
-
|
4392 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4393 |
|
4394 |
a[2] = withoutSuffix;
|
4395 |
a[3] = +posNegDuration > 0;
|
@@ -4398,11 +5500,11 @@
|
|
4398 |
}
|
4399 |
|
4400 |
// This function allows you to set the rounding function for relative time strings
|
4401 |
-
function getSetRelativeTimeRounding
|
4402 |
if (roundingFunction === undefined) {
|
4403 |
return round;
|
4404 |
}
|
4405 |
-
if (typeof
|
4406 |
round = roundingFunction;
|
4407 |
return true;
|
4408 |
}
|
@@ -4410,7 +5512,7 @@
|
|
4410 |
}
|
4411 |
|
4412 |
// This function allows you to set a threshold for relative time strings
|
4413 |
-
function getSetRelativeTimeThreshold
|
4414 |
if (thresholds[threshold] === undefined) {
|
4415 |
return false;
|
4416 |
}
|
@@ -4424,13 +5526,32 @@
|
|
4424 |
return true;
|
4425 |
}
|
4426 |
|
4427 |
-
function humanize
|
4428 |
if (!this.isValid()) {
|
4429 |
return this.localeData().invalidDate();
|
4430 |
}
|
4431 |
|
4432 |
-
var
|
4433 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4434 |
|
4435 |
if (withSuffix) {
|
4436 |
output = locale.pastFuture(+this, output);
|
@@ -4442,7 +5563,7 @@
|
|
4442 |
var abs$1 = Math.abs;
|
4443 |
|
4444 |
function sign(x) {
|
4445 |
-
return (
|
4446 |
}
|
4447 |
|
4448 |
function toISOString$1() {
|
@@ -4457,91 +5578,97 @@
|
|
4457 |
return this.localeData().invalidDate();
|
4458 |
}
|
4459 |
|
4460 |
-
var seconds = abs$1(this._milliseconds) / 1000
|
4461 |
-
|
4462 |
-
|
4463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4464 |
|
4465 |
// 3600 seconds -> 60 minutes -> 1 hour
|
4466 |
-
minutes
|
4467 |
-
hours
|
4468 |
seconds %= 60;
|
4469 |
minutes %= 60;
|
4470 |
|
4471 |
// 12 months -> 1 year
|
4472 |
-
years
|
4473 |
months %= 12;
|
4474 |
|
4475 |
-
|
4476 |
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
|
4477 |
-
|
4478 |
-
var M = months;
|
4479 |
-
var D = days;
|
4480 |
-
var h = hours;
|
4481 |
-
var m = minutes;
|
4482 |
-
var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
|
4483 |
-
var total = this.asSeconds();
|
4484 |
|
4485 |
-
|
4486 |
-
|
4487 |
-
|
4488 |
-
|
4489 |
-
}
|
4490 |
|
4491 |
-
|
4492 |
-
|
4493 |
-
|
4494 |
-
|
4495 |
-
|
4496 |
-
|
4497 |
-
(
|
4498 |
-
(
|
4499 |
-
(
|
4500 |
-
(
|
4501 |
-
|
4502 |
-
(m ? hmsSign + m + 'M' : '') +
|
4503 |
-
(s ? hmsSign + s + 'S' : '');
|
4504 |
}
|
4505 |
|
4506 |
var proto$2 = Duration.prototype;
|
4507 |
|
4508 |
-
proto$2.isValid
|
4509 |
-
proto$2.abs
|
4510 |
-
proto$2.add
|
4511 |
-
proto$2.subtract
|
4512 |
-
proto$2.as
|
4513 |
proto$2.asMilliseconds = asMilliseconds;
|
4514 |
-
proto$2.asSeconds
|
4515 |
-
proto$2.asMinutes
|
4516 |
-
proto$2.asHours
|
4517 |
-
proto$2.asDays
|
4518 |
-
proto$2.asWeeks
|
4519 |
-
proto$2.asMonths
|
4520 |
-
proto$2.
|
4521 |
-
proto$2.
|
4522 |
-
proto$2.
|
4523 |
-
proto$2.
|
4524 |
-
proto$2.
|
4525 |
-
proto$2.
|
4526 |
-
proto$2.
|
4527 |
-
proto$2.
|
4528 |
-
proto$2.
|
4529 |
-
proto$2.
|
4530 |
-
proto$2.
|
4531 |
-
proto$2.
|
4532 |
-
proto$2.
|
4533 |
-
proto$2.
|
4534 |
-
proto$2.
|
4535 |
-
proto$2.
|
4536 |
-
proto$2.
|
4537 |
-
proto$2.
|
4538 |
-
proto$2.
|
4539 |
-
|
4540 |
-
|
|
|
|
|
|
|
|
|
4541 |
proto$2.lang = lang;
|
4542 |
|
4543 |
-
// Side effect imports
|
4544 |
-
|
4545 |
// FORMATTING
|
4546 |
|
4547 |
addFormatToken('X', 0, 0, 'unix');
|
@@ -4552,65 +5679,95 @@
|
|
4552 |
addRegexToken('x', matchSigned);
|
4553 |
addRegexToken('X', matchTimestamp);
|
4554 |
addParseToken('X', function (input, array, config) {
|
4555 |
-
config._d = new Date(parseFloat(input
|
4556 |
});
|
4557 |
addParseToken('x', function (input, array, config) {
|
4558 |
config._d = new Date(toInt(input));
|
4559 |
});
|
4560 |
|
4561 |
-
|
4562 |
-
|
4563 |
|
4564 |
-
hooks.version = '2.
|
4565 |
|
4566 |
setHookCallback(createLocal);
|
4567 |
|
4568 |
-
hooks.fn
|
4569 |
-
hooks.min
|
4570 |
-
hooks.max
|
4571 |
-
hooks.now
|
4572 |
-
hooks.utc
|
4573 |
-
hooks.unix
|
4574 |
-
hooks.months
|
4575 |
-
hooks.isDate
|
4576 |
-
hooks.locale
|
4577 |
-
hooks.invalid
|
4578 |
-
hooks.duration
|
4579 |
-
hooks.isMoment
|
4580 |
-
hooks.weekdays
|
4581 |
-
hooks.parseZone
|
4582 |
-
hooks.localeData
|
4583 |
-
hooks.isDuration
|
4584 |
-
hooks.monthsShort
|
4585 |
-
hooks.weekdaysMin
|
4586 |
-
hooks.defineLocale
|
4587 |
-
hooks.updateLocale
|
4588 |
-
hooks.locales
|
4589 |
-
hooks.weekdaysShort
|
4590 |
-
hooks.normalizeUnits
|
4591 |
-
hooks.relativeTimeRounding
|
4592 |
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
4593 |
-
hooks.calendarFormat
|
4594 |
-
hooks.prototype
|
4595 |
|
4596 |
// currently HTML5 input type only supports 24-hour formats
|
4597 |
hooks.HTML5_FMT = {
|
4598 |
-
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',
|
4599 |
-
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',
|
4600 |
-
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',
|
4601 |
-
DATE: 'YYYY-MM-DD',
|
4602 |
-
TIME: 'HH:mm',
|
4603 |
-
TIME_SECONDS: 'HH:mm:ss',
|
4604 |
-
TIME_MS: 'HH:mm:ss.SSS',
|
4605 |
-
WEEK: 'GGGG-[W]WW',
|
4606 |
-
MONTH: 'YYYY-MM'
|
4607 |
};
|
4608 |
|
4609 |
return hooks;
|
4610 |
|
4611 |
})));
|
4612 |
|
4613 |
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4614 |
|
4615 |
/***/ }),
|
4616 |
/* 2 */
|
@@ -4658,7 +5815,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
4658 |
|
4659 |
"use strict";
|
4660 |
/* harmony export (immutable) */ __webpack_exports__["a"] = _possibleConstructorReturn;
|
4661 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helpers_esm_typeof__ = __webpack_require__(
|
4662 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__assertThisInitialized__ = __webpack_require__(9);
|
4663 |
|
4664 |
|
@@ -4689,7 +5846,7 @@ function _getPrototypeOf(o) {
|
|
4689 |
|
4690 |
"use strict";
|
4691 |
/* harmony export (immutable) */ __webpack_exports__["a"] = _inherits;
|
4692 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setPrototypeOf__ = __webpack_require__(
|
4693 |
|
4694 |
function _inherits(subClass, superClass) {
|
4695 |
if (typeof superClass !== "function" && superClass !== null) {
|
@@ -4748,6 +5905,21 @@ function _assertThisInitialized(self) {
|
|
4748 |
/* 10 */
|
4749 |
/***/ (function(module, exports, __webpack_require__) {
|
4750 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4751 |
/* WEBPACK VAR INJECTION */(function(process) {/**
|
4752 |
* Copyright (c) 2013-present, Facebook, Inc.
|
4753 |
*
|
@@ -4756,46 +5928,49 @@ function _assertThisInitialized(self) {
|
|
4756 |
*/
|
4757 |
|
4758 |
if (process.env.NODE_ENV !== 'production') {
|
4759 |
-
var
|
4760 |
-
Symbol.for &&
|
4761 |
-
Symbol.for('react.element')) ||
|
4762 |
-
0xeac7;
|
4763 |
-
|
4764 |
-
var isValidElement = function(object) {
|
4765 |
-
return typeof object === 'object' &&
|
4766 |
-
object !== null &&
|
4767 |
-
object.$$typeof === REACT_ELEMENT_TYPE;
|
4768 |
-
};
|
4769 |
|
4770 |
// By explicitly using `prop-types` you are opting into new development behavior.
|
4771 |
// http://fb.me/prop-types-in-prod
|
4772 |
var throwOnDirectAccess = true;
|
4773 |
-
module.exports = __webpack_require__(
|
4774 |
} else {
|
4775 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
4776 |
// http://fb.me/prop-types-in-prod
|
4777 |
-
module.exports = __webpack_require__(
|
4778 |
}
|
4779 |
|
4780 |
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(
|
4781 |
|
4782 |
/***/ }),
|
4783 |
-
/*
|
4784 |
-
/***/ (function(module,
|
4785 |
|
4786 |
"use strict";
|
4787 |
-
/*
|
|
|
4788 |
|
4789 |
-
|
4790 |
-
|
4791 |
-
|
4792 |
-
|
4793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4794 |
|
4795 |
-
|
|
|
4796 |
|
4797 |
/***/ }),
|
4798 |
-
/*
|
4799 |
/***/ (function(module, exports, __webpack_require__) {
|
4800 |
|
4801 |
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
@@ -4854,57 +6029,57 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
4854 |
|
4855 |
|
4856 |
/***/ }),
|
4857 |
-
/*
|
4858 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4859 |
|
4860 |
"use strict";
|
4861 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] =
|
4862 |
-
|
4863 |
-
|
4864 |
-
|
4865 |
-
|
4866 |
-
|
4867 |
-
|
4868 |
-
|
4869 |
-
|
4870 |
-
|
4871 |
-
|
4872 |
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
4873 |
-
key = sourceSymbolKeys[i];
|
4874 |
-
if (excluded.indexOf(key) >= 0) continue;
|
4875 |
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
4876 |
-
target[key] = source[key];
|
4877 |
-
}
|
4878 |
}
|
4879 |
|
4880 |
-
return
|
4881 |
}
|
4882 |
|
4883 |
/***/ }),
|
4884 |
-
/*
|
4885 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4886 |
|
4887 |
"use strict";
|
4888 |
-
/* harmony import */ var
|
4889 |
-
/* harmony
|
4890 |
-
/* harmony import */ var
|
4891 |
-
/* harmony reexport (
|
4892 |
-
/* harmony
|
4893 |
-
/*
|
4894 |
-
/* harmony
|
4895 |
-
/*
|
4896 |
-
/* harmony
|
4897 |
-
/* harmony reexport (
|
4898 |
-
/* harmony
|
4899 |
-
/* harmony reexport (
|
4900 |
-
/* harmony
|
4901 |
-
/* harmony reexport (
|
4902 |
-
/* harmony
|
4903 |
-
/*
|
4904 |
-
/* harmony
|
4905 |
-
|
4906 |
-
|
4907 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
4908 |
|
4909 |
|
4910 |
|
@@ -4912,21 +6087,40 @@ function _objectWithoutProperties(source, excluded) {
|
|
4912 |
|
4913 |
|
4914 |
|
|
|
4915 |
|
4916 |
-
|
4917 |
-
|
4918 |
-
|
4919 |
-
|
4920 |
-
|
4921 |
-
*
|
4922 |
-
* @return {Function} Returns the new composite function.
|
4923 |
-
*/
|
4924 |
|
4925 |
|
4926 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4927 |
|
4928 |
/***/ }),
|
4929 |
-
/*
|
4930 |
/***/ (function(module, exports, __webpack_require__) {
|
4931 |
|
4932 |
"use strict";
|
@@ -4971,289 +6165,288 @@ var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;
|
|
4971 |
var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
|
4972 |
|
4973 |
/***/ }),
|
4974 |
-
/*
|
4975 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4976 |
|
4977 |
"use strict";
|
4978 |
-
/* harmony
|
4979 |
-
/* harmony
|
4980 |
-
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
|
4987 |
-
|
4988 |
-
|
4989 |
-
|
4990 |
-
|
4991 |
-
|
4992 |
-
|
4993 |
-
|
4994 |
-
|
4995 |
-
|
4996 |
-
|
4997 |
-
|
4998 |
-
|
4999 |
-
|
5000 |
-
|
5001 |
-
/*
|
5002 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5003 |
|
5004 |
-
|
5005 |
-
value: true
|
5006 |
-
});
|
5007 |
-
exports["default"] = wrapValidator;
|
5008 |
|
5009 |
-
var _object = __webpack_require__(18);
|
5010 |
|
5011 |
-
var _object2 = _interopRequireDefault(_object);
|
5012 |
|
5013 |
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
5014 |
|
5015 |
-
function wrapValidator(validator, typeName) {
|
5016 |
-
var typeChecker = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
5017 |
|
5018 |
-
return (0, _object2["default"])(validator.bind(), {
|
5019 |
-
typeName: typeName,
|
5020 |
-
typeChecker: typeChecker,
|
5021 |
-
isRequired: (0, _object2["default"])(validator.isRequired.bind(), {
|
5022 |
-
typeName: typeName,
|
5023 |
-
typeChecker: typeChecker,
|
5024 |
-
typeRequired: true
|
5025 |
-
})
|
5026 |
-
});
|
5027 |
-
}
|
5028 |
-
//# sourceMappingURL=wrapValidator.js.map
|
5029 |
|
5030 |
-
|
5031 |
-
/* 18 */
|
5032 |
-
/***/ (function(module, exports, __webpack_require__) {
|
5033 |
|
5034 |
-
"use strict";
|
5035 |
|
5036 |
|
5037 |
-
var defineProperties = __webpack_require__(25);
|
5038 |
|
5039 |
-
var implementation = __webpack_require__(276);
|
5040 |
-
var getPolyfill = __webpack_require__(277);
|
5041 |
-
var shim = __webpack_require__(513);
|
5042 |
|
5043 |
-
var polyfill = getPolyfill();
|
5044 |
|
5045 |
-
defineProperties(polyfill, {
|
5046 |
-
getPolyfill: getPolyfill,
|
5047 |
-
implementation: implementation,
|
5048 |
-
shim: shim
|
5049 |
-
});
|
5050 |
|
5051 |
-
module.exports = polyfill;
|
5052 |
|
|
|
5053 |
|
5054 |
/***/ }),
|
5055 |
/* 19 */
|
5056 |
/***/ (function(module, exports, __webpack_require__) {
|
5057 |
|
5058 |
-
/* WEBPACK VAR INJECTION */(function(process) {module.exports = process.env.NODE_ENV === 'production' ? __webpack_require__(519) : __webpack_require__(520);
|
5059 |
-
|
5060 |
-
//# sourceMappingURL=index.js.map
|
5061 |
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
|
5062 |
-
|
5063 |
-
/***/ }),
|
5064 |
-
/* 20 */
|
5065 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5066 |
-
|
5067 |
"use strict";
|
5068 |
-
/* unused harmony export setLocaleData */
|
5069 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = __;
|
5070 |
-
/* harmony export (immutable) */ __webpack_exports__["c"] = _x;
|
5071 |
-
/* harmony export (immutable) */ __webpack_exports__["b"] = _n;
|
5072 |
-
/* unused harmony export _nx */
|
5073 |
-
/* harmony export (immutable) */ __webpack_exports__["d"] = sprintf;
|
5074 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(16);
|
5075 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tannin__ = __webpack_require__(379);
|
5076 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_memize__ = __webpack_require__(109);
|
5077 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_memize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_memize__);
|
5078 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js__ = __webpack_require__(384);
|
5079 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__);
|
5080 |
|
5081 |
|
5082 |
-
|
5083 |
-
|
5084 |
-
|
5085 |
-
|
5086 |
|
|
|
5087 |
|
5088 |
-
|
5089 |
-
* Default locale data to use for Tannin domain when not otherwise provided.
|
5090 |
-
* Assumes an English plural forms expression.
|
5091 |
-
*
|
5092 |
-
* @type {Object}
|
5093 |
-
*/
|
5094 |
|
5095 |
-
var
|
5096 |
-
|
5097 |
-
|
5098 |
-
|
5099 |
-
}
|
5100 |
-
|
5101 |
-
|
5102 |
-
|
5103 |
-
* to avoid crashing the application.
|
5104 |
-
*
|
5105 |
-
* @param {...*} args Arguments to pass to `console.error`
|
5106 |
-
*/
|
5107 |
|
5108 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5109 |
|
5110 |
-
|
5111 |
-
* The underlying instance of Tannin to which exported functions interface.
|
5112 |
-
*
|
5113 |
-
* @type {Tannin}
|
5114 |
-
*/
|
5115 |
|
5116 |
-
var
|
5117 |
-
/**
|
5118 |
-
* Merges locale data into the Tannin instance by domain. Accepts data in a
|
5119 |
-
* Jed-formatted JSON object shape.
|
5120 |
-
*
|
5121 |
-
* @see http://messageformat.github.io/Jed/
|
5122 |
-
*
|
5123 |
-
* @param {?Object} data Locale data configuration.
|
5124 |
-
* @param {?string} domain Domain for which configuration applies.
|
5125 |
-
*/
|
5126 |
|
5127 |
-
function
|
5128 |
-
|
5129 |
-
|
5130 |
-
|
|
|
|
|
|
|
5131 |
|
5132 |
-
|
5133 |
-
}
|
5134 |
-
/**
|
5135 |
-
* Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
|
5136 |
-
* otherwise previously assigned.
|
5137 |
-
*
|
5138 |
-
* @param {?string} domain Domain to retrieve the translated text.
|
5139 |
-
* @param {?string} context Context information for the translators.
|
5140 |
-
* @param {string} single Text to translate if non-plural. Used as fallback
|
5141 |
-
* return value on a caught error.
|
5142 |
-
* @param {?string} plural The text to be used if the number is plural.
|
5143 |
-
* @param {?number} number The number to compare against to use either the
|
5144 |
-
* singular or plural form.
|
5145 |
-
*
|
5146 |
-
* @return {string} The translated string.
|
5147 |
-
*/
|
5148 |
|
5149 |
-
|
5150 |
-
|
5151 |
-
|
5152 |
-
|
5153 |
-
|
5154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5155 |
|
5156 |
-
|
5157 |
-
|
5158 |
-
}
|
5159 |
|
5160 |
-
|
5161 |
-
|
5162 |
-
/**
|
5163 |
-
|
5164 |
-
|
5165 |
-
|
5166 |
-
|
5167 |
-
|
5168 |
-
|
5169 |
-
|
5170 |
-
|
5171 |
-
*/
|
5172 |
|
|
|
|
|
|
|
|
|
5173 |
|
5174 |
-
|
5175 |
-
|
5176 |
-
|
5177 |
-
|
5178 |
-
* Retrieve translated string with gettext context.
|
5179 |
-
*
|
5180 |
-
* @see https://developer.wordpress.org/reference/functions/_x/
|
5181 |
-
*
|
5182 |
-
* @param {string} text Text to translate.
|
5183 |
-
* @param {string} context Context information for the translators.
|
5184 |
-
* @param {?string} domain Domain to retrieve the translated text.
|
5185 |
-
*
|
5186 |
-
* @return {string} Translated context string without pipe.
|
5187 |
-
*/
|
5188 |
|
5189 |
-
|
5190 |
-
|
5191 |
-
}
|
5192 |
-
/**
|
5193 |
-
* Translates and retrieves the singular or plural form based on the supplied
|
5194 |
-
* number.
|
5195 |
-
*
|
5196 |
-
* @see https://developer.wordpress.org/reference/functions/_n/
|
5197 |
-
*
|
5198 |
-
* @param {string} single The text to be used if the number is singular.
|
5199 |
-
* @param {string} plural The text to be used if the number is plural.
|
5200 |
-
* @param {number} number The number to compare against to use either the
|
5201 |
-
* singular or plural form.
|
5202 |
-
* @param {?string} domain Domain to retrieve the translated text.
|
5203 |
-
*
|
5204 |
-
* @return {string} The translated singular or plural form.
|
5205 |
-
*/
|
5206 |
|
5207 |
-
function
|
5208 |
-
|
5209 |
-
|
5210 |
-
|
5211 |
-
|
5212 |
-
|
5213 |
-
|
5214 |
-
* @see https://developer.wordpress.org/reference/functions/_nx/
|
5215 |
-
*
|
5216 |
-
* @param {string} single The text to be used if the number is singular.
|
5217 |
-
* @param {string} plural The text to be used if the number is plural.
|
5218 |
-
* @param {number} number The number to compare against to use either the
|
5219 |
-
* singular or plural form.
|
5220 |
-
* @param {string} context Context information for the translators.
|
5221 |
-
* @param {?string} domain Domain to retrieve the translated text.
|
5222 |
-
*
|
5223 |
-
* @return {string} The translated singular or plural form.
|
5224 |
-
*/
|
5225 |
|
5226 |
-
|
5227 |
-
return dcnpgettext(domain, context, single, plural, number);
|
5228 |
-
}
|
5229 |
-
/**
|
5230 |
-
* Returns a formatted string. If an error occurs in applying the format, the
|
5231 |
-
* original format string is returned.
|
5232 |
-
*
|
5233 |
-
* @param {string} format The format of the string to generate.
|
5234 |
-
* @param {string[]} ...args Arguments to apply to the format.
|
5235 |
-
*
|
5236 |
-
* @see http://www.diveintojavascript.com/projects/javascript-sprintf
|
5237 |
-
*
|
5238 |
-
* @return {string} The formatted string.
|
5239 |
-
*/
|
5240 |
|
5241 |
-
|
5242 |
-
|
5243 |
-
|
5244 |
-
|
5245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5246 |
|
5247 |
-
return __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default.a.sprintf.apply(__WEBPACK_IMPORTED_MODULE_3_sprintf_js___default.a, [format].concat(args));
|
5248 |
-
} catch (error) {
|
5249 |
-
logErrorOnce('sprintf error: \n\n' + error.toString());
|
5250 |
-
return format;
|
5251 |
-
}
|
5252 |
-
}
|
5253 |
-
//# sourceMappingURL=index.js.map
|
5254 |
|
5255 |
/***/ }),
|
5256 |
-
/*
|
5257 |
/***/ (function(module, exports) {
|
5258 |
|
5259 |
// shim for using process in browser
|
@@ -5442,156 +6635,475 @@ process.chdir = function (dir) {
|
|
5442 |
process.umask = function() { return 0; };
|
5443 |
|
5444 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5445 |
/***/ }),
|
5446 |
/* 22 */
|
5447 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5448 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5449 |
"use strict";
|
5450 |
/* harmony export (immutable) */ __webpack_exports__["a"] = _toConsumableArray;
|
5451 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__ = __webpack_require__(
|
5452 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArray__ = __webpack_require__(
|
5453 |
-
/* harmony import */ var
|
|
|
|
|
5454 |
|
5455 |
|
5456 |
|
5457 |
function _toConsumableArray(arr) {
|
5458 |
-
return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArray__["a" /* default */])(arr) || Object(
|
5459 |
}
|
5460 |
|
5461 |
/***/ }),
|
5462 |
-
/*
|
5463 |
/***/ (function(module, exports, __webpack_require__) {
|
5464 |
|
5465 |
"use strict";
|
5466 |
|
5467 |
|
5468 |
-
|
5469 |
-
value: true
|
5470 |
-
});
|
5471 |
-
var calendarLabel = 'Calendar';
|
5472 |
-
var closeDatePicker = 'Close';
|
5473 |
-
var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
|
5474 |
-
var clearDate = 'Clear Date';
|
5475 |
-
var clearDates = 'Clear Dates';
|
5476 |
-
var jumpToPrevMonth = 'Move backward to switch to the previous month.';
|
5477 |
-
var jumpToNextMonth = 'Move forward to switch to the next month.';
|
5478 |
-
var keyboardShortcuts = 'Keyboard Shortcuts';
|
5479 |
-
var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
|
5480 |
-
var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
|
5481 |
-
var openThisPanel = 'Open this panel.';
|
5482 |
-
var enterKey = 'Enter key';
|
5483 |
-
var leftArrowRightArrow = 'Right and left arrow keys';
|
5484 |
-
var upArrowDownArrow = 'up and down arrow keys';
|
5485 |
-
var pageUpPageDown = 'page up and page down keys';
|
5486 |
-
var homeEnd = 'Home and end keys';
|
5487 |
-
var escape = 'Escape key';
|
5488 |
-
var questionMark = 'Question mark';
|
5489 |
-
var selectFocusedDate = 'Select the date in focus.';
|
5490 |
-
var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
|
5491 |
-
var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
|
5492 |
-
var moveFocusByOneMonth = 'Switch months.';
|
5493 |
-
var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
|
5494 |
-
var returnFocusToInput = 'Return to the date input field.';
|
5495 |
-
var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
|
5496 |
|
5497 |
-
var
|
5498 |
-
|
5499 |
-
|
5500 |
-
};
|
5501 |
-
var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
|
5502 |
-
var date = _ref2.date;
|
5503 |
-
return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.';
|
5504 |
-
};
|
5505 |
-
var chooseAvailableDate = function chooseAvailableDate(_ref3) {
|
5506 |
-
var date = _ref3.date;
|
5507 |
-
return date;
|
5508 |
-
};
|
5509 |
-
var dateIsUnavailable = function dateIsUnavailable(_ref4) {
|
5510 |
-
var date = _ref4.date;
|
5511 |
-
return 'Not available. ' + String(date);
|
5512 |
-
};
|
5513 |
-
var dateIsSelected = function dateIsSelected(_ref5) {
|
5514 |
-
var date = _ref5.date;
|
5515 |
-
return 'Selected. ' + String(date);
|
5516 |
-
};
|
5517 |
|
5518 |
-
|
5519 |
-
calendarLabel: calendarLabel,
|
5520 |
-
closeDatePicker: closeDatePicker,
|
5521 |
-
focusStartDate: focusStartDate,
|
5522 |
-
clearDate: clearDate,
|
5523 |
-
clearDates: clearDates,
|
5524 |
-
jumpToPrevMonth: jumpToPrevMonth,
|
5525 |
-
jumpToNextMonth: jumpToNextMonth,
|
5526 |
-
keyboardShortcuts: keyboardShortcuts,
|
5527 |
-
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
5528 |
-
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
5529 |
-
openThisPanel: openThisPanel,
|
5530 |
-
enterKey: enterKey,
|
5531 |
-
leftArrowRightArrow: leftArrowRightArrow,
|
5532 |
-
upArrowDownArrow: upArrowDownArrow,
|
5533 |
-
pageUpPageDown: pageUpPageDown,
|
5534 |
-
homeEnd: homeEnd,
|
5535 |
-
escape: escape,
|
5536 |
-
questionMark: questionMark,
|
5537 |
-
selectFocusedDate: selectFocusedDate,
|
5538 |
-
moveFocusByOneDay: moveFocusByOneDay,
|
5539 |
-
moveFocusByOneWeek: moveFocusByOneWeek,
|
5540 |
-
moveFocusByOneMonth: moveFocusByOneMonth,
|
5541 |
-
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
5542 |
-
returnFocusToInput: returnFocusToInput,
|
5543 |
-
keyboardNavigationInstructions: keyboardNavigationInstructions,
|
5544 |
|
5545 |
-
|
5546 |
-
|
5547 |
-
|
5548 |
-
|
5549 |
-
};
|
5550 |
-
var DateRangePickerPhrases = exports.DateRangePickerPhrases = {
|
5551 |
-
calendarLabel: calendarLabel,
|
5552 |
-
closeDatePicker: closeDatePicker,
|
5553 |
-
clearDates: clearDates,
|
5554 |
-
focusStartDate: focusStartDate,
|
5555 |
-
jumpToPrevMonth: jumpToPrevMonth,
|
5556 |
-
jumpToNextMonth: jumpToNextMonth,
|
5557 |
-
keyboardShortcuts: keyboardShortcuts,
|
5558 |
-
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
5559 |
-
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
5560 |
-
openThisPanel: openThisPanel,
|
5561 |
-
enterKey: enterKey,
|
5562 |
-
leftArrowRightArrow: leftArrowRightArrow,
|
5563 |
-
upArrowDownArrow: upArrowDownArrow,
|
5564 |
-
pageUpPageDown: pageUpPageDown,
|
5565 |
-
homeEnd: homeEnd,
|
5566 |
-
escape: escape,
|
5567 |
-
questionMark: questionMark,
|
5568 |
-
selectFocusedDate: selectFocusedDate,
|
5569 |
-
moveFocusByOneDay: moveFocusByOneDay,
|
5570 |
-
moveFocusByOneWeek: moveFocusByOneWeek,
|
5571 |
-
moveFocusByOneMonth: moveFocusByOneMonth,
|
5572 |
-
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
5573 |
-
returnFocusToInput: returnFocusToInput,
|
5574 |
-
keyboardNavigationInstructions: keyboardNavigationInstructions,
|
5575 |
-
chooseAvailableStartDate: chooseAvailableStartDate,
|
5576 |
-
chooseAvailableEndDate: chooseAvailableEndDate,
|
5577 |
-
dateIsUnavailable: dateIsUnavailable,
|
5578 |
-
dateIsSelected: dateIsSelected
|
5579 |
-
};
|
5580 |
|
5581 |
-
|
5582 |
-
focusStartDate: focusStartDate,
|
5583 |
-
clearDates: clearDates,
|
5584 |
-
keyboardNavigationInstructions: keyboardNavigationInstructions
|
5585 |
-
};
|
5586 |
|
5587 |
-
|
5588 |
-
|
5589 |
-
|
5590 |
-
|
5591 |
-
|
5592 |
-
|
5593 |
-
|
5594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5595 |
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
5596 |
openThisPanel: openThisPanel,
|
5597 |
enterKey: enterKey,
|
@@ -5678,7 +7190,70 @@ var CalendarDayPhrases = exports.CalendarDayPhrases = {
|
|
5678 |
};
|
5679 |
|
5680 |
/***/ }),
|
5681 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5682 |
/***/ (function(module, exports, __webpack_require__) {
|
5683 |
|
5684 |
"use strict";
|
@@ -5689,11 +7264,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5689 |
});
|
5690 |
exports['default'] = getPhrasePropTypes;
|
5691 |
|
5692 |
-
var _object = __webpack_require__(
|
5693 |
|
5694 |
var _object2 = _interopRequireDefault(_object);
|
5695 |
|
5696 |
-
var _propTypes = __webpack_require__(
|
5697 |
|
5698 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
5699 |
|
@@ -5708,75 +7283,339 @@ function getPhrasePropTypes(defaultPhrases) {
|
|
5708 |
}
|
5709 |
|
5710 |
/***/ }),
|
5711 |
-
/*
|
5712 |
-
/***/ (function(module,
|
5713 |
|
5714 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5715 |
|
5716 |
|
5717 |
-
var keys = __webpack_require__(90);
|
5718 |
-
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
5719 |
-
|
5720 |
-
var toStr = Object.prototype.toString;
|
5721 |
-
var concat = Array.prototype.concat;
|
5722 |
-
var origDefineProperty = Object.defineProperty;
|
5723 |
|
5724 |
-
|
5725 |
-
|
5726 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5727 |
|
5728 |
-
|
5729 |
-
|
5730 |
-
|
5731 |
-
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
|
5732 |
-
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
|
5733 |
-
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
|
5734 |
-
return false;
|
5735 |
-
}
|
5736 |
-
return obj.x === obj;
|
5737 |
-
} catch (e) { /* this is IE 8. */
|
5738 |
-
return false;
|
5739 |
-
}
|
5740 |
-
};
|
5741 |
-
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
|
5742 |
|
5743 |
-
|
5744 |
-
|
5745 |
-
|
5746 |
-
}
|
5747 |
-
if (supportsDescriptors) {
|
5748 |
-
origDefineProperty(object, name, {
|
5749 |
-
configurable: true,
|
5750 |
-
enumerable: false,
|
5751 |
-
value: value,
|
5752 |
-
writable: true
|
5753 |
-
});
|
5754 |
-
} else {
|
5755 |
-
object[name] = value;
|
5756 |
-
}
|
5757 |
-
};
|
5758 |
|
5759 |
-
var defineProperties = function (object, map) {
|
5760 |
-
var predicates = arguments.length > 2 ? arguments[2] : {};
|
5761 |
-
var props = keys(map);
|
5762 |
-
if (hasSymbols) {
|
5763 |
-
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
5764 |
-
}
|
5765 |
-
for (var i = 0; i < props.length; i += 1) {
|
5766 |
-
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
|
5767 |
-
}
|
5768 |
-
};
|
5769 |
|
5770 |
-
|
|
|
|
|
5771 |
|
5772 |
-
module.exports = defineProperties;
|
5773 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5774 |
|
5775 |
/***/ }),
|
5776 |
-
/*
|
5777 |
/***/ (function(module, exports, __webpack_require__) {
|
5778 |
|
5779 |
-
|
|
|
|
|
|
|
5780 |
value: true
|
5781 |
});
|
5782 |
exports.withStylesPropTypes = exports.css = undefined;
|
@@ -5787,29 +7626,29 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
5787 |
|
5788 |
exports.withStyles = withStyles;
|
5789 |
|
5790 |
-
var
|
|
|
|
|
|
|
|
|
5791 |
|
5792 |
var _react2 = _interopRequireDefault(_react);
|
5793 |
|
5794 |
-
var _propTypes = __webpack_require__(
|
5795 |
|
5796 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
5797 |
|
5798 |
-
var _hoistNonReactStatics = __webpack_require__(
|
5799 |
|
5800 |
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
5801 |
|
5802 |
-
var
|
5803 |
-
|
5804 |
-
var _deepmerge2 = _interopRequireDefault(_deepmerge);
|
5805 |
-
|
5806 |
-
var _constants = __webpack_require__(548);
|
5807 |
|
5808 |
-
var _brcast = __webpack_require__(
|
5809 |
|
5810 |
var _brcast2 = _interopRequireDefault(_brcast);
|
5811 |
|
5812 |
-
var _ThemedStyleSheet = __webpack_require__(
|
5813 |
|
5814 |
var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
|
5815 |
|
@@ -5821,7 +7660,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
5821 |
|
5822 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5823 |
|
5824 |
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5825 |
|
5826 |
// Add some named exports to assist in upgrading and for convenience
|
5827 |
var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;
|
@@ -5836,6 +7675,9 @@ var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() {
|
|
5836 |
return EMPTY_STYLES;
|
5837 |
};
|
5838 |
|
|
|
|
|
|
|
5839 |
function baseClass(pureComponent) {
|
5840 |
if (pureComponent) {
|
5841 |
if (!_react2['default'].PureComponent) {
|
@@ -5892,8 +7734,9 @@ function withStyles(styleFn) {
|
|
5892 |
return styleDef;
|
5893 |
}
|
5894 |
|
5895 |
-
if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined) {
|
5896 |
-
performance.
|
|
|
5897 |
}
|
5898 |
|
5899 |
var isRTL = direction === _constants.DIRECTIONS.RTL;
|
@@ -5910,10 +7753,14 @@ function withStyles(styleFn) {
|
|
5910 |
styleDef = styleDefLTR;
|
5911 |
}
|
5912 |
|
5913 |
-
if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined) {
|
5914 |
-
performance.
|
|
|
5915 |
|
5916 |
-
|
|
|
|
|
|
|
5917 |
}
|
5918 |
|
5919 |
return styleDef;
|
@@ -6010,13 +7857,13 @@ function withStyles(styleFn) {
|
|
6010 |
WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';
|
6011 |
WithStyles.contextTypes = contextTypes;
|
6012 |
if (WrappedComponent.propTypes) {
|
6013 |
-
WithStyles.propTypes = (0,
|
6014 |
delete WithStyles.propTypes[stylesPropName];
|
6015 |
delete WithStyles.propTypes[themePropName];
|
6016 |
delete WithStyles.propTypes[cssPropName];
|
6017 |
}
|
6018 |
if (WrappedComponent.defaultProps) {
|
6019 |
-
WithStyles.defaultProps = (0,
|
6020 |
}
|
6021 |
|
6022 |
return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);
|
@@ -6025,234 +7872,37 @@ function withStyles(styleFn) {
|
|
6025 |
return withStylesHOC;
|
6026 |
}();
|
6027 |
}
|
6028 |
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(
|
6029 |
|
6030 |
/***/ }),
|
6031 |
-
/*
|
6032 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6033 |
|
6034 |
"use strict";
|
6035 |
-
/* harmony export (
|
6036 |
-
/* harmony
|
6037 |
-
/* harmony
|
6038 |
-
/* harmony
|
6039 |
-
/* harmony
|
6040 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LEFT; });
|
6041 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return UP; });
|
6042 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return RIGHT; });
|
6043 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DOWN; });
|
6044 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DELETE; });
|
6045 |
-
/* unused harmony export F10 */
|
6046 |
-
/* unused harmony export ALT */
|
6047 |
-
/* unused harmony export CTRL */
|
6048 |
-
/* unused harmony export COMMAND */
|
6049 |
-
/* unused harmony export SHIFT */
|
6050 |
-
/* unused harmony export modifiers */
|
6051 |
-
/* unused harmony export rawShortcut */
|
6052 |
-
/* unused harmony export displayShortcutList */
|
6053 |
-
/* unused harmony export displayShortcut */
|
6054 |
-
/* unused harmony export shortcutAriaLabel */
|
6055 |
-
/* unused harmony export isKeyboardEvent */
|
6056 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(32);
|
6057 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(22);
|
6058 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
|
6059 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
|
6060 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__ = __webpack_require__(20);
|
6061 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(385);
|
6062 |
-
|
6063 |
-
|
6064 |
-
|
6065 |
-
/**
|
6066 |
-
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
6067 |
-
* functions in this file are intentional and should not be changed. They're
|
6068 |
-
* designed to fit with the standard menu keyboard shortcuts shown in the
|
6069 |
-
* user's platform.
|
6070 |
-
*
|
6071 |
-
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
6072 |
-
* on Windows Control will usually come first. So don't provide your own
|
6073 |
-
* shortcut combos directly to keyboardShortcut().
|
6074 |
-
*/
|
6075 |
-
|
6076 |
-
/**
|
6077 |
-
* External dependencies
|
6078 |
-
*/
|
6079 |
-
|
6080 |
-
/**
|
6081 |
-
* WordPress dependencies
|
6082 |
-
*/
|
6083 |
-
|
6084 |
-
|
6085 |
-
/**
|
6086 |
-
* Internal dependencies
|
6087 |
-
*/
|
6088 |
-
|
6089 |
-
|
6090 |
-
var BACKSPACE = 8;
|
6091 |
-
var TAB = 9;
|
6092 |
-
var ENTER = 13;
|
6093 |
-
var ESCAPE = 27;
|
6094 |
-
var SPACE = 32;
|
6095 |
-
var LEFT = 37;
|
6096 |
-
var UP = 38;
|
6097 |
-
var RIGHT = 39;
|
6098 |
-
var DOWN = 40;
|
6099 |
-
var DELETE = 46;
|
6100 |
-
var F10 = 121;
|
6101 |
-
var ALT = 'alt';
|
6102 |
-
var CTRL = 'ctrl'; // Understood in both Mousetrap and TinyMCE.
|
6103 |
-
|
6104 |
-
var COMMAND = 'meta';
|
6105 |
-
var SHIFT = 'shift';
|
6106 |
-
var modifiers = {
|
6107 |
-
primary: function primary(_isApple) {
|
6108 |
-
return _isApple() ? [COMMAND] : [CTRL];
|
6109 |
-
},
|
6110 |
-
primaryShift: function primaryShift(_isApple) {
|
6111 |
-
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
6112 |
-
},
|
6113 |
-
primaryAlt: function primaryAlt(_isApple) {
|
6114 |
-
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
6115 |
-
},
|
6116 |
-
secondary: function secondary(_isApple) {
|
6117 |
-
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
6118 |
-
},
|
6119 |
-
access: function access(_isApple) {
|
6120 |
-
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
6121 |
-
},
|
6122 |
-
ctrl: function ctrl() {
|
6123 |
-
return [CTRL];
|
6124 |
-
},
|
6125 |
-
alt: function alt() {
|
6126 |
-
return [ALT];
|
6127 |
-
},
|
6128 |
-
ctrlShift: function ctrlShift() {
|
6129 |
-
return [CTRL, SHIFT];
|
6130 |
-
},
|
6131 |
-
shift: function shift() {
|
6132 |
-
return [SHIFT];
|
6133 |
-
},
|
6134 |
-
shiftAlt: function shiftAlt() {
|
6135 |
-
return [SHIFT, ALT];
|
6136 |
-
}
|
6137 |
-
};
|
6138 |
-
/**
|
6139 |
-
* An object that contains functions to get raw shortcuts.
|
6140 |
-
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
6141 |
-
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
6142 |
-
*
|
6143 |
-
* @type {Object} Keyed map of functions to raw shortcuts.
|
6144 |
-
*/
|
6145 |
-
|
6146 |
-
var rawShortcut = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
|
6147 |
-
return function (character) {
|
6148 |
-
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
6149 |
-
|
6150 |
-
return Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifier(_isApple)).concat([character.toLowerCase()]).join('+');
|
6151 |
-
};
|
6152 |
-
});
|
6153 |
-
/**
|
6154 |
-
* Return an array of the parts of a keyboard shortcut chord for display
|
6155 |
-
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
6156 |
-
*
|
6157 |
-
* @type {Object} keyed map of functions to shortcut sequences
|
6158 |
-
*/
|
6159 |
-
|
6160 |
-
var displayShortcutList = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
|
6161 |
-
return function (character) {
|
6162 |
-
var _replacementKeyMap;
|
6163 |
-
|
6164 |
-
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
6165 |
-
|
6166 |
-
var isApple = _isApple();
|
6167 |
-
|
6168 |
-
var replacementKeyMap = (_replacementKeyMap = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
|
6169 |
-
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
6170 |
-
var replacementKey = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
6171 |
-
|
6172 |
-
if (isApple) {
|
6173 |
-
return Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(accumulator).concat([replacementKey]);
|
6174 |
-
}
|
6175 |
-
|
6176 |
-
return Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(accumulator).concat([replacementKey, '+']);
|
6177 |
-
}, []);
|
6178 |
-
var capitalizedCharacter = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["capitalize"])(character);
|
6179 |
-
return Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifierKeys).concat([capitalizedCharacter]);
|
6180 |
-
};
|
6181 |
-
});
|
6182 |
-
/**
|
6183 |
-
* An object that contains functions to display shortcuts.
|
6184 |
-
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
6185 |
-
*
|
6186 |
-
* @type {Object} Keyed map of functions to display shortcuts.
|
6187 |
-
*/
|
6188 |
-
|
6189 |
-
var displayShortcut = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(displayShortcutList, function (shortcutList) {
|
6190 |
-
return function (character) {
|
6191 |
-
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
6192 |
-
|
6193 |
-
return shortcutList(character, _isApple).join('');
|
6194 |
-
};
|
6195 |
-
});
|
6196 |
-
/**
|
6197 |
-
* An object that contains functions to return an aria label for a keyboard shortcut.
|
6198 |
-
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
6199 |
-
*/
|
6200 |
-
|
6201 |
-
var shortcutAriaLabel = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
|
6202 |
-
return function (character) {
|
6203 |
-
var _replacementKeyMap2;
|
6204 |
-
|
6205 |
-
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
6206 |
-
|
6207 |
-
var isApple = _isApple();
|
6208 |
-
|
6209 |
-
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, ',', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Comma')), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, '.', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Period')), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, '`', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Backtick')), _replacementKeyMap2);
|
6210 |
-
return Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifier(_isApple)).concat([character]).map(function (key) {
|
6211 |
-
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["capitalize"])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["get"])(replacementKeyMap, key, key));
|
6212 |
-
}).join(isApple ? ' ' : ' + ');
|
6213 |
-
};
|
6214 |
-
});
|
6215 |
-
/**
|
6216 |
-
* An object that contains functions to check if a keyboard event matches a
|
6217 |
-
* predefined shortcut combination.
|
6218 |
-
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
6219 |
-
* signals pressing ⌘M.
|
6220 |
-
*
|
6221 |
-
* @type {Object} Keyed map of functions to match events.
|
6222 |
-
*/
|
6223 |
-
|
6224 |
-
var isKeyboardEvent = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (getModifiers) {
|
6225 |
-
return function (event, character) {
|
6226 |
-
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
6227 |
|
6228 |
-
var mods = getModifiers(_isApple);
|
6229 |
|
6230 |
-
if (!mods.every(function (key) {
|
6231 |
-
return event["".concat(key, "Key")];
|
6232 |
-
})) {
|
6233 |
-
return false;
|
6234 |
-
}
|
6235 |
|
6236 |
-
if (!character) {
|
6237 |
-
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["includes"])(mods, event.key.toLowerCase());
|
6238 |
-
}
|
6239 |
|
6240 |
-
|
6241 |
-
|
6242 |
-
}
|
6243 |
-
//# sourceMappingURL=index.js.map
|
6244 |
|
6245 |
/***/ }),
|
6246 |
-
/*
|
6247 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6248 |
|
6249 |
"use strict";
|
6250 |
/* unused harmony export Button */
|
6251 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(
|
6252 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(
|
6253 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(
|
6254 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__);
|
6255 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_element__ = __webpack_require__(
|
6256 |
|
6257 |
|
6258 |
|
@@ -6310,25 +7960,25 @@ function Button(props, ref) {
|
|
6310 |
//# sourceMappingURL=index.js.map
|
6311 |
|
6312 |
/***/ }),
|
6313 |
-
/*
|
6314 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6315 |
|
6316 |
"use strict";
|
6317 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
6318 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(
|
6319 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
6320 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
6321 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
6322 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
6323 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
6324 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(
|
6325 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(
|
6326 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__);
|
6327 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash__ = __webpack_require__(2);
|
6328 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash__);
|
6329 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__tooltip__ = __webpack_require__(
|
6330 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__button__ = __webpack_require__(
|
6331 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__dashicon__ = __webpack_require__(
|
6332 |
|
6333 |
|
6334 |
|
@@ -6415,24 +8065,53 @@ function (_Component) {
|
|
6415 |
//# sourceMappingURL=index.js.map
|
6416 |
|
6417 |
/***/ }),
|
6418 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6419 |
/***/ (function(module, exports, __webpack_require__) {
|
6420 |
|
6421 |
"use strict";
|
6422 |
|
6423 |
|
6424 |
-
var
|
6425 |
|
6426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6427 |
|
6428 |
|
6429 |
/***/ }),
|
6430 |
-
/*
|
6431 |
/***/ (function(module, exports, __webpack_require__) {
|
6432 |
|
6433 |
-
var moment = __webpack_require__(
|
6434 |
-
var momentValidationWrapper = __webpack_require__(
|
6435 |
-
var core = __webpack_require__(
|
6436 |
|
6437 |
module.exports = {
|
6438 |
|
@@ -6473,53 +8152,246 @@ module.exports = {
|
|
6473 |
|
6474 |
|
6475 |
/***/ }),
|
6476 |
-
/*
|
6477 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6478 |
|
6479 |
"use strict";
|
6480 |
-
/* harmony export (
|
6481 |
-
|
6482 |
-
|
6483 |
-
|
6484 |
-
|
6485 |
-
|
6486 |
-
|
6487 |
-
|
6488 |
-
|
6489 |
-
|
6490 |
-
|
6491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6492 |
|
6493 |
-
return obj;
|
6494 |
-
}
|
6495 |
|
6496 |
-
/***/ }),
|
6497 |
-
/* 33 */
|
6498 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6499 |
|
6500 |
-
"use strict";
|
6501 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(0);
|
6502 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames__ = __webpack_require__(12);
|
6503 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_classnames__);
|
6504 |
|
6505 |
|
6506 |
/**
|
6507 |
-
*
|
|
|
|
|
|
|
|
|
6508 |
*/
|
6509 |
|
6510 |
|
6511 |
-
|
6512 |
-
|
6513 |
-
|
6514 |
-
|
6515 |
-
|
6516 |
-
|
6517 |
-
|
6518 |
-
|
6519 |
-
|
6520 |
-
|
6521 |
-
|
6522 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6523 |
htmlFor: id
|
6524 |
}, label), label && !id && Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("span", {
|
6525 |
className: "components-base-control__label"
|
@@ -6533,7 +8405,65 @@ function BaseControl(_ref) {
|
|
6533 |
//# sourceMappingURL=index.js.map
|
6534 |
|
6535 |
/***/ }),
|
6536 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6537 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6538 |
|
6539 |
"use strict";
|
@@ -6569,81 +8499,115 @@ function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierNam
|
|
6569 |
//# sourceMappingURL=index.js.map
|
6570 |
|
6571 |
/***/ }),
|
6572 |
-
/*
|
6573 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6574 |
|
6575 |
"use strict";
|
6576 |
-
/* harmony
|
6577 |
-
/* harmony
|
6578 |
-
|
6579 |
-
|
6580 |
-
|
6581 |
-
/* unused harmony export hasFilter */
|
6582 |
-
/* unused harmony export removeAllActions */
|
6583 |
-
/* unused harmony export removeAllFilters */
|
6584 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return doAction; });
|
6585 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return applyFilters; });
|
6586 |
-
/* unused harmony export currentAction */
|
6587 |
-
/* unused harmony export currentFilter */
|
6588 |
-
/* unused harmony export doingAction */
|
6589 |
-
/* unused harmony export doingFilter */
|
6590 |
-
/* unused harmony export didAction */
|
6591 |
-
/* unused harmony export didFilter */
|
6592 |
-
/* unused harmony export actions */
|
6593 |
-
/* unused harmony export filters */
|
6594 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createHooks__ = __webpack_require__(442);
|
6595 |
-
/* unused harmony reexport createHooks */
|
6596 |
-
|
6597 |
|
6598 |
-
|
6599 |
-
|
6600 |
-
|
6601 |
-
|
6602 |
-
|
6603 |
-
|
6604 |
-
|
6605 |
-
|
6606 |
-
|
6607 |
-
|
6608 |
-
|
6609 |
-
currentAction = _createHooks.currentAction,
|
6610 |
-
currentFilter = _createHooks.currentFilter,
|
6611 |
-
doingAction = _createHooks.doingAction,
|
6612 |
-
doingFilter = _createHooks.doingFilter,
|
6613 |
-
didAction = _createHooks.didAction,
|
6614 |
-
didFilter = _createHooks.didFilter,
|
6615 |
-
actions = _createHooks.actions,
|
6616 |
-
filters = _createHooks.filters;
|
6617 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6618 |
|
|
|
6619 |
//# sourceMappingURL=index.js.map
|
6620 |
|
6621 |
/***/ }),
|
6622 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6623 |
/***/ (function(module, exports, __webpack_require__) {
|
6624 |
|
6625 |
"use strict";
|
6626 |
|
6627 |
|
6628 |
-
var
|
6629 |
|
6630 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6631 |
|
6632 |
|
6633 |
/***/ }),
|
6634 |
-
/*
|
6635 |
/***/ (function(module, exports, __webpack_require__) {
|
6636 |
|
|
|
|
|
|
|
6637 |
Object.defineProperty(exports, "__esModule", {
|
6638 |
value: true
|
6639 |
});
|
6640 |
-
exports[
|
6641 |
-
|
6642 |
-
var _wrapValidator = __webpack_require__(17);
|
6643 |
|
6644 |
-
var
|
6645 |
|
6646 |
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
6647 |
|
6648 |
function andValidator(validators) {
|
6649 |
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and';
|
@@ -6651,50 +8615,43 @@ function andValidator(validators) {
|
|
6651 |
if (!Array.isArray(validators)) {
|
6652 |
throw new TypeError('and: 2 or more validators are required');
|
6653 |
}
|
|
|
6654 |
if (validators.length <= 1) {
|
6655 |
throw new RangeError('and: 2 or more validators are required');
|
6656 |
}
|
6657 |
|
6658 |
-
var validator = function () {
|
6659 |
-
|
6660 |
-
|
6661 |
-
args[_key] = arguments[_key];
|
6662 |
-
}
|
6663 |
-
|
6664 |
-
var firstError = null;
|
6665 |
-
validators.some(function (validatorFn) {
|
6666 |
-
firstError = validatorFn.apply(undefined, args);
|
6667 |
-
return firstError != null;
|
6668 |
-
});
|
6669 |
-
return firstError == null ? null : firstError;
|
6670 |
}
|
6671 |
|
6672 |
-
|
6673 |
-
|
6674 |
-
|
6675 |
-
|
6676 |
-
|
6677 |
-
|
6678 |
-
|
6679 |
-
}
|
6680 |
|
6681 |
-
|
6682 |
-
|
6683 |
-
|
6684 |
-
return firstError != null;
|
6685 |
-
});
|
6686 |
-
return firstError == null ? null : firstError;
|
6687 |
}
|
6688 |
|
6689 |
-
|
6690 |
-
|
|
|
|
|
|
|
|
|
|
|
6691 |
|
6692 |
-
return (0,
|
6693 |
}
|
6694 |
//# sourceMappingURL=and.js.map
|
6695 |
|
6696 |
/***/ }),
|
6697 |
-
/*
|
6698 |
/***/ (function(module, exports, __webpack_require__) {
|
6699 |
|
6700 |
"use strict";
|
@@ -6704,211 +8661,162 @@ Object.defineProperty(exports, "__esModule", {
|
|
6704 |
value: true
|
6705 |
});
|
6706 |
|
6707 |
-
var _propTypes = __webpack_require__(
|
6708 |
|
6709 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
6710 |
|
6711 |
-
var _constants = __webpack_require__(
|
6712 |
|
6713 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6714 |
|
6715 |
exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
|
6716 |
|
6717 |
/***/ }),
|
6718 |
-
/*
|
6719 |
-
/***/ (function(module, exports) {
|
6720 |
-
|
6721 |
-
var g;
|
6722 |
-
|
6723 |
-
// This works in non-strict mode
|
6724 |
-
g = (function() {
|
6725 |
-
return this;
|
6726 |
-
})();
|
6727 |
-
|
6728 |
-
try {
|
6729 |
-
// This works if eval is allowed (see CSP)
|
6730 |
-
g = g || Function("return this")() || (1,eval)("this");
|
6731 |
-
} catch(e) {
|
6732 |
-
// This works if the window reference is available
|
6733 |
-
if(typeof window === "object")
|
6734 |
-
g = window;
|
6735 |
-
}
|
6736 |
-
|
6737 |
-
// g can still be undefined, but nothing to do about it...
|
6738 |
-
// We return undefined, instead of nothing here, so it's
|
6739 |
-
// easier to handle this case. if(!global) { ...}
|
6740 |
-
|
6741 |
-
module.exports = g;
|
6742 |
-
|
6743 |
-
|
6744 |
-
/***/ }),
|
6745 |
-
/* 40 */
|
6746 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6747 |
-
|
6748 |
-
"use strict";
|
6749 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = _typeof;
|
6750 |
-
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
|
6751 |
-
|
6752 |
-
function _typeof(obj) {
|
6753 |
-
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
|
6754 |
-
_typeof = function _typeof(obj) {
|
6755 |
-
return _typeof2(obj);
|
6756 |
-
};
|
6757 |
-
} else {
|
6758 |
-
_typeof = function _typeof(obj) {
|
6759 |
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
|
6760 |
-
};
|
6761 |
-
}
|
6762 |
-
|
6763 |
-
return _typeof(obj);
|
6764 |
-
}
|
6765 |
-
|
6766 |
-
/***/ }),
|
6767 |
-
/* 41 */
|
6768 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6769 |
|
6770 |
"use strict";
|
6771 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__primitives__ = __webpack_require__(
|
6772 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__primitives__["c"]; });
|
6773 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autocomplete__ = __webpack_require__(
|
6774 |
/* unused harmony reexport Autocomplete */
|
6775 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_control__ = __webpack_require__(
|
6776 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__base_control__["a"]; });
|
6777 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__button__ = __webpack_require__(
|
6778 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__button__["a"]; });
|
6779 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__button_group__ = __webpack_require__(
|
6780 |
/* unused harmony reexport ButtonGroup */
|
6781 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__checkbox_control__ = __webpack_require__(
|
6782 |
/* unused harmony reexport CheckboxControl */
|
6783 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__clipboard_button__ = __webpack_require__(
|
6784 |
/* unused harmony reexport ClipboardButton */
|
6785 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__color_indicator__ = __webpack_require__(
|
6786 |
/* unused harmony reexport ColorIndicator */
|
6787 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__color_palette__ = __webpack_require__(
|
6788 |
/* unused harmony reexport ColorPalette */
|
6789 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__color_picker__ = __webpack_require__(
|
6790 |
/* unused harmony reexport ColorPicker */
|
6791 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__dashicon__ = __webpack_require__(
|
6792 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_10__dashicon__["a"]; });
|
6793 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__date_time__ = __webpack_require__(
|
6794 |
/* unused harmony reexport DateTimePicker */
|
6795 |
/* unused harmony reexport DatePicker */
|
6796 |
/* unused harmony reexport TimePicker */
|
6797 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__disabled__ = __webpack_require__(
|
6798 |
/* unused harmony reexport Disabled */
|
6799 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__draggable__ = __webpack_require__(
|
6800 |
/* unused harmony reexport Draggable */
|
6801 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__drop_zone__ = __webpack_require__(
|
6802 |
/* unused harmony reexport DropZone */
|
6803 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__drop_zone_provider__ = __webpack_require__(
|
6804 |
/* unused harmony reexport DropZoneProvider */
|
6805 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__dropdown__ = __webpack_require__(
|
6806 |
/* unused harmony reexport Dropdown */
|
6807 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__dropdown_menu__ = __webpack_require__(
|
6808 |
/* unused harmony reexport DropdownMenu */
|
6809 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__external_link__ = __webpack_require__(
|
6810 |
/* unused harmony reexport ExternalLink */
|
6811 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__focusable_iframe__ = __webpack_require__(
|
6812 |
/* unused harmony reexport FocusableIframe */
|
6813 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__font_size_picker__ = __webpack_require__(
|
6814 |
/* unused harmony reexport FontSizePicker */
|
6815 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__form_file_upload__ = __webpack_require__(
|
6816 |
/* unused harmony reexport FormFileUpload */
|
6817 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__form_toggle__ = __webpack_require__(
|
6818 |
/* unused harmony reexport FormToggle */
|
6819 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__form_token_field__ = __webpack_require__(
|
6820 |
/* unused harmony reexport FormTokenField */
|
6821 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__icon__ = __webpack_require__(
|
6822 |
/* unused harmony reexport Icon */
|
6823 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__icon_button__ = __webpack_require__(
|
6824 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_25__icon_button__["a"]; });
|
6825 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__keyboard_shortcuts__ = __webpack_require__(
|
6826 |
/* unused harmony reexport KeyboardShortcuts */
|
6827 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__menu_group__ = __webpack_require__(
|
6828 |
/* unused harmony reexport MenuGroup */
|
6829 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__menu_item__ = __webpack_require__(
|
6830 |
/* unused harmony reexport MenuItem */
|
6831 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__menu_items_choice__ = __webpack_require__(
|
6832 |
/* unused harmony reexport MenuItemsChoice */
|
6833 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__modal__ = __webpack_require__(
|
6834 |
/* unused harmony reexport Modal */
|
6835 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__scroll_lock__ = __webpack_require__(
|
6836 |
/* unused harmony reexport ScrollLock */
|
6837 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__navigable_container__ = __webpack_require__(
|
6838 |
/* unused harmony reexport NavigableMenu */
|
6839 |
/* unused harmony reexport TabbableContainer */
|
6840 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__notice__ = __webpack_require__(
|
6841 |
/* unused harmony reexport Notice */
|
6842 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__notice_list__ = __webpack_require__(
|
6843 |
/* unused harmony reexport NoticeList */
|
6844 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__panel__ = __webpack_require__(
|
6845 |
/* unused harmony reexport Panel */
|
6846 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__panel_body__ = __webpack_require__(
|
6847 |
/* unused harmony reexport PanelBody */
|
6848 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__panel_header__ = __webpack_require__(
|
6849 |
/* unused harmony reexport PanelHeader */
|
6850 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__panel_row__ = __webpack_require__(
|
6851 |
/* unused harmony reexport PanelRow */
|
6852 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__placeholder__ = __webpack_require__(
|
6853 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_39__placeholder__["a"]; });
|
6854 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__popover__ = __webpack_require__(
|
6855 |
/* unused harmony reexport Popover */
|
6856 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__query_controls__ = __webpack_require__(
|
6857 |
/* unused harmony reexport QueryControls */
|
6858 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__radio_control__ = __webpack_require__(
|
6859 |
/* unused harmony reexport RadioControl */
|
6860 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__range_control__ = __webpack_require__(
|
6861 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_43__range_control__["a"]; });
|
6862 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__resizable_box__ = __webpack_require__(
|
6863 |
/* unused harmony reexport ResizableBox */
|
6864 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__responsive_wrapper__ = __webpack_require__(
|
6865 |
/* unused harmony reexport ResponsiveWrapper */
|
6866 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__sandbox__ = __webpack_require__(
|
6867 |
/* unused harmony reexport SandBox */
|
6868 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__select_control__ = __webpack_require__(
|
6869 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_47__select_control__["a"]; });
|
6870 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__spinner__ = __webpack_require__(
|
6871 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_48__spinner__["a"]; });
|
6872 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__server_side_render__ = __webpack_require__(
|
6873 |
/* unused harmony reexport ServerSideRender */
|
6874 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__tab_panel__ = __webpack_require__(
|
6875 |
/* unused harmony reexport TabPanel */
|
6876 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__text_control__ = __webpack_require__(
|
6877 |
/* unused harmony reexport TextControl */
|
6878 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__textarea_control__ = __webpack_require__(
|
6879 |
/* unused harmony reexport TextareaControl */
|
6880 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__toggle_control__ = __webpack_require__(
|
6881 |
/* unused harmony reexport ToggleControl */
|
6882 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__toolbar__ = __webpack_require__(
|
6883 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_54__toolbar__["a"]; });
|
6884 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__toolbar_button__ = __webpack_require__(
|
6885 |
/* unused harmony reexport ToolbarButton */
|
6886 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__tooltip__ = __webpack_require__(
|
6887 |
/* unused harmony reexport Tooltip */
|
6888 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__tree_select__ = __webpack_require__(
|
6889 |
/* unused harmony reexport TreeSelect */
|
6890 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__isolated_event_container__ = __webpack_require__(
|
6891 |
/* unused harmony reexport IsolatedEventContainer */
|
6892 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__slot_fill__ = __webpack_require__(
|
6893 |
/* unused harmony reexport createSlotFill */
|
6894 |
/* unused harmony reexport Slot */
|
6895 |
/* unused harmony reexport Fill */
|
6896 |
/* unused harmony reexport SlotFillProvider */
|
6897 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__higher_order_navigate_regions__ = __webpack_require__(
|
6898 |
/* unused harmony reexport navigateRegions */
|
6899 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__higher_order_with_constrained_tabbing__ = __webpack_require__(
|
6900 |
/* unused harmony reexport withConstrainedTabbing */
|
6901 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__higher_order_with_fallback_styles__ = __webpack_require__(
|
6902 |
/* unused harmony reexport withFallbackStyles */
|
6903 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__higher_order_with_filters__ = __webpack_require__(
|
6904 |
/* unused harmony reexport withFilters */
|
6905 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__higher_order_with_focus_outside__ = __webpack_require__(
|
6906 |
/* unused harmony reexport withFocusOutside */
|
6907 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__higher_order_with_focus_return__ = __webpack_require__(
|
6908 |
/* unused harmony reexport withFocusReturn */
|
6909 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__higher_order_with_notices__ = __webpack_require__(
|
6910 |
/* unused harmony reexport withNotices */
|
6911 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__higher_order_with_spoken_messages__ = __webpack_require__(
|
6912 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_67__higher_order_with_spoken_messages__["a"]; });
|
6913 |
// Components
|
6914 |
// eslint-disable-next-line camelcase
|
@@ -6984,163 +8892,76 @@ function _typeof(obj) {
|
|
6984 |
//# sourceMappingURL=index.js.map
|
6985 |
|
6986 |
/***/ }),
|
6987 |
-
/*
|
6988 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6989 |
|
6990 |
"use strict";
|
6991 |
-
/* harmony export (
|
6992 |
-
/* harmony
|
6993 |
-
/*
|
6994 |
-
/* unused harmony export registerGenericStore */
|
6995 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return registerStore; });
|
6996 |
-
/* unused harmony export use */
|
6997 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers__ = __webpack_require__(397);
|
6998 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers__);
|
6999 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__default_registry__ = __webpack_require__(110);
|
7000 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__plugins__ = __webpack_require__(413);
|
7001 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_with_select__ = __webpack_require__(429);
|
7002 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_3__components_with_select__["a"]; });
|
7003 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_with_dispatch__ = __webpack_require__(430);
|
7004 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_4__components_with_dispatch__["a"]; });
|
7005 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_registry_provider__ = __webpack_require__(82);
|
7006 |
-
/* unused harmony reexport RegistryProvider */
|
7007 |
-
/* unused harmony reexport RegistryConsumer */
|
7008 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__registry__ = __webpack_require__(111);
|
7009 |
-
/* unused harmony reexport createRegistry */
|
7010 |
-
/* unused harmony reexport plugins */
|
7011 |
-
/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers___default.a; });
|
7012 |
-
/**
|
7013 |
-
* External dependencies
|
7014 |
-
*/
|
7015 |
-
|
7016 |
-
/**
|
7017 |
-
* Internal dependencies
|
7018 |
-
*/
|
7019 |
-
|
7020 |
-
|
7021 |
-
|
7022 |
-
|
7023 |
-
|
7024 |
-
|
7025 |
-
|
7026 |
-
|
7027 |
-
/**
|
7028 |
-
* The combineReducers helper function turns an object whose values are different
|
7029 |
-
* reducing functions into a single reducing function you can pass to registerReducer.
|
7030 |
-
*
|
7031 |
-
* @param {Object} reducers An object whose values correspond to different reducing
|
7032 |
-
* functions that need to be combined into one.
|
7033 |
-
*
|
7034 |
-
* @return {Function} A reducer that invokes every reducer inside the reducers
|
7035 |
-
* object, and constructs a state object with the same shape.
|
7036 |
-
*/
|
7037 |
|
7038 |
|
7039 |
-
var
|
7040 |
-
var dispatch = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].dispatch;
|
7041 |
-
var subscribe = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].subscribe;
|
7042 |
-
var registerGenericStore = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].registerGenericStore;
|
7043 |
-
var registerStore = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].registerStore;
|
7044 |
-
var use = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].use;
|
7045 |
-
//# sourceMappingURL=index.js.map
|
7046 |
|
7047 |
-
|
7048 |
-
/* 43 */
|
7049 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7050 |
|
7051 |
-
"use strict";
|
7052 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = normaliseFormats;
|
7053 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_format_equal__ = __webpack_require__(118);
|
7054 |
/**
|
7055 |
* Internal dependencies
|
7056 |
*/
|
7057 |
|
7058 |
/**
|
7059 |
-
* Normalises formats: ensures subsequent equal formats have the same
|
|
|
7060 |
*
|
7061 |
-
* @param
|
7062 |
*
|
7063 |
* @return {Object} New value with normalised formats.
|
7064 |
*/
|
7065 |
|
7066 |
-
function normaliseFormats(
|
7067 |
-
var
|
7068 |
-
text = _ref.text,
|
7069 |
-
start = _ref.start,
|
7070 |
-
end = _ref.end;
|
7071 |
-
var newFormats = formats.slice(0);
|
7072 |
newFormats.forEach(function (formatsAtIndex, index) {
|
7073 |
-
var
|
7074 |
|
7075 |
-
if (
|
7076 |
-
var newFormatsAtIndex = formatsAtIndex.slice(
|
7077 |
newFormatsAtIndex.forEach(function (format, formatIndex) {
|
7078 |
-
var
|
7079 |
|
7080 |
-
if (Object(
|
7081 |
-
newFormatsAtIndex[formatIndex] =
|
7082 |
}
|
7083 |
});
|
7084 |
newFormats[index] = newFormatsAtIndex;
|
7085 |
}
|
7086 |
});
|
7087 |
-
return {
|
7088 |
-
formats: newFormats
|
7089 |
-
|
7090 |
-
start: start,
|
7091 |
-
end: end
|
7092 |
-
};
|
7093 |
}
|
7094 |
//# sourceMappingURL=normalise-formats.js.map
|
7095 |
|
7096 |
/***/ }),
|
7097 |
-
/*
|
7098 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7099 |
-
|
7100 |
-
"use strict";
|
7101 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return focus; });
|
7102 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__focusable__ = __webpack_require__(127);
|
7103 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tabbable__ = __webpack_require__(460);
|
7104 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dom__ = __webpack_require__(461);
|
7105 |
-
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__dom__["a"]; });
|
7106 |
-
/**
|
7107 |
-
* Internal dependencies
|
7108 |
-
*/
|
7109 |
-
|
7110 |
-
|
7111 |
-
var focus = {
|
7112 |
-
focusable: __WEBPACK_IMPORTED_MODULE_0__focusable__,
|
7113 |
-
tabbable: __WEBPACK_IMPORTED_MODULE_1__tabbable__
|
7114 |
-
};
|
7115 |
-
|
7116 |
-
//# sourceMappingURL=index.js.map
|
7117 |
-
|
7118 |
-
/***/ }),
|
7119 |
-
/* 45 */
|
7120 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7121 |
|
7122 |
"use strict";
|
7123 |
-
/* harmony export (
|
7124 |
-
/* harmony import */ var
|
7125 |
-
/* harmony import */ var
|
7126 |
-
/* harmony import */ var
|
7127 |
-
/* harmony import */ var
|
7128 |
-
/* harmony import */ var
|
7129 |
-
/* harmony import */ var
|
7130 |
-
/* harmony import */ var
|
7131 |
-
|
7132 |
-
|
7133 |
|
7134 |
|
7135 |
|
7136 |
|
|
|
7137 |
|
7138 |
-
/*
|
7139 |
-
IF YOU ARE EDITING dashicon/index.jsx
|
7140 |
-
THEN YOU ARE EDITING A FILE THAT GETS OUTPUT FROM THE DASHICONS REPO!
|
7141 |
-
DO NOT EDIT THAT FILE! EDIT index-header.jsx and index-footer.jsx instead
|
7142 |
-
OR if you're looking to change now SVGs get output, you'll need to edit strings in the Gruntfile :)
|
7143 |
-
!!! */
|
7144 |
|
7145 |
/**
|
7146 |
* WordPress dependencies
|
@@ -7152,66 +8973,672 @@ OR if you're looking to change now SVGs get output, you'll need to edit strings
|
|
7152 |
|
7153 |
|
7154 |
|
7155 |
-
var Dashicon =
|
7156 |
-
/*#__PURE__*/
|
7157 |
-
function (_Component) {
|
7158 |
-
Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(Dashicon, _Component);
|
7159 |
|
7160 |
-
function Dashicon() {
|
7161 |
-
Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Dashicon);
|
7162 |
|
7163 |
-
return Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Dashicon).apply(this, arguments));
|
7164 |
-
}
|
7165 |
|
7166 |
-
|
7167 |
-
|
7168 |
-
|
7169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7170 |
}
|
7171 |
-
}
|
7172 |
-
|
7173 |
-
value: function render() {
|
7174 |
-
var _this$props = this.props,
|
7175 |
-
icon = _this$props.icon,
|
7176 |
-
className = _this$props.className,
|
7177 |
-
_this$props$size = _this$props.size,
|
7178 |
-
size = _this$props$size === void 0 ? 20 : _this$props$size;
|
7179 |
-
var path;
|
7180 |
|
7181 |
-
|
7182 |
-
|
7183 |
-
|
7184 |
-
|
7185 |
|
7186 |
-
|
7187 |
-
|
7188 |
-
break;
|
7189 |
|
7190 |
-
|
7191 |
-
|
7192 |
-
|
7193 |
|
7194 |
-
|
7195 |
-
|
7196 |
-
|
|
|
|
|
7197 |
|
7198 |
-
|
7199 |
-
|
7200 |
-
|
7201 |
|
7202 |
-
|
7203 |
-
|
7204 |
-
|
|
|
|
|
|
|
|
|
|
|
7205 |
|
7206 |
-
|
7207 |
-
|
7208 |
-
|
7209 |
|
7210 |
-
|
7211 |
-
|
7212 |
-
|
|
|
|
|
7213 |
|
7214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7215 |
path = 'M14.27 6.87L10 3.14 5.73 6.87 5 6.14l5-4.38 5 4.38zM14 8.42l-4.05 3.43L6 8.38v-.74l4-3.5 4 3.5v.78zM11 9.7V8H9v1.7h2zm-1.73 4.03L5 10 .73 13.73 0 13l5-4.38L10 13zm10 0L15 10l-4.27 3.73L10 13l5-4.38L20 13zM5 11l4 3.5V18H1v-3.5zm10 0l4 3.5V18h-8v-3.5zm-9 6v-2H4v2h2zm10 0v-2h-2v2h2z';
|
7216 |
break;
|
7217 |
|
@@ -8355,7 +10782,31 @@ function (_Component) {
|
|
8355 |
//# sourceMappingURL=index.js.map
|
8356 |
|
8357 |
/***/ }),
|
8358 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8359 |
/***/ (function(module, exports, __webpack_require__) {
|
8360 |
|
8361 |
"use strict";
|
@@ -8370,7 +10821,7 @@ function (_Component) {
|
|
8370 |
|
8371 |
|
8372 |
|
8373 |
-
var shallowEqual = __webpack_require__(
|
8374 |
|
8375 |
/**
|
8376 |
* Does a shallow comparison for props and state.
|
@@ -8388,7 +10839,7 @@ module.exports = shallowCompare;
|
|
8388 |
|
8389 |
|
8390 |
/***/ }),
|
8391 |
-
/*
|
8392 |
/***/ (function(module, exports, __webpack_require__) {
|
8393 |
|
8394 |
"use strict";
|
@@ -8399,7 +10850,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
8399 |
});
|
8400 |
exports['default'] = isSameDay;
|
8401 |
|
8402 |
-
var _moment = __webpack_require__(
|
8403 |
|
8404 |
var _moment2 = _interopRequireDefault(_moment);
|
8405 |
|
@@ -8413,7 +10864,7 @@ function isSameDay(a, b) {
|
|
8413 |
}
|
8414 |
|
8415 |
/***/ }),
|
8416 |
-
/*
|
8417 |
/***/ (function(module, exports, __webpack_require__) {
|
8418 |
|
8419 |
"use strict";
|
@@ -8424,11 +10875,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
8424 |
});
|
8425 |
exports['default'] = toMomentObject;
|
8426 |
|
8427 |
-
var _moment = __webpack_require__(
|
8428 |
|
8429 |
var _moment2 = _interopRequireDefault(_moment);
|
8430 |
|
8431 |
-
var _constants = __webpack_require__(
|
8432 |
|
8433 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8434 |
|
@@ -8440,7 +10891,7 @@ function toMomentObject(dateString, customFormat) {
|
|
8440 |
}
|
8441 |
|
8442 |
/***/ }),
|
8443 |
-
/*
|
8444 |
/***/ (function(module, exports, __webpack_require__) {
|
8445 |
|
8446 |
"use strict";
|
@@ -8450,18 +10901,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
8450 |
value: true
|
8451 |
});
|
8452 |
|
8453 |
-
var _propTypes = __webpack_require__(
|
8454 |
|
8455 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
8456 |
|
8457 |
-
var _constants = __webpack_require__(
|
8458 |
|
8459 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8460 |
|
8461 |
exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]);
|
8462 |
|
8463 |
/***/ }),
|
8464 |
-
/*
|
8465 |
/***/ (function(module, exports) {
|
8466 |
|
8467 |
Object.defineProperty(exports, "__esModule", {
|
@@ -8474,7 +10925,7 @@ function isTouchDevice() {
|
|
8474 |
module.exports = exports['default'];
|
8475 |
|
8476 |
/***/ }),
|
8477 |
-
/*
|
8478 |
/***/ (function(module, exports, __webpack_require__) {
|
8479 |
|
8480 |
"use strict";
|
@@ -8484,18 +10935,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
8484 |
value: true
|
8485 |
});
|
8486 |
|
8487 |
-
var _propTypes = __webpack_require__(
|
8488 |
|
8489 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
8490 |
|
8491 |
-
var _constants = __webpack_require__(
|
8492 |
|
8493 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8494 |
|
8495 |
exports['default'] = _propTypes2['default'].oneOf([_constants.OPEN_DOWN, _constants.OPEN_UP]);
|
8496 |
|
8497 |
/***/ }),
|
8498 |
-
/*
|
8499 |
/***/ (function(module, exports, __webpack_require__) {
|
8500 |
|
8501 |
"use strict";
|
@@ -8592,66 +11043,111 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
8592 |
|
8593 |
|
8594 |
/***/ }),
|
8595 |
-
/*
|
8596 |
-
/***/ (function(module,
|
8597 |
|
8598 |
"use strict";
|
8599 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8600 |
|
8601 |
-
function checkDCE() {
|
8602 |
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
8603 |
-
if (
|
8604 |
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
|
8605 |
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
|
8606 |
-
) {
|
8607 |
-
return;
|
8608 |
-
}
|
8609 |
-
if (process.env.NODE_ENV !== 'production') {
|
8610 |
-
// This branch is unreachable because this function is only called
|
8611 |
-
// in production, but the condition is true only in development.
|
8612 |
-
// Therefore if the branch is still here, dead code elimination wasn't
|
8613 |
-
// properly applied.
|
8614 |
-
// Don't change the message. React DevTools relies on it. Also make sure
|
8615 |
-
// this message doesn't occur elsewhere in this function, or it will cause
|
8616 |
-
// a false positive.
|
8617 |
-
throw new Error('^_^');
|
8618 |
-
}
|
8619 |
-
try {
|
8620 |
-
// Verify that the code above has been dead code eliminated (DCE'd).
|
8621 |
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
8622 |
-
} catch (err) {
|
8623 |
-
// DevTools shouldn't crash React, no matter what.
|
8624 |
-
// We should still report in case we break this code.
|
8625 |
-
console.error(err);
|
8626 |
-
}
|
8627 |
-
}
|
8628 |
|
8629 |
-
|
8630 |
-
|
8631 |
-
|
8632 |
-
|
8633 |
-
|
8634 |
-
|
8635 |
-
|
8636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8637 |
|
8638 |
-
|
8639 |
|
8640 |
/***/ }),
|
8641 |
-
/*
|
8642 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8643 |
|
8644 |
"use strict";
|
8645 |
-
/* harmony export (
|
8646 |
-
/* harmony
|
8647 |
-
/* harmony
|
8648 |
-
|
8649 |
-
|
8650 |
-
|
8651 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8652 |
|
8653 |
/***/ }),
|
8654 |
-
/*
|
8655 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8656 |
|
8657 |
"use strict";
|
@@ -8663,7 +11159,7 @@ var ZERO_WIDTH_NO_BREAK_SPACE = "\uFEFF";
|
|
8663 |
/* harmony export (immutable) */ __webpack_exports__["c"] = calculateSaturationChange;
|
8664 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
|
8665 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
|
8666 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tinycolor2__ = __webpack_require__(
|
8667 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tinycolor2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_tinycolor2__);
|
8668 |
/**
|
8669 |
* Parts of this source were derived and modified from react-color,
|
@@ -8902,7 +11398,7 @@ function calculateSaturationChange(e, props, container) {
|
|
8902 |
//# sourceMappingURL=utils.js.map
|
8903 |
|
8904 |
/***/ }),
|
8905 |
-
/*
|
8906 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8907 |
|
8908 |
"use strict";
|
@@ -8912,10 +11408,10 @@ function calculateSaturationChange(e, props, container) {
|
|
8912 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
8913 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
8914 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
8915 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(
|
8916 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_mousetrap__ = __webpack_require__(
|
8917 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_mousetrap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_mousetrap__);
|
8918 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind__ = __webpack_require__(
|
8919 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind__);
|
8920 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash__ = __webpack_require__(2);
|
8921 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash__);
|
@@ -9012,7 +11508,36 @@ function (_Component) {
|
|
9012 |
//# sourceMappingURL=index.js.map
|
9013 |
|
9014 |
/***/ }),
|
9015 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9016 |
/***/ (function(module, exports, __webpack_require__) {
|
9017 |
|
9018 |
"use strict";
|
@@ -9022,18 +11547,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
9022 |
value: true
|
9023 |
});
|
9024 |
|
9025 |
-
var _propTypes = __webpack_require__(
|
9026 |
|
9027 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
9028 |
|
9029 |
-
var _constants = __webpack_require__(
|
9030 |
|
9031 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9032 |
|
9033 |
exports['default'] = _propTypes2['default'].oneOf([_constants.ICON_BEFORE_POSITION, _constants.ICON_AFTER_POSITION]);
|
9034 |
|
9035 |
/***/ }),
|
9036 |
-
/*
|
9037 |
/***/ (function(module, exports, __webpack_require__) {
|
9038 |
|
9039 |
"use strict";
|
@@ -9043,18 +11568,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
9043 |
value: true
|
9044 |
});
|
9045 |
|
9046 |
-
var _propTypes = __webpack_require__(
|
9047 |
|
9048 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
9049 |
|
9050 |
-
var _constants = __webpack_require__(
|
9051 |
|
9052 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9053 |
|
9054 |
exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);
|
9055 |
|
9056 |
/***/ }),
|
9057 |
-
/*
|
9058 |
/***/ (function(module, exports, __webpack_require__) {
|
9059 |
|
9060 |
"use strict";
|
@@ -9065,11 +11590,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
9065 |
});
|
9066 |
exports['default'] = isInclusivelyAfterDay;
|
9067 |
|
9068 |
-
var _moment = __webpack_require__(
|
9069 |
|
9070 |
var _moment2 = _interopRequireDefault(_moment);
|
9071 |
|
9072 |
-
var _isBeforeDay = __webpack_require__(
|
9073 |
|
9074 |
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
|
9075 |
|
@@ -9081,7 +11606,7 @@ function isInclusivelyAfterDay(a, b) {
|
|
9081 |
}
|
9082 |
|
9083 |
/***/ }),
|
9084 |
-
/*
|
9085 |
/***/ (function(module, exports, __webpack_require__) {
|
9086 |
|
9087 |
"use strict";
|
@@ -9092,7 +11617,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
9092 |
});
|
9093 |
exports['default'] = isBeforeDay;
|
9094 |
|
9095 |
-
var _moment = __webpack_require__(
|
9096 |
|
9097 |
var _moment2 = _interopRequireDefault(_moment);
|
9098 |
|
@@ -9116,7 +11641,7 @@ function isBeforeDay(a, b) {
|
|
9116 |
}
|
9117 |
|
9118 |
/***/ }),
|
9119 |
-
/*
|
9120 |
/***/ (function(module, exports, __webpack_require__) {
|
9121 |
|
9122 |
"use strict";
|
@@ -9126,7 +11651,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
9126 |
value: true
|
9127 |
});
|
9128 |
|
9129 |
-
var _react = __webpack_require__(
|
9130 |
|
9131 |
var _react2 = _interopRequireDefault(_react);
|
9132 |
|
@@ -9153,13 +11678,13 @@ CloseButton.defaultProps = {
|
|
9153 |
exports['default'] = CloseButton;
|
9154 |
|
9155 |
/***/ }),
|
9156 |
-
/*
|
9157 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9158 |
|
9159 |
"use strict";
|
9160 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__menu__ = __webpack_require__(
|
9161 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__menu__["a"]; });
|
9162 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tabbable__ = __webpack_require__(
|
9163 |
/* unused harmony reexport TabbableContainer */
|
9164 |
/**
|
9165 |
* Internal Dependencies
|
@@ -9169,11 +11694,147 @@ exports['default'] = CloseButton;
|
|
9169 |
//# sourceMappingURL=index.js.map
|
9170 |
|
9171 |
/***/ }),
|
9172 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9173 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9174 |
|
9175 |
"use strict";
|
9176 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__svg__ = __webpack_require__(
|
9177 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["a"]; });
|
9178 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["b"]; });
|
9179 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["c"]; });
|
@@ -9181,62 +11842,208 @@ exports['default'] = CloseButton;
|
|
9181 |
//# sourceMappingURL=index.js.map
|
9182 |
|
9183 |
/***/ }),
|
9184 |
-
/*
|
9185 |
/***/ (function(module, exports, __webpack_require__) {
|
9186 |
|
9187 |
-
|
9188 |
-
|
|
|
|
|
|
|
|
|
|
|
9189 |
|
9190 |
/**
|
9191 |
-
* Internal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9192 |
*/
|
9193 |
-
var isShallowEqualObjects = __webpack_require__( 388 );
|
9194 |
-
var isShallowEqualArrays = __webpack_require__( 389 );
|
9195 |
|
9196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9197 |
|
9198 |
/**
|
9199 |
-
*
|
9200 |
-
*
|
9201 |
*
|
9202 |
-
* @
|
9203 |
-
* @param {(Array|Object)} b Second object or array to compare.
|
9204 |
*
|
9205 |
-
* @
|
|
|
|
|
|
|
9206 |
*/
|
9207 |
-
function
|
9208 |
-
|
9209 |
-
|
9210 |
-
|
9211 |
-
|
9212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9213 |
}
|
|
|
|
|
|
|
|
|
9214 |
}
|
9215 |
|
9216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9217 |
}
|
9218 |
|
9219 |
-
module.exports =
|
9220 |
|
|
|
9221 |
|
9222 |
/***/ }),
|
9223 |
-
/*
|
9224 |
-
/***/ (function(module,
|
9225 |
-
|
9226 |
-
"use strict";
|
9227 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = _slicedToArray;
|
9228 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__ = __webpack_require__(398);
|
9229 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__ = __webpack_require__(399);
|
9230 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nonIterableRest__ = __webpack_require__(400);
|
9231 |
|
|
|
9232 |
|
|
|
|
|
|
|
|
|
9233 |
|
9234 |
-
|
9235 |
-
|
|
|
|
|
|
|
|
|
|
|
9236 |
}
|
9237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9238 |
/***/ }),
|
9239 |
-
/*
|
9240 |
/***/ (function(module, exports, __webpack_require__) {
|
9241 |
|
9242 |
"use strict";
|
@@ -9248,7 +12055,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
9248 |
|
9249 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
9250 |
|
9251 |
-
var _keys = __webpack_require__(
|
9252 |
|
9253 |
var _keys2 = _interopRequireDefault(_keys);
|
9254 |
|
@@ -9300,682 +12107,151 @@ var is = {
|
|
9300 |
exports.default = is;
|
9301 |
|
9302 |
/***/ }),
|
9303 |
-
/*
|
9304 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9305 |
|
9306 |
"use strict";
|
9307 |
-
/* harmony
|
9308 |
-
/* harmony
|
9309 |
-
/* harmony import */ var
|
9310 |
-
/* harmony
|
9311 |
-
/* harmony import */ var
|
9312 |
-
/* harmony
|
9313 |
-
/* harmony import */ var
|
9314 |
-
/* harmony
|
9315 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9316 |
|
|
|
9317 |
|
9318 |
-
/**
|
9319 |
-
* WordPress dependencies
|
9320 |
-
*/
|
9321 |
|
9322 |
-
/**
|
9323 |
-
* Internal dependencies
|
9324 |
-
*/
|
9325 |
|
9326 |
|
9327 |
|
9328 |
|
|
|
9329 |
|
9330 |
-
/**
|
9331 |
-
* Browser dependencies
|
9332 |
-
*/
|
9333 |
|
9334 |
-
var _window$Node = window.Node,
|
9335 |
-
TEXT_NODE = _window$Node.TEXT_NODE,
|
9336 |
-
ELEMENT_NODE = _window$Node.ELEMENT_NODE;
|
9337 |
|
9338 |
-
function createEmptyValue() {
|
9339 |
-
return {
|
9340 |
-
formats: [],
|
9341 |
-
text: ''
|
9342 |
-
};
|
9343 |
-
}
|
9344 |
|
9345 |
-
function simpleFindKey(object, value) {
|
9346 |
-
for (var key in object) {
|
9347 |
-
if (object[key] === value) {
|
9348 |
-
return key;
|
9349 |
-
}
|
9350 |
-
}
|
9351 |
-
}
|
9352 |
|
9353 |
-
function toFormat(_ref) {
|
9354 |
-
var type = _ref.type,
|
9355 |
-
attributes = _ref.attributes;
|
9356 |
-
var formatType;
|
9357 |
|
9358 |
-
if (attributes && attributes.class) {
|
9359 |
-
formatType = Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_data__["d" /* select */])('core/rich-text').getFormatTypeForClassName(attributes.class);
|
9360 |
|
9361 |
-
if (formatType) {
|
9362 |
-
// Preserve any additional classes.
|
9363 |
-
attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
|
9364 |
|
9365 |
-
|
9366 |
-
delete attributes.class;
|
9367 |
-
}
|
9368 |
-
}
|
9369 |
-
}
|
9370 |
|
9371 |
-
|
9372 |
-
|
9373 |
-
|
9374 |
|
9375 |
-
|
9376 |
-
|
9377 |
-
|
9378 |
-
|
9379 |
-
} : {
|
9380 |
-
type: type
|
9381 |
-
};
|
9382 |
-
}
|
9383 |
-
|
9384 |
-
if (!attributes) {
|
9385 |
-
return {
|
9386 |
-
type: formatType.name
|
9387 |
-
};
|
9388 |
-
}
|
9389 |
-
|
9390 |
-
var registeredAttributes = {};
|
9391 |
-
var unregisteredAttributes = {};
|
9392 |
-
|
9393 |
-
for (var name in attributes) {
|
9394 |
-
var key = simpleFindKey(formatType.attributes, name);
|
9395 |
-
|
9396 |
-
if (key) {
|
9397 |
-
registeredAttributes[key] = attributes[name];
|
9398 |
-
} else {
|
9399 |
-
unregisteredAttributes[name] = attributes[name];
|
9400 |
-
}
|
9401 |
-
}
|
9402 |
-
|
9403 |
-
return {
|
9404 |
-
type: formatType.name,
|
9405 |
-
attributes: registeredAttributes,
|
9406 |
-
unregisteredAttributes: unregisteredAttributes
|
9407 |
-
};
|
9408 |
-
}
|
9409 |
/**
|
9410 |
-
*
|
9411 |
-
* plain text string, with optionally a `Range` object to set the selection. If
|
9412 |
-
* called without any input, an empty value will be created. If
|
9413 |
-
* `multilineTag` is provided, any content of direct children whose type matches
|
9414 |
-
* `multilineTag` will be separated by two newlines. The optional functions can
|
9415 |
-
* be used to filter out content.
|
9416 |
-
*
|
9417 |
-
* @param {?Object} $1 Optional named argements.
|
9418 |
-
* @param {?Element} $1.element Element to create value from.
|
9419 |
-
* @param {?string} $1.text Text to create value from.
|
9420 |
-
* @param {?string} $1.html HTML to create value from.
|
9421 |
-
* @param {?Range} $1.range Range to create value from.
|
9422 |
-
* @param {?string} $1.multilineTag Multiline tag if the structure is
|
9423 |
-
* multiline.
|
9424 |
-
* @param {?Array} $1.multilineWrapperTags Tags where lines can be found if
|
9425 |
-
* nesting is possible.
|
9426 |
-
* @param {?Function} $1.removeNode Function to declare whether the
|
9427 |
-
* given node should be removed.
|
9428 |
-
* @param {?Function} $1.unwrapNode Function to declare whether the
|
9429 |
-
* given node should be unwrapped.
|
9430 |
-
* @param {?Function} $1.filterString Function to filter the given
|
9431 |
-
* string.
|
9432 |
-
* @param {?Function} $1.removeAttribute Wether to remove an attribute
|
9433 |
-
* based on the name.
|
9434 |
-
*
|
9435 |
-
* @return {Object} A rich text value.
|
9436 |
*/
|
9437 |
|
9438 |
-
|
9439 |
-
function create() {
|
9440 |
-
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
9441 |
-
element = _ref2.element,
|
9442 |
-
text = _ref2.text,
|
9443 |
-
html = _ref2.html,
|
9444 |
-
range = _ref2.range,
|
9445 |
-
multilineTag = _ref2.multilineTag,
|
9446 |
-
multilineWrapperTags = _ref2.multilineWrapperTags,
|
9447 |
-
removeNode = _ref2.removeNode,
|
9448 |
-
unwrapNode = _ref2.unwrapNode,
|
9449 |
-
filterString = _ref2.filterString,
|
9450 |
-
removeAttribute = _ref2.removeAttribute;
|
9451 |
-
|
9452 |
-
if (typeof text === 'string' && text.length > 0) {
|
9453 |
-
return {
|
9454 |
-
formats: Array(text.length),
|
9455 |
-
text: text
|
9456 |
-
};
|
9457 |
-
}
|
9458 |
-
|
9459 |
-
if (typeof html === 'string' && html.length > 0) {
|
9460 |
-
element = Object(__WEBPACK_IMPORTED_MODULE_5__create_element__["a" /* createElement */])(document, html);
|
9461 |
-
}
|
9462 |
-
|
9463 |
-
if (Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_typeof__["a" /* default */])(element) !== 'object') {
|
9464 |
-
return createEmptyValue();
|
9465 |
-
}
|
9466 |
-
|
9467 |
-
if (!multilineTag) {
|
9468 |
-
return createFromElement({
|
9469 |
-
element: element,
|
9470 |
-
range: range,
|
9471 |
-
removeNode: removeNode,
|
9472 |
-
unwrapNode: unwrapNode,
|
9473 |
-
filterString: filterString,
|
9474 |
-
removeAttribute: removeAttribute
|
9475 |
-
});
|
9476 |
-
}
|
9477 |
-
|
9478 |
-
return createFromMultilineElement({
|
9479 |
-
element: element,
|
9480 |
-
range: range,
|
9481 |
-
multilineTag: multilineTag,
|
9482 |
-
multilineWrapperTags: multilineWrapperTags,
|
9483 |
-
removeNode: removeNode,
|
9484 |
-
unwrapNode: unwrapNode,
|
9485 |
-
filterString: filterString,
|
9486 |
-
removeAttribute: removeAttribute
|
9487 |
-
});
|
9488 |
-
}
|
9489 |
/**
|
9490 |
-
*
|
9491 |
-
* node and range.
|
9492 |
-
*
|
9493 |
-
* @param {Object} accumulator Object to accumulate into.
|
9494 |
-
* @param {Node} node Node to create value with.
|
9495 |
-
* @param {Range} range Range to create value with.
|
9496 |
-
* @param {Object} value Value that is being accumulated.
|
9497 |
*/
|
9498 |
|
9499 |
-
function accumulateSelection(accumulator, node, range, value) {
|
9500 |
-
if (!range) {
|
9501 |
-
return;
|
9502 |
-
}
|
9503 |
-
|
9504 |
-
var parentNode = node.parentNode;
|
9505 |
-
var startContainer = range.startContainer,
|
9506 |
-
startOffset = range.startOffset,
|
9507 |
-
endContainer = range.endContainer,
|
9508 |
-
endOffset = range.endOffset;
|
9509 |
-
var currentLength = accumulator.text.length; // Selection can be extracted from value.
|
9510 |
|
9511 |
-
if (value.start !== undefined) {
|
9512 |
-
accumulator.start = currentLength + value.start; // Range indicates that the current node has selection.
|
9513 |
-
} else if (node === startContainer && node.nodeType === TEXT_NODE) {
|
9514 |
-
accumulator.start = currentLength + startOffset; // Range indicates that the current node is selected.
|
9515 |
-
} else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) {
|
9516 |
-
accumulator.start = currentLength; // Range indicates that the selection is after the current node.
|
9517 |
-
} else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) {
|
9518 |
-
accumulator.start = currentLength + value.text.length; // Fallback if no child inside handled the selection.
|
9519 |
-
} else if (node === startContainer) {
|
9520 |
-
accumulator.start = currentLength;
|
9521 |
-
} // Selection can be extracted from value.
|
9522 |
-
|
9523 |
-
|
9524 |
-
if (value.end !== undefined) {
|
9525 |
-
accumulator.end = currentLength + value.end; // Range indicates that the current node has selection.
|
9526 |
-
} else if (node === endContainer && node.nodeType === TEXT_NODE) {
|
9527 |
-
accumulator.end = currentLength + endOffset; // Range indicates that the current node is selected.
|
9528 |
-
} else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) {
|
9529 |
-
accumulator.end = currentLength + value.text.length; // Range indicates that the selection is before the current node.
|
9530 |
-
} else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) {
|
9531 |
-
accumulator.end = currentLength; // Fallback if no child inside handled the selection.
|
9532 |
-
} else if (node === endContainer) {
|
9533 |
-
accumulator.end = currentLength + endOffset;
|
9534 |
-
}
|
9535 |
-
}
|
9536 |
/**
|
9537 |
-
*
|
9538 |
*
|
9539 |
-
*
|
9540 |
-
*
|
9541 |
-
*
|
9542 |
*
|
9543 |
-
*
|
9544 |
-
*/
|
9545 |
-
|
9546 |
-
|
9547 |
-
function filterRange(node, range, filter) {
|
9548 |
-
if (!range) {
|
9549 |
-
return;
|
9550 |
-
}
|
9551 |
-
|
9552 |
-
var startContainer = range.startContainer,
|
9553 |
-
endContainer = range.endContainer;
|
9554 |
-
var startOffset = range.startOffset,
|
9555 |
-
endOffset = range.endOffset;
|
9556 |
-
|
9557 |
-
if (node === startContainer) {
|
9558 |
-
startOffset = filter(node.nodeValue.slice(0, startOffset)).length;
|
9559 |
-
}
|
9560 |
-
|
9561 |
-
if (node === endContainer) {
|
9562 |
-
endOffset = filter(node.nodeValue.slice(0, endOffset)).length;
|
9563 |
-
}
|
9564 |
-
|
9565 |
-
return {
|
9566 |
-
startContainer: startContainer,
|
9567 |
-
startOffset: startOffset,
|
9568 |
-
endContainer: endContainer,
|
9569 |
-
endOffset: endOffset
|
9570 |
-
};
|
9571 |
-
}
|
9572 |
-
/**
|
9573 |
-
* Creates a Rich Text value from a DOM element and range.
|
9574 |
-
*
|
9575 |
-
* @param {Object} $1 Named argements.
|
9576 |
-
* @param {?Element} $1.element Element to create value from.
|
9577 |
-
* @param {?Range} $1.range Range to create value from.
|
9578 |
-
* @param {?string} $1.multilineTag Multiline tag if the structure is
|
9579 |
-
* multiline.
|
9580 |
-
* @param {?Array} $1.multilineWrapperTags Tags where lines can be found if
|
9581 |
-
* nesting is possible.
|
9582 |
-
* @param {?Function} $1.removeNode Function to declare whether the
|
9583 |
-
* given node should be removed.
|
9584 |
-
* @param {?Function} $1.unwrapNode Function to declare whether the
|
9585 |
-
* given node should be unwrapped.
|
9586 |
-
* @param {?Function} $1.filterString Function to filter the given
|
9587 |
-
* string.
|
9588 |
-
* @param {?Function} $1.removeAttribute Wether to remove an attribute
|
9589 |
-
* based on the name.
|
9590 |
*
|
9591 |
-
*
|
9592 |
-
|
9593 |
-
|
9594 |
-
|
9595 |
-
function createFromElement(_ref3) {
|
9596 |
-
var element = _ref3.element,
|
9597 |
-
range = _ref3.range,
|
9598 |
-
multilineTag = _ref3.multilineTag,
|
9599 |
-
multilineWrapperTags = _ref3.multilineWrapperTags,
|
9600 |
-
_ref3$currentWrapperT = _ref3.currentWrapperTags,
|
9601 |
-
currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
|
9602 |
-
removeNode = _ref3.removeNode,
|
9603 |
-
unwrapNode = _ref3.unwrapNode,
|
9604 |
-
filterString = _ref3.filterString,
|
9605 |
-
removeAttribute = _ref3.removeAttribute;
|
9606 |
-
var accumulator = createEmptyValue();
|
9607 |
-
|
9608 |
-
if (!element) {
|
9609 |
-
return accumulator;
|
9610 |
-
}
|
9611 |
-
|
9612 |
-
if (!element.hasChildNodes()) {
|
9613 |
-
accumulateSelection(accumulator, element, range, createEmptyValue());
|
9614 |
-
return accumulator;
|
9615 |
-
}
|
9616 |
-
|
9617 |
-
var length = element.childNodes.length;
|
9618 |
-
|
9619 |
-
var filterStringComplete = function filterStringComplete(string) {
|
9620 |
-
// Reduce any whitespace used for HTML formatting to one space
|
9621 |
-
// character, because it will also be displayed as such by the browser.
|
9622 |
-
string = string.replace(/[\n\r\t]+/g, ' ');
|
9623 |
-
|
9624 |
-
if (filterString) {
|
9625 |
-
string = filterString(string);
|
9626 |
-
}
|
9627 |
-
|
9628 |
-
return string;
|
9629 |
-
}; // Optimise for speed.
|
9630 |
-
|
9631 |
-
|
9632 |
-
for (var index = 0; index < length; index++) {
|
9633 |
-
var node = element.childNodes[index];
|
9634 |
-
var type = node.nodeName.toLowerCase();
|
9635 |
-
|
9636 |
-
if (node.nodeType === TEXT_NODE) {
|
9637 |
-
var _text = filterStringComplete(node.nodeValue);
|
9638 |
-
|
9639 |
-
range = filterRange(node, range, filterStringComplete);
|
9640 |
-
accumulateSelection(accumulator, node, range, {
|
9641 |
-
text: _text
|
9642 |
-
});
|
9643 |
-
accumulator.text += _text; // Create a sparse array of the same length as `text`, in which
|
9644 |
-
// formats can be added.
|
9645 |
-
|
9646 |
-
accumulator.formats.length += _text.length;
|
9647 |
-
continue;
|
9648 |
-
}
|
9649 |
-
|
9650 |
-
if (node.nodeType !== ELEMENT_NODE) {
|
9651 |
-
continue;
|
9652 |
-
}
|
9653 |
-
|
9654 |
-
if (removeNode && removeNode(node) || unwrapNode && unwrapNode(node) && !node.hasChildNodes()) {
|
9655 |
-
accumulateSelection(accumulator, node, range, createEmptyValue());
|
9656 |
-
continue;
|
9657 |
-
}
|
9658 |
-
|
9659 |
-
if (type === 'br') {
|
9660 |
-
accumulateSelection(accumulator, node, range, createEmptyValue());
|
9661 |
-
accumulator.text += '\n';
|
9662 |
-
accumulator.formats.length += 1;
|
9663 |
-
continue;
|
9664 |
-
}
|
9665 |
-
|
9666 |
-
var lastFormats = accumulator.formats[accumulator.formats.length - 1];
|
9667 |
-
var lastFormat = lastFormats && lastFormats[lastFormats.length - 1];
|
9668 |
-
var format = void 0;
|
9669 |
-
var value = void 0;
|
9670 |
-
|
9671 |
-
if (!unwrapNode || !unwrapNode(node)) {
|
9672 |
-
var newFormat = toFormat({
|
9673 |
-
type: type,
|
9674 |
-
attributes: getAttributes({
|
9675 |
-
element: node,
|
9676 |
-
removeAttribute: removeAttribute
|
9677 |
-
})
|
9678 |
-
});
|
9679 |
-
|
9680 |
-
if (newFormat) {
|
9681 |
-
// Reuse the last format if it's equal.
|
9682 |
-
if (Object(__WEBPACK_IMPORTED_MODULE_4__is_format_equal__["a" /* isFormatEqual */])(newFormat, lastFormat)) {
|
9683 |
-
format = lastFormat;
|
9684 |
-
} else {
|
9685 |
-
format = newFormat;
|
9686 |
-
}
|
9687 |
-
}
|
9688 |
-
}
|
9689 |
-
|
9690 |
-
if (multilineWrapperTags && multilineWrapperTags.indexOf(type) !== -1) {
|
9691 |
-
value = createFromMultilineElement({
|
9692 |
-
element: node,
|
9693 |
-
range: range,
|
9694 |
-
multilineTag: multilineTag,
|
9695 |
-
multilineWrapperTags: multilineWrapperTags,
|
9696 |
-
removeNode: removeNode,
|
9697 |
-
unwrapNode: unwrapNode,
|
9698 |
-
filterString: filterString,
|
9699 |
-
removeAttribute: removeAttribute,
|
9700 |
-
currentWrapperTags: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(currentWrapperTags).concat([format])
|
9701 |
-
});
|
9702 |
-
format = undefined;
|
9703 |
-
} else {
|
9704 |
-
value = createFromElement({
|
9705 |
-
element: node,
|
9706 |
-
range: range,
|
9707 |
-
multilineTag: multilineTag,
|
9708 |
-
multilineWrapperTags: multilineWrapperTags,
|
9709 |
-
removeNode: removeNode,
|
9710 |
-
unwrapNode: unwrapNode,
|
9711 |
-
filterString: filterString,
|
9712 |
-
removeAttribute: removeAttribute
|
9713 |
-
});
|
9714 |
-
}
|
9715 |
-
|
9716 |
-
var text = value.text;
|
9717 |
-
var start = accumulator.text.length;
|
9718 |
-
accumulateSelection(accumulator, node, range, value); // Don't apply the element as formatting if it has no content.
|
9719 |
-
|
9720 |
-
if (Object(__WEBPACK_IMPORTED_MODULE_3__is_empty__["a" /* isEmpty */])(value) && format && !format.attributes) {
|
9721 |
-
continue;
|
9722 |
-
}
|
9723 |
-
|
9724 |
-
var formats = accumulator.formats;
|
9725 |
-
|
9726 |
-
if (format && format.attributes && text.length === 0) {
|
9727 |
-
format.object = true;
|
9728 |
-
accumulator.text += __WEBPACK_IMPORTED_MODULE_6__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */];
|
9729 |
-
|
9730 |
-
if (formats[start]) {
|
9731 |
-
formats[start].unshift(format);
|
9732 |
-
} else {
|
9733 |
-
formats[start] = [format];
|
9734 |
-
}
|
9735 |
-
} else {
|
9736 |
-
accumulator.text += text;
|
9737 |
-
accumulator.formats.length += text.length;
|
9738 |
-
var i = value.formats.length; // Optimise for speed.
|
9739 |
-
|
9740 |
-
while (i--) {
|
9741 |
-
var formatIndex = start + i;
|
9742 |
-
|
9743 |
-
if (format) {
|
9744 |
-
if (formats[formatIndex]) {
|
9745 |
-
formats[formatIndex].push(format);
|
9746 |
-
} else {
|
9747 |
-
formats[formatIndex] = [format];
|
9748 |
-
}
|
9749 |
-
}
|
9750 |
-
|
9751 |
-
if (value.formats[i]) {
|
9752 |
-
if (formats[formatIndex]) {
|
9753 |
-
var _formats$formatIndex;
|
9754 |
-
|
9755 |
-
(_formats$formatIndex = formats[formatIndex]).push.apply(_formats$formatIndex, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(value.formats[i]));
|
9756 |
-
} else {
|
9757 |
-
formats[formatIndex] = value.formats[i];
|
9758 |
-
}
|
9759 |
-
}
|
9760 |
-
}
|
9761 |
-
}
|
9762 |
-
}
|
9763 |
-
|
9764 |
-
return accumulator;
|
9765 |
-
}
|
9766 |
-
/**
|
9767 |
-
* Creates a rich text value from a DOM element and range that should be
|
9768 |
-
* multiline.
|
9769 |
*
|
9770 |
-
* @
|
9771 |
-
*
|
9772 |
-
*
|
9773 |
-
*
|
9774 |
-
*
|
9775 |
-
*
|
9776 |
-
*
|
9777 |
-
* @param {?Function} $1.removeNode Function to declare whether the
|
9778 |
-
* given node should be removed.
|
9779 |
-
* @param {?Function} $1.unwrapNode Function to declare whether the
|
9780 |
-
* given node should be unwrapped.
|
9781 |
-
* @param {?Function} $1.filterString Function to filter the given
|
9782 |
-
* string.
|
9783 |
-
* @param {?Function} $1.removeAttribute Wether to remove an attribute
|
9784 |
-
* based on the name.
|
9785 |
-
* @param {boolean} $1.currentWrapperTags Whether to prepend a line
|
9786 |
-
* separator.
|
9787 |
*
|
9788 |
-
*
|
9789 |
-
*/
|
9790 |
-
|
9791 |
-
|
9792 |
-
function createFromMultilineElement(_ref4) {
|
9793 |
-
var element = _ref4.element,
|
9794 |
-
range = _ref4.range,
|
9795 |
-
multilineTag = _ref4.multilineTag,
|
9796 |
-
multilineWrapperTags = _ref4.multilineWrapperTags,
|
9797 |
-
removeNode = _ref4.removeNode,
|
9798 |
-
unwrapNode = _ref4.unwrapNode,
|
9799 |
-
filterString = _ref4.filterString,
|
9800 |
-
removeAttribute = _ref4.removeAttribute,
|
9801 |
-
_ref4$currentWrapperT = _ref4.currentWrapperTags,
|
9802 |
-
currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT;
|
9803 |
-
var accumulator = createEmptyValue();
|
9804 |
-
|
9805 |
-
if (!element || !element.hasChildNodes()) {
|
9806 |
-
return accumulator;
|
9807 |
-
}
|
9808 |
-
|
9809 |
-
var length = element.children.length; // Optimise for speed.
|
9810 |
-
|
9811 |
-
for (var index = 0; index < length; index++) {
|
9812 |
-
var node = element.children[index];
|
9813 |
-
|
9814 |
-
if (node.nodeName.toLowerCase() !== multilineTag) {
|
9815 |
-
continue;
|
9816 |
-
}
|
9817 |
-
|
9818 |
-
var value = createFromElement({
|
9819 |
-
element: node,
|
9820 |
-
range: range,
|
9821 |
-
multilineTag: multilineTag,
|
9822 |
-
multilineWrapperTags: multilineWrapperTags,
|
9823 |
-
currentWrapperTags: currentWrapperTags,
|
9824 |
-
removeNode: removeNode,
|
9825 |
-
unwrapNode: unwrapNode,
|
9826 |
-
filterString: filterString,
|
9827 |
-
removeAttribute: removeAttribute
|
9828 |
-
}); // If a line consists of one single line break (invisible), consider the
|
9829 |
-
// line empty, wether this is the browser's doing or not.
|
9830 |
-
|
9831 |
-
if (value.text === '\n') {
|
9832 |
-
var start = value.start;
|
9833 |
-
var end = value.end;
|
9834 |
-
value = createEmptyValue();
|
9835 |
-
|
9836 |
-
if (start !== undefined) {
|
9837 |
-
value.start = 0;
|
9838 |
-
}
|
9839 |
-
|
9840 |
-
if (end !== undefined) {
|
9841 |
-
value.end = 0;
|
9842 |
-
}
|
9843 |
-
} // Multiline value text should be separated by a double line break.
|
9844 |
-
|
9845 |
-
|
9846 |
-
if (index !== 0 || currentWrapperTags.length > 0) {
|
9847 |
-
var formats = currentWrapperTags.length > 0 ? [currentWrapperTags] : [,];
|
9848 |
-
accumulator.formats = accumulator.formats.concat(formats);
|
9849 |
-
accumulator.text += __WEBPACK_IMPORTED_MODULE_6__special_characters__["a" /* LINE_SEPARATOR */];
|
9850 |
-
}
|
9851 |
-
|
9852 |
-
accumulateSelection(accumulator, node, range, value);
|
9853 |
-
accumulator.formats = accumulator.formats.concat(value.formats);
|
9854 |
-
accumulator.text += value.text;
|
9855 |
-
}
|
9856 |
-
|
9857 |
-
return accumulator;
|
9858 |
-
}
|
9859 |
-
/**
|
9860 |
-
* Gets the attributes of an element in object shape.
|
9861 |
*
|
9862 |
-
*
|
9863 |
-
*
|
9864 |
-
*
|
9865 |
-
*
|
9866 |
*
|
9867 |
-
* @return {?Object} Attribute object or `undefined` if the element has no
|
9868 |
-
* attributes.
|
9869 |
-
*/
|
9870 |
-
|
9871 |
-
|
9872 |
-
function getAttributes(_ref5) {
|
9873 |
-
var element = _ref5.element,
|
9874 |
-
removeAttribute = _ref5.removeAttribute;
|
9875 |
-
|
9876 |
-
if (!element.hasAttributes()) {
|
9877 |
-
return;
|
9878 |
-
}
|
9879 |
-
|
9880 |
-
var length = element.attributes.length;
|
9881 |
-
var accumulator; // Optimise for speed.
|
9882 |
-
|
9883 |
-
for (var i = 0; i < length; i++) {
|
9884 |
-
var _element$attributes$i = element.attributes[i],
|
9885 |
-
name = _element$attributes$i.name,
|
9886 |
-
value = _element$attributes$i.value;
|
9887 |
-
|
9888 |
-
if (removeAttribute && removeAttribute(name)) {
|
9889 |
-
continue;
|
9890 |
-
}
|
9891 |
-
|
9892 |
-
accumulator = accumulator || {};
|
9893 |
-
accumulator[name] = value;
|
9894 |
-
}
|
9895 |
-
|
9896 |
-
return accumulator;
|
9897 |
-
}
|
9898 |
-
//# sourceMappingURL=create.js.map
|
9899 |
-
|
9900 |
-
/***/ }),
|
9901 |
-
/* 68 */
|
9902 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9903 |
-
|
9904 |
-
"use strict";
|
9905 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = insert;
|
9906 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create__ = __webpack_require__(67);
|
9907 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__normalise_formats__ = __webpack_require__(43);
|
9908 |
-
/**
|
9909 |
-
* Internal dependencies
|
9910 |
-
*/
|
9911 |
-
|
9912 |
-
|
9913 |
-
/**
|
9914 |
-
* Insert a Rich Text value, an HTML string, or a plain text string, into a
|
9915 |
-
* Rich Text value at the given `startIndex`. Any content between `startIndex`
|
9916 |
-
* and `endIndex` will be removed. Indices are retrieved from the selection if
|
9917 |
-
* none are provided.
|
9918 |
*
|
9919 |
-
*
|
9920 |
-
*
|
9921 |
-
*
|
9922 |
-
*
|
|
|
|
|
9923 |
*
|
9924 |
-
* @return {
|
9925 |
*/
|
9926 |
|
9927 |
-
function
|
9928 |
-
|
9929 |
-
text = _ref.text,
|
9930 |
-
start = _ref.start,
|
9931 |
-
end = _ref.end;
|
9932 |
-
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : start;
|
9933 |
-
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : end;
|
9934 |
-
|
9935 |
-
if (typeof valueToInsert === 'string') {
|
9936 |
-
valueToInsert = Object(__WEBPACK_IMPORTED_MODULE_0__create__["a" /* create */])({
|
9937 |
-
text: valueToInsert
|
9938 |
-
});
|
9939 |
-
}
|
9940 |
-
|
9941 |
-
var index = startIndex + valueToInsert.text.length;
|
9942 |
-
return Object(__WEBPACK_IMPORTED_MODULE_1__normalise_formats__["a" /* normaliseFormats */])({
|
9943 |
-
formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
|
9944 |
-
text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
|
9945 |
-
start: index,
|
9946 |
-
end: index
|
9947 |
-
});
|
9948 |
}
|
9949 |
-
//# sourceMappingURL=
|
9950 |
|
9951 |
/***/ }),
|
9952 |
-
/*
|
9953 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9954 |
|
9955 |
"use strict";
|
9956 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
9957 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(
|
9958 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
9959 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
9960 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
9961 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
9962 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
9963 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
9964 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_element__ = __webpack_require__(
|
9965 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(
|
9966 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
|
9967 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal__ = __webpack_require__(
|
9968 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal__);
|
9969 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__wordpress_dom__ = __webpack_require__(
|
9970 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__wordpress_keycodes__ = __webpack_require__(
|
9971 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(
|
9972 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__higher_order_with_focus_return__ = __webpack_require__(
|
9973 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__higher_order_with_constrained_tabbing__ = __webpack_require__(
|
9974 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__detect_outside__ = __webpack_require__(
|
9975 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__icon_button__ = __webpack_require__(
|
9976 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__scroll_lock__ = __webpack_require__(
|
9977 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isolated_event_container__ = __webpack_require__(
|
9978 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__slot_fill__ = __webpack_require__(
|
9979 |
|
9980 |
|
9981 |
|
@@ -10364,7 +12640,7 @@ PopoverContainer.Slot = function () {
|
|
10364 |
//# sourceMappingURL=index.js.map
|
10365 |
|
10366 |
/***/ }),
|
10367 |
-
/*
|
10368 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
10369 |
|
10370 |
"use strict";
|
@@ -10374,9 +12650,9 @@ PopoverContainer.Slot = function () {
|
|
10374 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
10375 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
10376 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
10377 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(
|
10378 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_deprecated__ = __webpack_require__(
|
10379 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__popover__ = __webpack_require__(
|
10380 |
|
10381 |
|
10382 |
|
@@ -10525,235 +12801,41 @@ function (_Component) {
|
|
10525 |
//# sourceMappingURL=index.js.map
|
10526 |
|
10527 |
/***/ }),
|
10528 |
-
/*
|
10529 |
/***/ (function(module, exports, __webpack_require__) {
|
10530 |
|
10531 |
"use strict";
|
10532 |
|
10533 |
|
10534 |
-
var
|
10535 |
-
|
10536 |
-
var constructorRegex = /^\s*class\b/;
|
10537 |
-
var isES6ClassFn = function isES6ClassFunction(value) {
|
10538 |
-
try {
|
10539 |
-
var fnStr = fnToStr.call(value);
|
10540 |
-
return constructorRegex.test(fnStr);
|
10541 |
-
} catch (e) {
|
10542 |
-
return false; // not a function
|
10543 |
-
}
|
10544 |
-
};
|
10545 |
|
10546 |
-
|
10547 |
-
try {
|
10548 |
-
if (isES6ClassFn(value)) { return false; }
|
10549 |
-
fnToStr.call(value);
|
10550 |
-
return true;
|
10551 |
-
} catch (e) {
|
10552 |
-
return false;
|
10553 |
-
}
|
10554 |
-
};
|
10555 |
-
var toStr = Object.prototype.toString;
|
10556 |
-
var fnClass = '[object Function]';
|
10557 |
-
var genClass = '[object GeneratorFunction]';
|
10558 |
-
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
10559 |
-
|
10560 |
-
module.exports = function isCallable(value) {
|
10561 |
-
if (!value) { return false; }
|
10562 |
-
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
10563 |
-
if (typeof value === 'function' && !value.prototype) { return true; }
|
10564 |
-
if (hasToStringTag) { return tryFunctionObject(value); }
|
10565 |
-
if (isES6ClassFn(value)) { return false; }
|
10566 |
-
var strClass = toStr.call(value);
|
10567 |
-
return strClass === fnClass || strClass === genClass;
|
10568 |
-
};
|
10569 |
|
10570 |
|
10571 |
/***/ }),
|
10572 |
-
/*
|
10573 |
/***/ (function(module, exports, __webpack_require__) {
|
10574 |
|
10575 |
"use strict";
|
10576 |
|
10577 |
|
10578 |
-
|
10579 |
-
Set,
|
10580 |
-
Map,
|
10581 |
-
WeakSet,
|
10582 |
-
WeakMap,
|
10583 |
-
|
10584 |
-
Promise,
|
10585 |
-
|
10586 |
-
Symbol,
|
10587 |
-
Proxy,
|
10588 |
|
10589 |
-
|
10590 |
-
SharedArrayBuffer,
|
10591 |
-
|
10592 |
-
ArrayBuffer,
|
10593 |
-
DataView,
|
10594 |
-
Uint8Array,
|
10595 |
-
Float32Array,
|
10596 |
-
Float64Array,
|
10597 |
-
Int8Array,
|
10598 |
-
Int16Array,
|
10599 |
-
Int32Array,
|
10600 |
-
Uint8ClampedArray,
|
10601 |
-
Uint16Array,
|
10602 |
-
Uint32Array,
|
10603 |
-
*/
|
10604 |
-
|
10605 |
-
var undefined; // eslint-disable-line no-shadow-restricted-names
|
10606 |
-
|
10607 |
-
var ThrowTypeError = Object.getOwnPropertyDescriptor
|
10608 |
-
? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }())
|
10609 |
-
: function () { throw new TypeError(); };
|
10610 |
-
|
10611 |
-
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
|
10612 |
-
|
10613 |
-
var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
|
10614 |
-
|
10615 |
-
var generator; // = function * () {};
|
10616 |
-
var generatorFunction = generator ? getProto(generator) : undefined;
|
10617 |
-
var asyncFn; // async function() {};
|
10618 |
-
var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
|
10619 |
-
var asyncGen; // async function * () {};
|
10620 |
-
var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
|
10621 |
-
var asyncGenIterator = asyncGen ? asyncGen() : undefined;
|
10622 |
|
10623 |
-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
10624 |
|
10625 |
-
|
10626 |
-
|
10627 |
-
|
10628 |
-
'$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
|
10629 |
-
'$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
10630 |
-
'$ %ArrayPrototype%': Array.prototype,
|
10631 |
-
'$ %ArrayProto_entries%': Array.prototype.entries,
|
10632 |
-
'$ %ArrayProto_forEach%': Array.prototype.forEach,
|
10633 |
-
'$ %ArrayProto_keys%': Array.prototype.keys,
|
10634 |
-
'$ %ArrayProto_values%': Array.prototype.values,
|
10635 |
-
'$ %AsyncFromSyncIteratorPrototype%': undefined,
|
10636 |
-
'$ %AsyncFunction%': asyncFunction,
|
10637 |
-
'$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
|
10638 |
-
'$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
|
10639 |
-
'$ %AsyncGeneratorFunction%': asyncGenFunction,
|
10640 |
-
'$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
|
10641 |
-
'$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
|
10642 |
-
'$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
10643 |
-
'$ %Boolean%': Boolean,
|
10644 |
-
'$ %BooleanPrototype%': Boolean.prototype,
|
10645 |
-
'$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
10646 |
-
'$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
|
10647 |
-
'$ %Date%': Date,
|
10648 |
-
'$ %DatePrototype%': Date.prototype,
|
10649 |
-
'$ %decodeURI%': decodeURI,
|
10650 |
-
'$ %decodeURIComponent%': decodeURIComponent,
|
10651 |
-
'$ %encodeURI%': encodeURI,
|
10652 |
-
'$ %encodeURIComponent%': encodeURIComponent,
|
10653 |
-
'$ %Error%': Error,
|
10654 |
-
'$ %ErrorPrototype%': Error.prototype,
|
10655 |
-
'$ %eval%': eval, // eslint-disable-line no-eval
|
10656 |
-
'$ %EvalError%': EvalError,
|
10657 |
-
'$ %EvalErrorPrototype%': EvalError.prototype,
|
10658 |
-
'$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
10659 |
-
'$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
|
10660 |
-
'$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
10661 |
-
'$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
|
10662 |
-
'$ %Function%': Function,
|
10663 |
-
'$ %FunctionPrototype%': Function.prototype,
|
10664 |
-
'$ %Generator%': generator ? getProto(generator()) : undefined,
|
10665 |
-
'$ %GeneratorFunction%': generatorFunction,
|
10666 |
-
'$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
|
10667 |
-
'$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
10668 |
-
'$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
|
10669 |
-
'$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
10670 |
-
'$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
|
10671 |
-
'$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
10672 |
-
'$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
|
10673 |
-
'$ %isFinite%': isFinite,
|
10674 |
-
'$ %isNaN%': isNaN,
|
10675 |
-
'$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
10676 |
-
'$ %JSON%': JSON,
|
10677 |
-
'$ %JSONParse%': JSON.parse,
|
10678 |
-
'$ %Map%': typeof Map === 'undefined' ? undefined : Map,
|
10679 |
-
'$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
10680 |
-
'$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
|
10681 |
-
'$ %Math%': Math,
|
10682 |
-
'$ %Number%': Number,
|
10683 |
-
'$ %NumberPrototype%': Number.prototype,
|
10684 |
-
'$ %Object%': Object,
|
10685 |
-
'$ %ObjectPrototype%': Object.prototype,
|
10686 |
-
'$ %ObjProto_toString%': Object.prototype.toString,
|
10687 |
-
'$ %ObjProto_valueOf%': Object.prototype.valueOf,
|
10688 |
-
'$ %parseFloat%': parseFloat,
|
10689 |
-
'$ %parseInt%': parseInt,
|
10690 |
-
'$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
10691 |
-
'$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
|
10692 |
-
'$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
|
10693 |
-
'$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
|
10694 |
-
'$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
|
10695 |
-
'$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
|
10696 |
-
'$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
10697 |
-
'$ %RangeError%': RangeError,
|
10698 |
-
'$ %RangeErrorPrototype%': RangeError.prototype,
|
10699 |
-
'$ %ReferenceError%': ReferenceError,
|
10700 |
-
'$ %ReferenceErrorPrototype%': ReferenceError.prototype,
|
10701 |
-
'$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
10702 |
-
'$ %RegExp%': RegExp,
|
10703 |
-
'$ %RegExpPrototype%': RegExp.prototype,
|
10704 |
-
'$ %Set%': typeof Set === 'undefined' ? undefined : Set,
|
10705 |
-
'$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
10706 |
-
'$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
|
10707 |
-
'$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
10708 |
-
'$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
|
10709 |
-
'$ %String%': String,
|
10710 |
-
'$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
10711 |
-
'$ %StringPrototype%': String.prototype,
|
10712 |
-
'$ %Symbol%': hasSymbols ? Symbol : undefined,
|
10713 |
-
'$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
|
10714 |
-
'$ %SyntaxError%': SyntaxError,
|
10715 |
-
'$ %SyntaxErrorPrototype%': SyntaxError.prototype,
|
10716 |
-
'$ %ThrowTypeError%': ThrowTypeError,
|
10717 |
-
'$ %TypedArray%': TypedArray,
|
10718 |
-
'$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
|
10719 |
-
'$ %TypeError%': TypeError,
|
10720 |
-
'$ %TypeErrorPrototype%': TypeError.prototype,
|
10721 |
-
'$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
10722 |
-
'$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
|
10723 |
-
'$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
10724 |
-
'$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
|
10725 |
-
'$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
10726 |
-
'$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
|
10727 |
-
'$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
10728 |
-
'$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
|
10729 |
-
'$ %URIError%': URIError,
|
10730 |
-
'$ %URIErrorPrototype%': URIError.prototype,
|
10731 |
-
'$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
10732 |
-
'$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
|
10733 |
-
'$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
|
10734 |
-
'$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
|
10735 |
-
};
|
10736 |
|
10737 |
-
|
10738 |
-
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
10739 |
-
throw new TypeError('"allowMissing" argument must be a boolean');
|
10740 |
-
}
|
10741 |
|
10742 |
-
var key = '$ ' + name;
|
10743 |
-
if (!(key in INTRINSICS)) {
|
10744 |
-
throw new SyntaxError('intrinsic ' + name + ' does not exist!');
|
10745 |
-
}
|
10746 |
|
10747 |
-
|
10748 |
-
if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) {
|
10749 |
-
throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
10750 |
-
}
|
10751 |
-
return INTRINSICS[key];
|
10752 |
-
};
|
10753 |
|
10754 |
|
10755 |
/***/ }),
|
10756 |
-
/*
|
10757 |
/***/ (function(module, exports, __webpack_require__) {
|
10758 |
|
10759 |
"use strict";
|
@@ -10763,11 +12845,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
10763 |
value: true
|
10764 |
});
|
10765 |
|
10766 |
-
var _propTypes = __webpack_require__(
|
10767 |
|
10768 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
10769 |
|
10770 |
-
var _airbnbPropTypes = __webpack_require__(
|
10771 |
|
10772 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10773 |
|
@@ -10798,7 +12880,7 @@ exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceO
|
|
10798 |
}()], 'Modifiers (Set of Strings)');
|
10799 |
|
10800 |
/***/ }),
|
10801 |
-
/*
|
10802 |
/***/ (function(module, exports, __webpack_require__) {
|
10803 |
|
10804 |
"use strict";
|
@@ -10809,15 +12891,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
10809 |
});
|
10810 |
exports['default'] = toISODateString;
|
10811 |
|
10812 |
-
var _moment = __webpack_require__(
|
10813 |
|
10814 |
var _moment2 = _interopRequireDefault(_moment);
|
10815 |
|
10816 |
-
var _toMomentObject = __webpack_require__(
|
10817 |
|
10818 |
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
|
10819 |
|
10820 |
-
var _constants = __webpack_require__(
|
10821 |
|
10822 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10823 |
|
@@ -10829,7 +12911,7 @@ function toISODateString(date, currentFormat) {
|
|
10829 |
}
|
10830 |
|
10831 |
/***/ }),
|
10832 |
-
/*
|
10833 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
10834 |
|
10835 |
"use strict";
|
@@ -11044,7 +13126,7 @@ function addEventListener(target, eventName, listener, options) {
|
|
11044 |
|
11045 |
|
11046 |
/***/ }),
|
11047 |
-
/*
|
11048 |
/***/ (function(module, exports, __webpack_require__) {
|
11049 |
|
11050 |
"use strict";
|
@@ -11055,15 +13137,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
11055 |
});
|
11056 |
exports['default'] = toISOMonthString;
|
11057 |
|
11058 |
-
var _moment = __webpack_require__(
|
11059 |
|
11060 |
var _moment2 = _interopRequireDefault(_moment);
|
11061 |
|
11062 |
-
var _toMomentObject = __webpack_require__(
|
11063 |
|
11064 |
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
|
11065 |
|
11066 |
-
var _constants = __webpack_require__(
|
11067 |
|
11068 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11069 |
|
@@ -11075,7 +13157,7 @@ function toISOMonthString(date, currentFormat) {
|
|
11075 |
}
|
11076 |
|
11077 |
/***/ }),
|
11078 |
-
/*
|
11079 |
/***/ (function(module, exports, __webpack_require__) {
|
11080 |
|
11081 |
"use strict";
|
@@ -11085,18 +13167,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
11085 |
value: true
|
11086 |
});
|
11087 |
|
11088 |
-
var _propTypes = __webpack_require__(
|
11089 |
|
11090 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
11091 |
|
11092 |
-
var _constants = __webpack_require__(
|
11093 |
|
11094 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11095 |
|
11096 |
exports['default'] = _propTypes2['default'].oneOfType([_propTypes2['default'].bool, _propTypes2['default'].oneOf([_constants.START_DATE, _constants.END_DATE])]);
|
11097 |
|
11098 |
/***/ }),
|
11099 |
-
/*
|
11100 |
/***/ (function(module, exports, __webpack_require__) {
|
11101 |
|
11102 |
"use strict";
|
@@ -11107,15 +13189,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
11107 |
});
|
11108 |
exports['default'] = isAfterDay;
|
11109 |
|
11110 |
-
var _moment = __webpack_require__(
|
11111 |
|
11112 |
var _moment2 = _interopRequireDefault(_moment);
|
11113 |
|
11114 |
-
var _isBeforeDay = __webpack_require__(
|
11115 |
|
11116 |
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
|
11117 |
|
11118 |
-
var _isSameDay = __webpack_require__(
|
11119 |
|
11120 |
var _isSameDay2 = _interopRequireDefault(_isSameDay);
|
11121 |
|
@@ -11127,15 +13209,15 @@ function isAfterDay(a, b) {
|
|
11127 |
}
|
11128 |
|
11129 |
/***/ }),
|
11130 |
-
/*
|
11131 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11132 |
|
11133 |
"use strict";
|
11134 |
/* harmony export (immutable) */ __webpack_exports__["f"] = concatChildren;
|
11135 |
/* unused harmony export switchChildrenNodeName */
|
11136 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(
|
11137 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(
|
11138 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(
|
11139 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
11140 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
|
11141 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
|
@@ -11288,7 +13370,7 @@ function switchChildrenNodeName(children, nodeName) {
|
|
11288 |
//# sourceMappingURL=react.js.map
|
11289 |
|
11290 |
/***/ }),
|
11291 |
-
/*
|
11292 |
/***/ (function(module, exports, __webpack_require__) {
|
11293 |
|
11294 |
"use strict";
|
@@ -11304,8 +13386,9 @@ function switchChildrenNodeName(children, nodeName) {
|
|
11304 |
var printWarning = function() {};
|
11305 |
|
11306 |
if (process.env.NODE_ENV !== 'production') {
|
11307 |
-
var ReactPropTypesSecret = __webpack_require__(
|
11308 |
var loggedTypeFailures = {};
|
|
|
11309 |
|
11310 |
printWarning = function(text) {
|
11311 |
var message = 'Warning: ' + text;
|
@@ -11335,7 +13418,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
11335 |
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
11336 |
if (process.env.NODE_ENV !== 'production') {
|
11337 |
for (var typeSpecName in typeSpecs) {
|
11338 |
-
if (typeSpecs
|
11339 |
var error;
|
11340 |
// Prop type validation may throw. In case they do, we don't want to
|
11341 |
// fail the render phase where it didn't fail before. So we log it.
|
@@ -11363,8 +13446,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
11363 |
'You may have forgotten to pass an argument to the type checker ' +
|
11364 |
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
11365 |
'shape all require an argument).'
|
11366 |
-
)
|
11367 |
-
|
11368 |
}
|
11369 |
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
11370 |
// Only monitor this failure once because there tends to be a lot of the
|
@@ -11382,12 +13464,23 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
11382 |
}
|
11383 |
}
|
11384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11385 |
module.exports = checkPropTypes;
|
11386 |
|
11387 |
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(
|
11388 |
|
11389 |
/***/ }),
|
11390 |
-
/*
|
11391 |
/***/ (function(module, exports, __webpack_require__) {
|
11392 |
|
11393 |
"use strict";
|
@@ -11406,16116 +13499,13168 @@ module.exports = ReactPropTypesSecret;
|
|
11406 |
|
11407 |
|
11408 |
/***/ }),
|
11409 |
-
/*
|
11410 |
-
/***/ (function(module,
|
11411 |
|
11412 |
-
|
11413 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RegistryConsumer; });
|
11414 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(0);
|
11415 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__default_registry__ = __webpack_require__(110);
|
11416 |
-
/**
|
11417 |
-
* WordPress dependencies
|
11418 |
-
*/
|
11419 |
|
11420 |
-
|
11421 |
-
|
11422 |
-
*/
|
11423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11424 |
|
|
|
|
|
|
|
|
|
11425 |
|
11426 |
-
|
11427 |
-
|
11428 |
-
|
11429 |
|
11430 |
-
|
11431 |
-
|
11432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11433 |
|
11434 |
-
|
11435 |
-
|
11436 |
-
|
11437 |
|
11438 |
-
|
11439 |
-
|
11440 |
-
|
11441 |
-
*
|
11442 |
-
* @param {string} hookName The hook name to validate. Should be a non empty string containing
|
11443 |
-
* only numbers, letters, dashes, periods and underscores. Also,
|
11444 |
-
* the hook name cannot begin with `__`.
|
11445 |
-
*
|
11446 |
-
* @return {boolean} Whether the hook name is valid.
|
11447 |
-
*/
|
11448 |
-
function validateHookName(hookName) {
|
11449 |
-
if ('string' !== typeof hookName || '' === hookName) {
|
11450 |
-
// eslint-disable-next-line no-console
|
11451 |
-
console.error('The hook name must be a non-empty string.');
|
11452 |
-
return false;
|
11453 |
-
}
|
11454 |
|
11455 |
-
|
11456 |
-
|
11457 |
-
|
11458 |
-
return false;
|
11459 |
-
}
|
11460 |
|
11461 |
-
|
11462 |
-
|
11463 |
-
|
11464 |
-
|
11465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11466 |
|
11467 |
-
|
11468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11469 |
|
11470 |
-
/* harmony default export */ __webpack_exports__["a"] = (validateHookName);
|
11471 |
-
//# sourceMappingURL=validateHookName.js.map
|
11472 |
|
11473 |
/***/ }),
|
11474 |
-
/*
|
11475 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11476 |
|
11477 |
"use strict";
|
11478 |
-
/* harmony
|
11479 |
-
/* harmony import */ var
|
11480 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
11481 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
11482 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
11483 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(0);
|
11484 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_compose__ = __webpack_require__(14);
|
11485 |
|
11486 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11487 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11491 |
|
11492 |
/**
|
11493 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11494 |
*/
|
|
|
|
|
|
|
|
|
11495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11496 |
|
11497 |
/**
|
11498 |
-
*
|
11499 |
-
* sidebars, modals, dropdowns. When mounting the wrapped component, we track a
|
11500 |
-
* reference to the current active element so we know where to restore focus
|
11501 |
-
* when the component is unmounted.
|
11502 |
*
|
11503 |
-
* @
|
11504 |
*
|
11505 |
-
* @
|
|
|
11506 |
*/
|
|
|
|
|
11507 |
|
11508 |
-
|
11509 |
-
|
11510 |
-
|
11511 |
-
|
11512 |
-
|
|
|
|
|
11513 |
|
11514 |
-
|
11515 |
-
|
|
|
|
|
|
|
|
|
|
|
11516 |
|
11517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11518 |
|
11519 |
-
|
|
|
|
|
|
|
|
|
|
|
11520 |
|
11521 |
-
|
11522 |
-
|
11523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11524 |
|
11525 |
-
|
11526 |
-
|
11527 |
-
};
|
11528 |
|
11529 |
-
|
11530 |
-
|
11531 |
-
|
|
|
|
|
|
|
|
|
|
|
11532 |
|
11533 |
-
|
11534 |
-
|
11535 |
-
|
11536 |
-
|
11537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11538 |
|
11539 |
-
|
11540 |
-
|
11541 |
-
}
|
11542 |
|
11543 |
-
|
11544 |
-
|
11545 |
-
activeElement = _document.activeElement;
|
11546 |
|
11547 |
-
|
11548 |
-
|
11549 |
-
|
11550 |
-
|
11551 |
-
|
11552 |
-
|
11553 |
-
|
11554 |
-
|
11555 |
-
|
11556 |
-
|
11557 |
-
|
11558 |
-
|
11559 |
-
|
|
|
11560 |
|
11561 |
-
|
11562 |
-
|
11563 |
-
|
11564 |
-
}
|
11565 |
-
|
|
|
|
|
11566 |
|
11567 |
-
|
11568 |
-
/* 85 */
|
11569 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11570 |
|
11571 |
-
|
11572 |
-
|
11573 |
-
|
11574 |
-
|
11575 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
11576 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
11577 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
11578 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(0);
|
11579 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_compose__ = __webpack_require__(14);
|
11580 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_keycodes__ = __webpack_require__(27);
|
11581 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_dom__ = __webpack_require__(44);
|
11582 |
|
|
|
11583 |
|
|
|
|
|
|
|
|
|
|
|
11584 |
|
|
|
|
|
|
|
11585 |
|
|
|
|
|
|
|
|
|
11586 |
|
11587 |
|
|
|
|
|
|
|
11588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11589 |
|
11590 |
/**
|
11591 |
-
*
|
11592 |
*/
|
11593 |
|
11594 |
|
|
|
|
|
|
|
|
|
|
|
11595 |
|
|
|
|
|
|
|
|
|
|
|
11596 |
|
11597 |
-
|
11598 |
-
|
11599 |
-
|
11600 |
-
|
11601 |
-
|
11602 |
-
|
11603 |
-
function _class() {
|
11604 |
-
var _this;
|
11605 |
-
|
11606 |
-
Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
|
11607 |
-
|
11608 |
-
_this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
|
11609 |
-
_this.focusContainRef = Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["j" /* createRef */])();
|
11610 |
-
_this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
11611 |
-
return _this;
|
11612 |
-
}
|
11613 |
-
|
11614 |
-
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
|
11615 |
-
key: "handleTabBehaviour",
|
11616 |
-
value: function handleTabBehaviour(event) {
|
11617 |
-
if (event.keyCode !== __WEBPACK_IMPORTED_MODULE_8__wordpress_keycodes__["i" /* TAB */]) {
|
11618 |
-
return;
|
11619 |
-
}
|
11620 |
-
|
11621 |
-
var tabbables = __WEBPACK_IMPORTED_MODULE_9__wordpress_dom__["a" /* focus */].tabbable.find(this.focusContainRef.current);
|
11622 |
-
|
11623 |
-
if (!tabbables.length) {
|
11624 |
-
return;
|
11625 |
-
}
|
11626 |
-
|
11627 |
-
var firstTabbable = tabbables[0];
|
11628 |
-
var lastTabbable = tabbables[tabbables.length - 1];
|
11629 |
-
|
11630 |
-
if (event.shiftKey && event.target === firstTabbable) {
|
11631 |
-
event.preventDefault();
|
11632 |
-
lastTabbable.focus();
|
11633 |
-
} else if (!event.shiftKey && event.target === lastTabbable) {
|
11634 |
-
event.preventDefault();
|
11635 |
-
firstTabbable.focus();
|
11636 |
-
/*
|
11637 |
-
* When pressing Tab and none of the tabbables has focus, the keydown
|
11638 |
-
* event happens on the wrapper div: move focus on the first tabbable.
|
11639 |
-
*/
|
11640 |
-
} else if (!tabbables.includes(event.target)) {
|
11641 |
-
event.preventDefault();
|
11642 |
-
firstTabbable.focus();
|
11643 |
-
}
|
11644 |
-
}
|
11645 |
-
}, {
|
11646 |
-
key: "render",
|
11647 |
-
value: function render() {
|
11648 |
-
// Disable reason: this component is non-interactive, but must capture
|
11649 |
-
// events from the wrapped component to determine when the Tab key is used.
|
11650 |
-
|
11651 |
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
11652 |
-
return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
11653 |
-
onKeyDown: this.handleTabBehaviour,
|
11654 |
-
ref: this.focusContainRef,
|
11655 |
-
tabIndex: "-1"
|
11656 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(WrappedComponent, this.props));
|
11657 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
11658 |
-
}
|
11659 |
-
}]);
|
11660 |
-
|
11661 |
-
return _class;
|
11662 |
-
}(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */])
|
11663 |
-
);
|
11664 |
-
}, 'withConstrainedTabbing');
|
11665 |
-
/* harmony default export */ __webpack_exports__["a"] = (withConstrainedTabbing);
|
11666 |
-
//# sourceMappingURL=index.js.map
|
11667 |
-
|
11668 |
-
/***/ }),
|
11669 |
-
/* 86 */
|
11670 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11671 |
-
|
11672 |
-
"use strict";
|
11673 |
-
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
11674 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
11675 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
11676 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
11677 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
11678 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(0);
|
11679 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash__ = __webpack_require__(2);
|
11680 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash__);
|
11681 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__popover__ = __webpack_require__(69);
|
11682 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__shortcut__ = __webpack_require__(131);
|
11683 |
-
|
11684 |
-
|
11685 |
-
|
11686 |
-
|
11687 |
|
|
|
|
|
|
|
11688 |
|
11689 |
|
11690 |
/**
|
11691 |
-
*
|
|
|
|
|
|
|
|
|
|
|
11692 |
*/
|
11693 |
|
|
|
11694 |
/**
|
11695 |
-
* WordPress
|
11696 |
*/
|
11697 |
|
11698 |
|
11699 |
/**
|
11700 |
-
*
|
|
|
|
|
|
|
|
|
11701 |
*/
|
11702 |
|
11703 |
|
11704 |
-
|
11705 |
/**
|
11706 |
-
*
|
|
|
11707 |
*
|
11708 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
11709 |
*/
|
11710 |
|
11711 |
-
var TOOLTIP_DELAY = 700;
|
11712 |
|
11713 |
-
|
11714 |
-
|
11715 |
-
|
11716 |
-
|
|
|
|
|
|
|
11717 |
|
11718 |
-
function Tooltip() {
|
11719 |
-
var _this;
|
11720 |
|
11721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11722 |
|
11723 |
-
_this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Tooltip).apply(this, arguments));
|
11724 |
-
_this.delayedSetIsOver = Object(__WEBPACK_IMPORTED_MODULE_6_lodash__["debounce"])(function (isOver) {
|
11725 |
-
return _this.setState({
|
11726 |
-
isOver: isOver
|
11727 |
-
});
|
11728 |
-
}, TOOLTIP_DELAY);
|
11729 |
-
_this.state = {
|
11730 |
-
isOver: false
|
11731 |
-
};
|
11732 |
-
return _this;
|
11733 |
-
}
|
11734 |
|
11735 |
-
|
11736 |
-
|
11737 |
-
|
11738 |
-
this.delayedSetIsOver.cancel();
|
11739 |
-
}
|
11740 |
-
}, {
|
11741 |
-
key: "emitToChild",
|
11742 |
-
value: function emitToChild(eventName, event) {
|
11743 |
-
var children = this.props.children;
|
11744 |
|
11745 |
-
if (__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].count(children) !== 1) {
|
11746 |
-
return;
|
11747 |
-
}
|
11748 |
|
11749 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11750 |
|
11751 |
-
if (typeof child.props[eventName] === 'function') {
|
11752 |
-
child.props[eventName](event);
|
11753 |
-
}
|
11754 |
-
}
|
11755 |
-
}, {
|
11756 |
-
key: "createToggleIsOver",
|
11757 |
-
value: function createToggleIsOver(eventName, isDelayed) {
|
11758 |
-
var _this2 = this;
|
11759 |
|
11760 |
-
|
11761 |
-
|
11762 |
-
|
11763 |
-
// firing on mouseenter but not mouseleave. Further, the default
|
11764 |
-
// behavior for disabled elements in some browsers is to ignore
|
11765 |
-
// mouse events. Don't bother trying to to handle them.
|
11766 |
-
//
|
11767 |
-
// See: https://github.com/facebook/react/issues/4251
|
11768 |
|
11769 |
|
11770 |
-
|
11771 |
-
|
11772 |
-
|
11773 |
-
// quickly blur/mouseleave before delayedSetIsOver is called
|
11774 |
|
11775 |
|
11776 |
-
|
|
|
|
|
11777 |
|
11778 |
-
var isOver = Object(__WEBPACK_IMPORTED_MODULE_6_lodash__["includes"])(['focus', 'mouseenter'], event.type);
|
11779 |
|
11780 |
-
|
11781 |
-
|
11782 |
-
|
11783 |
|
11784 |
-
if (isDelayed) {
|
11785 |
-
_this2.delayedSetIsOver(isOver);
|
11786 |
-
} else {
|
11787 |
-
_this2.setState({
|
11788 |
-
isOver: isOver
|
11789 |
-
});
|
11790 |
-
}
|
11791 |
-
};
|
11792 |
-
}
|
11793 |
-
}, {
|
11794 |
-
key: "render",
|
11795 |
-
value: function render() {
|
11796 |
-
var _this$props = this.props,
|
11797 |
-
children = _this$props.children,
|
11798 |
-
position = _this$props.position,
|
11799 |
-
text = _this$props.text,
|
11800 |
-
shortcut = _this$props.shortcut;
|
11801 |
|
11802 |
-
|
11803 |
-
|
11804 |
-
|
11805 |
-
console.error('Tooltip should be called with only a single child element.');
|
11806 |
-
}
|
11807 |
|
11808 |
-
return children;
|
11809 |
-
}
|
11810 |
|
11811 |
-
|
11812 |
-
|
11813 |
-
|
11814 |
-
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
|
11815 |
-
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
|
11816 |
-
onClick: this.createToggleIsOver('onClick'),
|
11817 |
-
onFocus: this.createToggleIsOver('onFocus'),
|
11818 |
-
onBlur: this.createToggleIsOver('onBlur'),
|
11819 |
-
children: Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["f" /* concatChildren */])(child.props.children, isOver && Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_7__popover__["a" /* default */], {
|
11820 |
-
focusOnMount: false,
|
11821 |
-
position: position,
|
11822 |
-
className: "components-tooltip",
|
11823 |
-
"aria-hidden": "true"
|
11824 |
-
}, text, Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_8__shortcut__["a" /* default */], {
|
11825 |
-
className: "components-tooltip__shortcut",
|
11826 |
-
shortcut: shortcut
|
11827 |
-
})))
|
11828 |
-
});
|
11829 |
-
}
|
11830 |
-
}]);
|
11831 |
|
11832 |
-
return Tooltip;
|
11833 |
-
}(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */]);
|
11834 |
|
11835 |
-
|
11836 |
-
|
11837 |
-
|
11838 |
|
11839 |
-
/***/ }),
|
11840 |
-
/* 87 */
|
11841 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11842 |
|
11843 |
-
|
11844 |
-
|
11845 |
-
|
11846 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
11847 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
11848 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
11849 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
11850 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
11851 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
11852 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_element__ = __webpack_require__(0);
|
11853 |
|
11854 |
|
|
|
|
|
|
|
11855 |
|
11856 |
|
|
|
|
|
|
|
11857 |
|
11858 |
|
|
|
|
|
|
|
11859 |
|
11860 |
|
|
|
|
|
|
|
11861 |
|
11862 |
|
11863 |
/**
|
11864 |
-
*
|
11865 |
*/
|
11866 |
|
11867 |
|
11868 |
-
|
11869 |
-
|
11870 |
-
|
11871 |
-
Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__["a" /* default */])(IsolatedEventContainer, _Component);
|
11872 |
|
11873 |
-
function IsolatedEventContainer(props) {
|
11874 |
-
var _this;
|
11875 |
|
11876 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11877 |
|
11878 |
-
|
11879 |
-
|
11880 |
-
|
11881 |
}
|
11882 |
|
11883 |
-
|
11884 |
-
|
11885 |
-
|
11886 |
-
|
11887 |
-
|
11888 |
-
|
11889 |
-
|
11890 |
-
value: function render() {
|
11891 |
-
var _this$props = this.props,
|
11892 |
-
children = _this$props.children,
|
11893 |
-
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_this$props, ["children"]); // Disable reason: this stops certain events from propagating outside of the component.
|
11894 |
-
// - onMouseDown is disabled as this can cause interactions with other DOM elements
|
11895 |
-
|
11896 |
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
11897 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11898 |
|
11899 |
-
|
11900 |
-
|
11901 |
-
|
|
|
|
|
|
|
11902 |
}
|
11903 |
-
}]);
|
11904 |
|
11905 |
-
|
11906 |
-
|
|
|
11907 |
|
11908 |
-
|
11909 |
-
|
|
|
|
|
|
|
|
|
11910 |
|
11911 |
/***/ }),
|
11912 |
-
/*
|
11913 |
-
/***/ (function(module,
|
11914 |
|
11915 |
-
|
11916 |
-
|
11917 |
-
|
11918 |
-
|
11919 |
-
|
11920 |
-
|
11921 |
-
|
11922 |
-
|
11923 |
-
|
11924 |
-
|
11925 |
-
|
11926 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11927 |
|
|
|
|
|
|
|
|
|
11928 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11929 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11930 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11931 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11932 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11933 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11934 |
|
|
|
|
|
|
|
|
|
11935 |
|
11936 |
-
|
11937 |
-
|
11938 |
-
|
|
|
|
|
|
|
|
|
11939 |
|
11940 |
-
/**
|
11941 |
-
|
11942 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11943 |
|
|
|
|
|
11944 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11945 |
|
11946 |
-
|
11947 |
-
|
11948 |
-
|
11949 |
-
registerFill: function registerFill() {},
|
11950 |
-
unregisterFill: function unregisterFill() {},
|
11951 |
-
getSlot: function getSlot() {},
|
11952 |
-
getFills: function getFills() {}
|
11953 |
-
}),
|
11954 |
-
Provider = _createContext.Provider,
|
11955 |
-
Consumer = _createContext.Consumer;
|
11956 |
|
11957 |
-
|
11958 |
-
|
11959 |
-
|
11960 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11961 |
|
11962 |
-
|
11963 |
-
|
11964 |
|
11965 |
-
|
|
|
|
|
|
|
11966 |
|
11967 |
-
|
11968 |
-
|
11969 |
-
|
11970 |
-
_this.unregisterSlot = _this.unregisterSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
11971 |
-
_this.unregisterFill = _this.unregisterFill.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
11972 |
-
_this.getSlot = _this.getSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
11973 |
-
_this.getFills = _this.getFills.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
11974 |
-
_this.slots = {};
|
11975 |
-
_this.fills = {};
|
11976 |
-
_this.state = {
|
11977 |
-
registerSlot: _this.registerSlot,
|
11978 |
-
unregisterSlot: _this.unregisterSlot,
|
11979 |
-
registerFill: _this.registerFill,
|
11980 |
-
unregisterFill: _this.unregisterFill,
|
11981 |
-
getSlot: _this.getSlot,
|
11982 |
-
getFills: _this.getFills
|
11983 |
-
};
|
11984 |
-
return _this;
|
11985 |
-
}
|
11986 |
|
11987 |
-
|
11988 |
-
key: "registerSlot",
|
11989 |
-
value: function registerSlot(name, slot) {
|
11990 |
-
this.slots[name] = slot;
|
11991 |
-
this.forceUpdateFills(name); // Sometimes the fills are registered after the initial render of slot
|
11992 |
-
// But before the registerSlot call, we need to rerender the slot
|
11993 |
|
11994 |
-
|
11995 |
-
|
11996 |
-
|
11997 |
-
|
11998 |
-
value: function registerFill(name, instance) {
|
11999 |
-
this.fills[name] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(this.fills[name] || []).concat([instance]);
|
12000 |
-
this.forceUpdateSlot(name);
|
12001 |
-
}
|
12002 |
-
}, {
|
12003 |
-
key: "unregisterSlot",
|
12004 |
-
value: function unregisterSlot(name) {
|
12005 |
-
delete this.slots[name];
|
12006 |
-
this.forceUpdateFills(name);
|
12007 |
-
}
|
12008 |
-
}, {
|
12009 |
-
key: "unregisterFill",
|
12010 |
-
value: function unregisterFill(name, instance) {
|
12011 |
-
this.fills[name] = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["without"])(this.fills[name], instance);
|
12012 |
-
this.resetFillOccurrence(name);
|
12013 |
-
this.forceUpdateSlot(name);
|
12014 |
-
}
|
12015 |
-
}, {
|
12016 |
-
key: "getSlot",
|
12017 |
-
value: function getSlot(name) {
|
12018 |
-
return this.slots[name];
|
12019 |
-
}
|
12020 |
-
}, {
|
12021 |
-
key: "getFills",
|
12022 |
-
value: function getFills(name) {
|
12023 |
-
return Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["sortBy"])(this.fills[name], 'occurrence');
|
12024 |
-
}
|
12025 |
-
}, {
|
12026 |
-
key: "resetFillOccurrence",
|
12027 |
-
value: function resetFillOccurrence(name) {
|
12028 |
-
Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["forEach"])(this.fills[name], function (instance) {
|
12029 |
-
instance.resetOccurrence();
|
12030 |
-
});
|
12031 |
-
}
|
12032 |
-
}, {
|
12033 |
-
key: "forceUpdateFills",
|
12034 |
-
value: function forceUpdateFills(name) {
|
12035 |
-
Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["forEach"])(this.fills[name], function (instance) {
|
12036 |
-
instance.forceUpdate();
|
12037 |
-
});
|
12038 |
}
|
12039 |
-
}, {
|
12040 |
-
key: "forceUpdateSlot",
|
12041 |
-
value: function forceUpdateSlot(name) {
|
12042 |
-
var slot = this.getSlot(name);
|
12043 |
|
12044 |
-
|
12045 |
-
|
12046 |
-
|
12047 |
-
|
12048 |
-
|
12049 |
-
|
12050 |
-
|
12051 |
-
|
12052 |
-
|
12053 |
-
}, this.props.children);
|
12054 |
}
|
12055 |
-
}]);
|
12056 |
-
|
12057 |
-
return SlotFillProvider;
|
12058 |
-
}(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */]);
|
12059 |
|
12060 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12061 |
|
12062 |
-
|
|
|
|
|
12063 |
|
12064 |
-
|
12065 |
-
|
12066 |
-
|
12067 |
|
12068 |
-
|
12069 |
-
|
12070 |
-
|
12071 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
12072 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
12073 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
12074 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
12075 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
12076 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(0);
|
12077 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
|
12078 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
|
12079 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_a11y__ = __webpack_require__(134);
|
12080 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_compose__ = __webpack_require__(14);
|
12081 |
|
|
|
|
|
|
|
12082 |
|
|
|
|
|
12083 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12084 |
|
|
|
|
|
12085 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12086 |
|
|
|
|
|
12087 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12088 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12089 |
|
12090 |
-
|
12091 |
-
|
12092 |
-
|
|
|
|
|
12093 |
|
12094 |
-
|
12095 |
-
|
12096 |
-
|
|
|
|
|
|
|
|
|
12097 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12098 |
|
|
|
|
|
|
|
|
|
|
|
12099 |
|
|
|
|
|
|
|
|
|
|
|
12100 |
|
12101 |
-
|
12102 |
-
|
12103 |
-
* component.
|
12104 |
-
*
|
12105 |
-
* @param {WPElement} WrappedComponent The wrapped component.
|
12106 |
-
*
|
12107 |
-
* @return {Component} Component with an instanceId prop.
|
12108 |
-
*/
|
12109 |
|
12110 |
-
|
12111 |
-
|
12112 |
-
|
12113 |
-
|
12114 |
-
|
|
|
|
|
|
|
|
|
|
|
12115 |
|
12116 |
-
|
12117 |
-
|
|
|
12118 |
|
12119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12120 |
|
12121 |
-
|
12122 |
-
|
12123 |
-
|
12124 |
-
}
|
12125 |
|
12126 |
-
|
12127 |
-
|
12128 |
-
value: function speak(message) {
|
12129 |
-
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polite';
|
12130 |
|
12131 |
-
|
12132 |
-
|
12133 |
-
|
12134 |
-
|
12135 |
-
value: function componentWillUnmount() {
|
12136 |
-
this.debouncedSpeak.cancel();
|
12137 |
-
}
|
12138 |
-
}, {
|
12139 |
-
key: "render",
|
12140 |
-
value: function render() {
|
12141 |
-
return Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(WrappedComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, this.props, {
|
12142 |
-
speak: this.speak,
|
12143 |
-
debouncedSpeak: this.debouncedSpeak
|
12144 |
-
}));
|
12145 |
-
}
|
12146 |
-
}]);
|
12147 |
|
12148 |
-
|
12149 |
-
|
12150 |
-
|
12151 |
-
|
12152 |
-
|
|
|
|
|
12153 |
|
12154 |
-
|
12155 |
-
|
12156 |
-
|
|
|
|
|
12157 |
|
12158 |
-
|
|
|
|
|
12159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12160 |
|
12161 |
-
|
12162 |
-
|
12163 |
-
|
12164 |
-
|
12165 |
-
var isArgs = __webpack_require__(491);
|
12166 |
-
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
12167 |
-
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
12168 |
-
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
12169 |
-
var dontEnums = [
|
12170 |
-
'toString',
|
12171 |
-
'toLocaleString',
|
12172 |
-
'valueOf',
|
12173 |
-
'hasOwnProperty',
|
12174 |
-
'isPrototypeOf',
|
12175 |
-
'propertyIsEnumerable',
|
12176 |
-
'constructor'
|
12177 |
-
];
|
12178 |
-
var equalsConstructorPrototype = function (o) {
|
12179 |
-
var ctor = o.constructor;
|
12180 |
-
return ctor && ctor.prototype === o;
|
12181 |
-
};
|
12182 |
-
var excludedKeys = {
|
12183 |
-
$applicationCache: true,
|
12184 |
-
$console: true,
|
12185 |
-
$external: true,
|
12186 |
-
$frame: true,
|
12187 |
-
$frameElement: true,
|
12188 |
-
$frames: true,
|
12189 |
-
$innerHeight: true,
|
12190 |
-
$innerWidth: true,
|
12191 |
-
$outerHeight: true,
|
12192 |
-
$outerWidth: true,
|
12193 |
-
$pageXOffset: true,
|
12194 |
-
$pageYOffset: true,
|
12195 |
-
$parent: true,
|
12196 |
-
$scrollLeft: true,
|
12197 |
-
$scrollTop: true,
|
12198 |
-
$scrollX: true,
|
12199 |
-
$scrollY: true,
|
12200 |
-
$self: true,
|
12201 |
-
$webkitIndexedDB: true,
|
12202 |
-
$webkitStorageInfo: true,
|
12203 |
-
$window: true
|
12204 |
-
};
|
12205 |
-
var hasAutomationEqualityBug = (function () {
|
12206 |
-
/* global window */
|
12207 |
-
if (typeof window === 'undefined') { return false; }
|
12208 |
-
for (var k in window) {
|
12209 |
-
try {
|
12210 |
-
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
12211 |
-
try {
|
12212 |
-
equalsConstructorPrototype(window[k]);
|
12213 |
-
} catch (e) {
|
12214 |
-
return true;
|
12215 |
-
}
|
12216 |
-
}
|
12217 |
-
} catch (e) {
|
12218 |
-
return true;
|
12219 |
-
}
|
12220 |
-
}
|
12221 |
-
return false;
|
12222 |
-
}());
|
12223 |
-
var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
12224 |
-
/* global window */
|
12225 |
-
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
12226 |
-
return equalsConstructorPrototype(o);
|
12227 |
-
}
|
12228 |
-
try {
|
12229 |
-
return equalsConstructorPrototype(o);
|
12230 |
-
} catch (e) {
|
12231 |
-
return false;
|
12232 |
-
}
|
12233 |
-
};
|
12234 |
|
12235 |
-
|
12236 |
-
|
12237 |
-
|
12238 |
-
var isArguments = isArgs(object);
|
12239 |
-
var isString = isObject && toStr.call(object) === '[object String]';
|
12240 |
-
var theKeys = [];
|
12241 |
|
12242 |
-
|
12243 |
-
|
12244 |
-
}
|
12245 |
|
12246 |
-
|
12247 |
-
|
12248 |
-
for (var i = 0; i < object.length; ++i) {
|
12249 |
-
theKeys.push(String(i));
|
12250 |
-
}
|
12251 |
-
}
|
12252 |
|
12253 |
-
|
12254 |
-
for (var j = 0; j < object.length; ++j) {
|
12255 |
-
theKeys.push(String(j));
|
12256 |
-
}
|
12257 |
-
} else {
|
12258 |
-
for (var name in object) {
|
12259 |
-
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
12260 |
-
theKeys.push(String(name));
|
12261 |
-
}
|
12262 |
-
}
|
12263 |
-
}
|
12264 |
|
12265 |
-
|
12266 |
-
|
|
|
12267 |
|
12268 |
-
|
12269 |
-
|
12270 |
-
|
12271 |
-
|
12272 |
-
|
12273 |
-
|
12274 |
-
return theKeys;
|
12275 |
-
};
|
12276 |
|
12277 |
-
|
12278 |
-
|
12279 |
-
|
12280 |
-
|
12281 |
-
|
12282 |
-
|
12283 |
-
if (!keysWorksWithArguments) {
|
12284 |
-
var originalKeys = Object.keys;
|
12285 |
-
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
12286 |
-
if (isArgs(object)) {
|
12287 |
-
return originalKeys(slice.call(object));
|
12288 |
-
} else {
|
12289 |
-
return originalKeys(object);
|
12290 |
-
}
|
12291 |
-
};
|
12292 |
-
}
|
12293 |
-
} else {
|
12294 |
-
Object.keys = keysShim;
|
12295 |
-
}
|
12296 |
-
return Object.keys || keysShim;
|
12297 |
-
};
|
12298 |
|
12299 |
-
|
|
|
|
|
|
|
|
|
|
|
12300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12301 |
|
12302 |
-
|
12303 |
-
|
12304 |
-
|
|
|
|
|
|
|
12305 |
|
12306 |
-
|
12307 |
-
|
|
|
|
|
|
|
|
|
12308 |
|
12309 |
-
|
|
|
|
|
|
|
|
|
|
|
12310 |
|
12311 |
-
|
12312 |
-
|
12313 |
-
|
12314 |
-
|
12315 |
-
|
12316 |
-
|
12317 |
-
|
12318 |
-
target[key] = source[key];
|
12319 |
-
}
|
12320 |
-
}
|
12321 |
-
return target;
|
12322 |
-
};
|
12323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12324 |
|
12325 |
-
|
12326 |
-
|
12327 |
-
/***/ (function(module, exports, __webpack_require__) {
|
12328 |
|
12329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12330 |
|
|
|
|
|
|
|
|
|
12331 |
|
12332 |
-
|
12333 |
-
|
12334 |
-
|
12335 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12336 |
|
12337 |
-
|
|
|
|
|
|
|
12338 |
|
12339 |
-
|
|
|
|
|
|
|
12340 |
|
12341 |
-
|
|
|
|
|
|
|
12342 |
|
12343 |
-
|
|
|
|
|
|
|
|
|
12344 |
|
12345 |
-
|
|
|
|
|
|
|
|
|
12346 |
|
12347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12348 |
|
12349 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12350 |
|
12351 |
-
|
|
|
|
|
12352 |
|
12353 |
-
|
|
|
12354 |
|
12355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12356 |
|
12357 |
-
|
|
|
|
|
|
|
12358 |
|
12359 |
-
|
|
|
|
|
|
|
|
|
12360 |
|
12361 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12362 |
|
12363 |
-
|
|
|
|
|
|
|
|
|
|
|
12364 |
|
12365 |
-
|
|
|
12366 |
|
12367 |
-
|
|
|
|
|
|
|
|
|
|
|
12368 |
|
12369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12370 |
|
12371 |
-
|
12372 |
|
12373 |
-
|
|
|
|
|
|
|
|
|
12374 |
|
12375 |
-
|
|
|
|
|
|
|
|
|
|
|
12376 |
|
12377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12378 |
|
12379 |
-
|
|
|
12380 |
|
12381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12382 |
|
12383 |
-
|
|
|
|
|
|
|
|
|
12384 |
|
12385 |
-
|
12386 |
|
12387 |
-
|
|
|
|
|
|
|
12388 |
|
12389 |
-
|
|
|
|
|
|
|
|
|
12390 |
|
12391 |
-
|
|
|
12392 |
|
12393 |
-
|
12394 |
-
|
12395 |
-
|
12396 |
-
|
12397 |
-
|
12398 |
-
|
12399 |
-
|
12400 |
-
|
12401 |
-
|
12402 |
-
|
12403 |
-
|
12404 |
-
|
12405 |
|
12406 |
-
|
12407 |
-
|
12408 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12409 |
|
12410 |
-
|
12411 |
-
|
12412 |
-
|
12413 |
-
isOutsideDay: false,
|
12414 |
-
modifiers: new Set(),
|
12415 |
-
isFocused: false,
|
12416 |
-
tabIndex: -1,
|
12417 |
-
onDayClick: function () {
|
12418 |
-
function onDayClick() {}
|
12419 |
|
12420 |
-
|
12421 |
-
|
12422 |
-
|
12423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12424 |
|
12425 |
-
|
12426 |
-
|
12427 |
-
|
12428 |
-
|
|
|
|
|
|
|
|
|
|
|
12429 |
|
12430 |
-
|
12431 |
-
|
|
|
|
|
|
|
|
|
12432 |
|
12433 |
-
|
12434 |
-
|
|
|
|
|
12435 |
|
12436 |
-
|
12437 |
-
|
12438 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12439 |
|
12440 |
-
|
12441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12442 |
|
12443 |
-
|
12444 |
-
|
12445 |
|
12446 |
-
|
|
|
12447 |
|
12448 |
-
|
12449 |
-
|
12450 |
-
}
|
12451 |
|
12452 |
-
|
|
|
|
|
|
|
|
|
|
|
12453 |
|
12454 |
-
|
12455 |
-
return _this;
|
12456 |
-
}
|
12457 |
|
12458 |
-
|
12459 |
-
|
12460 |
-
|
12461 |
-
function shouldComponentUpdate(nextProps, nextState) {
|
12462 |
-
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
|
12463 |
-
}
|
12464 |
|
12465 |
-
|
12466 |
-
|
12467 |
-
}, {
|
12468 |
-
key: 'componentDidUpdate',
|
12469 |
-
value: function () {
|
12470 |
-
function componentDidUpdate(prevProps) {
|
12471 |
-
var _props = this.props,
|
12472 |
-
isFocused = _props.isFocused,
|
12473 |
-
tabIndex = _props.tabIndex;
|
12474 |
|
12475 |
-
|
12476 |
-
|
12477 |
-
|
12478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12479 |
}
|
12480 |
-
}
|
12481 |
-
|
12482 |
-
return componentDidUpdate;
|
12483 |
-
}()
|
12484 |
-
}, {
|
12485 |
-
key: 'onDayClick',
|
12486 |
-
value: function () {
|
12487 |
-
function onDayClick(day, e) {
|
12488 |
-
var onDayClick = this.props.onDayClick;
|
12489 |
|
12490 |
-
|
12491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12492 |
|
12493 |
-
|
12494 |
-
|
12495 |
-
|
12496 |
-
|
12497 |
-
|
12498 |
-
function onDayMouseEnter(day, e) {
|
12499 |
-
var onDayMouseEnter = this.props.onDayMouseEnter;
|
12500 |
|
12501 |
-
|
12502 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12503 |
|
12504 |
-
|
12505 |
-
|
12506 |
-
|
12507 |
-
|
12508 |
-
|
12509 |
-
|
12510 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12511 |
|
12512 |
-
|
12513 |
-
|
12514 |
-
|
12515 |
-
|
12516 |
-
|
12517 |
-
|
12518 |
-
|
12519 |
-
|
12520 |
-
|
12521 |
-
|
12522 |
-
|
12523 |
-
|
12524 |
-
if (key === 'Enter' || key === ' ') {
|
12525 |
-
onDayClick(day, e);
|
12526 |
}
|
12527 |
-
|
|
|
12528 |
|
12529 |
-
|
12530 |
-
|
12531 |
-
|
12532 |
-
|
12533 |
-
|
12534 |
-
|
12535 |
-
|
12536 |
-
|
|
|
|
|
|
|
|
|
|
|
12537 |
|
12538 |
-
|
12539 |
-
|
12540 |
-
|
12541 |
-
|
12542 |
-
|
12543 |
-
|
12544 |
-
|
|
|
|
|
12545 |
|
12546 |
-
|
12547 |
-
|
12548 |
-
|
12549 |
-
|
12550 |
-
isOutsideDay = _props2.isOutsideDay,
|
12551 |
-
modifiers = _props2.modifiers,
|
12552 |
-
renderDayContents = _props2.renderDayContents,
|
12553 |
-
tabIndex = _props2.tabIndex,
|
12554 |
-
styles = _props2.styles,
|
12555 |
-
phrases = _props2.phrases;
|
12556 |
|
|
|
|
|
|
|
12557 |
|
12558 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12559 |
|
12560 |
-
|
12561 |
-
|
12562 |
-
|
12563 |
-
selected = _getCalendarDaySettin.selected,
|
12564 |
-
hoveredSpan = _getCalendarDaySettin.hoveredSpan,
|
12565 |
-
isOutsideRange = _getCalendarDaySettin.isOutsideRange,
|
12566 |
-
ariaLabel = _getCalendarDaySettin.ariaLabel;
|
12567 |
|
12568 |
-
|
12569 |
-
|
12570 |
-
|
12571 |
-
|
12572 |
-
|
12573 |
-
|
12574 |
-
|
12575 |
-
function onMouseEnter(e) {
|
12576 |
-
_this2.onDayMouseEnter(day, e);
|
12577 |
-
}
|
12578 |
|
12579 |
-
|
12580 |
-
|
12581 |
-
|
12582 |
-
|
12583 |
-
|
12584 |
-
|
|
|
|
|
|
|
|
|
|
|
12585 |
|
12586 |
-
|
12587 |
-
|
12588 |
-
|
12589 |
-
|
12590 |
-
|
12591 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12592 |
|
12593 |
-
|
12594 |
-
}(),
|
12595 |
-
onClick: function () {
|
12596 |
-
function onClick(e) {
|
12597 |
-
_this2.onDayClick(day, e);
|
12598 |
-
}
|
12599 |
|
12600 |
-
|
12601 |
-
|
12602 |
-
onKeyDown: function () {
|
12603 |
-
function onKeyDown(e) {
|
12604 |
-
_this2.onKeyDown(day, e);
|
12605 |
-
}
|
12606 |
|
12607 |
-
|
12608 |
-
|
12609 |
-
|
12610 |
-
|
12611 |
-
renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
|
12612 |
-
);
|
12613 |
-
}
|
12614 |
|
12615 |
-
|
12616 |
-
|
12617 |
-
|
|
|
|
|
|
|
|
|
|
|
12618 |
|
12619 |
-
return CalendarDay;
|
12620 |
-
}(_react2['default'].Component);
|
12621 |
|
12622 |
-
|
12623 |
-
|
|
|
12624 |
|
12625 |
-
|
12626 |
-
|
12627 |
-
|
12628 |
-
|
12629 |
-
|
12630 |
-
|
12631 |
-
|
12632 |
-
|
12633 |
-
|
12634 |
-
|
12635 |
-
|
|
|
|
|
|
|
|
|
12636 |
|
12637 |
-
|
12638 |
-
|
12639 |
-
}
|
12640 |
-
},
|
12641 |
|
12642 |
-
|
12643 |
-
|
12644 |
-
|
12645 |
|
12646 |
-
|
12647 |
-
|
12648 |
-
|
12649 |
-
background: color.background,
|
12650 |
|
12651 |
-
|
12652 |
-
|
12653 |
-
border: '1px double ' + String(color.core.borderLight),
|
12654 |
-
color: 'inherit'
|
12655 |
-
}
|
12656 |
-
},
|
12657 |
|
12658 |
-
|
12659 |
-
|
12660 |
-
|
12661 |
-
color: 'inherit'
|
12662 |
-
},
|
12663 |
|
12664 |
-
|
12665 |
-
|
12666 |
-
|
12667 |
-
|
|
|
|
|
12668 |
|
12669 |
-
|
12670 |
-
|
12671 |
-
}
|
12672 |
-
},
|
12673 |
|
12674 |
-
|
12675 |
-
|
12676 |
-
border: '1px solid ' + String(color.minimumNights.borderColor),
|
12677 |
-
color: color.minimumNights.color,
|
12678 |
|
12679 |
-
':hover': {
|
12680 |
-
background: color.minimumNights.backgroundColor_hover,
|
12681 |
-
color: color.minimumNights.color_active
|
12682 |
-
},
|
12683 |
|
12684 |
-
|
12685 |
-
|
12686 |
-
|
12687 |
-
}
|
12688 |
-
},
|
12689 |
|
12690 |
-
|
12691 |
-
|
12692 |
-
|
|
|
12693 |
|
12694 |
-
':hover': {
|
12695 |
-
background: color.highlighted.backgroundColor_hover,
|
12696 |
-
color: color.highlighted.color_active
|
12697 |
-
},
|
12698 |
|
12699 |
-
|
12700 |
-
|
12701 |
-
|
12702 |
-
}
|
12703 |
-
},
|
12704 |
|
12705 |
-
|
12706 |
-
|
12707 |
-
|
12708 |
-
|
|
|
|
|
12709 |
|
12710 |
-
|
12711 |
-
|
12712 |
-
|
12713 |
-
|
12714 |
-
|
12715 |
|
12716 |
-
|
12717 |
-
|
12718 |
-
|
12719 |
-
|
12720 |
-
}
|
12721 |
-
},
|
12722 |
|
12723 |
-
|
12724 |
-
|
12725 |
-
}
|
12726 |
|
12727 |
-
|
12728 |
-
|
12729 |
-
|
12730 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12731 |
|
12732 |
-
|
12733 |
-
|
12734 |
-
|
12735 |
-
color: color.selected.color_active
|
12736 |
-
},
|
12737 |
|
12738 |
-
|
12739 |
-
|
12740 |
-
|
12741 |
-
|
12742 |
-
|
12743 |
-
},
|
12744 |
|
12745 |
-
|
12746 |
-
|
12747 |
-
border: '1px solid ' + String(color.hoveredSpan.borderColor),
|
12748 |
-
color: color.hoveredSpan.color,
|
12749 |
|
12750 |
-
|
12751 |
-
|
12752 |
-
|
12753 |
-
color: color.hoveredSpan.color_active
|
12754 |
-
},
|
12755 |
|
12756 |
-
|
12757 |
-
|
12758 |
-
|
12759 |
-
|
12760 |
-
|
12761 |
-
|
|
|
12762 |
|
12763 |
-
|
12764 |
-
|
12765 |
-
|
12766 |
-
|
|
|
|
|
12767 |
|
12768 |
-
|
12769 |
-
|
12770 |
-
|
12771 |
-
|
12772 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12773 |
|
12774 |
-
|
12775 |
-
|
12776 |
-
|
12777 |
-
|
12778 |
-
|
12779 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12780 |
|
12781 |
-
|
12782 |
-
|
12783 |
-
|
12784 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12785 |
|
12786 |
-
':hover': {
|
12787 |
-
background: color.blocked_out_of_range.backgroundColor_hover,
|
12788 |
-
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
|
12789 |
-
color: color.blocked_out_of_range.color_active
|
12790 |
-
},
|
12791 |
|
12792 |
-
|
12793 |
-
background: color.blocked_out_of_range.backgroundColor_active,
|
12794 |
-
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
|
12795 |
-
color: color.blocked_out_of_range.color_active
|
12796 |
-
}
|
12797 |
-
},
|
12798 |
|
12799 |
-
|
12800 |
-
|
12801 |
-
|
12802 |
-
|
12803 |
-
CalendarDay__lastDayOfWeek: {}
|
12804 |
-
};
|
12805 |
-
})(CalendarDay);
|
12806 |
|
12807 |
/***/ }),
|
12808 |
-
/*
|
12809 |
-
/***/ (function(module,
|
12810 |
|
12811 |
-
|
12812 |
-
|
12813 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12814 |
|
12815 |
-
|
|
|
|
|
|
|
|
|
12816 |
|
12817 |
-
|
|
|
|
|
|
|
|
|
12818 |
|
12819 |
-
|
|
|
12820 |
|
12821 |
-
|
|
|
12822 |
|
12823 |
-
|
12824 |
-
|
12825 |
-
|
12826 |
-
|
12827 |
-
var _object4 = _interopRequireDefault(_object3);
|
12828 |
-
|
12829 |
-
var _shape = __webpack_require__(94);
|
12830 |
-
|
12831 |
-
var _shape2 = _interopRequireDefault(_shape);
|
12832 |
-
|
12833 |
-
var _valuesOf = __webpack_require__(283);
|
12834 |
-
|
12835 |
-
var _valuesOf2 = _interopRequireDefault(_valuesOf);
|
12836 |
-
|
12837 |
-
var _wrapValidator = __webpack_require__(17);
|
12838 |
-
|
12839 |
-
var _wrapValidator2 = _interopRequireDefault(_wrapValidator);
|
12840 |
|
12841 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12842 |
|
12843 |
-
|
|
|
|
|
12844 |
|
12845 |
-
function number(props, propName, componentName) {
|
12846 |
-
var value = props[propName];
|
12847 |
-
if (typeof value === 'number' && !isNaN(value)) {
|
12848 |
-
return null;
|
12849 |
-
}
|
12850 |
|
12851 |
-
|
12852 |
-
|
|
|
|
|
|
|
12853 |
|
12854 |
-
|
12855 |
-
|
|
|
|
|
|
|
12856 |
|
12857 |
-
|
12858 |
-
|
12859 |
-
|
|
|
|
|
12860 |
|
12861 |
-
|
12862 |
-
|
12863 |
-
|
12864 |
|
12865 |
-
return new TypeError(String(propName) + ': a function, or a non-NaN number is required');
|
12866 |
-
}
|
12867 |
|
12868 |
-
|
12869 |
-
|
12870 |
-
|
|
|
|
|
|
|
|
|
|
|
12871 |
|
12872 |
-
if (typeof gt === 'number') {
|
12873 |
-
return value > gt;
|
12874 |
-
}
|
12875 |
-
if (typeof gte === 'number') {
|
12876 |
-
return value >= gte;
|
12877 |
-
}
|
12878 |
-
return true;
|
12879 |
-
}
|
12880 |
|
12881 |
-
|
12882 |
-
|
12883 |
-
|
12884 |
|
12885 |
-
if (typeof lt === 'number') {
|
12886 |
-
return value < lt;
|
12887 |
-
}
|
12888 |
-
if (typeof lte === 'number') {
|
12889 |
-
return value <= lte;
|
12890 |
-
}
|
12891 |
-
return true;
|
12892 |
-
}
|
12893 |
|
12894 |
-
|
12895 |
-
|
12896 |
-
|
|
|
|
|
|
|
|
|
12897 |
|
12898 |
-
if (typeof gt === 'number') {
|
12899 |
-
return 'greater than ' + gt;
|
12900 |
-
}
|
12901 |
-
if (typeof gte === 'number') {
|
12902 |
-
return 'greater than or equal to ' + gte;
|
12903 |
-
}
|
12904 |
-
return '';
|
12905 |
-
}
|
12906 |
|
12907 |
-
|
12908 |
-
|
12909 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12910 |
|
12911 |
-
if (typeof lt === 'number') {
|
12912 |
-
return 'less than ' + lt;
|
12913 |
-
}
|
12914 |
-
if (typeof lte === 'number') {
|
12915 |
-
return 'less than or equal to ' + lte;
|
12916 |
-
}
|
12917 |
-
return '';
|
12918 |
-
}
|
12919 |
|
12920 |
-
|
12921 |
-
|
12922 |
-
|
12923 |
-
|
|
|
|
|
|
|
12924 |
|
12925 |
-
function propsThunkify(opts) {
|
12926 |
-
return (0, _object4['default'])(opts).reduce(function (acc, _ref5) {
|
12927 |
-
var _ref6 = _slicedToArray(_ref5, 2),
|
12928 |
-
key = _ref6[0],
|
12929 |
-
value = _ref6[1];
|
12930 |
|
12931 |
-
|
12932 |
-
|
12933 |
-
|
12934 |
-
|
12935 |
-
|
12936 |
-
|
|
|
|
|
|
|
|
|
|
|
12937 |
|
12938 |
-
function invokeWithProps(optsThunks, props) {
|
12939 |
-
return (0, _object4['default'])(optsThunks).reduce(function (acc, _ref7) {
|
12940 |
-
var _ref8 = _slicedToArray(_ref7, 2),
|
12941 |
-
key = _ref8[0],
|
12942 |
-
thunk = _ref8[1];
|
12943 |
|
12944 |
-
|
12945 |
-
|
12946 |
-
|
12947 |
-
}
|
12948 |
|
12949 |
-
var argValidators = [(0, _shape2['default'])({ lt: numberOrPropsFunc, gt: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ lte: numberOrPropsFunc, gt: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ lt: numberOrPropsFunc, gte: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ lte: numberOrPropsFunc, gte: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ lt: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ lte: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ gt: numberOrPropsFunc }).isRequired, (0, _shape2['default'])({ gte: numberOrPropsFunc }).isRequired];
|
12950 |
-
function argValidator(props, propName) {
|
12951 |
-
return argValidators.every(function (validator) {
|
12952 |
-
return !!validator(props, propName);
|
12953 |
-
});
|
12954 |
-
}
|
12955 |
|
12956 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12957 |
|
12958 |
-
function betweenValidator(options) {
|
12959 |
-
var argError = argValidator({ options: options }, 'options');
|
12960 |
-
if (argError) {
|
12961 |
-
throw new TypeError('between: only one of the pairs of `lt`/`lte`, and `gt`/`gte`, may be supplied, and at least one pair must be provided.');
|
12962 |
-
}
|
12963 |
|
12964 |
-
|
|
|
|
|
12965 |
|
12966 |
-
var validator = function () {
|
12967 |
-
function between(props, propName, componentName) {
|
12968 |
-
var propValue = props[propName];
|
12969 |
|
12970 |
-
|
12971 |
-
|
12972 |
-
|
12973 |
|
12974 |
-
if (typeof propValue !== 'number') {
|
12975 |
-
return new RangeError(String(componentName) + ': ' + String(propName) + ' must be a number, got "' + (typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue)) + '"');
|
12976 |
-
}
|
12977 |
|
12978 |
-
|
|
|
|
|
12979 |
|
12980 |
-
for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
12981 |
-
rest[_key - 3] = arguments[_key];
|
12982 |
-
}
|
12983 |
|
12984 |
-
|
12985 |
-
|
12986 |
-
|
12987 |
-
}
|
12988 |
|
12989 |
-
if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
|
12990 |
-
return new RangeError(errorMessage(componentName, propName, opts));
|
12991 |
-
}
|
12992 |
|
12993 |
-
|
12994 |
-
|
|
|
12995 |
|
12996 |
-
return between;
|
12997 |
-
}();
|
12998 |
-
validator.isRequired = function () {
|
12999 |
-
function betweenRequired(props, propName, componentName) {
|
13000 |
-
var propValue = props[propName];
|
13001 |
|
13002 |
-
|
13003 |
-
|
13004 |
-
|
13005 |
|
13006 |
-
var opts = invokeWithProps(optsThunks, props);
|
13007 |
|
13008 |
-
|
13009 |
-
|
13010 |
-
|
13011 |
|
13012 |
-
var thunkValuesError = thunkValueValidator.apply(undefined, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
|
13013 |
-
if (thunkValuesError) {
|
13014 |
-
return thunkValuesError;
|
13015 |
-
}
|
13016 |
|
13017 |
-
|
13018 |
-
|
13019 |
-
|
13020 |
|
13021 |
-
return null;
|
13022 |
-
}
|
13023 |
|
13024 |
-
|
13025 |
-
|
|
|
13026 |
|
13027 |
-
return (0, _wrapValidator2['default'])(validator, 'between', options);
|
13028 |
-
}
|
13029 |
-
//# sourceMappingURL=between.js.map
|
13030 |
|
13031 |
-
|
13032 |
-
|
13033 |
-
|
13034 |
|
13035 |
-
Object.defineProperty(exports, "__esModule", {
|
13036 |
-
value: true
|
13037 |
-
});
|
13038 |
-
exports['default'] = shapeValidator;
|
13039 |
|
13040 |
-
|
|
|
|
|
13041 |
|
13042 |
-
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
|
13043 |
|
13044 |
-
|
|
|
|
|
13045 |
|
13046 |
-
var _wrapValidator2 = _interopRequireDefault(_wrapValidator);
|
13047 |
|
13048 |
-
|
|
|
|
|
13049 |
|
13050 |
-
function shapeValidator(shapeTypes) {
|
13051 |
-
if (!(0, _isPlainObject2['default'])(shapeTypes)) {
|
13052 |
-
throw new TypeError('shape must be a normal object');
|
13053 |
-
}
|
13054 |
|
13055 |
-
|
13056 |
-
|
|
|
13057 |
|
13058 |
-
if (propValue == null) {
|
13059 |
-
return null;
|
13060 |
-
}
|
13061 |
-
// code adapted from PropTypes.shape: https://github.com/facebook/react/blob/14156e56b9cf18ac86963185c5af4abddf3ff811/src/isomorphic/classic/types/ReactPropTypes.js#L381
|
13062 |
-
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
13063 |
|
13064 |
-
|
13065 |
-
|
13066 |
-
|
|
|
|
|
|
|
|
|
13067 |
|
13068 |
-
|
13069 |
-
|
13070 |
-
|
13071 |
-
var error = checker.apply(undefined, [propValue, key, componentName, location].concat(rest));
|
13072 |
-
if (error) {
|
13073 |
-
return error;
|
13074 |
-
}
|
13075 |
-
}
|
13076 |
-
}
|
13077 |
-
return null;
|
13078 |
}
|
13079 |
|
13080 |
-
|
13081 |
-
function
|
13082 |
-
|
13083 |
-
|
13084 |
-
|
13085 |
-
|
13086 |
}
|
13087 |
|
13088 |
-
|
13089 |
-
|
13090 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13091 |
|
13092 |
-
|
|
|
|
|
|
|
|
|
|
|
13093 |
}
|
13094 |
|
13095 |
-
|
13096 |
-
|
|
|
13097 |
|
13098 |
-
|
|
|
|
|
|
|
13099 |
}
|
13100 |
-
//# sourceMappingURL=
|
13101 |
|
13102 |
/***/ }),
|
13103 |
-
/*
|
13104 |
/***/ (function(module, exports, __webpack_require__) {
|
13105 |
|
13106 |
-
|
13107 |
-
value: true
|
13108 |
-
});
|
13109 |
-
exports['default'] = renderableChildren;
|
13110 |
|
13111 |
-
var _react = __webpack_require__(11);
|
13112 |
|
13113 |
-
|
|
|
|
|
|
|
|
|
13114 |
|
13115 |
-
|
13116 |
|
13117 |
-
|
13118 |
-
|
13119 |
-
|
13120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13121 |
}
|
13122 |
-
//# sourceMappingURL=renderableChildren.js.map
|
13123 |
|
13124 |
-
|
13125 |
-
|
13126 |
-
|
13127 |
|
13128 |
-
Object.defineProperty(exports, "__esModule", {
|
13129 |
-
value: true
|
13130 |
-
});
|
13131 |
-
exports['default'] = getComponentName;
|
13132 |
|
13133 |
-
|
|
|
|
|
13134 |
|
13135 |
-
|
|
|
|
|
|
|
13136 |
|
13137 |
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13138 |
|
13139 |
-
|
13140 |
-
|
13141 |
-
|
13142 |
-
}
|
13143 |
-
if (typeof Component === 'function') {
|
13144 |
-
return Component.displayName || (0, _functionPrototype2['default'])(Component);
|
13145 |
-
}
|
13146 |
-
return null;
|
13147 |
-
}
|
13148 |
-
//# sourceMappingURL=getComponentName.js.map
|
13149 |
|
13150 |
-
|
13151 |
-
|
13152 |
-
|
|
|
|
|
|
|
13153 |
|
13154 |
-
|
13155 |
-
|
13156 |
-
|
|
|
|
|
13157 |
|
13158 |
-
|
|
|
|
|
|
|
13159 |
|
13160 |
-
var
|
|
|
|
|
13161 |
|
13162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13163 |
|
13164 |
-
|
|
|
|
|
13165 |
|
13166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13167 |
|
13168 |
-
function requiredInteger(props, propName, componentName) {
|
13169 |
-
var propValue = props[propName];
|
13170 |
|
13171 |
-
if (
|
13172 |
-
return
|
13173 |
}
|
13174 |
-
return null;
|
13175 |
-
}
|
13176 |
|
13177 |
-
|
13178 |
-
|
13179 |
-
|
13180 |
|
|
|
|
|
13181 |
|
13182 |
-
|
13183 |
-
|
13184 |
-
|
13185 |
|
13186 |
-
for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
13187 |
-
rest[_key - 2] = arguments[_key];
|
13188 |
-
}
|
13189 |
|
13190 |
-
|
|
|
13191 |
}
|
13192 |
|
13193 |
-
|
13194 |
-
|
13195 |
|
13196 |
-
|
|
|
|
|
13197 |
|
13198 |
-
|
13199 |
-
return (0, _wrapValidator2['default'])(validator, 'integer');
|
13200 |
-
};
|
13201 |
-
//# sourceMappingURL=integer.js.map
|
13202 |
|
13203 |
-
|
13204 |
-
|
13205 |
-
/***/ (function(module, exports, __webpack_require__) {
|
13206 |
|
13207 |
-
|
13208 |
-
|
|
|
|
|
13209 |
|
|
|
|
|
|
|
13210 |
|
13211 |
/***/ }),
|
13212 |
-
/*
|
13213 |
-
/***/ (function(module,
|
13214 |
|
13215 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13217 |
|
13218 |
-
|
|
|
|
|
|
|
13219 |
|
13220 |
-
|
13221 |
-
|
13222 |
-
|
13223 |
|
13224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13225 |
|
13226 |
-
|
13227 |
-
|
13228 |
-
|
13229 |
-
shim: shim
|
13230 |
-
});
|
13231 |
|
13232 |
-
module.exports = polyfill;
|
13233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13234 |
|
13235 |
/***/ }),
|
13236 |
-
/*
|
13237 |
-
/***/ (function(module,
|
13238 |
|
13239 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13240 |
|
|
|
|
|
|
|
13241 |
|
13242 |
-
|
13243 |
-
|
13244 |
-
|
13245 |
-
|
13246 |
-
|
13247 |
|
13248 |
-
|
13249 |
-
|
13250 |
-
|
13251 |
-
|
13252 |
|
13253 |
-
|
13254 |
-
|
13255 |
-
|
13256 |
|
13257 |
-
|
13258 |
-
return top + vertical;
|
13259 |
}
|
13260 |
|
13261 |
-
|
13262 |
-
|
13263 |
-
|
13264 |
|
13265 |
-
|
13266 |
-
|
13267 |
-
|
13268 |
|
13269 |
-
|
13270 |
-
|
13271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13272 |
|
13273 |
-
if (
|
13274 |
-
return
|
13275 |
}
|
13276 |
|
13277 |
-
return
|
13278 |
}
|
|
|
13279 |
|
13280 |
-
|
13281 |
-
|
13282 |
-
|
13283 |
-
lineHeight_small = _ref$font$input.lineHeight_small,
|
13284 |
-
_ref$spacing = _ref.spacing,
|
13285 |
-
inputPadding = _ref$spacing.inputPadding,
|
13286 |
-
displayTextPaddingVertical = _ref$spacing.displayTextPaddingVertical,
|
13287 |
-
displayTextPaddingTop = _ref$spacing.displayTextPaddingTop,
|
13288 |
-
displayTextPaddingBottom = _ref$spacing.displayTextPaddingBottom,
|
13289 |
-
displayTextPaddingVertical_small = _ref$spacing.displayTextPaddingVertical_small,
|
13290 |
-
displayTextPaddingTop_small = _ref$spacing.displayTextPaddingTop_small,
|
13291 |
-
displayTextPaddingBottom_small = _ref$spacing.displayTextPaddingBottom_small;
|
13292 |
|
13293 |
-
|
|
|
|
|
|
|
|
|
|
|
13294 |
|
13295 |
-
var padding = small ? getPadding(displayTextPaddingVertical_small, displayTextPaddingTop_small, displayTextPaddingBottom_small) : getPadding(displayTextPaddingVertical, displayTextPaddingTop, displayTextPaddingBottom);
|
13296 |
|
13297 |
-
|
13298 |
-
}
|
13299 |
|
13300 |
-
|
13301 |
-
/* 101 */
|
13302 |
-
/***/ (function(module, exports) {
|
13303 |
|
13304 |
/**
|
13305 |
-
*
|
13306 |
-
|
13307 |
-
|
13308 |
-
|
13309 |
-
*
|
13310 |
-
|
13311 |
-
|
13312 |
-
|
13313 |
-
|
13314 |
-
*
|
13315 |
-
*
|
13316 |
-
*
|
13317 |
-
* _.isObject({});
|
13318 |
-
* // => true
|
13319 |
-
*
|
13320 |
-
* _.isObject([1, 2, 3]);
|
13321 |
-
* // => true
|
13322 |
*
|
13323 |
-
*
|
13324 |
-
*
|
|
|
|
|
13325 |
*
|
13326 |
-
*
|
13327 |
-
* // => false
|
13328 |
*/
|
13329 |
-
function isObject(value) {
|
13330 |
-
var type = typeof value;
|
13331 |
-
return value != null && (type == 'object' || type == 'function');
|
13332 |
-
}
|
13333 |
-
|
13334 |
-
module.exports = isObject;
|
13335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13336 |
|
13337 |
-
|
13338 |
-
|
13339 |
-
|
|
|
13340 |
|
13341 |
-
|
|
|
|
|
|
|
|
|
13342 |
|
|
|
13343 |
|
13344 |
-
Object
|
13345 |
-
|
13346 |
-
|
13347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13348 |
|
13349 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13350 |
|
13351 |
-
|
|
|
|
|
|
|
|
|
13352 |
|
13353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13354 |
|
13355 |
-
|
|
|
|
|
13356 |
|
13357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13358 |
|
13359 |
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13360 |
|
13361 |
-
|
13362 |
-
|
13363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13364 |
|
13365 |
-
|
|
|
13366 |
}
|
|
|
13367 |
|
13368 |
/***/ }),
|
13369 |
-
/*
|
13370 |
-
/***/ (function(module,
|
13371 |
|
13372 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13373 |
|
13374 |
|
13375 |
-
Object.defineProperty(exports, "__esModule", {
|
13376 |
-
value: true
|
13377 |
-
});
|
13378 |
-
exports['default'] = isDayVisible;
|
13379 |
|
13380 |
-
var _isBeforeDay = __webpack_require__(60);
|
13381 |
|
13382 |
-
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
|
13383 |
|
13384 |
-
var _isAfterDay = __webpack_require__(78);
|
13385 |
|
13386 |
-
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
|
13387 |
|
13388 |
-
|
|
|
|
|
13389 |
|
13390 |
-
function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
|
13391 |
-
var firstDayOfFirstMonth = month.clone().startOf('month');
|
13392 |
-
if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
|
13393 |
-
if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
|
13394 |
|
13395 |
-
|
13396 |
-
|
13397 |
-
|
13398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13399 |
|
13400 |
-
|
13401 |
-
|
13402 |
-
|
|
|
|
|
13403 |
|
13404 |
-
|
|
|
13405 |
|
|
|
13406 |
|
13407 |
-
Object
|
13408 |
-
value: true
|
13409 |
-
});
|
13410 |
-
exports.PureDayPicker = exports.defaultProps = undefined;
|
13411 |
|
13412 |
-
|
|
|
|
|
13413 |
|
13414 |
-
|
|
|
|
|
13415 |
|
13416 |
-
|
|
|
|
|
13417 |
|
13418 |
-
|
|
|
|
|
|
|
|
|
13419 |
|
13420 |
-
|
|
|
|
|
13421 |
|
13422 |
-
var
|
|
|
|
|
13423 |
|
13424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13425 |
|
13426 |
-
|
|
|
|
|
|
|
|
|
13427 |
|
13428 |
-
|
|
|
|
|
13429 |
|
13430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13431 |
|
13432 |
-
var _airbnbPropTypes = __webpack_require__(19);
|
13433 |
|
13434 |
-
var _reactWithStyles = __webpack_require__(26);
|
13435 |
|
13436 |
-
var _moment = __webpack_require__(1);
|
13437 |
|
13438 |
-
var _moment2 = _interopRequireDefault(_moment);
|
13439 |
|
13440 |
-
var _throttle = __webpack_require__(321);
|
13441 |
|
13442 |
-
var _throttle2 = _interopRequireDefault(_throttle);
|
13443 |
|
13444 |
-
var _isTouchDevice = __webpack_require__(50);
|
13445 |
|
13446 |
-
|
|
|
|
|
13447 |
|
13448 |
-
var _reactOutsideClickHandler = __webpack_require__(98);
|
13449 |
|
13450 |
-
var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
|
13451 |
|
13452 |
-
var _defaultPhrases = __webpack_require__(23);
|
13453 |
|
13454 |
-
var
|
|
|
|
|
|
|
|
|
13455 |
|
13456 |
-
|
|
|
13457 |
|
13458 |
-
|
13459 |
|
13460 |
-
|
|
|
|
|
|
|
|
|
13461 |
|
13462 |
-
|
|
|
|
|
|
|
|
|
|
|
13463 |
|
13464 |
-
var
|
13465 |
|
13466 |
-
|
|
|
|
|
13467 |
|
13468 |
-
var
|
|
|
13469 |
|
13470 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13471 |
|
13472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13473 |
|
13474 |
-
|
|
|
|
|
|
|
|
|
|
|
13475 |
|
13476 |
-
|
|
|
|
|
13477 |
|
13478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13479 |
|
13480 |
-
var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
|
13481 |
|
13482 |
-
var _getActiveElement = __webpack_require__(581);
|
13483 |
|
13484 |
-
var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
|
13485 |
|
13486 |
-
var _isDayVisible = __webpack_require__(103);
|
13487 |
|
13488 |
-
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
|
13489 |
|
13490 |
-
var _ModifiersShape = __webpack_require__(73);
|
13491 |
|
13492 |
-
|
|
|
|
|
13493 |
|
13494 |
-
|
|
|
|
|
13495 |
|
13496 |
-
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
|
13497 |
|
13498 |
-
|
|
|
|
|
13499 |
|
13500 |
-
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
|
13501 |
|
13502 |
-
var _CalendarInfoPositionShape = __webpack_require__(58);
|
13503 |
|
13504 |
-
|
|
|
|
|
|
|
|
|
13505 |
|
13506 |
-
var
|
13507 |
|
13508 |
-
|
|
|
|
|
|
|
13509 |
|
13510 |
-
function
|
|
|
13511 |
|
13512 |
-
|
13513 |
|
13514 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13515 |
|
13516 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13517 |
|
13518 |
-
|
13519 |
-
|
13520 |
-
|
13521 |
-
var MONTH_SELECTION_TRANSITION = 'month_selection';
|
13522 |
-
var YEAR_SELECTION_TRANSITION = 'year_selection';
|
13523 |
|
13524 |
-
var
|
13525 |
|
13526 |
-
|
13527 |
-
|
13528 |
-
|
13529 |
-
|
13530 |
-
|
13531 |
-
|
13532 |
-
|
13533 |
-
|
13534 |
-
firstDayOfWeek: _DayOfWeekShape2['default'],
|
13535 |
-
renderCalendarInfo: _propTypes2['default'].func,
|
13536 |
-
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
|
13537 |
-
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
|
13538 |
-
daySize: _airbnbPropTypes.nonNegativeInteger,
|
13539 |
-
isRTL: _propTypes2['default'].bool,
|
13540 |
-
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
|
13541 |
-
noBorder: _propTypes2['default'].bool,
|
13542 |
-
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
|
13543 |
-
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
|
13544 |
-
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
|
13545 |
|
13546 |
-
|
13547 |
-
|
13548 |
-
|
13549 |
-
|
13550 |
-
|
13551 |
-
|
13552 |
-
|
13553 |
-
|
13554 |
-
onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
|
13555 |
|
13556 |
-
// month props
|
13557 |
-
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
|
13558 |
-
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
|
13559 |
|
13560 |
-
|
13561 |
-
|
13562 |
-
|
13563 |
-
|
13564 |
-
onDayClick: _propTypes2['default'].func,
|
13565 |
-
onDayMouseEnter: _propTypes2['default'].func,
|
13566 |
-
onDayMouseLeave: _propTypes2['default'].func,
|
13567 |
|
13568 |
-
// accessibility props
|
13569 |
-
isFocused: _propTypes2['default'].bool,
|
13570 |
-
getFirstFocusableDay: _propTypes2['default'].func,
|
13571 |
-
onBlur: _propTypes2['default'].func,
|
13572 |
-
showKeyboardShortcuts: _propTypes2['default'].bool,
|
13573 |
|
13574 |
-
|
13575 |
-
monthFormat: _propTypes2['default'].string,
|
13576 |
-
weekDayFormat: _propTypes2['default'].string,
|
13577 |
-
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
|
13578 |
-
dayAriaLabelFormat: _propTypes2['default'].string
|
13579 |
-
}));
|
13580 |
|
13581 |
-
var
|
13582 |
-
// calendar presentation props
|
13583 |
-
enableOutsideDays: false,
|
13584 |
-
numberOfMonths: 2,
|
13585 |
-
orientation: _constants.HORIZONTAL_ORIENTATION,
|
13586 |
-
withPortal: false,
|
13587 |
-
onOutsideClick: function () {
|
13588 |
-
function onOutsideClick() {}
|
13589 |
|
13590 |
-
|
13591 |
-
|
|
|
13592 |
|
13593 |
-
|
13594 |
-
|
13595 |
-
|
13596 |
-
|
|
|
|
|
|
|
|
|
13597 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13598 |
|
13599 |
-
|
13600 |
-
|
13601 |
-
|
13602 |
-
|
13603 |
-
|
13604 |
-
hideKeyboardShortcutsPanel: false,
|
13605 |
-
daySize: _constants.DAY_SIZE,
|
13606 |
-
isRTL: false,
|
13607 |
-
verticalHeight: null,
|
13608 |
-
noBorder: false,
|
13609 |
-
transitionDuration: undefined,
|
13610 |
-
verticalBorderSpacing: undefined,
|
13611 |
-
horizontalMonthPadding: 13,
|
13612 |
|
13613 |
-
|
13614 |
-
|
13615 |
-
navNext: null,
|
13616 |
-
noNavButtons: false,
|
13617 |
-
onPrevMonthClick: function () {
|
13618 |
-
function onPrevMonthClick() {}
|
13619 |
|
13620 |
-
|
13621 |
-
|
13622 |
-
|
13623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13624 |
|
13625 |
-
|
13626 |
-
|
13627 |
-
onMonthChange: function () {
|
13628 |
-
function onMonthChange() {}
|
13629 |
|
13630 |
-
|
13631 |
-
|
13632 |
-
|
13633 |
-
function onYearChange() {}
|
13634 |
|
13635 |
-
|
13636 |
-
|
13637 |
-
|
13638 |
-
function onMultiplyScrollableMonths() {}
|
13639 |
|
13640 |
-
|
13641 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13642 |
|
13643 |
|
13644 |
-
// month props
|
13645 |
-
renderMonthText: null,
|
13646 |
-
renderMonthElement: null,
|
13647 |
|
13648 |
-
// day props
|
13649 |
-
modifiers: {},
|
13650 |
-
renderCalendarDay: undefined,
|
13651 |
-
renderDayContents: null,
|
13652 |
-
onDayClick: function () {
|
13653 |
-
function onDayClick() {}
|
13654 |
|
13655 |
-
return onDayClick;
|
13656 |
-
}(),
|
13657 |
-
onDayMouseEnter: function () {
|
13658 |
-
function onDayMouseEnter() {}
|
13659 |
|
13660 |
-
return onDayMouseEnter;
|
13661 |
-
}(),
|
13662 |
-
onDayMouseLeave: function () {
|
13663 |
-
function onDayMouseLeave() {}
|
13664 |
|
13665 |
-
return onDayMouseLeave;
|
13666 |
-
}(),
|
13667 |
|
13668 |
|
13669 |
-
// accessibility props
|
13670 |
-
isFocused: false,
|
13671 |
-
getFirstFocusableDay: null,
|
13672 |
-
onBlur: function () {
|
13673 |
-
function onBlur() {}
|
13674 |
|
13675 |
-
return onBlur;
|
13676 |
-
}(),
|
13677 |
|
13678 |
-
|
|
|
|
|
13679 |
|
13680 |
-
// internationalization
|
13681 |
-
monthFormat: 'MMMM YYYY',
|
13682 |
-
weekDayFormat: 'dd',
|
13683 |
-
phrases: _defaultPhrases.DayPickerPhrases,
|
13684 |
-
dayAriaLabelFormat: undefined
|
13685 |
-
};
|
13686 |
|
13687 |
-
var
|
13688 |
-
|
|
|
|
|
13689 |
|
13690 |
-
function
|
13691 |
-
|
13692 |
|
13693 |
-
|
13694 |
|
13695 |
-
|
|
|
|
|
|
|
13696 |
|
13697 |
-
|
13698 |
-
|
13699 |
-
|
|
|
13700 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13701 |
|
13702 |
-
|
13703 |
-
|
13704 |
|
13705 |
-
var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
|
13706 |
|
13707 |
-
|
13708 |
-
|
13709 |
-
|
13710 |
-
|
13711 |
-
|
13712 |
-
scrollableMonthMultiple: 1,
|
13713 |
-
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
|
13714 |
-
focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
|
13715 |
-
nextFocusedDate: null,
|
13716 |
-
showKeyboardShortcuts: props.showKeyboardShortcuts,
|
13717 |
-
onKeyboardShortcutsPanelClose: function () {
|
13718 |
-
function onKeyboardShortcutsPanelClose() {}
|
13719 |
|
13720 |
-
|
13721 |
-
|
13722 |
|
13723 |
-
|
13724 |
-
|
13725 |
-
calendarInfoWidth: 0,
|
13726 |
-
monthTitleHeight: null,
|
13727 |
-
hasSetHeight: false
|
13728 |
-
};
|
13729 |
|
13730 |
-
|
|
|
|
|
13731 |
|
13732 |
-
|
13733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13734 |
|
13735 |
-
_this.onKeyDown = _this.onKeyDown.bind(_this);
|
13736 |
-
_this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
|
13737 |
-
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
|
13738 |
-
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
|
13739 |
-
_this.onMonthChange = _this.onMonthChange.bind(_this);
|
13740 |
-
_this.onYearChange = _this.onYearChange.bind(_this);
|
13741 |
|
13742 |
-
_this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
|
13743 |
-
_this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
|
13744 |
|
13745 |
-
_this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
|
13746 |
-
_this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
|
13747 |
|
13748 |
-
_this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
|
13749 |
-
_this.setContainerRef = _this.setContainerRef.bind(_this);
|
13750 |
-
_this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
|
13751 |
-
_this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
|
13752 |
-
return _this;
|
13753 |
-
}
|
13754 |
|
13755 |
-
_createClass(DayPicker, [{
|
13756 |
-
key: 'componentDidMount',
|
13757 |
-
value: function () {
|
13758 |
-
function componentDidMount() {
|
13759 |
-
var currentMonth = this.state.currentMonth;
|
13760 |
|
13761 |
-
if (this.calendarInfo) {
|
13762 |
-
this.setState({
|
13763 |
-
isTouchDevice: (0, _isTouchDevice2['default'])(),
|
13764 |
-
calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
|
13765 |
-
});
|
13766 |
-
} else {
|
13767 |
-
this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
|
13768 |
-
}
|
13769 |
|
13770 |
-
this.setCalendarMonthWeeks(currentMonth);
|
13771 |
-
}
|
13772 |
|
13773 |
-
return componentDidMount;
|
13774 |
-
}()
|
13775 |
-
}, {
|
13776 |
-
key: 'componentWillReceiveProps',
|
13777 |
-
value: function () {
|
13778 |
-
function componentWillReceiveProps(nextProps) {
|
13779 |
-
var hidden = nextProps.hidden,
|
13780 |
-
isFocused = nextProps.isFocused,
|
13781 |
-
showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
|
13782 |
-
onBlur = nextProps.onBlur,
|
13783 |
-
renderMonthText = nextProps.renderMonthText,
|
13784 |
-
horizontalMonthPadding = nextProps.horizontalMonthPadding;
|
13785 |
-
var currentMonth = this.state.currentMonth;
|
13786 |
|
|
|
|
|
|
|
13787 |
|
13788 |
-
|
13789 |
-
|
13790 |
-
|
13791 |
-
this.setState({
|
13792 |
-
currentMonth: nextProps.initialVisibleMonth()
|
13793 |
-
});
|
13794 |
-
}
|
13795 |
-
}
|
13796 |
|
13797 |
-
var _props = this.props,
|
13798 |
-
daySize = _props.daySize,
|
13799 |
-
prevIsFocused = _props.isFocused,
|
13800 |
-
prevRenderMonthText = _props.renderMonthText;
|
13801 |
|
13802 |
|
13803 |
-
|
13804 |
-
|
13805 |
-
|
13806 |
-
|
13807 |
-
|
|
|
|
|
|
|
|
|
|
|
13808 |
|
13809 |
-
|
13810 |
-
|
13811 |
-
|
|
|
13812 |
|
13813 |
-
|
|
|
13814 |
|
13815 |
-
|
13816 |
-
// the ? shortcut came from the input and we should return input there once it is close
|
13817 |
-
onKeyboardShortcutsPanelClose = onBlur;
|
13818 |
-
}
|
13819 |
|
13820 |
-
|
13821 |
-
|
13822 |
-
|
13823 |
-
|
13824 |
-
|
13825 |
-
|
13826 |
-
|
13827 |
-
|
13828 |
-
|
13829 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13830 |
|
13831 |
-
|
13832 |
-
|
13833 |
-
|
13834 |
-
|
13835 |
-
|
13836 |
-
|
13837 |
|
13838 |
-
|
13839 |
-
}
|
13840 |
}, {
|
13841 |
-
key:
|
13842 |
-
value: function () {
|
13843 |
-
|
13844 |
-
|
13845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13846 |
|
13847 |
-
|
13848 |
-
|
|
|
|
|
13849 |
}, {
|
13850 |
-
key:
|
13851 |
-
value: function () {
|
13852 |
-
|
13853 |
-
|
|
|
|
|
|
|
13854 |
|
13855 |
-
|
|
|
13856 |
|
13857 |
-
|
13858 |
-
// breaks the CSS transition.
|
13859 |
-
// The setTimeout will wait until the transition ends.
|
13860 |
|
13861 |
-
|
13862 |
-
this.setCalendarInfoWidthTimeout = setTimeout(function () {
|
13863 |
-
var calendarInfoWidth = _this2.state.calendarInfoWidth;
|
13864 |
|
13865 |
-
|
13866 |
-
|
13867 |
-
|
13868 |
-
calendarInfoWidth: calendarInfoPanelWidth
|
13869 |
-
});
|
13870 |
-
}
|
13871 |
-
}, transitionDuration);
|
13872 |
-
}
|
13873 |
-
}
|
13874 |
|
13875 |
-
|
13876 |
-
|
13877 |
-
|
13878 |
-
|
13879 |
-
|
13880 |
-
|
13881 |
-
|
13882 |
-
|
13883 |
-
|
13884 |
-
|
13885 |
-
|
13886 |
-
|
13887 |
-
|
13888 |
-
monthTitleHeight = _state.monthTitleHeight;
|
13889 |
|
13890 |
|
13891 |
-
if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
|
13892 |
-
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
|
13893 |
-
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
13894 |
-
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
|
13895 |
-
this.adjustDayPickerHeight(newMonthHeight);
|
13896 |
-
}
|
13897 |
|
13898 |
-
if (!prevProps.isFocused && isFocused && !focusedDate) {
|
13899 |
-
this.container.focus();
|
13900 |
-
}
|
13901 |
-
}
|
13902 |
|
13903 |
-
return componentDidUpdate;
|
13904 |
-
}()
|
13905 |
-
}, {
|
13906 |
-
key: 'componentWillUnmount',
|
13907 |
-
value: function () {
|
13908 |
-
function componentWillUnmount() {
|
13909 |
-
clearTimeout(this.setCalendarInfoWidthTimeout);
|
13910 |
-
}
|
13911 |
|
13912 |
-
return componentWillUnmount;
|
13913 |
-
}()
|
13914 |
-
}, {
|
13915 |
-
key: 'onKeyDown',
|
13916 |
-
value: function () {
|
13917 |
-
function onKeyDown(e) {
|
13918 |
-
e.stopPropagation();
|
13919 |
-
if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
|
13920 |
-
this.throttledKeyDown(e);
|
13921 |
-
}
|
13922 |
-
}
|
13923 |
|
13924 |
-
return onKeyDown;
|
13925 |
-
}()
|
13926 |
-
}, {
|
13927 |
-
key: 'onFinalKeyDown',
|
13928 |
-
value: function () {
|
13929 |
-
function onFinalKeyDown(e) {
|
13930 |
-
this.setState({ withMouseInteractions: false });
|
13931 |
|
13932 |
-
var _props3 = this.props,
|
13933 |
-
onBlur = _props3.onBlur,
|
13934 |
-
isRTL = _props3.isRTL;
|
13935 |
-
var _state2 = this.state,
|
13936 |
-
focusedDate = _state2.focusedDate,
|
13937 |
-
showKeyboardShortcuts = _state2.showKeyboardShortcuts;
|
13938 |
|
13939 |
-
if (!focusedDate) return;
|
13940 |
|
13941 |
-
|
|
|
|
|
13942 |
|
13943 |
-
|
|
|
|
|
13944 |
|
13945 |
-
// focus might be anywhere when the keyboard shortcuts panel is opened so we want to
|
13946 |
-
// return it to wherever it was before when the panel was opened
|
13947 |
-
var activeElement = (0, _getActiveElement2['default'])();
|
13948 |
-
var onKeyboardShortcutsPanelClose = function () {
|
13949 |
-
function onKeyboardShortcutsPanelClose() {
|
13950 |
-
if (activeElement) activeElement.focus();
|
13951 |
-
}
|
13952 |
|
13953 |
-
return onKeyboardShortcutsPanelClose;
|
13954 |
-
}();
|
13955 |
|
13956 |
-
switch (e.key) {
|
13957 |
-
case 'ArrowUp':
|
13958 |
-
e.preventDefault();
|
13959 |
-
newFocusedDate.subtract(1, 'week');
|
13960 |
-
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
13961 |
-
break;
|
13962 |
-
case 'ArrowLeft':
|
13963 |
-
e.preventDefault();
|
13964 |
-
if (isRTL) {
|
13965 |
-
newFocusedDate.add(1, 'day');
|
13966 |
-
} else {
|
13967 |
-
newFocusedDate.subtract(1, 'day');
|
13968 |
-
}
|
13969 |
-
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
13970 |
-
break;
|
13971 |
-
case 'Home':
|
13972 |
-
e.preventDefault();
|
13973 |
-
newFocusedDate.startOf('week');
|
13974 |
-
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
13975 |
-
break;
|
13976 |
-
case 'PageUp':
|
13977 |
-
e.preventDefault();
|
13978 |
-
newFocusedDate.subtract(1, 'month');
|
13979 |
-
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
13980 |
-
break;
|
13981 |
|
13982 |
-
|
13983 |
-
|
13984 |
-
|
13985 |
-
|
13986 |
-
|
13987 |
-
|
13988 |
-
|
13989 |
-
|
13990 |
-
newFocusedDate.subtract(1, 'day');
|
13991 |
-
} else {
|
13992 |
-
newFocusedDate.add(1, 'day');
|
13993 |
-
}
|
13994 |
-
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
13995 |
-
break;
|
13996 |
-
case 'End':
|
13997 |
-
e.preventDefault();
|
13998 |
-
newFocusedDate.endOf('week');
|
13999 |
-
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
14000 |
-
break;
|
14001 |
-
case 'PageDown':
|
14002 |
-
e.preventDefault();
|
14003 |
-
newFocusedDate.add(1, 'month');
|
14004 |
-
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
14005 |
-
break;
|
14006 |
|
14007 |
-
|
14008 |
-
|
14009 |
-
|
|
|
|
|
14010 |
|
14011 |
-
|
14012 |
-
|
14013 |
-
this.closeKeyboardShortcutsPanel();
|
14014 |
-
} else {
|
14015 |
-
onBlur();
|
14016 |
-
}
|
14017 |
-
break;
|
14018 |
|
14019 |
-
|
14020 |
-
break;
|
14021 |
-
}
|
14022 |
|
14023 |
-
|
14024 |
-
|
14025 |
-
|
14026 |
-
if (!didTransitionMonth) {
|
14027 |
-
this.setState({
|
14028 |
-
focusedDate: newFocusedDate
|
14029 |
-
});
|
14030 |
-
}
|
14031 |
}
|
14032 |
|
14033 |
-
|
14034 |
-
|
14035 |
-
|
14036 |
-
|
14037 |
-
value: function () {
|
14038 |
-
function onPrevMonthClick(nextFocusedDate, e) {
|
14039 |
-
var _props4 = this.props,
|
14040 |
-
daySize = _props4.daySize,
|
14041 |
-
isRTL = _props4.isRTL,
|
14042 |
-
numberOfMonths = _props4.numberOfMonths;
|
14043 |
-
var _state3 = this.state,
|
14044 |
-
calendarMonthWidth = _state3.calendarMonthWidth,
|
14045 |
-
monthTitleHeight = _state3.monthTitleHeight;
|
14046 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14047 |
|
14048 |
-
|
|
|
|
|
|
|
|
|
14049 |
|
14050 |
-
|
14051 |
-
|
14052 |
-
|
14053 |
-
translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
|
14054 |
-
} else if (this.isHorizontal()) {
|
14055 |
-
translationValue = calendarMonthWidth;
|
14056 |
-
if (isRTL) {
|
14057 |
-
translationValue = -2 * calendarMonthWidth;
|
14058 |
-
}
|
14059 |
|
14060 |
-
|
14061 |
-
var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
14062 |
-
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
|
14063 |
-
this.adjustDayPickerHeight(newMonthHeight);
|
14064 |
-
}
|
14065 |
|
14066 |
-
this.setState({
|
14067 |
-
monthTransition: PREV_TRANSITION,
|
14068 |
-
translationValue: translationValue,
|
14069 |
-
focusedDate: null,
|
14070 |
-
nextFocusedDate: nextFocusedDate
|
14071 |
-
});
|
14072 |
-
}
|
14073 |
|
14074 |
-
|
14075 |
-
}()
|
14076 |
-
}, {
|
14077 |
-
key: 'onMonthChange',
|
14078 |
-
value: function () {
|
14079 |
-
function onMonthChange(currentMonth) {
|
14080 |
-
this.setCalendarMonthWeeks(currentMonth);
|
14081 |
-
this.calculateAndSetDayPickerHeight();
|
14082 |
|
14083 |
-
|
14084 |
-
// properly rerenders the CalendarMonthGrid
|
14085 |
-
this.setState({
|
14086 |
-
monthTransition: MONTH_SELECTION_TRANSITION,
|
14087 |
-
translationValue: 0.00001,
|
14088 |
-
focusedDate: null,
|
14089 |
-
nextFocusedDate: currentMonth,
|
14090 |
-
currentMonth: currentMonth
|
14091 |
-
});
|
14092 |
-
}
|
14093 |
|
14094 |
-
|
14095 |
-
}()
|
14096 |
-
}, {
|
14097 |
-
key: 'onYearChange',
|
14098 |
-
value: function () {
|
14099 |
-
function onYearChange(currentMonth) {
|
14100 |
-
this.setCalendarMonthWeeks(currentMonth);
|
14101 |
-
this.calculateAndSetDayPickerHeight();
|
14102 |
|
14103 |
-
|
14104 |
-
|
14105 |
-
this.setState({
|
14106 |
-
monthTransition: YEAR_SELECTION_TRANSITION,
|
14107 |
-
translationValue: 0.0001,
|
14108 |
-
focusedDate: null,
|
14109 |
-
nextFocusedDate: currentMonth,
|
14110 |
-
currentMonth: currentMonth
|
14111 |
-
});
|
14112 |
-
}
|
14113 |
|
14114 |
-
|
14115 |
-
|
14116 |
-
|
14117 |
-
|
14118 |
-
|
14119 |
-
|
14120 |
-
var _props5 = this.props,
|
14121 |
-
isRTL = _props5.isRTL,
|
14122 |
-
numberOfMonths = _props5.numberOfMonths,
|
14123 |
-
daySize = _props5.daySize;
|
14124 |
-
var _state4 = this.state,
|
14125 |
-
calendarMonthWidth = _state4.calendarMonthWidth,
|
14126 |
-
monthTitleHeight = _state4.monthTitleHeight;
|
14127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14128 |
|
14129 |
-
if (e) e.preventDefault();
|
14130 |
|
14131 |
-
|
|
|
|
|
14132 |
|
14133 |
-
|
14134 |
-
var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
|
14135 |
-
var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
|
14136 |
-
translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
|
14137 |
-
}
|
14138 |
|
14139 |
-
if (this.isHorizontal()) {
|
14140 |
-
translationValue = -calendarMonthWidth;
|
14141 |
-
if (isRTL) {
|
14142 |
-
translationValue = 0;
|
14143 |
-
}
|
14144 |
|
14145 |
-
|
14146 |
-
var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
14147 |
-
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
|
14148 |
-
this.adjustDayPickerHeight(newMonthHeight);
|
14149 |
-
}
|
14150 |
|
14151 |
-
|
14152 |
-
monthTransition: NEXT_TRANSITION,
|
14153 |
-
translationValue: translationValue,
|
14154 |
-
focusedDate: null,
|
14155 |
-
nextFocusedDate: nextFocusedDate
|
14156 |
-
});
|
14157 |
-
}
|
14158 |
|
14159 |
-
|
14160 |
-
|
14161 |
-
}, {
|
14162 |
-
key: 'getFirstDayOfWeek',
|
14163 |
-
value: function () {
|
14164 |
-
function getFirstDayOfWeek() {
|
14165 |
-
var firstDayOfWeek = this.props.firstDayOfWeek;
|
14166 |
|
14167 |
-
|
14168 |
-
return _moment2['default'].localeData().firstDayOfWeek();
|
14169 |
-
}
|
14170 |
|
14171 |
-
|
14172 |
-
|
|
|
14173 |
|
14174 |
-
return getFirstDayOfWeek;
|
14175 |
-
}()
|
14176 |
-
}, {
|
14177 |
-
key: 'getFirstVisibleIndex',
|
14178 |
-
value: function () {
|
14179 |
-
function getFirstVisibleIndex() {
|
14180 |
-
var orientation = this.props.orientation;
|
14181 |
-
var monthTransition = this.state.monthTransition;
|
14182 |
|
|
|
|
|
|
|
14183 |
|
14184 |
-
|
14185 |
|
14186 |
-
var firstVisibleMonthIndex = 1;
|
14187 |
-
if (monthTransition === PREV_TRANSITION) {
|
14188 |
-
firstVisibleMonthIndex -= 1;
|
14189 |
-
} else if (monthTransition === NEXT_TRANSITION) {
|
14190 |
-
firstVisibleMonthIndex += 1;
|
14191 |
-
}
|
14192 |
|
14193 |
-
|
14194 |
-
|
|
|
14195 |
|
14196 |
-
return getFirstVisibleIndex;
|
14197 |
-
}()
|
14198 |
-
}, {
|
14199 |
-
key: 'getFocusedDay',
|
14200 |
-
value: function () {
|
14201 |
-
function getFocusedDay(newMonth) {
|
14202 |
-
var _props6 = this.props,
|
14203 |
-
getFirstFocusableDay = _props6.getFirstFocusableDay,
|
14204 |
-
numberOfMonths = _props6.numberOfMonths;
|
14205 |
|
|
|
|
|
|
|
14206 |
|
14207 |
-
|
14208 |
-
if (getFirstFocusableDay) {
|
14209 |
-
focusedDate = getFirstFocusableDay(newMonth);
|
14210 |
-
}
|
14211 |
|
14212 |
-
if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
|
14213 |
-
focusedDate = newMonth.clone().startOf('month');
|
14214 |
-
}
|
14215 |
|
14216 |
-
|
14217 |
-
}
|
14218 |
|
14219 |
-
|
14220 |
-
}()
|
14221 |
-
}, {
|
14222 |
-
key: 'setMonthTitleHeight',
|
14223 |
-
value: function () {
|
14224 |
-
function setMonthTitleHeight(monthTitleHeight) {
|
14225 |
-
var _this3 = this;
|
14226 |
|
14227 |
-
|
14228 |
-
|
14229 |
-
|
14230 |
-
|
14231 |
-
|
14232 |
-
|
14233 |
|
14234 |
-
return setMonthTitleHeight;
|
14235 |
-
}()
|
14236 |
-
}, {
|
14237 |
-
key: 'setCalendarMonthWeeks',
|
14238 |
-
value: function () {
|
14239 |
-
function setCalendarMonthWeeks(currentMonth) {
|
14240 |
-
var numberOfMonths = this.props.numberOfMonths;
|
14241 |
|
|
|
|
|
|
|
14242 |
|
14243 |
-
|
14244 |
-
var month = currentMonth.clone().subtract(1, 'months');
|
14245 |
-
var firstDayOfWeek = this.getFirstDayOfWeek();
|
14246 |
-
for (var i = 0; i < numberOfMonths + 2; i += 1) {
|
14247 |
-
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
|
14248 |
-
this.calendarMonthWeeks.push(numberOfWeeks);
|
14249 |
-
month = month.add(1, 'months');
|
14250 |
-
}
|
14251 |
-
}
|
14252 |
|
14253 |
-
return setCalendarMonthWeeks;
|
14254 |
-
}()
|
14255 |
-
}, {
|
14256 |
-
key: 'setContainerRef',
|
14257 |
-
value: function () {
|
14258 |
-
function setContainerRef(ref) {
|
14259 |
-
this.container = ref;
|
14260 |
-
}
|
14261 |
|
14262 |
-
|
14263 |
-
|
14264 |
-
|
14265 |
-
|
14266 |
-
value: function () {
|
14267 |
-
function setCalendarInfoRef(ref) {
|
14268 |
-
this.calendarInfo = ref;
|
14269 |
-
}
|
14270 |
|
14271 |
-
|
14272 |
-
}()
|
14273 |
-
}, {
|
14274 |
-
key: 'setTransitionContainerRef',
|
14275 |
-
value: function () {
|
14276 |
-
function setTransitionContainerRef(ref) {
|
14277 |
-
this.transitionContainer = ref;
|
14278 |
-
}
|
14279 |
|
14280 |
-
|
14281 |
-
}()
|
14282 |
-
}, {
|
14283 |
-
key: 'maybeTransitionNextMonth',
|
14284 |
-
value: function () {
|
14285 |
-
function maybeTransitionNextMonth(newFocusedDate) {
|
14286 |
-
var numberOfMonths = this.props.numberOfMonths;
|
14287 |
-
var _state5 = this.state,
|
14288 |
-
currentMonth = _state5.currentMonth,
|
14289 |
-
focusedDate = _state5.focusedDate;
|
14290 |
|
|
|
14291 |
|
14292 |
-
|
14293 |
-
var focusedDateMonth = focusedDate.month();
|
14294 |
-
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
|
14295 |
-
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
|
14296 |
-
this.onNextMonthClick(newFocusedDate);
|
14297 |
-
return true;
|
14298 |
-
}
|
14299 |
|
14300 |
-
|
14301 |
-
}
|
14302 |
|
14303 |
-
|
14304 |
-
}()
|
14305 |
-
}, {
|
14306 |
-
key: 'maybeTransitionPrevMonth',
|
14307 |
-
value: function () {
|
14308 |
-
function maybeTransitionPrevMonth(newFocusedDate) {
|
14309 |
-
var numberOfMonths = this.props.numberOfMonths;
|
14310 |
-
var _state6 = this.state,
|
14311 |
-
currentMonth = _state6.currentMonth,
|
14312 |
-
focusedDate = _state6.focusedDate;
|
14313 |
|
|
|
14314 |
|
14315 |
-
|
14316 |
-
var focusedDateMonth = focusedDate.month();
|
14317 |
-
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
|
14318 |
-
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
|
14319 |
-
this.onPrevMonthClick(newFocusedDate);
|
14320 |
-
return true;
|
14321 |
-
}
|
14322 |
|
14323 |
-
|
14324 |
-
}
|
14325 |
|
14326 |
-
|
14327 |
-
}()
|
14328 |
-
}, {
|
14329 |
-
key: 'multiplyScrollableMonths',
|
14330 |
-
value: function () {
|
14331 |
-
function multiplyScrollableMonths(e) {
|
14332 |
-
var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
|
14333 |
|
14334 |
-
|
14335 |
|
14336 |
-
|
14337 |
|
14338 |
-
|
14339 |
-
var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
|
14340 |
-
return {
|
14341 |
-
scrollableMonthMultiple: scrollableMonthMultiple + 1
|
14342 |
-
};
|
14343 |
-
});
|
14344 |
-
}
|
14345 |
|
14346 |
-
|
14347 |
-
}()
|
14348 |
-
}, {
|
14349 |
-
key: 'isHorizontal',
|
14350 |
-
value: function () {
|
14351 |
-
function isHorizontal() {
|
14352 |
-
var orientation = this.props.orientation;
|
14353 |
|
14354 |
-
|
14355 |
-
}
|
14356 |
|
14357 |
-
|
14358 |
-
}()
|
14359 |
-
}, {
|
14360 |
-
key: 'isVertical',
|
14361 |
-
value: function () {
|
14362 |
-
function isVertical() {
|
14363 |
-
var orientation = this.props.orientation;
|
14364 |
|
14365 |
-
|
14366 |
-
}
|
14367 |
|
14368 |
-
|
14369 |
-
}()
|
14370 |
-
}, {
|
14371 |
-
key: 'updateStateAfterMonthTransition',
|
14372 |
-
value: function () {
|
14373 |
-
function updateStateAfterMonthTransition() {
|
14374 |
-
var _this4 = this;
|
14375 |
|
14376 |
-
|
14377 |
-
onPrevMonthClick = _props7.onPrevMonthClick,
|
14378 |
-
onNextMonthClick = _props7.onNextMonthClick,
|
14379 |
-
numberOfMonths = _props7.numberOfMonths,
|
14380 |
-
onMonthChange = _props7.onMonthChange,
|
14381 |
-
onYearChange = _props7.onYearChange,
|
14382 |
-
isRTL = _props7.isRTL;
|
14383 |
-
var _state7 = this.state,
|
14384 |
-
currentMonth = _state7.currentMonth,
|
14385 |
-
monthTransition = _state7.monthTransition,
|
14386 |
-
focusedDate = _state7.focusedDate,
|
14387 |
-
nextFocusedDate = _state7.nextFocusedDate,
|
14388 |
-
withMouseInteractions = _state7.withMouseInteractions,
|
14389 |
-
calendarMonthWidth = _state7.calendarMonthWidth;
|
14390 |
|
|
|
14391 |
|
14392 |
-
|
14393 |
|
14394 |
-
|
14395 |
-
var firstDayOfWeek = this.getFirstDayOfWeek();
|
14396 |
-
if (monthTransition === PREV_TRANSITION) {
|
14397 |
-
newMonth.subtract(1, 'month');
|
14398 |
-
if (onPrevMonthClick) onPrevMonthClick(newMonth);
|
14399 |
-
var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
|
14400 |
-
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
|
14401 |
-
this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
|
14402 |
-
} else if (monthTransition === NEXT_TRANSITION) {
|
14403 |
-
newMonth.add(1, 'month');
|
14404 |
-
if (onNextMonthClick) onNextMonthClick(newMonth);
|
14405 |
-
var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
|
14406 |
-
var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
|
14407 |
-
this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
|
14408 |
-
} else if (monthTransition === MONTH_SELECTION_TRANSITION) {
|
14409 |
-
if (onMonthChange) onMonthChange(newMonth);
|
14410 |
-
} else if (monthTransition === YEAR_SELECTION_TRANSITION) {
|
14411 |
-
if (onYearChange) onYearChange(newMonth);
|
14412 |
-
}
|
14413 |
|
14414 |
-
|
14415 |
-
if (nextFocusedDate) {
|
14416 |
-
newFocusedDate = nextFocusedDate;
|
14417 |
-
} else if (!focusedDate && !withMouseInteractions) {
|
14418 |
-
newFocusedDate = this.getFocusedDay(newMonth);
|
14419 |
-
}
|
14420 |
|
14421 |
-
|
14422 |
-
|
14423 |
-
|
14424 |
-
|
14425 |
-
|
14426 |
-
|
14427 |
-
|
14428 |
-
|
14429 |
-
|
14430 |
-
|
14431 |
-
|
14432 |
-
|
14433 |
-
|
14434 |
-
|
14435 |
-
|
14436 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14437 |
}
|
14438 |
|
14439 |
-
return
|
14440 |
}()
|
14441 |
}, {
|
14442 |
-
key: '
|
14443 |
value: function () {
|
14444 |
-
function
|
14445 |
-
var
|
|
|
|
|
14446 |
|
14447 |
-
|
14448 |
-
|
14449 |
-
|
14450 |
-
if (!this.calendarMonthGridHeight) {
|
14451 |
-
setTimeout(function () {
|
14452 |
-
_this5.setState({ hasSetHeight: true });
|
14453 |
-
}, 0);
|
14454 |
}
|
14455 |
-
this.calendarMonthGridHeight = monthHeight;
|
14456 |
}
|
14457 |
}
|
14458 |
|
14459 |
-
return
|
14460 |
}()
|
14461 |
}, {
|
14462 |
-
key: '
|
14463 |
value: function () {
|
14464 |
-
function
|
14465 |
-
var
|
14466 |
-
daySize = _props8.daySize,
|
14467 |
-
numberOfMonths = _props8.numberOfMonths;
|
14468 |
-
var monthTitleHeight = this.state.monthTitleHeight;
|
14469 |
-
|
14470 |
-
|
14471 |
-
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
|
14472 |
-
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
14473 |
-
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
|
14474 |
|
14475 |
-
|
14476 |
-
this.adjustDayPickerHeight(newMonthHeight);
|
14477 |
-
}
|
14478 |
}
|
14479 |
|
14480 |
-
return
|
14481 |
}()
|
14482 |
}, {
|
14483 |
-
key: '
|
14484 |
value: function () {
|
14485 |
-
function
|
14486 |
-
this.
|
14487 |
-
|
14488 |
-
|
14489 |
-
});
|
14490 |
}
|
14491 |
|
14492 |
-
return
|
14493 |
}()
|
14494 |
}, {
|
14495 |
-
key: '
|
14496 |
value: function () {
|
14497 |
-
function
|
14498 |
-
var
|
14499 |
-
|
14500 |
-
|
14501 |
-
if (onKeyboardShortcutsPanelClose) {
|
14502 |
-
onKeyboardShortcutsPanelClose();
|
14503 |
-
}
|
14504 |
|
14505 |
-
|
14506 |
-
onKeyboardShortcutsPanelClose: null,
|
14507 |
-
showKeyboardShortcuts: false
|
14508 |
-
});
|
14509 |
}
|
14510 |
|
14511 |
-
return
|
14512 |
}()
|
14513 |
}, {
|
14514 |
-
key: '
|
14515 |
value: function () {
|
14516 |
-
function
|
14517 |
-
var
|
14518 |
-
|
14519 |
-
var _props9 = this.props,
|
14520 |
-
navPrev = _props9.navPrev,
|
14521 |
-
navNext = _props9.navNext,
|
14522 |
-
noNavButtons = _props9.noNavButtons,
|
14523 |
-
orientation = _props9.orientation,
|
14524 |
-
phrases = _props9.phrases,
|
14525 |
-
isRTL = _props9.isRTL;
|
14526 |
-
|
14527 |
-
|
14528 |
-
if (noNavButtons) {
|
14529 |
-
return null;
|
14530 |
-
}
|
14531 |
-
|
14532 |
-
var onNextMonthClick = void 0;
|
14533 |
-
if (orientation === _constants.VERTICAL_SCROLLABLE) {
|
14534 |
-
onNextMonthClick = this.multiplyScrollableMonths;
|
14535 |
-
} else {
|
14536 |
-
onNextMonthClick = function () {
|
14537 |
-
function onNextMonthClick(e) {
|
14538 |
-
_this6.onNextMonthClick(null, e);
|
14539 |
-
}
|
14540 |
|
14541 |
-
|
14542 |
-
|
14543 |
}
|
|
|
14544 |
|
14545 |
-
|
14546 |
-
|
14547 |
-
|
14548 |
-
|
14549 |
-
|
14550 |
-
|
14551 |
-
|
14552 |
-
}(),
|
14553 |
-
onNextMonthClick: onNextMonthClick,
|
14554 |
-
navPrev: navPrev,
|
14555 |
-
navNext: navNext,
|
14556 |
-
orientation: orientation,
|
14557 |
-
phrases: phrases,
|
14558 |
-
isRTL: isRTL
|
14559 |
-
});
|
14560 |
}
|
14561 |
|
14562 |
-
return
|
14563 |
}()
|
14564 |
}, {
|
14565 |
-
key: '
|
14566 |
value: function () {
|
14567 |
-
function
|
14568 |
-
var
|
14569 |
-
daySize = _props10.daySize,
|
14570 |
-
horizontalMonthPadding = _props10.horizontalMonthPadding,
|
14571 |
-
orientation = _props10.orientation,
|
14572 |
-
weekDayFormat = _props10.weekDayFormat,
|
14573 |
-
styles = _props10.styles;
|
14574 |
-
var calendarMonthWidth = this.state.calendarMonthWidth;
|
14575 |
|
14576 |
-
var
|
14577 |
-
|
14578 |
-
|
14579 |
-
|
14580 |
-
|
14581 |
-
|
14582 |
-
|
|
|
|
|
|
|
14583 |
|
14584 |
-
var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
|
14585 |
-
if (this.isHorizontal()) {
|
14586 |
-
weekHeaderStyle = horizontalStyle;
|
14587 |
-
} else if (this.isVertical() && !verticalScrollable) {
|
14588 |
-
weekHeaderStyle = verticalStyle;
|
14589 |
-
}
|
14590 |
|
14591 |
-
|
14592 |
|
14593 |
-
var
|
14594 |
-
|
14595 |
-
|
14596 |
-
|
14597 |
-
|
14598 |
-
|
14599 |
-
|
14600 |
-
null,
|
14601 |
-
(0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
|
14602 |
-
)
|
14603 |
-
));
|
14604 |
-
}
|
14605 |
|
14606 |
return _react2['default'].createElement(
|
14607 |
-
'
|
14608 |
-
_extends({}, (0, _reactWithStyles.css)(styles.
|
14609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14610 |
}),
|
14611 |
-
|
14612 |
-
'ul',
|
14613 |
-
(0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
|
14614 |
-
header
|
14615 |
-
)
|
14616 |
);
|
14617 |
}
|
14618 |
|
14619 |
-
return
|
14620 |
}()
|
14621 |
-
}
|
14622 |
-
key: 'render',
|
14623 |
-
value: function () {
|
14624 |
-
function render() {
|
14625 |
-
var _this7 = this;
|
14626 |
|
14627 |
-
|
14628 |
-
|
14629 |
-
currentMonth = _state8.currentMonth,
|
14630 |
-
monthTransition = _state8.monthTransition,
|
14631 |
-
translationValue = _state8.translationValue,
|
14632 |
-
scrollableMonthMultiple = _state8.scrollableMonthMultiple,
|
14633 |
-
focusedDate = _state8.focusedDate,
|
14634 |
-
showKeyboardShortcuts = _state8.showKeyboardShortcuts,
|
14635 |
-
isTouch = _state8.isTouchDevice,
|
14636 |
-
hasSetHeight = _state8.hasSetHeight,
|
14637 |
-
calendarInfoWidth = _state8.calendarInfoWidth,
|
14638 |
-
monthTitleHeight = _state8.monthTitleHeight;
|
14639 |
-
var _props11 = this.props,
|
14640 |
-
enableOutsideDays = _props11.enableOutsideDays,
|
14641 |
-
numberOfMonths = _props11.numberOfMonths,
|
14642 |
-
orientation = _props11.orientation,
|
14643 |
-
modifiers = _props11.modifiers,
|
14644 |
-
withPortal = _props11.withPortal,
|
14645 |
-
onDayClick = _props11.onDayClick,
|
14646 |
-
onDayMouseEnter = _props11.onDayMouseEnter,
|
14647 |
-
onDayMouseLeave = _props11.onDayMouseLeave,
|
14648 |
-
firstDayOfWeek = _props11.firstDayOfWeek,
|
14649 |
-
renderMonthText = _props11.renderMonthText,
|
14650 |
-
renderCalendarDay = _props11.renderCalendarDay,
|
14651 |
-
renderDayContents = _props11.renderDayContents,
|
14652 |
-
renderCalendarInfo = _props11.renderCalendarInfo,
|
14653 |
-
renderMonthElement = _props11.renderMonthElement,
|
14654 |
-
calendarInfoPosition = _props11.calendarInfoPosition,
|
14655 |
-
hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
|
14656 |
-
onOutsideClick = _props11.onOutsideClick,
|
14657 |
-
monthFormat = _props11.monthFormat,
|
14658 |
-
daySize = _props11.daySize,
|
14659 |
-
isFocused = _props11.isFocused,
|
14660 |
-
isRTL = _props11.isRTL,
|
14661 |
-
styles = _props11.styles,
|
14662 |
-
theme = _props11.theme,
|
14663 |
-
phrases = _props11.phrases,
|
14664 |
-
verticalHeight = _props11.verticalHeight,
|
14665 |
-
dayAriaLabelFormat = _props11.dayAriaLabelFormat,
|
14666 |
-
noBorder = _props11.noBorder,
|
14667 |
-
transitionDuration = _props11.transitionDuration,
|
14668 |
-
verticalBorderSpacing = _props11.verticalBorderSpacing,
|
14669 |
-
horizontalMonthPadding = _props11.horizontalMonthPadding;
|
14670 |
-
var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
|
14671 |
|
|
|
|
|
14672 |
|
14673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14674 |
|
14675 |
-
|
14676 |
-
|
14677 |
-
|
14678 |
-
|
14679 |
-
}
|
14680 |
|
14681 |
-
|
14682 |
-
|
14683 |
-
|
14684 |
-
height = this.calendarMonthGridHeight;
|
14685 |
-
} else if (this.isVertical() && !verticalScrollable && !withPortal) {
|
14686 |
-
// If the user doesn't set a desired height,
|
14687 |
-
// we default back to this kind of made-up value that generally looks good
|
14688 |
-
height = verticalHeight || 1.75 * calendarMonthWidth;
|
14689 |
-
}
|
14690 |
|
14691 |
-
|
|
|
|
|
|
|
14692 |
|
14693 |
-
|
|
|
|
|
|
|
|
|
|
|
14694 |
|
14695 |
-
|
14696 |
-
|
14697 |
-
|
14698 |
-
|
|
|
14699 |
|
14700 |
-
|
|
|
|
|
|
|
14701 |
|
14702 |
-
|
14703 |
-
|
14704 |
-
|
14705 |
-
|
14706 |
-
var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
|
14707 |
|
14708 |
-
|
14709 |
-
|
14710 |
-
|
14711 |
-
|
14712 |
-
}, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
|
14713 |
-
renderCalendarInfo()
|
14714 |
-
);
|
14715 |
|
14716 |
-
|
|
|
|
|
|
|
14717 |
|
14718 |
-
|
14719 |
-
|
14720 |
-
|
14721 |
-
|
|
|
14722 |
|
14723 |
-
|
14724 |
-
|
14725 |
-
|
14726 |
-
};
|
14727 |
|
14728 |
-
|
14729 |
-
|
14730 |
-
|
|
|
14731 |
|
14732 |
-
|
14733 |
-
|
|
|
|
|
|
|
14734 |
|
14735 |
-
|
14736 |
-
|
14737 |
-
|
14738 |
-
|
14739 |
|
14740 |
-
|
14741 |
-
|
14742 |
-
|
14743 |
-
|
14744 |
-
|
14745 |
-
}, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
|
14746 |
-
_react2['default'].createElement(
|
14747 |
-
_reactOutsideClickHandler2['default'],
|
14748 |
-
{ onOutsideClick: onOutsideClick },
|
14749 |
-
(calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
|
14750 |
-
_react2['default'].createElement(
|
14751 |
-
'div',
|
14752 |
-
(0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
|
14753 |
-
_react2['default'].createElement(
|
14754 |
-
'div',
|
14755 |
-
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
|
14756 |
-
'aria-hidden': 'true',
|
14757 |
-
role: 'presentation'
|
14758 |
-
}),
|
14759 |
-
weekHeaders
|
14760 |
-
),
|
14761 |
-
_react2['default'].createElement(
|
14762 |
-
'div',
|
14763 |
-
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
|
14764 |
-
ref: this.setContainerRef,
|
14765 |
-
onClick: function () {
|
14766 |
-
function onClick(e) {
|
14767 |
-
e.stopPropagation();
|
14768 |
-
}
|
14769 |
-
|
14770 |
-
return onClick;
|
14771 |
-
}(),
|
14772 |
-
onKeyDown: this.onKeyDown,
|
14773 |
-
onMouseUp: function () {
|
14774 |
-
function onMouseUp() {
|
14775 |
-
_this7.setState({ withMouseInteractions: true });
|
14776 |
-
}
|
14777 |
|
14778 |
-
|
14779 |
-
|
14780 |
-
|
14781 |
-
|
14782 |
-
}),
|
14783 |
-
!verticalScrollable && this.renderNavigation(),
|
14784 |
-
_react2['default'].createElement(
|
14785 |
-
'div',
|
14786 |
-
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
|
14787 |
-
ref: this.setTransitionContainerRef
|
14788 |
-
}),
|
14789 |
-
_react2['default'].createElement(_CalendarMonthGrid2['default'], {
|
14790 |
-
setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
|
14791 |
-
translationValue: translationValue,
|
14792 |
-
enableOutsideDays: enableOutsideDays,
|
14793 |
-
firstVisibleMonthIndex: firstVisibleMonthIndex,
|
14794 |
-
initialMonth: currentMonth,
|
14795 |
-
isAnimating: isCalendarMonthGridAnimating,
|
14796 |
-
modifiers: modifiers,
|
14797 |
-
orientation: orientation,
|
14798 |
-
numberOfMonths: numberOfMonths * scrollableMonthMultiple,
|
14799 |
-
onDayClick: onDayClick,
|
14800 |
-
onDayMouseEnter: onDayMouseEnter,
|
14801 |
-
onDayMouseLeave: onDayMouseLeave,
|
14802 |
-
onMonthChange: this.onMonthChange,
|
14803 |
-
onYearChange: this.onYearChange,
|
14804 |
-
renderMonthText: renderMonthText,
|
14805 |
-
renderCalendarDay: renderCalendarDay,
|
14806 |
-
renderDayContents: renderDayContents,
|
14807 |
-
renderMonthElement: renderMonthElement,
|
14808 |
-
onMonthTransitionEnd: this.updateStateAfterMonthTransition,
|
14809 |
-
monthFormat: monthFormat,
|
14810 |
-
daySize: daySize,
|
14811 |
-
firstDayOfWeek: firstDayOfWeek,
|
14812 |
-
isFocused: shouldFocusDate,
|
14813 |
-
focusedDate: focusedDate,
|
14814 |
-
phrases: phrases,
|
14815 |
-
isRTL: isRTL,
|
14816 |
-
dayAriaLabelFormat: dayAriaLabelFormat,
|
14817 |
-
transitionDuration: transitionDuration,
|
14818 |
-
verticalBorderSpacing: verticalBorderSpacing,
|
14819 |
-
horizontalMonthPadding: horizontalMonthPadding
|
14820 |
-
}),
|
14821 |
-
verticalScrollable && this.renderNavigation()
|
14822 |
-
),
|
14823 |
-
!isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
|
14824 |
-
block: this.isVertical() && !withPortal,
|
14825 |
-
buttonLocation: keyboardShortcutButtonLocation,
|
14826 |
-
showKeyboardShortcutsPanel: showKeyboardShortcuts,
|
14827 |
-
openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
|
14828 |
-
closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
|
14829 |
-
phrases: phrases
|
14830 |
-
})
|
14831 |
-
)
|
14832 |
-
),
|
14833 |
-
(calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
|
14834 |
-
)
|
14835 |
-
);
|
14836 |
}
|
|
|
14837 |
|
14838 |
-
|
14839 |
-
|
14840 |
-
|
14841 |
|
14842 |
-
|
14843 |
-
|
|
|
|
|
14844 |
|
14845 |
-
|
14846 |
-
|
|
|
|
|
|
|
14847 |
|
14848 |
-
|
14849 |
-
|
14850 |
-
|
14851 |
-
|
14852 |
-
|
14853 |
-
noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
|
14854 |
-
spacing = _ref2$reactDates.spacing,
|
14855 |
-
zIndex = _ref2$reactDates.zIndex;
|
14856 |
-
return {
|
14857 |
-
DayPicker: {
|
14858 |
-
background: color.background,
|
14859 |
-
position: 'relative',
|
14860 |
-
textAlign: 'left'
|
14861 |
},
|
14862 |
|
14863 |
-
|
14864 |
-
background: color.
|
14865 |
-
|
|
|
14866 |
|
14867 |
-
|
14868 |
-
|
14869 |
-
|
|
|
|
|
14870 |
|
14871 |
-
|
14872 |
-
|
|
|
|
|
|
|
14873 |
},
|
14874 |
|
14875 |
-
|
14876 |
-
|
14877 |
-
|
14878 |
-
|
14879 |
|
14880 |
-
|
14881 |
-
|
14882 |
-
|
14883 |
-
|
14884 |
-
|
14885 |
-
},
|
14886 |
|
14887 |
-
|
14888 |
-
|
|
|
|
|
|
|
14889 |
},
|
14890 |
|
14891 |
-
|
14892 |
-
|
14893 |
-
|
|
|
14894 |
|
14895 |
-
|
14896 |
-
|
14897 |
-
|
14898 |
-
|
|
|
14899 |
|
14900 |
-
|
14901 |
-
|
14902 |
-
|
|
|
|
|
14903 |
},
|
14904 |
|
14905 |
-
|
14906 |
-
|
14907 |
-
},
|
|
|
|
|
|
|
|
|
14908 |
|
14909 |
-
|
14910 |
-
|
14911 |
-
|
14912 |
|
14913 |
-
|
14914 |
-
color: color.placeholderText,
|
14915 |
-
position: 'absolute',
|
14916 |
-
top: 62,
|
14917 |
-
zIndex: zIndex + 2,
|
14918 |
-
textAlign: 'left'
|
14919 |
-
},
|
14920 |
|
14921 |
-
DayPicker_weekHeader__vertical: {
|
14922 |
-
left: '50%'
|
14923 |
-
},
|
14924 |
|
14925 |
-
|
14926 |
-
|
14927 |
-
|
14928 |
-
|
14929 |
-
background: color.background,
|
14930 |
-
marginLeft: 0,
|
14931 |
-
left: 0,
|
14932 |
-
width: '100%',
|
14933 |
-
textAlign: 'center'
|
14934 |
-
},
|
14935 |
|
14936 |
-
|
14937 |
-
listStyle: 'none',
|
14938 |
-
margin: '1px 0',
|
14939 |
-
paddingLeft: 0,
|
14940 |
-
paddingRight: 0,
|
14941 |
-
fontSize: font.size
|
14942 |
-
},
|
14943 |
|
14944 |
-
|
14945 |
-
display: 'inline-block',
|
14946 |
-
textAlign: 'center'
|
14947 |
-
},
|
14948 |
|
14949 |
-
|
14950 |
-
position: 'relative',
|
14951 |
-
overflow: 'hidden',
|
14952 |
-
borderRadius: 3
|
14953 |
-
},
|
14954 |
|
14955 |
-
|
14956 |
-
transition: 'height 0.2s ease-in-out'
|
14957 |
-
},
|
14958 |
|
14959 |
-
|
14960 |
-
width: '100%'
|
14961 |
-
},
|
14962 |
|
14963 |
-
|
14964 |
-
paddingTop: 20,
|
14965 |
-
height: '100%',
|
14966 |
-
position: 'absolute',
|
14967 |
-
top: 0,
|
14968 |
-
bottom: 0,
|
14969 |
-
right: 0,
|
14970 |
-
left: 0,
|
14971 |
-
overflowY: 'scroll'
|
14972 |
-
}, noScrollBarOnVerticalScrollable && {
|
14973 |
-
'-webkitOverflowScrolling': 'touch',
|
14974 |
-
'::-webkit-scrollbar': {
|
14975 |
-
'-webkit-appearance': 'none',
|
14976 |
-
display: 'none'
|
14977 |
-
}
|
14978 |
-
})
|
14979 |
-
};
|
14980 |
-
})(DayPicker);
|
14981 |
|
14982 |
-
|
14983 |
-
/* 105 */
|
14984 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
14985 |
|
14986 |
-
|
14987 |
-
/* unused harmony export isURL */
|
14988 |
-
/* unused harmony export getProtocol */
|
14989 |
-
/* unused harmony export isValidProtocol */
|
14990 |
-
/* unused harmony export getAuthority */
|
14991 |
-
/* unused harmony export isValidAuthority */
|
14992 |
-
/* unused harmony export getPath */
|
14993 |
-
/* unused harmony export isValidPath */
|
14994 |
-
/* unused harmony export getQueryString */
|
14995 |
-
/* unused harmony export isValidQueryString */
|
14996 |
-
/* unused harmony export getFragment */
|
14997 |
-
/* unused harmony export isValidFragment */
|
14998 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = addQueryArgs;
|
14999 |
-
/* unused harmony export getQueryArg */
|
15000 |
-
/* harmony export (immutable) */ __webpack_exports__["b"] = hasQueryArg;
|
15001 |
-
/* unused harmony export removeQueryArgs */
|
15002 |
-
/* unused harmony export prependHTTP */
|
15003 |
-
/* unused harmony export safeDecodeURI */
|
15004 |
-
/* unused harmony export filterURLForDisplay */
|
15005 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_qs__ = __webpack_require__(624);
|
15006 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_qs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_qs__);
|
15007 |
-
/**
|
15008 |
-
* External dependencies
|
15009 |
-
*/
|
15010 |
|
15011 |
-
|
15012 |
-
var EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
|
15013 |
-
var USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
|
15014 |
-
/**
|
15015 |
-
* Determines whether the given string looks like a URL.
|
15016 |
-
*
|
15017 |
-
* @param {string} url The string to scrutinise.
|
15018 |
-
*
|
15019 |
-
* @return {boolean} Whether or not it looks like a URL.
|
15020 |
-
*/
|
15021 |
|
15022 |
-
function
|
15023 |
-
return URL_REGEXP.test(url);
|
15024 |
-
}
|
15025 |
-
/**
|
15026 |
-
* Returns the protocol part of the URL.
|
15027 |
-
*
|
15028 |
-
* @param {string} url The full URL.
|
15029 |
-
*
|
15030 |
-
* @return {?string} The protocol part of the URL.
|
15031 |
-
*/
|
15032 |
|
15033 |
-
function
|
15034 |
-
var matches = /^([^\s:]+:)/.exec(url);
|
15035 |
|
15036 |
-
|
15037 |
-
return matches[1];
|
15038 |
-
}
|
15039 |
-
}
|
15040 |
-
/**
|
15041 |
-
* Tests if a url protocol is valid.
|
15042 |
-
*
|
15043 |
-
* @param {string} protocol The url protocol.
|
15044 |
-
*
|
15045 |
-
* @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).
|
15046 |
-
*/
|
15047 |
|
15048 |
-
function
|
15049 |
-
|
15050 |
-
|
|
|
|
|
|
|
|
|
15051 |
}
|
15052 |
|
15053 |
-
return
|
15054 |
}
|
15055 |
-
/**
|
15056 |
-
* Returns the authority part of the URL.
|
15057 |
-
*
|
15058 |
-
* @param {string} url The full URL.
|
15059 |
-
*
|
15060 |
-
* @return {?string} The authority part of the URL.
|
15061 |
-
*/
|
15062 |
|
15063 |
-
function
|
15064 |
-
var
|
15065 |
|
15066 |
-
if (
|
15067 |
-
return
|
15068 |
}
|
15069 |
-
}
|
15070 |
-
/**
|
15071 |
-
* Checks for invalid characters within the provided authority.
|
15072 |
-
*
|
15073 |
-
* @param {string} authority A string containing the URL authority.
|
15074 |
-
*
|
15075 |
-
* @return {boolean} True if the argument contains a valid authority.
|
15076 |
-
*/
|
15077 |
|
15078 |
-
|
15079 |
-
|
15080 |
-
return false;
|
15081 |
}
|
15082 |
|
15083 |
-
return
|
15084 |
}
|
15085 |
-
/**
|
15086 |
-
* Returns the path part of the URL.
|
15087 |
-
*
|
15088 |
-
* @param {string} url The full URL.
|
15089 |
-
*
|
15090 |
-
* @return {?string} The path part of the URL.
|
15091 |
-
*/
|
15092 |
|
15093 |
-
function
|
15094 |
-
var
|
|
|
15095 |
|
15096 |
-
if (
|
15097 |
-
return
|
15098 |
}
|
15099 |
-
}
|
15100 |
-
/**
|
15101 |
-
* Checks for invalid characters within the provided path.
|
15102 |
-
*
|
15103 |
-
* @param {string} path The URL path.
|
15104 |
-
*
|
15105 |
-
* @return {boolean} True if the argument contains a valid path
|
15106 |
-
*/
|
15107 |
|
15108 |
-
|
15109 |
-
|
15110 |
-
return false;
|
15111 |
}
|
15112 |
|
15113 |
-
return
|
15114 |
}
|
15115 |
-
/**
|
15116 |
-
* Returns the query string part of the URL.
|
15117 |
-
*
|
15118 |
-
* @param {string} url The full URL.
|
15119 |
-
*
|
15120 |
-
* @return {?string} The query string part of the URL.
|
15121 |
-
*/
|
15122 |
|
15123 |
-
function
|
15124 |
-
var
|
|
|
15125 |
|
15126 |
-
if (
|
15127 |
-
return
|
15128 |
}
|
15129 |
-
}
|
15130 |
-
/**
|
15131 |
-
* Checks for invalid characters within the provided query string.
|
15132 |
-
*
|
15133 |
-
* @param {string} queryString The query string.
|
15134 |
-
*
|
15135 |
-
* @return {boolean} True if the argument contains a valid query string.
|
15136 |
-
*/
|
15137 |
|
15138 |
-
|
15139 |
-
|
15140 |
-
return false;
|
15141 |
}
|
15142 |
|
15143 |
-
return
|
15144 |
}
|
15145 |
-
/**
|
15146 |
-
* Returns the fragment part of the URL.
|
15147 |
-
*
|
15148 |
-
* @param {string} url The full URL
|
15149 |
-
*
|
15150 |
-
* @return {?string} The fragment part of the URL.
|
15151 |
-
*/
|
15152 |
|
15153 |
-
function
|
15154 |
-
var
|
|
|
15155 |
|
15156 |
-
if (
|
15157 |
-
return
|
15158 |
}
|
15159 |
-
}
|
15160 |
-
/**
|
15161 |
-
* Checks for invalid characters within the provided fragment.
|
15162 |
-
*
|
15163 |
-
* @param {string} fragment The url fragment.
|
15164 |
-
*
|
15165 |
-
* @return {boolean} True if the argument contains a valid fragment.
|
15166 |
-
*/
|
15167 |
|
15168 |
-
|
15169 |
-
|
15170 |
-
return false;
|
15171 |
}
|
15172 |
|
15173 |
-
return
|
15174 |
}
|
15175 |
-
/**
|
15176 |
-
* Appends arguments as querystring to the provided URL. If the URL already
|
15177 |
-
* includes query arguments, the arguments are merged with (and take precedent
|
15178 |
-
* over) the existing set.
|
15179 |
-
*
|
15180 |
-
* @param {?string} url URL to which arguments should be appended. If omitted,
|
15181 |
-
* only the resulting querystring is returned.
|
15182 |
-
* @param {Object} args Query arguments to apply to URL.
|
15183 |
-
*
|
15184 |
-
* @return {string} URL with arguments applied.
|
15185 |
-
*/
|
15186 |
-
|
15187 |
-
function addQueryArgs() {
|
15188 |
-
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
15189 |
-
var args = arguments.length > 1 ? arguments[1] : undefined;
|
15190 |
-
var baseUrl = url; // Determine whether URL already had query arguments.
|
15191 |
|
15192 |
-
|
|
|
|
|
15193 |
|
15194 |
-
if (
|
15195 |
-
|
15196 |
-
|
15197 |
|
15198 |
-
|
|
|
15199 |
}
|
15200 |
|
15201 |
-
return
|
15202 |
}
|
15203 |
-
/**
|
15204 |
-
* Returns a single query argument of the url
|
15205 |
-
*
|
15206 |
-
* @param {string} url URL
|
15207 |
-
* @param {string} arg Query arg name
|
15208 |
-
*
|
15209 |
-
* @return {Array|string} Query arg value.
|
15210 |
-
*/
|
15211 |
|
15212 |
-
function
|
15213 |
-
var
|
15214 |
-
|
15215 |
-
return query[arg];
|
15216 |
}
|
15217 |
-
/**
|
15218 |
-
* Determines whether the URL contains a given query arg.
|
15219 |
-
*
|
15220 |
-
* @param {string} url URL
|
15221 |
-
* @param {string} arg Query arg name
|
15222 |
-
*
|
15223 |
-
* @return {boolean} Whether or not the URL contains the query aeg.
|
15224 |
-
*/
|
15225 |
|
15226 |
-
function
|
15227 |
-
return
|
15228 |
-
|
15229 |
-
|
15230 |
-
|
15231 |
-
*
|
15232 |
-
* @param {string} url URL
|
15233 |
-
* @param {...string} args Query Args
|
15234 |
-
*
|
15235 |
-
* @return {string} Updated URL
|
15236 |
-
*/
|
15237 |
|
15238 |
-
function
|
15239 |
-
|
15240 |
-
|
15241 |
-
|
|
|
|
|
15242 |
|
15243 |
-
|
15244 |
-
|
15245 |
-
|
|
|
|
|
15246 |
|
15247 |
-
|
15248 |
-
return
|
15249 |
-
});
|
15250 |
-
return baseUrl + '?' + Object(__WEBPACK_IMPORTED_MODULE_0_qs__["stringify"])(query);
|
15251 |
}
|
15252 |
-
/**
|
15253 |
-
* Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
|
15254 |
-
*
|
15255 |
-
* @param {string} url The URL to test
|
15256 |
-
*
|
15257 |
-
* @return {string} The updated URL
|
15258 |
-
*/
|
15259 |
|
15260 |
-
|
15261 |
-
|
15262 |
-
|
15263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15264 |
|
15265 |
-
|
|
|
|
|
|
|
15266 |
}
|
15267 |
-
/**
|
15268 |
-
* Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
|
15269 |
-
* `decodeURI` throws an error.
|
15270 |
-
*
|
15271 |
-
* @param {string} uri URI to decode.
|
15272 |
-
*
|
15273 |
-
* @return {string} Decoded URI if possible.
|
15274 |
-
*/
|
15275 |
|
15276 |
-
|
15277 |
-
try {
|
15278 |
-
return decodeURI(uri);
|
15279 |
-
} catch (uriError) {
|
15280 |
-
return uri;
|
15281 |
-
}
|
15282 |
-
}
|
15283 |
-
/**
|
15284 |
-
* Returns a URL for display.
|
15285 |
-
*
|
15286 |
-
* @param {string} url Original URL.
|
15287 |
-
*
|
15288 |
-
* @return {string} Displayed URL.
|
15289 |
-
*/
|
15290 |
|
15291 |
-
function
|
15292 |
-
|
15293 |
-
|
|
|
15294 |
|
15295 |
-
if (
|
15296 |
-
|
15297 |
}
|
15298 |
|
15299 |
-
|
15300 |
-
}
|
15301 |
-
//# sourceMappingURL=index.js.map
|
15302 |
-
|
15303 |
-
/***/ }),
|
15304 |
-
/* 106 */
|
15305 |
-
/***/ (function(module, exports, __webpack_require__) {
|
15306 |
-
|
15307 |
-
"use strict";
|
15308 |
-
/* WEBPACK VAR INJECTION */(function(process) {
|
15309 |
|
15310 |
-
|
15311 |
-
|
15312 |
-
} else {
|
15313 |
-
module.exports = __webpack_require__(366);
|
15314 |
-
}
|
15315 |
|
15316 |
-
|
|
|
|
|
15317 |
|
15318 |
-
|
15319 |
-
|
15320 |
-
|
15321 |
|
15322 |
-
|
15323 |
-
/* unused harmony export escapeAmpersand */
|
15324 |
-
/* unused harmony export escapeQuotationMark */
|
15325 |
-
/* unused harmony export escapeLessThan */
|
15326 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = escapeAttribute;
|
15327 |
-
/* harmony export (immutable) */ __webpack_exports__["b"] = escapeHTML;
|
15328 |
-
/* harmony export (immutable) */ __webpack_exports__["c"] = isValidAttributeName;
|
15329 |
-
/**
|
15330 |
-
* Regular expression matching invalid attribute names.
|
15331 |
-
*
|
15332 |
-
* "Attribute names must consist of one or more characters other than controls,
|
15333 |
-
* U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),
|
15334 |
-
* and noncharacters."
|
15335 |
-
*
|
15336 |
-
* @link https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
15337 |
-
*
|
15338 |
-
* @type {RegExp}
|
15339 |
-
*/
|
15340 |
-
var REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
|
15341 |
-
/**
|
15342 |
-
* Returns a string with ampersands escaped. Note that this is an imperfect
|
15343 |
-
* implementation, where only ampersands which do not appear as a pattern of
|
15344 |
-
* named, decimal, or hexadecimal character references are escaped. Invalid
|
15345 |
-
* named references (i.e. ambiguous ampersand) are are still permitted.
|
15346 |
-
*
|
15347 |
-
* @link https://w3c.github.io/html/syntax.html#character-references
|
15348 |
-
* @link https://w3c.github.io/html/syntax.html#ambiguous-ampersand
|
15349 |
-
* @link https://w3c.github.io/html/syntax.html#named-character-references
|
15350 |
-
*
|
15351 |
-
* @param {string} value Original string.
|
15352 |
-
*
|
15353 |
-
* @return {string} Escaped string.
|
15354 |
-
*/
|
15355 |
|
15356 |
-
|
15357 |
-
|
15358 |
-
}
|
15359 |
-
/**
|
15360 |
-
* Returns a string with quotation marks replaced.
|
15361 |
-
*
|
15362 |
-
* @param {string} value Original string.
|
15363 |
-
*
|
15364 |
-
* @return {string} Escaped string.
|
15365 |
-
*/
|
15366 |
|
15367 |
-
|
15368 |
-
return value.replace(/"/g, '"');
|
15369 |
-
}
|
15370 |
-
/**
|
15371 |
-
* Returns a string with less-than sign replaced.
|
15372 |
-
*
|
15373 |
-
* @param {string} value Original string.
|
15374 |
-
*
|
15375 |
-
* @return {string} Escaped string.
|
15376 |
-
*/
|
15377 |
|
15378 |
-
|
15379 |
-
|
15380 |
-
}
|
15381 |
-
/**
|
15382 |
-
* Returns an escaped attribute value.
|
15383 |
-
*
|
15384 |
-
* @link https://w3c.github.io/html/syntax.html#elements-attributes
|
15385 |
-
*
|
15386 |
-
* "[...] the text cannot contain an ambiguous ampersand [...] must not contain
|
15387 |
-
* any literal U+0022 QUOTATION MARK characters (")"
|
15388 |
-
*
|
15389 |
-
* @param {string} value Attribute value.
|
15390 |
-
*
|
15391 |
-
* @return {string} Escaped attribute value.
|
15392 |
-
*/
|
15393 |
|
15394 |
-
|
15395 |
-
|
15396 |
-
}
|
15397 |
-
/**
|
15398 |
-
* Returns an escaped HTML element value.
|
15399 |
-
*
|
15400 |
-
* @link https://w3c.github.io/html/syntax.html#writing-html-documents-elements
|
15401 |
-
*
|
15402 |
-
* "the text must not contain the character U+003C LESS-THAN SIGN (<) or an
|
15403 |
-
* ambiguous ampersand."
|
15404 |
-
*
|
15405 |
-
* @param {string} value Element value.
|
15406 |
-
*
|
15407 |
-
* @return {string} Escaped HTML element value.
|
15408 |
-
*/
|
15409 |
|
15410 |
-
|
15411 |
-
|
15412 |
-
}
|
15413 |
-
/**
|
15414 |
-
* Returns true if the given attribute name is valid, or false otherwise.
|
15415 |
-
*
|
15416 |
-
* @param {string} name Attribute name to test.
|
15417 |
-
*
|
15418 |
-
* @return {boolean} Whether attribute is valid.
|
15419 |
-
*/
|
15420 |
|
15421 |
-
function
|
15422 |
-
|
15423 |
-
}
|
15424 |
-
//# sourceMappingURL=index.js.map
|
15425 |
|
15426 |
-
|
15427 |
-
|
15428 |
-
|
15429 |
|
15430 |
-
|
15431 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
|
15432 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(16);
|
15433 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(13);
|
15434 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(79);
|
15435 |
|
|
|
|
|
|
|
15436 |
|
|
|
15437 |
|
15438 |
-
|
15439 |
-
|
15440 |
-
|
15441 |
|
15442 |
-
|
15443 |
-
|
15444 |
-
|
15445 |
-
* To preserve additional props, a `div` wrapper _will_ be created if any props
|
15446 |
-
* aside from `children` are passed.
|
15447 |
-
*
|
15448 |
-
* @param {string} props.children HTML to render.
|
15449 |
-
*
|
15450 |
-
* @return {WPElement} Dangerously-rendering element.
|
15451 |
-
*/
|
15452 |
|
15453 |
-
|
15454 |
-
|
15455 |
-
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
|
15456 |
|
15457 |
-
|
15458 |
-
// non-children props present.
|
15459 |
-
return Object(__WEBPACK_IMPORTED_MODULE_2__react__["h" /* createElement */])('div', Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({
|
15460 |
-
dangerouslySetInnerHTML: {
|
15461 |
-
__html: children
|
15462 |
-
}
|
15463 |
-
}, props));
|
15464 |
}
|
15465 |
-
//# sourceMappingURL=
|
15466 |
|
15467 |
/***/ }),
|
15468 |
-
/*
|
15469 |
/***/ (function(module, exports, __webpack_require__) {
|
15470 |
|
15471 |
-
|
15472 |
-
var size = 0,
|
15473 |
-
maxSize, head, tail;
|
15474 |
|
15475 |
-
if ( options && options.maxSize ) {
|
15476 |
-
maxSize = options.maxSize;
|
15477 |
-
}
|
15478 |
|
15479 |
-
|
15480 |
-
|
15481 |
-
|
15482 |
-
|
15483 |
|
15484 |
-
|
15485 |
-
// Perform a shallow equality test to confirm that whether the node
|
15486 |
-
// under test is a candidate for the arguments passed. Two arrays
|
15487 |
-
// are shallowly equal if their length matches and each entry is
|
15488 |
-
// strictly equal between the two sets. Avoid abstracting to a
|
15489 |
-
// function which could incur an arguments leaking deoptimization.
|
15490 |
|
15491 |
-
|
15492 |
-
if ( node.args.length !== arguments.length ) {
|
15493 |
-
node = node.next;
|
15494 |
-
continue;
|
15495 |
-
}
|
15496 |
|
15497 |
-
|
15498 |
-
for ( i = 0; i < len; i++ ) {
|
15499 |
-
if ( node.args[ i ] !== arguments[ i ] ) {
|
15500 |
-
node = node.next;
|
15501 |
-
continue searchCache;
|
15502 |
-
}
|
15503 |
-
}
|
15504 |
|
15505 |
-
|
|
|
|
|
|
|
15506 |
|
15507 |
-
|
15508 |
-
|
15509 |
-
// As tail, shift to previous. Must only shift if not also
|
15510 |
-
// head, since if both head and tail, there is no previous.
|
15511 |
-
if ( node === tail ) {
|
15512 |
-
tail = node.prev;
|
15513 |
-
}
|
15514 |
|
15515 |
-
|
15516 |
-
|
15517 |
-
|
15518 |
-
|
15519 |
-
node.next.prev = node.prev;
|
15520 |
-
}
|
15521 |
|
15522 |
-
node.next = head;
|
15523 |
-
node.prev = null;
|
15524 |
-
head.prev = node;
|
15525 |
-
head = node;
|
15526 |
-
}
|
15527 |
|
15528 |
-
|
15529 |
-
|
15530 |
-
|
15531 |
|
15532 |
-
|
|
|
15533 |
|
15534 |
-
|
15535 |
-
|
15536 |
-
for ( i = 0; i < len; i++ ) {
|
15537 |
-
args[ i ] = arguments[ i ];
|
15538 |
-
}
|
15539 |
|
15540 |
-
|
15541 |
-
|
|
|
|
|
|
|
15542 |
|
15543 |
-
|
15544 |
-
|
15545 |
-
};
|
15546 |
|
15547 |
-
|
15548 |
-
|
15549 |
|
15550 |
-
|
15551 |
-
|
15552 |
-
|
15553 |
-
node.next = head;
|
15554 |
-
} else {
|
15555 |
-
// If no head, follows that there's no tail (at initial or reset)
|
15556 |
-
tail = node;
|
15557 |
-
}
|
15558 |
|
15559 |
-
|
15560 |
-
|
15561 |
-
|
15562 |
-
tail.next = null;
|
15563 |
-
} else {
|
15564 |
-
size++;
|
15565 |
-
}
|
15566 |
|
15567 |
-
|
|
|
15568 |
|
15569 |
-
|
15570 |
-
|
|
|
15571 |
|
15572 |
-
|
15573 |
-
|
15574 |
-
|
15575 |
-
size = 0;
|
15576 |
-
};
|
15577 |
|
15578 |
-
|
15579 |
-
// Cache is not exposed in the public API, but used in tests to ensure
|
15580 |
-
// expected list progression
|
15581 |
-
memoized.getCache = function() {
|
15582 |
-
return [ head, tail, size ];
|
15583 |
-
};
|
15584 |
-
}
|
15585 |
|
15586 |
-
return memoized;
|
15587 |
-
};
|
15588 |
|
15589 |
-
|
|
|
|
|
|
|
15590 |
|
15591 |
-
|
15592 |
-
/* 110 */
|
15593 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15594 |
|
15595 |
-
"
|
15596 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__registry__ = __webpack_require__(111);
|
15597 |
|
15598 |
-
|
15599 |
-
|
|
|
15600 |
|
15601 |
/***/ }),
|
15602 |
-
/*
|
15603 |
-
/***/ (function(module,
|
15604 |
|
15605 |
"use strict";
|
15606 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = createRegistry;
|
15607 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(65);
|
15608 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(16);
|
15609 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
|
15610 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
|
15611 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__namespace_store_js__ = __webpack_require__(401);
|
15612 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__store__ = __webpack_require__(407);
|
15613 |
|
15614 |
|
|
|
|
|
|
|
|
|
15615 |
|
15616 |
-
|
15617 |
-
* External dependencies
|
15618 |
-
*/
|
15619 |
|
15620 |
-
|
15621 |
-
* Internal dependencies
|
15622 |
-
*/
|
15623 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15624 |
|
|
|
|
|
|
|
15625 |
|
15626 |
-
|
15627 |
-
* An isolated orchestrator of store registrations.
|
15628 |
-
*
|
15629 |
-
* @typedef {WPDataRegistry}
|
15630 |
-
*
|
15631 |
-
* @property {Function} registerGenericStore
|
15632 |
-
* @property {Function} registerStore
|
15633 |
-
* @property {Function} subscribe
|
15634 |
-
* @property {Function} select
|
15635 |
-
* @property {Function} dispatch
|
15636 |
-
*/
|
15637 |
|
15638 |
-
/**
|
15639 |
-
* An object of registry function overrides.
|
15640 |
-
*
|
15641 |
-
* @typedef {WPDataPlugin}
|
15642 |
-
*/
|
15643 |
|
15644 |
-
|
15645 |
-
|
15646 |
-
|
15647 |
-
|
15648 |
-
* @param {Object} storeConfigs Initial store configurations.
|
15649 |
-
*
|
15650 |
-
* @return {WPDataRegistry} Data registry.
|
15651 |
-
*/
|
15652 |
|
15653 |
-
|
15654 |
-
var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
15655 |
-
var stores = {};
|
15656 |
-
var listeners = [];
|
15657 |
-
/**
|
15658 |
-
* Global listener called for each store's update.
|
15659 |
-
*/
|
15660 |
|
15661 |
-
|
15662 |
-
listeners.forEach(function (listener) {
|
15663 |
-
return listener();
|
15664 |
-
});
|
15665 |
-
}
|
15666 |
-
/**
|
15667 |
-
* Subscribe to changes to any data.
|
15668 |
-
*
|
15669 |
-
* @param {Function} listener Listener function.
|
15670 |
-
*
|
15671 |
-
* @return {Function} Unsubscribe function.
|
15672 |
-
*/
|
15673 |
|
|
|
15674 |
|
15675 |
-
|
15676 |
-
|
15677 |
-
return
|
15678 |
-
|
15679 |
-
};
|
15680 |
-
};
|
15681 |
-
/**
|
15682 |
-
* Calls a selector given the current state and extra arguments.
|
15683 |
-
*
|
15684 |
-
* @param {string} reducerKey Part of the state shape to register the
|
15685 |
-
* selectors for.
|
15686 |
-
*
|
15687 |
-
* @return {*} The selector's returned value.
|
15688 |
-
*/
|
15689 |
|
|
|
|
|
|
|
15690 |
|
15691 |
-
|
15692 |
-
|
15693 |
-
|
|
|
|
|
15694 |
}
|
15695 |
-
/**
|
15696 |
-
* Returns the available actions for a part of the state.
|
15697 |
-
*
|
15698 |
-
* @param {string} reducerKey Part of the state shape to dispatch the
|
15699 |
-
* action for.
|
15700 |
-
*
|
15701 |
-
* @return {*} The action's returned value.
|
15702 |
-
*/
|
15703 |
|
|
|
|
|
|
|
15704 |
|
15705 |
-
|
15706 |
-
|
15707 |
-
|
15708 |
-
} //
|
15709 |
-
// Deprecated
|
15710 |
-
// TODO: Remove this after `use()` is removed.
|
15711 |
-
//
|
15712 |
|
|
|
|
|
|
|
15713 |
|
15714 |
-
|
15715 |
-
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(attributes, function (attribute, key) {
|
15716 |
-
if (typeof attribute !== 'function') {
|
15717 |
-
return attribute;
|
15718 |
-
}
|
15719 |
|
15720 |
-
return function () {
|
15721 |
-
return registry[key].apply(null, arguments);
|
15722 |
-
};
|
15723 |
-
});
|
15724 |
-
}
|
15725 |
-
/**
|
15726 |
-
* Registers a generic store.
|
15727 |
-
*
|
15728 |
-
* @param {string} key Store registry key.
|
15729 |
-
* @param {Object} config Configuration (getSelectors, getActions, subscribe).
|
15730 |
-
*/
|
15731 |
|
|
|
|
|
|
|
|
|
15732 |
|
15733 |
-
|
15734 |
-
if (typeof config.getSelectors !== 'function') {
|
15735 |
-
throw new TypeError('config.getSelectors must be a function');
|
15736 |
-
}
|
15737 |
|
15738 |
-
|
15739 |
-
throw new TypeError('config.getActions must be a function');
|
15740 |
-
}
|
15741 |
|
15742 |
-
|
15743 |
-
throw new TypeError('config.subscribe must be a function');
|
15744 |
-
}
|
15745 |
|
15746 |
-
|
15747 |
-
|
|
|
|
|
|
|
15748 |
}
|
15749 |
|
15750 |
-
|
15751 |
-
|
15752 |
-
stores: stores,
|
15753 |
-
namespaces: stores,
|
15754 |
-
// TODO: Deprecate/remove this.
|
15755 |
-
subscribe: subscribe,
|
15756 |
-
select: select,
|
15757 |
-
dispatch: dispatch,
|
15758 |
-
use: use
|
15759 |
-
};
|
15760 |
-
/**
|
15761 |
-
* Registers a standard `@wordpress/data` store.
|
15762 |
-
*
|
15763 |
-
* @param {string} reducerKey Reducer key.
|
15764 |
-
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
|
15765 |
-
*
|
15766 |
-
* @return {Object} Registered store object.
|
15767 |
-
*/
|
15768 |
-
|
15769 |
-
registry.registerStore = function (reducerKey, options) {
|
15770 |
-
if (!options.reducer) {
|
15771 |
-
throw new TypeError('Must specify store reducer');
|
15772 |
-
}
|
15773 |
|
15774 |
-
|
15775 |
-
|
15776 |
-
return namespace.store;
|
15777 |
-
}; //
|
15778 |
-
// TODO:
|
15779 |
-
// This function will be deprecated as soon as it is no longer internally referenced.
|
15780 |
-
//
|
15781 |
|
|
|
|
|
|
|
15782 |
|
15783 |
-
|
15784 |
-
|
15785 |
-
return registry;
|
15786 |
}
|
15787 |
|
15788 |
-
|
15789 |
-
|
15790 |
-
}, storeConfigs)).map(function (_ref) {
|
15791 |
-
var _ref2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_ref, 2),
|
15792 |
-
name = _ref2[0],
|
15793 |
-
config = _ref2[1];
|
15794 |
|
15795 |
-
|
15796 |
-
|
15797 |
-
|
15798 |
-
|
15799 |
-
|
|
|
|
|
|
|
15800 |
|
15801 |
/***/ }),
|
15802 |
-
/*
|
15803 |
-
/***/ (function(module,
|
15804 |
|
15805 |
"use strict";
|
15806 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = _asyncToGenerator;
|
15807 |
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
15808 |
-
try {
|
15809 |
-
var info = gen[key](arg);
|
15810 |
-
var value = info.value;
|
15811 |
-
} catch (error) {
|
15812 |
-
reject(error);
|
15813 |
-
return;
|
15814 |
-
}
|
15815 |
|
15816 |
-
|
15817 |
-
|
15818 |
-
|
15819 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15820 |
}
|
|
|
|
|
|
|
15821 |
}
|
|
|
15822 |
|
15823 |
-
|
15824 |
-
|
15825 |
-
|
15826 |
-
args = arguments;
|
15827 |
-
return new Promise(function (resolve, reject) {
|
15828 |
-
var gen = fn.apply(self, args);
|
15829 |
|
15830 |
-
|
15831 |
-
|
15832 |
-
}
|
15833 |
|
15834 |
-
function _throw(err) {
|
15835 |
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
15836 |
-
}
|
15837 |
|
15838 |
-
|
15839 |
-
|
15840 |
-
|
15841 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15842 |
|
15843 |
/***/ }),
|
15844 |
-
/*
|
15845 |
-
/***/ (function(module,
|
15846 |
|
15847 |
"use strict";
|
15848 |
-
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createStore; });
|
15849 |
-
/* unused harmony export combineReducers */
|
15850 |
-
/* unused harmony export bindActionCreators */
|
15851 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return applyMiddleware; });
|
15852 |
-
/* unused harmony export compose */
|
15853 |
-
/* unused harmony export __DO_NOT_USE__ActionTypes */
|
15854 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_symbol_observable__ = __webpack_require__(402);
|
15855 |
|
15856 |
|
15857 |
-
|
15858 |
-
|
15859 |
-
|
15860 |
-
|
15861 |
-
|
15862 |
-
*/
|
15863 |
-
var randomString = function randomString() {
|
15864 |
-
return Math.random().toString(36).substring(7).split('').join('.');
|
15865 |
-
};
|
15866 |
|
15867 |
-
|
15868 |
-
|
15869 |
-
|
15870 |
-
|
15871 |
-
|
|
|
|
|
15872 |
}
|
15873 |
-
};
|
15874 |
|
15875 |
-
|
15876 |
-
|
15877 |
-
|
15878 |
-
*/
|
15879 |
-
function isPlainObject(obj) {
|
15880 |
-
if (typeof obj !== 'object' || obj === null) return false;
|
15881 |
-
var proto = obj;
|
15882 |
|
15883 |
-
|
15884 |
-
|
15885 |
}
|
15886 |
|
15887 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15888 |
}
|
15889 |
|
|
|
|
|
|
|
|
|
15890 |
/**
|
15891 |
-
*
|
15892 |
-
*
|
|
|
15893 |
*
|
15894 |
-
*
|
15895 |
-
*
|
15896 |
-
*
|
|
|
|
|
|
|
|
|
15897 |
*
|
15898 |
-
*
|
15899 |
-
*
|
15900 |
*
|
15901 |
-
*
|
15902 |
-
*
|
15903 |
-
* previously serialized user session.
|
15904 |
-
* If you use `combineReducers` to produce the root reducer function, this must be
|
15905 |
-
* an object with the same shape as `combineReducers` keys.
|
15906 |
*
|
15907 |
-
*
|
15908 |
-
*
|
15909 |
-
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
15910 |
-
* is `applyMiddleware()`.
|
15911 |
*
|
15912 |
-
*
|
15913 |
-
*
|
15914 |
*/
|
|
|
|
|
|
|
|
|
15915 |
|
15916 |
-
|
15917 |
-
var _ref2;
|
15918 |
|
15919 |
-
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
|
15920 |
-
throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function');
|
15921 |
-
}
|
15922 |
|
15923 |
-
|
15924 |
-
|
15925 |
-
|
15926 |
-
}
|
15927 |
|
15928 |
-
|
15929 |
-
if (typeof enhancer !== 'function') {
|
15930 |
-
throw new Error('Expected the enhancer to be a function.');
|
15931 |
-
}
|
15932 |
|
15933 |
-
return enhancer(createStore)(reducer, preloadedState);
|
15934 |
-
}
|
15935 |
|
15936 |
-
|
15937 |
-
|
15938 |
-
|
|
|
15939 |
|
15940 |
-
|
15941 |
-
var currentState = preloadedState;
|
15942 |
-
var currentListeners = [];
|
15943 |
-
var nextListeners = currentListeners;
|
15944 |
-
var isDispatching = false;
|
15945 |
|
15946 |
-
|
15947 |
-
if (nextListeners === currentListeners) {
|
15948 |
-
nextListeners = currentListeners.slice();
|
15949 |
-
}
|
15950 |
-
}
|
15951 |
-
/**
|
15952 |
-
* Reads the state tree managed by the store.
|
15953 |
-
*
|
15954 |
-
* @returns {any} The current state tree of your application.
|
15955 |
-
*/
|
15956 |
|
|
|
15957 |
|
15958 |
-
|
15959 |
-
if (isDispatching) {
|
15960 |
-
throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
|
15961 |
-
}
|
15962 |
|
15963 |
-
|
15964 |
-
}
|
15965 |
-
/**
|
15966 |
-
* Adds a change listener. It will be called any time an action is dispatched,
|
15967 |
-
* and some part of the state tree may potentially have changed. You may then
|
15968 |
-
* call `getState()` to read the current state tree inside the callback.
|
15969 |
-
*
|
15970 |
-
* You may call `dispatch()` from a change listener, with the following
|
15971 |
-
* caveats:
|
15972 |
-
*
|
15973 |
-
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
15974 |
-
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
15975 |
-
* will not have any effect on the `dispatch()` that is currently in progress.
|
15976 |
-
* However, the next `dispatch()` call, whether nested or not, will use a more
|
15977 |
-
* recent snapshot of the subscription list.
|
15978 |
-
*
|
15979 |
-
* 2. The listener should not expect to see all state changes, as the state
|
15980 |
-
* might have been updated multiple times during a nested `dispatch()` before
|
15981 |
-
* the listener is called. It is, however, guaranteed that all subscribers
|
15982 |
-
* registered before the `dispatch()` started will be called with the latest
|
15983 |
-
* state by the time it exits.
|
15984 |
-
*
|
15985 |
-
* @param {Function} listener A callback to be invoked on every dispatch.
|
15986 |
-
* @returns {Function} A function to remove this change listener.
|
15987 |
-
*/
|
15988 |
|
|
|
15989 |
|
15990 |
-
|
15991 |
-
|
15992 |
-
|
15993 |
-
}
|
15994 |
|
15995 |
-
|
15996 |
-
|
15997 |
-
}
|
15998 |
|
15999 |
-
|
16000 |
-
|
16001 |
-
|
16002 |
-
return function unsubscribe() {
|
16003 |
-
if (!isSubscribed) {
|
16004 |
-
return;
|
16005 |
-
}
|
16006 |
|
16007 |
-
|
16008 |
-
throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
|
16009 |
-
}
|
16010 |
|
16011 |
-
isSubscribed = false;
|
16012 |
-
ensureCanMutateNextListeners();
|
16013 |
-
var index = nextListeners.indexOf(listener);
|
16014 |
-
nextListeners.splice(index, 1);
|
16015 |
-
};
|
16016 |
-
}
|
16017 |
-
/**
|
16018 |
-
* Dispatches an action. It is the only way to trigger a state change.
|
16019 |
-
*
|
16020 |
-
* The `reducer` function, used to create the store, will be called with the
|
16021 |
-
* current state tree and the given `action`. Its return value will
|
16022 |
-
* be considered the **next** state of the tree, and the change listeners
|
16023 |
-
* will be notified.
|
16024 |
-
*
|
16025 |
-
* The base implementation only supports plain object actions. If you want to
|
16026 |
-
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
16027 |
-
* wrap your store creating function into the corresponding middleware. For
|
16028 |
-
* example, see the documentation for the `redux-thunk` package. Even the
|
16029 |
-
* middleware will eventually dispatch plain object actions using this method.
|
16030 |
-
*
|
16031 |
-
* @param {Object} action A plain object representing “what changed”. It is
|
16032 |
-
* a good idea to keep actions serializable so you can record and replay user
|
16033 |
-
* sessions, or use the time travelling `redux-devtools`. An action must have
|
16034 |
-
* a `type` property which may not be `undefined`. It is a good idea to use
|
16035 |
-
* string constants for action types.
|
16036 |
-
*
|
16037 |
-
* @returns {Object} For convenience, the same action object you dispatched.
|
16038 |
-
*
|
16039 |
-
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
16040 |
-
* return something else (for example, a Promise you can await).
|
16041 |
-
*/
|
16042 |
|
|
|
|
|
|
|
|
|
16043 |
|
16044 |
-
|
16045 |
-
if (!isPlainObject(action)) {
|
16046 |
-
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
|
16047 |
-
}
|
16048 |
|
16049 |
-
|
16050 |
-
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
|
16051 |
-
}
|
16052 |
|
16053 |
-
|
16054 |
-
throw new Error('Reducers may not dispatch actions.');
|
16055 |
-
}
|
16056 |
|
16057 |
-
|
16058 |
-
isDispatching = true;
|
16059 |
-
currentState = currentReducer(currentState, action);
|
16060 |
-
} finally {
|
16061 |
-
isDispatching = false;
|
16062 |
-
}
|
16063 |
|
16064 |
-
|
16065 |
|
16066 |
-
|
16067 |
-
|
16068 |
-
|
16069 |
-
|
16070 |
|
16071 |
-
|
16072 |
-
|
16073 |
-
|
16074 |
-
|
16075 |
-
*
|
16076 |
-
* You might need this if your app implements code splitting and you want to
|
16077 |
-
* load some of the reducers dynamically. You might also need this if you
|
16078 |
-
* implement a hot reloading mechanism for Redux.
|
16079 |
-
*
|
16080 |
-
* @param {Function} nextReducer The reducer for the store to use instead.
|
16081 |
-
* @returns {void}
|
16082 |
-
*/
|
16083 |
|
|
|
|
|
|
|
16084 |
|
16085 |
-
|
16086 |
-
if (typeof nextReducer !== 'function') {
|
16087 |
-
throw new Error('Expected the nextReducer to be a function.');
|
16088 |
-
}
|
16089 |
|
16090 |
-
currentReducer = nextReducer;
|
16091 |
-
dispatch({
|
16092 |
-
type: ActionTypes.REPLACE
|
16093 |
-
});
|
16094 |
-
}
|
16095 |
-
/**
|
16096 |
-
* Interoperability point for observable/reactive libraries.
|
16097 |
-
* @returns {observable} A minimal observable of state changes.
|
16098 |
-
* For more information, see the observable proposal:
|
16099 |
-
* https://github.com/tc39/proposal-observable
|
16100 |
-
*/
|
16101 |
|
|
|
|
|
|
|
|
|
16102 |
|
16103 |
-
|
16104 |
-
var _ref;
|
16105 |
|
16106 |
-
|
16107 |
-
return _ref = {
|
16108 |
-
/**
|
16109 |
-
* The minimal observable subscription method.
|
16110 |
-
* @param {Object} observer Any object that can be used as an observer.
|
16111 |
-
* The observer object should have a `next` method.
|
16112 |
-
* @returns {subscription} An object with an `unsubscribe` method that can
|
16113 |
-
* be used to unsubscribe the observable from the store, and prevent further
|
16114 |
-
* emission of values from the observable.
|
16115 |
-
*/
|
16116 |
-
subscribe: function subscribe(observer) {
|
16117 |
-
if (typeof observer !== 'object' || observer === null) {
|
16118 |
-
throw new TypeError('Expected the observer to be an object.');
|
16119 |
-
}
|
16120 |
|
16121 |
-
|
16122 |
-
if (observer.next) {
|
16123 |
-
observer.next(getState());
|
16124 |
-
}
|
16125 |
-
}
|
16126 |
|
16127 |
-
|
16128 |
-
var unsubscribe = outerSubscribe(observeState);
|
16129 |
-
return {
|
16130 |
-
unsubscribe: unsubscribe
|
16131 |
-
};
|
16132 |
-
}
|
16133 |
-
}, _ref[__WEBPACK_IMPORTED_MODULE_0_symbol_observable__["a" /* default */]] = function () {
|
16134 |
-
return this;
|
16135 |
-
}, _ref;
|
16136 |
-
} // When a store is created, an "INIT" action is dispatched so that every
|
16137 |
-
// reducer returns their initial state. This effectively populates
|
16138 |
-
// the initial state tree.
|
16139 |
|
|
|
16140 |
|
16141 |
-
|
16142 |
-
type: ActionTypes.INIT
|
16143 |
-
});
|
16144 |
-
return _ref2 = {
|
16145 |
-
dispatch: dispatch,
|
16146 |
-
subscribe: subscribe,
|
16147 |
-
getState: getState,
|
16148 |
-
replaceReducer: replaceReducer
|
16149 |
-
}, _ref2[__WEBPACK_IMPORTED_MODULE_0_symbol_observable__["a" /* default */]] = observable, _ref2;
|
16150 |
-
}
|
16151 |
|
16152 |
-
|
16153 |
-
* Prints a warning in the console if it exists.
|
16154 |
-
*
|
16155 |
-
* @param {String} message The warning message.
|
16156 |
-
* @returns {void}
|
16157 |
-
*/
|
16158 |
-
function warning(message) {
|
16159 |
-
/* eslint-disable no-console */
|
16160 |
-
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
16161 |
-
console.error(message);
|
16162 |
-
}
|
16163 |
-
/* eslint-enable no-console */
|
16164 |
|
|
|
16165 |
|
16166 |
-
|
16167 |
-
// This error was thrown as a convenience so that if you enable
|
16168 |
-
// "break on all exceptions" in your console,
|
16169 |
-
// it would pause the execution at this line.
|
16170 |
-
throw new Error(message);
|
16171 |
-
} catch (e) {} // eslint-disable-line no-empty
|
16172 |
|
16173 |
-
|
16174 |
|
16175 |
-
|
16176 |
-
var actionType = action && action.type;
|
16177 |
-
var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
|
16178 |
-
return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
|
16179 |
-
}
|
16180 |
|
16181 |
-
|
16182 |
-
var reducerKeys = Object.keys(reducers);
|
16183 |
-
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
16184 |
|
16185 |
-
|
16186 |
-
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
16187 |
-
}
|
16188 |
|
16189 |
-
|
16190 |
-
return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
16191 |
-
}
|
16192 |
|
16193 |
-
|
16194 |
-
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
16195 |
-
});
|
16196 |
-
unexpectedKeys.forEach(function (key) {
|
16197 |
-
unexpectedKeyCache[key] = true;
|
16198 |
-
});
|
16199 |
-
if (action && action.type === ActionTypes.REPLACE) return;
|
16200 |
|
16201 |
-
|
16202 |
-
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
|
16203 |
-
}
|
16204 |
-
}
|
16205 |
|
16206 |
-
|
16207 |
-
Object.keys(reducers).forEach(function (key) {
|
16208 |
-
var reducer = reducers[key];
|
16209 |
-
var initialState = reducer(undefined, {
|
16210 |
-
type: ActionTypes.INIT
|
16211 |
-
});
|
16212 |
|
16213 |
-
|
16214 |
-
throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
|
16215 |
-
}
|
16216 |
|
16217 |
-
|
16218 |
-
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
16219 |
-
}) === 'undefined') {
|
16220 |
-
throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
16221 |
-
}
|
16222 |
-
});
|
16223 |
-
}
|
16224 |
-
/**
|
16225 |
-
* Turns an object whose values are different reducer functions, into a single
|
16226 |
-
* reducer function. It will call every child reducer, and gather their results
|
16227 |
-
* into a single state object, whose keys correspond to the keys of the passed
|
16228 |
-
* reducer functions.
|
16229 |
-
*
|
16230 |
-
* @param {Object} reducers An object whose values correspond to different
|
16231 |
-
* reducer functions that need to be combined into one. One handy way to obtain
|
16232 |
-
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
16233 |
-
* undefined for any action. Instead, they should return their initial state
|
16234 |
-
* if the state passed to them was undefined, and the current state for any
|
16235 |
-
* unrecognized action.
|
16236 |
-
*
|
16237 |
-
* @returns {Function} A reducer function that invokes every reducer inside the
|
16238 |
-
* passed object, and builds a state object with the same shape.
|
16239 |
-
*/
|
16240 |
|
|
|
16241 |
|
16242 |
-
|
16243 |
-
var reducerKeys = Object.keys(reducers);
|
16244 |
-
var finalReducers = {};
|
16245 |
|
16246 |
-
|
16247 |
-
var key = reducerKeys[i];
|
16248 |
|
16249 |
-
|
16250 |
-
if (typeof reducers[key] === 'undefined') {
|
16251 |
-
warning("No reducer provided for key \"" + key + "\"");
|
16252 |
-
}
|
16253 |
-
}
|
16254 |
|
16255 |
-
|
16256 |
-
finalReducers[key] = reducers[key];
|
16257 |
-
}
|
16258 |
-
}
|
16259 |
|
16260 |
-
|
16261 |
-
var unexpectedKeyCache;
|
16262 |
|
16263 |
-
|
16264 |
-
unexpectedKeyCache = {};
|
16265 |
-
}
|
16266 |
|
16267 |
-
|
16268 |
|
16269 |
-
|
16270 |
-
assertReducerShape(finalReducers);
|
16271 |
-
} catch (e) {
|
16272 |
-
shapeAssertionError = e;
|
16273 |
-
}
|
16274 |
|
16275 |
-
|
16276 |
-
if (state === void 0) {
|
16277 |
-
state = {};
|
16278 |
-
}
|
16279 |
|
16280 |
-
|
16281 |
-
throw shapeAssertionError;
|
16282 |
-
}
|
16283 |
|
16284 |
-
|
16285 |
-
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
16286 |
|
16287 |
-
|
16288 |
-
warning(warningMessage);
|
16289 |
-
}
|
16290 |
-
}
|
16291 |
|
16292 |
-
|
16293 |
-
var nextState = {};
|
16294 |
|
16295 |
-
|
16296 |
-
var _key = finalReducerKeys[_i];
|
16297 |
-
var reducer = finalReducers[_key];
|
16298 |
-
var previousStateForKey = state[_key];
|
16299 |
-
var nextStateForKey = reducer(previousStateForKey, action);
|
16300 |
|
16301 |
-
|
16302 |
-
var errorMessage = getUndefinedStateErrorMessage(_key, action);
|
16303 |
-
throw new Error(errorMessage);
|
16304 |
-
}
|
16305 |
|
16306 |
-
|
16307 |
-
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
16308 |
-
}
|
16309 |
|
16310 |
-
|
16311 |
-
};
|
16312 |
-
}
|
16313 |
|
16314 |
-
|
16315 |
-
return function () {
|
16316 |
-
return dispatch(actionCreator.apply(this, arguments));
|
16317 |
-
};
|
16318 |
-
}
|
16319 |
-
/**
|
16320 |
-
* Turns an object whose values are action creators, into an object with the
|
16321 |
-
* same keys, but with every function wrapped into a `dispatch` call so they
|
16322 |
-
* may be invoked directly. This is just a convenience method, as you can call
|
16323 |
-
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
16324 |
-
*
|
16325 |
-
* For convenience, you can also pass a single function as the first argument,
|
16326 |
-
* and get a function in return.
|
16327 |
-
*
|
16328 |
-
* @param {Function|Object} actionCreators An object whose values are action
|
16329 |
-
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
16330 |
-
* syntax. You may also pass a single function.
|
16331 |
-
*
|
16332 |
-
* @param {Function} dispatch The `dispatch` function available on your Redux
|
16333 |
-
* store.
|
16334 |
-
*
|
16335 |
-
* @returns {Function|Object} The object mimicking the original object, but with
|
16336 |
-
* every action creator wrapped into the `dispatch` call. If you passed a
|
16337 |
-
* function as `actionCreators`, the return value will also be a single
|
16338 |
-
* function.
|
16339 |
-
*/
|
16340 |
|
|
|
16341 |
|
16342 |
-
|
16343 |
-
if (typeof actionCreators === 'function') {
|
16344 |
-
return bindActionCreator(actionCreators, dispatch);
|
16345 |
-
}
|
16346 |
|
16347 |
-
|
16348 |
-
throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
|
16349 |
-
}
|
16350 |
|
16351 |
-
|
16352 |
-
var boundActionCreators = {};
|
16353 |
|
16354 |
-
|
16355 |
-
var key = keys[i];
|
16356 |
-
var actionCreator = actionCreators[key];
|
16357 |
|
16358 |
-
|
16359 |
-
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
16360 |
-
}
|
16361 |
-
}
|
16362 |
|
16363 |
-
|
16364 |
-
}
|
16365 |
|
16366 |
-
|
16367 |
-
if (key in obj) {
|
16368 |
-
Object.defineProperty(obj, key, {
|
16369 |
-
value: value,
|
16370 |
-
enumerable: true,
|
16371 |
-
configurable: true,
|
16372 |
-
writable: true
|
16373 |
-
});
|
16374 |
-
} else {
|
16375 |
-
obj[key] = value;
|
16376 |
-
}
|
16377 |
|
16378 |
-
|
16379 |
-
}
|
16380 |
|
16381 |
-
|
16382 |
-
for (var i = 1; i < arguments.length; i++) {
|
16383 |
-
var source = arguments[i] != null ? arguments[i] : {};
|
16384 |
-
var ownKeys = Object.keys(source);
|
16385 |
|
16386 |
-
|
16387 |
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
16388 |
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
16389 |
-
}));
|
16390 |
-
}
|
16391 |
|
16392 |
-
|
16393 |
-
_defineProperty(target, key, source[key]);
|
16394 |
-
});
|
16395 |
-
}
|
16396 |
|
16397 |
-
|
16398 |
-
}
|
16399 |
|
16400 |
-
|
16401 |
-
* Composes single-argument functions from right to left. The rightmost
|
16402 |
-
* function can take multiple arguments as it provides the signature for
|
16403 |
-
* the resulting composite function.
|
16404 |
-
*
|
16405 |
-
* @param {...Function} funcs The functions to compose.
|
16406 |
-
* @returns {Function} A function obtained by composing the argument functions
|
16407 |
-
* from right to left. For example, compose(f, g, h) is identical to doing
|
16408 |
-
* (...args) => f(g(h(...args))).
|
16409 |
-
*/
|
16410 |
-
function compose() {
|
16411 |
-
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
16412 |
-
funcs[_key] = arguments[_key];
|
16413 |
-
}
|
16414 |
|
16415 |
-
|
16416 |
-
return function (arg) {
|
16417 |
-
return arg;
|
16418 |
-
};
|
16419 |
-
}
|
16420 |
|
16421 |
-
|
16422 |
-
|
16423 |
-
|
|
|
|
|
16424 |
|
16425 |
-
|
16426 |
-
return function () {
|
16427 |
-
return a(b.apply(void 0, arguments));
|
16428 |
-
};
|
16429 |
-
});
|
16430 |
-
}
|
16431 |
|
16432 |
-
|
16433 |
-
|
16434 |
-
|
16435 |
-
|
16436 |
-
|
16437 |
-
|
16438 |
-
|
16439 |
-
|
16440 |
-
|
16441 |
-
|
16442 |
-
|
16443 |
-
|
16444 |
-
|
16445 |
-
|
16446 |
-
|
16447 |
-
|
|
|
|
|
|
|
16448 |
|
16449 |
-
|
16450 |
-
|
16451 |
-
|
16452 |
-
|
|
|
|
|
|
|
|
|
|
|
16453 |
|
16454 |
-
|
16455 |
-
|
16456 |
-
|
16457 |
|
16458 |
-
|
16459 |
-
|
16460 |
-
|
|
|
|
|
|
|
|
|
16461 |
|
16462 |
-
|
16463 |
-
|
16464 |
-
|
16465 |
-
|
16466 |
-
|
16467 |
-
};
|
16468 |
-
var chain = middlewares.map(function (middleware) {
|
16469 |
-
return middleware(middlewareAPI);
|
16470 |
-
});
|
16471 |
-
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
16472 |
-
return _objectSpread({}, store, {
|
16473 |
-
dispatch: _dispatch
|
16474 |
-
});
|
16475 |
-
};
|
16476 |
-
};
|
16477 |
-
}
|
16478 |
|
16479 |
-
|
16480 |
-
|
16481 |
-
|
16482 |
-
|
|
|
|
|
16483 |
|
16484 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16485 |
|
16486 |
-
|
16487 |
-
|
16488 |
-
}
|
16489 |
|
|
|
|
|
|
|
|
|
|
|
16490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16491 |
|
16492 |
-
|
|
|
|
|
|
|
|
|
|
|
16493 |
|
16494 |
-
|
16495 |
-
|
16496 |
-
|
|
|
16497 |
|
16498 |
-
|
|
|
|
|
|
|
16499 |
|
16500 |
-
|
16501 |
-
|
16502 |
-
|
|
|
16503 |
|
|
|
|
|
|
|
|
|
16504 |
|
16505 |
-
|
16506 |
-
|
16507 |
-
/***/ (function(module, exports, __webpack_require__) {
|
16508 |
|
16509 |
-
"use strict";
|
16510 |
|
|
|
|
|
|
|
16511 |
|
16512 |
-
|
16513 |
-
|
16514 |
-
|
16515 |
-
|
|
|
|
|
16516 |
|
16517 |
-
|
|
|
|
|
|
|
16518 |
|
16519 |
-
|
|
|
|
|
|
|
16520 |
|
16521 |
-
|
|
|
16522 |
|
16523 |
-
var all = exports.all = function all(value) {
|
16524 |
-
return {
|
16525 |
-
type: _keys2.default.all,
|
16526 |
-
value: value
|
16527 |
-
};
|
16528 |
-
};
|
16529 |
|
16530 |
-
|
16531 |
-
|
16532 |
-
|
16533 |
-
|
16534 |
-
|
16535 |
-
};
|
16536 |
|
16537 |
-
|
16538 |
-
|
16539 |
-
args[_key - 1] = arguments[_key];
|
16540 |
-
}
|
16541 |
|
16542 |
-
|
16543 |
-
type: _keys2.default.fork,
|
16544 |
-
iterator: iterator,
|
16545 |
-
args: args
|
16546 |
-
};
|
16547 |
-
};
|
16548 |
|
16549 |
-
|
16550 |
-
|
16551 |
-
|
16552 |
-
|
16553 |
-
|
16554 |
};
|
16555 |
|
16556 |
-
var
|
16557 |
-
|
16558 |
-
type: _keys2.default.race,
|
16559 |
-
competitors: competitors
|
16560 |
-
};
|
16561 |
-
};
|
16562 |
|
16563 |
-
|
16564 |
-
|
16565 |
-
setTimeout(function () {
|
16566 |
-
return resolve(true);
|
16567 |
-
}, timeout);
|
16568 |
-
});
|
16569 |
-
};
|
16570 |
|
16571 |
-
var
|
16572 |
-
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
16573 |
-
args[_key2 - 1] = arguments[_key2];
|
16574 |
-
}
|
16575 |
|
16576 |
-
|
16577 |
-
type: _keys2.default.call,
|
16578 |
-
func: func,
|
16579 |
-
context: null,
|
16580 |
-
args: args
|
16581 |
-
};
|
16582 |
-
};
|
16583 |
|
16584 |
-
var
|
16585 |
-
|
16586 |
-
|
16587 |
-
|
16588 |
|
16589 |
-
|
16590 |
-
type: _keys2.default.call,
|
16591 |
-
func: func,
|
16592 |
-
context: context,
|
16593 |
-
args: args
|
16594 |
-
};
|
16595 |
-
};
|
16596 |
|
16597 |
-
var apply = exports.apply = function apply(func, context, args) {
|
16598 |
-
return {
|
16599 |
-
type: _keys2.default.call,
|
16600 |
-
func: func,
|
16601 |
-
context: context,
|
16602 |
-
args: args
|
16603 |
-
};
|
16604 |
-
};
|
16605 |
|
16606 |
-
var
|
16607 |
-
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
16608 |
-
args[_key4 - 1] = arguments[_key4];
|
16609 |
-
}
|
16610 |
|
16611 |
-
|
16612 |
-
|
16613 |
-
|
16614 |
-
|
16615 |
-
|
16616 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16617 |
|
16618 |
-
|
16619 |
-
|
16620 |
-
type: _keys2.default.subscribe,
|
16621 |
-
channel: channel
|
16622 |
-
};
|
16623 |
-
};
|
16624 |
|
16625 |
-
|
16626 |
-
|
16627 |
-
|
16628 |
-
|
16629 |
-
|
16630 |
-
return listeners.splice(listeners.indexOf(l), 1);
|
16631 |
};
|
16632 |
-
};
|
16633 |
-
var next = function next(val) {
|
16634 |
-
return listeners.forEach(function (l) {
|
16635 |
-
return l(val);
|
16636 |
-
});
|
16637 |
-
};
|
16638 |
-
callback(next);
|
16639 |
|
16640 |
-
|
16641 |
-
subscribe: subscribe
|
16642 |
-
};
|
16643 |
-
};
|
16644 |
|
16645 |
-
|
16646 |
-
|
16647 |
-
/***/ (function(module, exports, __webpack_require__) {
|
16648 |
|
16649 |
-
|
|
|
|
|
|
|
|
|
|
|
16650 |
|
|
|
|
|
16651 |
|
16652 |
-
|
16653 |
-
|
16654 |
-
});
|
16655 |
-
var keys = {
|
16656 |
-
all: Symbol('all'),
|
16657 |
-
error: Symbol('error'),
|
16658 |
-
fork: Symbol('fork'),
|
16659 |
-
join: Symbol('join'),
|
16660 |
-
race: Symbol('race'),
|
16661 |
-
call: Symbol('call'),
|
16662 |
-
cps: Symbol('cps'),
|
16663 |
-
subscribe: Symbol('subscribe')
|
16664 |
-
};
|
16665 |
|
16666 |
-
|
|
|
|
|
|
|
|
|
|
|
16667 |
|
16668 |
-
|
16669 |
-
|
16670 |
-
|
|
|
|
|
16671 |
|
16672 |
-
|
16673 |
-
|
16674 |
-
|
16675 |
-
|
16676 |
-
|
16677 |
-
|
16678 |
-
|
16679 |
-
|
16680 |
|
16681 |
-
|
16682 |
-
|
16683 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16684 |
|
16685 |
|
16686 |
-
|
16687 |
-
|
16688 |
-
|
16689 |
-
|
16690 |
-
|
16691 |
-
|
16692 |
-
|
16693 |
-
|
16694 |
-
* @param {number} endIndex End index.
|
16695 |
-
*
|
16696 |
-
* @return {Object} A new value with the format applied.
|
16697 |
-
*/
|
16698 |
|
16699 |
-
|
16700 |
-
|
16701 |
-
|
16702 |
-
|
16703 |
-
end = _ref.end;
|
16704 |
-
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : start;
|
16705 |
-
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : end;
|
16706 |
-
var newFormats = formats.slice(0); // The selection is collpased.
|
16707 |
|
16708 |
-
if (startIndex === endIndex) {
|
16709 |
-
var startFormat = Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["find"])(newFormats[startIndex], {
|
16710 |
-
type: format.type
|
16711 |
-
}); // If the caret is at a format of the same type, expand start and end to
|
16712 |
-
// the edges of the format. This is useful to apply new attributes.
|
16713 |
|
16714 |
-
|
16715 |
-
|
16716 |
-
|
16717 |
-
|
16718 |
-
|
16719 |
|
16720 |
-
|
|
|
|
|
16721 |
|
16722 |
-
|
16723 |
-
applyFormats(newFormats, endIndex, format);
|
16724 |
-
endIndex++;
|
16725 |
-
} // Otherwise, insert a placeholder with the format so new input appears
|
16726 |
-
// with the format applied.
|
16727 |
|
16728 |
-
|
16729 |
-
|
16730 |
-
|
16731 |
-
|
16732 |
-
|
16733 |
-
|
16734 |
-
|
16735 |
-
|
16736 |
-
|
16737 |
-
|
16738 |
-
|
16739 |
-
|
16740 |
-
|
|
|
16741 |
}
|
16742 |
-
};
|
16743 |
-
}
|
16744 |
-
} else {
|
16745 |
-
for (var index = startIndex; index < endIndex; index++) {
|
16746 |
-
applyFormats(newFormats, index, format);
|
16747 |
-
}
|
16748 |
-
}
|
16749 |
|
16750 |
-
|
16751 |
-
|
16752 |
-
|
16753 |
-
|
16754 |
-
|
16755 |
-
|
16756 |
-
}
|
16757 |
|
16758 |
-
|
16759 |
-
|
16760 |
-
|
16761 |
-
|
16762 |
-
|
16763 |
-
|
16764 |
-
|
16765 |
-
|
16766 |
-
} else {
|
16767 |
-
formats[index] = [format];
|
16768 |
-
}
|
16769 |
-
}
|
16770 |
-
//# sourceMappingURL=apply-format.js.map
|
16771 |
|
16772 |
-
|
16773 |
-
|
16774 |
-
|
|
|
|
|
|
|
|
|
16775 |
|
16776 |
-
|
16777 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = isFormatEqual;
|
16778 |
-
/**
|
16779 |
-
* Optimised equality check for format objects.
|
16780 |
-
*
|
16781 |
-
* @param {?Object} format1 Format to compare.
|
16782 |
-
* @param {?Object} format2 Format to compare.
|
16783 |
-
*
|
16784 |
-
* @return {boolean} True if formats are equal, false if not.
|
16785 |
-
*/
|
16786 |
-
function isFormatEqual(format1, format2) {
|
16787 |
-
// Both not defined.
|
16788 |
-
if (format1 === format2) {
|
16789 |
-
return true;
|
16790 |
-
} // Either not defined.
|
16791 |
|
|
|
|
|
|
|
16792 |
|
16793 |
-
|
16794 |
-
|
16795 |
-
|
16796 |
|
16797 |
-
|
16798 |
-
|
16799 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16800 |
|
16801 |
-
|
16802 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16803 |
|
16804 |
-
if (attributes1 === attributes2) {
|
16805 |
-
return true;
|
16806 |
-
} // Either not defined.
|
16807 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16808 |
|
16809 |
-
|
16810 |
-
|
16811 |
-
|
|
|
16812 |
|
16813 |
-
|
16814 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16815 |
|
16816 |
-
|
16817 |
-
|
16818 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16819 |
|
16820 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16821 |
|
16822 |
-
|
16823 |
-
|
|
|
|
|
|
|
|
|
16824 |
|
16825 |
-
|
16826 |
-
return false;
|
16827 |
-
}
|
16828 |
-
}
|
16829 |
|
16830 |
-
|
16831 |
-
}
|
16832 |
-
//# sourceMappingURL=is-format-equal.js.map
|
16833 |
|
16834 |
-
|
16835 |
-
/* 119 */
|
16836 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16837 |
|
16838 |
-
|
16839 |
-
|
16840 |
-
|
16841 |
-
|
|
|
|
|
|
|
16842 |
|
16843 |
-
|
16844 |
-
|
16845 |
-
* objects (such as images).
|
16846 |
-
*
|
16847 |
-
* @param {Object} value Value to use.
|
16848 |
-
*
|
16849 |
-
* @return {boolean} True if the value is empty, false if not.
|
16850 |
-
*/
|
16851 |
|
16852 |
-
|
16853 |
-
|
16854 |
-
|
16855 |
-
|
16856 |
-
|
16857 |
-
|
16858 |
-
|
16859 |
-
|
16860 |
-
|
16861 |
-
|
16862 |
-
|
16863 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16864 |
|
16865 |
-
|
16866 |
-
|
16867 |
-
|
16868 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16869 |
|
16870 |
-
|
16871 |
-
|
16872 |
-
|
16873 |
|
16874 |
-
|
16875 |
-
|
16876 |
-
|
|
|
|
|
|
|
|
|
16877 |
|
16878 |
-
|
16879 |
-
|
16880 |
-
|
16881 |
|
16882 |
-
|
16883 |
-
|
16884 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16885 |
|
16886 |
-
|
16887 |
-
}
|
16888 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16889 |
|
16890 |
-
/***/ }),
|
16891 |
-
/* 120 */
|
16892 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16893 |
|
16894 |
-
|
16895 |
-
/* harmony export (immutable) */ __webpack_exports__["a"] = createElement;
|
16896 |
-
/**
|
16897 |
-
* Parse the given HTML into a body element.
|
16898 |
-
*
|
16899 |
-
* Note: The current implementation will return a shared reference, reset on
|
16900 |
-
* each call to `createElement`. Therefore, you should not hold a reference to
|
16901 |
-
* the value to operate upon asynchronously, as it may have unexpected results.
|
16902 |
-
*
|
16903 |
-
* @param {HTMLDocument} document The HTML document to use to parse.
|
16904 |
-
* @param {string} html The HTML to parse.
|
16905 |
-
*
|
16906 |
-
* @return {HTMLBodyElement} Body element with parsed HTML.
|
16907 |
-
*/
|
16908 |
-
function createElement(_ref, html) {
|
16909 |
-
var implementation = _ref.implementation;
|
16910 |
|
16911 |
-
|
16912 |
-
|
16913 |
-
|
16914 |
-
|
16915 |
-
|
16916 |
-
|
16917 |
-
|
16918 |
-
|
16919 |
-
|
16920 |
-
return createElement.body;
|
16921 |
-
}
|
16922 |
-
//# sourceMappingURL=create-element.js.map
|
16923 |
-
|
16924 |
-
/***/ }),
|
16925 |
-
/* 121 */
|
16926 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16927 |
|
16928 |
-
|
16929 |
-
|
16930 |
-
|
16931 |
-
|
16932 |
-
|
16933 |
-
* External dependencies
|
16934 |
-
*/
|
16935 |
|
16936 |
-
|
16937 |
-
|
16938 |
-
|
16939 |
-
|
16940 |
-
|
16941 |
-
|
16942 |
-
|
16943 |
-
* @param {string} formatType Format type to look for.
|
16944 |
-
*
|
16945 |
-
* @return {?Object} Active format object of the specified type, or undefined.
|
16946 |
-
*/
|
16947 |
|
16948 |
-
|
16949 |
-
|
16950 |
-
|
|
|
|
|
|
|
|
|
|
|
16951 |
|
16952 |
-
|
16953 |
-
|
16954 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16955 |
|
16956 |
-
|
16957 |
-
|
16958 |
-
}
|
16959 |
-
|
16960 |
-
|
|
|
|
|
|
|
16961 |
|
16962 |
-
|
16963 |
-
|
16964 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16965 |
|
16966 |
-
|
16967 |
-
|
16968 |
-
|
16969 |
-
|
16970 |
-
|
16971 |
-
|
16972 |
-
|
16973 |
-
|
16974 |
-
|
16975 |
-
|
16976 |
-
|
16977 |
-
|
16978 |
-
|
16979 |
-
}
|
16980 |
-
//# sourceMappingURL=get-text-content.js.map
|
16981 |
|
16982 |
-
/***/ }),
|
16983 |
-
/* 123 */
|
16984 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16985 |
|
16986 |
-
|
16987 |
-
/**
|
16988 |
-
* Validate a namespace string.
|
16989 |
-
*
|
16990 |
-
* @param {string} namespace The namespace to validate - should take the form
|
16991 |
-
* `vendor/plugin/function`.
|
16992 |
-
*
|
16993 |
-
* @return {boolean} Whether the namespace is valid.
|
16994 |
-
*/
|
16995 |
-
function validateNamespace(namespace) {
|
16996 |
-
if ('string' !== typeof namespace || '' === namespace) {
|
16997 |
-
// eslint-disable-next-line no-console
|
16998 |
-
console.error('The namespace must be a non-empty string.');
|
16999 |
-
return false;
|
17000 |
-
}
|
17001 |
|
17002 |
-
|
17003 |
-
// eslint-disable-next-line no-console
|
17004 |
-
console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');
|
17005 |
-
return false;
|
17006 |
-
}
|
17007 |
|
17008 |
-
|
17009 |
-
|
|
|
|
|
|
|
17010 |
|
17011 |
-
|
17012 |
-
|
|
|
|
|
|
|
17013 |
|
17014 |
-
|
17015 |
-
|
17016 |
-
|
|
|
|
|
17017 |
|
17018 |
-
|
17019 |
-
|
17020 |
-
|
17021 |
-
|
17022 |
-
|
17023 |
-
|
17024 |
-
|
17025 |
-
*/
|
17026 |
|
17027 |
-
|
17028 |
-
|
17029 |
-
|
|
|
|
|
|
|
|
|
17030 |
|
|
|
|
|
|
|
17031 |
|
17032 |
-
|
17033 |
-
|
17034 |
-
* `startIndex` to the given `endIndex`. Indices are retrieved from the
|
17035 |
-
* selection if none are provided.
|
17036 |
-
*
|
17037 |
-
* @param {Object} value Value to modify.
|
17038 |
-
* @param {string} formatType Format type to remove.
|
17039 |
-
* @param {number} startIndex Start index.
|
17040 |
-
* @param {number} endIndex End index.
|
17041 |
-
*
|
17042 |
-
* @return {Object} A new value with the format applied.
|
17043 |
-
*/
|
17044 |
|
17045 |
-
|
17046 |
-
|
17047 |
-
|
17048 |
-
|
17049 |
-
|
17050 |
-
|
17051 |
-
|
17052 |
-
|
17053 |
-
// format.
|
17054 |
|
17055 |
-
if (startIndex === endIndex) {
|
17056 |
-
var format = Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["find"])(newFormats[startIndex], {
|
17057 |
-
type: formatType
|
17058 |
-
});
|
17059 |
|
17060 |
-
|
17061 |
-
filterFormats(newFormats, startIndex, formatType);
|
17062 |
-
startIndex--;
|
17063 |
-
}
|
17064 |
|
17065 |
-
|
|
|
|
|
|
|
|
|
|
|
17066 |
|
17067 |
-
|
17068 |
-
filterFormats(newFormats, endIndex, formatType);
|
17069 |
-
endIndex++;
|
17070 |
-
}
|
17071 |
-
} else {
|
17072 |
-
for (var i = startIndex; i < endIndex; i++) {
|
17073 |
-
if (newFormats[i]) {
|
17074 |
-
filterFormats(newFormats, i, formatType);
|
17075 |
}
|
17076 |
-
}
|
17077 |
-
}
|
17078 |
|
17079 |
-
|
17080 |
-
|
17081 |
-
|
17082 |
-
|
17083 |
-
|
17084 |
-
|
17085 |
-
|
|
|
|
|
17086 |
|
17087 |
-
function filterFormats(formats, index, formatType) {
|
17088 |
-
var newFormats = formats[index].filter(function (_ref2) {
|
17089 |
-
var type = _ref2.type;
|
17090 |
-
return type !== formatType;
|
17091 |
-
});
|
17092 |
|
17093 |
-
|
17094 |
-
|
17095 |
-
|
17096 |
-
|
17097 |
-
}
|
17098 |
-
}
|
17099 |
-
//# sourceMappingURL=remove-format.js.map
|
17100 |
|
17101 |
-
|
17102 |
-
|
17103 |
-
|
17104 |
|
17105 |
-
|
17106 |
-
|
17107 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__ = __webpack_require__(40);
|
17108 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__normalise_formats__ = __webpack_require__(43);
|
17109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17110 |
|
17111 |
-
|
17112 |
-
|
17113 |
-
|
|
|
|
|
|
|
17114 |
|
17115 |
-
|
17116 |
-
|
17117 |
-
|
17118 |
-
|
17119 |
-
|
17120 |
-
|
17121 |
-
|
17122 |
-
* string and is not interpreted as a
|
17123 |
-
* regular expression. Only the first
|
17124 |
-
* occurrence will be replaced.
|
17125 |
-
* @param {Function|string} replacement The match or matches are replaced with
|
17126 |
-
* the specified or the value returned by
|
17127 |
-
* the specified function.
|
17128 |
-
*
|
17129 |
-
* @return {Object} A new value with replacements applied.
|
17130 |
-
*/
|
17131 |
|
17132 |
-
function replace(_ref, pattern, replacement) {
|
17133 |
-
var formats = _ref.formats,
|
17134 |
-
text = _ref.text,
|
17135 |
-
start = _ref.start,
|
17136 |
-
end = _ref.end;
|
17137 |
-
text = text.replace(pattern, function (match) {
|
17138 |
-
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
17139 |
-
rest[_key - 1] = arguments[_key];
|
17140 |
-
}
|
17141 |
|
17142 |
-
|
17143 |
-
|
17144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17145 |
|
17146 |
-
|
17147 |
-
|
17148 |
-
|
|
|
|
|
|
|
|
|
|
|
17149 |
|
17150 |
-
|
17151 |
-
|
17152 |
-
|
17153 |
-
|
17154 |
-
|
|
|
|
|
|
|
17155 |
|
17156 |
-
|
17157 |
-
|
|
|
|
|
|
|
|
|
|
|
17158 |
}
|
17159 |
-
}
|
17160 |
|
17161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17162 |
|
17163 |
-
if (start) {
|
17164 |
-
start = end = offset + newText.length;
|
17165 |
-
}
|
17166 |
|
17167 |
-
|
17168 |
-
|
17169 |
-
|
17170 |
-
|
17171 |
-
|
17172 |
-
|
17173 |
-
|
17174 |
-
});
|
17175 |
-
}
|
17176 |
-
//# sourceMappingURL=replace.js.map
|
17177 |
|
17178 |
-
|
17179 |
-
|
17180 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
17181 |
|
17182 |
-
|
17183 |
-
|
17184 |
-
|
17185 |
-
|
17186 |
-
|
17187 |
-
|
|
|
|
|
|
|
|
|
17188 |
|
17189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17190 |
|
17191 |
-
|
17192 |
-
|
17193 |
-
*/
|
17194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17195 |
|
|
|
17196 |
|
17197 |
-
|
17198 |
-
var type = _ref.type,
|
17199 |
-
attributes = _ref.attributes,
|
17200 |
-
unregisteredAttributes = _ref.unregisteredAttributes,
|
17201 |
-
object = _ref.object;
|
17202 |
-
var formatType = Object(__WEBPACK_IMPORTED_MODULE_2__get_format_type__["a" /* getFormatType */])(type);
|
17203 |
|
17204 |
-
|
17205 |
-
|
17206 |
-
|
17207 |
-
|
17208 |
-
|
17209 |
-
|
17210 |
-
|
17211 |
|
17212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17213 |
|
17214 |
-
|
17215 |
-
|
17216 |
|
17217 |
-
|
17218 |
-
|
17219 |
-
|
17220 |
-
|
17221 |
-
|
17222 |
-
|
|
|
17223 |
|
17224 |
-
|
17225 |
-
|
17226 |
-
elementAttributes.class = "".concat(formatType.className, " ").concat(elementAttributes.class);
|
17227 |
-
} else {
|
17228 |
-
elementAttributes.class = formatType.className;
|
17229 |
-
}
|
17230 |
-
}
|
17231 |
|
17232 |
-
|
17233 |
-
|
17234 |
-
|
17235 |
-
|
17236 |
-
|
17237 |
-
|
|
|
17238 |
|
17239 |
-
|
17240 |
-
|
17241 |
-
|
17242 |
-
|
17243 |
-
|
17244 |
-
|
17245 |
-
|
17246 |
-
|
17247 |
-
|
17248 |
-
|
17249 |
-
|
17250 |
-
|
17251 |
-
|
17252 |
-
|
17253 |
-
onEndIndex = _ref2.onEndIndex,
|
17254 |
-
isEditableTree = _ref2.isEditableTree;
|
17255 |
-
var formats = value.formats,
|
17256 |
-
text = value.text,
|
17257 |
-
start = value.start,
|
17258 |
-
end = value.end,
|
17259 |
-
formatPlaceholder = value.formatPlaceholder;
|
17260 |
-
var formatsLength = formats.length + 1;
|
17261 |
-
var tree = createEmpty();
|
17262 |
-
var multilineFormat = {
|
17263 |
-
type: multilineTag
|
17264 |
-
};
|
17265 |
-
var lastSeparatorFormats;
|
17266 |
-
var lastCharacterFormats;
|
17267 |
-
var lastCharacter; // If we're building a multiline tree, start off with a multiline element.
|
17268 |
-
|
17269 |
-
if (multilineTag) {
|
17270 |
-
append(append(tree, {
|
17271 |
-
type: multilineTag
|
17272 |
-
}), '');
|
17273 |
-
lastCharacterFormats = lastSeparatorFormats = [multilineFormat];
|
17274 |
-
} else {
|
17275 |
-
append(tree, '');
|
17276 |
-
}
|
17277 |
-
|
17278 |
-
function setFormatPlaceholder(pointer, index) {
|
17279 |
-
if (isEditableTree && formatPlaceholder && formatPlaceholder.index === index) {
|
17280 |
-
var parent = getParent(pointer);
|
17281 |
|
17282 |
-
if (formatPlaceholder.format === undefined) {
|
17283 |
-
pointer = getParent(parent);
|
17284 |
-
} else {
|
17285 |
-
pointer = append(parent, fromFormat(formatPlaceholder.format));
|
17286 |
-
}
|
17287 |
|
17288 |
-
|
17289 |
-
}
|
17290 |
|
17291 |
-
|
17292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17293 |
|
17294 |
-
|
17295 |
-
|
17296 |
-
|
|
|
|
|
|
|
17297 |
|
17298 |
-
|
17299 |
-
|
17300 |
-
|
17301 |
-
|
17302 |
-
|
17303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17304 |
}
|
17305 |
-
|
17306 |
-
return accumulator;
|
17307 |
-
}, [multilineFormat]);
|
17308 |
-
} else {
|
17309 |
-
characterFormats = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(lastSeparatorFormats).concat(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(characterFormats || []));
|
17310 |
}
|
17311 |
-
}
|
17312 |
-
|
17313 |
-
var pointer = getLastChild(tree); // Set selection for the start of line.
|
17314 |
|
17315 |
-
|
17316 |
-
|
17317 |
-
|
17318 |
-
|
17319 |
-
|
17320 |
-
|
|
|
17321 |
|
17322 |
-
|
17323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17324 |
}
|
17325 |
|
17326 |
-
|
17327 |
-
|
17328 |
-
|
17329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17330 |
|
17331 |
-
if (characterFormats) {
|
17332 |
-
characterFormats.forEach(function (format, formatIndex) {
|
17333 |
-
if (pointer && lastCharacterFormats && format === lastCharacterFormats[formatIndex] && ( // Do not reuse the last element if the character is a
|
17334 |
-
// line separator.
|
17335 |
-
character !== __WEBPACK_IMPORTED_MODULE_3__special_characters__["a" /* LINE_SEPARATOR */] || characterFormats.length - 1 !== formatIndex)) {
|
17336 |
-
pointer = getLastChild(pointer);
|
17337 |
-
return;
|
17338 |
-
}
|
17339 |
|
17340 |
-
var
|
17341 |
-
var
|
|
|
17342 |
|
17343 |
-
if (
|
17344 |
-
|
17345 |
}
|
17346 |
-
|
17347 |
-
pointer = append(format.object ? parent : newNode, '');
|
17348 |
-
});
|
17349 |
-
} // No need for further processing if the character is a line separator.
|
17350 |
-
|
17351 |
-
|
17352 |
-
if (character === __WEBPACK_IMPORTED_MODULE_3__special_characters__["a" /* LINE_SEPARATOR */]) {
|
17353 |
-
lastCharacterFormats = characterFormats;
|
17354 |
-
lastCharacter = character;
|
17355 |
-
return "continue";
|
17356 |
-
}
|
17357 |
-
|
17358 |
-
pointer = setFormatPlaceholder(pointer, 0); // If there is selection at 0, handle it before characters are inserted.
|
17359 |
-
|
17360 |
-
if (i === 0) {
|
17361 |
-
if (onStartIndex && start === 0) {
|
17362 |
-
onStartIndex(tree, pointer);
|
17363 |
-
}
|
17364 |
-
|
17365 |
-
if (onEndIndex && end === 0) {
|
17366 |
-
onEndIndex(tree, pointer);
|
17367 |
}
|
17368 |
-
}
|
17369 |
-
|
17370 |
-
if (character !== __WEBPACK_IMPORTED_MODULE_3__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */]) {
|
17371 |
-
if (character === '\n') {
|
17372 |
-
pointer = append(getParent(pointer), {
|
17373 |
-
type: 'br',
|
17374 |
-
object: true
|
17375 |
-
}); // Ensure pointer is text node.
|
17376 |
|
17377 |
-
|
17378 |
-
|
17379 |
-
|
17380 |
-
|
17381 |
-
|
|
|
|
|
|
|
|
|
|
|
17382 |
}
|
17383 |
-
}
|
17384 |
|
17385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17386 |
|
17387 |
-
if (onStartIndex && start === i + 1) {
|
17388 |
-
onStartIndex(tree, pointer);
|
17389 |
-
}
|
17390 |
|
17391 |
-
|
17392 |
-
|
17393 |
-
|
17394 |
|
17395 |
-
|
17396 |
-
|
17397 |
-
|
|
|
|
|
17398 |
|
17399 |
-
|
17400 |
-
|
|
|
|
|
|
|
|
|
|
|
17401 |
|
17402 |
-
|
17403 |
-
|
|
|
|
|
|
|
|
|
|
|
17404 |
|
17405 |
-
return tree;
|
17406 |
-
}
|
17407 |
-
//# sourceMappingURL=to-tree.js.map
|
17408 |
|
17409 |
-
|
17410 |
-
|
17411 |
-
|
17412 |
|
17413 |
-
|
17414 |
-
|
17415 |
-
|
17416 |
-
|
|
|
|
|
|
|
|
|
17417 |
|
|
|
|
|
|
|
17418 |
|
17419 |
-
|
17420 |
-
|
17421 |
-
|
17422 |
-
|
17423 |
-
|
17424 |
-
*
|
17425 |
-
* Sequential focus navigation:
|
17426 |
-
* - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
|
17427 |
-
*
|
17428 |
-
* Disabled elements:
|
17429 |
-
* - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
|
17430 |
-
*
|
17431 |
-
* getClientRects algorithm (requiring layout box):
|
17432 |
-
* - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
|
17433 |
-
*
|
17434 |
-
* AREA elements associated with an IMG:
|
17435 |
-
* - https://w3c.github.io/html/editing.html#data-model
|
17436 |
-
*/
|
17437 |
-
var SELECTOR = ['[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(',');
|
17438 |
-
/**
|
17439 |
-
* Returns true if the specified element is visible (i.e. neither display: none
|
17440 |
-
* nor visibility: hidden).
|
17441 |
-
*
|
17442 |
-
* @param {Element} element DOM element to test.
|
17443 |
-
*
|
17444 |
-
* @return {boolean} Whether element is visible.
|
17445 |
-
*/
|
17446 |
|
17447 |
-
|
17448 |
-
|
17449 |
-
|
17450 |
-
|
17451 |
-
|
17452 |
-
|
17453 |
-
|
17454 |
-
|
17455 |
-
|
17456 |
-
|
17457 |
-
* @return {boolean} Whether area element is valid for focus.
|
17458 |
-
*/
|
17459 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17460 |
|
17461 |
-
|
17462 |
-
|
|
|
|
|
|
|
|
|
|
|
17463 |
|
17464 |
-
|
17465 |
-
|
17466 |
-
|
|
|
|
|
|
|
17467 |
|
17468 |
-
|
17469 |
-
return !!img && isVisible(img);
|
17470 |
-
}
|
17471 |
-
/**
|
17472 |
-
* Returns all focusable elements within a given context.
|
17473 |
-
*
|
17474 |
-
* @param {Element} context Element in which to search.
|
17475 |
-
*
|
17476 |
-
* @return {Element[]} Focusable elements.
|
17477 |
-
*/
|
17478 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17479 |
|
17480 |
-
|
17481 |
-
|
17482 |
-
|
17483 |
-
|
17484 |
-
|
17485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17486 |
|
17487 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17488 |
|
17489 |
-
|
17490 |
-
|
17491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17492 |
|
17493 |
-
return true;
|
17494 |
-
});
|
17495 |
-
}
|
17496 |
-
//# sourceMappingURL=focusable.js.map
|
17497 |
|
17498 |
-
|
17499 |
-
/* 128 */
|
17500 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
17501 |
|
17502 |
-
|
17503 |
-
|
17504 |
-
|
17505 |
-
|
17506 |
-
|
17507 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
17508 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
17509 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
17510 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(0);
|
17511 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
|
17512 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
|
17513 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_compose__ = __webpack_require__(14);
|
17514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17515 |
|
|
|
17516 |
|
|
|
17517 |
|
|
|
|
|
|
|
|
|
17518 |
|
|
|
17519 |
|
|
|
|
|
|
|
|
|
|
|
17520 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17521 |
|
|
|
17522 |
|
17523 |
-
|
17524 |
-
*
|
17525 |
-
|
|
|
17526 |
|
17527 |
-
|
17528 |
-
|
17529 |
-
|
|
|
17530 |
|
|
|
|
|
|
|
17531 |
|
|
|
|
|
17532 |
|
17533 |
-
|
17534 |
-
|
17535 |
-
|
17536 |
-
|
17537 |
-
* @type {string[]}
|
17538 |
-
*/
|
17539 |
|
17540 |
-
|
17541 |
-
|
17542 |
-
|
17543 |
-
|
17544 |
-
|
17545 |
-
|
17546 |
-
|
17547 |
-
|
17548 |
-
|
17549 |
-
|
17550 |
-
|
17551 |
-
|
17552 |
-
|
17553 |
-
|
17554 |
-
|
17555 |
-
|
17556 |
-
|
17557 |
-
|
17558 |
-
|
17559 |
-
|
17560 |
-
|
17561 |
-
|
17562 |
-
|
17563 |
-
}
|
17564 |
-
|
17565 |
-
|
17566 |
-
|
17567 |
-
|
17568 |
-
|
17569 |
-
Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
|
17570 |
-
|
17571 |
-
function _class() {
|
17572 |
-
var _this;
|
17573 |
|
17574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17575 |
|
17576 |
-
|
17577 |
-
|
17578 |
-
|
17579 |
-
|
17580 |
-
|
17581 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17582 |
}
|
17583 |
|
17584 |
-
|
17585 |
-
|
17586 |
-
|
17587 |
-
this.cancelBlurCheck();
|
17588 |
-
}
|
17589 |
-
}, {
|
17590 |
-
key: "bindNode",
|
17591 |
-
value: function bindNode(node) {
|
17592 |
-
if (node) {
|
17593 |
-
this.node = node;
|
17594 |
-
} else {
|
17595 |
-
delete this.node;
|
17596 |
-
this.cancelBlurCheck();
|
17597 |
-
}
|
17598 |
-
}
|
17599 |
-
}, {
|
17600 |
-
key: "queueBlurCheck",
|
17601 |
-
value: function queueBlurCheck(event) {
|
17602 |
-
var _this2 = this;
|
17603 |
-
|
17604 |
-
// React does not allow using an event reference asynchronously
|
17605 |
-
// due to recycling behavior, except when explicitly persisted.
|
17606 |
-
event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
|
17607 |
-
|
17608 |
-
if (this.preventBlurCheck) {
|
17609 |
-
return;
|
17610 |
-
}
|
17611 |
|
17612 |
-
|
17613 |
-
|
17614 |
-
_this2.node.handleFocusOutside(event);
|
17615 |
-
}
|
17616 |
-
}, 0);
|
17617 |
-
}
|
17618 |
-
}, {
|
17619 |
-
key: "cancelBlurCheck",
|
17620 |
-
value: function cancelBlurCheck() {
|
17621 |
-
clearTimeout(this.blurCheckTimeout);
|
17622 |
-
}
|
17623 |
-
/**
|
17624 |
-
* Handles a mousedown or mouseup event to respectively assign and
|
17625 |
-
* unassign a flag for preventing blur check on button elements. Some
|
17626 |
-
* browsers, namely Firefox and Safari, do not emit a focus event on
|
17627 |
-
* button elements when clicked, while others do. The logic here
|
17628 |
-
* intends to normalize this as treating click on buttons as focus.
|
17629 |
-
*
|
17630 |
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
17631 |
-
*
|
17632 |
-
* @param {MouseEvent} event Event for mousedown or mouseup.
|
17633 |
-
*/
|
17634 |
|
17635 |
-
|
17636 |
-
|
17637 |
-
value: function normalizeButtonFocus(event) {
|
17638 |
-
var type = event.type,
|
17639 |
-
target = event.target;
|
17640 |
-
var isInteractionEnd = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["includes"])(['mouseup', 'touchend'], type);
|
17641 |
|
17642 |
-
|
17643 |
-
|
17644 |
-
|
17645 |
-
|
17646 |
-
|
17647 |
-
|
17648 |
-
|
17649 |
-
|
17650 |
-
|
17651 |
-
|
17652 |
-
|
|
|
|
|
|
|
17653 |
|
17654 |
-
|
17655 |
-
|
17656 |
-
|
17657 |
-
onMouseDown: this.normalizeButtonFocus,
|
17658 |
-
onMouseUp: this.normalizeButtonFocus,
|
17659 |
-
onTouchStart: this.normalizeButtonFocus,
|
17660 |
-
onTouchEnd: this.normalizeButtonFocus,
|
17661 |
-
onBlur: this.queueBlurCheck
|
17662 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(WrappedComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
|
17663 |
-
ref: this.bindNode
|
17664 |
-
}, this.props)));
|
17665 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
17666 |
-
}
|
17667 |
-
}]);
|
17668 |
|
17669 |
-
|
17670 |
-
|
17671 |
-
|
17672 |
-
}, 'withFocusOutside'));
|
17673 |
-
//# sourceMappingURL=index.js.map
|
17674 |
|
17675 |
-
|
17676 |
-
|
17677 |
-
|
17678 |
|
17679 |
-
|
|
|
|
|
|
|
17680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
17681 |
|
17682 |
-
|
|
|
|
|
17683 |
|
17684 |
-
|
|
|
|
|
17685 |
|
17686 |
-
|
|
|
|
|
|
|
17687 |
|
17688 |
-
|
|
|
|
|
|
|
17689 |
|
17690 |
-
|
|
|
|
|
17691 |
|
17692 |
-
|
|
|
|
|
17693 |
|
17694 |
-
|
17695 |
-
|
17696 |
-
|
|
|
|
|
|
|
|
|
17697 |
|
17698 |
-
|
17699 |
-
|
|
|
17700 |
|
17701 |
-
|
17702 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17703 |
|
17704 |
-
|
17705 |
-
|
|
|
|
|
|
|
|
|
|
|
17706 |
|
17707 |
-
|
|
|
|
|
|
|
17708 |
|
17709 |
-
|
17710 |
-
|
17711 |
-
|
|
|
|
|
17712 |
|
17713 |
-
|
17714 |
-
|
17715 |
-
|
17716 |
-
document.addEventListener('click', this.handleClickOutside, true);
|
17717 |
-
}
|
17718 |
-
}, {
|
17719 |
-
key: 'componentWillUnmount',
|
17720 |
-
value: function componentWillUnmount() {
|
17721 |
-
document.removeEventListener('click', this.handleClickOutside, true);
|
17722 |
-
}
|
17723 |
-
}, {
|
17724 |
-
key: 'handleClickOutside',
|
17725 |
-
value: function handleClickOutside(e) {
|
17726 |
-
var domNode = this.__domNode;
|
17727 |
-
if ((!domNode || !domNode.contains(e.target)) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') {
|
17728 |
-
this.__wrappedInstance.handleClickOutside(e);
|
17729 |
-
}
|
17730 |
-
}
|
17731 |
-
}, {
|
17732 |
-
key: 'render',
|
17733 |
-
value: function render() {
|
17734 |
-
var _this2 = this;
|
17735 |
|
17736 |
-
|
17737 |
-
|
17738 |
-
|
17739 |
|
17740 |
-
|
17741 |
-
|
17742 |
-
|
17743 |
-
|
17744 |
-
|
17745 |
-
|
17746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17747 |
}
|
17748 |
-
}
|
17749 |
-
|
17750 |
-
|
17751 |
-
}(React.Component);
|
17752 |
-
|
17753 |
-
EnhancedComponent.displayName = 'clickOutside(' + componentName + ')';
|
17754 |
-
|
17755 |
-
return hoistNonReactStatic(EnhancedComponent, WrappedComponent);
|
17756 |
-
};
|
17757 |
|
17758 |
/***/ }),
|
17759 |
-
/*
|
17760 |
-
/***/ (function(module,
|
17761 |
|
17762 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17763 |
|
17764 |
|
17765 |
-
/**
|
17766 |
-
* Copyright 2015, Yahoo! Inc.
|
17767 |
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
17768 |
-
*/
|
17769 |
-
var REACT_STATICS = {
|
17770 |
-
childContextTypes: true,
|
17771 |
-
contextTypes: true,
|
17772 |
-
defaultProps: true,
|
17773 |
-
displayName: true,
|
17774 |
-
getDefaultProps: true,
|
17775 |
-
getDerivedStateFromProps: true,
|
17776 |
-
mixins: true,
|
17777 |
-
propTypes: true,
|
17778 |
-
type: true
|
17779 |
-
};
|
17780 |
-
|
17781 |
-
var KNOWN_STATICS = {
|
17782 |
-
name: true,
|
17783 |
-
length: true,
|
17784 |
-
prototype: true,
|
17785 |
-
caller: true,
|
17786 |
-
callee: true,
|
17787 |
-
arguments: true,
|
17788 |
-
arity: true
|
17789 |
-
};
|
17790 |
-
|
17791 |
-
var defineProperty = Object.defineProperty;
|
17792 |
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
17793 |
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
17794 |
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
17795 |
-
var getPrototypeOf = Object.getPrototypeOf;
|
17796 |
-
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
17797 |
-
|
17798 |
-
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
17799 |
-
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
17800 |
-
|
17801 |
-
if (objectPrototype) {
|
17802 |
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
17803 |
-
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
17804 |
-
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
17805 |
-
}
|
17806 |
-
}
|
17807 |
|
17808 |
-
var keys = getOwnPropertyNames(sourceComponent);
|
17809 |
|
17810 |
-
if (getOwnPropertySymbols) {
|
17811 |
-
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
17812 |
-
}
|
17813 |
|
17814 |
-
for (var i = 0; i < keys.length; ++i) {
|
17815 |
-
var key = keys[i];
|
17816 |
-
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
17817 |
-
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
17818 |
-
try { // Avoid failures from read-only properties
|
17819 |
-
defineProperty(targetComponent, key, descriptor);
|
17820 |
-
} catch (e) {}
|
17821 |
-
}
|
17822 |
-
}
|
17823 |
|
17824 |
-
return targetComponent;
|
17825 |
-
}
|
17826 |
|
17827 |
-
return targetComponent;
|
17828 |
-
}
|
17829 |
|
17830 |
-
module.exports = hoistNonReactStatics;
|
17831 |
|
17832 |
|
17833 |
-
/***/ }),
|
17834 |
-
/* 131 */
|
17835 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
17836 |
|
17837 |
-
"use strict";
|
17838 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(0);
|
17839 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(2);
|
17840 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);
|
17841 |
|
17842 |
|
17843 |
-
/**
|
17844 |
-
* External dependencies
|
17845 |
-
*/
|
17846 |
|
17847 |
|
17848 |
-
function Shortcut(_ref) {
|
17849 |
-
var shortcut = _ref.shortcut,
|
17850 |
-
className = _ref.className;
|
17851 |
|
17852 |
-
if (!shortcut) {
|
17853 |
-
return null;
|
17854 |
-
}
|
17855 |
|
17856 |
-
var displayText;
|
17857 |
-
var ariaLabel;
|
17858 |
|
17859 |
-
if (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["isString"])(shortcut)) {
|
17860 |
-
displayText = shortcut;
|
17861 |
-
}
|
17862 |
|
17863 |
-
if (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["isObject"])(shortcut)) {
|
17864 |
-
displayText = shortcut.display;
|
17865 |
-
ariaLabel = shortcut.ariaLabel;
|
17866 |
-
}
|
17867 |
|
17868 |
-
return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("span", {
|
17869 |
-
className: className,
|
17870 |
-
"aria-label": ariaLabel
|
17871 |
-
}, displayText);
|
17872 |
-
}
|
17873 |
|
17874 |
-
/* harmony default export */ __webpack_exports__["a"] = (Shortcut);
|
17875 |
//# sourceMappingURL=index.js.map
|
17876 |
|
17877 |
/***/ }),
|
17878 |
-
/*
|
17879 |
-
/***/ (function(module,
|
17880 |
|
17881 |
"use strict";
|
17882 |
-
/* unused harmony export createScrollLockComponent */
|
17883 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
17884 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
17885 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
17886 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
17887 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
17888 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(0);
|
17889 |
|
17890 |
|
|
|
|
|
|
|
17891 |
|
|
|
|
|
|
|
|
|
|
|
17892 |
|
17893 |
|
|
|
|
|
|
|
17894 |
|
17895 |
-
|
17896 |
-
* WordPress dependencies
|
17897 |
-
*/
|
17898 |
|
17899 |
-
/**
|
17900 |
-
* Creates a ScrollLock component bound to the specified document.
|
17901 |
-
*
|
17902 |
-
* This function creates a ScrollLock component for the specified document
|
17903 |
-
* and is exposed so we can create an isolated component for unit testing.
|
17904 |
-
*
|
17905 |
-
* @param {Object} args Keyword args.
|
17906 |
-
* @param {HTMLDocument} args.htmlDocument The document to lock the scroll for.
|
17907 |
-
* @param {string} args.className The name of the class used to lock scrolling.
|
17908 |
-
* @return {Component} The bound ScrollLock component.
|
17909 |
-
*/
|
17910 |
|
17911 |
-
|
17912 |
-
|
17913 |
-
_ref$htmlDocument = _ref.htmlDocument,
|
17914 |
-
htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument,
|
17915 |
-
_ref$className = _ref.className,
|
17916 |
-
className = _ref$className === void 0 ? 'lockscroll' : _ref$className;
|
17917 |
|
17918 |
-
|
17919 |
-
|
17920 |
-
|
17921 |
-
|
17922 |
-
|
17923 |
-
* NOTE: It would be cleaner and possibly safer to find a localized solution such
|
17924 |
-
* as preventing default on certain touchmove events.
|
17925 |
-
*/
|
17926 |
|
17927 |
-
|
17928 |
-
|
17929 |
-
* Locks and unlocks scroll depending on the boolean argument.
|
17930 |
-
*
|
17931 |
-
* @param {boolean} locked Whether or not scroll should be locked.
|
17932 |
-
*/
|
17933 |
|
17934 |
-
|
17935 |
-
|
|
|
|
|
17936 |
|
17937 |
-
|
17938 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17939 |
}
|
|
|
17940 |
|
17941 |
-
|
17942 |
-
|
|
|
|
|
|
|
|
|
|
|
17943 |
|
17944 |
-
|
|
|
17945 |
|
17946 |
-
|
17947 |
-
|
|
|
|
|
17948 |
}
|
17949 |
-
}
|
17950 |
-
/**
|
17951 |
-
* Requests scroll lock.
|
17952 |
-
*
|
17953 |
-
* This function tracks requests for scroll lock. It locks scroll on the first
|
17954 |
-
* request and counts each request so `releaseLock` can unlock scroll when
|
17955 |
-
* all requests have been released.
|
17956 |
-
*/
|
17957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17958 |
|
17959 |
-
|
17960 |
-
if (lockCounter === 0) {
|
17961 |
-
setLocked(true);
|
17962 |
}
|
17963 |
|
17964 |
-
|
17965 |
-
|
17966 |
-
|
17967 |
-
* Releases a request for scroll lock.
|
17968 |
-
*
|
17969 |
-
* This function tracks released requests for scroll lock. When all requests
|
17970 |
-
* have been released, it unlocks scroll.
|
17971 |
-
*/
|
17972 |
|
|
|
|
|
|
|
|
|
17973 |
|
17974 |
-
|
17975 |
-
|
17976 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17977 |
}
|
17978 |
|
17979 |
-
|
17980 |
-
|
17981 |
|
17982 |
-
|
17983 |
-
|
17984 |
-
|
17985 |
-
|
|
|
|
|
|
|
|
|
17986 |
|
17987 |
-
|
17988 |
-
|
|
|
|
|
|
|
|
|
17989 |
|
17990 |
-
|
17991 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17992 |
|
17993 |
-
|
17994 |
-
|
|
|
|
|
|
|
|
|
17995 |
|
17996 |
-
|
17997 |
-
|
17998 |
-
|
17999 |
-
|
18000 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18001 |
}
|
18002 |
-
/**
|
18003 |
-
* Releases scroll lock before unmount.
|
18004 |
-
*/
|
18005 |
|
18006 |
-
|
18007 |
-
|
18008 |
-
|
18009 |
-
releaseLock();
|
18010 |
}
|
18011 |
-
/**
|
18012 |
-
* Render nothing as this component is merely a way to declare scroll lock.
|
18013 |
-
*
|
18014 |
-
* @return {null} Render nothing by returning `null`.
|
18015 |
-
*/
|
18016 |
|
18017 |
-
|
18018 |
-
|
18019 |
-
|
18020 |
-
return null;
|
18021 |
}
|
18022 |
-
}]);
|
18023 |
|
18024 |
-
|
18025 |
-
|
18026 |
-
|
18027 |
-
}
|
18028 |
-
/* harmony default export */ __webpack_exports__["a"] = (createScrollLockComponent());
|
18029 |
-
//# sourceMappingURL=index.js.map
|
18030 |
|
18031 |
-
|
18032 |
-
|
18033 |
-
|
|
|
|
|
|
|
|
|
18034 |
|
18035 |
-
|
18036 |
-
|
18037 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
18038 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wordpress_element__ = __webpack_require__(0);
|
18039 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__slot__ = __webpack_require__(464);
|
18040 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fill__ = __webpack_require__(465);
|
18041 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__context__ = __webpack_require__(88);
|
18042 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__slot__["a"]; });
|
18043 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__fill__["a"]; });
|
18044 |
-
/* unused harmony reexport Provider */
|
18045 |
-
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_4__context__["a"]; });
|
18046 |
|
|
|
|
|
|
|
18047 |
|
|
|
|
|
|
|
18048 |
|
18049 |
-
|
18050 |
-
|
18051 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18052 |
|
|
|
18053 |
|
|
|
|
|
18054 |
|
|
|
|
|
|
|
18055 |
|
|
|
|
|
|
|
|
|
18056 |
|
|
|
|
|
18057 |
|
18058 |
-
function
|
18059 |
-
|
18060 |
-
|
18061 |
-
name: name
|
18062 |
-
}, props));
|
18063 |
-
};
|
18064 |
|
18065 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18066 |
|
18067 |
-
|
18068 |
-
|
18069 |
-
|
18070 |
-
|
18071 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18072 |
|
18073 |
-
SlotComponent.displayName = name + 'Slot';
|
18074 |
-
return {
|
18075 |
-
Fill: FillComponent,
|
18076 |
-
Slot: SlotComponent
|
18077 |
-
};
|
18078 |
-
}
|
18079 |
-
//# sourceMappingURL=index.js.map
|
18080 |
|
18081 |
/***/ }),
|
18082 |
-
/*
|
18083 |
-
/***/ (function(module,
|
18084 |
|
18085 |
"use strict";
|
18086 |
-
/*
|
18087 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return speak; });
|
18088 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__addContainer__ = __webpack_require__(466);
|
18089 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clear__ = __webpack_require__(467);
|
18090 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__wordpress_dom_ready__ = __webpack_require__(468);
|
18091 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filterMessage__ = __webpack_require__(469);
|
18092 |
|
|
|
|
|
|
|
|
|
|
|
18093 |
|
|
|
18094 |
|
|
|
|
|
|
|
18095 |
|
18096 |
-
|
18097 |
-
|
18098 |
-
*/
|
|
|
|
|
18099 |
|
18100 |
-
var setup = function setup() {
|
18101 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
18102 |
-
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
18103 |
|
18104 |
-
if (containerPolite === null) {
|
18105 |
-
containerPolite = Object(__WEBPACK_IMPORTED_MODULE_0__addContainer__["a" /* default */])('polite');
|
18106 |
-
}
|
18107 |
|
18108 |
-
if (containerAssertive === null) {
|
18109 |
-
containerAssertive = Object(__WEBPACK_IMPORTED_MODULE_0__addContainer__["a" /* default */])('assertive');
|
18110 |
-
}
|
18111 |
-
};
|
18112 |
/**
|
18113 |
-
*
|
18114 |
*/
|
18115 |
|
18116 |
-
Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_dom_ready__["a" /* default */])(setup);
|
18117 |
/**
|
18118 |
-
*
|
|
|
|
|
|
|
18119 |
*
|
18120 |
-
* @param {string}
|
18121 |
-
*
|
18122 |
-
*
|
18123 |
*/
|
18124 |
|
18125 |
-
|
18126 |
-
|
18127 |
-
|
18128 |
-
message = Object(__WEBPACK_IMPORTED_MODULE_3__filterMessage__["a" /* default */])(message);
|
18129 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
18130 |
-
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
18131 |
|
18132 |
-
|
18133 |
-
|
18134 |
-
|
18135 |
-
|
18136 |
-
|
18137 |
-
}
|
18138 |
-
|
|
|
|
|
18139 |
|
18140 |
/***/ }),
|
18141 |
-
/*
|
18142 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
18143 |
|
18144 |
"use strict";
|
18145 |
-
/* harmony export (
|
18146 |
-
|
18147 |
-
|
18148 |
-
|
18149 |
-
|
18150 |
-
|
18151 |
-
|
18152 |
-
|
18153 |
-
|
18154 |
-
|
18155 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
|
18156 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
|
18157 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__alpha__ = __webpack_require__(477);
|
18158 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__hue__ = __webpack_require__(481);
|
18159 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__inputs__ = __webpack_require__(482);
|
18160 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__saturation__ = __webpack_require__(483);
|
18161 |
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(55);
|
18162 |
|
|
|
|
|
|
|
18163 |
|
|
|
|
|
|
|
18164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18165 |
|
|
|
|
|
|
|
18166 |
|
|
|
|
|
|
|
|
|
18167 |
|
18168 |
|
|
|
18169 |
|
18170 |
-
|
18171 |
-
* Parts of this source were derived and modified from react-color,
|
18172 |
-
* released under the MIT license.
|
18173 |
-
*
|
18174 |
-
* https://github.com/casesandberg/react-color/
|
18175 |
-
*
|
18176 |
-
* Copyright (c) 2015 Case Sandberg
|
18177 |
-
*
|
18178 |
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
18179 |
-
* of this software and associated documentation files (the "Software"), to deal
|
18180 |
-
* in the Software without restriction, including without limitation the rights
|
18181 |
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18182 |
-
* copies of the Software, and to permit persons to whom the Software is
|
18183 |
-
* furnished to do so, subject to the following conditions:
|
18184 |
-
*
|
18185 |
-
* The above copyright notice and this permission notice shall be included in
|
18186 |
-
* all copies or substantial portions of the Software.
|
18187 |
-
*
|
18188 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18189 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18190 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18191 |
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18192 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18193 |
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
18194 |
-
* THE SOFTWARE.
|
18195 |
-
*/
|
18196 |
|
18197 |
/**
|
18198 |
* External dependencies
|
18199 |
*/
|
18200 |
|
|
|
|
|
|
|
18201 |
|
18202 |
/**
|
18203 |
-
*
|
|
|
|
|
|
|
18204 |
*/
|
18205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18206 |
|
18207 |
/**
|
18208 |
-
*
|
|
|
|
|
|
|
|
|
18209 |
*/
|
18210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18212 |
|
|
|
|
|
|
|
18213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18214 |
|
18215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18216 |
|
18217 |
-
var ColorPicker =
|
18218 |
-
/*#__PURE__*/
|
18219 |
-
function (_Component) {
|
18220 |
-
Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(ColorPicker, _Component);
|
18221 |
|
18222 |
-
function
|
18223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18224 |
|
18225 |
-
var _ref$color = _ref.color,
|
18226 |
-
color = _ref$color === void 0 ? '0071a1' : _ref$color;
|
18227 |
|
18228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18229 |
|
18230 |
-
|
18231 |
-
|
18232 |
-
|
18233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18234 |
}
|
18235 |
|
18236 |
-
|
18237 |
-
|
18238 |
-
|
18239 |
-
|
18240 |
-
|
18241 |
-
|
18242 |
-
|
18243 |
-
|
18244 |
-
|
18245 |
-
|
18246 |
-
var colors = Object(__WEBPACK_IMPORTED_MODULE_13__utils__["d" /* colorToState */])(data, data.h || oldHue);
|
18247 |
-
this.setState(colors, Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["debounce"])(Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["partial"])(onChangeComplete, colors), 100));
|
18248 |
-
}
|
18249 |
-
}
|
18250 |
-
}, {
|
18251 |
-
key: "render",
|
18252 |
-
value: function render() {
|
18253 |
-
var _this$props2 = this.props,
|
18254 |
-
className = _this$props2.className,
|
18255 |
-
disableAlpha = _this$props2.disableAlpha;
|
18256 |
-
var _this$state = this.state,
|
18257 |
-
color = _this$state.color,
|
18258 |
-
hex = _this$state.hex,
|
18259 |
-
hsl = _this$state.hsl,
|
18260 |
-
hsv = _this$state.hsv,
|
18261 |
-
rgb = _this$state.rgb;
|
18262 |
-
var classes = __WEBPACK_IMPORTED_MODULE_7_classnames___default()(className, {
|
18263 |
-
'components-color-picker': true,
|
18264 |
-
'is-alpha-disabled': disableAlpha,
|
18265 |
-
'is-alpha-enabled': !disableAlpha
|
18266 |
-
});
|
18267 |
-
return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18268 |
-
className: classes
|
18269 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18270 |
-
className: "components-color-picker__saturation"
|
18271 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_12__saturation__["a" /* default */], {
|
18272 |
-
hsl: hsl,
|
18273 |
-
hsv: hsv,
|
18274 |
-
onChange: this.handleChange
|
18275 |
-
})), Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18276 |
-
className: "components-color-picker__body"
|
18277 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18278 |
-
className: "components-color-picker__controls"
|
18279 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18280 |
-
className: "components-color-picker__swatch"
|
18281 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18282 |
-
className: "components-color-picker__active",
|
18283 |
-
style: {
|
18284 |
-
backgroundColor: color && color.toRgbString()
|
18285 |
-
}
|
18286 |
-
})), Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
18287 |
-
className: "components-color-picker__toggles"
|
18288 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_10__hue__["a" /* default */], {
|
18289 |
-
hsl: hsl,
|
18290 |
-
onChange: this.handleChange
|
18291 |
-
}), disableAlpha ? null : Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_9__alpha__["a" /* default */], {
|
18292 |
-
rgb: rgb,
|
18293 |
-
hsl: hsl,
|
18294 |
-
onChange: this.handleChange
|
18295 |
-
}))), Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_11__inputs__["a" /* default */], {
|
18296 |
-
rgb: rgb,
|
18297 |
-
hsl: hsl,
|
18298 |
-
hex: hex,
|
18299 |
-
onChange: this.handleChange,
|
18300 |
-
disableAlpha: disableAlpha
|
18301 |
-
})));
|
18302 |
-
}
|
18303 |
-
}]);
|
18304 |
-
|
18305 |
-
return ColorPicker;
|
18306 |
-
}(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */]);
|
18307 |
-
|
18308 |
-
|
18309 |
-
//# sourceMappingURL=index.js.map
|
18310 |
|
18311 |
/***/ }),
|
18312 |
-
/*
|
18313 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
18314 |
|
18315 |
"use strict";
|
18316 |
-
/* harmony
|
18317 |
-
/* harmony import */ var
|
18318 |
-
/* harmony import */ var
|
18319 |
-
/* harmony import */ var
|
18320 |
-
|
18321 |
|
18322 |
|
|
|
18323 |
|
|
|
18324 |
|
18325 |
/**
|
18326 |
-
*
|
18327 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18328 |
|
18329 |
/**
|
18330 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18331 |
*/
|
18332 |
|
|
|
|
|
|
|
18333 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18334 |
|
18335 |
-
|
18336 |
-
|
18337 |
-
|
18338 |
-
help = _ref.help,
|
18339 |
-
className = _ref.className,
|
18340 |
-
instanceId = _ref.instanceId,
|
18341 |
-
onChange = _ref.onChange,
|
18342 |
-
_ref$type = _ref.type,
|
18343 |
-
type = _ref$type === void 0 ? 'text' : _ref$type,
|
18344 |
-
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["label", "value", "help", "className", "instanceId", "onChange", "type"]);
|
18345 |
|
18346 |
-
|
|
|
|
|
|
|
|
|
|
|
18347 |
|
18348 |
-
|
18349 |
-
|
18350 |
-
|
|
|
|
|
|
|
18351 |
|
18352 |
-
|
18353 |
-
|
18354 |
-
|
18355 |
-
|
18356 |
-
className: className
|
18357 |
-
}, Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_element__["h" /* createElement */])("input", Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
|
18358 |
-
className: "components-text-control__input",
|
18359 |
-
type: type,
|
18360 |
-
id: id,
|
18361 |
-
value: value,
|
18362 |
-
onChange: onChangeValue,
|
18363 |
-
"aria-describedby": !!help ? id + '__help' : undefined
|
18364 |
-
}, props)));
|
18365 |
}
|
|
|
|
|
|
|
|
|
|
|
18366 |
|
18367 |
-
|
|
|
|
|
|
|
|
|
|
|
18368 |
//# sourceMappingURL=index.js.map
|
18369 |
|
18370 |
/***/ }),
|
18371 |
-
/*
|
18372 |
/***/ (function(module, exports, __webpack_require__) {
|
18373 |
|
18374 |
-
"
|
|
|
18375 |
|
18376 |
|
18377 |
-
|
|
|
|
|
18378 |
|
18379 |
-
|
|
|
|
|
18380 |
|
18381 |
-
|
18382 |
-
var
|
18383 |
-
var targetIndex = start;
|
18384 |
-
var sourceIndex = 0;
|
18385 |
|
18386 |
-
|
18387 |
-
|
18388 |
-
|
18389 |
-
|
18390 |
-
|
18391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18392 |
|
18393 |
-
|
18394 |
-
var P = ES.ToString(sourceIndex);
|
18395 |
-
var exists = ES.HasProperty(source, P);
|
18396 |
-
if (exists) {
|
18397 |
-
var element = ES.Get(source, P);
|
18398 |
-
/*
|
18399 |
-
if (typeof mapperFunction !== 'undefined') {
|
18400 |
-
if (arguments.length <= 6) {
|
18401 |
-
throw new TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
|
18402 |
-
}
|
18403 |
-
element = ES.Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
|
18404 |
-
}
|
18405 |
-
*/
|
18406 |
-
var shouldFlatten = false;
|
18407 |
-
if (depth > 0) {
|
18408 |
-
shouldFlatten = ES.IsArray(element);
|
18409 |
-
}
|
18410 |
-
if (shouldFlatten) {
|
18411 |
-
var elementLen = ES.ToLength(ES.Get(element, 'length'));
|
18412 |
-
targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
|
18413 |
-
} else {
|
18414 |
-
if (targetIndex >= MAX_SAFE_INTEGER) {
|
18415 |
-
throw new TypeError('index too large');
|
18416 |
-
}
|
18417 |
-
ES.CreateDataPropertyOrThrow(target, ES.ToString(targetIndex), element);
|
18418 |
-
targetIndex += 1;
|
18419 |
-
}
|
18420 |
}
|
18421 |
-
|
18422 |
-
}
|
18423 |
|
18424 |
-
|
18425 |
-
};
|
18426 |
|
18427 |
-
|
18428 |
-
|
18429 |
-
var sourceLen = ES.ToLength(ES.Get(O, 'length'));
|
18430 |
|
18431 |
-
|
18432 |
-
|
18433 |
-
|
18434 |
-
|
18435 |
|
18436 |
-
|
18437 |
-
|
18438 |
-
|
18439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18440 |
|
18441 |
|
18442 |
/***/ }),
|
18443 |
-
/*
|
18444 |
-
/***/ (function(module,
|
18445 |
|
18446 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18447 |
|
18448 |
|
18449 |
-
var ES2015 = __webpack_require__(139);
|
18450 |
-
var assign = __webpack_require__(91);
|
18451 |
|
18452 |
-
var
|
18453 |
-
// https://github.com/tc39/ecma262/pull/60
|
18454 |
-
SameValueNonNumber: function SameValueNonNumber(x, y) {
|
18455 |
-
if (typeof x === 'number' || typeof x !== typeof y) {
|
18456 |
-
throw new TypeError('SameValueNonNumber requires two non-number values of the same type.');
|
18457 |
-
}
|
18458 |
-
return this.SameValue(x, y);
|
18459 |
-
}
|
18460 |
-
});
|
18461 |
|
18462 |
-
|
18463 |
|
|
|
|
|
|
|
18464 |
|
18465 |
-
/***/ }),
|
18466 |
-
/* 139 */
|
18467 |
-
/***/ (function(module, exports, __webpack_require__) {
|
18468 |
|
18469 |
-
|
|
|
|
|
18470 |
|
18471 |
|
18472 |
-
var has = __webpack_require__(36);
|
18473 |
-
var toPrimitive = __webpack_require__(494);
|
18474 |
-
var keys = __webpack_require__(90);
|
18475 |
|
18476 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18477 |
|
18478 |
-
|
18479 |
-
|
18480 |
-
|
18481 |
-
|
18482 |
-
|
18483 |
-
var $Number = GetIntrinsic('%Number%');
|
18484 |
-
var $Symbol = GetIntrinsic('%Symbol%', true);
|
18485 |
-
var $RegExp = GetIntrinsic('%RegExp%');
|
18486 |
|
18487 |
-
|
18488 |
-
|
18489 |
-
|
18490 |
-
|
18491 |
-
|
18492 |
-
|
18493 |
-
|
18494 |
-
|
18495 |
-
|
18496 |
-
var mod = __webpack_require__(147);
|
18497 |
-
var isPrimitive = __webpack_require__(498);
|
18498 |
-
var parseInteger = parseInt;
|
18499 |
-
var bind = __webpack_require__(30);
|
18500 |
-
var arraySlice = bind.call(Function.call, $Array.prototype.slice);
|
18501 |
-
var strSlice = bind.call(Function.call, $String.prototype.slice);
|
18502 |
-
var isBinary = bind.call(Function.call, $RegExp.prototype.test, /^0b[01]+$/i);
|
18503 |
-
var isOctal = bind.call(Function.call, $RegExp.prototype.test, /^0o[0-7]+$/i);
|
18504 |
-
var regexExec = bind.call(Function.call, $RegExp.prototype.exec);
|
18505 |
-
var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
|
18506 |
-
var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
|
18507 |
-
var hasNonWS = bind.call(Function.call, $RegExp.prototype.test, nonWSregex);
|
18508 |
-
var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i;
|
18509 |
-
var isInvalidHexLiteral = bind.call(Function.call, $RegExp.prototype.test, invalidHexLiteral);
|
18510 |
-
var $charCodeAt = bind.call(Function.call, $String.prototype.charCodeAt);
|
18511 |
|
18512 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18513 |
|
18514 |
-
|
18515 |
-
|
18516 |
-
|
18517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18518 |
|
18519 |
-
var $floor = Math.floor;
|
18520 |
-
var $abs = Math.abs;
|
18521 |
|
18522 |
-
var
|
18523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18524 |
|
18525 |
-
var $isExtensible = $Object.isExtensible;
|
18526 |
|
18527 |
-
|
|
|
18528 |
|
18529 |
-
|
18530 |
-
|
18531 |
-
|
18532 |
-
'\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
|
18533 |
-
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
|
18534 |
-
'\u2029\uFEFF'
|
18535 |
-
].join('');
|
18536 |
-
var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
|
18537 |
-
var replace = bind.call(Function.call, $String.prototype.replace);
|
18538 |
-
var trim = function (value) {
|
18539 |
-
return replace(value, trimRegex, '');
|
18540 |
-
};
|
18541 |
|
18542 |
-
|
|
|
18543 |
|
18544 |
-
var
|
|
|
|
|
|
|
|
|
|
|
18545 |
|
18546 |
-
|
18547 |
-
var
|
|
|
|
|
18548 |
|
18549 |
-
|
18550 |
-
|
18551 |
-
|
18552 |
-
if (!this.IsCallable(F)) {
|
18553 |
-
throw new $TypeError(F + ' is not a function');
|
18554 |
-
}
|
18555 |
-
return F.apply(V, args);
|
18556 |
-
},
|
18557 |
|
18558 |
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive
|
18559 |
-
ToPrimitive: toPrimitive,
|
18560 |
|
18561 |
-
|
18562 |
-
// ToBoolean: ES5.ToBoolean,
|
18563 |
|
18564 |
-
|
18565 |
-
|
18566 |
-
|
18567 |
-
if (typeof value === 'symbol') {
|
18568 |
-
throw new $TypeError('Cannot convert a Symbol value to a number');
|
18569 |
-
}
|
18570 |
-
if (typeof value === 'string') {
|
18571 |
-
if (isBinary(value)) {
|
18572 |
-
return this.ToNumber(parseInteger(strSlice(value, 2), 2));
|
18573 |
-
} else if (isOctal(value)) {
|
18574 |
-
return this.ToNumber(parseInteger(strSlice(value, 2), 8));
|
18575 |
-
} else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
|
18576 |
-
return NaN;
|
18577 |
-
} else {
|
18578 |
-
var trimmed = trim(value);
|
18579 |
-
if (trimmed !== value) {
|
18580 |
-
return this.ToNumber(trimmed);
|
18581 |
-
}
|
18582 |
-
}
|
18583 |
-
}
|
18584 |
-
return $Number(value);
|
18585 |
-
},
|
18586 |
|
18587 |
-
|
18588 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18589 |
|
18590 |
-
|
18591 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18592 |
|
18593 |
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32
|
18594 |
-
// ToUint32: ES5.ToUint32,
|
18595 |
|
18596 |
-
|
18597 |
-
|
18598 |
-
var int16bit = this.ToUint16(argument);
|
18599 |
-
return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
|
18600 |
-
},
|
18601 |
|
18602 |
-
|
18603 |
-
|
|
|
18604 |
|
18605 |
-
|
18606 |
-
|
18607 |
-
|
18608 |
-
|
18609 |
-
|
18610 |
|
18611 |
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8
|
18612 |
-
ToUint8: function ToUint8(argument) {
|
18613 |
-
var number = this.ToNumber(argument);
|
18614 |
-
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
|
18615 |
-
var posInt = sign(number) * $floor($abs(number));
|
18616 |
-
return mod(posInt, 0x100);
|
18617 |
-
},
|
18618 |
|
18619 |
-
|
18620 |
-
|
18621 |
-
|
18622 |
-
|
18623 |
-
|
18624 |
-
var f = $floor(argument);
|
18625 |
-
if (f + 0.5 < number) { return f + 1; }
|
18626 |
-
if (number < f + 0.5) { return f; }
|
18627 |
-
if (f % 2 !== 0) { return f + 1; }
|
18628 |
-
return f;
|
18629 |
-
},
|
18630 |
|
18631 |
-
|
18632 |
-
|
18633 |
-
|
18634 |
-
|
18635 |
-
|
18636 |
-
|
18637 |
-
|
|
|
|
|
|
|
|
|
18638 |
|
18639 |
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject
|
18640 |
-
ToObject: function ToObject(value) {
|
18641 |
-
this.RequireObjectCoercible(value);
|
18642 |
-
return $Object(value);
|
18643 |
-
},
|
18644 |
|
18645 |
-
|
18646 |
-
|
18647 |
-
|
18648 |
-
|
18649 |
-
},
|
18650 |
|
18651 |
-
|
18652 |
-
|
18653 |
-
|
18654 |
-
if (len <= 0) { return 0; } // includes converting -0 to +0
|
18655 |
-
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
|
18656 |
-
return len;
|
18657 |
-
},
|
18658 |
|
18659 |
-
|
18660 |
-
|
18661 |
-
|
18662 |
-
throw new $TypeError('must be a string');
|
18663 |
-
}
|
18664 |
-
if (argument === '-0') { return -0; }
|
18665 |
-
var n = this.ToNumber(argument);
|
18666 |
-
if (this.SameValue(this.ToString(n), argument)) { return n; }
|
18667 |
-
return void 0;
|
18668 |
-
},
|
18669 |
|
18670 |
-
|
18671 |
-
|
|
|
18672 |
|
18673 |
-
|
18674 |
-
|
18675 |
-
|
18676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18677 |
|
18678 |
-
|
18679 |
-
|
|
|
|
|
18680 |
|
18681 |
-
|
18682 |
-
|
18683 |
-
|
18684 |
-
|
|
|
|
|
|
|
18685 |
|
18686 |
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o
|
18687 |
-
IsExtensible: Object.preventExtensions
|
18688 |
-
? function IsExtensible(obj) {
|
18689 |
-
if (isPrimitive(obj)) {
|
18690 |
-
return false;
|
18691 |
-
}
|
18692 |
-
return $isExtensible(obj);
|
18693 |
-
}
|
18694 |
-
: function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars
|
18695 |
|
18696 |
-
|
18697 |
-
|
18698 |
-
|
18699 |
-
|
18700 |
-
}
|
18701 |
-
var abs = $abs(argument);
|
18702 |
-
return $floor(abs) === abs;
|
18703 |
-
},
|
18704 |
|
18705 |
-
|
18706 |
-
|
18707 |
-
|
18708 |
-
|
|
|
18709 |
|
18710 |
-
|
18711 |
-
|
18712 |
-
if (!argument || typeof argument !== 'object') {
|
18713 |
-
return false;
|
18714 |
-
}
|
18715 |
-
if (hasSymbols) {
|
18716 |
-
var isRegExp = argument[$Symbol.match];
|
18717 |
-
if (typeof isRegExp !== 'undefined') {
|
18718 |
-
return ES5.ToBoolean(isRegExp);
|
18719 |
-
}
|
18720 |
-
}
|
18721 |
-
return hasRegExpMatcher(argument);
|
18722 |
-
},
|
18723 |
|
18724 |
-
|
18725 |
-
|
|
|
18726 |
|
18727 |
-
|
18728 |
-
|
18729 |
-
|
18730 |
-
},
|
18731 |
|
18732 |
-
|
18733 |
-
|
18734 |
-
|
18735 |
-
* 2. Let O be ToObject(V).
|
18736 |
-
* 3. ReturnIfAbrupt(O).
|
18737 |
-
* 4. Return O.[[Get]](P, V).
|
18738 |
-
*/
|
18739 |
-
GetV: function GetV(V, P) {
|
18740 |
-
// 7.3.2.1
|
18741 |
-
if (!this.IsPropertyKey(P)) {
|
18742 |
-
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
18743 |
-
}
|
18744 |
|
18745 |
-
|
18746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18747 |
|
18748 |
-
|
18749 |
-
|
18750 |
-
|
|
|
|
|
|
|
18751 |
|
18752 |
-
|
18753 |
-
|
18754 |
-
|
18755 |
-
|
18756 |
-
|
18757 |
-
|
18758 |
-
* 5. If IsCallable(func) is false, throw a TypeError exception.
|
18759 |
-
* 6. Return func.
|
18760 |
-
*/
|
18761 |
-
GetMethod: function GetMethod(O, P) {
|
18762 |
-
// 7.3.9.1
|
18763 |
-
if (!this.IsPropertyKey(P)) {
|
18764 |
-
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
18765 |
-
}
|
18766 |
|
18767 |
-
|
18768 |
-
|
|
|
18769 |
|
18770 |
-
|
18771 |
-
|
18772 |
-
|
18773 |
-
}
|
18774 |
|
18775 |
-
|
18776 |
-
|
18777 |
-
|
18778 |
-
|
18779 |
|
18780 |
-
|
18781 |
-
|
18782 |
-
|
18783 |
|
18784 |
-
|
18785 |
-
* 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
|
18786 |
-
* 1. Assert: Type(O) is Object.
|
18787 |
-
* 2. Assert: IsPropertyKey(P) is true.
|
18788 |
-
* 3. Return O.[[Get]](P, O).
|
18789 |
-
*/
|
18790 |
-
Get: function Get(O, P) {
|
18791 |
-
// 7.3.1.1
|
18792 |
-
if (this.Type(O) !== 'Object') {
|
18793 |
-
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
18794 |
-
}
|
18795 |
-
// 7.3.1.2
|
18796 |
-
if (!this.IsPropertyKey(P)) {
|
18797 |
-
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
18798 |
-
}
|
18799 |
-
// 7.3.1.3
|
18800 |
-
return O[P];
|
18801 |
-
},
|
18802 |
|
18803 |
-
Type: function Type(x) {
|
18804 |
-
if (typeof x === 'symbol') {
|
18805 |
-
return 'Symbol';
|
18806 |
-
}
|
18807 |
-
return ES5.Type(x);
|
18808 |
-
},
|
18809 |
|
18810 |
-
|
18811 |
-
|
18812 |
-
|
18813 |
-
|
18814 |
-
}
|
18815 |
-
var C = O.constructor;
|
18816 |
-
if (typeof C === 'undefined') {
|
18817 |
-
return defaultConstructor;
|
18818 |
-
}
|
18819 |
-
if (this.Type(C) !== 'Object') {
|
18820 |
-
throw new $TypeError('O.constructor is not an Object');
|
18821 |
-
}
|
18822 |
-
var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0;
|
18823 |
-
if (S == null) {
|
18824 |
-
return defaultConstructor;
|
18825 |
-
}
|
18826 |
-
if (this.IsConstructor(S)) {
|
18827 |
-
return S;
|
18828 |
-
}
|
18829 |
-
throw new $TypeError('no constructor found');
|
18830 |
-
},
|
18831 |
|
18832 |
-
|
18833 |
-
CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) {
|
18834 |
-
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
|
18835 |
|
18836 |
-
|
18837 |
-
if (!has(Desc, '[[Value]]')) {
|
18838 |
-
Desc['[[Value]]'] = void 0;
|
18839 |
-
}
|
18840 |
-
if (!has(Desc, '[[Writable]]')) {
|
18841 |
-
Desc['[[Writable]]'] = false;
|
18842 |
-
}
|
18843 |
-
} else {
|
18844 |
-
if (!has(Desc, '[[Get]]')) {
|
18845 |
-
Desc['[[Get]]'] = void 0;
|
18846 |
-
}
|
18847 |
-
if (!has(Desc, '[[Set]]')) {
|
18848 |
-
Desc['[[Set]]'] = void 0;
|
18849 |
-
}
|
18850 |
-
}
|
18851 |
-
if (!has(Desc, '[[Enumerable]]')) {
|
18852 |
-
Desc['[[Enumerable]]'] = false;
|
18853 |
-
}
|
18854 |
-
if (!has(Desc, '[[Configurable]]')) {
|
18855 |
-
Desc['[[Configurable]]'] = false;
|
18856 |
-
}
|
18857 |
-
return Desc;
|
18858 |
-
},
|
18859 |
-
|
18860 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw
|
18861 |
-
Set: function Set(O, P, V, Throw) {
|
18862 |
-
if (this.Type(O) !== 'Object') {
|
18863 |
-
throw new $TypeError('O must be an Object');
|
18864 |
-
}
|
18865 |
-
if (!this.IsPropertyKey(P)) {
|
18866 |
-
throw new $TypeError('P must be a Property Key');
|
18867 |
-
}
|
18868 |
-
if (this.Type(Throw) !== 'Boolean') {
|
18869 |
-
throw new $TypeError('Throw must be a Boolean');
|
18870 |
-
}
|
18871 |
-
if (Throw) {
|
18872 |
-
O[P] = V;
|
18873 |
-
return true;
|
18874 |
-
} else {
|
18875 |
-
try {
|
18876 |
-
O[P] = V;
|
18877 |
-
} catch (e) {
|
18878 |
-
return false;
|
18879 |
-
}
|
18880 |
-
}
|
18881 |
-
},
|
18882 |
-
|
18883 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
|
18884 |
-
HasOwnProperty: function HasOwnProperty(O, P) {
|
18885 |
-
if (this.Type(O) !== 'Object') {
|
18886 |
-
throw new $TypeError('O must be an Object');
|
18887 |
-
}
|
18888 |
-
if (!this.IsPropertyKey(P)) {
|
18889 |
-
throw new $TypeError('P must be a Property Key');
|
18890 |
-
}
|
18891 |
-
return has(O, P);
|
18892 |
-
},
|
18893 |
-
|
18894 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
|
18895 |
-
HasProperty: function HasProperty(O, P) {
|
18896 |
-
if (this.Type(O) !== 'Object') {
|
18897 |
-
throw new $TypeError('O must be an Object');
|
18898 |
-
}
|
18899 |
-
if (!this.IsPropertyKey(P)) {
|
18900 |
-
throw new $TypeError('P must be a Property Key');
|
18901 |
-
}
|
18902 |
-
return P in O;
|
18903 |
-
},
|
18904 |
-
|
18905 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable
|
18906 |
-
IsConcatSpreadable: function IsConcatSpreadable(O) {
|
18907 |
-
if (this.Type(O) !== 'Object') {
|
18908 |
-
return false;
|
18909 |
-
}
|
18910 |
-
if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') {
|
18911 |
-
var spreadable = this.Get(O, Symbol.isConcatSpreadable);
|
18912 |
-
if (typeof spreadable !== 'undefined') {
|
18913 |
-
return this.ToBoolean(spreadable);
|
18914 |
-
}
|
18915 |
-
}
|
18916 |
-
return this.IsArray(O);
|
18917 |
-
},
|
18918 |
-
|
18919 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-invoke
|
18920 |
-
Invoke: function Invoke(O, P) {
|
18921 |
-
if (!this.IsPropertyKey(P)) {
|
18922 |
-
throw new $TypeError('P must be a Property Key');
|
18923 |
-
}
|
18924 |
-
var argumentsList = arraySlice(arguments, 2);
|
18925 |
-
var func = this.GetV(O, P);
|
18926 |
-
return this.Call(func, O, argumentsList);
|
18927 |
-
},
|
18928 |
-
|
18929 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-getiterator
|
18930 |
-
GetIterator: function GetIterator(obj, method) {
|
18931 |
-
if (!hasSymbols) {
|
18932 |
-
throw new SyntaxError('ES.GetIterator depends on native iterator support.');
|
18933 |
-
}
|
18934 |
-
|
18935 |
-
var actualMethod = method;
|
18936 |
-
if (arguments.length < 2) {
|
18937 |
-
actualMethod = this.GetMethod(obj, $Symbol.iterator);
|
18938 |
-
}
|
18939 |
-
var iterator = this.Call(actualMethod, obj);
|
18940 |
-
if (this.Type(iterator) !== 'Object') {
|
18941 |
-
throw new $TypeError('iterator must return an object');
|
18942 |
-
}
|
18943 |
-
|
18944 |
-
return iterator;
|
18945 |
-
},
|
18946 |
-
|
18947 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext
|
18948 |
-
IteratorNext: function IteratorNext(iterator, value) {
|
18949 |
-
var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
|
18950 |
-
if (this.Type(result) !== 'Object') {
|
18951 |
-
throw new $TypeError('iterator next must return an object');
|
18952 |
-
}
|
18953 |
-
return result;
|
18954 |
-
},
|
18955 |
-
|
18956 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete
|
18957 |
-
IteratorComplete: function IteratorComplete(iterResult) {
|
18958 |
-
if (this.Type(iterResult) !== 'Object') {
|
18959 |
-
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
|
18960 |
-
}
|
18961 |
-
return this.ToBoolean(this.Get(iterResult, 'done'));
|
18962 |
-
},
|
18963 |
-
|
18964 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
|
18965 |
-
IteratorValue: function IteratorValue(iterResult) {
|
18966 |
-
if (this.Type(iterResult) !== 'Object') {
|
18967 |
-
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
|
18968 |
-
}
|
18969 |
-
return this.Get(iterResult, 'value');
|
18970 |
-
},
|
18971 |
-
|
18972 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
|
18973 |
-
IteratorStep: function IteratorStep(iterator) {
|
18974 |
-
var result = this.IteratorNext(iterator);
|
18975 |
-
var done = this.IteratorComplete(result);
|
18976 |
-
return done === true ? false : result;
|
18977 |
-
},
|
18978 |
-
|
18979 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose
|
18980 |
-
IteratorClose: function IteratorClose(iterator, completion) {
|
18981 |
-
if (this.Type(iterator) !== 'Object') {
|
18982 |
-
throw new $TypeError('Assertion failed: Type(iterator) is not Object');
|
18983 |
-
}
|
18984 |
-
if (!this.IsCallable(completion)) {
|
18985 |
-
throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record');
|
18986 |
-
}
|
18987 |
-
var completionThunk = completion;
|
18988 |
-
|
18989 |
-
var iteratorReturn = this.GetMethod(iterator, 'return');
|
18990 |
-
|
18991 |
-
if (typeof iteratorReturn === 'undefined') {
|
18992 |
-
return completionThunk();
|
18993 |
-
}
|
18994 |
|
18995 |
-
|
18996 |
-
try {
|
18997 |
-
var innerResult = this.Call(iteratorReturn, iterator, []);
|
18998 |
-
} catch (e) {
|
18999 |
-
// if we hit here, then "e" is the innerResult completion that needs re-throwing
|
19000 |
|
19001 |
-
|
19002 |
-
|
19003 |
-
|
|
|
|
|
|
|
19004 |
|
19005 |
-
|
19006 |
-
|
19007 |
-
|
19008 |
-
|
19009 |
-
|
|
|
19010 |
|
19011 |
-
|
19012 |
-
|
19013 |
-
|
|
|
19014 |
|
19015 |
-
|
19016 |
-
|
|
|
|
|
|
|
|
|
19017 |
|
19018 |
-
|
19019 |
-
|
19020 |
-
|
19021 |
-
|
19022 |
-
|
19023 |
-
|
19024 |
-
value: value,
|
19025 |
-
done: done
|
19026 |
-
};
|
19027 |
-
},
|
19028 |
|
19029 |
-
|
19030 |
-
|
19031 |
-
|
19032 |
-
|
19033 |
-
|
19034 |
-
|
19035 |
-
throw new $TypeError('S must be a String');
|
19036 |
-
}
|
19037 |
-
var exec = this.Get(R, 'exec');
|
19038 |
-
if (this.IsCallable(exec)) {
|
19039 |
-
var result = this.Call(exec, R, [S]);
|
19040 |
-
if (result === null || this.Type(result) === 'Object') {
|
19041 |
-
return result;
|
19042 |
-
}
|
19043 |
-
throw new $TypeError('"exec" method must return `null` or an Object');
|
19044 |
-
}
|
19045 |
-
return regexExec(R, S);
|
19046 |
-
},
|
19047 |
|
19048 |
-
|
19049 |
-
|
19050 |
-
|
19051 |
-
|
19052 |
-
|
19053 |
-
|
19054 |
-
|
19055 |
-
var isArray = this.IsArray(originalArray);
|
19056 |
-
if (isArray) {
|
19057 |
-
C = this.Get(originalArray, 'constructor');
|
19058 |
-
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
|
19059 |
-
// if (this.IsConstructor(C)) {
|
19060 |
-
// if C is another realm's Array, C = undefined
|
19061 |
-
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
|
19062 |
-
// }
|
19063 |
-
if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) {
|
19064 |
-
C = this.Get(C, $Symbol.species);
|
19065 |
-
if (C === null) {
|
19066 |
-
C = void 0;
|
19067 |
-
}
|
19068 |
-
}
|
19069 |
-
}
|
19070 |
-
if (typeof C === 'undefined') {
|
19071 |
-
return $Array(len);
|
19072 |
-
}
|
19073 |
-
if (!this.IsConstructor(C)) {
|
19074 |
-
throw new $TypeError('C must be a constructor');
|
19075 |
-
}
|
19076 |
-
return new C(len); // this.Construct(C, len);
|
19077 |
-
},
|
19078 |
|
19079 |
-
|
19080 |
-
|
19081 |
-
|
19082 |
-
|
19083 |
-
if (!this.IsPropertyKey(P)) {
|
19084 |
-
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
19085 |
-
}
|
19086 |
-
var oldDesc = $gOPD(O, P);
|
19087 |
-
var extensible = oldDesc || (typeof $isExtensible !== 'function' || $isExtensible(O));
|
19088 |
-
var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
|
19089 |
-
if (immutable || !extensible) {
|
19090 |
-
return false;
|
19091 |
-
}
|
19092 |
-
var newDesc = {
|
19093 |
-
configurable: true,
|
19094 |
-
enumerable: true,
|
19095 |
-
value: V,
|
19096 |
-
writable: true
|
19097 |
-
};
|
19098 |
-
$defineProperty(O, P, newDesc);
|
19099 |
-
return true;
|
19100 |
-
},
|
19101 |
|
19102 |
-
|
19103 |
-
|
19104 |
-
|
19105 |
-
|
19106 |
-
|
19107 |
-
|
19108 |
-
|
19109 |
-
}
|
19110 |
-
var success = this.CreateDataProperty(O, P, V);
|
19111 |
-
if (!success) {
|
19112 |
-
throw new $TypeError('unable to create data property');
|
19113 |
-
}
|
19114 |
-
return success;
|
19115 |
-
},
|
19116 |
|
19117 |
-
|
19118 |
-
|
19119 |
-
|
19120 |
-
|
19121 |
-
}
|
19122 |
-
var slots = arguments.length < 2 ? [] : internalSlotsList;
|
19123 |
-
if (slots.length > 0) {
|
19124 |
-
throw new $SyntaxError('es-abstract does not yet support internal slots');
|
19125 |
-
}
|
19126 |
|
19127 |
-
|
19128 |
-
|
19129 |
-
|
|
|
|
|
|
|
|
|
19130 |
|
19131 |
-
|
19132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19133 |
|
19134 |
-
|
19135 |
-
|
19136 |
-
|
19137 |
-
|
19138 |
-
}
|
19139 |
-
if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
|
19140 |
-
throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53');
|
19141 |
-
}
|
19142 |
-
if (this.Type(unicode) !== 'Boolean') {
|
19143 |
-
throw new $TypeError('Assertion failed: unicode must be a Boolean');
|
19144 |
-
}
|
19145 |
-
if (!unicode) {
|
19146 |
-
return index + 1;
|
19147 |
-
}
|
19148 |
-
var length = S.length;
|
19149 |
-
if ((index + 1) >= length) {
|
19150 |
-
return index + 1;
|
19151 |
-
}
|
19152 |
|
19153 |
-
|
19154 |
-
|
19155 |
-
|
19156 |
-
|
|
|
|
|
19157 |
|
19158 |
-
|
19159 |
-
|
19160 |
-
|
19161 |
-
|
|
|
|
|
19162 |
|
19163 |
-
|
19164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19165 |
|
19166 |
-
|
19167 |
-
|
19168 |
-
|
19169 |
-
|
19170 |
-
}
|
19171 |
|
19172 |
-
|
19173 |
-
|
19174 |
-
|
19175 |
|
19176 |
-
|
19177 |
-
configurable: true,
|
19178 |
-
enumerable: false,
|
19179 |
-
value: V,
|
19180 |
-
writable: true
|
19181 |
-
};
|
19182 |
-
return !!$defineProperty(O, P, newDesc);
|
19183 |
-
},
|
19184 |
|
19185 |
-
// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
|
19186 |
-
DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) {
|
19187 |
-
if (this.Type(O) !== 'Object') {
|
19188 |
-
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
19189 |
-
}
|
19190 |
|
19191 |
-
|
19192 |
-
|
19193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19194 |
|
19195 |
-
|
19196 |
-
},
|
19197 |
|
19198 |
-
|
19199 |
-
|
19200 |
-
|
19201 |
-
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
19202 |
-
}
|
19203 |
|
19204 |
-
|
19205 |
-
|
19206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19207 |
|
19208 |
-
|
19209 |
-
|
19210 |
-
|
19211 |
-
|
19212 |
-
|
19213 |
-
},
|
19214 |
|
19215 |
-
|
19216 |
-
|
19217 |
-
if (this.Type(O) !== 'Object') {
|
19218 |
-
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
19219 |
-
}
|
19220 |
|
19221 |
-
|
19222 |
-
|
19223 |
|
19224 |
-
|
19225 |
-
|
19226 |
-
|
19227 |
-
return value;
|
19228 |
-
}
|
19229 |
|
19230 |
-
|
19231 |
-
|
|
|
|
|
|
|
19232 |
|
19233 |
-
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object
|
19234 |
-
thisBooleanValue: function thisBooleanValue(value) {
|
19235 |
-
if (this.Type(value) === 'Boolean') {
|
19236 |
-
return value;
|
19237 |
-
}
|
19238 |
|
19239 |
-
return $BooleanValueOf(value);
|
19240 |
-
},
|
19241 |
|
19242 |
-
|
19243 |
-
thisStringValue: function thisStringValue(value) {
|
19244 |
-
if (this.Type(value) === 'String') {
|
19245 |
-
return value;
|
19246 |
-
}
|
19247 |
|
19248 |
-
|
19249 |
-
},
|
19250 |
|
19251 |
-
|
19252 |
-
|
19253 |
-
|
19254 |
-
|
19255 |
-
});
|
19256 |
|
19257 |
-
|
19258 |
|
19259 |
-
|
19260 |
|
|
|
19261 |
|
19262 |
-
|
19263 |
-
|
19264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19265 |
|
19266 |
-
|
19267 |
-
|
19268 |
-
|
19269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19270 |
|
19271 |
/***/ }),
|
19272 |
-
/*
|
19273 |
-
/***/ (function(module,
|
19274 |
|
19275 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
19276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
19277 |
|
19278 |
-
|
19279 |
-
var
|
19280 |
-
|
19281 |
-
|
19282 |
-
|
19283 |
-
|
19284 |
-
|
19285 |
-
|
19286 |
-
|
19287 |
-
|
19288 |
-
return symStringRegex.test(symToStr.call(value));
|
19289 |
-
};
|
19290 |
|
19291 |
-
module.exports = function isSymbol(value) {
|
19292 |
-
if (typeof value === 'symbol') {
|
19293 |
-
return true;
|
19294 |
-
}
|
19295 |
-
if (toStr.call(value) !== '[object Symbol]') {
|
19296 |
-
return false;
|
19297 |
-
}
|
19298 |
-
try {
|
19299 |
-
return isSymbolObject(value);
|
19300 |
-
} catch (e) {
|
19301 |
-
return false;
|
19302 |
-
}
|
19303 |
-
};
|
19304 |
-
} else {
|
19305 |
|
19306 |
-
|
19307 |
-
|
19308 |
-
|
19309 |
-
|
19310 |
}
|
19311 |
-
|
19312 |
|
19313 |
/***/ }),
|
19314 |
-
/*
|
19315 |
-
/***/ (function(module,
|
19316 |
|
19317 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19318 |
|
19319 |
|
19320 |
-
|
19321 |
-
|
19322 |
-
|
19323 |
-
if (typeof Symbol.iterator === 'symbol') { return true; }
|
19324 |
-
|
19325 |
-
var obj = {};
|
19326 |
-
var sym = Symbol('test');
|
19327 |
-
var symObj = Object(sym);
|
19328 |
-
if (typeof sym === 'string') { return false; }
|
19329 |
-
|
19330 |
-
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
19331 |
-
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
19332 |
-
|
19333 |
-
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
19334 |
-
// if (sym instanceof Symbol) { return false; }
|
19335 |
-
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
19336 |
-
// if (!(symObj instanceof Symbol)) { return false; }
|
19337 |
-
|
19338 |
-
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
19339 |
-
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
19340 |
|
19341 |
-
|
19342 |
-
|
19343 |
-
|
19344 |
-
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
19345 |
|
19346 |
-
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
19347 |
|
19348 |
-
var syms = Object.getOwnPropertySymbols(obj);
|
19349 |
-
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
19350 |
|
19351 |
-
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
19352 |
|
19353 |
-
|
19354 |
-
|
19355 |
-
|
19356 |
-
}
|
19357 |
|
19358 |
-
return true;
|
19359 |
-
};
|
19360 |
|
19361 |
|
19362 |
-
|
19363 |
-
|
19364 |
-
|
|
|
|
|
|
|
|
|
|
|
19365 |
|
19366 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
19368 |
|
19369 |
-
var
|
|
|
|
|
|
|
|
|
19370 |
|
19371 |
-
var
|
19372 |
-
|
|
|
|
|
|
|
19373 |
|
19374 |
-
var
|
|
|
|
|
|
|
|
|
|
|
19375 |
|
19376 |
-
|
19377 |
-
|
19378 |
-
|
19379 |
-
|
19380 |
-
|
19381 |
}
|
19382 |
-
|
19383 |
-
|
19384 |
-
'[[Enumerable]]': true,
|
19385 |
-
'[[Get]]': true,
|
19386 |
-
'[[Set]]': true,
|
19387 |
-
'[[Value]]': true,
|
19388 |
-
'[[Writable]]': true
|
19389 |
-
};
|
19390 |
|
19391 |
-
|
19392 |
-
|
19393 |
-
|
19394 |
-
|
|
|
|
|
|
|
|
|
19395 |
}
|
|
|
19396 |
|
19397 |
-
|
19398 |
-
|
19399 |
-
|
19400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19401 |
}
|
19402 |
-
|
19403 |
-
|
19404 |
-
|
|
|
|
|
|
|
19405 |
|
19406 |
-
|
19407 |
-
|
19408 |
-
|
19409 |
-
throw new $SyntaxError('unknown record type: ' + recordType);
|
19410 |
-
}
|
19411 |
-
if (!predicate(ES, value)) {
|
19412 |
-
throw new $TypeError(argumentName + ' must be a ' + recordType);
|
19413 |
-
}
|
19414 |
-
console.log(predicate(ES, value), value);
|
19415 |
-
};
|
19416 |
|
|
|
|
|
|
|
|
|
19417 |
|
19418 |
-
|
19419 |
-
|
19420 |
-
|
|
|
19421 |
|
19422 |
-
module.exports = Number.isNaN || function isNaN(a) {
|
19423 |
-
return a !== a;
|
19424 |
-
};
|
19425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19426 |
|
19427 |
/***/ }),
|
19428 |
-
/*
|
19429 |
-
/***/ (function(module,
|
19430 |
|
19431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19432 |
|
19433 |
-
|
|
|
|
|
19434 |
|
19435 |
|
19436 |
-
|
19437 |
-
|
19438 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19439 |
|
19440 |
-
|
19441 |
-
|
19442 |
-
|
|
|
|
|
|
|
|
|
|
|
19443 |
|
|
|
|
|
19444 |
|
19445 |
/***/ }),
|
19446 |
-
/*
|
19447 |
-
/***/ (function(module,
|
19448 |
|
19449 |
-
|
19450 |
-
|
19451 |
-
|
19452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19453 |
|
19454 |
|
|
|
|
|
|
|
|
|
|
|
19455 |
/***/ }),
|
19456 |
-
/*
|
19457 |
-
/***/ (function(module,
|
19458 |
|
19459 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
19460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19461 |
|
19462 |
-
var
|
19463 |
-
|
19464 |
-
var gOPD = Object.getOwnPropertyDescriptor;
|
19465 |
|
19466 |
-
|
19467 |
-
|
19468 |
-
|
19469 |
-
value.lastIndex = 0;
|
19470 |
|
19471 |
-
|
19472 |
-
|
19473 |
-
|
19474 |
-
|
19475 |
-
|
19476 |
-
value.lastIndex = lastIndex;
|
19477 |
-
}
|
19478 |
-
};
|
19479 |
-
var toStr = Object.prototype.toString;
|
19480 |
-
var regexClass = '[object RegExp]';
|
19481 |
-
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
19482 |
|
19483 |
-
module.exports = function isRegex(value) {
|
19484 |
-
if (!value || typeof value !== 'object') {
|
19485 |
-
return false;
|
19486 |
-
}
|
19487 |
-
if (!hasToStringTag) {
|
19488 |
-
return toStr.call(value) === regexClass;
|
19489 |
-
}
|
19490 |
|
19491 |
-
|
19492 |
-
|
19493 |
-
|
19494 |
-
|
19495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19496 |
|
19497 |
-
return tryRegexExecCall(value);
|
19498 |
-
};
|
19499 |
|
|
|
19500 |
|
19501 |
/***/ }),
|
19502 |
-
/*
|
19503 |
-
/***/ (function(module,
|
19504 |
|
19505 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
19506 |
|
19507 |
|
19508 |
-
var implementation = __webpack_require__(137);
|
19509 |
|
19510 |
-
|
19511 |
-
return Array.prototype.flat || implementation;
|
19512 |
-
};
|
19513 |
|
|
|
19514 |
|
19515 |
-
|
19516 |
-
|
19517 |
-
|
19518 |
|
19519 |
-
|
19520 |
-
|
19521 |
-
|
19522 |
-
var styleInterface = void 0;
|
19523 |
-
var styleTheme = void 0;
|
19524 |
|
19525 |
-
function registerTheme(theme) {
|
19526 |
-
styleTheme = theme;
|
19527 |
-
}
|
19528 |
|
19529 |
-
function registerInterface(interfaceToRegister) {
|
19530 |
-
styleInterface = interfaceToRegister;
|
19531 |
-
}
|
19532 |
|
19533 |
-
function
|
19534 |
-
|
19535 |
-
|
19536 |
-
|
19537 |
-
};
|
19538 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19539 |
|
19540 |
-
function createLTR(makeFromTheme) {
|
19541 |
-
return create(makeFromTheme, styleInterface.createLTR || styleInterface.create);
|
19542 |
-
}
|
19543 |
|
19544 |
-
function
|
19545 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19546 |
}
|
|
|
19547 |
|
19548 |
-
|
19549 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19550 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19551 |
|
19552 |
-
function
|
19553 |
-
|
19554 |
-
|
19555 |
}
|
19556 |
|
19557 |
-
|
19558 |
-
|
19559 |
-
|
19560 |
|
19561 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19562 |
|
19563 |
-
|
19564 |
-
|
|
|
|
|
|
|
19565 |
|
19566 |
-
|
|
|
19567 |
}
|
19568 |
|
19569 |
-
return
|
19570 |
}
|
|
|
19571 |
|
19572 |
-
|
19573 |
-
|
19574 |
-
|
19575 |
-
}
|
19576 |
|
19577 |
-
|
19578 |
-
|
19579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19580 |
|
19581 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19582 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19583 |
|
19584 |
-
function
|
19585 |
-
|
19586 |
-
|
|
|
|
|
|
|
|
|
19587 |
}
|
19588 |
|
19589 |
-
if (
|
19590 |
-
return
|
19591 |
}
|
19592 |
|
19593 |
-
|
19594 |
-
|
|
|
19595 |
|
19596 |
-
|
19597 |
-
|
19598 |
-
styleInterface.flush();
|
19599 |
}
|
19600 |
-
}
|
19601 |
|
19602 |
-
|
19603 |
-
|
19604 |
-
|
19605 |
-
create: createLTR,
|
19606 |
-
createLTR: createLTR,
|
19607 |
-
createRTL: createRTL,
|
19608 |
-
get: get,
|
19609 |
-
resolve: resolveLTR,
|
19610 |
-
resolveLTR: resolveLTR,
|
19611 |
-
resolveRTL: resolveRTL,
|
19612 |
-
flush: flush
|
19613 |
-
};
|
19614 |
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
|
19615 |
|
19616 |
/***/ }),
|
19617 |
-
/*
|
19618 |
-
/***/ (function(module,
|
19619 |
|
19620 |
"use strict";
|
|
|
|
|
|
|
19621 |
|
19622 |
|
19623 |
-
|
19624 |
-
|
19625 |
-
|
19626 |
-
var core = {
|
19627 |
-
white: '#fff',
|
19628 |
-
gray: '#484848',
|
19629 |
-
grayLight: '#82888a',
|
19630 |
-
grayLighter: '#cacccd',
|
19631 |
-
grayLightest: '#f2f2f2',
|
19632 |
|
19633 |
-
|
19634 |
-
|
19635 |
-
|
19636 |
-
|
19637 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19638 |
|
19639 |
-
|
19640 |
-
|
19641 |
-
|
19642 |
-
|
19643 |
-
|
19644 |
-
|
|
|
|
|
|
|
|
|
19645 |
|
19646 |
-
|
|
|
|
|
|
|
19647 |
|
19648 |
-
|
19649 |
-
|
19650 |
-
}
|
19651 |
|
19652 |
-
|
19653 |
-
|
19654 |
-
|
19655 |
-
|
19656 |
-
|
19657 |
-
|
19658 |
-
borderTop: 0,
|
19659 |
-
borderRight: 0,
|
19660 |
-
borderBottom: '2px solid transparent',
|
19661 |
-
borderLeft: 0,
|
19662 |
-
outlineFocused: 0,
|
19663 |
-
borderFocused: 0,
|
19664 |
-
borderTopFocused: 0,
|
19665 |
-
borderLeftFocused: 0,
|
19666 |
-
borderBottomFocused: '2px solid ' + String(core.primary_dark),
|
19667 |
-
borderRightFocused: 0,
|
19668 |
-
borderRadius: 0
|
19669 |
-
},
|
19670 |
-
pickerInput: {
|
19671 |
-
borderWidth: 1,
|
19672 |
-
borderStyle: 'solid',
|
19673 |
-
borderRadius: 2
|
60 |
/******/ __webpack_require__.p = "";
|
61 |
/******/
|
62 |
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 419);
|
64 |
/******/ })
|
65 |
/************************************************************************/
|
66 |
/******/ ([
|
67 |
/* 0 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
/***/ (function(module, exports, __webpack_require__) {
|
69 |
|
70 |
/* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
|
71 |
+
//! version : 2.26.0
|
72 |
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
73 |
+
//! license : MIT
|
74 |
+
//! momentjs.com
|
75 |
|
76 |
;(function (global, factory) {
|
77 |
true ? module.exports = factory() :
|
81 |
|
82 |
var hookCallback;
|
83 |
|
84 |
+
function hooks() {
|
85 |
return hookCallback.apply(null, arguments);
|
86 |
}
|
87 |
|
88 |
// This is done to register the method called with moment()
|
89 |
// without creating circular dependencies.
|
90 |
+
function setHookCallback(callback) {
|
91 |
hookCallback = callback;
|
92 |
}
|
93 |
|
94 |
function isArray(input) {
|
95 |
+
return (
|
96 |
+
input instanceof Array ||
|
97 |
+
Object.prototype.toString.call(input) === '[object Array]'
|
98 |
+
);
|
99 |
}
|
100 |
|
101 |
function isObject(input) {
|
102 |
// IE8 will treat undefined and null as object if it wasn't for
|
103 |
// input != null
|
104 |
+
return (
|
105 |
+
input != null &&
|
106 |
+
Object.prototype.toString.call(input) === '[object Object]'
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
function hasOwnProp(a, b) {
|
111 |
+
return Object.prototype.hasOwnProperty.call(a, b);
|
112 |
}
|
113 |
|
114 |
function isObjectEmpty(obj) {
|
115 |
if (Object.getOwnPropertyNames) {
|
116 |
+
return Object.getOwnPropertyNames(obj).length === 0;
|
117 |
} else {
|
118 |
var k;
|
119 |
for (k in obj) {
|
120 |
+
if (hasOwnProp(obj, k)) {
|
121 |
return false;
|
122 |
}
|
123 |
}
|
130 |
}
|
131 |
|
132 |
function isNumber(input) {
|
133 |
+
return (
|
134 |
+
typeof input === 'number' ||
|
135 |
+
Object.prototype.toString.call(input) === '[object Number]'
|
136 |
+
);
|
137 |
}
|
138 |
|
139 |
function isDate(input) {
|
140 |
+
return (
|
141 |
+
input instanceof Date ||
|
142 |
+
Object.prototype.toString.call(input) === '[object Date]'
|
143 |
+
);
|
144 |
}
|
145 |
|
146 |
function map(arr, fn) {
|
147 |
+
var res = [],
|
148 |
+
i;
|
149 |
for (i = 0; i < arr.length; ++i) {
|
150 |
res.push(fn(arr[i], i));
|
151 |
}
|
152 |
return res;
|
153 |
}
|
154 |
|
|
|
|
|
|
|
|
|
155 |
function extend(a, b) {
|
156 |
for (var i in b) {
|
157 |
if (hasOwnProp(b, i)) {
|
170 |
return a;
|
171 |
}
|
172 |
|
173 |
+
function createUTC(input, format, locale, strict) {
|
174 |
return createLocalOrUTC(input, format, locale, strict, true).utc();
|
175 |
}
|
176 |
|
177 |
function defaultParsingFlags() {
|
178 |
// We need to deep clone this object.
|
179 |
return {
|
180 |
+
empty: false,
|
181 |
+
unusedTokens: [],
|
182 |
+
unusedInput: [],
|
183 |
+
overflow: -2,
|
184 |
+
charsLeftOver: 0,
|
185 |
+
nullInput: false,
|
186 |
+
invalidEra: null,
|
187 |
+
invalidMonth: null,
|
188 |
+
invalidFormat: false,
|
189 |
+
userInvalidated: false,
|
190 |
+
iso: false,
|
191 |
+
parsedDateParts: [],
|
192 |
+
era: null,
|
193 |
+
meridiem: null,
|
194 |
+
rfc2822: false,
|
195 |
+
weekdayMismatch: false,
|
196 |
};
|
197 |
}
|
198 |
|
208 |
some = Array.prototype.some;
|
209 |
} else {
|
210 |
some = function (fun) {
|
211 |
+
var t = Object(this),
|
212 |
+
len = t.length >>> 0,
|
213 |
+
i;
|
214 |
|
215 |
+
for (i = 0; i < len; i++) {
|
216 |
if (i in t && fun.call(this, t[i], i, t)) {
|
217 |
return true;
|
218 |
}
|
224 |
|
225 |
function isValid(m) {
|
226 |
if (m._isValid == null) {
|
227 |
+
var flags = getParsingFlags(m),
|
228 |
+
parsedParts = some.call(flags.parsedDateParts, function (i) {
|
229 |
+
return i != null;
|
230 |
+
}),
|
231 |
+
isNowValid =
|
232 |
+
!isNaN(m._d.getTime()) &&
|
233 |
+
flags.overflow < 0 &&
|
234 |
+
!flags.empty &&
|
235 |
+
!flags.invalidEra &&
|
236 |
+
!flags.invalidMonth &&
|
237 |
+
!flags.invalidWeekday &&
|
238 |
+
!flags.weekdayMismatch &&
|
239 |
+
!flags.nullInput &&
|
240 |
+
!flags.invalidFormat &&
|
241 |
+
!flags.userInvalidated &&
|
242 |
+
(!flags.meridiem || (flags.meridiem && parsedParts));
|
243 |
|
244 |
if (m._strict) {
|
245 |
+
isNowValid =
|
246 |
+
isNowValid &&
|
247 |
flags.charsLeftOver === 0 &&
|
248 |
flags.unusedTokens.length === 0 &&
|
249 |
flags.bigHour === undefined;
|
251 |
|
252 |
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
253 |
m._isValid = isNowValid;
|
254 |
+
} else {
|
|
|
255 |
return isNowValid;
|
256 |
}
|
257 |
}
|
258 |
return m._isValid;
|
259 |
}
|
260 |
|
261 |
+
function createInvalid(flags) {
|
262 |
var m = createUTC(NaN);
|
263 |
if (flags != null) {
|
264 |
extend(getParsingFlags(m), flags);
|
265 |
+
} else {
|
|
|
266 |
getParsingFlags(m).userInvalidated = true;
|
267 |
}
|
268 |
|
271 |
|
272 |
// Plugins that add properties should also add the key here (null value),
|
273 |
// so we can properly clone ourselves.
|
274 |
+
var momentProperties = (hooks.momentProperties = []),
|
275 |
+
updateInProgress = false;
|
276 |
|
277 |
function copyConfig(to, from) {
|
278 |
var i, prop, val;
|
321 |
return to;
|
322 |
}
|
323 |
|
|
|
|
|
324 |
// Moment prototype object
|
325 |
function Moment(config) {
|
326 |
copyConfig(this, config);
|
337 |
}
|
338 |
}
|
339 |
|
340 |
+
function isMoment(obj) {
|
341 |
+
return (
|
342 |
+
obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
|
343 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
}
|
345 |
|
346 |
function warn(msg) {
|
347 |
+
if (
|
348 |
+
hooks.suppressDeprecationWarnings === false &&
|
349 |
+
typeof console !== 'undefined' &&
|
350 |
+
console.warn
|
351 |
+
) {
|
352 |
console.warn('Deprecation warning: ' + msg);
|
353 |
}
|
354 |
}
|
361 |
hooks.deprecationHandler(null, msg);
|
362 |
}
|
363 |
if (firstTime) {
|
364 |
+
var args = [],
|
365 |
+
arg,
|
366 |
+
i,
|
367 |
+
key;
|
368 |
+
for (i = 0; i < arguments.length; i++) {
|
369 |
arg = '';
|
370 |
if (typeof arguments[i] === 'object') {
|
371 |
arg += '\n[' + i + '] ';
|
372 |
+
for (key in arguments[0]) {
|
373 |
+
if (hasOwnProp(arguments[0], key)) {
|
374 |
+
arg += key + ': ' + arguments[0][key] + ', ';
|
375 |
+
}
|
376 |
}
|
377 |
arg = arg.slice(0, -2); // Remove trailing comma and space
|
378 |
} else {
|
380 |
}
|
381 |
args.push(arg);
|
382 |
}
|
383 |
+
warn(
|
384 |
+
msg +
|
385 |
+
'\nArguments: ' +
|
386 |
+
Array.prototype.slice.call(args).join('') +
|
387 |
+
'\n' +
|
388 |
+
new Error().stack
|
389 |
+
);
|
390 |
firstTime = false;
|
391 |
}
|
392 |
return fn.apply(this, arguments);
|
409 |
hooks.deprecationHandler = null;
|
410 |
|
411 |
function isFunction(input) {
|
412 |
+
return (
|
413 |
+
(typeof Function !== 'undefined' && input instanceof Function) ||
|
414 |
+
Object.prototype.toString.call(input) === '[object Function]'
|
415 |
+
);
|
416 |
}
|
417 |
|
418 |
+
function set(config) {
|
419 |
var prop, i;
|
420 |
for (i in config) {
|
421 |
+
if (hasOwnProp(config, i)) {
|
422 |
+
prop = config[i];
|
423 |
+
if (isFunction(prop)) {
|
424 |
+
this[i] = prop;
|
425 |
+
} else {
|
426 |
+
this['_' + i] = prop;
|
427 |
+
}
|
428 |
}
|
429 |
}
|
430 |
this._config = config;
|
433 |
// TODO: Remove "ordinalParse" fallback in next major release.
|
434 |
this._dayOfMonthOrdinalParseLenient = new RegExp(
|
435 |
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
|
436 |
+
'|' +
|
437 |
+
/\d{1,2}/.source
|
438 |
+
);
|
439 |
}
|
440 |
|
441 |
function mergeConfigs(parentConfig, childConfig) {
|
442 |
+
var res = extend({}, parentConfig),
|
443 |
+
prop;
|
444 |
for (prop in childConfig) {
|
445 |
if (hasOwnProp(childConfig, prop)) {
|
446 |
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
455 |
}
|
456 |
}
|
457 |
for (prop in parentConfig) {
|
458 |
+
if (
|
459 |
+
hasOwnProp(parentConfig, prop) &&
|
460 |
+
!hasOwnProp(childConfig, prop) &&
|
461 |
+
isObject(parentConfig[prop])
|
462 |
+
) {
|
463 |
// make sure changes to properties don't modify parent config
|
464 |
res[prop] = extend({}, res[prop]);
|
465 |
}
|
479 |
keys = Object.keys;
|
480 |
} else {
|
481 |
keys = function (obj) {
|
482 |
+
var i,
|
483 |
+
res = [];
|
484 |
for (i in obj) {
|
485 |
if (hasOwnProp(obj, i)) {
|
486 |
res.push(i);
|
491 |
}
|
492 |
|
493 |
var defaultCalendar = {
|
494 |
+
sameDay: '[Today at] LT',
|
495 |
+
nextDay: '[Tomorrow at] LT',
|
496 |
+
nextWeek: 'dddd [at] LT',
|
497 |
+
lastDay: '[Yesterday at] LT',
|
498 |
+
lastWeek: '[Last] dddd [at] LT',
|
499 |
+
sameElse: 'L',
|
500 |
};
|
501 |
|
502 |
+
function calendar(key, mom, now) {
|
503 |
var output = this._calendar[key] || this._calendar['sameElse'];
|
504 |
return isFunction(output) ? output.call(mom, now) : output;
|
505 |
}
|
506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
function zeroFill(number, targetLength, forceSign) {
|
508 |
var absNumber = '' + Math.abs(number),
|
509 |
zerosToFill = targetLength - absNumber.length,
|
510 |
sign = number >= 0;
|
511 |
+
return (
|
512 |
+
(sign ? (forceSign ? '+' : '') : '-') +
|
513 |
+
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
|
514 |
+
absNumber
|
515 |
+
);
|
516 |
}
|
517 |
|
518 |
+
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
|
519 |
+
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
|
520 |
+
formatFunctions = {},
|
521 |
+
formatTokenFunctions = {};
|
|
|
|
|
|
|
522 |
|
523 |
// token: 'M'
|
524 |
// padded: ['MM', 2]
|
525 |
// ordinal: 'Mo'
|
526 |
// callback: function () { this.month() + 1 }
|
527 |
+
function addFormatToken(token, padded, ordinal, callback) {
|
528 |
var func = callback;
|
529 |
if (typeof callback === 'string') {
|
530 |
func = function () {
|
541 |
}
|
542 |
if (ordinal) {
|
543 |
formatTokenFunctions[ordinal] = function () {
|
544 |
+
return this.localeData().ordinal(
|
545 |
+
func.apply(this, arguments),
|
546 |
+
token
|
547 |
+
);
|
548 |
};
|
549 |
}
|
550 |
}
|
557 |
}
|
558 |
|
559 |
function makeFormatFunction(format) {
|
560 |
+
var array = format.match(formattingTokens),
|
561 |
+
i,
|
562 |
+
length;
|
563 |
|
564 |
for (i = 0, length = array.length; i < length; i++) {
|
565 |
if (formatTokenFunctions[array[i]]) {
|
570 |
}
|
571 |
|
572 |
return function (mom) {
|
573 |
+
var output = '',
|
574 |
+
i;
|
575 |
for (i = 0; i < length; i++) {
|
576 |
+
output += isFunction(array[i])
|
577 |
+
? array[i].call(mom, format)
|
578 |
+
: array[i];
|
579 |
}
|
580 |
return output;
|
581 |
};
|
588 |
}
|
589 |
|
590 |
format = expandFormat(format, m.localeData());
|
591 |
+
formatFunctions[format] =
|
592 |
+
formatFunctions[format] || makeFormatFunction(format);
|
593 |
|
594 |
return formatFunctions[format](m);
|
595 |
}
|
603 |
|
604 |
localFormattingTokens.lastIndex = 0;
|
605 |
while (i >= 0 && localFormattingTokens.test(format)) {
|
606 |
+
format = format.replace(
|
607 |
+
localFormattingTokens,
|
608 |
+
replaceLongDateFormatTokens
|
609 |
+
);
|
610 |
localFormattingTokens.lastIndex = 0;
|
611 |
i -= 1;
|
612 |
}
|
614 |
return format;
|
615 |
}
|
616 |
|
617 |
+
var defaultLongDateFormat = {
|
618 |
+
LTS: 'h:mm:ss A',
|
619 |
+
LT: 'h:mm A',
|
620 |
+
L: 'MM/DD/YYYY',
|
621 |
+
LL: 'MMMM D, YYYY',
|
622 |
+
LLL: 'MMMM D, YYYY h:mm A',
|
623 |
+
LLLL: 'dddd, MMMM D, YYYY h:mm A',
|
624 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
|
626 |
+
function longDateFormat(key) {
|
627 |
+
var format = this._longDateFormat[key],
|
628 |
+
formatUpper = this._longDateFormat[key.toUpperCase()];
|
629 |
|
630 |
+
if (format || !formatUpper) {
|
631 |
+
return format;
|
632 |
+
}
|
633 |
|
634 |
+
this._longDateFormat[key] = formatUpper
|
635 |
+
.match(formattingTokens)
|
636 |
+
.map(function (tok) {
|
637 |
+
if (
|
638 |
+
tok === 'MMMM' ||
|
639 |
+
tok === 'MM' ||
|
640 |
+
tok === 'DD' ||
|
641 |
+
tok === 'dddd'
|
642 |
+
) {
|
643 |
+
return tok.slice(1);
|
644 |
+
}
|
645 |
+
return tok;
|
646 |
+
})
|
647 |
+
.join('');
|
648 |
|
649 |
+
return this._longDateFormat[key];
|
|
|
|
|
|
|
650 |
}
|
651 |
|
652 |
+
var defaultInvalidDate = 'Invalid date';
|
|
|
|
|
|
|
653 |
|
654 |
+
function invalidDate() {
|
655 |
+
return this._invalidDate;
|
656 |
}
|
657 |
|
658 |
+
var defaultOrdinal = '%d',
|
659 |
+
defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
|
|
|
|
|
|
|
|
660 |
|
661 |
+
function ordinal(number) {
|
662 |
+
return this._ordinal.replace('%d', number);
|
663 |
}
|
664 |
|
665 |
+
var defaultRelativeTime = {
|
666 |
+
future: 'in %s',
|
667 |
+
past: '%s ago',
|
668 |
+
s: 'a few seconds',
|
669 |
+
ss: '%d seconds',
|
670 |
+
m: 'a minute',
|
671 |
+
mm: '%d minutes',
|
672 |
+
h: 'an hour',
|
673 |
+
hh: '%d hours',
|
674 |
+
d: 'a day',
|
675 |
+
dd: '%d days',
|
676 |
+
w: 'a week',
|
677 |
+
ww: '%d weeks',
|
678 |
+
M: 'a month',
|
679 |
+
MM: '%d months',
|
680 |
+
y: 'a year',
|
681 |
+
yy: '%d years',
|
682 |
+
};
|
683 |
|
684 |
+
function relativeTime(number, withoutSuffix, string, isFuture) {
|
685 |
+
var output = this._relativeTime[string];
|
686 |
+
return isFunction(output)
|
687 |
+
? output(number, withoutSuffix, string, isFuture)
|
688 |
+
: output.replace(/%d/i, number);
|
689 |
}
|
690 |
|
691 |
+
function pastFuture(diff, output) {
|
692 |
+
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
693 |
+
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
|
|
694 |
}
|
695 |
|
696 |
+
var aliases = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
697 |
|
698 |
+
function addUnitAlias(unit, shorthand) {
|
699 |
+
var lowerCase = unit.toLowerCase();
|
700 |
+
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
|
701 |
+
}
|
702 |
|
703 |
+
function normalizeUnits(units) {
|
704 |
+
return typeof units === 'string'
|
705 |
+
? aliases[units] || aliases[units.toLowerCase()]
|
706 |
+
: undefined;
|
707 |
+
}
|
708 |
|
709 |
+
function normalizeObjectUnits(inputObject) {
|
710 |
+
var normalizedInput = {},
|
711 |
+
normalizedProp,
|
712 |
+
prop;
|
713 |
|
714 |
+
for (prop in inputObject) {
|
715 |
+
if (hasOwnProp(inputObject, prop)) {
|
716 |
+
normalizedProp = normalizeUnits(prop);
|
717 |
+
if (normalizedProp) {
|
718 |
+
normalizedInput[normalizedProp] = inputObject[prop];
|
719 |
+
}
|
720 |
+
}
|
721 |
+
}
|
722 |
|
723 |
+
return normalizedInput;
|
724 |
+
}
|
|
|
|
|
|
|
725 |
|
726 |
+
var priorities = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
727 |
|
728 |
+
function addUnitPriority(unit, priority) {
|
729 |
+
priorities[unit] = priority;
|
730 |
+
}
|
731 |
|
732 |
+
function getPrioritizedUnits(unitsObj) {
|
733 |
+
var units = [],
|
734 |
+
u;
|
735 |
+
for (u in unitsObj) {
|
736 |
+
if (hasOwnProp(unitsObj, u)) {
|
737 |
+
units.push({ unit: u, priority: priorities[u] });
|
738 |
+
}
|
739 |
+
}
|
740 |
+
units.sort(function (a, b) {
|
741 |
+
return a.priority - b.priority;
|
742 |
+
});
|
743 |
+
return units;
|
744 |
}
|
745 |
|
746 |
function isLeapYear(year) {
|
747 |
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
748 |
}
|
749 |
|
750 |
+
function absFloor(number) {
|
751 |
+
if (number < 0) {
|
752 |
+
// -0 -> 0
|
753 |
+
return Math.ceil(number) || 0;
|
754 |
+
} else {
|
755 |
+
return Math.floor(number);
|
756 |
+
}
|
757 |
+
}
|
758 |
|
759 |
+
function toInt(argumentForCoercion) {
|
760 |
+
var coercedNumber = +argumentForCoercion,
|
761 |
+
value = 0;
|
762 |
|
763 |
+
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
764 |
+
value = absFloor(coercedNumber);
|
765 |
+
}
|
766 |
|
767 |
+
return value;
|
|
|
768 |
}
|
769 |
|
770 |
+
function makeGetSet(unit, keepTime) {
|
771 |
return function (value) {
|
772 |
if (value != null) {
|
773 |
set$1(this, unit, value);
|
779 |
};
|
780 |
}
|
781 |
|
782 |
+
function get(mom, unit) {
|
783 |
+
return mom.isValid()
|
784 |
+
? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
|
785 |
+
: NaN;
|
786 |
}
|
787 |
|
788 |
+
function set$1(mom, unit, value) {
|
789 |
if (mom.isValid() && !isNaN(value)) {
|
790 |
+
if (
|
791 |
+
unit === 'FullYear' &&
|
792 |
+
isLeapYear(mom.year()) &&
|
793 |
+
mom.month() === 1 &&
|
794 |
+
mom.date() === 29
|
795 |
+
) {
|
796 |
+
value = toInt(value);
|
797 |
+
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
|
798 |
+
value,
|
799 |
+
mom.month(),
|
800 |
+
daysInMonth(value, mom.month())
|
801 |
+
);
|
802 |
+
} else {
|
803 |
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
804 |
}
|
805 |
}
|
807 |
|
808 |
// MOMENTS
|
809 |
|
810 |
+
function stringGet(units) {
|
811 |
units = normalizeUnits(units);
|
812 |
if (isFunction(this[units])) {
|
813 |
return this[units]();
|
815 |
return this;
|
816 |
}
|
817 |
|
818 |
+
function stringSet(units, value) {
|
|
|
819 |
if (typeof units === 'object') {
|
820 |
units = normalizeObjectUnits(units);
|
821 |
+
var prioritized = getPrioritizedUnits(units),
|
822 |
+
i;
|
823 |
+
for (i = 0; i < prioritized.length; i++) {
|
824 |
this[prioritized[i].unit](units[prioritized[i].unit]);
|
825 |
}
|
826 |
} else {
|
832 |
return this;
|
833 |
}
|
834 |
|
835 |
+
var match1 = /\d/, // 0 - 9
|
836 |
+
match2 = /\d\d/, // 00 - 99
|
837 |
+
match3 = /\d{3}/, // 000 - 999
|
838 |
+
match4 = /\d{4}/, // 0000 - 9999
|
839 |
+
match6 = /[+-]?\d{6}/, // -999999 - 999999
|
840 |
+
match1to2 = /\d\d?/, // 0 - 99
|
841 |
+
match3to4 = /\d\d\d\d?/, // 999 - 9999
|
842 |
+
match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
|
843 |
+
match1to3 = /\d{1,3}/, // 0 - 999
|
844 |
+
match1to4 = /\d{1,4}/, // 0 - 9999
|
845 |
+
match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
|
846 |
+
matchUnsigned = /\d+/, // 0 - inf
|
847 |
+
matchSigned = /[+-]?\d+/, // -inf - inf
|
848 |
+
matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
|
849 |
+
matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
|
850 |
+
matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
|
851 |
+
// any word (or two) characters or numbers including two/three word month in arabic.
|
852 |
+
// includes scottish gaelic two word and hyphenated months
|
853 |
+
matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
|
854 |
+
regexes;
|
855 |
+
|
856 |
+
regexes = {};
|
857 |
+
|
858 |
+
function addRegexToken(token, regex, strictRegex) {
|
859 |
+
regexes[token] = isFunction(regex)
|
860 |
+
? regex
|
861 |
+
: function (isStrict, localeData) {
|
862 |
+
return isStrict && strictRegex ? strictRegex : regex;
|
863 |
+
};
|
864 |
+
}
|
865 |
+
|
866 |
+
function getParseRegexForToken(token, config) {
|
867 |
+
if (!hasOwnProp(regexes, token)) {
|
868 |
+
return new RegExp(unescapeFormat(token));
|
869 |
+
}
|
870 |
+
|
871 |
+
return regexes[token](config._strict, config._locale);
|
872 |
+
}
|
873 |
+
|
874 |
+
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
|
875 |
+
function unescapeFormat(s) {
|
876 |
+
return regexEscape(
|
877 |
+
s
|
878 |
+
.replace('\\', '')
|
879 |
+
.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
|
880 |
+
matched,
|
881 |
+
p1,
|
882 |
+
p2,
|
883 |
+
p3,
|
884 |
+
p4
|
885 |
+
) {
|
886 |
+
return p1 || p2 || p3 || p4;
|
887 |
+
})
|
888 |
+
);
|
889 |
+
}
|
890 |
+
|
891 |
+
function regexEscape(s) {
|
892 |
+
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
893 |
+
}
|
894 |
+
|
895 |
+
var tokens = {};
|
896 |
+
|
897 |
+
function addParseToken(token, callback) {
|
898 |
+
var i,
|
899 |
+
func = callback;
|
900 |
+
if (typeof token === 'string') {
|
901 |
+
token = [token];
|
902 |
+
}
|
903 |
+
if (isNumber(callback)) {
|
904 |
+
func = function (input, array) {
|
905 |
+
array[callback] = toInt(input);
|
906 |
+
};
|
907 |
+
}
|
908 |
+
for (i = 0; i < token.length; i++) {
|
909 |
+
tokens[token[i]] = func;
|
910 |
+
}
|
911 |
+
}
|
912 |
+
|
913 |
+
function addWeekParseToken(token, callback) {
|
914 |
+
addParseToken(token, function (input, array, config, token) {
|
915 |
+
config._w = config._w || {};
|
916 |
+
callback(input, config._w, config, token);
|
917 |
+
});
|
918 |
+
}
|
919 |
+
|
920 |
+
function addTimeToArrayFromToken(token, input, config) {
|
921 |
+
if (input != null && hasOwnProp(tokens, token)) {
|
922 |
+
tokens[token](input, config._a, config, token);
|
923 |
+
}
|
924 |
+
}
|
925 |
+
|
926 |
+
var YEAR = 0,
|
927 |
+
MONTH = 1,
|
928 |
+
DATE = 2,
|
929 |
+
HOUR = 3,
|
930 |
+
MINUTE = 4,
|
931 |
+
SECOND = 5,
|
932 |
+
MILLISECOND = 6,
|
933 |
+
WEEK = 7,
|
934 |
+
WEEKDAY = 8;
|
935 |
+
|
936 |
function mod(n, x) {
|
937 |
return ((n % x) + x) % x;
|
938 |
}
|
960 |
}
|
961 |
var modMonth = mod(month, 12);
|
962 |
year += (month - modMonth) / 12;
|
963 |
+
return modMonth === 1
|
964 |
+
? isLeapYear(year)
|
965 |
+
? 29
|
966 |
+
: 28
|
967 |
+
: 31 - ((modMonth % 7) % 2);
|
968 |
}
|
969 |
|
970 |
// FORMATTING
|
991 |
|
992 |
// PARSING
|
993 |
|
994 |
+
addRegexToken('M', match1to2);
|
995 |
+
addRegexToken('MM', match1to2, match2);
|
996 |
+
addRegexToken('MMM', function (isStrict, locale) {
|
997 |
return locale.monthsShortRegex(isStrict);
|
998 |
});
|
999 |
addRegexToken('MMMM', function (isStrict, locale) {
|
1016 |
|
1017 |
// LOCALES
|
1018 |
|
1019 |
+
var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
1020 |
+
'_'
|
1021 |
+
),
|
1022 |
+
defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
|
1023 |
+
'_'
|
1024 |
+
),
|
1025 |
+
MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
|
1026 |
+
defaultMonthsShortRegex = matchWord,
|
1027 |
+
defaultMonthsRegex = matchWord;
|
1028 |
+
|
1029 |
+
function localeMonths(m, format) {
|
1030 |
if (!m) {
|
1031 |
+
return isArray(this._months)
|
1032 |
+
? this._months
|
1033 |
+
: this._months['standalone'];
|
1034 |
}
|
1035 |
+
return isArray(this._months)
|
1036 |
+
? this._months[m.month()]
|
1037 |
+
: this._months[
|
1038 |
+
(this._months.isFormat || MONTHS_IN_FORMAT).test(format)
|
1039 |
+
? 'format'
|
1040 |
+
: 'standalone'
|
1041 |
+
][m.month()];
|
1042 |
}
|
1043 |
|
1044 |
+
function localeMonthsShort(m, format) {
|
|
|
1045 |
if (!m) {
|
1046 |
+
return isArray(this._monthsShort)
|
1047 |
+
? this._monthsShort
|
1048 |
+
: this._monthsShort['standalone'];
|
1049 |
}
|
1050 |
+
return isArray(this._monthsShort)
|
1051 |
+
? this._monthsShort[m.month()]
|
1052 |
+
: this._monthsShort[
|
1053 |
+
MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
|
1054 |
+
][m.month()];
|
1055 |
}
|
1056 |
|
1057 |
function handleStrictParse(monthName, format, strict) {
|
1058 |
+
var i,
|
1059 |
+
ii,
|
1060 |
+
mom,
|
1061 |
+
llc = monthName.toLocaleLowerCase();
|
1062 |
if (!this._monthsParse) {
|
1063 |
// this is not used
|
1064 |
this._monthsParse = [];
|
1066 |
this._shortMonthsParse = [];
|
1067 |
for (i = 0; i < 12; ++i) {
|
1068 |
mom = createUTC([2000, i]);
|
1069 |
+
this._shortMonthsParse[i] = this.monthsShort(
|
1070 |
+
mom,
|
1071 |
+
''
|
1072 |
+
).toLocaleLowerCase();
|
1073 |
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
|
1074 |
}
|
1075 |
}
|
1101 |
}
|
1102 |
}
|
1103 |
|
1104 |
+
function localeMonthsParse(monthName, format, strict) {
|
1105 |
var i, mom, regex;
|
1106 |
|
1107 |
if (this._monthsParseExact) {
|
1121 |
// make the regex if we don't have it already
|
1122 |
mom = createUTC([2000, i]);
|
1123 |
if (strict && !this._longMonthsParse[i]) {
|
1124 |
+
this._longMonthsParse[i] = new RegExp(
|
1125 |
+
'^' + this.months(mom, '').replace('.', '') + '$',
|
1126 |
+
'i'
|
1127 |
+
);
|
1128 |
+
this._shortMonthsParse[i] = new RegExp(
|
1129 |
+
'^' + this.monthsShort(mom, '').replace('.', '') + '$',
|
1130 |
+
'i'
|
1131 |
+
);
|
1132 |
}
|
1133 |
if (!strict && !this._monthsParse[i]) {
|
1134 |
+
regex =
|
1135 |
+
'^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
|
1136 |
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
1137 |
}
|
1138 |
// test the regex
|
1139 |
+
if (
|
1140 |
+
strict &&
|
1141 |
+
format === 'MMMM' &&
|
1142 |
+
this._longMonthsParse[i].test(monthName)
|
1143 |
+
) {
|
1144 |
return i;
|
1145 |
+
} else if (
|
1146 |
+
strict &&
|
1147 |
+
format === 'MMM' &&
|
1148 |
+
this._shortMonthsParse[i].test(monthName)
|
1149 |
+
) {
|
1150 |
return i;
|
1151 |
} else if (!strict && this._monthsParse[i].test(monthName)) {
|
1152 |
return i;
|
1156 |
|
1157 |
// MOMENTS
|
1158 |
|
1159 |
+
function setMonth(mom, value) {
|
1160 |
var dayOfMonth;
|
1161 |
|
1162 |
if (!mom.isValid()) {
|
1181 |
return mom;
|
1182 |
}
|
1183 |
|
1184 |
+
function getSetMonth(value) {
|
1185 |
if (value != null) {
|
1186 |
setMonth(this, value);
|
1187 |
hooks.updateOffset(this, true);
|
1191 |
}
|
1192 |
}
|
1193 |
|
1194 |
+
function getDaysInMonth() {
|
1195 |
return daysInMonth(this.year(), this.month());
|
1196 |
}
|
1197 |
|
1198 |
+
function monthsShortRegex(isStrict) {
|
|
|
1199 |
if (this._monthsParseExact) {
|
1200 |
if (!hasOwnProp(this, '_monthsRegex')) {
|
1201 |
computeMonthsParse.call(this);
|
1209 |
if (!hasOwnProp(this, '_monthsShortRegex')) {
|
1210 |
this._monthsShortRegex = defaultMonthsShortRegex;
|
1211 |
}
|
1212 |
+
return this._monthsShortStrictRegex && isStrict
|
1213 |
+
? this._monthsShortStrictRegex
|
1214 |
+
: this._monthsShortRegex;
|
1215 |
}
|
1216 |
}
|
1217 |
|
1218 |
+
function monthsRegex(isStrict) {
|
|
|
1219 |
if (this._monthsParseExact) {
|
1220 |
if (!hasOwnProp(this, '_monthsRegex')) {
|
1221 |
computeMonthsParse.call(this);
|
1229 |
if (!hasOwnProp(this, '_monthsRegex')) {
|
1230 |
this._monthsRegex = defaultMonthsRegex;
|
1231 |
}
|
1232 |
+
return this._monthsStrictRegex && isStrict
|
1233 |
+
? this._monthsStrictRegex
|
1234 |
+
: this._monthsRegex;
|
1235 |
}
|
1236 |
}
|
1237 |
|
1238 |
+
function computeMonthsParse() {
|
1239 |
function cmpLenRev(a, b) {
|
1240 |
return b.length - a.length;
|
1241 |
}
|
1242 |
|
1243 |
+
var shortPieces = [],
|
1244 |
+
longPieces = [],
|
1245 |
+
mixedPieces = [],
|
1246 |
+
i,
|
1247 |
+
mom;
|
1248 |
for (i = 0; i < 12; i++) {
|
1249 |
// make the regex if we don't have it already
|
1250 |
mom = createUTC([2000, i]);
|
1268 |
|
1269 |
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
1270 |
this._monthsShortRegex = this._monthsRegex;
|
1271 |
+
this._monthsStrictRegex = new RegExp(
|
1272 |
+
'^(' + longPieces.join('|') + ')',
|
1273 |
+
'i'
|
1274 |
+
);
|
1275 |
+
this._monthsShortStrictRegex = new RegExp(
|
1276 |
+
'^(' + shortPieces.join('|') + ')',
|
1277 |
+
'i'
|
1278 |
+
);
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
// FORMATTING
|
1282 |
+
|
1283 |
+
addFormatToken('Y', 0, 0, function () {
|
1284 |
+
var y = this.year();
|
1285 |
+
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
|
1286 |
+
});
|
1287 |
+
|
1288 |
+
addFormatToken(0, ['YY', 2], 0, function () {
|
1289 |
+
return this.year() % 100;
|
1290 |
+
});
|
1291 |
+
|
1292 |
+
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
1293 |
+
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
1294 |
+
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
1295 |
+
|
1296 |
+
// ALIASES
|
1297 |
+
|
1298 |
+
addUnitAlias('year', 'y');
|
1299 |
+
|
1300 |
+
// PRIORITIES
|
1301 |
+
|
1302 |
+
addUnitPriority('year', 1);
|
1303 |
+
|
1304 |
+
// PARSING
|
1305 |
+
|
1306 |
+
addRegexToken('Y', matchSigned);
|
1307 |
+
addRegexToken('YY', match1to2, match2);
|
1308 |
+
addRegexToken('YYYY', match1to4, match4);
|
1309 |
+
addRegexToken('YYYYY', match1to6, match6);
|
1310 |
+
addRegexToken('YYYYYY', match1to6, match6);
|
1311 |
+
|
1312 |
+
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
1313 |
+
addParseToken('YYYY', function (input, array) {
|
1314 |
+
array[YEAR] =
|
1315 |
+
input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
1316 |
+
});
|
1317 |
+
addParseToken('YY', function (input, array) {
|
1318 |
+
array[YEAR] = hooks.parseTwoDigitYear(input);
|
1319 |
+
});
|
1320 |
+
addParseToken('Y', function (input, array) {
|
1321 |
+
array[YEAR] = parseInt(input, 10);
|
1322 |
+
});
|
1323 |
+
|
1324 |
+
// HELPERS
|
1325 |
+
|
1326 |
+
function daysInYear(year) {
|
1327 |
+
return isLeapYear(year) ? 366 : 365;
|
1328 |
+
}
|
1329 |
+
|
1330 |
+
// HOOKS
|
1331 |
+
|
1332 |
+
hooks.parseTwoDigitYear = function (input) {
|
1333 |
+
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
1334 |
+
};
|
1335 |
+
|
1336 |
+
// MOMENTS
|
1337 |
+
|
1338 |
+
var getSetYear = makeGetSet('FullYear', true);
|
1339 |
+
|
1340 |
+
function getIsLeapYear() {
|
1341 |
+
return isLeapYear(this.year());
|
1342 |
}
|
1343 |
|
1344 |
+
function createDate(y, m, d, h, M, s, ms) {
|
1345 |
// can't just apply() to create a date:
|
1346 |
// https://stackoverflow.com/q/181348
|
1347 |
+
var date;
|
|
|
1348 |
// the date constructor remaps years 0-99 to 1900-1999
|
1349 |
+
if (y < 100 && y >= 0) {
|
1350 |
+
// preserve leap years using a full 400 year cycle, then reset
|
1351 |
+
date = new Date(y + 400, m, d, h, M, s, ms);
|
1352 |
+
if (isFinite(date.getFullYear())) {
|
1353 |
+
date.setFullYear(y);
|
1354 |
+
}
|
1355 |
+
} else {
|
1356 |
+
date = new Date(y, m, d, h, M, s, ms);
|
1357 |
}
|
1358 |
+
|
1359 |
return date;
|
1360 |
}
|
1361 |
|
1362 |
+
function createUTCDate(y) {
|
1363 |
+
var date, args;
|
|
|
1364 |
// the Date.UTC function remaps years 0-99 to 1900-1999
|
1365 |
+
if (y < 100 && y >= 0) {
|
1366 |
+
args = Array.prototype.slice.call(arguments);
|
1367 |
+
// preserve leap years using a full 400 year cycle, then reset
|
1368 |
+
args[0] = y + 400;
|
1369 |
+
date = new Date(Date.UTC.apply(null, args));
|
1370 |
+
if (isFinite(date.getUTCFullYear())) {
|
1371 |
+
date.setUTCFullYear(y);
|
1372 |
+
}
|
1373 |
+
} else {
|
1374 |
+
date = new Date(Date.UTC.apply(null, arguments));
|
1375 |
}
|
1376 |
+
|
1377 |
return date;
|
1378 |
}
|
1379 |
|
1392 |
var localWeekday = (7 + weekday - dow) % 7,
|
1393 |
weekOffset = firstWeekOffset(year, dow, doy),
|
1394 |
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
|
1395 |
+
resYear,
|
1396 |
+
resDayOfYear;
|
1397 |
|
1398 |
if (dayOfYear <= 0) {
|
1399 |
resYear = year - 1;
|
1408 |
|
1409 |
return {
|
1410 |
year: resYear,
|
1411 |
+
dayOfYear: resDayOfYear,
|
1412 |
};
|
1413 |
}
|
1414 |
|
1415 |
function weekOfYear(mom, dow, doy) {
|
1416 |
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
|
1417 |
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
|
1418 |
+
resWeek,
|
1419 |
+
resYear;
|
1420 |
|
1421 |
if (week < 1) {
|
1422 |
resYear = mom.year() - 1;
|
1431 |
|
1432 |
return {
|
1433 |
week: resWeek,
|
1434 |
+
year: resYear,
|
1435 |
};
|
1436 |
}
|
1437 |
|
1458 |
|
1459 |
// PARSING
|
1460 |
|
1461 |
+
addRegexToken('w', match1to2);
|
1462 |
addRegexToken('ww', match1to2, match2);
|
1463 |
+
addRegexToken('W', match1to2);
|
1464 |
addRegexToken('WW', match1to2, match2);
|
1465 |
|
1466 |
+
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
|
1467 |
+
input,
|
1468 |
+
week,
|
1469 |
+
config,
|
1470 |
+
token
|
1471 |
+
) {
|
1472 |
week[token.substr(0, 1)] = toInt(input);
|
1473 |
});
|
1474 |
|
1476 |
|
1477 |
// LOCALES
|
1478 |
|
1479 |
+
function localeWeek(mom) {
|
1480 |
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
1481 |
}
|
1482 |
|
1483 |
var defaultLocaleWeek = {
|
1484 |
+
dow: 0, // Sunday is the first day of the week.
|
1485 |
+
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
1486 |
};
|
1487 |
|
1488 |
+
function localeFirstDayOfWeek() {
|
1489 |
return this._week.dow;
|
1490 |
}
|
1491 |
|
1492 |
+
function localeFirstDayOfYear() {
|
1493 |
return this._week.doy;
|
1494 |
}
|
1495 |
|
1496 |
// MOMENTS
|
1497 |
|
1498 |
+
function getSetWeek(input) {
|
1499 |
var week = this.localeData().week(this);
|
1500 |
return input == null ? week : this.add((input - week) * 7, 'd');
|
1501 |
}
|
1502 |
|
1503 |
+
function getSetISOWeek(input) {
|
1504 |
var week = weekOfYear(this, 1, 4).week;
|
1505 |
return input == null ? week : this.add((input - week) * 7, 'd');
|
1506 |
}
|
1537 |
|
1538 |
// PARSING
|
1539 |
|
1540 |
+
addRegexToken('d', match1to2);
|
1541 |
+
addRegexToken('e', match1to2);
|
1542 |
+
addRegexToken('E', match1to2);
|
1543 |
+
addRegexToken('dd', function (isStrict, locale) {
|
1544 |
return locale.weekdaysMinRegex(isStrict);
|
1545 |
});
|
1546 |
+
addRegexToken('ddd', function (isStrict, locale) {
|
1547 |
return locale.weekdaysShortRegex(isStrict);
|
1548 |
});
|
1549 |
+
addRegexToken('dddd', function (isStrict, locale) {
|
1550 |
return locale.weekdaysRegex(isStrict);
|
1551 |
});
|
1552 |
|
1591 |
}
|
1592 |
|
1593 |
// LOCALES
|
1594 |
+
function shiftWeekdays(ws, n) {
|
1595 |
+
return ws.slice(n, 7).concat(ws.slice(0, n));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1596 |
}
|
1597 |
|
1598 |
+
var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
1599 |
+
'_'
|
1600 |
+
),
|
1601 |
+
defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
1602 |
+
defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
1603 |
+
defaultWeekdaysRegex = matchWord,
|
1604 |
+
defaultWeekdaysShortRegex = matchWord,
|
1605 |
+
defaultWeekdaysMinRegex = matchWord;
|
1606 |
+
|
1607 |
+
function localeWeekdays(m, format) {
|
1608 |
+
var weekdays = isArray(this._weekdays)
|
1609 |
+
? this._weekdays
|
1610 |
+
: this._weekdays[
|
1611 |
+
m && m !== true && this._weekdays.isFormat.test(format)
|
1612 |
+
? 'format'
|
1613 |
+
: 'standalone'
|
1614 |
+
];
|
1615 |
+
return m === true
|
1616 |
+
? shiftWeekdays(weekdays, this._week.dow)
|
1617 |
+
: m
|
1618 |
+
? weekdays[m.day()]
|
1619 |
+
: weekdays;
|
1620 |
+
}
|
1621 |
+
|
1622 |
+
function localeWeekdaysShort(m) {
|
1623 |
+
return m === true
|
1624 |
+
? shiftWeekdays(this._weekdaysShort, this._week.dow)
|
1625 |
+
: m
|
1626 |
+
? this._weekdaysShort[m.day()]
|
1627 |
+
: this._weekdaysShort;
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
function localeWeekdaysMin(m) {
|
1631 |
+
return m === true
|
1632 |
+
? shiftWeekdays(this._weekdaysMin, this._week.dow)
|
1633 |
+
: m
|
1634 |
+
? this._weekdaysMin[m.day()]
|
1635 |
+
: this._weekdaysMin;
|
1636 |
}
|
1637 |
|
1638 |
function handleStrictParse$1(weekdayName, format, strict) {
|
1639 |
+
var i,
|
1640 |
+
ii,
|
1641 |
+
mom,
|
1642 |
+
llc = weekdayName.toLocaleLowerCase();
|
1643 |
if (!this._weekdaysParse) {
|
1644 |
this._weekdaysParse = [];
|
1645 |
this._shortWeekdaysParse = [];
|
1647 |
|
1648 |
for (i = 0; i < 7; ++i) {
|
1649 |
mom = createUTC([2000, 1]).day(i);
|
1650 |
+
this._minWeekdaysParse[i] = this.weekdaysMin(
|
1651 |
+
mom,
|
1652 |
+
''
|
1653 |
+
).toLocaleLowerCase();
|
1654 |
+
this._shortWeekdaysParse[i] = this.weekdaysShort(
|
1655 |
+
mom,
|
1656 |
+
''
|
1657 |
+
).toLocaleLowerCase();
|
1658 |
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
|
1659 |
}
|
1660 |
}
|
1708 |
}
|
1709 |
}
|
1710 |
|
1711 |
+
function localeWeekdaysParse(weekdayName, format, strict) {
|
1712 |
var i, mom, regex;
|
1713 |
|
1714 |
if (this._weekdaysParseExact) {
|
1727 |
|
1728 |
mom = createUTC([2000, 1]).day(i);
|
1729 |
if (strict && !this._fullWeekdaysParse[i]) {
|
1730 |
+
this._fullWeekdaysParse[i] = new RegExp(
|
1731 |
+
'^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
|
1732 |
+
'i'
|
1733 |
+
);
|
1734 |
+
this._shortWeekdaysParse[i] = new RegExp(
|
1735 |
+
'^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
|
1736 |
+
'i'
|
1737 |
+
);
|
1738 |
+
this._minWeekdaysParse[i] = new RegExp(
|
1739 |
+
'^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
|
1740 |
+
'i'
|
1741 |
+
);
|
1742 |
}
|
1743 |
if (!this._weekdaysParse[i]) {
|
1744 |
+
regex =
|
1745 |
+
'^' +
|
1746 |
+
this.weekdays(mom, '') +
|
1747 |
+
'|^' +
|
1748 |
+
this.weekdaysShort(mom, '') +
|
1749 |
+
'|^' +
|
1750 |
+
this.weekdaysMin(mom, '');
|
1751 |
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
1752 |
}
|
1753 |
// test the regex
|
1754 |
+
if (
|
1755 |
+
strict &&
|
1756 |
+
format === 'dddd' &&
|
1757 |
+
this._fullWeekdaysParse[i].test(weekdayName)
|
1758 |
+
) {
|
1759 |
return i;
|
1760 |
+
} else if (
|
1761 |
+
strict &&
|
1762 |
+
format === 'ddd' &&
|
1763 |
+
this._shortWeekdaysParse[i].test(weekdayName)
|
1764 |
+
) {
|
1765 |
return i;
|
1766 |
+
} else if (
|
1767 |
+
strict &&
|
1768 |
+
format === 'dd' &&
|
1769 |
+
this._minWeekdaysParse[i].test(weekdayName)
|
1770 |
+
) {
|
1771 |
return i;
|
1772 |
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
1773 |
return i;
|
1777 |
|
1778 |
// MOMENTS
|
1779 |
|
1780 |
+
function getSetDayOfWeek(input) {
|
1781 |
if (!this.isValid()) {
|
1782 |
return input != null ? this : NaN;
|
1783 |
}
|
1790 |
}
|
1791 |
}
|
1792 |
|
1793 |
+
function getSetLocaleDayOfWeek(input) {
|
1794 |
if (!this.isValid()) {
|
1795 |
return input != null ? this : NaN;
|
1796 |
}
|
1798 |
return input == null ? weekday : this.add(input - weekday, 'd');
|
1799 |
}
|
1800 |
|
1801 |
+
function getSetISODayOfWeek(input) {
|
1802 |
if (!this.isValid()) {
|
1803 |
return input != null ? this : NaN;
|
1804 |
}
|
1815 |
}
|
1816 |
}
|
1817 |
|
1818 |
+
function weekdaysRegex(isStrict) {
|
|
|
1819 |
if (this._weekdaysParseExact) {
|
1820 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1821 |
computeWeekdaysParse.call(this);
|
1829 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1830 |
this._weekdaysRegex = defaultWeekdaysRegex;
|
1831 |
}
|
1832 |
+
return this._weekdaysStrictRegex && isStrict
|
1833 |
+
? this._weekdaysStrictRegex
|
1834 |
+
: this._weekdaysRegex;
|
1835 |
}
|
1836 |
}
|
1837 |
|
1838 |
+
function weekdaysShortRegex(isStrict) {
|
|
|
1839 |
if (this._weekdaysParseExact) {
|
1840 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1841 |
computeWeekdaysParse.call(this);
|
1849 |
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
|
1850 |
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
1851 |
}
|
1852 |
+
return this._weekdaysShortStrictRegex && isStrict
|
1853 |
+
? this._weekdaysShortStrictRegex
|
1854 |
+
: this._weekdaysShortRegex;
|
1855 |
}
|
1856 |
}
|
1857 |
|
1858 |
+
function weekdaysMinRegex(isStrict) {
|
|
|
1859 |
if (this._weekdaysParseExact) {
|
1860 |
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
1861 |
computeWeekdaysParse.call(this);
|
1869 |
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
|
1870 |
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
1871 |
}
|
1872 |
+
return this._weekdaysMinStrictRegex && isStrict
|
1873 |
+
? this._weekdaysMinStrictRegex
|
1874 |
+
: this._weekdaysMinRegex;
|
1875 |
}
|
1876 |
}
|
1877 |
|
1878 |
+
function computeWeekdaysParse() {
|
|
|
1879 |
function cmpLenRev(a, b) {
|
1880 |
return b.length - a.length;
|
1881 |
}
|
1882 |
|
1883 |
+
var minPieces = [],
|
1884 |
+
shortPieces = [],
|
1885 |
+
longPieces = [],
|
1886 |
+
mixedPieces = [],
|
1887 |
+
i,
|
1888 |
+
mom,
|
1889 |
+
minp,
|
1890 |
+
shortp,
|
1891 |
+
longp;
|
1892 |
for (i = 0; i < 7; i++) {
|
1893 |
// make the regex if we don't have it already
|
1894 |
mom = createUTC([2000, 1]).day(i);
|
1895 |
+
minp = regexEscape(this.weekdaysMin(mom, ''));
|
1896 |
+
shortp = regexEscape(this.weekdaysShort(mom, ''));
|
1897 |
+
longp = regexEscape(this.weekdays(mom, ''));
|
1898 |
minPieces.push(minp);
|
1899 |
shortPieces.push(shortp);
|
1900 |
longPieces.push(longp);
|
1908 |
shortPieces.sort(cmpLenRev);
|
1909 |
longPieces.sort(cmpLenRev);
|
1910 |
mixedPieces.sort(cmpLenRev);
|
|
|
|
|
|
|
|
|
|
|
1911 |
|
1912 |
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
1913 |
this._weekdaysShortRegex = this._weekdaysRegex;
|
1914 |
this._weekdaysMinRegex = this._weekdaysRegex;
|
1915 |
|
1916 |
+
this._weekdaysStrictRegex = new RegExp(
|
1917 |
+
'^(' + longPieces.join('|') + ')',
|
1918 |
+
'i'
|
1919 |
+
);
|
1920 |
+
this._weekdaysShortStrictRegex = new RegExp(
|
1921 |
+
'^(' + shortPieces.join('|') + ')',
|
1922 |
+
'i'
|
1923 |
+
);
|
1924 |
+
this._weekdaysMinStrictRegex = new RegExp(
|
1925 |
+
'^(' + minPieces.join('|') + ')',
|
1926 |
+
'i'
|
1927 |
+
);
|
1928 |
}
|
1929 |
|
1930 |
// FORMATTING
|
1946 |
});
|
1947 |
|
1948 |
addFormatToken('hmmss', 0, 0, function () {
|
1949 |
+
return (
|
1950 |
+
'' +
|
1951 |
+
hFormat.apply(this) +
|
1952 |
+
zeroFill(this.minutes(), 2) +
|
1953 |
+
zeroFill(this.seconds(), 2)
|
1954 |
+
);
|
1955 |
});
|
1956 |
|
1957 |
addFormatToken('Hmm', 0, 0, function () {
|
1959 |
});
|
1960 |
|
1961 |
addFormatToken('Hmmss', 0, 0, function () {
|
1962 |
+
return (
|
1963 |
+
'' +
|
1964 |
+
this.hours() +
|
1965 |
+
zeroFill(this.minutes(), 2) +
|
1966 |
+
zeroFill(this.seconds(), 2)
|
1967 |
+
);
|
1968 |
});
|
1969 |
|
1970 |
+
function meridiem(token, lowercase) {
|
1971 |
addFormatToken(token, 0, 0, function () {
|
1972 |
+
return this.localeData().meridiem(
|
1973 |
+
this.hours(),
|
1974 |
+
this.minutes(),
|
1975 |
+
lowercase
|
1976 |
+
);
|
1977 |
});
|
1978 |
}
|
1979 |
|
1989 |
|
1990 |
// PARSING
|
1991 |
|
1992 |
+
function matchMeridiem(isStrict, locale) {
|
1993 |
return locale._meridiemParse;
|
1994 |
}
|
1995 |
|
1996 |
+
addRegexToken('a', matchMeridiem);
|
1997 |
+
addRegexToken('A', matchMeridiem);
|
1998 |
+
addRegexToken('H', match1to2);
|
1999 |
+
addRegexToken('h', match1to2);
|
2000 |
+
addRegexToken('k', match1to2);
|
2001 |
addRegexToken('HH', match1to2, match2);
|
2002 |
addRegexToken('hh', match1to2, match2);
|
2003 |
addRegexToken('kk', match1to2, match2);
|
2027 |
getParsingFlags(config).bigHour = true;
|
2028 |
});
|
2029 |
addParseToken('hmmss', function (input, array, config) {
|
2030 |
+
var pos1 = input.length - 4,
|
2031 |
+
pos2 = input.length - 2;
|
2032 |
array[HOUR] = toInt(input.substr(0, pos1));
|
2033 |
array[MINUTE] = toInt(input.substr(pos1, 2));
|
2034 |
array[SECOND] = toInt(input.substr(pos2));
|
2040 |
array[MINUTE] = toInt(input.substr(pos));
|
2041 |
});
|
2042 |
addParseToken('Hmmss', function (input, array, config) {
|
2043 |
+
var pos1 = input.length - 4,
|
2044 |
+
pos2 = input.length - 2;
|
2045 |
array[HOUR] = toInt(input.substr(0, pos1));
|
2046 |
array[MINUTE] = toInt(input.substr(pos1, 2));
|
2047 |
array[SECOND] = toInt(input.substr(pos2));
|
2049 |
|
2050 |
// LOCALES
|
2051 |
|
2052 |
+
function localeIsPM(input) {
|
2053 |
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
|
2054 |
// Using charAt should be more compatible.
|
2055 |
+
return (input + '').toLowerCase().charAt(0) === 'p';
|
2056 |
}
|
2057 |
|
2058 |
+
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
|
2059 |
+
// Setting the hour should keep the time, because the user explicitly
|
2060 |
+
// specified which hour they want. So trying to maintain the same hour (in
|
2061 |
+
// a new timezone) makes sense. Adding/subtracting hours does not follow
|
2062 |
+
// this rule.
|
2063 |
+
getSetHour = makeGetSet('Hours', true);
|
2064 |
+
|
2065 |
+
function localeMeridiem(hours, minutes, isLower) {
|
2066 |
if (hours > 11) {
|
2067 |
return isLower ? 'pm' : 'PM';
|
2068 |
} else {
|
2070 |
}
|
2071 |
}
|
2072 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2073 |
var baseConfig = {
|
2074 |
calendar: defaultCalendar,
|
2075 |
longDateFormat: defaultLongDateFormat,
|
2087 |
weekdaysMin: defaultLocaleWeekdaysMin,
|
2088 |
weekdaysShort: defaultLocaleWeekdaysShort,
|
2089 |
|
2090 |
+
meridiemParse: defaultLocaleMeridiemParse,
|
2091 |
};
|
2092 |
|
2093 |
// internal storage for locale config files
|
2094 |
+
var locales = {},
|
2095 |
+
localeFamilies = {},
|
2096 |
+
globalLocale;
|
2097 |
+
|
2098 |
+
function commonPrefix(arr1, arr2) {
|
2099 |
+
var i,
|
2100 |
+
minl = Math.min(arr1.length, arr2.length);
|
2101 |
+
for (i = 0; i < minl; i += 1) {
|
2102 |
+
if (arr1[i] !== arr2[i]) {
|
2103 |
+
return i;
|
2104 |
+
}
|
2105 |
+
}
|
2106 |
+
return minl;
|
2107 |
+
}
|
2108 |
|
2109 |
function normalizeLocale(key) {
|
2110 |
return key ? key.toLowerCase().replace('_', '-') : key;
|
2114 |
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
|
2115 |
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
|
2116 |
function chooseLocale(names) {
|
2117 |
+
var i = 0,
|
2118 |
+
j,
|
2119 |
+
next,
|
2120 |
+
locale,
|
2121 |
+
split;
|
2122 |
|
2123 |
while (i < names.length) {
|
2124 |
split = normalizeLocale(names[i]).split('-');
|
2130 |
if (locale) {
|
2131 |
return locale;
|
2132 |
}
|
2133 |
+
if (
|
2134 |
+
next &&
|
2135 |
+
next.length >= j &&
|
2136 |
+
commonPrefix(split, next) >= j - 1
|
2137 |
+
) {
|
2138 |
//the next array item is better than a shallower substring of this one
|
2139 |
break;
|
2140 |
}
|
2146 |
}
|
2147 |
|
2148 |
function loadLocale(name) {
|
2149 |
+
var oldLocale = null,
|
2150 |
+
aliasedRequire;
|
2151 |
// TODO: Find a better way to register and load all the locales in Node
|
2152 |
+
if (
|
2153 |
+
locales[name] === undefined &&
|
2154 |
+
typeof module !== 'undefined' &&
|
2155 |
+
module &&
|
2156 |
+
module.exports
|
2157 |
+
) {
|
2158 |
try {
|
2159 |
oldLocale = globalLocale._abbr;
|
2160 |
+
aliasedRequire = require;
|
2161 |
+
__webpack_require__(646)("./" + name);
|
2162 |
getSetGlobalLocale(oldLocale);
|
2163 |
+
} catch (e) {
|
2164 |
+
// mark as not found to avoid repeating expensive file require call causing high CPU
|
2165 |
+
// when trying to find en-US, en_US, en-us for every format call
|
2166 |
+
locales[name] = null; // null means not found
|
2167 |
+
}
|
2168 |
}
|
2169 |
return locales[name];
|
2170 |
}
|
2172 |
// This function will load locale and then set the global locale. If
|
2173 |
// no arguments are passed in, it will simply return the current global
|
2174 |
// locale key.
|
2175 |
+
function getSetGlobalLocale(key, values) {
|
2176 |
var data;
|
2177 |
if (key) {
|
2178 |
if (isUndefined(values)) {
|
2179 |
data = getLocale(key);
|
2180 |
+
} else {
|
|
|
2181 |
data = defineLocale(key, values);
|
2182 |
}
|
2183 |
|
2184 |
if (data) {
|
2185 |
// moment.duration._locale = moment._locale = data;
|
2186 |
globalLocale = data;
|
2187 |
+
} else {
|
2188 |
+
if (typeof console !== 'undefined' && console.warn) {
|
|
|
2189 |
//warn user if arguments are passed but the locale could not be set
|
2190 |
+
console.warn(
|
2191 |
+
'Locale ' + key + ' not found. Did you forget to load it?'
|
2192 |
+
);
|
2193 |
}
|
2194 |
}
|
2195 |
}
|
2197 |
return globalLocale._abbr;
|
2198 |
}
|
2199 |
|
2200 |
+
function defineLocale(name, config) {
|
2201 |
if (config !== null) {
|
2202 |
+
var locale,
|
2203 |
+
parentConfig = baseConfig;
|
2204 |
config.abbr = name;
|
2205 |
if (locales[name] != null) {
|
2206 |
+
deprecateSimple(
|
2207 |
+
'defineLocaleOverride',
|
2208 |
+
'use moment.updateLocale(localeName, config) to change ' +
|
2209 |
'an existing locale. moment.defineLocale(localeName, ' +
|
2210 |
'config) should only be used for creating a new locale ' +
|
2211 |
+
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
|
2212 |
+
);
|
2213 |
parentConfig = locales[name]._config;
|
2214 |
} else if (config.parentLocale != null) {
|
2215 |
if (locales[config.parentLocale] != null) {
|
2224 |
}
|
2225 |
localeFamilies[config.parentLocale].push({
|
2226 |
name: name,
|
2227 |
+
config: config,
|
2228 |
});
|
2229 |
return null;
|
2230 |
}
|
2243 |
// created, so we won't end up with the child locale set.
|
2244 |
getSetGlobalLocale(name);
|
2245 |
|
|
|
2246 |
return locales[name];
|
2247 |
} else {
|
2248 |
// useful for testing
|
2253 |
|
2254 |
function updateLocale(name, config) {
|
2255 |
if (config != null) {
|
2256 |
+
var locale,
|
2257 |
+
tmpLocale,
|
2258 |
+
parentConfig = baseConfig;
|
2259 |
+
|
2260 |
+
if (locales[name] != null && locales[name].parentLocale != null) {
|
2261 |
+
// Update existing child locale in-place to avoid memory-leaks
|
2262 |
+
locales[name].set(mergeConfigs(locales[name]._config, config));
|
2263 |
+
} else {
|
2264 |
+
// MERGE
|
2265 |
+
tmpLocale = loadLocale(name);
|
2266 |
+
if (tmpLocale != null) {
|
2267 |
+
parentConfig = tmpLocale._config;
|
2268 |
+
}
|
2269 |
+
config = mergeConfigs(parentConfig, config);
|
2270 |
+
if (tmpLocale == null) {
|
2271 |
+
// updateLocale is called for creating a new locale
|
2272 |
+
// Set abbr so it will have a name (getters return
|
2273 |
+
// undefined otherwise).
|
2274 |
+
config.abbr = name;
|
2275 |
+
}
|
2276 |
+
locale = new Locale(config);
|
2277 |
+
locale.parentLocale = locales[name];
|
2278 |
+
locales[name] = locale;
|
2279 |
}
|
|
|
|
|
|
|
|
|
2280 |
|
2281 |
// backwards compat for now: also set the locale
|
2282 |
getSetGlobalLocale(name);
|
2285 |
if (locales[name] != null) {
|
2286 |
if (locales[name].parentLocale != null) {
|
2287 |
locales[name] = locales[name].parentLocale;
|
2288 |
+
if (name === getSetGlobalLocale()) {
|
2289 |
+
getSetGlobalLocale(name);
|
2290 |
+
}
|
2291 |
} else if (locales[name] != null) {
|
2292 |
delete locales[name];
|
2293 |
}
|
2297 |
}
|
2298 |
|
2299 |
// returns locale data
|
2300 |
+
function getLocale(key) {
|
2301 |
var locale;
|
2302 |
|
2303 |
if (key && key._locale && key._locale._abbr) {
|
2324 |
return keys(locales);
|
2325 |
}
|
2326 |
|
2327 |
+
function checkOverflow(m) {
|
2328 |
+
var overflow,
|
2329 |
+
a = m._a;
|
2330 |
|
2331 |
if (a && getParsingFlags(m).overflow === -2) {
|
2332 |
overflow =
|
2333 |
+
a[MONTH] < 0 || a[MONTH] > 11
|
2334 |
+
? MONTH
|
2335 |
+
: a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
|
2336 |
+
? DATE
|
2337 |
+
: a[HOUR] < 0 ||
|
2338 |
+
a[HOUR] > 24 ||
|
2339 |
+
(a[HOUR] === 24 &&
|
2340 |
+
(a[MINUTE] !== 0 ||
|
2341 |
+
a[SECOND] !== 0 ||
|
2342 |
+
a[MILLISECOND] !== 0))
|
2343 |
+
? HOUR
|
2344 |
+
: a[MINUTE] < 0 || a[MINUTE] > 59
|
2345 |
+
? MINUTE
|
2346 |
+
: a[SECOND] < 0 || a[SECOND] > 59
|
2347 |
+
? SECOND
|
2348 |
+
: a[MILLISECOND] < 0 || a[MILLISECOND] > 999
|
2349 |
+
? MILLISECOND
|
2350 |
+
: -1;
|
2351 |
+
|
2352 |
+
if (
|
2353 |
+
getParsingFlags(m)._overflowDayOfYear &&
|
2354 |
+
(overflow < YEAR || overflow > DATE)
|
2355 |
+
) {
|
2356 |
overflow = DATE;
|
2357 |
}
|
2358 |
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
2368 |
return m;
|
2369 |
}
|
2370 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2371 |
// iso 8601 regex
|
2372 |
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
|
2373 |
+
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
2374 |
+
basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
2375 |
+
tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
|
2376 |
+
isoDates = [
|
2377 |
+
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
|
2378 |
+
['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
|
2379 |
+
['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
|
2380 |
+
['GGGG-[W]WW', /\d{4}-W\d\d/, false],
|
2381 |
+
['YYYY-DDD', /\d{4}-\d{3}/],
|
2382 |
+
['YYYY-MM', /\d{4}-\d\d/, false],
|
2383 |
+
['YYYYYYMMDD', /[+-]\d{10}/],
|
2384 |
+
['YYYYMMDD', /\d{8}/],
|
2385 |
+
['GGGG[W]WWE', /\d{4}W\d{3}/],
|
2386 |
+
['GGGG[W]WW', /\d{4}W\d{2}/, false],
|
2387 |
+
['YYYYDDD', /\d{7}/],
|
2388 |
+
['YYYYMM', /\d{6}/, false],
|
2389 |
+
['YYYY', /\d{4}/, false],
|
2390 |
+
],
|
2391 |
+
// iso time formats and regexes
|
2392 |
+
isoTimes = [
|
2393 |
+
['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
|
2394 |
+
['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
|
2395 |
+
['HH:mm:ss', /\d\d:\d\d:\d\d/],
|
2396 |
+
['HH:mm', /\d\d:\d\d/],
|
2397 |
+
['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
|
2398 |
+
['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
|
2399 |
+
['HHmmss', /\d\d\d\d\d\d/],
|
2400 |
+
['HHmm', /\d\d\d\d/],
|
2401 |
+
['HH', /\d\d/],
|
2402 |
+
],
|
2403 |
+
aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
|
2404 |
+
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
|
2405 |
+
rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
|
2406 |
+
obsOffsets = {
|
2407 |
+
UT: 0,
|
2408 |
+
GMT: 0,
|
2409 |
+
EDT: -4 * 60,
|
2410 |
+
EST: -5 * 60,
|
2411 |
+
CDT: -5 * 60,
|
2412 |
+
CST: -6 * 60,
|
2413 |
+
MDT: -6 * 60,
|
2414 |
+
MST: -7 * 60,
|
2415 |
+
PDT: -7 * 60,
|
2416 |
+
PST: -8 * 60,
|
2417 |
+
};
|
2418 |
|
2419 |
// date from iso format
|
2420 |
function configFromISO(config) {
|
2421 |
+
var i,
|
2422 |
+
l,
|
2423 |
string = config._i,
|
2424 |
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
|
2425 |
+
allowTime,
|
2426 |
+
dateFormat,
|
2427 |
+
timeFormat,
|
2428 |
+
tzFormat;
|
2429 |
|
2430 |
if (match) {
|
2431 |
getParsingFlags(config).iso = true;
|
2473 |
}
|
2474 |
}
|
2475 |
|
2476 |
+
function extractFromRFC2822Strings(
|
2477 |
+
yearStr,
|
2478 |
+
monthStr,
|
2479 |
+
dayStr,
|
2480 |
+
hourStr,
|
2481 |
+
minuteStr,
|
2482 |
+
secondStr
|
2483 |
+
) {
|
2484 |
var result = [
|
2485 |
untruncateYear(yearStr),
|
2486 |
defaultLocaleMonthsShort.indexOf(monthStr),
|
2487 |
parseInt(dayStr, 10),
|
2488 |
parseInt(hourStr, 10),
|
2489 |
+
parseInt(minuteStr, 10),
|
2490 |
];
|
2491 |
|
2492 |
if (secondStr) {
|
2508 |
|
2509 |
function preprocessRFC2822(s) {
|
2510 |
// Remove comments and folding whitespace and replace multiple-spaces with a single space
|
2511 |
+
return s
|
2512 |
+
.replace(/\([^)]*\)|[\n\t]/g, ' ')
|
2513 |
+
.replace(/(\s\s+)/g, ' ')
|
2514 |
+
.replace(/^\s\s*/, '')
|
2515 |
+
.replace(/\s\s*$/, '');
|
2516 |
}
|
2517 |
|
2518 |
function checkWeekday(weekdayStr, parsedInput, config) {
|
2519 |
if (weekdayStr) {
|
2520 |
+
// TODO: Replace the vanilla JS Date object with an independent day-of-week check.
|
2521 |
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
|
2522 |
+
weekdayActual = new Date(
|
2523 |
+
parsedInput[0],
|
2524 |
+
parsedInput[1],
|
2525 |
+
parsedInput[2]
|
2526 |
+
).getDay();
|
2527 |
if (weekdayProvided !== weekdayActual) {
|
2528 |
getParsingFlags(config).weekdayMismatch = true;
|
2529 |
config._isValid = false;
|
2533 |
return true;
|
2534 |
}
|
2535 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2536 |
function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
2537 |
if (obsOffset) {
|
2538 |
return obsOffsets[obsOffset];
|
2540 |
// the only allowed military tz is Z
|
2541 |
return 0;
|
2542 |
} else {
|
2543 |
+
var hm = parseInt(numOffset, 10),
|
2544 |
+
m = hm % 100,
|
2545 |
+
h = (hm - m) / 100;
|
2546 |
return h * 60 + m;
|
2547 |
}
|
2548 |
}
|
2549 |
|
2550 |
// date and time from ref 2822 format
|
2551 |
function configFromRFC2822(config) {
|
2552 |
+
var match = rfc2822.exec(preprocessRFC2822(config._i)),
|
2553 |
+
parsedArray;
|
2554 |
if (match) {
|
2555 |
+
parsedArray = extractFromRFC2822Strings(
|
2556 |
+
match[4],
|
2557 |
+
match[3],
|
2558 |
+
match[2],
|
2559 |
+
match[5],
|
2560 |
+
match[6],
|
2561 |
+
match[7]
|
2562 |
+
);
|
2563 |
if (!checkWeekday(match[1], parsedArray, config)) {
|
2564 |
return;
|
2565 |
}
|
2576 |
}
|
2577 |
}
|
2578 |
|
2579 |
+
// date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
|
2580 |
function configFromString(config) {
|
2581 |
var matched = aspNetJsonRegex.exec(config._i);
|
|
|
2582 |
if (matched !== null) {
|
2583 |
config._d = new Date(+matched[1]);
|
2584 |
return;
|
2598 |
return;
|
2599 |
}
|
2600 |
|
2601 |
+
if (config._strict) {
|
2602 |
+
config._isValid = false;
|
2603 |
+
} else {
|
2604 |
+
// Final attempt, use Input Fallback
|
2605 |
+
hooks.createFromInputFallback(config);
|
2606 |
+
}
|
2607 |
}
|
2608 |
|
2609 |
hooks.createFromInputFallback = deprecate(
|
2610 |
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
|
2611 |
+
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
|
2612 |
+
'discouraged and will be removed in an upcoming major release. Please refer to ' +
|
2613 |
+
'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
|
2614 |
function (config) {
|
2615 |
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
|
2616 |
}
|
2617 |
);
|
2618 |
|
2619 |
+
// Pick the first defined of two or three arguments.
|
2620 |
+
function defaults(a, b, c) {
|
2621 |
+
if (a != null) {
|
2622 |
+
return a;
|
2623 |
+
}
|
2624 |
+
if (b != null) {
|
2625 |
+
return b;
|
2626 |
+
}
|
2627 |
+
return c;
|
2628 |
+
}
|
2629 |
+
|
2630 |
+
function currentDateArray(config) {
|
2631 |
+
// hooks is actually the exported moment object
|
2632 |
+
var nowValue = new Date(hooks.now());
|
2633 |
+
if (config._useUTC) {
|
2634 |
+
return [
|
2635 |
+
nowValue.getUTCFullYear(),
|
2636 |
+
nowValue.getUTCMonth(),
|
2637 |
+
nowValue.getUTCDate(),
|
2638 |
+
];
|
2639 |
+
}
|
2640 |
+
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
2641 |
+
}
|
2642 |
+
|
2643 |
+
// convert an array to a date.
|
2644 |
+
// the array should mirror the parameters below
|
2645 |
+
// note: all values past the year are optional and will default to the lowest possible value.
|
2646 |
+
// [year, month, day , hour, minute, second, millisecond]
|
2647 |
+
function configFromArray(config) {
|
2648 |
+
var i,
|
2649 |
+
date,
|
2650 |
+
input = [],
|
2651 |
+
currentDate,
|
2652 |
+
expectedWeekday,
|
2653 |
+
yearToUse;
|
2654 |
+
|
2655 |
+
if (config._d) {
|
2656 |
+
return;
|
2657 |
+
}
|
2658 |
+
|
2659 |
+
currentDate = currentDateArray(config);
|
2660 |
+
|
2661 |
+
//compute day of the year from weeks and weekdays
|
2662 |
+
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
2663 |
+
dayOfYearFromWeekInfo(config);
|
2664 |
+
}
|
2665 |
+
|
2666 |
+
//if the day of the year is set, figure out what it is
|
2667 |
+
if (config._dayOfYear != null) {
|
2668 |
+
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
2669 |
+
|
2670 |
+
if (
|
2671 |
+
config._dayOfYear > daysInYear(yearToUse) ||
|
2672 |
+
config._dayOfYear === 0
|
2673 |
+
) {
|
2674 |
+
getParsingFlags(config)._overflowDayOfYear = true;
|
2675 |
+
}
|
2676 |
+
|
2677 |
+
date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
2678 |
+
config._a[MONTH] = date.getUTCMonth();
|
2679 |
+
config._a[DATE] = date.getUTCDate();
|
2680 |
+
}
|
2681 |
+
|
2682 |
+
// Default to current date.
|
2683 |
+
// * if no year, month, day of month are given, default to today
|
2684 |
+
// * if day of month is given, default month and year
|
2685 |
+
// * if month is given, default only year
|
2686 |
+
// * if year is given, don't default anything
|
2687 |
+
for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
2688 |
+
config._a[i] = input[i] = currentDate[i];
|
2689 |
+
}
|
2690 |
+
|
2691 |
+
// Zero out whatever was not defaulted, including time
|
2692 |
+
for (; i < 7; i++) {
|
2693 |
+
config._a[i] = input[i] =
|
2694 |
+
config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
|
2695 |
+
}
|
2696 |
+
|
2697 |
+
// Check for 24:00:00.000
|
2698 |
+
if (
|
2699 |
+
config._a[HOUR] === 24 &&
|
2700 |
+
config._a[MINUTE] === 0 &&
|
2701 |
+
config._a[SECOND] === 0 &&
|
2702 |
+
config._a[MILLISECOND] === 0
|
2703 |
+
) {
|
2704 |
+
config._nextDay = true;
|
2705 |
+
config._a[HOUR] = 0;
|
2706 |
+
}
|
2707 |
+
|
2708 |
+
config._d = (config._useUTC ? createUTCDate : createDate).apply(
|
2709 |
+
null,
|
2710 |
+
input
|
2711 |
+
);
|
2712 |
+
expectedWeekday = config._useUTC
|
2713 |
+
? config._d.getUTCDay()
|
2714 |
+
: config._d.getDay();
|
2715 |
+
|
2716 |
+
// Apply timezone offset from input. The actual utcOffset can be changed
|
2717 |
+
// with parseZone.
|
2718 |
+
if (config._tzm != null) {
|
2719 |
+
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
2720 |
+
}
|
2721 |
+
|
2722 |
+
if (config._nextDay) {
|
2723 |
+
config._a[HOUR] = 24;
|
2724 |
+
}
|
2725 |
+
|
2726 |
+
// check for mismatching day of week
|
2727 |
+
if (
|
2728 |
+
config._w &&
|
2729 |
+
typeof config._w.d !== 'undefined' &&
|
2730 |
+
config._w.d !== expectedWeekday
|
2731 |
+
) {
|
2732 |
+
getParsingFlags(config).weekdayMismatch = true;
|
2733 |
+
}
|
2734 |
+
}
|
2735 |
+
|
2736 |
+
function dayOfYearFromWeekInfo(config) {
|
2737 |
+
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
|
2738 |
+
|
2739 |
+
w = config._w;
|
2740 |
+
if (w.GG != null || w.W != null || w.E != null) {
|
2741 |
+
dow = 1;
|
2742 |
+
doy = 4;
|
2743 |
+
|
2744 |
+
// TODO: We need to take the current isoWeekYear, but that depends on
|
2745 |
+
// how we interpret now (local, utc, fixed offset). So create
|
2746 |
+
// a now version of current config (take local/utc/offset flags, and
|
2747 |
+
// create now).
|
2748 |
+
weekYear = defaults(
|
2749 |
+
w.GG,
|
2750 |
+
config._a[YEAR],
|
2751 |
+
weekOfYear(createLocal(), 1, 4).year
|
2752 |
+
);
|
2753 |
+
week = defaults(w.W, 1);
|
2754 |
+
weekday = defaults(w.E, 1);
|
2755 |
+
if (weekday < 1 || weekday > 7) {
|
2756 |
+
weekdayOverflow = true;
|
2757 |
+
}
|
2758 |
+
} else {
|
2759 |
+
dow = config._locale._week.dow;
|
2760 |
+
doy = config._locale._week.doy;
|
2761 |
+
|
2762 |
+
curWeek = weekOfYear(createLocal(), dow, doy);
|
2763 |
+
|
2764 |
+
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
2765 |
+
|
2766 |
+
// Default to current week.
|
2767 |
+
week = defaults(w.w, curWeek.week);
|
2768 |
+
|
2769 |
+
if (w.d != null) {
|
2770 |
+
// weekday -- low day numbers are considered next week
|
2771 |
+
weekday = w.d;
|
2772 |
+
if (weekday < 0 || weekday > 6) {
|
2773 |
+
weekdayOverflow = true;
|
2774 |
+
}
|
2775 |
+
} else if (w.e != null) {
|
2776 |
+
// local weekday -- counting starts from beginning of week
|
2777 |
+
weekday = w.e + dow;
|
2778 |
+
if (w.e < 0 || w.e > 6) {
|
2779 |
+
weekdayOverflow = true;
|
2780 |
+
}
|
2781 |
+
} else {
|
2782 |
+
// default to beginning of week
|
2783 |
+
weekday = dow;
|
2784 |
+
}
|
2785 |
+
}
|
2786 |
+
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
2787 |
+
getParsingFlags(config)._overflowWeeks = true;
|
2788 |
+
} else if (weekdayOverflow != null) {
|
2789 |
+
getParsingFlags(config)._overflowWeekday = true;
|
2790 |
+
} else {
|
2791 |
+
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
2792 |
+
config._a[YEAR] = temp.year;
|
2793 |
+
config._dayOfYear = temp.dayOfYear;
|
2794 |
+
}
|
2795 |
+
}
|
2796 |
+
|
2797 |
// constant that refers to the ISO standard
|
2798 |
hooks.ISO_8601 = function () {};
|
2799 |
|
2816 |
|
2817 |
// This array is used to make a Date, either with `new Date` or `Date.UTC`
|
2818 |
var string = '' + config._i,
|
2819 |
+
i,
|
2820 |
+
parsedInput,
|
2821 |
+
tokens,
|
2822 |
+
token,
|
2823 |
+
skipped,
|
2824 |
stringLength = string.length,
|
2825 |
+
totalParsedInputLength = 0,
|
2826 |
+
era;
|
2827 |
|
2828 |
+
tokens =
|
2829 |
+
expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
2830 |
|
2831 |
for (i = 0; i < tokens.length; i++) {
|
2832 |
token = tokens[i];
|
2833 |
+
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
|
2834 |
+
[])[0];
|
|
|
2835 |
if (parsedInput) {
|
2836 |
skipped = string.substr(0, string.indexOf(parsedInput));
|
2837 |
if (skipped.length > 0) {
|
2838 |
getParsingFlags(config).unusedInput.push(skipped);
|
2839 |
}
|
2840 |
+
string = string.slice(
|
2841 |
+
string.indexOf(parsedInput) + parsedInput.length
|
2842 |
+
);
|
2843 |
totalParsedInputLength += parsedInput.length;
|
2844 |
}
|
2845 |
// don't parse if it's not a known token
|
2846 |
if (formatTokenFunctions[token]) {
|
2847 |
if (parsedInput) {
|
2848 |
getParsingFlags(config).empty = false;
|
2849 |
+
} else {
|
|
|
2850 |
getParsingFlags(config).unusedTokens.push(token);
|
2851 |
}
|
2852 |
addTimeToArrayFromToken(token, parsedInput, config);
|
2853 |
+
} else if (config._strict && !parsedInput) {
|
|
|
2854 |
getParsingFlags(config).unusedTokens.push(token);
|
2855 |
}
|
2856 |
}
|
2857 |
|
2858 |
// add remaining unparsed input length to the string
|
2859 |
+
getParsingFlags(config).charsLeftOver =
|
2860 |
+
stringLength - totalParsedInputLength;
|
2861 |
if (string.length > 0) {
|
2862 |
getParsingFlags(config).unusedInput.push(string);
|
2863 |
}
|
2864 |
|
2865 |
// clear _12h flag if hour is <= 12
|
2866 |
+
if (
|
2867 |
+
config._a[HOUR] <= 12 &&
|
2868 |
getParsingFlags(config).bigHour === true &&
|
2869 |
+
config._a[HOUR] > 0
|
2870 |
+
) {
|
2871 |
getParsingFlags(config).bigHour = undefined;
|
2872 |
}
|
2873 |
|
2874 |
getParsingFlags(config).parsedDateParts = config._a.slice(0);
|
2875 |
getParsingFlags(config).meridiem = config._meridiem;
|
2876 |
// handle meridiem
|
2877 |
+
config._a[HOUR] = meridiemFixWrap(
|
2878 |
+
config._locale,
|
2879 |
+
config._a[HOUR],
|
2880 |
+
config._meridiem
|
2881 |
+
);
|
2882 |
+
|
2883 |
+
// handle era
|
2884 |
+
era = getParsingFlags(config).era;
|
2885 |
+
if (era !== null) {
|
2886 |
+
config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
|
2887 |
+
}
|
2888 |
|
2889 |
configFromArray(config);
|
2890 |
checkOverflow(config);
|
2891 |
}
|
2892 |
|
2893 |
+
function meridiemFixWrap(locale, hour, meridiem) {
|
|
|
2894 |
var isPm;
|
2895 |
|
2896 |
if (meridiem == null) {
|
2919 |
function configFromStringAndArray(config) {
|
2920 |
var tempConfig,
|
2921 |
bestMoment,
|
|
|
2922 |
scoreToBeat,
|
2923 |
i,
|
2924 |
+
currentScore,
|
2925 |
+
validFormatFound,
|
2926 |
+
bestFormatIsValid = false;
|
2927 |
|
2928 |
if (config._f.length === 0) {
|
2929 |
getParsingFlags(config).invalidFormat = true;
|
2933 |
|
2934 |
for (i = 0; i < config._f.length; i++) {
|
2935 |
currentScore = 0;
|
2936 |
+
validFormatFound = false;
|
2937 |
tempConfig = copyConfig({}, config);
|
2938 |
if (config._useUTC != null) {
|
2939 |
tempConfig._useUTC = config._useUTC;
|
2941 |
tempConfig._f = config._f[i];
|
2942 |
configFromStringAndFormat(tempConfig);
|
2943 |
|
2944 |
+
if (isValid(tempConfig)) {
|
2945 |
+
validFormatFound = true;
|
2946 |
}
|
2947 |
|
2948 |
// if there is any input that was not parsed add a penalty for that format
|
2953 |
|
2954 |
getParsingFlags(tempConfig).score = currentScore;
|
2955 |
|
2956 |
+
if (!bestFormatIsValid) {
|
2957 |
+
if (
|
2958 |
+
scoreToBeat == null ||
|
2959 |
+
currentScore < scoreToBeat ||
|
2960 |
+
validFormatFound
|
2961 |
+
) {
|
2962 |
+
scoreToBeat = currentScore;
|
2963 |
+
bestMoment = tempConfig;
|
2964 |
+
if (validFormatFound) {
|
2965 |
+
bestFormatIsValid = true;
|
2966 |
+
}
|
2967 |
+
}
|
2968 |
+
} else {
|
2969 |
+
if (currentScore < scoreToBeat) {
|
2970 |
+
scoreToBeat = currentScore;
|
2971 |
+
bestMoment = tempConfig;
|
2972 |
+
}
|
2973 |
}
|
2974 |
}
|
2975 |
|
2981 |
return;
|
2982 |
}
|
2983 |
|
2984 |
+
var i = normalizeObjectUnits(config._i),
|
2985 |
+
dayOrDate = i.day === undefined ? i.date : i.day;
|
2986 |
+
config._a = map(
|
2987 |
+
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
|
2988 |
+
function (obj) {
|
2989 |
+
return obj && parseInt(obj, 10);
|
2990 |
+
}
|
2991 |
+
);
|
2992 |
|
2993 |
configFromArray(config);
|
2994 |
}
|
2995 |
|
2996 |
+
function createFromConfig(config) {
|
2997 |
var res = new Moment(checkOverflow(prepareConfig(config)));
|
2998 |
if (res._nextDay) {
|
2999 |
// Adding is smart enough around DST
|
3004 |
return res;
|
3005 |
}
|
3006 |
|
3007 |
+
function prepareConfig(config) {
|
3008 |
var input = config._i,
|
3009 |
format = config._f;
|
3010 |
|
3011 |
config._locale = config._locale || getLocale(config._l);
|
3012 |
|
3013 |
if (input === null || (format === undefined && input === '')) {
|
3014 |
+
return createInvalid({ nullInput: true });
|
3015 |
}
|
3016 |
|
3017 |
if (typeof input === 'string') {
|
3026 |
configFromStringAndArray(config);
|
3027 |
} else if (format) {
|
3028 |
configFromStringAndFormat(config);
|
3029 |
+
} else {
|
3030 |
configFromInput(config);
|
3031 |
}
|
3032 |
|
3060 |
}
|
3061 |
}
|
3062 |
|
3063 |
+
function createLocalOrUTC(input, format, locale, strict, isUTC) {
|
3064 |
var c = {};
|
3065 |
|
3066 |
+
if (format === true || format === false) {
|
3067 |
+
strict = format;
|
3068 |
+
format = undefined;
|
3069 |
+
}
|
3070 |
+
|
3071 |
if (locale === true || locale === false) {
|
3072 |
strict = locale;
|
3073 |
locale = undefined;
|
3074 |
}
|
3075 |
|
3076 |
+
if (
|
3077 |
+
(isObject(input) && isObjectEmpty(input)) ||
|
3078 |
+
(isArray(input) && input.length === 0)
|
3079 |
+
) {
|
3080 |
input = undefined;
|
3081 |
}
|
3082 |
// object construction must be done this way.
|
3091 |
return createFromConfig(c);
|
3092 |
}
|
3093 |
|
3094 |
+
function createLocal(input, format, locale, strict) {
|
3095 |
return createLocalOrUTC(input, format, locale, strict, false);
|
3096 |
}
|
3097 |
|
3098 |
var prototypeMin = deprecate(
|
3099 |
+
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
|
3100 |
+
function () {
|
3101 |
+
var other = createLocal.apply(null, arguments);
|
3102 |
+
if (this.isValid() && other.isValid()) {
|
3103 |
+
return other < this ? this : other;
|
3104 |
+
} else {
|
3105 |
+
return createInvalid();
|
3106 |
+
}
|
3107 |
}
|
3108 |
+
),
|
3109 |
+
prototypeMax = deprecate(
|
3110 |
+
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
|
3111 |
+
function () {
|
3112 |
+
var other = createLocal.apply(null, arguments);
|
3113 |
+
if (this.isValid() && other.isValid()) {
|
3114 |
+
return other > this ? this : other;
|
3115 |
+
} else {
|
3116 |
+
return createInvalid();
|
3117 |
+
}
|
|
|
3118 |
}
|
3119 |
+
);
|
|
|
3120 |
|
3121 |
// Pick a moment m from moments so that m[fn](other) is true for all
|
3122 |
// other. This relies on the function fn to be transitive.
|
3141 |
}
|
3142 |
|
3143 |
// TODO: Use [].sort instead?
|
3144 |
+
function min() {
|
3145 |
var args = [].slice.call(arguments, 0);
|
3146 |
|
3147 |
return pickBy('isBefore', args);
|
3148 |
}
|
3149 |
|
3150 |
+
function max() {
|
3151 |
var args = [].slice.call(arguments, 0);
|
3152 |
|
3153 |
return pickBy('isAfter', args);
|
3154 |
}
|
3155 |
|
3156 |
var now = function () {
|
3157 |
+
return Date.now ? Date.now() : +new Date();
|
3158 |
};
|
3159 |
|
3160 |
+
var ordering = [
|
3161 |
+
'year',
|
3162 |
+
'quarter',
|
3163 |
+
'month',
|
3164 |
+
'week',
|
3165 |
+
'day',
|
3166 |
+
'hour',
|
3167 |
+
'minute',
|
3168 |
+
'second',
|
3169 |
+
'millisecond',
|
3170 |
+
];
|
3171 |
|
3172 |
function isDurationValid(m) {
|
3173 |
+
var key,
|
3174 |
+
unitHasDecimal = false,
|
3175 |
+
i;
|
3176 |
+
for (key in m) {
|
3177 |
+
if (
|
3178 |
+
hasOwnProp(m, key) &&
|
3179 |
+
!(
|
3180 |
+
indexOf.call(ordering, key) !== -1 &&
|
3181 |
+
(m[key] == null || !isNaN(m[key]))
|
3182 |
+
)
|
3183 |
+
) {
|
3184 |
return false;
|
3185 |
}
|
3186 |
}
|
3187 |
|
3188 |
+
for (i = 0; i < ordering.length; ++i) {
|
|
|
3189 |
if (m[ordering[i]]) {
|
3190 |
if (unitHasDecimal) {
|
3191 |
return false; // only allow non-integers for smallest unit
|
3207 |
return createDuration(NaN);
|
3208 |
}
|
3209 |
|
3210 |
+
function Duration(duration) {
|
3211 |
var normalizedInput = normalizeObjectUnits(duration),
|
3212 |
years = normalizedInput.year || 0,
|
3213 |
quarters = normalizedInput.quarter || 0,
|
3222 |
this._isValid = isDurationValid(normalizedInput);
|
3223 |
|
3224 |
// representation for dateAddRemove
|
3225 |
+
this._milliseconds =
|
3226 |
+
+milliseconds +
|
3227 |
seconds * 1e3 + // 1000
|
3228 |
minutes * 6e4 + // 1000 * 60
|
3229 |
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
|
3230 |
// Because of dateAddRemove treats 24 hours as different from a
|
3231 |
// day when working around DST, we need to store them separately
|
3232 |
+
this._days = +days + weeks * 7;
|
|
|
3233 |
// It is impossible to translate months into days without knowing
|
3234 |
// which months you are are talking about, so we have to store
|
3235 |
// it separately.
|
3236 |
+
this._months = +months + quarters * 3 + years * 12;
|
|
|
|
|
3237 |
|
3238 |
this._data = {};
|
3239 |
|
3242 |
this._bubble();
|
3243 |
}
|
3244 |
|
3245 |
+
function isDuration(obj) {
|
3246 |
return obj instanceof Duration;
|
3247 |
}
|
3248 |
|
3249 |
+
function absRound(number) {
|
3250 |
if (number < 0) {
|
3251 |
return Math.round(-1 * number) * -1;
|
3252 |
} else {
|
3254 |
}
|
3255 |
}
|
3256 |
|
3257 |
+
// compare two arrays, return the number of differences
|
3258 |
+
function compareArrays(array1, array2, dontConvert) {
|
3259 |
+
var len = Math.min(array1.length, array2.length),
|
3260 |
+
lengthDiff = Math.abs(array1.length - array2.length),
|
3261 |
+
diffs = 0,
|
3262 |
+
i;
|
3263 |
+
for (i = 0; i < len; i++) {
|
3264 |
+
if (
|
3265 |
+
(dontConvert && array1[i] !== array2[i]) ||
|
3266 |
+
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
|
3267 |
+
) {
|
3268 |
+
diffs++;
|
3269 |
+
}
|
3270 |
+
}
|
3271 |
+
return diffs + lengthDiff;
|
3272 |
+
}
|
3273 |
+
|
3274 |
// FORMATTING
|
3275 |
|
3276 |
+
function offset(token, separator) {
|
3277 |
addFormatToken(token, 0, 0, function () {
|
3278 |
+
var offset = this.utcOffset(),
|
3279 |
+
sign = '+';
|
3280 |
if (offset < 0) {
|
3281 |
offset = -offset;
|
3282 |
sign = '-';
|
3283 |
}
|
3284 |
+
return (
|
3285 |
+
sign +
|
3286 |
+
zeroFill(~~(offset / 60), 2) +
|
3287 |
+
separator +
|
3288 |
+
zeroFill(~~offset % 60, 2)
|
3289 |
+
);
|
3290 |
});
|
3291 |
}
|
3292 |
|
3295 |
|
3296 |
// PARSING
|
3297 |
|
3298 |
+
addRegexToken('Z', matchShortOffset);
|
3299 |
addRegexToken('ZZ', matchShortOffset);
|
3300 |
addParseToken(['Z', 'ZZ'], function (input, array, config) {
|
3301 |
config._useUTC = true;
|
3310 |
var chunkOffset = /([\+\-]|\d\d)/gi;
|
3311 |
|
3312 |
function offsetFromString(matcher, string) {
|
3313 |
+
var matches = (string || '').match(matcher),
|
3314 |
+
chunk,
|
3315 |
+
parts,
|
3316 |
+
minutes;
|
3317 |
|
3318 |
if (matches === null) {
|
3319 |
return null;
|
3320 |
}
|
3321 |
|
3322 |
+
chunk = matches[matches.length - 1] || [];
|
3323 |
+
parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
|
3324 |
+
minutes = +(parts[1] * 60) + toInt(parts[2]);
|
3325 |
|
3326 |
+
return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
|
|
|
|
|
3327 |
}
|
3328 |
|
3329 |
// Return a moment from input, that is local/utc/zone equivalent to model.
|
3331 |
var res, diff;
|
3332 |
if (model._isUTC) {
|
3333 |
res = model.clone();
|
3334 |
+
diff =
|
3335 |
+
(isMoment(input) || isDate(input)
|
3336 |
+
? input.valueOf()
|
3337 |
+
: createLocal(input).valueOf()) - res.valueOf();
|
3338 |
// Use low-level api, because this fn is low-level api.
|
3339 |
res._d.setTime(res._d.valueOf() + diff);
|
3340 |
hooks.updateOffset(res, false);
|
3344 |
}
|
3345 |
}
|
3346 |
|
3347 |
+
function getDateOffset(m) {
|
3348 |
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
|
3349 |
// https://github.com/moment/moment/pull/1871
|
3350 |
+
return -Math.round(m._d.getTimezoneOffset());
|
3351 |
}
|
3352 |
|
3353 |
// HOOKS
|
3368 |
// a second time. In case it wants us to change the offset again
|
3369 |
// _changeInProgress == true case, then we have to adjust, because
|
3370 |
// there is no such time in the given timezone.
|
3371 |
+
function getSetOffset(input, keepLocalTime, keepMinutes) {
|
3372 |
var offset = this._offset || 0,
|
3373 |
localAdjust;
|
3374 |
if (!this.isValid()) {
|
3393 |
}
|
3394 |
if (offset !== input) {
|
3395 |
if (!keepLocalTime || this._changeInProgress) {
|
3396 |
+
addSubtract(
|
3397 |
+
this,
|
3398 |
+
createDuration(input - offset, 'm'),
|
3399 |
+
1,
|
3400 |
+
false
|
3401 |
+
);
|
3402 |
} else if (!this._changeInProgress) {
|
3403 |
this._changeInProgress = true;
|
3404 |
hooks.updateOffset(this, true);
|
3411 |
}
|
3412 |
}
|
3413 |
|
3414 |
+
function getSetZone(input, keepLocalTime) {
|
3415 |
if (input != null) {
|
3416 |
if (typeof input !== 'string') {
|
3417 |
input = -input;
|
3425 |
}
|
3426 |
}
|
3427 |
|
3428 |
+
function setOffsetToUTC(keepLocalTime) {
|
3429 |
return this.utcOffset(0, keepLocalTime);
|
3430 |
}
|
3431 |
|
3432 |
+
function setOffsetToLocal(keepLocalTime) {
|
3433 |
if (this._isUTC) {
|
3434 |
this.utcOffset(0, keepLocalTime);
|
3435 |
this._isUTC = false;
|
3441 |
return this;
|
3442 |
}
|
3443 |
|
3444 |
+
function setOffsetToParsedOffset() {
|
3445 |
if (this._tzm != null) {
|
3446 |
this.utcOffset(this._tzm, false, true);
|
3447 |
} else if (typeof this._i === 'string') {
|
3448 |
var tZone = offsetFromString(matchOffset, this._i);
|
3449 |
if (tZone != null) {
|
3450 |
this.utcOffset(tZone);
|
3451 |
+
} else {
|
|
|
3452 |
this.utcOffset(0, true);
|
3453 |
}
|
3454 |
}
|
3455 |
return this;
|
3456 |
}
|
3457 |
|
3458 |
+
function hasAlignedHourOffset(input) {
|
3459 |
if (!this.isValid()) {
|
3460 |
return false;
|
3461 |
}
|
3464 |
return (this.utcOffset() - input) % 60 === 0;
|
3465 |
}
|
3466 |
|
3467 |
+
function isDaylightSavingTime() {
|
3468 |
return (
|
3469 |
this.utcOffset() > this.clone().month(0).utcOffset() ||
|
3470 |
this.utcOffset() > this.clone().month(5).utcOffset()
|
3471 |
);
|
3472 |
}
|
3473 |
|
3474 |
+
function isDaylightSavingTimeShifted() {
|
3475 |
if (!isUndefined(this._isDSTShifted)) {
|
3476 |
return this._isDSTShifted;
|
3477 |
}
|
3478 |
|
3479 |
+
var c = {},
|
3480 |
+
other;
|
3481 |
|
3482 |
copyConfig(c, this);
|
3483 |
c = prepareConfig(c);
|
3484 |
|
3485 |
if (c._a) {
|
3486 |
+
other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
|
3487 |
+
this._isDSTShifted =
|
3488 |
+
this.isValid() && compareArrays(c._a, other.toArray()) > 0;
|
3489 |
} else {
|
3490 |
this._isDSTShifted = false;
|
3491 |
}
|
3493 |
return this._isDSTShifted;
|
3494 |
}
|
3495 |
|
3496 |
+
function isLocal() {
|
3497 |
return this.isValid() ? !this._isUTC : false;
|
3498 |
}
|
3499 |
|
3500 |
+
function isUtcOffset() {
|
3501 |
return this.isValid() ? this._isUTC : false;
|
3502 |
}
|
3503 |
|
3504 |
+
function isUtc() {
|
3505 |
return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
3506 |
}
|
3507 |
|
3508 |
// ASP.NET json date format regex
|
3509 |
+
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
|
3510 |
+
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
|
3511 |
+
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
|
3512 |
+
// and further modified to allow for strings containing both week and day
|
3513 |
+
isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
3514 |
|
3515 |
+
function createDuration(input, key) {
|
|
|
|
|
|
|
|
|
|
|
3516 |
var duration = input,
|
3517 |
// matching against regexp is expensive, do it on demand
|
3518 |
match = null,
|
3522 |
|
3523 |
if (isDuration(input)) {
|
3524 |
duration = {
|
3525 |
+
ms: input._milliseconds,
|
3526 |
+
d: input._days,
|
3527 |
+
M: input._months,
|
3528 |
};
|
3529 |
+
} else if (isNumber(input) || !isNaN(+input)) {
|
3530 |
duration = {};
|
3531 |
if (key) {
|
3532 |
+
duration[key] = +input;
|
3533 |
} else {
|
3534 |
+
duration.milliseconds = +input;
|
3535 |
}
|
3536 |
+
} else if ((match = aspNetRegex.exec(input))) {
|
3537 |
+
sign = match[1] === '-' ? -1 : 1;
|
3538 |
duration = {
|
3539 |
+
y: 0,
|
3540 |
+
d: toInt(match[DATE]) * sign,
|
3541 |
+
h: toInt(match[HOUR]) * sign,
|
3542 |
+
m: toInt(match[MINUTE]) * sign,
|
3543 |
+
s: toInt(match[SECOND]) * sign,
|
3544 |
+
ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
|
3545 |
};
|
3546 |
+
} else if ((match = isoRegex.exec(input))) {
|
3547 |
+
sign = match[1] === '-' ? -1 : 1;
|
3548 |
duration = {
|
3549 |
+
y: parseIso(match[2], sign),
|
3550 |
+
M: parseIso(match[3], sign),
|
3551 |
+
w: parseIso(match[4], sign),
|
3552 |
+
d: parseIso(match[5], sign),
|
3553 |
+
h: parseIso(match[6], sign),
|
3554 |
+
m: parseIso(match[7], sign),
|
3555 |
+
s: parseIso(match[8], sign),
|
3556 |
};
|
3557 |
+
} else if (duration == null) {
|
3558 |
+
// checks for null or undefined
|
3559 |
duration = {};
|
3560 |
+
} else if (
|
3561 |
+
typeof duration === 'object' &&
|
3562 |
+
('from' in duration || 'to' in duration)
|
3563 |
+
) {
|
3564 |
+
diffRes = momentsDifference(
|
3565 |
+
createLocal(duration.from),
|
3566 |
+
createLocal(duration.to)
|
3567 |
+
);
|
3568 |
|
3569 |
duration = {};
|
3570 |
duration.ms = diffRes.milliseconds;
|
3577 |
ret._locale = input._locale;
|
3578 |
}
|
3579 |
|
3580 |
+
if (isDuration(input) && hasOwnProp(input, '_isValid')) {
|
3581 |
+
ret._isValid = input._isValid;
|
3582 |
+
}
|
3583 |
+
|
3584 |
return ret;
|
3585 |
}
|
3586 |
|
3587 |
createDuration.fn = Duration.prototype;
|
3588 |
createDuration.invalid = createInvalid$1;
|
3589 |
|
3590 |
+
function parseIso(inp, sign) {
|
3591 |
// We'd normally use ~~inp for this, but unfortunately it also
|
3592 |
// converts floats to ints.
|
3593 |
// inp may be undefined, so careful calling replace on it.
|
3597 |
}
|
3598 |
|
3599 |
function positiveMomentsDifference(base, other) {
|
3600 |
+
var res = {};
|
3601 |
|
3602 |
+
res.months =
|
3603 |
+
other.month() - base.month() + (other.year() - base.year()) * 12;
|
3604 |
if (base.clone().add(res.months, 'M').isAfter(other)) {
|
3605 |
--res.months;
|
3606 |
}
|
3607 |
|
3608 |
+
res.milliseconds = +other - +base.clone().add(res.months, 'M');
|
3609 |
|
3610 |
return res;
|
3611 |
}
|
3613 |
function momentsDifference(base, other) {
|
3614 |
var res;
|
3615 |
if (!(base.isValid() && other.isValid())) {
|
3616 |
+
return { milliseconds: 0, months: 0 };
|
3617 |
}
|
3618 |
|
3619 |
other = cloneWithOffset(other, base);
|
3634 |
var dur, tmp;
|
3635 |
//invert the arguments, but complain about it
|
3636 |
if (period !== null && !isNaN(+period)) {
|
3637 |
+
deprecateSimple(
|
3638 |
+
name,
|
3639 |
+
'moment().' +
|
3640 |
+
name +
|
3641 |
+
'(period, number) is deprecated. Please use moment().' +
|
3642 |
+
name +
|
3643 |
+
'(number, period). ' +
|
3644 |
+
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
|
3645 |
+
);
|
3646 |
+
tmp = val;
|
3647 |
+
val = period;
|
3648 |
+
period = tmp;
|
3649 |
}
|
3650 |
|
|
|
3651 |
dur = createDuration(val, period);
|
3652 |
addSubtract(this, dur, direction);
|
3653 |
return this;
|
3654 |
};
|
3655 |
}
|
3656 |
|
3657 |
+
function addSubtract(mom, duration, isAdding, updateOffset) {
|
3658 |
var milliseconds = duration._milliseconds,
|
3659 |
days = absRound(duration._days),
|
3660 |
months = absRound(duration._months);
|
3680 |
}
|
3681 |
}
|
3682 |
|
3683 |
+
var add = createAdder(1, 'add'),
|
3684 |
+
subtract = createAdder(-1, 'subtract');
|
3685 |
|
3686 |
+
function isString(input) {
|
3687 |
+
return typeof input === 'string' || input instanceof String;
|
3688 |
+
}
|
3689 |
+
|
3690 |
+
// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
|
3691 |
+
function isMomentInput(input) {
|
3692 |
+
return (
|
3693 |
+
isMoment(input) ||
|
3694 |
+
isDate(input) ||
|
3695 |
+
isString(input) ||
|
3696 |
+
isNumber(input) ||
|
3697 |
+
isNumberOrStringArray(input) ||
|
3698 |
+
isMomentInputObject(input) ||
|
3699 |
+
input === null ||
|
3700 |
+
input === undefined
|
3701 |
+
);
|
3702 |
+
}
|
3703 |
+
|
3704 |
+
function isMomentInputObject(input) {
|
3705 |
+
var objectTest = isObject(input) && !isObjectEmpty(input),
|
3706 |
+
propertyTest = false,
|
3707 |
+
properties = [
|
3708 |
+
'years',
|
3709 |
+
'year',
|
3710 |
+
'y',
|
3711 |
+
'months',
|
3712 |
+
'month',
|
3713 |
+
'M',
|
3714 |
+
'days',
|
3715 |
+
'day',
|
3716 |
+
'd',
|
3717 |
+
'dates',
|
3718 |
+
'date',
|
3719 |
+
'D',
|
3720 |
+
'hours',
|
3721 |
+
'hour',
|
3722 |
+
'h',
|
3723 |
+
'minutes',
|
3724 |
+
'minute',
|
3725 |
+
'm',
|
3726 |
+
'seconds',
|
3727 |
+
'second',
|
3728 |
+
's',
|
3729 |
+
'milliseconds',
|
3730 |
+
'millisecond',
|
3731 |
+
'ms',
|
3732 |
+
],
|
3733 |
+
i,
|
3734 |
+
property;
|
3735 |
+
|
3736 |
+
for (i = 0; i < properties.length; i += 1) {
|
3737 |
+
property = properties[i];
|
3738 |
+
propertyTest = propertyTest || hasOwnProp(input, property);
|
3739 |
+
}
|
3740 |
+
|
3741 |
+
return objectTest && propertyTest;
|
3742 |
}
|
3743 |
|
3744 |
+
function isNumberOrStringArray(input) {
|
3745 |
+
var arrayTest = isArray(input),
|
3746 |
+
dataTypeTest = false;
|
3747 |
+
if (arrayTest) {
|
3748 |
+
dataTypeTest =
|
3749 |
+
input.filter(function (item) {
|
3750 |
+
return !isNumber(item) && isString(input);
|
3751 |
+
}).length === 0;
|
3752 |
+
}
|
3753 |
+
return arrayTest && dataTypeTest;
|
3754 |
+
}
|
3755 |
+
|
3756 |
+
function isCalendarSpec(input) {
|
3757 |
+
var objectTest = isObject(input) && !isObjectEmpty(input),
|
3758 |
+
propertyTest = false,
|
3759 |
+
properties = [
|
3760 |
+
'sameDay',
|
3761 |
+
'nextDay',
|
3762 |
+
'lastDay',
|
3763 |
+
'nextWeek',
|
3764 |
+
'lastWeek',
|
3765 |
+
'sameElse',
|
3766 |
+
],
|
3767 |
+
i,
|
3768 |
+
property;
|
3769 |
+
|
3770 |
+
for (i = 0; i < properties.length; i += 1) {
|
3771 |
+
property = properties[i];
|
3772 |
+
propertyTest = propertyTest || hasOwnProp(input, property);
|
3773 |
+
}
|
3774 |
+
|
3775 |
+
return objectTest && propertyTest;
|
3776 |
+
}
|
3777 |
+
|
3778 |
+
function getCalendarFormat(myMoment, now) {
|
3779 |
+
var diff = myMoment.diff(now, 'days', true);
|
3780 |
+
return diff < -6
|
3781 |
+
? 'sameElse'
|
3782 |
+
: diff < -1
|
3783 |
+
? 'lastWeek'
|
3784 |
+
: diff < 0
|
3785 |
+
? 'lastDay'
|
3786 |
+
: diff < 1
|
3787 |
+
? 'sameDay'
|
3788 |
+
: diff < 2
|
3789 |
+
? 'nextDay'
|
3790 |
+
: diff < 7
|
3791 |
+
? 'nextWeek'
|
3792 |
+
: 'sameElse';
|
3793 |
+
}
|
3794 |
+
|
3795 |
+
function calendar$1(time, formats) {
|
3796 |
+
// Support for single parameter, formats only overload to the calendar function
|
3797 |
+
if (arguments.length === 1) {
|
3798 |
+
if (isMomentInput(arguments[0])) {
|
3799 |
+
time = arguments[0];
|
3800 |
+
formats = undefined;
|
3801 |
+
} else if (isCalendarSpec(arguments[0])) {
|
3802 |
+
formats = arguments[0];
|
3803 |
+
time = undefined;
|
3804 |
+
}
|
3805 |
+
}
|
3806 |
// We want to compare the start of today, vs this.
|
3807 |
// Getting start-of-today depends on whether we're local/utc/offset or not.
|
3808 |
var now = time || createLocal(),
|
3809 |
sod = cloneWithOffset(now, this).startOf('day'),
|
3810 |
+
format = hooks.calendarFormat(this, sod) || 'sameElse',
|
3811 |
+
output =
|
3812 |
+
formats &&
|
3813 |
+
(isFunction(formats[format])
|
3814 |
+
? formats[format].call(this, now)
|
3815 |
+
: formats[format]);
|
3816 |
+
|
3817 |
+
return this.format(
|
3818 |
+
output || this.localeData().calendar(format, this, createLocal(now))
|
3819 |
+
);
|
3820 |
}
|
3821 |
|
3822 |
+
function clone() {
|
3823 |
return new Moment(this);
|
3824 |
}
|
3825 |
|
3826 |
+
function isAfter(input, units) {
|
3827 |
var localInput = isMoment(input) ? input : createLocal(input);
|
3828 |
if (!(this.isValid() && localInput.isValid())) {
|
3829 |
return false;
|
3836 |
}
|
3837 |
}
|
3838 |
|
3839 |
+
function isBefore(input, units) {
|
3840 |
var localInput = isMoment(input) ? input : createLocal(input);
|
3841 |
if (!(this.isValid() && localInput.isValid())) {
|
3842 |
return false;
|
3849 |
}
|
3850 |
}
|
3851 |
|
3852 |
+
function isBetween(from, to, units, inclusivity) {
|
3853 |
var localFrom = isMoment(from) ? from : createLocal(from),
|
3854 |
localTo = isMoment(to) ? to : createLocal(to);
|
3855 |
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
3856 |
return false;
|
3857 |
}
|
3858 |
inclusivity = inclusivity || '()';
|
3859 |
+
return (
|
3860 |
+
(inclusivity[0] === '('
|
3861 |
+
? this.isAfter(localFrom, units)
|
3862 |
+
: !this.isBefore(localFrom, units)) &&
|
3863 |
+
(inclusivity[1] === ')'
|
3864 |
+
? this.isBefore(localTo, units)
|
3865 |
+
: !this.isAfter(localTo, units))
|
3866 |
+
);
|
3867 |
}
|
3868 |
|
3869 |
+
function isSame(input, units) {
|
3870 |
var localInput = isMoment(input) ? input : createLocal(input),
|
3871 |
inputMs;
|
3872 |
if (!(this.isValid() && localInput.isValid())) {
|
3877 |
return this.valueOf() === localInput.valueOf();
|
3878 |
} else {
|
3879 |
inputMs = localInput.valueOf();
|
3880 |
+
return (
|
3881 |
+
this.clone().startOf(units).valueOf() <= inputMs &&
|
3882 |
+
inputMs <= this.clone().endOf(units).valueOf()
|
3883 |
+
);
|
3884 |
}
|
3885 |
}
|
3886 |
|
3887 |
+
function isSameOrAfter(input, units) {
|
3888 |
return this.isSame(input, units) || this.isAfter(input, units);
|
3889 |
}
|
3890 |
|
3891 |
+
function isSameOrBefore(input, units) {
|
3892 |
return this.isSame(input, units) || this.isBefore(input, units);
|
3893 |
}
|
3894 |
|
3895 |
+
function diff(input, units, asFloat) {
|
3896 |
+
var that, zoneDelta, output;
|
|
|
|
|
3897 |
|
3898 |
if (!this.isValid()) {
|
3899 |
return NaN;
|
3910 |
units = normalizeUnits(units);
|
3911 |
|
3912 |
switch (units) {
|
3913 |
+
case 'year':
|
3914 |
+
output = monthDiff(this, that) / 12;
|
3915 |
+
break;
|
3916 |
+
case 'month':
|
3917 |
+
output = monthDiff(this, that);
|
3918 |
+
break;
|
3919 |
+
case 'quarter':
|
3920 |
+
output = monthDiff(this, that) / 3;
|
3921 |
+
break;
|
3922 |
+
case 'second':
|
3923 |
+
output = (this - that) / 1e3;
|
3924 |
+
break; // 1000
|
3925 |
+
case 'minute':
|
3926 |
+
output = (this - that) / 6e4;
|
3927 |
+
break; // 1000 * 60
|
3928 |
+
case 'hour':
|
3929 |
+
output = (this - that) / 36e5;
|
3930 |
+
break; // 1000 * 60 * 60
|
3931 |
+
case 'day':
|
3932 |
+
output = (this - that - zoneDelta) / 864e5;
|
3933 |
+
break; // 1000 * 60 * 60 * 24, negate dst
|
3934 |
+
case 'week':
|
3935 |
+
output = (this - that - zoneDelta) / 6048e5;
|
3936 |
+
break; // 1000 * 60 * 60 * 24 * 7, negate dst
|
3937 |
+
default:
|
3938 |
+
output = this - that;
|
3939 |
}
|
3940 |
|
3941 |
return asFloat ? output : absFloor(output);
|
3942 |
}
|
3943 |
|
3944 |
+
function monthDiff(a, b) {
|
3945 |
+
if (a.date() < b.date()) {
|
3946 |
+
// end-of-month calculations work correct when the start month has more
|
3947 |
+
// days than the end month.
|
3948 |
+
return -monthDiff(b, a);
|
3949 |
+
}
|
3950 |
// difference in months
|
3951 |
+
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
|
3952 |
// b is in (anchor - 1 month, anchor + 1 month)
|
3953 |
anchor = a.clone().add(wholeMonthDiff, 'months'),
|
3954 |
+
anchor2,
|
3955 |
+
adjust;
|
3956 |
|
3957 |
if (b - anchor < 0) {
|
3958 |
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
|
3971 |
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
3972 |
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
|
3973 |
|
3974 |
+
function toString() {
|
3975 |
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
|
3976 |
}
|
3977 |
|
3979 |
if (!this.isValid()) {
|
3980 |
return null;
|
3981 |
}
|
3982 |
+
var utc = keepOffset !== true,
|
3983 |
+
m = utc ? this.clone().utc() : this;
|
3984 |
if (m.year() < 0 || m.year() > 9999) {
|
3985 |
+
return formatMoment(
|
3986 |
+
m,
|
3987 |
+
utc
|
3988 |
+
? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
|
3989 |
+
: 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
|
3990 |
+
);
|
3991 |
}
|
3992 |
if (isFunction(Date.prototype.toISOString)) {
|
3993 |
// native implementation is ~50x faster, use it when we can
|
3994 |
if (utc) {
|
3995 |
return this.toDate().toISOString();
|
3996 |
} else {
|
3997 |
+
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
|
3998 |
+
.toISOString()
|
3999 |
+
.replace('Z', formatMoment(m, 'Z'));
|
4000 |
}
|
4001 |
}
|
4002 |
+
return formatMoment(
|
4003 |
+
m,
|
4004 |
+
utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
|
4005 |
+
);
|
4006 |
}
|
4007 |
|
4008 |
/**
|
4011 |
*
|
4012 |
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
|
4013 |
*/
|
4014 |
+
function inspect() {
|
4015 |
if (!this.isValid()) {
|
4016 |
return 'moment.invalid(/* ' + this._i + ' */)';
|
4017 |
}
|
4018 |
+
var func = 'moment',
|
4019 |
+
zone = '',
|
4020 |
+
prefix,
|
4021 |
+
year,
|
4022 |
+
datetime,
|
4023 |
+
suffix;
|
4024 |
if (!this.isLocal()) {
|
4025 |
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
|
4026 |
zone = 'Z';
|
4027 |
}
|
4028 |
+
prefix = '[' + func + '("]';
|
4029 |
+
year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
|
4030 |
+
datetime = '-MM-DD[T]HH:mm:ss.SSS';
|
4031 |
+
suffix = zone + '[")]';
|
4032 |
|
4033 |
return this.format(prefix + year + datetime + suffix);
|
4034 |
}
|
4035 |
|
4036 |
+
function format(inputString) {
|
4037 |
if (!inputString) {
|
4038 |
+
inputString = this.isUtc()
|
4039 |
+
? hooks.defaultFormatUtc
|
4040 |
+
: hooks.defaultFormat;
|
4041 |
}
|
4042 |
var output = formatMoment(this, inputString);
|
4043 |
return this.localeData().postformat(output);
|
4044 |
}
|
4045 |
|
4046 |
+
function from(time, withoutSuffix) {
|
4047 |
+
if (
|
4048 |
+
this.isValid() &&
|
4049 |
+
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
|
4050 |
+
) {
|
4051 |
+
return createDuration({ to: this, from: time })
|
4052 |
+
.locale(this.locale())
|
4053 |
+
.humanize(!withoutSuffix);
|
4054 |
} else {
|
4055 |
return this.localeData().invalidDate();
|
4056 |
}
|
4057 |
}
|
4058 |
|
4059 |
+
function fromNow(withoutSuffix) {
|
4060 |
return this.from(createLocal(), withoutSuffix);
|
4061 |
}
|
4062 |
|
4063 |
+
function to(time, withoutSuffix) {
|
4064 |
+
if (
|
4065 |
+
this.isValid() &&
|
4066 |
+
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
|
4067 |
+
) {
|
4068 |
+
return createDuration({ from: this, to: time })
|
4069 |
+
.locale(this.locale())
|
4070 |
+
.humanize(!withoutSuffix);
|
4071 |
} else {
|
4072 |
return this.localeData().invalidDate();
|
4073 |
}
|
4074 |
}
|
4075 |
|
4076 |
+
function toNow(withoutSuffix) {
|
4077 |
return this.to(createLocal(), withoutSuffix);
|
4078 |
}
|
4079 |
|
4080 |
// If passed a locale key, it will set the locale for this
|
4081 |
// instance. Otherwise, it will return the locale configuration
|
4082 |
// variables for this instance.
|
4083 |
+
function locale(key) {
|
4084 |
var newLocaleData;
|
4085 |
|
4086 |
if (key === undefined) {
|
4105 |
}
|
4106 |
);
|
4107 |
|
4108 |
+
function localeData() {
|
4109 |
return this._locale;
|
4110 |
}
|
4111 |
|
4112 |
+
var MS_PER_SECOND = 1000,
|
4113 |
+
MS_PER_MINUTE = 60 * MS_PER_SECOND,
|
4114 |
+
MS_PER_HOUR = 60 * MS_PER_MINUTE,
|
4115 |
+
MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
4116 |
+
|
4117 |
+
// actual modulo - handles negative numbers (for dates before 1970):
|
4118 |
+
function mod$1(dividend, divisor) {
|
4119 |
+
return ((dividend % divisor) + divisor) % divisor;
|
4120 |
+
}
|
4121 |
+
|
4122 |
+
function localStartOfDate(y, m, d) {
|
4123 |
+
// the date constructor remaps years 0-99 to 1900-1999
|
4124 |
+
if (y < 100 && y >= 0) {
|
4125 |
+
// preserve leap years using a full 400 year cycle, then reset
|
4126 |
+
return new Date(y + 400, m, d) - MS_PER_400_YEARS;
|
4127 |
+
} else {
|
4128 |
+
return new Date(y, m, d).valueOf();
|
4129 |
+
}
|
4130 |
+
}
|
4131 |
+
|
4132 |
+
function utcStartOfDate(y, m, d) {
|
4133 |
+
// Date.UTC remaps years 0-99 to 1900-1999
|
4134 |
+
if (y < 100 && y >= 0) {
|
4135 |
+
// preserve leap years using a full 400 year cycle, then reset
|
4136 |
+
return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
|
4137 |
+
} else {
|
4138 |
+
return Date.UTC(y, m, d);
|
4139 |
+
}
|
4140 |
+
}
|
4141 |
+
|
4142 |
+
function startOf(units) {
|
4143 |
+
var time, startOfDate;
|
4144 |
units = normalizeUnits(units);
|
4145 |
+
if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
4146 |
+
return this;
|
4147 |
+
}
|
4148 |
+
|
4149 |
+
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
4150 |
+
|
4151 |
switch (units) {
|
4152 |
case 'year':
|
4153 |
+
time = startOfDate(this.year(), 0, 1);
|
4154 |
+
break;
|
4155 |
case 'quarter':
|
4156 |
+
time = startOfDate(
|
4157 |
+
this.year(),
|
4158 |
+
this.month() - (this.month() % 3),
|
4159 |
+
1
|
4160 |
+
);
|
4161 |
+
break;
|
4162 |
case 'month':
|
4163 |
+
time = startOfDate(this.year(), this.month(), 1);
|
4164 |
+
break;
|
4165 |
case 'week':
|
4166 |
+
time = startOfDate(
|
4167 |
+
this.year(),
|
4168 |
+
this.month(),
|
4169 |
+
this.date() - this.weekday()
|
4170 |
+
);
|
4171 |
+
break;
|
4172 |
case 'isoWeek':
|
4173 |
+
time = startOfDate(
|
4174 |
+
this.year(),
|
4175 |
+
this.month(),
|
4176 |
+
this.date() - (this.isoWeekday() - 1)
|
4177 |
+
);
|
4178 |
+
break;
|
4179 |
case 'day':
|
4180 |
case 'date':
|
4181 |
+
time = startOfDate(this.year(), this.month(), this.date());
|
4182 |
+
break;
|
4183 |
case 'hour':
|
4184 |
+
time = this._d.valueOf();
|
4185 |
+
time -= mod$1(
|
4186 |
+
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
4187 |
+
MS_PER_HOUR
|
4188 |
+
);
|
4189 |
+
break;
|
4190 |
case 'minute':
|
4191 |
+
time = this._d.valueOf();
|
4192 |
+
time -= mod$1(time, MS_PER_MINUTE);
|
4193 |
+
break;
|
4194 |
case 'second':
|
4195 |
+
time = this._d.valueOf();
|
4196 |
+
time -= mod$1(time, MS_PER_SECOND);
|
4197 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4198 |
}
|
4199 |
|
4200 |
+
this._d.setTime(time);
|
4201 |
+
hooks.updateOffset(this, true);
|
4202 |
return this;
|
4203 |
}
|
4204 |
|
4205 |
+
function endOf(units) {
|
4206 |
+
var time, startOfDate;
|
4207 |
units = normalizeUnits(units);
|
4208 |
+
if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
4209 |
return this;
|
4210 |
}
|
4211 |
|
4212 |
+
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
4213 |
+
|
4214 |
+
switch (units) {
|
4215 |
+
case 'year':
|
4216 |
+
time = startOfDate(this.year() + 1, 0, 1) - 1;
|
4217 |
+
break;
|
4218 |
+
case 'quarter':
|
4219 |
+
time =
|
4220 |
+
startOfDate(
|
4221 |
+
this.year(),
|
4222 |
+
this.month() - (this.month() % 3) + 3,
|
4223 |
+
1
|
4224 |
+
) - 1;
|
4225 |
+
break;
|
4226 |
+
case 'month':
|
4227 |
+
time = startOfDate(this.year(), this.month() + 1, 1) - 1;
|
4228 |
+
break;
|
4229 |
+
case 'week':
|
4230 |
+
time =
|
4231 |
+
startOfDate(
|
4232 |
+
this.year(),
|
4233 |
+
this.month(),
|
4234 |
+
this.date() - this.weekday() + 7
|
4235 |
+
) - 1;
|
4236 |
+
break;
|
4237 |
+
case 'isoWeek':
|
4238 |
+
time =
|
4239 |
+
startOfDate(
|
4240 |
+
this.year(),
|
4241 |
+
this.month(),
|
4242 |
+
this.date() - (this.isoWeekday() - 1) + 7
|
4243 |
+
) - 1;
|
4244 |
+
break;
|
4245 |
+
case 'day':
|
4246 |
+
case 'date':
|
4247 |
+
time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
|
4248 |
+
break;
|
4249 |
+
case 'hour':
|
4250 |
+
time = this._d.valueOf();
|
4251 |
+
time +=
|
4252 |
+
MS_PER_HOUR -
|
4253 |
+
mod$1(
|
4254 |
+
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
4255 |
+
MS_PER_HOUR
|
4256 |
+
) -
|
4257 |
+
1;
|
4258 |
+
break;
|
4259 |
+
case 'minute':
|
4260 |
+
time = this._d.valueOf();
|
4261 |
+
time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
|
4262 |
+
break;
|
4263 |
+
case 'second':
|
4264 |
+
time = this._d.valueOf();
|
4265 |
+
time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
|
4266 |
+
break;
|
4267 |
}
|
4268 |
|
4269 |
+
this._d.setTime(time);
|
4270 |
+
hooks.updateOffset(this, true);
|
4271 |
+
return this;
|
4272 |
}
|
4273 |
|
4274 |
+
function valueOf() {
|
4275 |
+
return this._d.valueOf() - (this._offset || 0) * 60000;
|
4276 |
}
|
4277 |
|
4278 |
+
function unix() {
|
4279 |
return Math.floor(this.valueOf() / 1000);
|
4280 |
}
|
4281 |
|
4282 |
+
function toDate() {
|
4283 |
return new Date(this.valueOf());
|
4284 |
}
|
4285 |
|
4286 |
+
function toArray() {
|
4287 |
var m = this;
|
4288 |
+
return [
|
4289 |
+
m.year(),
|
4290 |
+
m.month(),
|
4291 |
+
m.date(),
|
4292 |
+
m.hour(),
|
4293 |
+
m.minute(),
|
4294 |
+
m.second(),
|
4295 |
+
m.millisecond(),
|
4296 |
+
];
|
4297 |
}
|
4298 |
|
4299 |
+
function toObject() {
|
4300 |
var m = this;
|
4301 |
return {
|
4302 |
years: m.year(),
|
4305 |
hours: m.hours(),
|
4306 |
minutes: m.minutes(),
|
4307 |
seconds: m.seconds(),
|
4308 |
+
milliseconds: m.milliseconds(),
|
4309 |
};
|
4310 |
}
|
4311 |
|
4312 |
+
function toJSON() {
|
4313 |
// new Date(NaN).toJSON() === null
|
4314 |
return this.isValid() ? this.toISOString() : null;
|
4315 |
}
|
4316 |
|
4317 |
+
function isValid$2() {
|
4318 |
return isValid(this);
|
4319 |
}
|
4320 |
|
4321 |
+
function parsingFlags() {
|
4322 |
return extend({}, getParsingFlags(this));
|
4323 |
}
|
4324 |
|
4325 |
+
function invalidAt() {
|
4326 |
return getParsingFlags(this).overflow;
|
4327 |
}
|
4328 |
|
4332 |
format: this._f,
|
4333 |
locale: this._locale,
|
4334 |
isUTC: this._isUTC,
|
4335 |
+
strict: this._strict,
|
4336 |
};
|
4337 |
}
|
4338 |
|
4339 |
+
addFormatToken('N', 0, 0, 'eraAbbr');
|
4340 |
+
addFormatToken('NN', 0, 0, 'eraAbbr');
|
4341 |
+
addFormatToken('NNN', 0, 0, 'eraAbbr');
|
4342 |
+
addFormatToken('NNNN', 0, 0, 'eraName');
|
4343 |
+
addFormatToken('NNNNN', 0, 0, 'eraNarrow');
|
4344 |
+
|
4345 |
+
addFormatToken('y', ['y', 1], 'yo', 'eraYear');
|
4346 |
+
addFormatToken('y', ['yy', 2], 0, 'eraYear');
|
4347 |
+
addFormatToken('y', ['yyy', 3], 0, 'eraYear');
|
4348 |
+
addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
|
4349 |
+
|
4350 |
+
addRegexToken('N', matchEraAbbr);
|
4351 |
+
addRegexToken('NN', matchEraAbbr);
|
4352 |
+
addRegexToken('NNN', matchEraAbbr);
|
4353 |
+
addRegexToken('NNNN', matchEraName);
|
4354 |
+
addRegexToken('NNNNN', matchEraNarrow);
|
4355 |
+
|
4356 |
+
addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
|
4357 |
+
input,
|
4358 |
+
array,
|
4359 |
+
config,
|
4360 |
+
token
|
4361 |
+
) {
|
4362 |
+
var era = config._locale.erasParse(input, token, config._strict);
|
4363 |
+
if (era) {
|
4364 |
+
getParsingFlags(config).era = era;
|
4365 |
+
} else {
|
4366 |
+
getParsingFlags(config).invalidEra = input;
|
4367 |
+
}
|
4368 |
+
});
|
4369 |
+
|
4370 |
+
addRegexToken('y', matchUnsigned);
|
4371 |
+
addRegexToken('yy', matchUnsigned);
|
4372 |
+
addRegexToken('yyy', matchUnsigned);
|
4373 |
+
addRegexToken('yyyy', matchUnsigned);
|
4374 |
+
addRegexToken('yo', matchEraYearOrdinal);
|
4375 |
+
|
4376 |
+
addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
|
4377 |
+
addParseToken(['yo'], function (input, array, config, token) {
|
4378 |
+
var match;
|
4379 |
+
if (config._locale._eraYearOrdinalRegex) {
|
4380 |
+
match = input.match(config._locale._eraYearOrdinalRegex);
|
4381 |
+
}
|
4382 |
+
|
4383 |
+
if (config._locale.eraYearOrdinalParse) {
|
4384 |
+
array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
|
4385 |
+
} else {
|
4386 |
+
array[YEAR] = parseInt(input, 10);
|
4387 |
+
}
|
4388 |
+
});
|
4389 |
+
|
4390 |
+
function localeEras(m, format) {
|
4391 |
+
var i,
|
4392 |
+
l,
|
4393 |
+
date,
|
4394 |
+
eras = this._eras || getLocale('en')._eras;
|
4395 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4396 |
+
switch (typeof eras[i].since) {
|
4397 |
+
case 'string':
|
4398 |
+
// truncate time
|
4399 |
+
date = hooks(eras[i].since).startOf('day');
|
4400 |
+
eras[i].since = date.valueOf();
|
4401 |
+
break;
|
4402 |
+
}
|
4403 |
+
|
4404 |
+
switch (typeof eras[i].until) {
|
4405 |
+
case 'undefined':
|
4406 |
+
eras[i].until = +Infinity;
|
4407 |
+
break;
|
4408 |
+
case 'string':
|
4409 |
+
// truncate time
|
4410 |
+
date = hooks(eras[i].until).startOf('day').valueOf();
|
4411 |
+
eras[i].until = date.valueOf();
|
4412 |
+
break;
|
4413 |
+
}
|
4414 |
+
}
|
4415 |
+
return eras;
|
4416 |
+
}
|
4417 |
+
|
4418 |
+
function localeErasParse(eraName, format, strict) {
|
4419 |
+
var i,
|
4420 |
+
l,
|
4421 |
+
eras = this.eras(),
|
4422 |
+
name,
|
4423 |
+
abbr,
|
4424 |
+
narrow;
|
4425 |
+
eraName = eraName.toUpperCase();
|
4426 |
+
|
4427 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4428 |
+
name = eras[i].name.toUpperCase();
|
4429 |
+
abbr = eras[i].abbr.toUpperCase();
|
4430 |
+
narrow = eras[i].narrow.toUpperCase();
|
4431 |
+
|
4432 |
+
if (strict) {
|
4433 |
+
switch (format) {
|
4434 |
+
case 'N':
|
4435 |
+
case 'NN':
|
4436 |
+
case 'NNN':
|
4437 |
+
if (abbr === eraName) {
|
4438 |
+
return eras[i];
|
4439 |
+
}
|
4440 |
+
break;
|
4441 |
+
|
4442 |
+
case 'NNNN':
|
4443 |
+
if (name === eraName) {
|
4444 |
+
return eras[i];
|
4445 |
+
}
|
4446 |
+
break;
|
4447 |
+
|
4448 |
+
case 'NNNNN':
|
4449 |
+
if (narrow === eraName) {
|
4450 |
+
return eras[i];
|
4451 |
+
}
|
4452 |
+
break;
|
4453 |
+
}
|
4454 |
+
} else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
|
4455 |
+
return eras[i];
|
4456 |
+
}
|
4457 |
+
}
|
4458 |
+
}
|
4459 |
+
|
4460 |
+
function localeErasConvertYear(era, year) {
|
4461 |
+
var dir = era.since <= era.until ? +1 : -1;
|
4462 |
+
if (year === undefined) {
|
4463 |
+
return hooks(era.since).year();
|
4464 |
+
} else {
|
4465 |
+
return hooks(era.since).year() + (year - era.offset) * dir;
|
4466 |
+
}
|
4467 |
+
}
|
4468 |
+
|
4469 |
+
function getEraName() {
|
4470 |
+
var i,
|
4471 |
+
l,
|
4472 |
+
val,
|
4473 |
+
eras = this.localeData().eras();
|
4474 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4475 |
+
// truncate time
|
4476 |
+
val = this.startOf('day').valueOf();
|
4477 |
+
|
4478 |
+
if (eras[i].since <= val && val <= eras[i].until) {
|
4479 |
+
return eras[i].name;
|
4480 |
+
}
|
4481 |
+
if (eras[i].until <= val && val <= eras[i].since) {
|
4482 |
+
return eras[i].name;
|
4483 |
+
}
|
4484 |
+
}
|
4485 |
+
|
4486 |
+
return '';
|
4487 |
+
}
|
4488 |
+
|
4489 |
+
function getEraNarrow() {
|
4490 |
+
var i,
|
4491 |
+
l,
|
4492 |
+
val,
|
4493 |
+
eras = this.localeData().eras();
|
4494 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4495 |
+
// truncate time
|
4496 |
+
val = this.startOf('day').valueOf();
|
4497 |
+
|
4498 |
+
if (eras[i].since <= val && val <= eras[i].until) {
|
4499 |
+
return eras[i].narrow;
|
4500 |
+
}
|
4501 |
+
if (eras[i].until <= val && val <= eras[i].since) {
|
4502 |
+
return eras[i].narrow;
|
4503 |
+
}
|
4504 |
+
}
|
4505 |
+
|
4506 |
+
return '';
|
4507 |
+
}
|
4508 |
+
|
4509 |
+
function getEraAbbr() {
|
4510 |
+
var i,
|
4511 |
+
l,
|
4512 |
+
val,
|
4513 |
+
eras = this.localeData().eras();
|
4514 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4515 |
+
// truncate time
|
4516 |
+
val = this.startOf('day').valueOf();
|
4517 |
+
|
4518 |
+
if (eras[i].since <= val && val <= eras[i].until) {
|
4519 |
+
return eras[i].abbr;
|
4520 |
+
}
|
4521 |
+
if (eras[i].until <= val && val <= eras[i].since) {
|
4522 |
+
return eras[i].abbr;
|
4523 |
+
}
|
4524 |
+
}
|
4525 |
+
|
4526 |
+
return '';
|
4527 |
+
}
|
4528 |
+
|
4529 |
+
function getEraYear() {
|
4530 |
+
var i,
|
4531 |
+
l,
|
4532 |
+
dir,
|
4533 |
+
val,
|
4534 |
+
eras = this.localeData().eras();
|
4535 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4536 |
+
dir = eras[i].since <= eras[i].until ? +1 : -1;
|
4537 |
+
|
4538 |
+
// truncate time
|
4539 |
+
val = this.startOf('day').valueOf();
|
4540 |
+
|
4541 |
+
if (
|
4542 |
+
(eras[i].since <= val && val <= eras[i].until) ||
|
4543 |
+
(eras[i].until <= val && val <= eras[i].since)
|
4544 |
+
) {
|
4545 |
+
return (
|
4546 |
+
(this.year() - hooks(eras[i].since).year()) * dir +
|
4547 |
+
eras[i].offset
|
4548 |
+
);
|
4549 |
+
}
|
4550 |
+
}
|
4551 |
+
|
4552 |
+
return this.year();
|
4553 |
+
}
|
4554 |
+
|
4555 |
+
function erasNameRegex(isStrict) {
|
4556 |
+
if (!hasOwnProp(this, '_erasNameRegex')) {
|
4557 |
+
computeErasParse.call(this);
|
4558 |
+
}
|
4559 |
+
return isStrict ? this._erasNameRegex : this._erasRegex;
|
4560 |
+
}
|
4561 |
+
|
4562 |
+
function erasAbbrRegex(isStrict) {
|
4563 |
+
if (!hasOwnProp(this, '_erasAbbrRegex')) {
|
4564 |
+
computeErasParse.call(this);
|
4565 |
+
}
|
4566 |
+
return isStrict ? this._erasAbbrRegex : this._erasRegex;
|
4567 |
+
}
|
4568 |
+
|
4569 |
+
function erasNarrowRegex(isStrict) {
|
4570 |
+
if (!hasOwnProp(this, '_erasNarrowRegex')) {
|
4571 |
+
computeErasParse.call(this);
|
4572 |
+
}
|
4573 |
+
return isStrict ? this._erasNarrowRegex : this._erasRegex;
|
4574 |
+
}
|
4575 |
+
|
4576 |
+
function matchEraAbbr(isStrict, locale) {
|
4577 |
+
return locale.erasAbbrRegex(isStrict);
|
4578 |
+
}
|
4579 |
+
|
4580 |
+
function matchEraName(isStrict, locale) {
|
4581 |
+
return locale.erasNameRegex(isStrict);
|
4582 |
+
}
|
4583 |
+
|
4584 |
+
function matchEraNarrow(isStrict, locale) {
|
4585 |
+
return locale.erasNarrowRegex(isStrict);
|
4586 |
+
}
|
4587 |
+
|
4588 |
+
function matchEraYearOrdinal(isStrict, locale) {
|
4589 |
+
return locale._eraYearOrdinalRegex || matchUnsigned;
|
4590 |
+
}
|
4591 |
+
|
4592 |
+
function computeErasParse() {
|
4593 |
+
var abbrPieces = [],
|
4594 |
+
namePieces = [],
|
4595 |
+
narrowPieces = [],
|
4596 |
+
mixedPieces = [],
|
4597 |
+
i,
|
4598 |
+
l,
|
4599 |
+
eras = this.eras();
|
4600 |
+
|
4601 |
+
for (i = 0, l = eras.length; i < l; ++i) {
|
4602 |
+
namePieces.push(regexEscape(eras[i].name));
|
4603 |
+
abbrPieces.push(regexEscape(eras[i].abbr));
|
4604 |
+
narrowPieces.push(regexEscape(eras[i].narrow));
|
4605 |
+
|
4606 |
+
mixedPieces.push(regexEscape(eras[i].name));
|
4607 |
+
mixedPieces.push(regexEscape(eras[i].abbr));
|
4608 |
+
mixedPieces.push(regexEscape(eras[i].narrow));
|
4609 |
+
}
|
4610 |
+
|
4611 |
+
this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
4612 |
+
this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
|
4613 |
+
this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
|
4614 |
+
this._erasNarrowRegex = new RegExp(
|
4615 |
+
'^(' + narrowPieces.join('|') + ')',
|
4616 |
+
'i'
|
4617 |
+
);
|
4618 |
+
}
|
4619 |
+
|
4620 |
// FORMATTING
|
4621 |
|
4622 |
addFormatToken(0, ['gg', 2], 0, function () {
|
4627 |
return this.isoWeekYear() % 100;
|
4628 |
});
|
4629 |
|
4630 |
+
function addWeekYearFormatToken(token, getter) {
|
4631 |
addFormatToken(0, [token, token.length], 0, getter);
|
4632 |
}
|
4633 |
|
4634 |
+
addWeekYearFormatToken('gggg', 'weekYear');
|
4635 |
+
addWeekYearFormatToken('ggggg', 'weekYear');
|
4636 |
+
addWeekYearFormatToken('GGGG', 'isoWeekYear');
|
4637 |
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
|
4638 |
|
4639 |
// ALIASES
|
4646 |
addUnitPriority('weekYear', 1);
|
4647 |
addUnitPriority('isoWeekYear', 1);
|
4648 |
|
|
|
4649 |
// PARSING
|
4650 |
|
4651 |
+
addRegexToken('G', matchSigned);
|
4652 |
+
addRegexToken('g', matchSigned);
|
4653 |
+
addRegexToken('GG', match1to2, match2);
|
4654 |
+
addRegexToken('gg', match1to2, match2);
|
4655 |
+
addRegexToken('GGGG', match1to4, match4);
|
4656 |
+
addRegexToken('gggg', match1to4, match4);
|
4657 |
+
addRegexToken('GGGGG', match1to6, match6);
|
4658 |
+
addRegexToken('ggggg', match1to6, match6);
|
4659 |
+
|
4660 |
+
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
|
4661 |
+
input,
|
4662 |
+
week,
|
4663 |
+
config,
|
4664 |
+
token
|
4665 |
+
) {
|
4666 |
week[token.substr(0, 2)] = toInt(input);
|
4667 |
});
|
4668 |
|
4672 |
|
4673 |
// MOMENTS
|
4674 |
|
4675 |
+
function getSetWeekYear(input) {
|
4676 |
+
return getSetWeekYearHelper.call(
|
4677 |
+
this,
|
4678 |
+
input,
|
4679 |
+
this.week(),
|
4680 |
+
this.weekday(),
|
4681 |
+
this.localeData()._week.dow,
|
4682 |
+
this.localeData()._week.doy
|
4683 |
+
);
|
4684 |
}
|
4685 |
|
4686 |
+
function getSetISOWeekYear(input) {
|
4687 |
+
return getSetWeekYearHelper.call(
|
4688 |
+
this,
|
4689 |
+
input,
|
4690 |
+
this.isoWeek(),
|
4691 |
+
this.isoWeekday(),
|
4692 |
+
1,
|
4693 |
+
4
|
4694 |
+
);
|
4695 |
}
|
4696 |
|
4697 |
+
function getISOWeeksInYear() {
|
4698 |
return weeksInYear(this.year(), 1, 4);
|
4699 |
}
|
4700 |
|
4701 |
+
function getISOWeeksInISOWeekYear() {
|
4702 |
+
return weeksInYear(this.isoWeekYear(), 1, 4);
|
4703 |
+
}
|
4704 |
+
|
4705 |
+
function getWeeksInYear() {
|
4706 |
var weekInfo = this.localeData()._week;
|
4707 |
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
4708 |
}
|
4709 |
|
4710 |
+
function getWeeksInWeekYear() {
|
4711 |
+
var weekInfo = this.localeData()._week;
|
4712 |
+
return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
|
4713 |
+
}
|
4714 |
+
|
4715 |
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
4716 |
var weeksTarget;
|
4717 |
if (input == null) {
|
4756 |
|
4757 |
// MOMENTS
|
4758 |
|
4759 |
+
function getSetQuarter(input) {
|
4760 |
+
return input == null
|
4761 |
+
? Math.ceil((this.month() + 1) / 3)
|
4762 |
+
: this.month((input - 1) * 3 + (this.month() % 3));
|
4763 |
}
|
4764 |
|
4765 |
// FORMATTING
|
4775 |
|
4776 |
// PARSING
|
4777 |
|
4778 |
+
addRegexToken('D', match1to2);
|
4779 |
addRegexToken('DD', match1to2, match2);
|
4780 |
addRegexToken('Do', function (isStrict, locale) {
|
4781 |
// TODO: Remove "ordinalParse" fallback in next major release.
|
4782 |
+
return isStrict
|
4783 |
+
? locale._dayOfMonthOrdinalParse || locale._ordinalParse
|
4784 |
+
: locale._dayOfMonthOrdinalParseLenient;
|
4785 |
});
|
4786 |
|
4787 |
addParseToken(['D', 'DD'], DATE);
|
4806 |
|
4807 |
// PARSING
|
4808 |
|
4809 |
+
addRegexToken('DDD', match1to3);
|
4810 |
addRegexToken('DDDD', match3);
|
4811 |
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
|
4812 |
config._dayOfYear = toInt(input);
|
4816 |
|
4817 |
// MOMENTS
|
4818 |
|
4819 |
+
function getSetDayOfYear(input) {
|
4820 |
+
var dayOfYear =
|
4821 |
+
Math.round(
|
4822 |
+
(this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
|
4823 |
+
) + 1;
|
4824 |
+
return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
|
4825 |
}
|
4826 |
|
4827 |
// FORMATTING
|
4838 |
|
4839 |
// PARSING
|
4840 |
|
4841 |
+
addRegexToken('m', match1to2);
|
4842 |
addRegexToken('mm', match1to2, match2);
|
4843 |
addParseToken(['m', 'mm'], MINUTE);
|
4844 |
|
4860 |
|
4861 |
// PARSING
|
4862 |
|
4863 |
+
addRegexToken('s', match1to2);
|
4864 |
addRegexToken('ss', match1to2, match2);
|
4865 |
addParseToken(['s', 'ss'], SECOND);
|
4866 |
|
4898 |
return this.millisecond() * 1000000;
|
4899 |
});
|
4900 |
|
|
|
4901 |
// ALIASES
|
4902 |
|
4903 |
addUnitAlias('millisecond', 'ms');
|
4908 |
|
4909 |
// PARSING
|
4910 |
|
4911 |
+
addRegexToken('S', match1to3, match1);
|
4912 |
+
addRegexToken('SS', match1to3, match2);
|
4913 |
+
addRegexToken('SSS', match1to3, match3);
|
4914 |
|
4915 |
+
var token, getSetMillisecond;
|
4916 |
for (token = 'SSSS'; token.length <= 9; token += 'S') {
|
4917 |
addRegexToken(token, matchUnsigned);
|
4918 |
}
|
4924 |
for (token = 'S'; token.length <= 9; token += 'S') {
|
4925 |
addParseToken(token, parseMs);
|
4926 |
}
|
|
|
4927 |
|
4928 |
+
getSetMillisecond = makeGetSet('Milliseconds', false);
|
4929 |
|
4930 |
// FORMATTING
|
4931 |
|
4932 |
+
addFormatToken('z', 0, 0, 'zoneAbbr');
|
4933 |
addFormatToken('zz', 0, 0, 'zoneName');
|
4934 |
|
4935 |
// MOMENTS
|
4936 |
|
4937 |
+
function getZoneAbbr() {
|
4938 |
return this._isUTC ? 'UTC' : '';
|
4939 |
}
|
4940 |
|
4941 |
+
function getZoneName() {
|
4942 |
return this._isUTC ? 'Coordinated Universal Time' : '';
|
4943 |
}
|
4944 |
|
4945 |
var proto = Moment.prototype;
|
4946 |
|
4947 |
+
proto.add = add;
|
4948 |
+
proto.calendar = calendar$1;
|
4949 |
+
proto.clone = clone;
|
4950 |
+
proto.diff = diff;
|
4951 |
+
proto.endOf = endOf;
|
4952 |
+
proto.format = format;
|
4953 |
+
proto.from = from;
|
4954 |
+
proto.fromNow = fromNow;
|
4955 |
+
proto.to = to;
|
4956 |
+
proto.toNow = toNow;
|
4957 |
+
proto.get = stringGet;
|
4958 |
+
proto.invalidAt = invalidAt;
|
4959 |
+
proto.isAfter = isAfter;
|
4960 |
+
proto.isBefore = isBefore;
|
4961 |
+
proto.isBetween = isBetween;
|
4962 |
+
proto.isSame = isSame;
|
4963 |
+
proto.isSameOrAfter = isSameOrAfter;
|
4964 |
+
proto.isSameOrBefore = isSameOrBefore;
|
4965 |
+
proto.isValid = isValid$2;
|
4966 |
+
proto.lang = lang;
|
4967 |
+
proto.locale = locale;
|
4968 |
+
proto.localeData = localeData;
|
4969 |
+
proto.max = prototypeMax;
|
4970 |
+
proto.min = prototypeMin;
|
4971 |
+
proto.parsingFlags = parsingFlags;
|
4972 |
+
proto.set = stringSet;
|
4973 |
+
proto.startOf = startOf;
|
4974 |
+
proto.subtract = subtract;
|
4975 |
+
proto.toArray = toArray;
|
4976 |
+
proto.toObject = toObject;
|
4977 |
+
proto.toDate = toDate;
|
4978 |
+
proto.toISOString = toISOString;
|
4979 |
+
proto.inspect = inspect;
|
4980 |
+
if (typeof Symbol !== 'undefined' && Symbol.for != null) {
|
4981 |
+
proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
|
4982 |
+
return 'Moment<' + this.format() + '>';
|
4983 |
+
};
|
4984 |
+
}
|
4985 |
+
proto.toJSON = toJSON;
|
4986 |
+
proto.toString = toString;
|
4987 |
+
proto.unix = unix;
|
4988 |
+
proto.valueOf = valueOf;
|
4989 |
+
proto.creationData = creationData;
|
4990 |
+
proto.eraName = getEraName;
|
4991 |
+
proto.eraNarrow = getEraNarrow;
|
4992 |
+
proto.eraAbbr = getEraAbbr;
|
4993 |
+
proto.eraYear = getEraYear;
|
4994 |
+
proto.year = getSetYear;
|
4995 |
proto.isLeapYear = getIsLeapYear;
|
4996 |
+
proto.weekYear = getSetWeekYear;
|
4997 |
proto.isoWeekYear = getSetISOWeekYear;
|
4998 |
proto.quarter = proto.quarters = getSetQuarter;
|
4999 |
+
proto.month = getSetMonth;
|
5000 |
proto.daysInMonth = getDaysInMonth;
|
5001 |
+
proto.week = proto.weeks = getSetWeek;
|
5002 |
+
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
5003 |
+
proto.weeksInYear = getWeeksInYear;
|
5004 |
+
proto.weeksInWeekYear = getWeeksInWeekYear;
|
5005 |
proto.isoWeeksInYear = getISOWeeksInYear;
|
5006 |
+
proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
|
5007 |
+
proto.date = getSetDayOfMonth;
|
5008 |
+
proto.day = proto.days = getSetDayOfWeek;
|
5009 |
+
proto.weekday = getSetLocaleDayOfWeek;
|
5010 |
proto.isoWeekday = getSetISODayOfWeek;
|
5011 |
+
proto.dayOfYear = getSetDayOfYear;
|
5012 |
proto.hour = proto.hours = getSetHour;
|
5013 |
proto.minute = proto.minutes = getSetMinute;
|
5014 |
proto.second = proto.seconds = getSetSecond;
|
5015 |
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
5016 |
+
proto.utcOffset = getSetOffset;
|
5017 |
+
proto.utc = setOffsetToUTC;
|
5018 |
+
proto.local = setOffsetToLocal;
|
5019 |
+
proto.parseZone = setOffsetToParsedOffset;
|
5020 |
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
5021 |
+
proto.isDST = isDaylightSavingTime;
|
5022 |
+
proto.isLocal = isLocal;
|
5023 |
+
proto.isUtcOffset = isUtcOffset;
|
5024 |
+
proto.isUtc = isUtc;
|
5025 |
+
proto.isUTC = isUtc;
|
5026 |
proto.zoneAbbr = getZoneAbbr;
|
5027 |
proto.zoneName = getZoneName;
|
5028 |
+
proto.dates = deprecate(
|
5029 |
+
'dates accessor is deprecated. Use date instead.',
|
5030 |
+
getSetDayOfMonth
|
5031 |
+
);
|
5032 |
+
proto.months = deprecate(
|
5033 |
+
'months accessor is deprecated. Use month instead',
|
5034 |
+
getSetMonth
|
5035 |
+
);
|
5036 |
+
proto.years = deprecate(
|
5037 |
+
'years accessor is deprecated. Use year instead',
|
5038 |
+
getSetYear
|
5039 |
+
);
|
5040 |
+
proto.zone = deprecate(
|
5041 |
+
'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
|
5042 |
+
getSetZone
|
5043 |
+
);
|
5044 |
+
proto.isDSTShifted = deprecate(
|
5045 |
+
'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
|
5046 |
+
isDaylightSavingTimeShifted
|
5047 |
+
);
|
5048 |
|
5049 |
+
function createUnix(input) {
|
5050 |
return createLocal(input * 1000);
|
5051 |
}
|
5052 |
|
5053 |
+
function createInZone() {
|
5054 |
return createLocal.apply(null, arguments).parseZone();
|
5055 |
}
|
5056 |
|
5057 |
+
function preParsePostFormat(string) {
|
5058 |
return string;
|
5059 |
}
|
5060 |
|
5061 |
var proto$1 = Locale.prototype;
|
5062 |
|
5063 |
+
proto$1.calendar = calendar;
|
5064 |
+
proto$1.longDateFormat = longDateFormat;
|
5065 |
+
proto$1.invalidDate = invalidDate;
|
5066 |
+
proto$1.ordinal = ordinal;
|
5067 |
+
proto$1.preparse = preParsePostFormat;
|
5068 |
+
proto$1.postformat = preParsePostFormat;
|
5069 |
+
proto$1.relativeTime = relativeTime;
|
5070 |
+
proto$1.pastFuture = pastFuture;
|
5071 |
+
proto$1.set = set;
|
5072 |
+
proto$1.eras = localeEras;
|
5073 |
+
proto$1.erasParse = localeErasParse;
|
5074 |
+
proto$1.erasConvertYear = localeErasConvertYear;
|
5075 |
+
proto$1.erasAbbrRegex = erasAbbrRegex;
|
5076 |
+
proto$1.erasNameRegex = erasNameRegex;
|
5077 |
+
proto$1.erasNarrowRegex = erasNarrowRegex;
|
5078 |
+
|
5079 |
+
proto$1.months = localeMonths;
|
5080 |
+
proto$1.monthsShort = localeMonthsShort;
|
5081 |
+
proto$1.monthsParse = localeMonthsParse;
|
5082 |
+
proto$1.monthsRegex = monthsRegex;
|
5083 |
+
proto$1.monthsShortRegex = monthsShortRegex;
|
5084 |
proto$1.week = localeWeek;
|
5085 |
proto$1.firstDayOfYear = localeFirstDayOfYear;
|
5086 |
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
5087 |
|
5088 |
+
proto$1.weekdays = localeWeekdays;
|
5089 |
+
proto$1.weekdaysMin = localeWeekdaysMin;
|
5090 |
+
proto$1.weekdaysShort = localeWeekdaysShort;
|
5091 |
+
proto$1.weekdaysParse = localeWeekdaysParse;
|
5092 |
|
5093 |
+
proto$1.weekdaysRegex = weekdaysRegex;
|
5094 |
+
proto$1.weekdaysShortRegex = weekdaysShortRegex;
|
5095 |
+
proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
5096 |
|
5097 |
proto$1.isPM = localeIsPM;
|
5098 |
proto$1.meridiem = localeMeridiem;
|
5099 |
|
5100 |
+
function get$1(format, index, field, setter) {
|
5101 |
+
var locale = getLocale(),
|
5102 |
+
utc = createUTC().set(setter, index);
|
5103 |
return locale[field](utc, format);
|
5104 |
}
|
5105 |
|
5106 |
+
function listMonthsImpl(format, index, field) {
|
5107 |
if (isNumber(format)) {
|
5108 |
index = format;
|
5109 |
format = undefined;
|
5115 |
return get$1(format, index, field, 'month');
|
5116 |
}
|
5117 |
|
5118 |
+
var i,
|
5119 |
+
out = [];
|
5120 |
for (i = 0; i < 12; i++) {
|
5121 |
out[i] = get$1(format, i, field, 'month');
|
5122 |
}
|
5131 |
// (true, 5)
|
5132 |
// (true, fmt, 5)
|
5133 |
// (true, fmt)
|
5134 |
+
function listWeekdaysImpl(localeSorted, format, index, field) {
|
5135 |
if (typeof localeSorted === 'boolean') {
|
5136 |
if (isNumber(format)) {
|
5137 |
index = format;
|
5153 |
}
|
5154 |
|
5155 |
var locale = getLocale(),
|
5156 |
+
shift = localeSorted ? locale._week.dow : 0,
|
5157 |
+
i,
|
5158 |
+
out = [];
|
5159 |
|
5160 |
if (index != null) {
|
5161 |
return get$1(format, (index + shift) % 7, field, 'day');
|
5162 |
}
|
5163 |
|
|
|
|
|
5164 |
for (i = 0; i < 7; i++) {
|
5165 |
out[i] = get$1(format, (i + shift) % 7, field, 'day');
|
5166 |
}
|
5167 |
return out;
|
5168 |
}
|
5169 |
|
5170 |
+
function listMonths(format, index) {
|
5171 |
return listMonthsImpl(format, index, 'months');
|
5172 |
}
|
5173 |
|
5174 |
+
function listMonthsShort(format, index) {
|
5175 |
return listMonthsImpl(format, index, 'monthsShort');
|
5176 |
}
|
5177 |
|
5178 |
+
function listWeekdays(localeSorted, format, index) {
|
5179 |
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
|
5180 |
}
|
5181 |
|
5182 |
+
function listWeekdaysShort(localeSorted, format, index) {
|
5183 |
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
|
5184 |
}
|
5185 |
|
5186 |
+
function listWeekdaysMin(localeSorted, format, index) {
|
5187 |
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
|
5188 |
}
|
5189 |
|
5190 |
getSetGlobalLocale('en', {
|
5191 |
+
eras: [
|
5192 |
+
{
|
5193 |
+
since: '0001-01-01',
|
5194 |
+
until: +Infinity,
|
5195 |
+
offset: 1,
|
5196 |
+
name: 'Anno Domini',
|
5197 |
+
narrow: 'AD',
|
5198 |
+
abbr: 'AD',
|
5199 |
+
},
|
5200 |
+
{
|
5201 |
+
since: '0000-12-31',
|
5202 |
+
until: -Infinity,
|
5203 |
+
offset: 1,
|
5204 |
+
name: 'Before Christ',
|
5205 |
+
narrow: 'BC',
|
5206 |
+
abbr: 'BC',
|
5207 |
+
},
|
5208 |
+
],
|
5209 |
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
5210 |
+
ordinal: function (number) {
|
5211 |
var b = number % 10,
|
5212 |
+
output =
|
5213 |
+
toInt((number % 100) / 10) === 1
|
5214 |
+
? 'th'
|
5215 |
+
: b === 1
|
5216 |
+
? 'st'
|
5217 |
+
: b === 2
|
5218 |
+
? 'nd'
|
5219 |
+
: b === 3
|
5220 |
+
? 'rd'
|
5221 |
+
: 'th';
|
5222 |
return number + output;
|
5223 |
+
},
|
5224 |
});
|
5225 |
|
5226 |
// Side effect imports
|
5227 |
|
5228 |
+
hooks.lang = deprecate(
|
5229 |
+
'moment.lang is deprecated. Use moment.locale instead.',
|
5230 |
+
getSetGlobalLocale
|
5231 |
+
);
|
5232 |
+
hooks.langData = deprecate(
|
5233 |
+
'moment.langData is deprecated. Use moment.localeData instead.',
|
5234 |
+
getLocale
|
5235 |
+
);
|
5236 |
|
5237 |
var mathAbs = Math.abs;
|
5238 |
|
5239 |
+
function abs() {
|
5240 |
+
var data = this._data;
|
5241 |
|
5242 |
this._milliseconds = mathAbs(this._milliseconds);
|
5243 |
+
this._days = mathAbs(this._days);
|
5244 |
+
this._months = mathAbs(this._months);
|
5245 |
|
5246 |
+
data.milliseconds = mathAbs(data.milliseconds);
|
5247 |
+
data.seconds = mathAbs(data.seconds);
|
5248 |
+
data.minutes = mathAbs(data.minutes);
|
5249 |
+
data.hours = mathAbs(data.hours);
|
5250 |
+
data.months = mathAbs(data.months);
|
5251 |
+
data.years = mathAbs(data.years);
|
5252 |
|
5253 |
return this;
|
5254 |
}
|
5255 |
|
5256 |
+
function addSubtract$1(duration, input, value, direction) {
|
5257 |
var other = createDuration(input, value);
|
5258 |
|
5259 |
duration._milliseconds += direction * other._milliseconds;
|
5260 |
+
duration._days += direction * other._days;
|
5261 |
+
duration._months += direction * other._months;
|
5262 |
|
5263 |
return duration._bubble();
|
5264 |
}
|
5265 |
|
5266 |
// supports only 2.0-style add(1, 's') or add(duration)
|
5267 |
+
function add$1(input, value) {
|
5268 |
return addSubtract$1(this, input, value, 1);
|
5269 |
}
|
5270 |
|
5271 |
// supports only 2.0-style subtract(1, 's') or subtract(duration)
|
5272 |
+
function subtract$1(input, value) {
|
5273 |
return addSubtract$1(this, input, value, -1);
|
5274 |
}
|
5275 |
|
5276 |
+
function absCeil(number) {
|
5277 |
if (number < 0) {
|
5278 |
return Math.floor(number);
|
5279 |
} else {
|
5281 |
}
|
5282 |
}
|
5283 |
|
5284 |
+
function bubble() {
|
5285 |
+
var milliseconds = this._milliseconds,
|
5286 |
+
days = this._days,
|
5287 |
+
months = this._months,
|
5288 |
+
data = this._data,
|
5289 |
+
seconds,
|
5290 |
+
minutes,
|
5291 |
+
hours,
|
5292 |
+
years,
|
5293 |
+
monthsFromDays;
|
5294 |
|
5295 |
// if we have a mix of positive and negative values, bubble down first
|
5296 |
// check: https://github.com/moment/moment/issues/2166
|
5297 |
+
if (
|
5298 |
+
!(
|
5299 |
+
(milliseconds >= 0 && days >= 0 && months >= 0) ||
|
5300 |
+
(milliseconds <= 0 && days <= 0 && months <= 0)
|
5301 |
+
)
|
5302 |
+
) {
|
5303 |
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
|
5304 |
days = 0;
|
5305 |
months = 0;
|
5309 |
// examples of what that means.
|
5310 |
data.milliseconds = milliseconds % 1000;
|
5311 |
|
5312 |
+
seconds = absFloor(milliseconds / 1000);
|
5313 |
+
data.seconds = seconds % 60;
|
5314 |
|
5315 |
+
minutes = absFloor(seconds / 60);
|
5316 |
+
data.minutes = minutes % 60;
|
5317 |
|
5318 |
+
hours = absFloor(minutes / 60);
|
5319 |
+
data.hours = hours % 24;
|
5320 |
|
5321 |
days += absFloor(hours / 24);
|
5322 |
|
5329 |
years = absFloor(months / 12);
|
5330 |
months %= 12;
|
5331 |
|
5332 |
+
data.days = days;
|
5333 |
data.months = months;
|
5334 |
+
data.years = years;
|
5335 |
|
5336 |
return this;
|
5337 |
}
|
5338 |
|
5339 |
+
function daysToMonths(days) {
|
5340 |
// 400 years have 146097 days (taking into account leap year rules)
|
5341 |
// 400 years have 12 months === 4800
|
5342 |
+
return (days * 4800) / 146097;
|
5343 |
}
|
5344 |
|
5345 |
+
function monthsToDays(months) {
|
5346 |
// the reverse of daysToMonths
|
5347 |
+
return (months * 146097) / 4800;
|
5348 |
}
|
5349 |
|
5350 |
+
function as(units) {
|
5351 |
if (!this.isValid()) {
|
5352 |
return NaN;
|
5353 |
}
|
5354 |
+
var days,
|
5355 |
+
months,
|
5356 |
+
milliseconds = this._milliseconds;
|
5357 |
|
5358 |
units = normalizeUnits(units);
|
5359 |
|
5360 |
+
if (units === 'month' || units === 'quarter' || units === 'year') {
|
5361 |
+
days = this._days + milliseconds / 864e5;
|
5362 |
months = this._months + daysToMonths(days);
|
5363 |
+
switch (units) {
|
5364 |
+
case 'month':
|
5365 |
+
return months;
|
5366 |
+
case 'quarter':
|
5367 |
+
return months / 3;
|
5368 |
+
case 'year':
|
5369 |
+
return months / 12;
|
5370 |
+
}
|
5371 |
} else {
|
5372 |
// handle milliseconds separately because of floating point math errors (issue #1867)
|
5373 |
days = this._days + Math.round(monthsToDays(this._months));
|
5374 |
switch (units) {
|
5375 |
+
case 'week':
|
5376 |
+
return days / 7 + milliseconds / 6048e5;
|
5377 |
+
case 'day':
|
5378 |
+
return days + milliseconds / 864e5;
|
5379 |
+
case 'hour':
|
5380 |
+
return days * 24 + milliseconds / 36e5;
|
5381 |
+
case 'minute':
|
5382 |
+
return days * 1440 + milliseconds / 6e4;
|
5383 |
+
case 'second':
|
5384 |
+
return days * 86400 + milliseconds / 1000;
|
5385 |
// Math.floor prevents floating point math errors here
|
5386 |
+
case 'millisecond':
|
5387 |
+
return Math.floor(days * 864e5) + milliseconds;
|
5388 |
+
default:
|
5389 |
+
throw new Error('Unknown unit ' + units);
|
5390 |
}
|
5391 |
}
|
5392 |
}
|
5393 |
|
5394 |
// TODO: Use this.as('ms')?
|
5395 |
+
function valueOf$1() {
|
5396 |
if (!this.isValid()) {
|
5397 |
return NaN;
|
5398 |
}
|
5404 |
);
|
5405 |
}
|
5406 |
|
5407 |
+
function makeAs(alias) {
|
5408 |
return function () {
|
5409 |
return this.as(alias);
|
5410 |
};
|
5411 |
}
|
5412 |
|
5413 |
+
var asMilliseconds = makeAs('ms'),
|
5414 |
+
asSeconds = makeAs('s'),
|
5415 |
+
asMinutes = makeAs('m'),
|
5416 |
+
asHours = makeAs('h'),
|
5417 |
+
asDays = makeAs('d'),
|
5418 |
+
asWeeks = makeAs('w'),
|
5419 |
+
asMonths = makeAs('M'),
|
5420 |
+
asQuarters = makeAs('Q'),
|
5421 |
+
asYears = makeAs('y');
|
5422 |
|
5423 |
+
function clone$1() {
|
5424 |
return createDuration(this);
|
5425 |
}
|
5426 |
|
5427 |
+
function get$2(units) {
|
5428 |
units = normalizeUnits(units);
|
5429 |
return this.isValid() ? this[units + 's']() : NaN;
|
5430 |
}
|
5435 |
};
|
5436 |
}
|
5437 |
|
5438 |
+
var milliseconds = makeGetter('milliseconds'),
|
5439 |
+
seconds = makeGetter('seconds'),
|
5440 |
+
minutes = makeGetter('minutes'),
|
5441 |
+
hours = makeGetter('hours'),
|
5442 |
+
days = makeGetter('days'),
|
5443 |
+
months = makeGetter('months'),
|
5444 |
+
years = makeGetter('years');
|
5445 |
|
5446 |
+
function weeks() {
|
5447 |
return absFloor(this.days() / 7);
|
5448 |
}
|
5449 |
|
5450 |
+
var round = Math.round,
|
5451 |
+
thresholds = {
|
5452 |
+
ss: 44, // a few seconds to seconds
|
5453 |
+
s: 45, // seconds to minute
|
5454 |
+
m: 45, // minutes to hour
|
5455 |
+
h: 22, // hours to day
|
5456 |
+
d: 26, // days to month/week
|
5457 |
+
w: null, // weeks to month
|
5458 |
+
M: 11, // months to year
|
5459 |
+
};
|
5460 |
|
5461 |
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
|
5462 |
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
|
5463 |
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
|
5464 |
}
|
5465 |
|
5466 |
+
function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
|
5467 |
+
var duration = createDuration(posNegDuration).abs(),
|
5468 |
+
seconds = round(duration.as('s')),
|
5469 |
+
minutes = round(duration.as('m')),
|
5470 |
+
hours = round(duration.as('h')),
|
5471 |
+
days = round(duration.as('d')),
|
5472 |
+
months = round(duration.as('M')),
|
5473 |
+
weeks = round(duration.as('w')),
|
5474 |
+
years = round(duration.as('y')),
|
5475 |
+
a =
|
5476 |
+
(seconds <= thresholds.ss && ['s', seconds]) ||
|
5477 |
+
(seconds < thresholds.s && ['ss', seconds]) ||
|
5478 |
+
(minutes <= 1 && ['m']) ||
|
5479 |
+
(minutes < thresholds.m && ['mm', minutes]) ||
|
5480 |
+
(hours <= 1 && ['h']) ||
|
5481 |
+
(hours < thresholds.h && ['hh', hours]) ||
|
5482 |
+
(days <= 1 && ['d']) ||
|
5483 |
+
(days < thresholds.d && ['dd', days]);
|
5484 |
+
|
5485 |
+
if (thresholds.w != null) {
|
5486 |
+
a =
|
5487 |
+
a ||
|
5488 |
+
(weeks <= 1 && ['w']) ||
|
5489 |
+
(weeks < thresholds.w && ['ww', weeks]);
|
5490 |
+
}
|
5491 |
+
a = a ||
|
5492 |
+
(months <= 1 && ['M']) ||
|
5493 |
+
(months < thresholds.M && ['MM', months]) ||
|
5494 |
+
(years <= 1 && ['y']) || ['yy', years];
|
5495 |
|
5496 |
a[2] = withoutSuffix;
|
5497 |
a[3] = +posNegDuration > 0;
|
5500 |
}
|
5501 |
|
5502 |
// This function allows you to set the rounding function for relative time strings
|
5503 |
+
function getSetRelativeTimeRounding(roundingFunction) {
|
5504 |
if (roundingFunction === undefined) {
|
5505 |
return round;
|
5506 |
}
|
5507 |
+
if (typeof roundingFunction === 'function') {
|
5508 |
round = roundingFunction;
|
5509 |
return true;
|
5510 |
}
|
5512 |
}
|
5513 |
|
5514 |
// This function allows you to set a threshold for relative time strings
|
5515 |
+
function getSetRelativeTimeThreshold(threshold, limit) {
|
5516 |
if (thresholds[threshold] === undefined) {
|
5517 |
return false;
|
5518 |
}
|
5526 |
return true;
|
5527 |
}
|
5528 |
|
5529 |
+
function humanize(argWithSuffix, argThresholds) {
|
5530 |
if (!this.isValid()) {
|
5531 |
return this.localeData().invalidDate();
|
5532 |
}
|
5533 |
|
5534 |
+
var withSuffix = false,
|
5535 |
+
th = thresholds,
|
5536 |
+
locale,
|
5537 |
+
output;
|
5538 |
+
|
5539 |
+
if (typeof argWithSuffix === 'object') {
|
5540 |
+
argThresholds = argWithSuffix;
|
5541 |
+
argWithSuffix = false;
|
5542 |
+
}
|
5543 |
+
if (typeof argWithSuffix === 'boolean') {
|
5544 |
+
withSuffix = argWithSuffix;
|
5545 |
+
}
|
5546 |
+
if (typeof argThresholds === 'object') {
|
5547 |
+
th = Object.assign({}, thresholds, argThresholds);
|
5548 |
+
if (argThresholds.s != null && argThresholds.ss == null) {
|
5549 |
+
th.ss = argThresholds.s - 1;
|
5550 |
+
}
|
5551 |
+
}
|
5552 |
+
|
5553 |
+
locale = this.localeData();
|
5554 |
+
output = relativeTime$1(this, !withSuffix, th, locale);
|
5555 |
|
5556 |
if (withSuffix) {
|
5557 |
output = locale.pastFuture(+this, output);
|
5563 |
var abs$1 = Math.abs;
|
5564 |
|
5565 |
function sign(x) {
|
5566 |
+
return (x > 0) - (x < 0) || +x;
|
5567 |
}
|
5568 |
|
5569 |
function toISOString$1() {
|
5578 |
return this.localeData().invalidDate();
|
5579 |
}
|
5580 |
|
5581 |
+
var seconds = abs$1(this._milliseconds) / 1000,
|
5582 |
+
days = abs$1(this._days),
|
5583 |
+
months = abs$1(this._months),
|
5584 |
+
minutes,
|
5585 |
+
hours,
|
5586 |
+
years,
|
5587 |
+
s,
|
5588 |
+
total = this.asSeconds(),
|
5589 |
+
totalSign,
|
5590 |
+
ymSign,
|
5591 |
+
daysSign,
|
5592 |
+
hmsSign;
|
5593 |
+
|
5594 |
+
if (!total) {
|
5595 |
+
// this is the same as C#'s (Noda) and python (isodate)...
|
5596 |
+
// but not other JS (goog.date)
|
5597 |
+
return 'P0D';
|
5598 |
+
}
|
5599 |
|
5600 |
// 3600 seconds -> 60 minutes -> 1 hour
|
5601 |
+
minutes = absFloor(seconds / 60);
|
5602 |
+
hours = absFloor(minutes / 60);
|
5603 |
seconds %= 60;
|
5604 |
minutes %= 60;
|
5605 |
|
5606 |
// 12 months -> 1 year
|
5607 |
+
years = absFloor(months / 12);
|
5608 |
months %= 12;
|
5609 |
|
|
|
5610 |
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
|
5611 |
+
s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
5612 |
|
5613 |
+
totalSign = total < 0 ? '-' : '';
|
5614 |
+
ymSign = sign(this._months) !== sign(total) ? '-' : '';
|
5615 |
+
daysSign = sign(this._days) !== sign(total) ? '-' : '';
|
5616 |
+
hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
|
|
|
5617 |
|
5618 |
+
return (
|
5619 |
+
totalSign +
|
5620 |
+
'P' +
|
5621 |
+
(years ? ymSign + years + 'Y' : '') +
|
5622 |
+
(months ? ymSign + months + 'M' : '') +
|
5623 |
+
(days ? daysSign + days + 'D' : '') +
|
5624 |
+
(hours || minutes || seconds ? 'T' : '') +
|
5625 |
+
(hours ? hmsSign + hours + 'H' : '') +
|
5626 |
+
(minutes ? hmsSign + minutes + 'M' : '') +
|
5627 |
+
(seconds ? hmsSign + s + 'S' : '')
|
5628 |
+
);
|
|
|
|
|
5629 |
}
|
5630 |
|
5631 |
var proto$2 = Duration.prototype;
|
5632 |
|
5633 |
+
proto$2.isValid = isValid$1;
|
5634 |
+
proto$2.abs = abs;
|
5635 |
+
proto$2.add = add$1;
|
5636 |
+
proto$2.subtract = subtract$1;
|
5637 |
+
proto$2.as = as;
|
5638 |
proto$2.asMilliseconds = asMilliseconds;
|
5639 |
+
proto$2.asSeconds = asSeconds;
|
5640 |
+
proto$2.asMinutes = asMinutes;
|
5641 |
+
proto$2.asHours = asHours;
|
5642 |
+
proto$2.asDays = asDays;
|
5643 |
+
proto$2.asWeeks = asWeeks;
|
5644 |
+
proto$2.asMonths = asMonths;
|
5645 |
+
proto$2.asQuarters = asQuarters;
|
5646 |
+
proto$2.asYears = asYears;
|
5647 |
+
proto$2.valueOf = valueOf$1;
|
5648 |
+
proto$2._bubble = bubble;
|
5649 |
+
proto$2.clone = clone$1;
|
5650 |
+
proto$2.get = get$2;
|
5651 |
+
proto$2.milliseconds = milliseconds;
|
5652 |
+
proto$2.seconds = seconds;
|
5653 |
+
proto$2.minutes = minutes;
|
5654 |
+
proto$2.hours = hours;
|
5655 |
+
proto$2.days = days;
|
5656 |
+
proto$2.weeks = weeks;
|
5657 |
+
proto$2.months = months;
|
5658 |
+
proto$2.years = years;
|
5659 |
+
proto$2.humanize = humanize;
|
5660 |
+
proto$2.toISOString = toISOString$1;
|
5661 |
+
proto$2.toString = toISOString$1;
|
5662 |
+
proto$2.toJSON = toISOString$1;
|
5663 |
+
proto$2.locale = locale;
|
5664 |
+
proto$2.localeData = localeData;
|
5665 |
+
|
5666 |
+
proto$2.toIsoString = deprecate(
|
5667 |
+
'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
|
5668 |
+
toISOString$1
|
5669 |
+
);
|
5670 |
proto$2.lang = lang;
|
5671 |
|
|
|
|
|
5672 |
// FORMATTING
|
5673 |
|
5674 |
addFormatToken('X', 0, 0, 'unix');
|
5679 |
addRegexToken('x', matchSigned);
|
5680 |
addRegexToken('X', matchTimestamp);
|
5681 |
addParseToken('X', function (input, array, config) {
|
5682 |
+
config._d = new Date(parseFloat(input) * 1000);
|
5683 |
});
|
5684 |
addParseToken('x', function (input, array, config) {
|
5685 |
config._d = new Date(toInt(input));
|
5686 |
});
|
5687 |
|
5688 |
+
//! moment.js
|
|
|
5689 |
|
5690 |
+
hooks.version = '2.26.0';
|
5691 |
|
5692 |
setHookCallback(createLocal);
|
5693 |
|
5694 |
+
hooks.fn = proto;
|
5695 |
+
hooks.min = min;
|
5696 |
+
hooks.max = max;
|
5697 |
+
hooks.now = now;
|
5698 |
+
hooks.utc = createUTC;
|
5699 |
+
hooks.unix = createUnix;
|
5700 |
+
hooks.months = listMonths;
|
5701 |
+
hooks.isDate = isDate;
|
5702 |
+
hooks.locale = getSetGlobalLocale;
|
5703 |
+
hooks.invalid = createInvalid;
|
5704 |
+
hooks.duration = createDuration;
|
5705 |
+
hooks.isMoment = isMoment;
|
5706 |
+
hooks.weekdays = listWeekdays;
|
5707 |
+
hooks.parseZone = createInZone;
|
5708 |
+
hooks.localeData = getLocale;
|
5709 |
+
hooks.isDuration = isDuration;
|
5710 |
+
hooks.monthsShort = listMonthsShort;
|
5711 |
+
hooks.weekdaysMin = listWeekdaysMin;
|
5712 |
+
hooks.defineLocale = defineLocale;
|
5713 |
+
hooks.updateLocale = updateLocale;
|
5714 |
+
hooks.locales = listLocales;
|
5715 |
+
hooks.weekdaysShort = listWeekdaysShort;
|
5716 |
+
hooks.normalizeUnits = normalizeUnits;
|
5717 |
+
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
|
5718 |
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
5719 |
+
hooks.calendarFormat = getCalendarFormat;
|
5720 |
+
hooks.prototype = proto;
|
5721 |
|
5722 |
// currently HTML5 input type only supports 24-hour formats
|
5723 |
hooks.HTML5_FMT = {
|
5724 |
+
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
|
5725 |
+
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
|
5726 |
+
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
|
5727 |
+
DATE: 'YYYY-MM-DD', // <input type="date" />
|
5728 |
+
TIME: 'HH:mm', // <input type="time" />
|
5729 |
+
TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
|
5730 |
+
TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
|
5731 |
+
WEEK: 'GGGG-[W]WW', // <input type="week" />
|
5732 |
+
MONTH: 'YYYY-MM', // <input type="month" />
|
5733 |
};
|
5734 |
|
5735 |
return hooks;
|
5736 |
|
5737 |
})));
|
5738 |
|
5739 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(645)(module)))
|
5740 |
+
|
5741 |
+
/***/ }),
|
5742 |
+
/* 1 */
|
5743 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5744 |
+
|
5745 |
+
"use strict";
|
5746 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__react__ = __webpack_require__(92);
|
5747 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["a"]; });
|
5748 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["b"]; });
|
5749 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["c"]; });
|
5750 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["e"]; });
|
5751 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["f"]; });
|
5752 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["g"]; });
|
5753 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["h"]; });
|
5754 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["i"]; });
|
5755 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["j"]; });
|
5756 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["k"]; });
|
5757 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react_platform__ = __webpack_require__(431);
|
5758 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react_platform__["a"]; });
|
5759 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(439);
|
5760 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2__utils__["a"]; });
|
5761 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__serialize__ = __webpack_require__(440);
|
5762 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_3__serialize__["a"]; });
|
5763 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__raw_html__ = __webpack_require__(143);
|
5764 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_4__raw_html__["a"]; });
|
5765 |
+
|
5766 |
+
|
5767 |
+
|
5768 |
+
|
5769 |
+
|
5770 |
+
//# sourceMappingURL=index.js.map
|
5771 |
|
5772 |
/***/ }),
|
5773 |
/* 2 */
|
5815 |
|
5816 |
"use strict";
|
5817 |
/* harmony export (immutable) */ __webpack_exports__["a"] = _possibleConstructorReturn;
|
5818 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helpers_esm_typeof__ = __webpack_require__(36);
|
5819 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__assertThisInitialized__ = __webpack_require__(9);
|
5820 |
|
5821 |
|
5846 |
|
5847 |
"use strict";
|
5848 |
/* harmony export (immutable) */ __webpack_exports__["a"] = _inherits;
|
5849 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setPrototypeOf__ = __webpack_require__(444);
|
5850 |
|
5851 |
function _inherits(subClass, superClass) {
|
5852 |
if (typeof superClass !== "function" && superClass !== null) {
|
5905 |
/* 10 */
|
5906 |
/***/ (function(module, exports, __webpack_require__) {
|
5907 |
|
5908 |
+
"use strict";
|
5909 |
+
/* WEBPACK VAR INJECTION */(function(process) {
|
5910 |
+
|
5911 |
+
if (process.env.NODE_ENV === 'production') {
|
5912 |
+
module.exports = __webpack_require__(429);
|
5913 |
+
} else {
|
5914 |
+
module.exports = __webpack_require__(430);
|
5915 |
+
}
|
5916 |
+
|
5917 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
5918 |
+
|
5919 |
+
/***/ }),
|
5920 |
+
/* 11 */
|
5921 |
+
/***/ (function(module, exports, __webpack_require__) {
|
5922 |
+
|
5923 |
/* WEBPACK VAR INJECTION */(function(process) {/**
|
5924 |
* Copyright (c) 2013-present, Facebook, Inc.
|
5925 |
*
|
5928 |
*/
|
5929 |
|
5930 |
if (process.env.NODE_ENV !== 'production') {
|
5931 |
+
var ReactIs = __webpack_require__(67);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5932 |
|
5933 |
// By explicitly using `prop-types` you are opting into new development behavior.
|
5934 |
// http://fb.me/prop-types-in-prod
|
5935 |
var throwOnDirectAccess = true;
|
5936 |
+
module.exports = __webpack_require__(652)(ReactIs.isElement, throwOnDirectAccess);
|
5937 |
} else {
|
5938 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
5939 |
// http://fb.me/prop-types-in-prod
|
5940 |
+
module.exports = __webpack_require__(653)();
|
5941 |
}
|
5942 |
|
5943 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
5944 |
|
5945 |
/***/ }),
|
5946 |
+
/* 12 */
|
5947 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5948 |
|
5949 |
"use strict";
|
5950 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutProperties;
|
5951 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__objectWithoutPropertiesLoose__ = __webpack_require__(428);
|
5952 |
|
5953 |
+
function _objectWithoutProperties(source, excluded) {
|
5954 |
+
if (source == null) return {};
|
5955 |
+
var target = Object(__WEBPACK_IMPORTED_MODULE_0__objectWithoutPropertiesLoose__["a" /* default */])(source, excluded);
|
5956 |
+
var key, i;
|
5957 |
+
|
5958 |
+
if (Object.getOwnPropertySymbols) {
|
5959 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
5960 |
+
|
5961 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
5962 |
+
key = sourceSymbolKeys[i];
|
5963 |
+
if (excluded.indexOf(key) >= 0) continue;
|
5964 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
5965 |
+
target[key] = source[key];
|
5966 |
+
}
|
5967 |
+
}
|
5968 |
|
5969 |
+
return target;
|
5970 |
+
}
|
5971 |
|
5972 |
/***/ }),
|
5973 |
+
/* 13 */
|
5974 |
/***/ (function(module, exports, __webpack_require__) {
|
5975 |
|
5976 |
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
6029 |
|
6030 |
|
6031 |
/***/ }),
|
6032 |
+
/* 14 */
|
6033 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6034 |
|
6035 |
"use strict";
|
6036 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _defineProperty;
|
6037 |
+
function _defineProperty(obj, key, value) {
|
6038 |
+
if (key in obj) {
|
6039 |
+
Object.defineProperty(obj, key, {
|
6040 |
+
value: value,
|
6041 |
+
enumerable: true,
|
6042 |
+
configurable: true,
|
6043 |
+
writable: true
|
6044 |
+
});
|
6045 |
+
} else {
|
6046 |
+
obj[key] = value;
|
|
|
|
|
|
|
|
|
|
|
|
|
6047 |
}
|
6048 |
|
6049 |
+
return obj;
|
6050 |
}
|
6051 |
|
6052 |
/***/ }),
|
6053 |
+
/* 15 */
|
6054 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6055 |
|
6056 |
"use strict";
|
6057 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create_interpolate_element__ = __webpack_require__(523);
|
6058 |
+
/* unused harmony reexport createInterpolateElement */
|
6059 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react__ = __webpack_require__(104);
|
6060 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["a"]; });
|
6061 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["b"]; });
|
6062 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["d"]; });
|
6063 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["e"]; });
|
6064 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["f"]; });
|
6065 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["g"]; });
|
6066 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["h"]; });
|
6067 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["i"]; });
|
6068 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["j"]; });
|
6069 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["k"]; });
|
6070 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["l"]; });
|
6071 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["m"]; });
|
6072 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["n"]; });
|
6073 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react_platform__ = __webpack_require__(524);
|
6074 |
+
/* unused harmony namespace reexport */
|
6075 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(525);
|
6076 |
+
/* unused harmony namespace reexport */
|
6077 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(526);
|
6078 |
+
/* unused harmony reexport Platform */
|
6079 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serialize__ = __webpack_require__(527);
|
6080 |
+
/* unused harmony reexport renderToString */
|
6081 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__raw_html__ = __webpack_require__(156);
|
6082 |
+
/* unused harmony reexport RawHTML */
|
6083 |
|
6084 |
|
6085 |
|
6087 |
|
6088 |
|
6089 |
|
6090 |
+
//# sourceMappingURL=index.js.map
|
6091 |
|
6092 |
+
/***/ }),
|
6093 |
+
/* 16 */
|
6094 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6095 |
+
|
6096 |
+
"use strict";
|
|
|
|
|
|
|
6097 |
|
6098 |
|
6099 |
+
Object.defineProperty(exports, "__esModule", {
|
6100 |
+
value: true
|
6101 |
+
});
|
6102 |
+
exports["default"] = wrapValidator;
|
6103 |
+
|
6104 |
+
var _object = _interopRequireDefault(__webpack_require__(24));
|
6105 |
+
|
6106 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6107 |
+
|
6108 |
+
function wrapValidator(validator, typeName) {
|
6109 |
+
var typeChecker = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
6110 |
+
return (0, _object["default"])(validator.bind(), {
|
6111 |
+
typeName: typeName,
|
6112 |
+
typeChecker: typeChecker,
|
6113 |
+
isRequired: (0, _object["default"])(validator.isRequired.bind(), {
|
6114 |
+
typeName: typeName,
|
6115 |
+
typeChecker: typeChecker,
|
6116 |
+
typeRequired: true
|
6117 |
+
})
|
6118 |
+
});
|
6119 |
+
}
|
6120 |
+
//# sourceMappingURL=wrapValidator.js.map
|
6121 |
|
6122 |
/***/ }),
|
6123 |
+
/* 17 */
|
6124 |
/***/ (function(module, exports, __webpack_require__) {
|
6125 |
|
6126 |
"use strict";
|
6165 |
var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
|
6166 |
|
6167 |
/***/ }),
|
6168 |
+
/* 18 */
|
6169 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6170 |
|
6171 |
"use strict";
|
6172 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__ = __webpack_require__(43);
|
6173 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__["a"]; });
|
6174 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__ = __webpack_require__(456);
|
6175 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__["a"]; });
|
6176 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__higher_order_if_condition__ = __webpack_require__(457);
|
6177 |
+
/* unused harmony reexport ifCondition */
|
6178 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__higher_order_pure__ = __webpack_require__(466);
|
6179 |
+
/* unused harmony reexport pure */
|
6180 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__higher_order_with_global_events__ = __webpack_require__(470);
|
6181 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_4__higher_order_with_global_events__["a"]; });
|
6182 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__higher_order_with_instance_id__ = __webpack_require__(472);
|
6183 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_5__higher_order_with_instance_id__["a"]; });
|
6184 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__ = __webpack_require__(473);
|
6185 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__["a"]; });
|
6186 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__higher_order_with_state__ = __webpack_require__(474);
|
6187 |
+
/* unused harmony reexport withState */
|
6188 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__hooks_use_dragging__ = __webpack_require__(475);
|
6189 |
+
/* unused harmony reexport __experimentalUseDragging */
|
6190 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__hooks_use_instance_id__ = __webpack_require__(148);
|
6191 |
+
/* unused harmony reexport useInstanceId */
|
6192 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__hooks_use_keyboard_shortcut__ = __webpack_require__(476);
|
6193 |
+
/* unused harmony reexport useKeyboardShortcut */
|
6194 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__hooks_use_media_query__ = __webpack_require__(100);
|
6195 |
+
/* unused harmony reexport useMediaQuery */
|
6196 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__hooks_use_reduced_motion__ = __webpack_require__(477);
|
6197 |
+
/* unused harmony reexport useReducedMotion */
|
6198 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__hooks_use_viewport_match__ = __webpack_require__(478);
|
6199 |
+
/* unused harmony reexport useViewportMatch */
|
6200 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__hooks_use_resize_observer__ = __webpack_require__(479);
|
6201 |
+
/* unused harmony reexport useResizeObserver */
|
6202 |
+
// Utils
|
6203 |
+
// Compose helper (aliased flowRight from Lodash)
|
6204 |
|
6205 |
+
// Higher-order components
|
|
|
|
|
|
|
6206 |
|
|
|
6207 |
|
|
|
6208 |
|
|
|
6209 |
|
|
|
|
|
6210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6211 |
|
6212 |
+
// Hooks
|
|
|
|
|
6213 |
|
|
|
6214 |
|
6215 |
|
|
|
6216 |
|
|
|
|
|
|
|
6217 |
|
|
|
6218 |
|
|
|
|
|
|
|
|
|
|
|
6219 |
|
|
|
6220 |
|
6221 |
+
//# sourceMappingURL=index.js.map
|
6222 |
|
6223 |
/***/ }),
|
6224 |
/* 19 */
|
6225 |
/***/ (function(module, exports, __webpack_require__) {
|
6226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6227 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6228 |
|
6229 |
|
6230 |
+
/* globals
|
6231 |
+
Atomics,
|
6232 |
+
SharedArrayBuffer,
|
6233 |
+
*/
|
6234 |
|
6235 |
+
var undefined;
|
6236 |
|
6237 |
+
var $TypeError = TypeError;
|
|
|
|
|
|
|
|
|
|
|
6238 |
|
6239 |
+
var $gOPD = Object.getOwnPropertyDescriptor;
|
6240 |
+
if ($gOPD) {
|
6241 |
+
try {
|
6242 |
+
$gOPD({}, '');
|
6243 |
+
} catch (e) {
|
6244 |
+
$gOPD = null; // this is IE 8, which has a broken gOPD
|
6245 |
+
}
|
6246 |
+
}
|
|
|
|
|
|
|
|
|
6247 |
|
6248 |
+
var throwTypeError = function () { throw new $TypeError(); };
|
6249 |
+
var ThrowTypeError = $gOPD
|
6250 |
+
? (function () {
|
6251 |
+
try {
|
6252 |
+
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
6253 |
+
arguments.callee; // IE 8 does not throw here
|
6254 |
+
return throwTypeError;
|
6255 |
+
} catch (calleeThrows) {
|
6256 |
+
try {
|
6257 |
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
6258 |
+
return $gOPD(arguments, 'callee').get;
|
6259 |
+
} catch (gOPDthrows) {
|
6260 |
+
return throwTypeError;
|
6261 |
+
}
|
6262 |
+
}
|
6263 |
+
}())
|
6264 |
+
: throwTypeError;
|
6265 |
|
6266 |
+
var hasSymbols = __webpack_require__(191)();
|
|
|
|
|
|
|
|
|
6267 |
|
6268 |
+
var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6269 |
|
6270 |
+
var generator; // = function * () {};
|
6271 |
+
var generatorFunction = generator ? getProto(generator) : undefined;
|
6272 |
+
var asyncFn; // async function() {};
|
6273 |
+
var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
|
6274 |
+
var asyncGen; // async function * () {};
|
6275 |
+
var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
|
6276 |
+
var asyncGenIterator = asyncGen ? asyncGen() : undefined;
|
6277 |
|
6278 |
+
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6279 |
|
6280 |
+
var INTRINSICS = {
|
6281 |
+
'%Array%': Array,
|
6282 |
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
6283 |
+
'%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
|
6284 |
+
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
6285 |
+
'%ArrayPrototype%': Array.prototype,
|
6286 |
+
'%ArrayProto_entries%': Array.prototype.entries,
|
6287 |
+
'%ArrayProto_forEach%': Array.prototype.forEach,
|
6288 |
+
'%ArrayProto_keys%': Array.prototype.keys,
|
6289 |
+
'%ArrayProto_values%': Array.prototype.values,
|
6290 |
+
'%AsyncFromSyncIteratorPrototype%': undefined,
|
6291 |
+
'%AsyncFunction%': asyncFunction,
|
6292 |
+
'%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
|
6293 |
+
'%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
|
6294 |
+
'%AsyncGeneratorFunction%': asyncGenFunction,
|
6295 |
+
'%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
|
6296 |
+
'%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
|
6297 |
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
6298 |
+
'%Boolean%': Boolean,
|
6299 |
+
'%BooleanPrototype%': Boolean.prototype,
|
6300 |
+
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
6301 |
+
'%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
|
6302 |
+
'%Date%': Date,
|
6303 |
+
'%DatePrototype%': Date.prototype,
|
6304 |
+
'%decodeURI%': decodeURI,
|
6305 |
+
'%decodeURIComponent%': decodeURIComponent,
|
6306 |
+
'%encodeURI%': encodeURI,
|
6307 |
+
'%encodeURIComponent%': encodeURIComponent,
|
6308 |
+
'%Error%': Error,
|
6309 |
+
'%ErrorPrototype%': Error.prototype,
|
6310 |
+
'%eval%': eval, // eslint-disable-line no-eval
|
6311 |
+
'%EvalError%': EvalError,
|
6312 |
+
'%EvalErrorPrototype%': EvalError.prototype,
|
6313 |
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
6314 |
+
'%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
|
6315 |
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
6316 |
+
'%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
|
6317 |
+
'%Function%': Function,
|
6318 |
+
'%FunctionPrototype%': Function.prototype,
|
6319 |
+
'%Generator%': generator ? getProto(generator()) : undefined,
|
6320 |
+
'%GeneratorFunction%': generatorFunction,
|
6321 |
+
'%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
|
6322 |
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
6323 |
+
'%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
|
6324 |
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
6325 |
+
'%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
|
6326 |
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
6327 |
+
'%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
|
6328 |
+
'%isFinite%': isFinite,
|
6329 |
+
'%isNaN%': isNaN,
|
6330 |
+
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
6331 |
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
6332 |
+
'%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
|
6333 |
+
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
6334 |
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
6335 |
+
'%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
|
6336 |
+
'%Math%': Math,
|
6337 |
+
'%Number%': Number,
|
6338 |
+
'%NumberPrototype%': Number.prototype,
|
6339 |
+
'%Object%': Object,
|
6340 |
+
'%ObjectPrototype%': Object.prototype,
|
6341 |
+
'%ObjProto_toString%': Object.prototype.toString,
|
6342 |
+
'%ObjProto_valueOf%': Object.prototype.valueOf,
|
6343 |
+
'%parseFloat%': parseFloat,
|
6344 |
+
'%parseInt%': parseInt,
|
6345 |
+
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
6346 |
+
'%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
|
6347 |
+
'%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
|
6348 |
+
'%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
|
6349 |
+
'%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
|
6350 |
+
'%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
|
6351 |
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
6352 |
+
'%RangeError%': RangeError,
|
6353 |
+
'%RangeErrorPrototype%': RangeError.prototype,
|
6354 |
+
'%ReferenceError%': ReferenceError,
|
6355 |
+
'%ReferenceErrorPrototype%': ReferenceError.prototype,
|
6356 |
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
6357 |
+
'%RegExp%': RegExp,
|
6358 |
+
'%RegExpPrototype%': RegExp.prototype,
|
6359 |
+
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
6360 |
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
6361 |
+
'%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
|
6362 |
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
6363 |
+
'%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
|
6364 |
+
'%String%': String,
|
6365 |
+
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
6366 |
+
'%StringPrototype%': String.prototype,
|
6367 |
+
'%Symbol%': hasSymbols ? Symbol : undefined,
|
6368 |
+
'%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
|
6369 |
+
'%SyntaxError%': SyntaxError,
|
6370 |
+
'%SyntaxErrorPrototype%': SyntaxError.prototype,
|
6371 |
+
'%ThrowTypeError%': ThrowTypeError,
|
6372 |
+
'%TypedArray%': TypedArray,
|
6373 |
+
'%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
|
6374 |
+
'%TypeError%': $TypeError,
|
6375 |
+
'%TypeErrorPrototype%': $TypeError.prototype,
|
6376 |
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
6377 |
+
'%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
|
6378 |
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
6379 |
+
'%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
|
6380 |
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
6381 |
+
'%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
|
6382 |
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
6383 |
+
'%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
|
6384 |
+
'%URIError%': URIError,
|
6385 |
+
'%URIErrorPrototype%': URIError.prototype,
|
6386 |
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
6387 |
+
'%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
|
6388 |
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
|
6389 |
+
'%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
|
6390 |
+
};
|
6391 |
|
6392 |
+
var bind = __webpack_require__(83);
|
6393 |
+
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
|
6394 |
|
6395 |
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
6396 |
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
6397 |
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
6398 |
+
var stringToPath = function stringToPath(string) {
|
6399 |
+
var result = [];
|
6400 |
+
$replace(string, rePropName, function (match, number, quote, subString) {
|
6401 |
+
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
|
6402 |
+
});
|
6403 |
+
return result;
|
6404 |
+
};
|
6405 |
+
/* end adaptation */
|
|
|
6406 |
|
6407 |
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
6408 |
+
if (!(name in INTRINSICS)) {
|
6409 |
+
throw new SyntaxError('intrinsic ' + name + ' does not exist!');
|
6410 |
+
}
|
6411 |
|
6412 |
+
// istanbul ignore if // hopefully this is impossible to test :-)
|
6413 |
+
if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
|
6414 |
+
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
6415 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6416 |
|
6417 |
+
return INTRINSICS[name];
|
6418 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6419 |
|
6420 |
+
module.exports = function GetIntrinsic(name, allowMissing) {
|
6421 |
+
if (typeof name !== 'string' || name.length === 0) {
|
6422 |
+
throw new TypeError('intrinsic name must be a non-empty string');
|
6423 |
+
}
|
6424 |
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
6425 |
+
throw new TypeError('"allowMissing" argument must be a boolean');
|
6426 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6427 |
|
6428 |
+
var parts = stringToPath(name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6429 |
|
6430 |
+
var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
|
6431 |
+
for (var i = 1; i < parts.length; i += 1) {
|
6432 |
+
if (value != null) {
|
6433 |
+
if ($gOPD && (i + 1) >= parts.length) {
|
6434 |
+
var desc = $gOPD(value, parts[i]);
|
6435 |
+
if (!allowMissing && !(parts[i] in value)) {
|
6436 |
+
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
6437 |
+
}
|
6438 |
+
value = desc ? (desc.get || desc.value) : value[parts[i]];
|
6439 |
+
} else {
|
6440 |
+
value = value[parts[i]];
|
6441 |
+
}
|
6442 |
+
}
|
6443 |
+
}
|
6444 |
+
return value;
|
6445 |
+
};
|
6446 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6447 |
|
6448 |
/***/ }),
|
6449 |
+
/* 20 */
|
6450 |
/***/ (function(module, exports) {
|
6451 |
|
6452 |
// shim for using process in browser
|
6635 |
process.umask = function() { return 0; };
|
6636 |
|
6637 |
|
6638 |
+
/***/ }),
|
6639 |
+
/* 21 */
|
6640 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6641 |
+
|
6642 |
+
/* WEBPACK VAR INJECTION */(function(process) {module.exports = process.env.NODE_ENV === 'production' ? __webpack_require__(657) : __webpack_require__(658);
|
6643 |
+
|
6644 |
+
//# sourceMappingURL=index.js.map
|
6645 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
6646 |
+
|
6647 |
/***/ }),
|
6648 |
/* 22 */
|
6649 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6650 |
|
6651 |
+
"use strict";
|
6652 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _objectSpread;
|
6653 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defineProperty__ = __webpack_require__(14);
|
6654 |
+
|
6655 |
+
function _objectSpread(target) {
|
6656 |
+
for (var i = 1; i < arguments.length; i++) {
|
6657 |
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
6658 |
+
var ownKeys = Object.keys(source);
|
6659 |
+
|
6660 |
+
if (typeof Object.getOwnPropertySymbols === 'function') {
|
6661 |
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
6662 |
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
6663 |
+
}));
|
6664 |
+
}
|
6665 |
+
|
6666 |
+
ownKeys.forEach(function (key) {
|
6667 |
+
Object(__WEBPACK_IMPORTED_MODULE_0__defineProperty__["a" /* default */])(target, key, source[key]);
|
6668 |
+
});
|
6669 |
+
}
|
6670 |
+
|
6671 |
+
return target;
|
6672 |
+
}
|
6673 |
+
|
6674 |
+
/***/ }),
|
6675 |
+
/* 23 */
|
6676 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6677 |
+
|
6678 |
"use strict";
|
6679 |
/* harmony export (immutable) */ __webpack_exports__["a"] = _toConsumableArray;
|
6680 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__ = __webpack_require__(445);
|
6681 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArray__ = __webpack_require__(446);
|
6682 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__unsupportedIterableToArray__ = __webpack_require__(145);
|
6683 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__nonIterableSpread__ = __webpack_require__(447);
|
6684 |
+
|
6685 |
|
6686 |
|
6687 |
|
6688 |
function _toConsumableArray(arr) {
|
6689 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArray__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_2__unsupportedIterableToArray__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_3__nonIterableSpread__["a" /* default */])();
|
6690 |
}
|
6691 |
|
6692 |
/***/ }),
|
6693 |
+
/* 24 */
|
6694 |
/***/ (function(module, exports, __webpack_require__) {
|
6695 |
|
6696 |
"use strict";
|
6697 |
|
6698 |
|
6699 |
+
var defineProperties = __webpack_require__(26);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6700 |
|
6701 |
+
var implementation = __webpack_require__(340);
|
6702 |
+
var getPolyfill = __webpack_require__(341);
|
6703 |
+
var shim = __webpack_require__(649);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6704 |
|
6705 |
+
var polyfill = getPolyfill();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6706 |
|
6707 |
+
defineProperties(polyfill, {
|
6708 |
+
getPolyfill: getPolyfill,
|
6709 |
+
implementation: implementation,
|
6710 |
+
shim: shim
|
6711 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6712 |
|
6713 |
+
module.exports = polyfill;
|
|
|
|
|
|
|
|
|
6714 |
|
6715 |
+
|
6716 |
+
/***/ }),
|
6717 |
+
/* 25 */
|
6718 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6719 |
+
|
6720 |
+
"use strict";
|
6721 |
+
/* unused harmony export setLocaleData */
|
6722 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = __;
|
6723 |
+
/* harmony export (immutable) */ __webpack_exports__["c"] = _x;
|
6724 |
+
/* harmony export (immutable) */ __webpack_exports__["b"] = _n;
|
6725 |
+
/* unused harmony export _nx */
|
6726 |
+
/* harmony export (immutable) */ __webpack_exports__["d"] = sprintf;
|
6727 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(22);
|
6728 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tannin__ = __webpack_require__(96);
|
6729 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_memize__ = __webpack_require__(76);
|
6730 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_memize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_memize__);
|
6731 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js__ = __webpack_require__(95);
|
6732 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__);
|
6733 |
+
|
6734 |
+
|
6735 |
+
/**
|
6736 |
+
* External dependencies
|
6737 |
+
*/
|
6738 |
+
|
6739 |
+
|
6740 |
+
|
6741 |
+
/**
|
6742 |
+
* Default locale data to use for Tannin domain when not otherwise provided.
|
6743 |
+
* Assumes an English plural forms expression.
|
6744 |
+
*
|
6745 |
+
* @type {Object}
|
6746 |
+
*/
|
6747 |
+
|
6748 |
+
var DEFAULT_LOCALE_DATA = {
|
6749 |
+
'': {
|
6750 |
+
plural_forms: 'plural=(n!=1)'
|
6751 |
+
}
|
6752 |
+
};
|
6753 |
+
/**
|
6754 |
+
* Log to console, once per message; or more precisely, per referentially equal
|
6755 |
+
* argument set. Because Jed throws errors, we log these to the console instead
|
6756 |
+
* to avoid crashing the application.
|
6757 |
+
*
|
6758 |
+
* @param {...*} args Arguments to pass to `console.error`
|
6759 |
+
*/
|
6760 |
+
|
6761 |
+
var logErrorOnce = __WEBPACK_IMPORTED_MODULE_2_memize___default()(console.error); // eslint-disable-line no-console
|
6762 |
+
|
6763 |
+
/**
|
6764 |
+
* The underlying instance of Tannin to which exported functions interface.
|
6765 |
+
*
|
6766 |
+
* @type {Tannin}
|
6767 |
+
*/
|
6768 |
+
|
6769 |
+
var i18n = new __WEBPACK_IMPORTED_MODULE_1_tannin__["a" /* default */]({});
|
6770 |
+
/**
|
6771 |
+
* Merges locale data into the Tannin instance by domain. Accepts data in a
|
6772 |
+
* Jed-formatted JSON object shape.
|
6773 |
+
*
|
6774 |
+
* @see http://messageformat.github.io/Jed/
|
6775 |
+
*
|
6776 |
+
* @param {?Object} data Locale data configuration.
|
6777 |
+
* @param {?string} domain Domain for which configuration applies.
|
6778 |
+
*/
|
6779 |
+
|
6780 |
+
function setLocaleData(data) {
|
6781 |
+
var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
6782 |
+
i18n.data[domain] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({}, DEFAULT_LOCALE_DATA, i18n.data[domain], data); // Populate default domain configuration (supported locale date which omits
|
6783 |
+
// a plural forms expression).
|
6784 |
+
|
6785 |
+
i18n.data[domain][''] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({}, DEFAULT_LOCALE_DATA[''], i18n.data[domain]['']);
|
6786 |
+
}
|
6787 |
+
/**
|
6788 |
+
* Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
|
6789 |
+
* otherwise previously assigned.
|
6790 |
+
*
|
6791 |
+
* @param {?string} domain Domain to retrieve the translated text.
|
6792 |
+
* @param {?string} context Context information for the translators.
|
6793 |
+
* @param {string} single Text to translate if non-plural. Used as fallback
|
6794 |
+
* return value on a caught error.
|
6795 |
+
* @param {?string} plural The text to be used if the number is plural.
|
6796 |
+
* @param {?number} number The number to compare against to use either the
|
6797 |
+
* singular or plural form.
|
6798 |
+
*
|
6799 |
+
* @return {string} The translated string.
|
6800 |
+
*/
|
6801 |
+
|
6802 |
+
function dcnpgettext() {
|
6803 |
+
var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
6804 |
+
var context = arguments.length > 1 ? arguments[1] : undefined;
|
6805 |
+
var single = arguments.length > 2 ? arguments[2] : undefined;
|
6806 |
+
var plural = arguments.length > 3 ? arguments[3] : undefined;
|
6807 |
+
var number = arguments.length > 4 ? arguments[4] : undefined;
|
6808 |
+
|
6809 |
+
if (!i18n.data[domain]) {
|
6810 |
+
setLocaleData(undefined, domain);
|
6811 |
+
}
|
6812 |
+
|
6813 |
+
return i18n.dcnpgettext(domain, context, single, plural, number);
|
6814 |
+
}
|
6815 |
+
/**
|
6816 |
+
* Retrieve the translation of text.
|
6817 |
+
*
|
6818 |
+
* @see https://developer.wordpress.org/reference/functions/__/
|
6819 |
+
*
|
6820 |
+
* @param {string} text Text to translate.
|
6821 |
+
* @param {?string} domain Domain to retrieve the translated text.
|
6822 |
+
*
|
6823 |
+
* @return {string} Translated text.
|
6824 |
+
*/
|
6825 |
+
|
6826 |
+
|
6827 |
+
function __(text, domain) {
|
6828 |
+
return dcnpgettext(domain, undefined, text);
|
6829 |
+
}
|
6830 |
+
/**
|
6831 |
+
* Retrieve translated string with gettext context.
|
6832 |
+
*
|
6833 |
+
* @see https://developer.wordpress.org/reference/functions/_x/
|
6834 |
+
*
|
6835 |
+
* @param {string} text Text to translate.
|
6836 |
+
* @param {string} context Context information for the translators.
|
6837 |
+
* @param {?string} domain Domain to retrieve the translated text.
|
6838 |
+
*
|
6839 |
+
* @return {string} Translated context string without pipe.
|
6840 |
+
*/
|
6841 |
+
|
6842 |
+
function _x(text, context, domain) {
|
6843 |
+
return dcnpgettext(domain, context, text);
|
6844 |
+
}
|
6845 |
+
/**
|
6846 |
+
* Translates and retrieves the singular or plural form based on the supplied
|
6847 |
+
* number.
|
6848 |
+
*
|
6849 |
+
* @see https://developer.wordpress.org/reference/functions/_n/
|
6850 |
+
*
|
6851 |
+
* @param {string} single The text to be used if the number is singular.
|
6852 |
+
* @param {string} plural The text to be used if the number is plural.
|
6853 |
+
* @param {number} number The number to compare against to use either the
|
6854 |
+
* singular or plural form.
|
6855 |
+
* @param {?string} domain Domain to retrieve the translated text.
|
6856 |
+
*
|
6857 |
+
* @return {string} The translated singular or plural form.
|
6858 |
+
*/
|
6859 |
+
|
6860 |
+
function _n(single, plural, number, domain) {
|
6861 |
+
return dcnpgettext(domain, undefined, single, plural, number);
|
6862 |
+
}
|
6863 |
+
/**
|
6864 |
+
* Translates and retrieves the singular or plural form based on the supplied
|
6865 |
+
* number, with gettext context.
|
6866 |
+
*
|
6867 |
+
* @see https://developer.wordpress.org/reference/functions/_nx/
|
6868 |
+
*
|
6869 |
+
* @param {string} single The text to be used if the number is singular.
|
6870 |
+
* @param {string} plural The text to be used if the number is plural.
|
6871 |
+
* @param {number} number The number to compare against to use either the
|
6872 |
+
* singular or plural form.
|
6873 |
+
* @param {string} context Context information for the translators.
|
6874 |
+
* @param {?string} domain Domain to retrieve the translated text.
|
6875 |
+
*
|
6876 |
+
* @return {string} The translated singular or plural form.
|
6877 |
+
*/
|
6878 |
+
|
6879 |
+
function _nx(single, plural, number, context, domain) {
|
6880 |
+
return dcnpgettext(domain, context, single, plural, number);
|
6881 |
+
}
|
6882 |
+
/**
|
6883 |
+
* Returns a formatted string. If an error occurs in applying the format, the
|
6884 |
+
* original format string is returned.
|
6885 |
+
*
|
6886 |
+
* @param {string} format The format of the string to generate.
|
6887 |
+
* @param {string[]} ...args Arguments to apply to the format.
|
6888 |
+
*
|
6889 |
+
* @see http://www.diveintojavascript.com/projects/javascript-sprintf
|
6890 |
+
*
|
6891 |
+
* @return {string} The formatted string.
|
6892 |
+
*/
|
6893 |
+
|
6894 |
+
function sprintf(format) {
|
6895 |
+
try {
|
6896 |
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
6897 |
+
args[_key - 1] = arguments[_key];
|
6898 |
+
}
|
6899 |
+
|
6900 |
+
return __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default.a.sprintf.apply(__WEBPACK_IMPORTED_MODULE_3_sprintf_js___default.a, [format].concat(args));
|
6901 |
+
} catch (error) {
|
6902 |
+
logErrorOnce('sprintf error: \n\n' + error.toString());
|
6903 |
+
return format;
|
6904 |
+
}
|
6905 |
+
}
|
6906 |
+
//# sourceMappingURL=index.js.map
|
6907 |
+
|
6908 |
+
/***/ }),
|
6909 |
+
/* 26 */
|
6910 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6911 |
+
|
6912 |
+
"use strict";
|
6913 |
+
|
6914 |
+
|
6915 |
+
var keys = __webpack_require__(189);
|
6916 |
+
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
6917 |
+
|
6918 |
+
var toStr = Object.prototype.toString;
|
6919 |
+
var concat = Array.prototype.concat;
|
6920 |
+
var origDefineProperty = Object.defineProperty;
|
6921 |
+
|
6922 |
+
var isFunction = function (fn) {
|
6923 |
+
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
|
6924 |
+
};
|
6925 |
+
|
6926 |
+
var arePropertyDescriptorsSupported = function () {
|
6927 |
+
var obj = {};
|
6928 |
+
try {
|
6929 |
+
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
|
6930 |
+
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
|
6931 |
+
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
|
6932 |
+
return false;
|
6933 |
+
}
|
6934 |
+
return obj.x === obj;
|
6935 |
+
} catch (e) { /* this is IE 8. */
|
6936 |
+
return false;
|
6937 |
+
}
|
6938 |
+
};
|
6939 |
+
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
|
6940 |
+
|
6941 |
+
var defineProperty = function (object, name, value, predicate) {
|
6942 |
+
if (name in object && (!isFunction(predicate) || !predicate())) {
|
6943 |
+
return;
|
6944 |
+
}
|
6945 |
+
if (supportsDescriptors) {
|
6946 |
+
origDefineProperty(object, name, {
|
6947 |
+
configurable: true,
|
6948 |
+
enumerable: false,
|
6949 |
+
value: value,
|
6950 |
+
writable: true
|
6951 |
+
});
|
6952 |
+
} else {
|
6953 |
+
object[name] = value;
|
6954 |
+
}
|
6955 |
+
};
|
6956 |
+
|
6957 |
+
var defineProperties = function (object, map) {
|
6958 |
+
var predicates = arguments.length > 2 ? arguments[2] : {};
|
6959 |
+
var props = keys(map);
|
6960 |
+
if (hasSymbols) {
|
6961 |
+
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
6962 |
+
}
|
6963 |
+
for (var i = 0; i < props.length; i += 1) {
|
6964 |
+
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
|
6965 |
+
}
|
6966 |
+
};
|
6967 |
+
|
6968 |
+
defineProperties.supportsDescriptors = !!supportsDescriptors;
|
6969 |
+
|
6970 |
+
module.exports = defineProperties;
|
6971 |
+
|
6972 |
+
|
6973 |
+
/***/ }),
|
6974 |
+
/* 27 */
|
6975 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6976 |
+
|
6977 |
+
"use strict";
|
6978 |
+
|
6979 |
+
|
6980 |
+
Object.defineProperty(exports, "__esModule", {
|
6981 |
+
value: true
|
6982 |
+
});
|
6983 |
+
var calendarLabel = 'Calendar';
|
6984 |
+
var closeDatePicker = 'Close';
|
6985 |
+
var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
|
6986 |
+
var clearDate = 'Clear Date';
|
6987 |
+
var clearDates = 'Clear Dates';
|
6988 |
+
var jumpToPrevMonth = 'Move backward to switch to the previous month.';
|
6989 |
+
var jumpToNextMonth = 'Move forward to switch to the next month.';
|
6990 |
+
var keyboardShortcuts = 'Keyboard Shortcuts';
|
6991 |
+
var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
|
6992 |
+
var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
|
6993 |
+
var openThisPanel = 'Open this panel.';
|
6994 |
+
var enterKey = 'Enter key';
|
6995 |
+
var leftArrowRightArrow = 'Right and left arrow keys';
|
6996 |
+
var upArrowDownArrow = 'up and down arrow keys';
|
6997 |
+
var pageUpPageDown = 'page up and page down keys';
|
6998 |
+
var homeEnd = 'Home and end keys';
|
6999 |
+
var escape = 'Escape key';
|
7000 |
+
var questionMark = 'Question mark';
|
7001 |
+
var selectFocusedDate = 'Select the date in focus.';
|
7002 |
+
var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
|
7003 |
+
var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
|
7004 |
+
var moveFocusByOneMonth = 'Switch months.';
|
7005 |
+
var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
|
7006 |
+
var returnFocusToInput = 'Return to the date input field.';
|
7007 |
+
var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
|
7008 |
+
|
7009 |
+
var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
|
7010 |
+
var date = _ref.date;
|
7011 |
+
return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.';
|
7012 |
+
};
|
7013 |
+
var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
|
7014 |
+
var date = _ref2.date;
|
7015 |
+
return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.';
|
7016 |
+
};
|
7017 |
+
var chooseAvailableDate = function chooseAvailableDate(_ref3) {
|
7018 |
+
var date = _ref3.date;
|
7019 |
+
return date;
|
7020 |
+
};
|
7021 |
+
var dateIsUnavailable = function dateIsUnavailable(_ref4) {
|
7022 |
+
var date = _ref4.date;
|
7023 |
+
return 'Not available. ' + String(date);
|
7024 |
+
};
|
7025 |
+
var dateIsSelected = function dateIsSelected(_ref5) {
|
7026 |
+
var date = _ref5.date;
|
7027 |
+
return 'Selected. ' + String(date);
|
7028 |
+
};
|
7029 |
+
|
7030 |
+
exports['default'] = {
|
7031 |
+
calendarLabel: calendarLabel,
|
7032 |
+
closeDatePicker: closeDatePicker,
|
7033 |
+
focusStartDate: focusStartDate,
|
7034 |
+
clearDate: clearDate,
|
7035 |
+
clearDates: clearDates,
|
7036 |
+
jumpToPrevMonth: jumpToPrevMonth,
|
7037 |
+
jumpToNextMonth: jumpToNextMonth,
|
7038 |
+
keyboardShortcuts: keyboardShortcuts,
|
7039 |
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
7040 |
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
7041 |
+
openThisPanel: openThisPanel,
|
7042 |
+
enterKey: enterKey,
|
7043 |
+
leftArrowRightArrow: leftArrowRightArrow,
|
7044 |
+
upArrowDownArrow: upArrowDownArrow,
|
7045 |
+
pageUpPageDown: pageUpPageDown,
|
7046 |
+
homeEnd: homeEnd,
|
7047 |
+
escape: escape,
|
7048 |
+
questionMark: questionMark,
|
7049 |
+
selectFocusedDate: selectFocusedDate,
|
7050 |
+
moveFocusByOneDay: moveFocusByOneDay,
|
7051 |
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
7052 |
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
7053 |
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
7054 |
+
returnFocusToInput: returnFocusToInput,
|
7055 |
+
keyboardNavigationInstructions: keyboardNavigationInstructions,
|
7056 |
+
|
7057 |
+
chooseAvailableStartDate: chooseAvailableStartDate,
|
7058 |
+
chooseAvailableEndDate: chooseAvailableEndDate,
|
7059 |
+
dateIsUnavailable: dateIsUnavailable,
|
7060 |
+
dateIsSelected: dateIsSelected
|
7061 |
+
};
|
7062 |
+
var DateRangePickerPhrases = exports.DateRangePickerPhrases = {
|
7063 |
+
calendarLabel: calendarLabel,
|
7064 |
+
closeDatePicker: closeDatePicker,
|
7065 |
+
clearDates: clearDates,
|
7066 |
+
focusStartDate: focusStartDate,
|
7067 |
+
jumpToPrevMonth: jumpToPrevMonth,
|
7068 |
+
jumpToNextMonth: jumpToNextMonth,
|
7069 |
+
keyboardShortcuts: keyboardShortcuts,
|
7070 |
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
7071 |
+
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
7072 |
+
openThisPanel: openThisPanel,
|
7073 |
+
enterKey: enterKey,
|
7074 |
+
leftArrowRightArrow: leftArrowRightArrow,
|
7075 |
+
upArrowDownArrow: upArrowDownArrow,
|
7076 |
+
pageUpPageDown: pageUpPageDown,
|
7077 |
+
homeEnd: homeEnd,
|
7078 |
+
escape: escape,
|
7079 |
+
questionMark: questionMark,
|
7080 |
+
selectFocusedDate: selectFocusedDate,
|
7081 |
+
moveFocusByOneDay: moveFocusByOneDay,
|
7082 |
+
moveFocusByOneWeek: moveFocusByOneWeek,
|
7083 |
+
moveFocusByOneMonth: moveFocusByOneMonth,
|
7084 |
+
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
|
7085 |
+
returnFocusToInput: returnFocusToInput,
|
7086 |
+
keyboardNavigationInstructions: keyboardNavigationInstructions,
|
7087 |
+
chooseAvailableStartDate: chooseAvailableStartDate,
|
7088 |
+
chooseAvailableEndDate: chooseAvailableEndDate,
|
7089 |
+
dateIsUnavailable: dateIsUnavailable,
|
7090 |
+
dateIsSelected: dateIsSelected
|
7091 |
+
};
|
7092 |
+
|
7093 |
+
var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = {
|
7094 |
+
focusStartDate: focusStartDate,
|
7095 |
+
clearDates: clearDates,
|
7096 |
+
keyboardNavigationInstructions: keyboardNavigationInstructions
|
7097 |
+
};
|
7098 |
+
|
7099 |
+
var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = {
|
7100 |
+
calendarLabel: calendarLabel,
|
7101 |
+
closeDatePicker: closeDatePicker,
|
7102 |
+
clearDate: clearDate,
|
7103 |
+
jumpToPrevMonth: jumpToPrevMonth,
|
7104 |
+
jumpToNextMonth: jumpToNextMonth,
|
7105 |
+
keyboardShortcuts: keyboardShortcuts,
|
7106 |
+
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
|
7107 |
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
|
7108 |
openThisPanel: openThisPanel,
|
7109 |
enterKey: enterKey,
|
7190 |
};
|
7191 |
|
7192 |
/***/ }),
|
7193 |
+
/* 28 */
|
7194 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7195 |
+
|
7196 |
+
"use strict";
|
7197 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create_interpolate_element__ = __webpack_require__(458);
|
7198 |
+
/* unused harmony reexport createInterpolateElement */
|
7199 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react__ = __webpack_require__(97);
|
7200 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["a"]; });
|
7201 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["d"]; });
|
7202 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["e"]; });
|
7203 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["f"]; });
|
7204 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["g"]; });
|
7205 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["h"]; });
|
7206 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["i"]; });
|
7207 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["j"]; });
|
7208 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["k"]; });
|
7209 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["l"]; });
|
7210 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["m"]; });
|
7211 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react_platform__ = __webpack_require__(462);
|
7212 |
+
/* unused harmony namespace reexport */
|
7213 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(463);
|
7214 |
+
/* unused harmony namespace reexport */
|
7215 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(464);
|
7216 |
+
/* unused harmony reexport Platform */
|
7217 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serialize__ = __webpack_require__(465);
|
7218 |
+
/* unused harmony reexport renderToString */
|
7219 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__raw_html__ = __webpack_require__(147);
|
7220 |
+
/* unused harmony reexport RawHTML */
|
7221 |
+
|
7222 |
+
|
7223 |
+
|
7224 |
+
|
7225 |
+
|
7226 |
+
|
7227 |
+
|
7228 |
+
//# sourceMappingURL=index.js.map
|
7229 |
+
|
7230 |
+
/***/ }),
|
7231 |
+
/* 29 */
|
7232 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7233 |
+
|
7234 |
+
"use strict";
|
7235 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LINE_SEPARATOR; });
|
7236 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return OBJECT_REPLACEMENT_CHARACTER; });
|
7237 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ZWNBSP; });
|
7238 |
+
/**
|
7239 |
+
* Line separator character, used for multiline text.
|
7240 |
+
*/
|
7241 |
+
var LINE_SEPARATOR = "\u2028";
|
7242 |
+
/**
|
7243 |
+
* Object replacement character, used as a placeholder for objects.
|
7244 |
+
*/
|
7245 |
+
|
7246 |
+
var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
|
7247 |
+
/**
|
7248 |
+
* Zero width non-breaking space, used as padding in the editable DOM tree when
|
7249 |
+
* it is empty otherwise.
|
7250 |
+
*/
|
7251 |
+
|
7252 |
+
var ZWNBSP = "\uFEFF";
|
7253 |
+
//# sourceMappingURL=special-characters.js.map
|
7254 |
+
|
7255 |
+
/***/ }),
|
7256 |
+
/* 30 */
|
7257 |
/***/ (function(module, exports, __webpack_require__) {
|
7258 |
|
7259 |
"use strict";
|
7264 |
});
|
7265 |
exports['default'] = getPhrasePropTypes;
|
7266 |
|
7267 |
+
var _object = __webpack_require__(24);
|
7268 |
|
7269 |
var _object2 = _interopRequireDefault(_object);
|
7270 |
|
7271 |
+
var _propTypes = __webpack_require__(11);
|
7272 |
|
7273 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
7274 |
|
7283 |
}
|
7284 |
|
7285 |
/***/ }),
|
7286 |
+
/* 31 */
|
7287 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7288 |
|
7289 |
"use strict";
|
7290 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BACKSPACE; });
|
7291 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return TAB; });
|
7292 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ENTER; });
|
7293 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ESCAPE; });
|
7294 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return SPACE; });
|
7295 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LEFT; });
|
7296 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return UP; });
|
7297 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return RIGHT; });
|
7298 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DOWN; });
|
7299 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DELETE; });
|
7300 |
+
/* unused harmony export F10 */
|
7301 |
+
/* unused harmony export ALT */
|
7302 |
+
/* unused harmony export CTRL */
|
7303 |
+
/* unused harmony export COMMAND */
|
7304 |
+
/* unused harmony export SHIFT */
|
7305 |
+
/* unused harmony export ZERO */
|
7306 |
+
/* unused harmony export modifiers */
|
7307 |
+
/* unused harmony export rawShortcut */
|
7308 |
+
/* unused harmony export displayShortcutList */
|
7309 |
+
/* unused harmony export displayShortcut */
|
7310 |
+
/* unused harmony export shortcutAriaLabel */
|
7311 |
+
/* unused harmony export isKeyboardEvent */
|
7312 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
7313 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(23);
|
7314 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
|
7315 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
|
7316 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__ = __webpack_require__(448);
|
7317 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(455);
|
7318 |
|
7319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7320 |
|
7321 |
+
/**
|
7322 |
+
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
7323 |
+
* functions in this file are intentional and should not be changed. They're
|
7324 |
+
* designed to fit with the standard menu keyboard shortcuts shown in the
|
7325 |
+
* user's platform.
|
7326 |
+
*
|
7327 |
+
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
7328 |
+
* on Windows Control will usually come first. So don't provide your own
|
7329 |
+
* shortcut combos directly to keyboardShortcut().
|
7330 |
+
*/
|
7331 |
|
7332 |
+
/**
|
7333 |
+
* External dependencies
|
7334 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7335 |
|
7336 |
+
/**
|
7337 |
+
* WordPress dependencies
|
7338 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7340 |
|
7341 |
+
/**
|
7342 |
+
* Internal dependencies
|
7343 |
+
*/
|
7344 |
|
|
|
7345 |
|
7346 |
+
/**
|
7347 |
+
* @typedef {'primary'|'primaryShift'|'primaryAlt'|'secondary'|'access'|'ctrl'|'alt'|'ctrlShift'|'shift'|'shiftAlt'} WPKeycodeModifier
|
7348 |
+
*/
|
7349 |
+
|
7350 |
+
/**
|
7351 |
+
* An object of handler functions for each of the possible modifier
|
7352 |
+
* combinations. A handler will return a value for a given key.
|
7353 |
+
*
|
7354 |
+
* @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
|
7355 |
+
*/
|
7356 |
+
|
7357 |
+
/**
|
7358 |
+
* Keycode for BACKSPACE key.
|
7359 |
+
*/
|
7360 |
+
|
7361 |
+
var BACKSPACE = 8;
|
7362 |
+
/**
|
7363 |
+
* Keycode for TAB key.
|
7364 |
+
*/
|
7365 |
+
|
7366 |
+
var TAB = 9;
|
7367 |
+
/**
|
7368 |
+
* Keycode for ENTER key.
|
7369 |
+
*/
|
7370 |
+
|
7371 |
+
var ENTER = 13;
|
7372 |
+
/**
|
7373 |
+
* Keycode for ESCAPE key.
|
7374 |
+
*/
|
7375 |
+
|
7376 |
+
var ESCAPE = 27;
|
7377 |
+
/**
|
7378 |
+
* Keycode for SPACE key.
|
7379 |
+
*/
|
7380 |
+
|
7381 |
+
var SPACE = 32;
|
7382 |
+
/**
|
7383 |
+
* Keycode for LEFT key.
|
7384 |
+
*/
|
7385 |
+
|
7386 |
+
var LEFT = 37;
|
7387 |
+
/**
|
7388 |
+
* Keycode for UP key.
|
7389 |
+
*/
|
7390 |
+
|
7391 |
+
var UP = 38;
|
7392 |
+
/**
|
7393 |
+
* Keycode for RIGHT key.
|
7394 |
+
*/
|
7395 |
+
|
7396 |
+
var RIGHT = 39;
|
7397 |
+
/**
|
7398 |
+
* Keycode for DOWN key.
|
7399 |
+
*/
|
7400 |
+
|
7401 |
+
var DOWN = 40;
|
7402 |
+
/**
|
7403 |
+
* Keycode for DELETE key.
|
7404 |
+
*/
|
7405 |
+
|
7406 |
+
var DELETE = 46;
|
7407 |
+
/**
|
7408 |
+
* Keycode for F10 key.
|
7409 |
+
*/
|
7410 |
+
|
7411 |
+
var F10 = 121;
|
7412 |
+
/**
|
7413 |
+
* Keycode for ALT key.
|
7414 |
+
*/
|
7415 |
+
|
7416 |
+
var ALT = 'alt';
|
7417 |
+
/**
|
7418 |
+
* Keycode for CTRL key.
|
7419 |
+
*/
|
7420 |
+
|
7421 |
+
var CTRL = 'ctrl';
|
7422 |
+
/**
|
7423 |
+
* Keycode for COMMAND/META key.
|
7424 |
+
*/
|
7425 |
+
|
7426 |
+
var COMMAND = 'meta';
|
7427 |
+
/**
|
7428 |
+
* Keycode for SHIFT key.
|
7429 |
+
*/
|
7430 |
+
|
7431 |
+
var SHIFT = 'shift';
|
7432 |
+
/**
|
7433 |
+
* Keycode for ZERO key.
|
7434 |
+
*/
|
7435 |
+
|
7436 |
+
var ZERO = 48;
|
7437 |
+
/**
|
7438 |
+
* Object that contains functions that return the available modifier
|
7439 |
+
* depending on platform.
|
7440 |
+
*
|
7441 |
+
* - `primary`: takes a isApple function as a parameter.
|
7442 |
+
* - `primaryShift`: takes a isApple function as a parameter.
|
7443 |
+
* - `primaryAlt`: takes a isApple function as a parameter.
|
7444 |
+
* - `secondary`: takes a isApple function as a parameter.
|
7445 |
+
* - `access`: takes a isApple function as a parameter.
|
7446 |
+
* - `ctrl`
|
7447 |
+
* - `alt`
|
7448 |
+
* - `ctrlShift`
|
7449 |
+
* - `shift`
|
7450 |
+
* - `shiftAlt`
|
7451 |
+
*/
|
7452 |
+
|
7453 |
+
var modifiers = {
|
7454 |
+
primary: function primary(_isApple) {
|
7455 |
+
return _isApple() ? [COMMAND] : [CTRL];
|
7456 |
+
},
|
7457 |
+
primaryShift: function primaryShift(_isApple) {
|
7458 |
+
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
7459 |
+
},
|
7460 |
+
primaryAlt: function primaryAlt(_isApple) {
|
7461 |
+
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
7462 |
+
},
|
7463 |
+
secondary: function secondary(_isApple) {
|
7464 |
+
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
7465 |
+
},
|
7466 |
+
access: function access(_isApple) {
|
7467 |
+
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
7468 |
+
},
|
7469 |
+
ctrl: function ctrl() {
|
7470 |
+
return [CTRL];
|
7471 |
+
},
|
7472 |
+
alt: function alt() {
|
7473 |
+
return [ALT];
|
7474 |
+
},
|
7475 |
+
ctrlShift: function ctrlShift() {
|
7476 |
+
return [CTRL, SHIFT];
|
7477 |
+
},
|
7478 |
+
shift: function shift() {
|
7479 |
+
return [SHIFT];
|
7480 |
+
},
|
7481 |
+
shiftAlt: function shiftAlt() {
|
7482 |
+
return [SHIFT, ALT];
|
7483 |
+
}
|
7484 |
+
};
|
7485 |
+
/**
|
7486 |
+
* An object that contains functions to get raw shortcuts.
|
7487 |
+
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
7488 |
+
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
7489 |
+
*
|
7490 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
|
7491 |
+
*/
|
7492 |
+
|
7493 |
+
var rawShortcut = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
|
7494 |
+
return function (character) {
|
7495 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
7496 |
+
|
7497 |
+
return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
|
7498 |
+
};
|
7499 |
+
});
|
7500 |
+
/**
|
7501 |
+
* Return an array of the parts of a keyboard shortcut chord for display
|
7502 |
+
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
7503 |
+
*
|
7504 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
|
7505 |
+
* sequences.
|
7506 |
+
*/
|
7507 |
+
|
7508 |
+
var displayShortcutList = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
|
7509 |
+
return function (character) {
|
7510 |
+
var _replacementKeyMap;
|
7511 |
+
|
7512 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
7513 |
+
|
7514 |
+
var isApple = _isApple();
|
7515 |
+
|
7516 |
+
var replacementKeyMap = (_replacementKeyMap = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
|
7517 |
+
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
7518 |
+
var replacementKey = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
7519 |
+
|
7520 |
+
if (isApple) {
|
7521 |
+
return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(accumulator), [replacementKey]);
|
7522 |
+
}
|
7523 |
+
|
7524 |
+
return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(accumulator), [replacementKey, '+']);
|
7525 |
+
}, []);
|
7526 |
+
var capitalizedCharacter = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["capitalize"])(character);
|
7527 |
+
return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifierKeys), [capitalizedCharacter]);
|
7528 |
+
};
|
7529 |
+
});
|
7530 |
+
/**
|
7531 |
+
* An object that contains functions to display shortcuts.
|
7532 |
+
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
7533 |
+
*
|
7534 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
|
7535 |
+
* shortcuts.
|
7536 |
+
*/
|
7537 |
+
|
7538 |
+
var displayShortcut = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(displayShortcutList, function (shortcutList) {
|
7539 |
+
return function (character) {
|
7540 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
7541 |
+
|
7542 |
+
return shortcutList(character, _isApple).join('');
|
7543 |
+
};
|
7544 |
+
});
|
7545 |
+
/**
|
7546 |
+
* An object that contains functions to return an aria label for a keyboard shortcut.
|
7547 |
+
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
7548 |
+
*
|
7549 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut ARIA
|
7550 |
+
* labels.
|
7551 |
+
*/
|
7552 |
+
|
7553 |
+
var shortcutAriaLabel = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
|
7554 |
+
return function (character) {
|
7555 |
+
var _replacementKeyMap2;
|
7556 |
+
|
7557 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
7558 |
+
|
7559 |
+
var isApple = _isApple();
|
7560 |
+
|
7561 |
+
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, ',', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Comma')), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, '.', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Period')), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, '`', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Backtick')), _replacementKeyMap2);
|
7562 |
+
return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
|
7563 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["capitalize"])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["get"])(replacementKeyMap, key, key));
|
7564 |
+
}).join(isApple ? ' ' : ' + ');
|
7565 |
+
};
|
7566 |
+
});
|
7567 |
+
/**
|
7568 |
+
* From a given KeyboardEvent, returns an array of active modifier constants for
|
7569 |
+
* the event.
|
7570 |
+
*
|
7571 |
+
* @param {KeyboardEvent} event Keyboard event.
|
7572 |
+
*
|
7573 |
+
* @return {Array<ALT|CTRL|COMMAND|SHIFT>} Active modifier constants.
|
7574 |
+
*/
|
7575 |
+
|
7576 |
+
function getEventModifiers(event) {
|
7577 |
+
return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
|
7578 |
+
return event["".concat(key, "Key")];
|
7579 |
+
});
|
7580 |
+
}
|
7581 |
+
/**
|
7582 |
+
* An object that contains functions to check if a keyboard event matches a
|
7583 |
+
* predefined shortcut combination.
|
7584 |
+
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
7585 |
+
* signals pressing ⌘M.
|
7586 |
+
*
|
7587 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to match events.
|
7588 |
+
*/
|
7589 |
+
|
7590 |
+
|
7591 |
+
var isKeyboardEvent = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (getModifiers) {
|
7592 |
+
return function (event, character) {
|
7593 |
+
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
|
7594 |
+
|
7595 |
+
var mods = getModifiers(_isApple);
|
7596 |
+
var eventMods = getEventModifiers(event);
|
7597 |
+
|
7598 |
+
if (Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["xor"])(mods, eventMods).length) {
|
7599 |
+
return false;
|
7600 |
+
}
|
7601 |
+
|
7602 |
+
if (!character) {
|
7603 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["includes"])(mods, event.key.toLowerCase());
|
7604 |
+
}
|
7605 |
+
|
7606 |
+
return event.key === character;
|
7607 |
+
};
|
7608 |
+
});
|
7609 |
+
//# sourceMappingURL=index.js.map
|
7610 |
|
7611 |
/***/ }),
|
7612 |
+
/* 32 */
|
7613 |
/***/ (function(module, exports, __webpack_require__) {
|
7614 |
|
7615 |
+
"use strict";
|
7616 |
+
/* WEBPACK VAR INJECTION */(function(process) {
|
7617 |
+
|
7618 |
+
Object.defineProperty(exports, "__esModule", {
|
7619 |
value: true
|
7620 |
});
|
7621 |
exports.withStylesPropTypes = exports.css = undefined;
|
7626 |
|
7627 |
exports.withStyles = withStyles;
|
7628 |
|
7629 |
+
var _object = __webpack_require__(24);
|
7630 |
+
|
7631 |
+
var _object2 = _interopRequireDefault(_object);
|
7632 |
+
|
7633 |
+
var _react = __webpack_require__(10);
|
7634 |
|
7635 |
var _react2 = _interopRequireDefault(_react);
|
7636 |
|
7637 |
+
var _propTypes = __webpack_require__(11);
|
7638 |
|
7639 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
7640 |
|
7641 |
+
var _hoistNonReactStatics = __webpack_require__(687);
|
7642 |
|
7643 |
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
7644 |
|
7645 |
+
var _constants = __webpack_require__(688);
|
|
|
|
|
|
|
|
|
7646 |
|
7647 |
+
var _brcast = __webpack_require__(689);
|
7648 |
|
7649 |
var _brcast2 = _interopRequireDefault(_brcast);
|
7650 |
|
7651 |
+
var _ThemedStyleSheet = __webpack_require__(206);
|
7652 |
|
7653 |
var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
|
7654 |
|
7660 |
|
7661 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
7662 |
|
7663 |
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint react/forbid-foreign-prop-types: off */
|
7664 |
|
7665 |
// Add some named exports to assist in upgrading and for convenience
|
7666 |
var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;
|
7675 |
return EMPTY_STYLES;
|
7676 |
};
|
7677 |
|
7678 |
+
var START_MARK = 'react-with-styles.createStyles.start';
|
7679 |
+
var END_MARK = 'react-with-styles.createStyles.end';
|
7680 |
+
|
7681 |
function baseClass(pureComponent) {
|
7682 |
if (pureComponent) {
|
7683 |
if (!_react2['default'].PureComponent) {
|
7734 |
return styleDef;
|
7735 |
}
|
7736 |
|
7737 |
+
if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
|
7738 |
+
performance.clearMarks(START_MARK);
|
7739 |
+
performance.mark(START_MARK);
|
7740 |
}
|
7741 |
|
7742 |
var isRTL = direction === _constants.DIRECTIONS.RTL;
|
7753 |
styleDef = styleDefLTR;
|
7754 |
}
|
7755 |
|
7756 |
+
if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
|
7757 |
+
performance.clearMarks(END_MARK);
|
7758 |
+
performance.mark(END_MARK);
|
7759 |
|
7760 |
+
var measureName = '\uD83D\uDC69\u200D\uD83C\uDFA8 withStyles(' + String(wrappedComponentName) + ') [create styles]';
|
7761 |
+
|
7762 |
+
performance.measure(measureName, START_MARK, END_MARK);
|
7763 |
+
performance.clearMarks(measureName);
|
7764 |
}
|
7765 |
|
7766 |
return styleDef;
|
7857 |
WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';
|
7858 |
WithStyles.contextTypes = contextTypes;
|
7859 |
if (WrappedComponent.propTypes) {
|
7860 |
+
WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes);
|
7861 |
delete WithStyles.propTypes[stylesPropName];
|
7862 |
delete WithStyles.propTypes[themePropName];
|
7863 |
delete WithStyles.propTypes[cssPropName];
|
7864 |
}
|
7865 |
if (WrappedComponent.defaultProps) {
|
7866 |
+
WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps);
|
7867 |
}
|
7868 |
|
7869 |
return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);
|
7872 |
return withStylesHOC;
|
7873 |
}();
|
7874 |
}
|
7875 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
7876 |
|
7877 |
/***/ }),
|
7878 |
+
/* 33 */
|
7879 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7880 |
|
7881 |
"use strict";
|
7882 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _slicedToArray;
|
7883 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__ = __webpack_require__(459);
|
7884 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__ = __webpack_require__(460);
|
7885 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__unsupportedIterableToArray__ = __webpack_require__(145);
|
7886 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__nonIterableRest__ = __webpack_require__(461);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7887 |
|
|
|
7888 |
|
|
|
|
|
|
|
|
|
|
|
7889 |
|
|
|
|
|
|
|
7890 |
|
7891 |
+
function _slicedToArray(arr, i) {
|
7892 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__["a" /* default */])(arr, i) || Object(__WEBPACK_IMPORTED_MODULE_2__unsupportedIterableToArray__["a" /* default */])(arr, i) || Object(__WEBPACK_IMPORTED_MODULE_3__nonIterableRest__["a" /* default */])();
|
7893 |
+
}
|
|
|
7894 |
|
7895 |
/***/ }),
|
7896 |
+
/* 34 */
|
7897 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7898 |
|
7899 |
"use strict";
|
7900 |
/* unused harmony export Button */
|
7901 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(22);
|
7902 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
7903 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(13);
|
7904 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__);
|
7905 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_element__ = __webpack_require__(1);
|
7906 |
|
7907 |
|
7908 |
|
7960 |
//# sourceMappingURL=index.js.map
|
7961 |
|
7962 |
/***/ }),
|
7963 |
+
/* 35 */
|
7964 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7965 |
|
7966 |
"use strict";
|
7967 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
7968 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
7969 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
7970 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
7971 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
7972 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
7973 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
7974 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
|
7975 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(13);
|
7976 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__);
|
7977 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash__ = __webpack_require__(2);
|
7978 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash__);
|
7979 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__tooltip__ = __webpack_require__(116);
|
7980 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__button__ = __webpack_require__(34);
|
7981 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__dashicon__ = __webpack_require__(53);
|
7982 |
|
7983 |
|
7984 |
|
8065 |
//# sourceMappingURL=index.js.map
|
8066 |
|
8067 |
/***/ }),
|
8068 |
+
/* 36 */
|
8069 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8070 |
+
|
8071 |
+
"use strict";
|
8072 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _typeof;
|
8073 |
+
function _typeof(obj) {
|
8074 |
+
"@babel/helpers - typeof";
|
8075 |
+
|
8076 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
8077 |
+
_typeof = function _typeof(obj) {
|
8078 |
+
return typeof obj;
|
8079 |
+
};
|
8080 |
+
} else {
|
8081 |
+
_typeof = function _typeof(obj) {
|
8082 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
8083 |
+
};
|
8084 |
+
}
|
8085 |
+
|
8086 |
+
return _typeof(obj);
|
8087 |
+
}
|
8088 |
+
|
8089 |
+
/***/ }),
|
8090 |
+
/* 37 */
|
8091 |
/***/ (function(module, exports, __webpack_require__) {
|
8092 |
|
8093 |
"use strict";
|
8094 |
|
8095 |
|
8096 |
+
var ES5Type = __webpack_require__(610);
|
8097 |
|
8098 |
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring
|
8099 |
+
|
8100 |
+
module.exports = function Type(x) {
|
8101 |
+
if (typeof x === 'symbol') {
|
8102 |
+
return 'Symbol';
|
8103 |
+
}
|
8104 |
+
return ES5Type(x);
|
8105 |
+
};
|
8106 |
|
8107 |
|
8108 |
/***/ }),
|
8109 |
+
/* 38 */
|
8110 |
/***/ (function(module, exports, __webpack_require__) {
|
8111 |
|
8112 |
+
var moment = __webpack_require__(0);
|
8113 |
+
var momentValidationWrapper = __webpack_require__(655);
|
8114 |
+
var core = __webpack_require__(656);
|
8115 |
|
8116 |
module.exports = {
|
8117 |
|
8152 |
|
8153 |
|
8154 |
/***/ }),
|
8155 |
+
/* 39 */
|
8156 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8157 |
|
8158 |
"use strict";
|
8159 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return select; });
|
8160 |
+
/* unused harmony export __experimentalResolveSelect */
|
8161 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return dispatch; });
|
8162 |
+
/* unused harmony export subscribe */
|
8163 |
+
/* unused harmony export registerGenericStore */
|
8164 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return registerStore; });
|
8165 |
+
/* unused harmony export use */
|
8166 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers__ = __webpack_require__(150);
|
8167 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers__);
|
8168 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__default_registry__ = __webpack_require__(101);
|
8169 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__plugins__ = __webpack_require__(509);
|
8170 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_with_select__ = __webpack_require__(522);
|
8171 |
+
/* unused harmony reexport withSelect */
|
8172 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_with_dispatch__ = __webpack_require__(546);
|
8173 |
+
/* unused harmony reexport withDispatch */
|
8174 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_with_registry__ = __webpack_require__(549);
|
8175 |
+
/* unused harmony reexport withRegistry */
|
8176 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_registry_provider__ = __webpack_require__(163);
|
8177 |
+
/* unused harmony reexport RegistryProvider */
|
8178 |
+
/* unused harmony reexport RegistryConsumer */
|
8179 |
+
/* unused harmony reexport useRegistry */
|
8180 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_use_select__ = __webpack_require__(158);
|
8181 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_7__components_use_select__["a"]; });
|
8182 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__components_use_dispatch__ = __webpack_require__(162);
|
8183 |
+
/* unused harmony reexport useDispatch */
|
8184 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_8__components_use_dispatch__["a"]; });
|
8185 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_async_mode_provider__ = __webpack_require__(550);
|
8186 |
+
/* unused harmony reexport AsyncModeProvider */
|
8187 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__registry__ = __webpack_require__(151);
|
8188 |
+
/* unused harmony reexport createRegistry */
|
8189 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__factory__ = __webpack_require__(551);
|
8190 |
+
/* unused harmony reexport createRegistrySelector */
|
8191 |
+
/* unused harmony reexport createRegistryControl */
|
8192 |
+
/* unused harmony reexport plugins */
|
8193 |
+
/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers___default.a; });
|
8194 |
+
/**
|
8195 |
+
* External dependencies
|
8196 |
+
*/
|
8197 |
+
|
8198 |
+
/**
|
8199 |
+
* Internal dependencies
|
8200 |
+
*/
|
8201 |
+
|
8202 |
+
|
8203 |
+
|
8204 |
+
|
8205 |
+
|
8206 |
+
|
8207 |
+
|
8208 |
|
|
|
|
|
8209 |
|
|
|
|
|
|
|
8210 |
|
|
|
|
|
|
|
|
|
8211 |
|
8212 |
|
8213 |
/**
|
8214 |
+
* Object of available plugins to use with a registry.
|
8215 |
+
*
|
8216 |
+
* @see [use](#use)
|
8217 |
+
*
|
8218 |
+
* @type {Object}
|
8219 |
*/
|
8220 |
|
8221 |
|
8222 |
+
/**
|
8223 |
+
* The combineReducers helper function turns an object whose values are different
|
8224 |
+
* reducing functions into a single reducing function you can pass to registerReducer.
|
8225 |
+
*
|
8226 |
+
* @param {Object} reducers An object whose values correspond to different reducing
|
8227 |
+
* functions that need to be combined into one.
|
8228 |
+
*
|
8229 |
+
* @example
|
8230 |
+
* ```js
|
8231 |
+
* const { combineReducers, registerStore } = wp.data;
|
8232 |
+
*
|
8233 |
+
* const prices = ( state = {}, action ) => {
|
8234 |
+
* return action.type === 'SET_PRICE' ?
|
8235 |
+
* {
|
8236 |
+
* ...state,
|
8237 |
+
* [ action.item ]: action.price,
|
8238 |
+
* } :
|
8239 |
+
* state;
|
8240 |
+
* };
|
8241 |
+
*
|
8242 |
+
* const discountPercent = ( state = 0, action ) => {
|
8243 |
+
* return action.type === 'START_SALE' ?
|
8244 |
+
* action.discountPercent :
|
8245 |
+
* state;
|
8246 |
+
* };
|
8247 |
+
*
|
8248 |
+
* registerStore( 'my-shop', {
|
8249 |
+
* reducer: combineReducers( {
|
8250 |
+
* prices,
|
8251 |
+
* discountPercent,
|
8252 |
+
* } ),
|
8253 |
+
* } );
|
8254 |
+
* ```
|
8255 |
+
*
|
8256 |
+
* @return {Function} A reducer that invokes every reducer inside the reducers
|
8257 |
+
* object, and constructs a state object with the same shape.
|
8258 |
+
*/
|
8259 |
+
|
8260 |
+
|
8261 |
+
/**
|
8262 |
+
* Given the name of a registered store, returns an object of the store's selectors.
|
8263 |
+
* The selector functions are been pre-bound to pass the current state automatically.
|
8264 |
+
* As a consumer, you need only pass arguments of the selector, if applicable.
|
8265 |
+
*
|
8266 |
+
* @param {string} name Store name.
|
8267 |
+
*
|
8268 |
+
* @example
|
8269 |
+
* ```js
|
8270 |
+
* const { select } = wp.data;
|
8271 |
+
*
|
8272 |
+
* select( 'my-shop' ).getPrice( 'hammer' );
|
8273 |
+
* ```
|
8274 |
+
*
|
8275 |
+
* @return {Object} Object containing the store's selectors.
|
8276 |
+
*/
|
8277 |
+
|
8278 |
+
var select = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].select;
|
8279 |
+
/**
|
8280 |
+
* Given the name of a registered store, returns an object containing the store's
|
8281 |
+
* selectors pre-bound to state so that you only need to supply additional arguments,
|
8282 |
+
* and modified so that they return promises that resolve to their eventual values,
|
8283 |
+
* after any resolvers have ran.
|
8284 |
+
*
|
8285 |
+
* @param {string} name Store name.
|
8286 |
+
*
|
8287 |
+
* @example
|
8288 |
+
* ```js
|
8289 |
+
* const { __experimentalResolveSelect } = wp.data;
|
8290 |
+
*
|
8291 |
+
* __experimentalResolveSelect( 'my-shop' ).getPrice( 'hammer' ).then(console.log)
|
8292 |
+
* ```
|
8293 |
+
*
|
8294 |
+
* @return {Object} Object containing the store's promise-wrapped selectors.
|
8295 |
+
*/
|
8296 |
+
|
8297 |
+
var __experimentalResolveSelect = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].__experimentalResolveSelect;
|
8298 |
+
/**
|
8299 |
+
* Given the name of a registered store, returns an object of the store's action creators.
|
8300 |
+
* Calling an action creator will cause it to be dispatched, updating the state value accordingly.
|
8301 |
+
*
|
8302 |
+
* Note: Action creators returned by the dispatch will return a promise when
|
8303 |
+
* they are called.
|
8304 |
+
*
|
8305 |
+
* @param {string} name Store name.
|
8306 |
+
*
|
8307 |
+
* @example
|
8308 |
+
* ```js
|
8309 |
+
* const { dispatch } = wp.data;
|
8310 |
+
*
|
8311 |
+
* dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
|
8312 |
+
* ```
|
8313 |
+
* @return {Object} Object containing the action creators.
|
8314 |
+
*/
|
8315 |
+
|
8316 |
+
var dispatch = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].dispatch;
|
8317 |
+
/**
|
8318 |
+
* Given a listener function, the function will be called any time the state value
|
8319 |
+
* of one of the registered stores has changed. This function returns a `unsubscribe`
|
8320 |
+
* function used to stop the subscription.
|
8321 |
+
*
|
8322 |
+
* @param {Function} listener Callback function.
|
8323 |
+
*
|
8324 |
+
* @example
|
8325 |
+
* ```js
|
8326 |
+
* const { subscribe } = wp.data;
|
8327 |
+
*
|
8328 |
+
* const unsubscribe = subscribe( () => {
|
8329 |
+
* // You could use this opportunity to test whether the derived result of a
|
8330 |
+
* // selector has subsequently changed as the result of a state update.
|
8331 |
+
* } );
|
8332 |
+
*
|
8333 |
+
* // Later, if necessary...
|
8334 |
+
* unsubscribe();
|
8335 |
+
* ```
|
8336 |
+
*/
|
8337 |
+
|
8338 |
+
var subscribe = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].subscribe;
|
8339 |
+
/**
|
8340 |
+
* Registers a generic store.
|
8341 |
+
*
|
8342 |
+
* @param {string} key Store registry key.
|
8343 |
+
* @param {Object} config Configuration (getSelectors, getActions, subscribe).
|
8344 |
+
*/
|
8345 |
+
|
8346 |
+
var registerGenericStore = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].registerGenericStore;
|
8347 |
+
/**
|
8348 |
+
* Registers a standard `@wordpress/data` store.
|
8349 |
+
*
|
8350 |
+
* @param {string} reducerKey Reducer key.
|
8351 |
+
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
|
8352 |
+
*
|
8353 |
+
* @return {Object} Registered store object.
|
8354 |
+
*/
|
8355 |
+
|
8356 |
+
var registerStore = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].registerStore;
|
8357 |
+
/**
|
8358 |
+
* Extends a registry to inherit functionality provided by a given plugin. A
|
8359 |
+
* plugin is an object with properties aligning to that of a registry, merged
|
8360 |
+
* to extend the default registry behavior.
|
8361 |
+
*
|
8362 |
+
* @param {Object} plugin Plugin object.
|
8363 |
+
*/
|
8364 |
+
|
8365 |
+
var use = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].use;
|
8366 |
+
//# sourceMappingURL=index.js.map
|
8367 |
+
|
8368 |
+
/***/ }),
|
8369 |
+
/* 40 */
|
8370 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8371 |
+
|
8372 |
+
"use strict";
|
8373 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(1);
|
8374 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames__ = __webpack_require__(13);
|
8375 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_classnames__);
|
8376 |
+
|
8377 |
+
|
8378 |
+
/**
|
8379 |
+
* External dependencies
|
8380 |
+
*/
|
8381 |
+
|
8382 |
+
|
8383 |
+
function BaseControl(_ref) {
|
8384 |
+
var id = _ref.id,
|
8385 |
+
label = _ref.label,
|
8386 |
+
help = _ref.help,
|
8387 |
+
className = _ref.className,
|
8388 |
+
children = _ref.children;
|
8389 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("div", {
|
8390 |
+
className: __WEBPACK_IMPORTED_MODULE_1_classnames___default()('components-base-control', className)
|
8391 |
+
}, Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("div", {
|
8392 |
+
className: "components-base-control__field"
|
8393 |
+
}, label && id && Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("label", {
|
8394 |
+
className: "components-base-control__label",
|
8395 |
htmlFor: id
|
8396 |
}, label), label && !id && Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("span", {
|
8397 |
className: "components-base-control__label"
|
8405 |
//# sourceMappingURL=index.js.map
|
8406 |
|
8407 |
/***/ }),
|
8408 |
+
/* 41 */
|
8409 |
+
/***/ (function(module, exports, __webpack_require__) {
|
8410 |
+
|
8411 |
+
"use strict";
|
8412 |
+
|
8413 |
+
|
8414 |
+
var bind = __webpack_require__(83);
|
8415 |
+
|
8416 |
+
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
|
8417 |
+
|
8418 |
+
|
8419 |
+
/***/ }),
|
8420 |
+
/* 42 */
|
8421 |
+
/***/ (function(module, exports, __webpack_require__) {
|
8422 |
+
|
8423 |
+
"use strict";
|
8424 |
+
/* WEBPACK VAR INJECTION */(function(process) {
|
8425 |
+
|
8426 |
+
function checkDCE() {
|
8427 |
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
8428 |
+
if (
|
8429 |
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
|
8430 |
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
|
8431 |
+
) {
|
8432 |
+
return;
|
8433 |
+
}
|
8434 |
+
if (process.env.NODE_ENV !== 'production') {
|
8435 |
+
// This branch is unreachable because this function is only called
|
8436 |
+
// in production, but the condition is true only in development.
|
8437 |
+
// Therefore if the branch is still here, dead code elimination wasn't
|
8438 |
+
// properly applied.
|
8439 |
+
// Don't change the message. React DevTools relies on it. Also make sure
|
8440 |
+
// this message doesn't occur elsewhere in this function, or it will cause
|
8441 |
+
// a false positive.
|
8442 |
+
throw new Error('^_^');
|
8443 |
+
}
|
8444 |
+
try {
|
8445 |
+
// Verify that the code above has been dead code eliminated (DCE'd).
|
8446 |
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
8447 |
+
} catch (err) {
|
8448 |
+
// DevTools shouldn't crash React, no matter what.
|
8449 |
+
// We should still report in case we break this code.
|
8450 |
+
console.error(err);
|
8451 |
+
}
|
8452 |
+
}
|
8453 |
+
|
8454 |
+
if (process.env.NODE_ENV === 'production') {
|
8455 |
+
// DCE check should happen before ReactDOM bundle executes so that
|
8456 |
+
// DevTools can report bad minification during injection.
|
8457 |
+
checkDCE();
|
8458 |
+
module.exports = __webpack_require__(432);
|
8459 |
+
} else {
|
8460 |
+
module.exports = __webpack_require__(435);
|
8461 |
+
}
|
8462 |
+
|
8463 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
8464 |
+
|
8465 |
+
/***/ }),
|
8466 |
+
/* 43 */
|
8467 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8468 |
|
8469 |
"use strict";
|
8499 |
//# sourceMappingURL=index.js.map
|
8500 |
|
8501 |
/***/ }),
|
8502 |
+
/* 44 */
|
8503 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8504 |
|
8505 |
"use strict";
|
8506 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
|
8507 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
|
8508 |
+
/**
|
8509 |
+
* External dependencies
|
8510 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8511 |
|
8512 |
+
/**
|
8513 |
+
* Given a function mapping a component to an enhanced component and modifier
|
8514 |
+
* name, returns the enhanced component augmented with a generated displayName.
|
8515 |
+
*
|
8516 |
+
* @param {Function} mapComponentToEnhancedComponent Function mapping component
|
8517 |
+
* to enhanced component.
|
8518 |
+
* @param {string} modifierName Seed name from which to
|
8519 |
+
* generated display name.
|
8520 |
+
*
|
8521 |
+
* @return {WPComponent} Component class with generated display name assigned.
|
8522 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8523 |
|
8524 |
+
function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
|
8525 |
+
return function (OriginalComponent) {
|
8526 |
+
var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
|
8527 |
+
var _OriginalComponent$di = OriginalComponent.displayName,
|
8528 |
+
displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
|
8529 |
+
EnhancedComponent.displayName = "".concat(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["upperFirst"])(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["camelCase"])(modifierName)), "(").concat(displayName, ")");
|
8530 |
+
return EnhancedComponent;
|
8531 |
+
};
|
8532 |
+
}
|
8533 |
|
8534 |
+
/* harmony default export */ __webpack_exports__["a"] = (createHigherOrderComponent);
|
8535 |
//# sourceMappingURL=index.js.map
|
8536 |
|
8537 |
/***/ }),
|
8538 |
+
/* 45 */
|
8539 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8540 |
+
|
8541 |
+
"use strict";
|
8542 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = getLineIndex;
|
8543 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(29);
|
8544 |
+
/**
|
8545 |
+
* Internal dependencies
|
8546 |
+
*/
|
8547 |
+
|
8548 |
+
/**
|
8549 |
+
* Gets the currently selected line index, or the first line index if the
|
8550 |
+
* selection spans over multiple items.
|
8551 |
+
*
|
8552 |
+
* @param {Object} value Value to get the line index from.
|
8553 |
+
* @param {boolean} startIndex Optional index that should be contained by the
|
8554 |
+
* line. Defaults to the selection start of the
|
8555 |
+
* value.
|
8556 |
+
*
|
8557 |
+
* @return {?boolean} The line index. Undefined if not found.
|
8558 |
+
*/
|
8559 |
+
|
8560 |
+
function getLineIndex(_ref) {
|
8561 |
+
var start = _ref.start,
|
8562 |
+
text = _ref.text;
|
8563 |
+
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
|
8564 |
+
var index = startIndex;
|
8565 |
+
|
8566 |
+
while (index--) {
|
8567 |
+
if (text[index] === __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
|
8568 |
+
return index;
|
8569 |
+
}
|
8570 |
+
}
|
8571 |
+
}
|
8572 |
+
//# sourceMappingURL=get-line-index.js.map
|
8573 |
+
|
8574 |
+
/***/ }),
|
8575 |
+
/* 46 */
|
8576 |
/***/ (function(module, exports, __webpack_require__) {
|
8577 |
|
8578 |
"use strict";
|
8579 |
|
8580 |
|
8581 |
+
var GetIntrinsic = __webpack_require__(19);
|
8582 |
|
8583 |
+
var callBind = __webpack_require__(54);
|
8584 |
+
|
8585 |
+
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
8586 |
+
|
8587 |
+
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
8588 |
+
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
8589 |
+
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
|
8590 |
+
return callBind(intrinsic);
|
8591 |
+
}
|
8592 |
+
return intrinsic;
|
8593 |
+
};
|
8594 |
|
8595 |
|
8596 |
/***/ }),
|
8597 |
+
/* 47 */
|
8598 |
/***/ (function(module, exports, __webpack_require__) {
|
8599 |
|
8600 |
+
"use strict";
|
8601 |
+
|
8602 |
+
|
8603 |
Object.defineProperty(exports, "__esModule", {
|
8604 |
value: true
|
8605 |
});
|
8606 |
+
exports["default"] = andValidator;
|
|
|
|
|
8607 |
|
8608 |
+
var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
|
8609 |
|
8610 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
8611 |
|
8612 |
function andValidator(validators) {
|
8613 |
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and';
|
8615 |
if (!Array.isArray(validators)) {
|
8616 |
throw new TypeError('and: 2 or more validators are required');
|
8617 |
}
|
8618 |
+
|
8619 |
if (validators.length <= 1) {
|
8620 |
throw new RangeError('and: 2 or more validators are required');
|
8621 |
}
|
8622 |
|
8623 |
+
var validator = function and() {
|
8624 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
8625 |
+
args[_key] = arguments[_key];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8626 |
}
|
8627 |
|
8628 |
+
var firstError = null;
|
8629 |
+
validators.some(function (validatorFn) {
|
8630 |
+
firstError = validatorFn.apply(void 0, args);
|
8631 |
+
return firstError != null;
|
8632 |
+
});
|
8633 |
+
return firstError == null ? null : firstError;
|
8634 |
+
};
|
|
|
8635 |
|
8636 |
+
validator.isRequired = function andIsRequired() {
|
8637 |
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
8638 |
+
args[_key2] = arguments[_key2];
|
|
|
|
|
|
|
8639 |
}
|
8640 |
|
8641 |
+
var firstError = null;
|
8642 |
+
validators.some(function (validatorFn) {
|
8643 |
+
firstError = validatorFn.isRequired.apply(validatorFn, args);
|
8644 |
+
return firstError != null;
|
8645 |
+
});
|
8646 |
+
return firstError == null ? null : firstError;
|
8647 |
+
};
|
8648 |
|
8649 |
+
return (0, _wrapValidator["default"])(validator, name, validators);
|
8650 |
}
|
8651 |
//# sourceMappingURL=and.js.map
|
8652 |
|
8653 |
/***/ }),
|
8654 |
+
/* 48 */
|
8655 |
/***/ (function(module, exports, __webpack_require__) {
|
8656 |
|
8657 |
"use strict";
|
8661 |
value: true
|
8662 |
});
|
8663 |
|
8664 |
+
var _propTypes = __webpack_require__(11);
|
8665 |
|
8666 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
8667 |
|
8668 |
+
var _constants = __webpack_require__(17);
|
8669 |
|
8670 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8671 |
|
8672 |
exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
|
8673 |
|
8674 |
/***/ }),
|
8675 |
+
/* 49 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8676 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8677 |
|
8678 |
"use strict";
|
8679 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__primitives__ = __webpack_require__(75);
|
8680 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__primitives__["c"]; });
|
8681 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autocomplete__ = __webpack_require__(443);
|
8682 |
/* unused harmony reexport Autocomplete */
|
8683 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_control__ = __webpack_require__(40);
|
8684 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__base_control__["a"]; });
|
8685 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__button__ = __webpack_require__(34);
|
8686 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__button__["a"]; });
|
8687 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__button_group__ = __webpack_require__(588);
|
8688 |
/* unused harmony reexport ButtonGroup */
|
8689 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__checkbox_control__ = __webpack_require__(589);
|
8690 |
/* unused harmony reexport CheckboxControl */
|
8691 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__clipboard_button__ = __webpack_require__(590);
|
8692 |
/* unused harmony reexport ClipboardButton */
|
8693 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__color_indicator__ = __webpack_require__(592);
|
8694 |
/* unused harmony reexport ColorIndicator */
|
8695 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__color_palette__ = __webpack_require__(593);
|
8696 |
/* unused harmony reexport ColorPalette */
|
8697 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__color_picker__ = __webpack_require__(187);
|
8698 |
/* unused harmony reexport ColorPicker */
|
8699 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__dashicon__ = __webpack_require__(53);
|
8700 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_10__dashicon__["a"]; });
|
8701 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__date_time__ = __webpack_require__(599);
|
8702 |
/* unused harmony reexport DateTimePicker */
|
8703 |
/* unused harmony reexport DatePicker */
|
8704 |
/* unused harmony reexport TimePicker */
|
8705 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__disabled__ = __webpack_require__(727);
|
8706 |
/* unused harmony reexport Disabled */
|
8707 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__draggable__ = __webpack_require__(728);
|
8708 |
/* unused harmony reexport Draggable */
|
8709 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__drop_zone__ = __webpack_require__(729);
|
8710 |
/* unused harmony reexport DropZone */
|
8711 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__drop_zone_provider__ = __webpack_require__(399);
|
8712 |
/* unused harmony reexport DropZoneProvider */
|
8713 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__dropdown__ = __webpack_require__(82);
|
8714 |
/* unused harmony reexport Dropdown */
|
8715 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__dropdown_menu__ = __webpack_require__(400);
|
8716 |
/* unused harmony reexport DropdownMenu */
|
8717 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__external_link__ = __webpack_require__(732);
|
8718 |
/* unused harmony reexport ExternalLink */
|
8719 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__focusable_iframe__ = __webpack_require__(402);
|
8720 |
/* unused harmony reexport FocusableIframe */
|
8721 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__font_size_picker__ = __webpack_require__(733);
|
8722 |
/* unused harmony reexport FontSizePicker */
|
8723 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__form_file_upload__ = __webpack_require__(734);
|
8724 |
/* unused harmony reexport FormFileUpload */
|
8725 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__form_toggle__ = __webpack_require__(404);
|
8726 |
/* unused harmony reexport FormToggle */
|
8727 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__form_token_field__ = __webpack_require__(735);
|
8728 |
/* unused harmony reexport FormTokenField */
|
8729 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__icon__ = __webpack_require__(405);
|
8730 |
/* unused harmony reexport Icon */
|
8731 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__icon_button__ = __webpack_require__(35);
|
8732 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_25__icon_button__["a"]; });
|
8733 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__keyboard_shortcuts__ = __webpack_require__(65);
|
8734 |
/* unused harmony reexport KeyboardShortcuts */
|
8735 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__menu_group__ = __webpack_require__(742);
|
8736 |
/* unused harmony reexport MenuGroup */
|
8737 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__menu_item__ = __webpack_require__(406);
|
8738 |
/* unused harmony reexport MenuItem */
|
8739 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__menu_items_choice__ = __webpack_require__(743);
|
8740 |
/* unused harmony reexport MenuItemsChoice */
|
8741 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__modal__ = __webpack_require__(744);
|
8742 |
/* unused harmony reexport Modal */
|
8743 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__scroll_lock__ = __webpack_require__(184);
|
8744 |
/* unused harmony reexport ScrollLock */
|
8745 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__navigable_container__ = __webpack_require__(73);
|
8746 |
/* unused harmony reexport NavigableMenu */
|
8747 |
/* unused harmony reexport TabbableContainer */
|
8748 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__notice__ = __webpack_require__(407);
|
8749 |
/* unused harmony reexport Notice */
|
8750 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__notice_list__ = __webpack_require__(408);
|
8751 |
/* unused harmony reexport NoticeList */
|
8752 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__panel__ = __webpack_require__(748);
|
8753 |
/* unused harmony reexport Panel */
|
8754 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__panel_body__ = __webpack_require__(749);
|
8755 |
/* unused harmony reexport PanelBody */
|
8756 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__panel_header__ = __webpack_require__(409);
|
8757 |
/* unused harmony reexport PanelHeader */
|
8758 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__panel_row__ = __webpack_require__(750);
|
8759 |
/* unused harmony reexport PanelRow */
|
8760 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__placeholder__ = __webpack_require__(410);
|
8761 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_39__placeholder__["a"]; });
|
8762 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__popover__ = __webpack_require__(81);
|
8763 |
/* unused harmony reexport Popover */
|
8764 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__query_controls__ = __webpack_require__(751);
|
8765 |
/* unused harmony reexport QueryControls */
|
8766 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__radio_control__ = __webpack_require__(754);
|
8767 |
/* unused harmony reexport RadioControl */
|
8768 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__range_control__ = __webpack_require__(403);
|
8769 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_43__range_control__["a"]; });
|
8770 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__resizable_box__ = __webpack_require__(755);
|
8771 |
/* unused harmony reexport ResizableBox */
|
8772 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__responsive_wrapper__ = __webpack_require__(757);
|
8773 |
/* unused harmony reexport ResponsiveWrapper */
|
8774 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__sandbox__ = __webpack_require__(758);
|
8775 |
/* unused harmony reexport SandBox */
|
8776 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__select_control__ = __webpack_require__(759);
|
8777 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_47__select_control__["a"]; });
|
8778 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__spinner__ = __webpack_require__(412);
|
8779 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_48__spinner__["a"]; });
|
8780 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__server_side_render__ = __webpack_require__(760);
|
8781 |
/* unused harmony reexport ServerSideRender */
|
8782 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__tab_panel__ = __webpack_require__(792);
|
8783 |
/* unused harmony reexport TabPanel */
|
8784 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__text_control__ = __webpack_require__(188);
|
8785 |
/* unused harmony reexport TextControl */
|
8786 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__textarea_control__ = __webpack_require__(793);
|
8787 |
/* unused harmony reexport TextareaControl */
|
8788 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__toggle_control__ = __webpack_require__(794);
|
8789 |
/* unused harmony reexport ToggleControl */
|
8790 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__toolbar__ = __webpack_require__(795);
|
8791 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_54__toolbar__["a"]; });
|
8792 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__toolbar_button__ = __webpack_require__(418);
|
8793 |
/* unused harmony reexport ToolbarButton */
|
8794 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__tooltip__ = __webpack_require__(116);
|
8795 |
/* unused harmony reexport Tooltip */
|
8796 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__tree_select__ = __webpack_require__(411);
|
8797 |
/* unused harmony reexport TreeSelect */
|
8798 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__isolated_event_container__ = __webpack_require__(117);
|
8799 |
/* unused harmony reexport IsolatedEventContainer */
|
8800 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__slot_fill__ = __webpack_require__(185);
|
8801 |
/* unused harmony reexport createSlotFill */
|
8802 |
/* unused harmony reexport Slot */
|
8803 |
/* unused harmony reexport Fill */
|
8804 |
/* unused harmony reexport SlotFillProvider */
|
8805 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__higher_order_navigate_regions__ = __webpack_require__(798);
|
8806 |
/* unused harmony reexport navigateRegions */
|
8807 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__higher_order_with_constrained_tabbing__ = __webpack_require__(115);
|
8808 |
/* unused harmony reexport withConstrainedTabbing */
|
8809 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__higher_order_with_fallback_styles__ = __webpack_require__(799);
|
8810 |
/* unused harmony reexport withFallbackStyles */
|
8811 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__higher_order_with_filters__ = __webpack_require__(800);
|
8812 |
/* unused harmony reexport withFilters */
|
8813 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__higher_order_with_focus_outside__ = __webpack_require__(180);
|
8814 |
/* unused harmony reexport withFocusOutside */
|
8815 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__higher_order_with_focus_return__ = __webpack_require__(114);
|
8816 |
/* unused harmony reexport withFocusReturn */
|
8817 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__higher_order_with_notices__ = __webpack_require__(801);
|
8818 |
/* unused harmony reexport withNotices */
|
8819 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__higher_order_with_spoken_messages__ = __webpack_require__(119);
|
8820 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_67__higher_order_with_spoken_messages__["a"]; });
|
8821 |
// Components
|
8822 |
// eslint-disable-next-line camelcase
|
8892 |
//# sourceMappingURL=index.js.map
|
8893 |
|
8894 |
/***/ }),
|
8895 |
+
/* 50 */
|
8896 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8897 |
|
8898 |
"use strict";
|
8899 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = normaliseFormats;
|
8900 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
8901 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_format_equal__ = __webpack_require__(107);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8902 |
|
8903 |
|
8904 |
+
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
8905 |
|
8906 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
|
|
|
|
8907 |
|
|
|
|
|
|
|
8908 |
/**
|
8909 |
* Internal dependencies
|
8910 |
*/
|
8911 |
|
8912 |
/**
|
8913 |
+
* Normalises formats: ensures subsequent adjacent equal formats have the same
|
8914 |
+
* reference.
|
8915 |
*
|
8916 |
+
* @param {Object} value Value to normalise formats of.
|
8917 |
*
|
8918 |
* @return {Object} New value with normalised formats.
|
8919 |
*/
|
8920 |
|
8921 |
+
function normaliseFormats(value) {
|
8922 |
+
var newFormats = value.formats.slice();
|
|
|
|
|
|
|
|
|
8923 |
newFormats.forEach(function (formatsAtIndex, index) {
|
8924 |
+
var formatsAtPreviousIndex = newFormats[index - 1];
|
8925 |
|
8926 |
+
if (formatsAtPreviousIndex) {
|
8927 |
+
var newFormatsAtIndex = formatsAtIndex.slice();
|
8928 |
newFormatsAtIndex.forEach(function (format, formatIndex) {
|
8929 |
+
var previousFormat = formatsAtPreviousIndex[formatIndex];
|
8930 |
|
8931 |
+
if (Object(__WEBPACK_IMPORTED_MODULE_1__is_format_equal__["a" /* isFormatEqual */])(format, previousFormat)) {
|
8932 |
+
newFormatsAtIndex[formatIndex] = previousFormat;
|
8933 |
}
|
8934 |
});
|
8935 |
newFormats[index] = newFormatsAtIndex;
|
8936 |
}
|
8937 |
});
|
8938 |
+
return _objectSpread({}, value, {
|
8939 |
+
formats: newFormats
|
8940 |
+
});
|
|
|
|
|
|
|
8941 |
}
|
8942 |
//# sourceMappingURL=normalise-formats.js.map
|
8943 |
|
8944 |
/***/ }),
|
8945 |
+
/* 51 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8946 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8947 |
|
8948 |
"use strict";
|
8949 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = create;
|
8950 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
8951 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(23);
|
8952 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_typeof__ = __webpack_require__(36);
|
8953 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_data__ = __webpack_require__(39);
|
8954 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__is_format_equal__ = __webpack_require__(107);
|
8955 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__create_element__ = __webpack_require__(108);
|
8956 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__concat__ = __webpack_require__(165);
|
8957 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__special_characters__ = __webpack_require__(29);
|
|
|
8958 |
|
8959 |
|
8960 |
|
8961 |
|
8962 |
+
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; }
|
8963 |
|
8964 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
|
|
|
|
|
|
|
|
|
|
8965 |
|
8966 |
/**
|
8967 |
* WordPress dependencies
|
8973 |
|
8974 |
|
8975 |
|
|
|
|
|
|
|
|
|
8976 |
|
|
|
|
|
8977 |
|
|
|
|
|
8978 |
|
8979 |
+
function createEmptyValue() {
|
8980 |
+
return {
|
8981 |
+
formats: [],
|
8982 |
+
replacements: [],
|
8983 |
+
text: ''
|
8984 |
+
};
|
8985 |
+
}
|
8986 |
+
|
8987 |
+
function simpleFindKey(object, value) {
|
8988 |
+
for (var key in object) {
|
8989 |
+
if (object[key] === value) {
|
8990 |
+
return key;
|
8991 |
}
|
8992 |
+
}
|
8993 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8994 |
|
8995 |
+
function toFormat(_ref) {
|
8996 |
+
var type = _ref.type,
|
8997 |
+
attributes = _ref.attributes;
|
8998 |
+
var formatType;
|
8999 |
|
9000 |
+
if (attributes && attributes.class) {
|
9001 |
+
formatType = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_data__["e" /* select */])('core/rich-text').getFormatTypeForClassName(attributes.class);
|
|
|
9002 |
|
9003 |
+
if (formatType) {
|
9004 |
+
// Preserve any additional classes.
|
9005 |
+
attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
|
9006 |
|
9007 |
+
if (!attributes.class) {
|
9008 |
+
delete attributes.class;
|
9009 |
+
}
|
9010 |
+
}
|
9011 |
+
}
|
9012 |
|
9013 |
+
if (!formatType) {
|
9014 |
+
formatType = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_data__["e" /* select */])('core/rich-text').getFormatTypeForBareElement(type);
|
9015 |
+
}
|
9016 |
|
9017 |
+
if (!formatType) {
|
9018 |
+
return attributes ? {
|
9019 |
+
type: type,
|
9020 |
+
attributes: attributes
|
9021 |
+
} : {
|
9022 |
+
type: type
|
9023 |
+
};
|
9024 |
+
}
|
9025 |
|
9026 |
+
if (formatType.__experimentalCreatePrepareEditableTree && !formatType.__experimentalCreateOnChangeEditableValue) {
|
9027 |
+
return null;
|
9028 |
+
}
|
9029 |
|
9030 |
+
if (!attributes) {
|
9031 |
+
return {
|
9032 |
+
type: formatType.name
|
9033 |
+
};
|
9034 |
+
}
|
9035 |
|
9036 |
+
var registeredAttributes = {};
|
9037 |
+
var unregisteredAttributes = {};
|
9038 |
+
|
9039 |
+
for (var name in attributes) {
|
9040 |
+
var key = simpleFindKey(formatType.attributes, name);
|
9041 |
+
|
9042 |
+
if (key) {
|
9043 |
+
registeredAttributes[key] = attributes[name];
|
9044 |
+
} else {
|
9045 |
+
unregisteredAttributes[name] = attributes[name];
|
9046 |
+
}
|
9047 |
+
}
|
9048 |
+
|
9049 |
+
return {
|
9050 |
+
type: formatType.name,
|
9051 |
+
attributes: registeredAttributes,
|
9052 |
+
unregisteredAttributes: unregisteredAttributes
|
9053 |
+
};
|
9054 |
+
}
|
9055 |
+
/**
|
9056 |
+
* Create a RichText value from an `Element` tree (DOM), an HTML string or a
|
9057 |
+
* plain text string, with optionally a `Range` object to set the selection. If
|
9058 |
+
* called without any input, an empty value will be created. If
|
9059 |
+
* `multilineTag` is provided, any content of direct children whose type matches
|
9060 |
+
* `multilineTag` will be separated by two newlines. The optional functions can
|
9061 |
+
* be used to filter out content.
|
9062 |
+
*
|
9063 |
+
* A value will have the following shape, which you are strongly encouraged not
|
9064 |
+
* to modify without the use of helper functions:
|
9065 |
+
*
|
9066 |
+
* ```js
|
9067 |
+
* {
|
9068 |
+
* text: string,
|
9069 |
+
* formats: Array,
|
9070 |
+
* replacements: Array,
|
9071 |
+
* ?start: number,
|
9072 |
+
* ?end: number,
|
9073 |
+
* }
|
9074 |
+
* ```
|
9075 |
+
*
|
9076 |
+
* As you can see, text and formatting are separated. `text` holds the text,
|
9077 |
+
* including any replacement characters for objects and lines. `formats`,
|
9078 |
+
* `objects` and `lines` are all sparse arrays of the same length as `text`. It
|
9079 |
+
* holds information about the formatting at the relevant text indices. Finally
|
9080 |
+
* `start` and `end` state which text indices are selected. They are only
|
9081 |
+
* provided if a `Range` was given.
|
9082 |
+
*
|
9083 |
+
* @param {Object} [$1] Optional named arguments.
|
9084 |
+
* @param {Element} [$1.element] Element to create value from.
|
9085 |
+
* @param {string} [$1.text] Text to create value from.
|
9086 |
+
* @param {string} [$1.html] HTML to create value from.
|
9087 |
+
* @param {Range} [$1.range] Range to create value from.
|
9088 |
+
* @param {string} [$1.multilineTag] Multiline tag if the structure is
|
9089 |
+
* multiline.
|
9090 |
+
* @param {Array} [$1.multilineWrapperTags] Tags where lines can be found if
|
9091 |
+
* nesting is possible.
|
9092 |
+
* @param {?boolean} [$1.preserveWhiteSpace] Whether or not to collapse white
|
9093 |
+
* space characters.
|
9094 |
+
*
|
9095 |
+
* @return {Object} A rich text value.
|
9096 |
+
*/
|
9097 |
+
|
9098 |
+
|
9099 |
+
function create() {
|
9100 |
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
9101 |
+
element = _ref2.element,
|
9102 |
+
text = _ref2.text,
|
9103 |
+
html = _ref2.html,
|
9104 |
+
range = _ref2.range,
|
9105 |
+
multilineTag = _ref2.multilineTag,
|
9106 |
+
multilineWrapperTags = _ref2.multilineWrapperTags,
|
9107 |
+
isEditableTree = _ref2.__unstableIsEditableTree,
|
9108 |
+
preserveWhiteSpace = _ref2.preserveWhiteSpace;
|
9109 |
+
|
9110 |
+
if (typeof text === 'string' && text.length > 0) {
|
9111 |
+
return {
|
9112 |
+
formats: Array(text.length),
|
9113 |
+
replacements: Array(text.length),
|
9114 |
+
text: text
|
9115 |
+
};
|
9116 |
+
}
|
9117 |
+
|
9118 |
+
if (typeof html === 'string' && html.length > 0) {
|
9119 |
+
// It does not matter which document this is, we're just using it to
|
9120 |
+
// parse.
|
9121 |
+
element = Object(__WEBPACK_IMPORTED_MODULE_5__create_element__["a" /* createElement */])(document, html);
|
9122 |
+
}
|
9123 |
+
|
9124 |
+
if (Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_typeof__["a" /* default */])(element) !== 'object') {
|
9125 |
+
return createEmptyValue();
|
9126 |
+
}
|
9127 |
+
|
9128 |
+
if (!multilineTag) {
|
9129 |
+
return createFromElement({
|
9130 |
+
element: element,
|
9131 |
+
range: range,
|
9132 |
+
isEditableTree: isEditableTree,
|
9133 |
+
preserveWhiteSpace: preserveWhiteSpace
|
9134 |
+
});
|
9135 |
+
}
|
9136 |
+
|
9137 |
+
return createFromMultilineElement({
|
9138 |
+
element: element,
|
9139 |
+
range: range,
|
9140 |
+
multilineTag: multilineTag,
|
9141 |
+
multilineWrapperTags: multilineWrapperTags,
|
9142 |
+
isEditableTree: isEditableTree,
|
9143 |
+
preserveWhiteSpace: preserveWhiteSpace
|
9144 |
+
});
|
9145 |
+
}
|
9146 |
+
/**
|
9147 |
+
* Helper to accumulate the value's selection start and end from the current
|
9148 |
+
* node and range.
|
9149 |
+
*
|
9150 |
+
* @param {Object} accumulator Object to accumulate into.
|
9151 |
+
* @param {Node} node Node to create value with.
|
9152 |
+
* @param {Range} range Range to create value with.
|
9153 |
+
* @param {Object} value Value that is being accumulated.
|
9154 |
+
*/
|
9155 |
+
|
9156 |
+
function accumulateSelection(accumulator, node, range, value) {
|
9157 |
+
if (!range) {
|
9158 |
+
return;
|
9159 |
+
}
|
9160 |
+
|
9161 |
+
var parentNode = node.parentNode;
|
9162 |
+
var startContainer = range.startContainer,
|
9163 |
+
startOffset = range.startOffset,
|
9164 |
+
endContainer = range.endContainer,
|
9165 |
+
endOffset = range.endOffset;
|
9166 |
+
var currentLength = accumulator.text.length; // Selection can be extracted from value.
|
9167 |
+
|
9168 |
+
if (value.start !== undefined) {
|
9169 |
+
accumulator.start = currentLength + value.start; // Range indicates that the current node has selection.
|
9170 |
+
} else if (node === startContainer && node.nodeType === node.TEXT_NODE) {
|
9171 |
+
accumulator.start = currentLength + startOffset; // Range indicates that the current node is selected.
|
9172 |
+
} else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) {
|
9173 |
+
accumulator.start = currentLength; // Range indicates that the selection is after the current node.
|
9174 |
+
} else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) {
|
9175 |
+
accumulator.start = currentLength + value.text.length; // Fallback if no child inside handled the selection.
|
9176 |
+
} else if (node === startContainer) {
|
9177 |
+
accumulator.start = currentLength;
|
9178 |
+
} // Selection can be extracted from value.
|
9179 |
+
|
9180 |
+
|
9181 |
+
if (value.end !== undefined) {
|
9182 |
+
accumulator.end = currentLength + value.end; // Range indicates that the current node has selection.
|
9183 |
+
} else if (node === endContainer && node.nodeType === node.TEXT_NODE) {
|
9184 |
+
accumulator.end = currentLength + endOffset; // Range indicates that the current node is selected.
|
9185 |
+
} else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) {
|
9186 |
+
accumulator.end = currentLength + value.text.length; // Range indicates that the selection is before the current node.
|
9187 |
+
} else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) {
|
9188 |
+
accumulator.end = currentLength; // Fallback if no child inside handled the selection.
|
9189 |
+
} else if (node === endContainer) {
|
9190 |
+
accumulator.end = currentLength + endOffset;
|
9191 |
+
}
|
9192 |
+
}
|
9193 |
+
/**
|
9194 |
+
* Adjusts the start and end offsets from a range based on a text filter.
|
9195 |
+
*
|
9196 |
+
* @param {Node} node Node of which the text should be filtered.
|
9197 |
+
* @param {Range} range The range to filter.
|
9198 |
+
* @param {Function} filter Function to use to filter the text.
|
9199 |
+
*
|
9200 |
+
* @return {?Object} Object containing range properties.
|
9201 |
+
*/
|
9202 |
+
|
9203 |
+
|
9204 |
+
function filterRange(node, range, filter) {
|
9205 |
+
if (!range) {
|
9206 |
+
return;
|
9207 |
+
}
|
9208 |
+
|
9209 |
+
var startContainer = range.startContainer,
|
9210 |
+
endContainer = range.endContainer;
|
9211 |
+
var startOffset = range.startOffset,
|
9212 |
+
endOffset = range.endOffset;
|
9213 |
+
|
9214 |
+
if (node === startContainer) {
|
9215 |
+
startOffset = filter(node.nodeValue.slice(0, startOffset)).length;
|
9216 |
+
}
|
9217 |
+
|
9218 |
+
if (node === endContainer) {
|
9219 |
+
endOffset = filter(node.nodeValue.slice(0, endOffset)).length;
|
9220 |
+
}
|
9221 |
+
|
9222 |
+
return {
|
9223 |
+
startContainer: startContainer,
|
9224 |
+
startOffset: startOffset,
|
9225 |
+
endContainer: endContainer,
|
9226 |
+
endOffset: endOffset
|
9227 |
+
};
|
9228 |
+
}
|
9229 |
+
/**
|
9230 |
+
* Collapse any whitespace used for HTML formatting to one space character,
|
9231 |
+
* because it will also be displayed as such by the browser.
|
9232 |
+
*
|
9233 |
+
* @param {string} string
|
9234 |
+
*/
|
9235 |
+
|
9236 |
+
|
9237 |
+
function collapseWhiteSpace(string) {
|
9238 |
+
return string.replace(/[\n\r\t]+/g, ' ');
|
9239 |
+
}
|
9240 |
+
|
9241 |
+
var ZWNBSPRegExp = new RegExp(__WEBPACK_IMPORTED_MODULE_7__special_characters__["c" /* ZWNBSP */], 'g');
|
9242 |
+
/**
|
9243 |
+
* Removes padding (zero width non breaking spaces) added by `toTree`.
|
9244 |
+
*
|
9245 |
+
* @param {string} string
|
9246 |
+
*/
|
9247 |
+
|
9248 |
+
function removePadding(string) {
|
9249 |
+
return string.replace(ZWNBSPRegExp, '');
|
9250 |
+
}
|
9251 |
+
/**
|
9252 |
+
* Creates a Rich Text value from a DOM element and range.
|
9253 |
+
*
|
9254 |
+
* @param {Object} $1 Named argements.
|
9255 |
+
* @param {?Element} $1.element Element to create value from.
|
9256 |
+
* @param {?Range} $1.range Range to create value from.
|
9257 |
+
* @param {?string} $1.multilineTag Multiline tag if the structure is
|
9258 |
+
* multiline.
|
9259 |
+
* @param {?Array} $1.multilineWrapperTags Tags where lines can be found if
|
9260 |
+
* nesting is possible.
|
9261 |
+
* @param {?boolean} $1.preserveWhiteSpace Whether or not to collapse white
|
9262 |
+
* space characters.
|
9263 |
+
*
|
9264 |
+
* @return {Object} A rich text value.
|
9265 |
+
*/
|
9266 |
+
|
9267 |
+
|
9268 |
+
function createFromElement(_ref3) {
|
9269 |
+
var element = _ref3.element,
|
9270 |
+
range = _ref3.range,
|
9271 |
+
multilineTag = _ref3.multilineTag,
|
9272 |
+
multilineWrapperTags = _ref3.multilineWrapperTags,
|
9273 |
+
_ref3$currentWrapperT = _ref3.currentWrapperTags,
|
9274 |
+
currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
|
9275 |
+
isEditableTree = _ref3.isEditableTree,
|
9276 |
+
preserveWhiteSpace = _ref3.preserveWhiteSpace;
|
9277 |
+
var accumulator = createEmptyValue();
|
9278 |
+
|
9279 |
+
if (!element) {
|
9280 |
+
return accumulator;
|
9281 |
+
}
|
9282 |
+
|
9283 |
+
if (!element.hasChildNodes()) {
|
9284 |
+
accumulateSelection(accumulator, element, range, createEmptyValue());
|
9285 |
+
return accumulator;
|
9286 |
+
}
|
9287 |
+
|
9288 |
+
var length = element.childNodes.length; // Optimise for speed.
|
9289 |
+
|
9290 |
+
var _loop = function _loop(index) {
|
9291 |
+
var node = element.childNodes[index];
|
9292 |
+
var type = node.nodeName.toLowerCase();
|
9293 |
+
|
9294 |
+
if (node.nodeType === node.TEXT_NODE) {
|
9295 |
+
var filter = removePadding;
|
9296 |
+
|
9297 |
+
if (!preserveWhiteSpace) {
|
9298 |
+
filter = function filter(string) {
|
9299 |
+
return removePadding(collapseWhiteSpace(string));
|
9300 |
+
};
|
9301 |
+
}
|
9302 |
+
|
9303 |
+
var text = filter(node.nodeValue);
|
9304 |
+
range = filterRange(node, range, filter);
|
9305 |
+
accumulateSelection(accumulator, node, range, {
|
9306 |
+
text: text
|
9307 |
+
}); // Create a sparse array of the same length as `text`, in which
|
9308 |
+
// formats can be added.
|
9309 |
+
|
9310 |
+
accumulator.formats.length += text.length;
|
9311 |
+
accumulator.replacements.length += text.length;
|
9312 |
+
accumulator.text += text;
|
9313 |
+
return "continue";
|
9314 |
+
}
|
9315 |
+
|
9316 |
+
if (node.nodeType !== node.ELEMENT_NODE) {
|
9317 |
+
return "continue";
|
9318 |
+
}
|
9319 |
+
|
9320 |
+
if (isEditableTree && ( // Ignore any placeholders.
|
9321 |
+
node.getAttribute('data-rich-text-placeholder') || // Ignore any line breaks that are not inserted by us.
|
9322 |
+
type === 'br' && !node.getAttribute('data-rich-text-line-break'))) {
|
9323 |
+
accumulateSelection(accumulator, node, range, createEmptyValue());
|
9324 |
+
return "continue";
|
9325 |
+
}
|
9326 |
+
|
9327 |
+
if (type === 'br') {
|
9328 |
+
accumulateSelection(accumulator, node, range, createEmptyValue());
|
9329 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, create({
|
9330 |
+
text: '\n'
|
9331 |
+
}));
|
9332 |
+
return "continue";
|
9333 |
+
}
|
9334 |
+
|
9335 |
+
var lastFormats = accumulator.formats[accumulator.formats.length - 1];
|
9336 |
+
var lastFormat = lastFormats && lastFormats[lastFormats.length - 1];
|
9337 |
+
var newFormat = toFormat({
|
9338 |
+
type: type,
|
9339 |
+
attributes: getAttributes({
|
9340 |
+
element: node
|
9341 |
+
})
|
9342 |
+
});
|
9343 |
+
var format = Object(__WEBPACK_IMPORTED_MODULE_4__is_format_equal__["a" /* isFormatEqual */])(newFormat, lastFormat) ? lastFormat : newFormat;
|
9344 |
+
|
9345 |
+
if (multilineWrapperTags && multilineWrapperTags.indexOf(type) !== -1) {
|
9346 |
+
var _value = createFromMultilineElement({
|
9347 |
+
element: node,
|
9348 |
+
range: range,
|
9349 |
+
multilineTag: multilineTag,
|
9350 |
+
multilineWrapperTags: multilineWrapperTags,
|
9351 |
+
currentWrapperTags: [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(currentWrapperTags), [format]),
|
9352 |
+
isEditableTree: isEditableTree,
|
9353 |
+
preserveWhiteSpace: preserveWhiteSpace
|
9354 |
+
});
|
9355 |
+
|
9356 |
+
accumulateSelection(accumulator, node, range, _value);
|
9357 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, _value);
|
9358 |
+
return "continue";
|
9359 |
+
}
|
9360 |
+
|
9361 |
+
var value = createFromElement({
|
9362 |
+
element: node,
|
9363 |
+
range: range,
|
9364 |
+
multilineTag: multilineTag,
|
9365 |
+
multilineWrapperTags: multilineWrapperTags,
|
9366 |
+
isEditableTree: isEditableTree,
|
9367 |
+
preserveWhiteSpace: preserveWhiteSpace
|
9368 |
+
});
|
9369 |
+
accumulateSelection(accumulator, node, range, value);
|
9370 |
+
|
9371 |
+
if (!format) {
|
9372 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, value);
|
9373 |
+
} else if (value.text.length === 0) {
|
9374 |
+
if (format.attributes) {
|
9375 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, {
|
9376 |
+
formats: [,],
|
9377 |
+
replacements: [format],
|
9378 |
+
text: __WEBPACK_IMPORTED_MODULE_7__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */]
|
9379 |
+
});
|
9380 |
+
}
|
9381 |
+
} else {
|
9382 |
+
// Indices should share a reference to the same formats array.
|
9383 |
+
// Only create a new reference if `formats` changes.
|
9384 |
+
function mergeFormats(formats) {
|
9385 |
+
if (mergeFormats.formats === formats) {
|
9386 |
+
return mergeFormats.newFormats;
|
9387 |
+
}
|
9388 |
+
|
9389 |
+
var newFormats = formats ? [format].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(formats)) : [format];
|
9390 |
+
mergeFormats.formats = formats;
|
9391 |
+
mergeFormats.newFormats = newFormats;
|
9392 |
+
return newFormats;
|
9393 |
+
} // Since the formats parameter can be `undefined`, preset
|
9394 |
+
// `mergeFormats` with a new reference.
|
9395 |
+
|
9396 |
+
|
9397 |
+
mergeFormats.newFormats = [format];
|
9398 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, _objectSpread({}, value, {
|
9399 |
+
formats: Array.from(value.formats, mergeFormats)
|
9400 |
+
}));
|
9401 |
+
}
|
9402 |
+
};
|
9403 |
+
|
9404 |
+
for (var index = 0; index < length; index++) {
|
9405 |
+
var _ret = _loop(index);
|
9406 |
+
|
9407 |
+
if (_ret === "continue") continue;
|
9408 |
+
}
|
9409 |
+
|
9410 |
+
return accumulator;
|
9411 |
+
}
|
9412 |
+
/**
|
9413 |
+
* Creates a rich text value from a DOM element and range that should be
|
9414 |
+
* multiline.
|
9415 |
+
*
|
9416 |
+
* @param {Object} $1 Named argements.
|
9417 |
+
* @param {?Element} $1.element Element to create value from.
|
9418 |
+
* @param {?Range} $1.range Range to create value from.
|
9419 |
+
* @param {?string} $1.multilineTag Multiline tag if the structure is
|
9420 |
+
* multiline.
|
9421 |
+
* @param {?Array} $1.multilineWrapperTags Tags where lines can be found if
|
9422 |
+
* nesting is possible.
|
9423 |
+
* @param {boolean} $1.currentWrapperTags Whether to prepend a line
|
9424 |
+
* separator.
|
9425 |
+
* @param {?boolean} $1.preserveWhiteSpace Whether or not to collapse white
|
9426 |
+
* space characters.
|
9427 |
+
*
|
9428 |
+
* @return {Object} A rich text value.
|
9429 |
+
*/
|
9430 |
+
|
9431 |
+
|
9432 |
+
function createFromMultilineElement(_ref4) {
|
9433 |
+
var element = _ref4.element,
|
9434 |
+
range = _ref4.range,
|
9435 |
+
multilineTag = _ref4.multilineTag,
|
9436 |
+
multilineWrapperTags = _ref4.multilineWrapperTags,
|
9437 |
+
_ref4$currentWrapperT = _ref4.currentWrapperTags,
|
9438 |
+
currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT,
|
9439 |
+
isEditableTree = _ref4.isEditableTree,
|
9440 |
+
preserveWhiteSpace = _ref4.preserveWhiteSpace;
|
9441 |
+
var accumulator = createEmptyValue();
|
9442 |
+
|
9443 |
+
if (!element || !element.hasChildNodes()) {
|
9444 |
+
return accumulator;
|
9445 |
+
}
|
9446 |
+
|
9447 |
+
var length = element.children.length; // Optimise for speed.
|
9448 |
+
|
9449 |
+
for (var index = 0; index < length; index++) {
|
9450 |
+
var node = element.children[index];
|
9451 |
+
|
9452 |
+
if (node.nodeName.toLowerCase() !== multilineTag) {
|
9453 |
+
continue;
|
9454 |
+
}
|
9455 |
+
|
9456 |
+
var value = createFromElement({
|
9457 |
+
element: node,
|
9458 |
+
range: range,
|
9459 |
+
multilineTag: multilineTag,
|
9460 |
+
multilineWrapperTags: multilineWrapperTags,
|
9461 |
+
currentWrapperTags: currentWrapperTags,
|
9462 |
+
isEditableTree: isEditableTree,
|
9463 |
+
preserveWhiteSpace: preserveWhiteSpace
|
9464 |
+
}); // Multiline value text should be separated by a line separator.
|
9465 |
+
|
9466 |
+
if (index !== 0 || currentWrapperTags.length > 0) {
|
9467 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, {
|
9468 |
+
formats: [,],
|
9469 |
+
replacements: currentWrapperTags.length > 0 ? [currentWrapperTags] : [,],
|
9470 |
+
text: __WEBPACK_IMPORTED_MODULE_7__special_characters__["a" /* LINE_SEPARATOR */]
|
9471 |
+
});
|
9472 |
+
}
|
9473 |
+
|
9474 |
+
accumulateSelection(accumulator, node, range, value);
|
9475 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, value);
|
9476 |
+
}
|
9477 |
+
|
9478 |
+
return accumulator;
|
9479 |
+
}
|
9480 |
+
/**
|
9481 |
+
* Gets the attributes of an element in object shape.
|
9482 |
+
*
|
9483 |
+
* @param {Object} $1 Named argements.
|
9484 |
+
* @param {Element} $1.element Element to get attributes from.
|
9485 |
+
*
|
9486 |
+
* @return {?Object} Attribute object or `undefined` if the element has no
|
9487 |
+
* attributes.
|
9488 |
+
*/
|
9489 |
+
|
9490 |
+
|
9491 |
+
function getAttributes(_ref5) {
|
9492 |
+
var element = _ref5.element;
|
9493 |
+
|
9494 |
+
if (!element.hasAttributes()) {
|
9495 |
+
return;
|
9496 |
+
}
|
9497 |
+
|
9498 |
+
var length = element.attributes.length;
|
9499 |
+
var accumulator; // Optimise for speed.
|
9500 |
+
|
9501 |
+
for (var i = 0; i < length; i++) {
|
9502 |
+
var _element$attributes$i = element.attributes[i],
|
9503 |
+
name = _element$attributes$i.name,
|
9504 |
+
value = _element$attributes$i.value;
|
9505 |
+
|
9506 |
+
if (name.indexOf('data-rich-text-') === 0) {
|
9507 |
+
continue;
|
9508 |
+
}
|
9509 |
+
|
9510 |
+
accumulator = accumulator || {};
|
9511 |
+
accumulator[name] = value;
|
9512 |
+
}
|
9513 |
+
|
9514 |
+
return accumulator;
|
9515 |
+
}
|
9516 |
+
//# sourceMappingURL=create.js.map
|
9517 |
+
|
9518 |
+
/***/ }),
|
9519 |
+
/* 52 */
|
9520 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9521 |
+
|
9522 |
+
"use strict";
|
9523 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return focus; });
|
9524 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__focusable__ = __webpack_require__(179);
|
9525 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tabbable__ = __webpack_require__(575);
|
9526 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dom__ = __webpack_require__(576);
|
9527 |
+
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__dom__["a"]; });
|
9528 |
+
/**
|
9529 |
+
* Internal dependencies
|
9530 |
+
*/
|
9531 |
+
|
9532 |
+
|
9533 |
+
/**
|
9534 |
+
* Object grouping `focusable` and `tabbable` utils
|
9535 |
+
* under the keys with the same name.
|
9536 |
+
*/
|
9537 |
+
|
9538 |
+
var focus = {
|
9539 |
+
focusable: __WEBPACK_IMPORTED_MODULE_0__focusable__,
|
9540 |
+
tabbable: __WEBPACK_IMPORTED_MODULE_1__tabbable__
|
9541 |
+
};
|
9542 |
+
|
9543 |
+
//# sourceMappingURL=index.js.map
|
9544 |
+
|
9545 |
+
/***/ }),
|
9546 |
+
/* 53 */
|
9547 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9548 |
+
|
9549 |
+
"use strict";
|
9550 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Dashicon; });
|
9551 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
9552 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
9553 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
9554 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
9555 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
9556 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
|
9557 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__primitives__ = __webpack_require__(75);
|
9558 |
+
|
9559 |
+
|
9560 |
+
|
9561 |
+
|
9562 |
+
|
9563 |
+
|
9564 |
+
|
9565 |
+
/* !!!
|
9566 |
+
IF YOU ARE EDITING dashicon/index.jsx
|
9567 |
+
THEN YOU ARE EDITING A FILE THAT GETS OUTPUT FROM THE DASHICONS REPO!
|
9568 |
+
DO NOT EDIT THAT FILE! EDIT index-header.jsx and index-footer.jsx instead
|
9569 |
+
OR if you're looking to change now SVGs get output, you'll need to edit strings in the Gruntfile :)
|
9570 |
+
!!! */
|
9571 |
+
|
9572 |
+
/**
|
9573 |
+
* WordPress dependencies
|
9574 |
+
*/
|
9575 |
+
|
9576 |
+
/**
|
9577 |
+
* Internal dependencies
|
9578 |
+
*/
|
9579 |
+
|
9580 |
+
|
9581 |
+
|
9582 |
+
var Dashicon =
|
9583 |
+
/*#__PURE__*/
|
9584 |
+
function (_Component) {
|
9585 |
+
Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(Dashicon, _Component);
|
9586 |
+
|
9587 |
+
function Dashicon() {
|
9588 |
+
Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Dashicon);
|
9589 |
+
|
9590 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Dashicon).apply(this, arguments));
|
9591 |
+
}
|
9592 |
+
|
9593 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(Dashicon, [{
|
9594 |
+
key: "shouldComponentUpdate",
|
9595 |
+
value: function shouldComponentUpdate(nextProps) {
|
9596 |
+
return this.props.icon !== nextProps.icon || this.props.size !== nextProps.size || this.props.className !== nextProps.className;
|
9597 |
+
}
|
9598 |
+
}, {
|
9599 |
+
key: "render",
|
9600 |
+
value: function render() {
|
9601 |
+
var _this$props = this.props,
|
9602 |
+
icon = _this$props.icon,
|
9603 |
+
className = _this$props.className,
|
9604 |
+
_this$props$size = _this$props.size,
|
9605 |
+
size = _this$props$size === void 0 ? 20 : _this$props$size;
|
9606 |
+
var path;
|
9607 |
+
|
9608 |
+
switch (icon) {
|
9609 |
+
case 'admin-appearance':
|
9610 |
+
path = 'M14.48 11.06L7.41 3.99l1.5-1.5c.5-.56 2.3-.47 3.51.32 1.21.8 1.43 1.28 2.91 2.1 1.18.64 2.45 1.26 4.45.85zm-.71.71L6.7 4.7 4.93 6.47c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39.39 1.03 0 1.42-.6.6-1.43 1.11-2.21 1.69-.35.26-.7.53-1.01.84C1.43 14.23.4 16.08 1.4 17.07c.99 1 2.84-.03 4.18-1.36.31-.31.58-.66.85-1.02.57-.78 1.08-1.61 1.69-2.21.39-.39 1.02-.39 1.41 0l1.06 1.06c.39.39 1.02.39 1.41 0z';
|
9611 |
+
break;
|
9612 |
+
|
9613 |
+
case 'admin-collapse':
|
9614 |
+
path = 'M10 2.16c4.33 0 7.84 3.51 7.84 7.84s-3.51 7.84-7.84 7.84S2.16 14.33 2.16 10 5.71 2.16 10 2.16zm2 11.72V6.12L6.18 9.97z';
|
9615 |
+
break;
|
9616 |
+
|
9617 |
+
case 'admin-comments':
|
9618 |
+
path = 'M5 2h9c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2z';
|
9619 |
+
break;
|
9620 |
+
|
9621 |
+
case 'admin-customizer':
|
9622 |
+
path = 'M18.33 3.57s.27-.8-.31-1.36c-.53-.52-1.22-.24-1.22-.24-.61.3-5.76 3.47-7.67 5.57-.86.96-2.06 3.79-1.09 4.82.92.98 3.96-.17 4.79-1 2.06-2.06 5.21-7.17 5.5-7.79zM1.4 17.65c2.37-1.56 1.46-3.41 3.23-4.64.93-.65 2.22-.62 3.08.29.63.67.8 2.57-.16 3.46-1.57 1.45-4 1.55-6.15.89z';
|
9623 |
+
break;
|
9624 |
+
|
9625 |
+
case 'admin-generic':
|
9626 |
+
path = 'M18 12h-2.18c-.17.7-.44 1.35-.81 1.93l1.54 1.54-2.1 2.1-1.54-1.54c-.58.36-1.23.63-1.91.79V19H8v-2.18c-.68-.16-1.33-.43-1.91-.79l-1.54 1.54-2.12-2.12 1.54-1.54c-.36-.58-.63-1.23-.79-1.91H1V9.03h2.17c.16-.7.44-1.35.8-1.94L2.43 5.55l2.1-2.1 1.54 1.54c.58-.37 1.24-.64 1.93-.81V2h3v2.18c.68.16 1.33.43 1.91.79l1.54-1.54 2.12 2.12-1.54 1.54c.36.59.64 1.24.8 1.94H18V12zm-8.5 1.5c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z';
|
9627 |
+
break;
|
9628 |
+
|
9629 |
+
case 'admin-home':
|
9630 |
+
path = 'M16 8.5l1.53 1.53-1.06 1.06L10 4.62l-6.47 6.47-1.06-1.06L10 2.5l4 4v-2h2v4zm-6-2.46l6 5.99V18H4v-5.97zM12 17v-5H8v5h4z';
|
9631 |
+
break;
|
9632 |
+
|
9633 |
+
case 'admin-links':
|
9634 |
+
path = 'M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z';
|
9635 |
+
break;
|
9636 |
+
|
9637 |
+
case 'admin-media':
|
9638 |
+
path = 'M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z';
|
9639 |
+
break;
|
9640 |
+
|
9641 |
+
case 'admin-multisite':
|
9642 |
path = 'M14.27 6.87L10 3.14 5.73 6.87 5 6.14l5-4.38 5 4.38zM14 8.42l-4.05 3.43L6 8.38v-.74l4-3.5 4 3.5v.78zM11 9.7V8H9v1.7h2zm-1.73 4.03L5 10 .73 13.73 0 13l5-4.38L10 13zm10 0L15 10l-4.27 3.73L10 13l5-4.38L20 13zM5 11l4 3.5V18H1v-3.5zm10 0l4 3.5V18h-8v-3.5zm-9 6v-2H4v2h2zm10 0v-2h-2v2h2z';
|
9643 |
break;
|
9644 |
|
10782 |
//# sourceMappingURL=index.js.map
|
10783 |
|
10784 |
/***/ }),
|
10785 |
+
/* 54 */
|
10786 |
+
/***/ (function(module, exports, __webpack_require__) {
|
10787 |
+
|
10788 |
+
"use strict";
|
10789 |
+
|
10790 |
+
|
10791 |
+
var bind = __webpack_require__(83);
|
10792 |
+
|
10793 |
+
var GetIntrinsic = __webpack_require__(19);
|
10794 |
+
|
10795 |
+
var $Function = GetIntrinsic('%Function%');
|
10796 |
+
var $apply = $Function.apply;
|
10797 |
+
var $call = $Function.call;
|
10798 |
+
|
10799 |
+
module.exports = function callBind() {
|
10800 |
+
return bind.apply($call, arguments);
|
10801 |
+
};
|
10802 |
+
|
10803 |
+
module.exports.apply = function applyBind() {
|
10804 |
+
return bind.apply($apply, arguments);
|
10805 |
+
};
|
10806 |
+
|
10807 |
+
|
10808 |
+
/***/ }),
|
10809 |
+
/* 55 */
|
10810 |
/***/ (function(module, exports, __webpack_require__) {
|
10811 |
|
10812 |
"use strict";
|
10821 |
|
10822 |
|
10823 |
|
10824 |
+
var shallowEqual = __webpack_require__(654);
|
10825 |
|
10826 |
/**
|
10827 |
* Does a shallow comparison for props and state.
|
10839 |
|
10840 |
|
10841 |
/***/ }),
|
10842 |
+
/* 56 */
|
10843 |
/***/ (function(module, exports, __webpack_require__) {
|
10844 |
|
10845 |
"use strict";
|
10850 |
});
|
10851 |
exports['default'] = isSameDay;
|
10852 |
|
10853 |
+
var _moment = __webpack_require__(0);
|
10854 |
|
10855 |
var _moment2 = _interopRequireDefault(_moment);
|
10856 |
|
10864 |
}
|
10865 |
|
10866 |
/***/ }),
|
10867 |
+
/* 57 */
|
10868 |
/***/ (function(module, exports, __webpack_require__) {
|
10869 |
|
10870 |
"use strict";
|
10875 |
});
|
10876 |
exports['default'] = toMomentObject;
|
10877 |
|
10878 |
+
var _moment = __webpack_require__(0);
|
10879 |
|
10880 |
var _moment2 = _interopRequireDefault(_moment);
|
10881 |
|
10882 |
+
var _constants = __webpack_require__(17);
|
10883 |
|
10884 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10885 |
|
10891 |
}
|
10892 |
|
10893 |
/***/ }),
|
10894 |
+
/* 58 */
|
10895 |
/***/ (function(module, exports, __webpack_require__) {
|
10896 |
|
10897 |
"use strict";
|
10901 |
value: true
|
10902 |
});
|
10903 |
|
10904 |
+
var _propTypes = __webpack_require__(11);
|
10905 |
|
10906 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
10907 |
|
10908 |
+
var _constants = __webpack_require__(17);
|
10909 |
|
10910 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10911 |
|
10912 |
exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]);
|
10913 |
|
10914 |
/***/ }),
|
10915 |
+
/* 59 */
|
10916 |
/***/ (function(module, exports) {
|
10917 |
|
10918 |
Object.defineProperty(exports, "__esModule", {
|
10925 |
module.exports = exports['default'];
|
10926 |
|
10927 |
/***/ }),
|
10928 |
+
/* 60 */
|
10929 |
/***/ (function(module, exports, __webpack_require__) {
|
10930 |
|
10931 |
"use strict";
|
10935 |
value: true
|
10936 |
});
|
10937 |
|
10938 |
+
var _propTypes = __webpack_require__(11);
|
10939 |
|
10940 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
10941 |
|
10942 |
+
var _constants = __webpack_require__(17);
|
10943 |
|
10944 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10945 |
|
10946 |
exports['default'] = _propTypes2['default'].oneOf([_constants.OPEN_DOWN, _constants.OPEN_UP]);
|
10947 |
|
10948 |
/***/ }),
|
10949 |
+
/* 61 */
|
10950 |
/***/ (function(module, exports, __webpack_require__) {
|
10951 |
|
10952 |
"use strict";
|
11043 |
|
11044 |
|
11045 |
/***/ }),
|
11046 |
+
/* 62 */
|
11047 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11048 |
|
11049 |
"use strict";
|
11050 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addAction; });
|
11051 |
+
/* unused harmony export addFilter */
|
11052 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeAction; });
|
11053 |
+
/* unused harmony export removeFilter */
|
11054 |
+
/* unused harmony export hasAction */
|
11055 |
+
/* unused harmony export hasFilter */
|
11056 |
+
/* unused harmony export removeAllActions */
|
11057 |
+
/* unused harmony export removeAllFilters */
|
11058 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return doAction; });
|
11059 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return applyFilters; });
|
11060 |
+
/* unused harmony export currentAction */
|
11061 |
+
/* unused harmony export currentFilter */
|
11062 |
+
/* unused harmony export doingAction */
|
11063 |
+
/* unused harmony export doingFilter */
|
11064 |
+
/* unused harmony export didAction */
|
11065 |
+
/* unused harmony export didFilter */
|
11066 |
+
/* unused harmony export actions */
|
11067 |
+
/* unused harmony export filters */
|
11068 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createHooks__ = __webpack_require__(511);
|
11069 |
+
/* unused harmony reexport createHooks */
|
11070 |
+
/**
|
11071 |
+
* Internal dependencies
|
11072 |
+
*/
|
11073 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11074 |
|
11075 |
+
var _createHooks = Object(__WEBPACK_IMPORTED_MODULE_0__createHooks__["a" /* default */])(),
|
11076 |
+
addAction = _createHooks.addAction,
|
11077 |
+
addFilter = _createHooks.addFilter,
|
11078 |
+
removeAction = _createHooks.removeAction,
|
11079 |
+
removeFilter = _createHooks.removeFilter,
|
11080 |
+
hasAction = _createHooks.hasAction,
|
11081 |
+
hasFilter = _createHooks.hasFilter,
|
11082 |
+
removeAllActions = _createHooks.removeAllActions,
|
11083 |
+
removeAllFilters = _createHooks.removeAllFilters,
|
11084 |
+
doAction = _createHooks.doAction,
|
11085 |
+
applyFilters = _createHooks.applyFilters,
|
11086 |
+
currentAction = _createHooks.currentAction,
|
11087 |
+
currentFilter = _createHooks.currentFilter,
|
11088 |
+
doingAction = _createHooks.doingAction,
|
11089 |
+
doingFilter = _createHooks.doingFilter,
|
11090 |
+
didAction = _createHooks.didAction,
|
11091 |
+
didFilter = _createHooks.didFilter,
|
11092 |
+
actions = _createHooks.actions,
|
11093 |
+
filters = _createHooks.filters;
|
11094 |
+
|
11095 |
|
11096 |
+
//# sourceMappingURL=index.js.map
|
11097 |
|
11098 |
/***/ }),
|
11099 |
+
/* 63 */
|
11100 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11101 |
|
11102 |
"use strict";
|
11103 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = insert;
|
11104 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create__ = __webpack_require__(51);
|
11105 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__normalise_formats__ = __webpack_require__(50);
|
11106 |
+
/**
|
11107 |
+
* Internal dependencies
|
11108 |
+
*/
|
11109 |
+
|
11110 |
+
|
11111 |
+
/**
|
11112 |
+
* Insert a Rich Text value, an HTML string, or a plain text string, into a
|
11113 |
+
* Rich Text value at the given `startIndex`. Any content between `startIndex`
|
11114 |
+
* and `endIndex` will be removed. Indices are retrieved from the selection if
|
11115 |
+
* none are provided.
|
11116 |
+
*
|
11117 |
+
* @param {Object} value Value to modify.
|
11118 |
+
* @param {Object|string} valueToInsert Value to insert.
|
11119 |
+
* @param {number} [startIndex] Start index.
|
11120 |
+
* @param {number} [endIndex] End index.
|
11121 |
+
*
|
11122 |
+
* @return {Object} A new value with the value inserted.
|
11123 |
+
*/
|
11124 |
+
|
11125 |
+
function insert(value, valueToInsert) {
|
11126 |
+
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
11127 |
+
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
11128 |
+
var formats = value.formats,
|
11129 |
+
replacements = value.replacements,
|
11130 |
+
text = value.text;
|
11131 |
+
|
11132 |
+
if (typeof valueToInsert === 'string') {
|
11133 |
+
valueToInsert = Object(__WEBPACK_IMPORTED_MODULE_0__create__["a" /* create */])({
|
11134 |
+
text: valueToInsert
|
11135 |
+
});
|
11136 |
+
}
|
11137 |
+
|
11138 |
+
var index = startIndex + valueToInsert.text.length;
|
11139 |
+
return Object(__WEBPACK_IMPORTED_MODULE_1__normalise_formats__["a" /* normaliseFormats */])({
|
11140 |
+
formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
|
11141 |
+
replacements: replacements.slice(0, startIndex).concat(valueToInsert.replacements, replacements.slice(endIndex)),
|
11142 |
+
text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
|
11143 |
+
start: index,
|
11144 |
+
end: index
|
11145 |
+
});
|
11146 |
+
}
|
11147 |
+
//# sourceMappingURL=insert.js.map
|
11148 |
|
11149 |
/***/ }),
|
11150 |
+
/* 64 */
|
11151 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11152 |
|
11153 |
"use strict";
|
11159 |
/* harmony export (immutable) */ __webpack_exports__["c"] = calculateSaturationChange;
|
11160 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
|
11161 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
|
11162 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tinycolor2__ = __webpack_require__(595);
|
11163 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tinycolor2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_tinycolor2__);
|
11164 |
/**
|
11165 |
* Parts of this source were derived and modified from react-color,
|
11398 |
//# sourceMappingURL=utils.js.map
|
11399 |
|
11400 |
/***/ }),
|
11401 |
+
/* 65 */
|
11402 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11403 |
|
11404 |
"use strict";
|
11408 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
11409 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
11410 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
11411 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
|
11412 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_mousetrap__ = __webpack_require__(98);
|
11413 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_mousetrap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_mousetrap__);
|
11414 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind__ = __webpack_require__(99);
|
11415 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind__);
|
11416 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash__ = __webpack_require__(2);
|
11417 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash__);
|
11508 |
//# sourceMappingURL=index.js.map
|
11509 |
|
11510 |
/***/ }),
|
11511 |
+
/* 66 */
|
11512 |
+
/***/ (function(module, exports, __webpack_require__) {
|
11513 |
+
|
11514 |
+
"use strict";
|
11515 |
+
|
11516 |
+
|
11517 |
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
|
11518 |
+
|
11519 |
+
module.exports = function IsPropertyKey(argument) {
|
11520 |
+
return typeof argument === 'string' || typeof argument === 'symbol';
|
11521 |
+
};
|
11522 |
+
|
11523 |
+
|
11524 |
+
/***/ }),
|
11525 |
+
/* 67 */
|
11526 |
+
/***/ (function(module, exports, __webpack_require__) {
|
11527 |
+
|
11528 |
+
"use strict";
|
11529 |
+
/* WEBPACK VAR INJECTION */(function(process) {
|
11530 |
+
|
11531 |
+
if (process.env.NODE_ENV === 'production') {
|
11532 |
+
module.exports = __webpack_require__(650);
|
11533 |
+
} else {
|
11534 |
+
module.exports = __webpack_require__(651);
|
11535 |
+
}
|
11536 |
+
|
11537 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
11538 |
+
|
11539 |
+
/***/ }),
|
11540 |
+
/* 68 */
|
11541 |
/***/ (function(module, exports, __webpack_require__) {
|
11542 |
|
11543 |
"use strict";
|
11547 |
value: true
|
11548 |
});
|
11549 |
|
11550 |
+
var _propTypes = __webpack_require__(11);
|
11551 |
|
11552 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
11553 |
|
11554 |
+
var _constants = __webpack_require__(17);
|
11555 |
|
11556 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11557 |
|
11558 |
exports['default'] = _propTypes2['default'].oneOf([_constants.ICON_BEFORE_POSITION, _constants.ICON_AFTER_POSITION]);
|
11559 |
|
11560 |
/***/ }),
|
11561 |
+
/* 69 */
|
11562 |
/***/ (function(module, exports, __webpack_require__) {
|
11563 |
|
11564 |
"use strict";
|
11568 |
value: true
|
11569 |
});
|
11570 |
|
11571 |
+
var _propTypes = __webpack_require__(11);
|
11572 |
|
11573 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
11574 |
|
11575 |
+
var _constants = __webpack_require__(17);
|
11576 |
|
11577 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11578 |
|
11579 |
exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);
|
11580 |
|
11581 |
/***/ }),
|
11582 |
+
/* 70 */
|
11583 |
/***/ (function(module, exports, __webpack_require__) {
|
11584 |
|
11585 |
"use strict";
|
11590 |
});
|
11591 |
exports['default'] = isInclusivelyAfterDay;
|
11592 |
|
11593 |
+
var _moment = __webpack_require__(0);
|
11594 |
|
11595 |
var _moment2 = _interopRequireDefault(_moment);
|
11596 |
|
11597 |
+
var _isBeforeDay = __webpack_require__(71);
|
11598 |
|
11599 |
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
|
11600 |
|
11606 |
}
|
11607 |
|
11608 |
/***/ }),
|
11609 |
+
/* 71 */
|
11610 |
/***/ (function(module, exports, __webpack_require__) {
|
11611 |
|
11612 |
"use strict";
|
11617 |
});
|
11618 |
exports['default'] = isBeforeDay;
|
11619 |
|
11620 |
+
var _moment = __webpack_require__(0);
|
11621 |
|
11622 |
var _moment2 = _interopRequireDefault(_moment);
|
11623 |
|
11641 |
}
|
11642 |
|
11643 |
/***/ }),
|
11644 |
+
/* 72 */
|
11645 |
/***/ (function(module, exports, __webpack_require__) {
|
11646 |
|
11647 |
"use strict";
|
11651 |
value: true
|
11652 |
});
|
11653 |
|
11654 |
+
var _react = __webpack_require__(10);
|
11655 |
|
11656 |
var _react2 = _interopRequireDefault(_react);
|
11657 |
|
11678 |
exports['default'] = CloseButton;
|
11679 |
|
11680 |
/***/ }),
|
11681 |
+
/* 73 */
|
11682 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11683 |
|
11684 |
"use strict";
|
11685 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__menu__ = __webpack_require__(730);
|
11686 |
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__menu__["a"]; });
|
11687 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tabbable__ = __webpack_require__(731);
|
11688 |
/* unused harmony reexport TabbableContainer */
|
11689 |
/**
|
11690 |
* Internal Dependencies
|
11694 |
//# sourceMappingURL=index.js.map
|
11695 |
|
11696 |
/***/ }),
|
11697 |
+
/* 74 */
|
11698 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11699 |
+
|
11700 |
+
"use strict";
|
11701 |
+
/* unused harmony export escapeAmpersand */
|
11702 |
+
/* unused harmony export escapeQuotationMark */
|
11703 |
+
/* unused harmony export escapeLessThan */
|
11704 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = escapeAttribute;
|
11705 |
+
/* harmony export (immutable) */ __webpack_exports__["c"] = escapeHTML;
|
11706 |
+
/* harmony export (immutable) */ __webpack_exports__["b"] = escapeEditableHTML;
|
11707 |
+
/* harmony export (immutable) */ __webpack_exports__["d"] = isValidAttributeName;
|
11708 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__escape_greater__ = __webpack_require__(441);
|
11709 |
+
/**
|
11710 |
+
* Internal dependencies
|
11711 |
+
*/
|
11712 |
+
|
11713 |
+
/**
|
11714 |
+
* Regular expression matching invalid attribute names.
|
11715 |
+
*
|
11716 |
+
* "Attribute names must consist of one or more characters other than controls,
|
11717 |
+
* U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),
|
11718 |
+
* and noncharacters."
|
11719 |
+
*
|
11720 |
+
* @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
11721 |
+
*
|
11722 |
+
* @type {RegExp}
|
11723 |
+
*/
|
11724 |
+
|
11725 |
+
var REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
|
11726 |
+
/**
|
11727 |
+
* Returns a string with ampersands escaped. Note that this is an imperfect
|
11728 |
+
* implementation, where only ampersands which do not appear as a pattern of
|
11729 |
+
* named, decimal, or hexadecimal character references are escaped. Invalid
|
11730 |
+
* named references (i.e. ambiguous ampersand) are are still permitted.
|
11731 |
+
*
|
11732 |
+
* @see https://w3c.github.io/html/syntax.html#character-references
|
11733 |
+
* @see https://w3c.github.io/html/syntax.html#ambiguous-ampersand
|
11734 |
+
* @see https://w3c.github.io/html/syntax.html#named-character-references
|
11735 |
+
*
|
11736 |
+
* @param {string} value Original string.
|
11737 |
+
*
|
11738 |
+
* @return {string} Escaped string.
|
11739 |
+
*/
|
11740 |
+
|
11741 |
+
function escapeAmpersand(value) {
|
11742 |
+
return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&');
|
11743 |
+
}
|
11744 |
+
/**
|
11745 |
+
* Returns a string with quotation marks replaced.
|
11746 |
+
*
|
11747 |
+
* @param {string} value Original string.
|
11748 |
+
*
|
11749 |
+
* @return {string} Escaped string.
|
11750 |
+
*/
|
11751 |
+
|
11752 |
+
function escapeQuotationMark(value) {
|
11753 |
+
return value.replace(/"/g, '"');
|
11754 |
+
}
|
11755 |
+
/**
|
11756 |
+
* Returns a string with less-than sign replaced.
|
11757 |
+
*
|
11758 |
+
* @param {string} value Original string.
|
11759 |
+
*
|
11760 |
+
* @return {string} Escaped string.
|
11761 |
+
*/
|
11762 |
+
|
11763 |
+
function escapeLessThan(value) {
|
11764 |
+
return value.replace(/</g, '<');
|
11765 |
+
}
|
11766 |
+
/**
|
11767 |
+
* Returns an escaped attribute value.
|
11768 |
+
*
|
11769 |
+
* @see https://w3c.github.io/html/syntax.html#elements-attributes
|
11770 |
+
*
|
11771 |
+
* "[...] the text cannot contain an ambiguous ampersand [...] must not contain
|
11772 |
+
* any literal U+0022 QUOTATION MARK characters (")"
|
11773 |
+
*
|
11774 |
+
* Note we also escape the greater than symbol, as this is used by wptexturize to
|
11775 |
+
* split HTML strings. This is a WordPress specific fix
|
11776 |
+
*
|
11777 |
+
* Note that if a resolution for Trac#45387 comes to fruition, it is no longer
|
11778 |
+
* necessary for `__unstableEscapeGreaterThan` to be used.
|
11779 |
+
*
|
11780 |
+
* See: https://core.trac.wordpress.org/ticket/45387
|
11781 |
+
*
|
11782 |
+
* @param {string} value Attribute value.
|
11783 |
+
*
|
11784 |
+
* @return {string} Escaped attribute value.
|
11785 |
+
*/
|
11786 |
+
|
11787 |
+
function escapeAttribute(value) {
|
11788 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__escape_greater__["a" /* default */])(escapeQuotationMark(escapeAmpersand(value)));
|
11789 |
+
}
|
11790 |
+
/**
|
11791 |
+
* Returns an escaped HTML element value.
|
11792 |
+
*
|
11793 |
+
* @see https://w3c.github.io/html/syntax.html#writing-html-documents-elements
|
11794 |
+
*
|
11795 |
+
* "the text must not contain the character U+003C LESS-THAN SIGN (<) or an
|
11796 |
+
* ambiguous ampersand."
|
11797 |
+
*
|
11798 |
+
* @param {string} value Element value.
|
11799 |
+
*
|
11800 |
+
* @return {string} Escaped HTML element value.
|
11801 |
+
*/
|
11802 |
+
|
11803 |
+
function escapeHTML(value) {
|
11804 |
+
return escapeLessThan(escapeAmpersand(value));
|
11805 |
+
}
|
11806 |
+
/**
|
11807 |
+
* Returns an escaped Editable HTML element value. This is different from
|
11808 |
+
* `escapeHTML`, because for editable HTML, ALL ampersands must be escaped in
|
11809 |
+
* order to render the content correctly on the page.
|
11810 |
+
*
|
11811 |
+
* @param {string} value Element value.
|
11812 |
+
*
|
11813 |
+
* @return {string} Escaped HTML element value.
|
11814 |
+
*/
|
11815 |
+
|
11816 |
+
function escapeEditableHTML(value) {
|
11817 |
+
return escapeLessThan(value.replace(/&/g, '&'));
|
11818 |
+
}
|
11819 |
+
/**
|
11820 |
+
* Returns true if the given attribute name is valid, or false otherwise.
|
11821 |
+
*
|
11822 |
+
* @param {string} name Attribute name to test.
|
11823 |
+
*
|
11824 |
+
* @return {boolean} Whether attribute is valid.
|
11825 |
+
*/
|
11826 |
+
|
11827 |
+
function isValidAttributeName(name) {
|
11828 |
+
return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
|
11829 |
+
}
|
11830 |
+
//# sourceMappingURL=index.js.map
|
11831 |
+
|
11832 |
+
/***/ }),
|
11833 |
+
/* 75 */
|
11834 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11835 |
|
11836 |
"use strict";
|
11837 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__svg__ = __webpack_require__(442);
|
11838 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["a"]; });
|
11839 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["b"]; });
|
11840 |
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["c"]; });
|
11842 |
//# sourceMappingURL=index.js.map
|
11843 |
|
11844 |
/***/ }),
|
11845 |
+
/* 76 */
|
11846 |
/***/ (function(module, exports, __webpack_require__) {
|
11847 |
|
11848 |
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
11849 |
+
* Memize options object.
|
11850 |
+
*
|
11851 |
+
* @typedef MemizeOptions
|
11852 |
+
*
|
11853 |
+
* @property {number} [maxSize] Maximum size of the cache.
|
11854 |
+
*/
|
11855 |
|
11856 |
/**
|
11857 |
+
* Internal cache entry.
|
11858 |
+
*
|
11859 |
+
* @typedef MemizeCacheNode
|
11860 |
+
*
|
11861 |
+
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
11862 |
+
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
11863 |
+
* @property {Array<*>} args Function arguments for cache
|
11864 |
+
* entry.
|
11865 |
+
* @property {*} val Function result.
|
11866 |
*/
|
|
|
|
|
11867 |
|
11868 |
+
/**
|
11869 |
+
* Properties of the enhanced function for controlling cache.
|
11870 |
+
*
|
11871 |
+
* @typedef MemizeMemoizedFunction
|
11872 |
+
*
|
11873 |
+
* @property {()=>void} clear Clear the cache.
|
11874 |
+
*/
|
11875 |
|
11876 |
/**
|
11877 |
+
* Accepts a function to be memoized, and returns a new memoized function, with
|
11878 |
+
* optional options.
|
11879 |
*
|
11880 |
+
* @template {Function} F
|
|
|
11881 |
*
|
11882 |
+
* @param {F} fn Function to memoize.
|
11883 |
+
* @param {MemizeOptions} [options] Options object.
|
11884 |
+
*
|
11885 |
+
* @return {F & MemizeMemoizedFunction} Memoized function.
|
11886 |
*/
|
11887 |
+
function memize( fn, options ) {
|
11888 |
+
var size = 0;
|
11889 |
+
|
11890 |
+
/** @type {?MemizeCacheNode|undefined} */
|
11891 |
+
var head;
|
11892 |
+
|
11893 |
+
/** @type {?MemizeCacheNode|undefined} */
|
11894 |
+
var tail;
|
11895 |
+
|
11896 |
+
options = options || {};
|
11897 |
+
|
11898 |
+
function memoized( /* ...args */ ) {
|
11899 |
+
var node = head,
|
11900 |
+
len = arguments.length,
|
11901 |
+
args, i;
|
11902 |
+
|
11903 |
+
searchCache: while ( node ) {
|
11904 |
+
// Perform a shallow equality test to confirm that whether the node
|
11905 |
+
// under test is a candidate for the arguments passed. Two arrays
|
11906 |
+
// are shallowly equal if their length matches and each entry is
|
11907 |
+
// strictly equal between the two sets. Avoid abstracting to a
|
11908 |
+
// function which could incur an arguments leaking deoptimization.
|
11909 |
+
|
11910 |
+
// Check whether node arguments match arguments length
|
11911 |
+
if ( node.args.length !== arguments.length ) {
|
11912 |
+
node = node.next;
|
11913 |
+
continue;
|
11914 |
+
}
|
11915 |
+
|
11916 |
+
// Check whether node arguments match arguments values
|
11917 |
+
for ( i = 0; i < len; i++ ) {
|
11918 |
+
if ( node.args[ i ] !== arguments[ i ] ) {
|
11919 |
+
node = node.next;
|
11920 |
+
continue searchCache;
|
11921 |
+
}
|
11922 |
+
}
|
11923 |
+
|
11924 |
+
// At this point we can assume we've found a match
|
11925 |
+
|
11926 |
+
// Surface matched node to head if not already
|
11927 |
+
if ( node !== head ) {
|
11928 |
+
// As tail, shift to previous. Must only shift if not also
|
11929 |
+
// head, since if both head and tail, there is no previous.
|
11930 |
+
if ( node === tail ) {
|
11931 |
+
tail = node.prev;
|
11932 |
+
}
|
11933 |
+
|
11934 |
+
// Adjust siblings to point to each other. If node was tail,
|
11935 |
+
// this also handles new tail's empty `next` assignment.
|
11936 |
+
/** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
|
11937 |
+
if ( node.next ) {
|
11938 |
+
node.next.prev = node.prev;
|
11939 |
+
}
|
11940 |
+
|
11941 |
+
node.next = head;
|
11942 |
+
node.prev = null;
|
11943 |
+
/** @type {MemizeCacheNode} */ ( head ).prev = node;
|
11944 |
+
head = node;
|
11945 |
+
}
|
11946 |
+
|
11947 |
+
// Return immediately
|
11948 |
+
return node.val;
|
11949 |
+
}
|
11950 |
+
|
11951 |
+
// No cached value found. Continue to insertion phase:
|
11952 |
+
|
11953 |
+
// Create a copy of arguments (avoid leaking deoptimization)
|
11954 |
+
args = new Array( len );
|
11955 |
+
for ( i = 0; i < len; i++ ) {
|
11956 |
+
args[ i ] = arguments[ i ];
|
11957 |
+
}
|
11958 |
+
|
11959 |
+
node = {
|
11960 |
+
args: args,
|
11961 |
+
|
11962 |
+
// Generate the result from original function
|
11963 |
+
val: fn.apply( null, args ),
|
11964 |
+
};
|
11965 |
+
|
11966 |
+
// Don't need to check whether node is already head, since it would
|
11967 |
+
// have been returned above already if it was
|
11968 |
+
|
11969 |
+
// Shift existing head down list
|
11970 |
+
if ( head ) {
|
11971 |
+
head.prev = node;
|
11972 |
+
node.next = head;
|
11973 |
+
} else {
|
11974 |
+
// If no head, follows that there's no tail (at initial or reset)
|
11975 |
+
tail = node;
|
11976 |
+
}
|
11977 |
+
|
11978 |
+
// Trim tail if we're reached max size and are pending cache insertion
|
11979 |
+
if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
|
11980 |
+
tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
|
11981 |
+
/** @type {MemizeCacheNode} */ ( tail ).next = null;
|
11982 |
+
} else {
|
11983 |
+
size++;
|
11984 |
}
|
11985 |
+
|
11986 |
+
head = node;
|
11987 |
+
|
11988 |
+
return node.val;
|
11989 |
}
|
11990 |
|
11991 |
+
memoized.clear = function() {
|
11992 |
+
head = null;
|
11993 |
+
tail = null;
|
11994 |
+
size = 0;
|
11995 |
+
};
|
11996 |
+
|
11997 |
+
if ( process.env.NODE_ENV === 'test' ) {
|
11998 |
+
// Cache is not exposed in the public API, but used in tests to ensure
|
11999 |
+
// expected list progression
|
12000 |
+
memoized.getCache = function() {
|
12001 |
+
return [ head, tail, size ];
|
12002 |
+
};
|
12003 |
+
}
|
12004 |
+
|
12005 |
+
// Ignore reason: There's not a clear solution to create an intersection of
|
12006 |
+
// the function with additional properties, where the goal is to retain the
|
12007 |
+
// function signature of the incoming argument and add control properties
|
12008 |
+
// on the return value.
|
12009 |
+
|
12010 |
+
// @ts-ignore
|
12011 |
+
return memoized;
|
12012 |
}
|
12013 |
|
12014 |
+
module.exports = memize;
|
12015 |
|
12016 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
12017 |
|
12018 |
/***/ }),
|
12019 |
+
/* 77 */
|
12020 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
12021 |
|
12022 |
+
var g;
|
12023 |
|
12024 |
+
// This works in non-strict mode
|
12025 |
+
g = (function() {
|
12026 |
+
return this;
|
12027 |
+
})();
|
12028 |
|
12029 |
+
try {
|
12030 |
+
// This works if eval is allowed (see CSP)
|
12031 |
+
g = g || Function("return this")() || (1,eval)("this");
|
12032 |
+
} catch(e) {
|
12033 |
+
// This works if the window reference is available
|
12034 |
+
if(typeof window === "object")
|
12035 |
+
g = window;
|
12036 |
}
|
12037 |
|
12038 |
+
// g can still be undefined, but nothing to do about it...
|
12039 |
+
// We return undefined, instead of nothing here, so it's
|
12040 |
+
// easier to handle this case. if(!global) { ...}
|
12041 |
+
|
12042 |
+
module.exports = g;
|
12043 |
+
|
12044 |
+
|
12045 |
/***/ }),
|
12046 |
+
/* 78 */
|
12047 |
/***/ (function(module, exports, __webpack_require__) {
|
12048 |
|
12049 |
"use strict";
|
12055 |
|
12056 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
12057 |
|
12058 |
+
var _keys = __webpack_require__(154);
|
12059 |
|
12060 |
var _keys2 = _interopRequireDefault(_keys);
|
12061 |
|
12107 |
exports.default = is;
|
12108 |
|
12109 |
/***/ }),
|
12110 |
+
/* 79 */
|
12111 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12112 |
|
12113 |
"use strict";
|
12114 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__ = __webpack_require__(44);
|
12115 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__["a"]; });
|
12116 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__ = __webpack_require__(528);
|
12117 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__["a"]; });
|
12118 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__higher_order_if_condition__ = __webpack_require__(529);
|
12119 |
+
/* unused harmony reexport ifCondition */
|
12120 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__higher_order_pure__ = __webpack_require__(530);
|
12121 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_3__higher_order_pure__["a"]; });
|
12122 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__higher_order_with_global_events__ = __webpack_require__(533);
|
12123 |
+
/* unused harmony reexport withGlobalEvents */
|
12124 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__higher_order_with_instance_id__ = __webpack_require__(535);
|
12125 |
+
/* unused harmony reexport withInstanceId */
|
12126 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__ = __webpack_require__(536);
|
12127 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__["a"]; });
|
12128 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__higher_order_with_state__ = __webpack_require__(537);
|
12129 |
+
/* unused harmony reexport withState */
|
12130 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__hooks_use_dragging__ = __webpack_require__(538);
|
12131 |
+
/* unused harmony reexport __experimentalUseDragging */
|
12132 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__hooks_use_instance_id__ = __webpack_require__(157);
|
12133 |
+
/* unused harmony reexport useInstanceId */
|
12134 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__hooks_use_keyboard_shortcut__ = __webpack_require__(539);
|
12135 |
+
/* unused harmony reexport useKeyboardShortcut */
|
12136 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__hooks_use_media_query__ = __webpack_require__(106);
|
12137 |
+
/* unused harmony reexport useMediaQuery */
|
12138 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__hooks_use_reduced_motion__ = __webpack_require__(540);
|
12139 |
+
/* unused harmony reexport useReducedMotion */
|
12140 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__hooks_use_viewport_match__ = __webpack_require__(541);
|
12141 |
+
/* unused harmony reexport useViewportMatch */
|
12142 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__hooks_use_resize_observer__ = __webpack_require__(542);
|
12143 |
+
/* unused harmony reexport useResizeObserver */
|
12144 |
+
// Utils
|
12145 |
+
// Compose helper (aliased flowRight from Lodash)
|
12146 |
|
12147 |
+
// Higher-order components
|
12148 |
|
|
|
|
|
|
|
12149 |
|
|
|
|
|
|
|
12150 |
|
12151 |
|
12152 |
|
12153 |
|
12154 |
+
// Hooks
|
12155 |
|
|
|
|
|
|
|
12156 |
|
|
|
|
|
|
|
12157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12159 |
|
|
|
|
|
|
|
|
|
12160 |
|
|
|
|
|
12161 |
|
|
|
|
|
|
|
12162 |
|
12163 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
12164 |
|
12165 |
+
/***/ }),
|
12166 |
+
/* 80 */
|
12167 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12168 |
|
12169 |
+
"use strict";
|
12170 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useRegistry;
|
12171 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
|
12172 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__context__ = __webpack_require__(159);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12173 |
/**
|
12174 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12175 |
*/
|
12176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12177 |
/**
|
12178 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
12179 |
*/
|
12180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12182 |
/**
|
12183 |
+
* A custom react hook exposing the registry context for use.
|
12184 |
*
|
12185 |
+
* This exposes the `registry` value provided via the
|
12186 |
+
* <a href="#RegistryProvider">Registry Provider</a> to a component implementing
|
12187 |
+
* this hook.
|
12188 |
*
|
12189 |
+
* It acts similarly to the `useContext` react hook.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12190 |
*
|
12191 |
+
* Note: Generally speaking, `useRegistry` is a low level hook that in most cases
|
12192 |
+
* won't be needed for implementation. Most interactions with the wp.data api
|
12193 |
+
* can be performed via the `useSelect` hook, or the `withSelect` and
|
12194 |
+
* `withDispatch` higher order components.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12195 |
*
|
12196 |
+
* @example
|
12197 |
+
* ```js
|
12198 |
+
* const {
|
12199 |
+
* RegistryProvider,
|
12200 |
+
* createRegistry,
|
12201 |
+
* useRegistry,
|
12202 |
+
* } = wp.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12203 |
*
|
12204 |
+
* const registry = createRegistry( {} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12205 |
*
|
12206 |
+
* const SomeChildUsingRegistry = ( props ) => {
|
12207 |
+
* const registry = useRegistry( registry );
|
12208 |
+
* // ...logic implementing the registry in other react hooks.
|
12209 |
+
* };
|
12210 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12211 |
*
|
12212 |
+
* const ParentProvidingRegistry = ( props ) => {
|
12213 |
+
* return <RegistryProvider value={ registry }>
|
12214 |
+
* <SomeChildUsingRegistry { ...props } />
|
12215 |
+
* </RegistryProvider>
|
12216 |
+
* };
|
12217 |
+
* ```
|
12218 |
*
|
12219 |
+
* @return {Function} A custom react hook exposing the registry context value.
|
12220 |
*/
|
12221 |
|
12222 |
+
function useRegistry() {
|
12223 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["g" /* useContext */])(__WEBPACK_IMPORTED_MODULE_1__context__["a" /* Context */]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12224 |
}
|
12225 |
+
//# sourceMappingURL=use-registry.js.map
|
12226 |
|
12227 |
/***/ }),
|
12228 |
+
/* 81 */
|
12229 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12230 |
|
12231 |
"use strict";
|
12232 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
12233 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
12234 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
12235 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
12236 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
12237 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
12238 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
12239 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
12240 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_element__ = __webpack_require__(1);
|
12241 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(13);
|
12242 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
|
12243 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal__ = __webpack_require__(181);
|
12244 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal__);
|
12245 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__wordpress_dom__ = __webpack_require__(52);
|
12246 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__wordpress_keycodes__ = __webpack_require__(31);
|
12247 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(579);
|
12248 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__higher_order_with_focus_return__ = __webpack_require__(114);
|
12249 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__higher_order_with_constrained_tabbing__ = __webpack_require__(115);
|
12250 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__detect_outside__ = __webpack_require__(580);
|
12251 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__icon_button__ = __webpack_require__(35);
|
12252 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__scroll_lock__ = __webpack_require__(184);
|
12253 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isolated_event_container__ = __webpack_require__(117);
|
12254 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__slot_fill__ = __webpack_require__(185);
|
12255 |
|
12256 |
|
12257 |
|
12640 |
//# sourceMappingURL=index.js.map
|
12641 |
|
12642 |
/***/ }),
|
12643 |
+
/* 82 */
|
12644 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12645 |
|
12646 |
"use strict";
|
12650 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
12651 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
12652 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
12653 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
|
12654 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_deprecated__ = __webpack_require__(102);
|
12655 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__popover__ = __webpack_require__(81);
|
12656 |
|
12657 |
|
12658 |
|
12801 |
//# sourceMappingURL=index.js.map
|
12802 |
|
12803 |
/***/ }),
|
12804 |
+
/* 83 */
|
12805 |
/***/ (function(module, exports, __webpack_require__) {
|
12806 |
|
12807 |
"use strict";
|
12808 |
|
12809 |
|
12810 |
+
var implementation = __webpack_require__(607);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12811 |
|
12812 |
+
module.exports = Function.prototype.bind || implementation;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12813 |
|
12814 |
|
12815 |
/***/ }),
|
12816 |
+
/* 84 */
|
12817 |
/***/ (function(module, exports, __webpack_require__) {
|
12818 |
|
12819 |
"use strict";
|
12820 |
|
12821 |
|
12822 |
+
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12823 |
|
12824 |
+
module.exports = __webpack_require__(197);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12825 |
|
|
|
12826 |
|
12827 |
+
/***/ }),
|
12828 |
+
/* 85 */
|
12829 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12830 |
|
12831 |
+
"use strict";
|
|
|
|
|
|
|
12832 |
|
|
|
|
|
|
|
|
|
12833 |
|
12834 |
+
module.exports = __webpack_require__(637);
|
|
|
|
|
|
|
|
|
|
|
12835 |
|
12836 |
|
12837 |
/***/ }),
|
12838 |
+
/* 86 */
|
12839 |
/***/ (function(module, exports, __webpack_require__) {
|
12840 |
|
12841 |
"use strict";
|
12845 |
value: true
|
12846 |
});
|
12847 |
|
12848 |
+
var _propTypes = __webpack_require__(11);
|
12849 |
|
12850 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
12851 |
|
12852 |
+
var _airbnbPropTypes = __webpack_require__(21);
|
12853 |
|
12854 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12855 |
|
12880 |
}()], 'Modifiers (Set of Strings)');
|
12881 |
|
12882 |
/***/ }),
|
12883 |
+
/* 87 */
|
12884 |
/***/ (function(module, exports, __webpack_require__) {
|
12885 |
|
12886 |
"use strict";
|
12891 |
});
|
12892 |
exports['default'] = toISODateString;
|
12893 |
|
12894 |
+
var _moment = __webpack_require__(0);
|
12895 |
|
12896 |
var _moment2 = _interopRequireDefault(_moment);
|
12897 |
|
12898 |
+
var _toMomentObject = __webpack_require__(57);
|
12899 |
|
12900 |
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
|
12901 |
|
12902 |
+
var _constants = __webpack_require__(17);
|
12903 |
|
12904 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12905 |
|
12911 |
}
|
12912 |
|
12913 |
/***/ }),
|
12914 |
+
/* 88 */
|
12915 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12916 |
|
12917 |
"use strict";
|
13126 |
|
13127 |
|
13128 |
/***/ }),
|
13129 |
+
/* 89 */
|
13130 |
/***/ (function(module, exports, __webpack_require__) {
|
13131 |
|
13132 |
"use strict";
|
13137 |
});
|
13138 |
exports['default'] = toISOMonthString;
|
13139 |
|
13140 |
+
var _moment = __webpack_require__(0);
|
13141 |
|
13142 |
var _moment2 = _interopRequireDefault(_moment);
|
13143 |
|
13144 |
+
var _toMomentObject = __webpack_require__(57);
|
13145 |
|
13146 |
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
|
13147 |
|
13148 |
+
var _constants = __webpack_require__(17);
|
13149 |
|
13150 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13151 |
|
13157 |
}
|
13158 |
|
13159 |
/***/ }),
|
13160 |
+
/* 90 */
|
13161 |
/***/ (function(module, exports, __webpack_require__) {
|
13162 |
|
13163 |
"use strict";
|
13167 |
value: true
|
13168 |
});
|
13169 |
|
13170 |
+
var _propTypes = __webpack_require__(11);
|
13171 |
|
13172 |
var _propTypes2 = _interopRequireDefault(_propTypes);
|
13173 |
|
13174 |
+
var _constants = __webpack_require__(17);
|
13175 |
|
13176 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13177 |
|
13178 |
exports['default'] = _propTypes2['default'].oneOfType([_propTypes2['default'].bool, _propTypes2['default'].oneOf([_constants.START_DATE, _constants.END_DATE])]);
|
13179 |
|
13180 |
/***/ }),
|
13181 |
+
/* 91 */
|
13182 |
/***/ (function(module, exports, __webpack_require__) {
|
13183 |
|
13184 |
"use strict";
|
13189 |
});
|
13190 |
exports['default'] = isAfterDay;
|
13191 |
|
13192 |
+
var _moment = __webpack_require__(0);
|
13193 |
|
13194 |
var _moment2 = _interopRequireDefault(_moment);
|
13195 |
|
13196 |
+
var _isBeforeDay = __webpack_require__(71);
|
13197 |
|
13198 |
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
|
13199 |
|
13200 |
+
var _isSameDay = __webpack_require__(56);
|
13201 |
|
13202 |
var _isSameDay2 = _interopRequireDefault(_isSameDay);
|
13203 |
|
13209 |
}
|
13210 |
|
13211 |
/***/ }),
|
13212 |
+
/* 92 */
|
13213 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13214 |
|
13215 |
"use strict";
|
13216 |
/* harmony export (immutable) */ __webpack_exports__["f"] = concatChildren;
|
13217 |
/* unused harmony export switchChildrenNodeName */
|
13218 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(22);
|
13219 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
13220 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(10);
|
13221 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
13222 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
|
13223 |
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
|
13370 |
//# sourceMappingURL=react.js.map
|
13371 |
|
13372 |
/***/ }),
|
13373 |
+
/* 93 */
|
13374 |
/***/ (function(module, exports, __webpack_require__) {
|
13375 |
|
13376 |
"use strict";
|
13386 |
var printWarning = function() {};
|
13387 |
|
13388 |
if (process.env.NODE_ENV !== 'production') {
|
13389 |
+
var ReactPropTypesSecret = __webpack_require__(94);
|
13390 |
var loggedTypeFailures = {};
|
13391 |
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
13392 |
|
13393 |
printWarning = function(text) {
|
13394 |
var message = 'Warning: ' + text;
|
13418 |
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
13419 |
if (process.env.NODE_ENV !== 'production') {
|
13420 |
for (var typeSpecName in typeSpecs) {
|
13421 |
+
if (has(typeSpecs, typeSpecName)) {
|
13422 |
var error;
|
13423 |
// Prop type validation may throw. In case they do, we don't want to
|
13424 |
// fail the render phase where it didn't fail before. So we log it.
|
13446 |
'You may have forgotten to pass an argument to the type checker ' +
|
13447 |
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
13448 |
'shape all require an argument).'
|
13449 |
+
);
|
|
|
13450 |
}
|
13451 |
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
13452 |
// Only monitor this failure once because there tends to be a lot of the
|
13464 |
}
|
13465 |
}
|
13466 |
|
13467 |
+
/**
|
13468 |
+
* Resets warning cache when testing.
|
13469 |
+
*
|
13470 |
+
* @private
|
13471 |
+
*/
|
13472 |
+
checkPropTypes.resetWarningCache = function() {
|
13473 |
+
if (process.env.NODE_ENV !== 'production') {
|
13474 |
+
loggedTypeFailures = {};
|
13475 |
+
}
|
13476 |
+
}
|
13477 |
+
|
13478 |
module.exports = checkPropTypes;
|
13479 |
|
13480 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
13481 |
|
13482 |
/***/ }),
|
13483 |
+
/* 94 */
|
13484 |
/***/ (function(module, exports, __webpack_require__) {
|
13485 |
|
13486 |
"use strict";
|
13499 |
|
13500 |
|
13501 |
/***/ }),
|
13502 |
+
/* 95 */
|
13503 |
+
/***/ (function(module, exports, __webpack_require__) {
|
13504 |
|
13505 |
+
var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
|
|
|
|
|
|
|
|
|
|
|
|
|
13506 |
|
13507 |
+
!function() {
|
13508 |
+
'use strict'
|
|
|
13509 |
|
13510 |
+
var re = {
|
13511 |
+
not_string: /[^s]/,
|
13512 |
+
not_bool: /[^t]/,
|
13513 |
+
not_type: /[^T]/,
|
13514 |
+
not_primitive: /[^v]/,
|
13515 |
+
number: /[diefg]/,
|
13516 |
+
numeric_arg: /[bcdiefguxX]/,
|
13517 |
+
json: /[j]/,
|
13518 |
+
not_json: /[^j]/,
|
13519 |
+
text: /^[^\x25]+/,
|
13520 |
+
modulo: /^\x25{2}/,
|
13521 |
+
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
|
13522 |
+
key: /^([a-z_][a-z_\d]*)/i,
|
13523 |
+
key_access: /^\.([a-z_][a-z_\d]*)/i,
|
13524 |
+
index_access: /^\[(\d+)\]/,
|
13525 |
+
sign: /^[+-]/
|
13526 |
+
}
|
13527 |
|
13528 |
+
function sprintf(key) {
|
13529 |
+
// `arguments` is not an array, but should be fine for this call
|
13530 |
+
return sprintf_format(sprintf_parse(key), arguments)
|
13531 |
+
}
|
13532 |
|
13533 |
+
function vsprintf(fmt, argv) {
|
13534 |
+
return sprintf.apply(null, [fmt].concat(argv || []))
|
13535 |
+
}
|
13536 |
|
13537 |
+
function sprintf_format(parse_tree, argv) {
|
13538 |
+
var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign
|
13539 |
+
for (i = 0; i < tree_length; i++) {
|
13540 |
+
if (typeof parse_tree[i] === 'string') {
|
13541 |
+
output += parse_tree[i]
|
13542 |
+
}
|
13543 |
+
else if (typeof parse_tree[i] === 'object') {
|
13544 |
+
ph = parse_tree[i] // convenience purposes only
|
13545 |
+
if (ph.keys) { // keyword argument
|
13546 |
+
arg = argv[cursor]
|
13547 |
+
for (k = 0; k < ph.keys.length; k++) {
|
13548 |
+
if (arg == undefined) {
|
13549 |
+
throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1]))
|
13550 |
+
}
|
13551 |
+
arg = arg[ph.keys[k]]
|
13552 |
+
}
|
13553 |
+
}
|
13554 |
+
else if (ph.param_no) { // positional argument (explicit)
|
13555 |
+
arg = argv[ph.param_no]
|
13556 |
+
}
|
13557 |
+
else { // positional argument (implicit)
|
13558 |
+
arg = argv[cursor++]
|
13559 |
+
}
|
13560 |
|
13561 |
+
if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
|
13562 |
+
arg = arg()
|
13563 |
+
}
|
13564 |
|
13565 |
+
if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
|
13566 |
+
throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
|
13567 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13568 |
|
13569 |
+
if (re.number.test(ph.type)) {
|
13570 |
+
is_positive = arg >= 0
|
13571 |
+
}
|
|
|
|
|
13572 |
|
13573 |
+
switch (ph.type) {
|
13574 |
+
case 'b':
|
13575 |
+
arg = parseInt(arg, 10).toString(2)
|
13576 |
+
break
|
13577 |
+
case 'c':
|
13578 |
+
arg = String.fromCharCode(parseInt(arg, 10))
|
13579 |
+
break
|
13580 |
+
case 'd':
|
13581 |
+
case 'i':
|
13582 |
+
arg = parseInt(arg, 10)
|
13583 |
+
break
|
13584 |
+
case 'j':
|
13585 |
+
arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)
|
13586 |
+
break
|
13587 |
+
case 'e':
|
13588 |
+
arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()
|
13589 |
+
break
|
13590 |
+
case 'f':
|
13591 |
+
arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)
|
13592 |
+
break
|
13593 |
+
case 'g':
|
13594 |
+
arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)
|
13595 |
+
break
|
13596 |
+
case 'o':
|
13597 |
+
arg = (parseInt(arg, 10) >>> 0).toString(8)
|
13598 |
+
break
|
13599 |
+
case 's':
|
13600 |
+
arg = String(arg)
|
13601 |
+
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
13602 |
+
break
|
13603 |
+
case 't':
|
13604 |
+
arg = String(!!arg)
|
13605 |
+
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
13606 |
+
break
|
13607 |
+
case 'T':
|
13608 |
+
arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()
|
13609 |
+
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
13610 |
+
break
|
13611 |
+
case 'u':
|
13612 |
+
arg = parseInt(arg, 10) >>> 0
|
13613 |
+
break
|
13614 |
+
case 'v':
|
13615 |
+
arg = arg.valueOf()
|
13616 |
+
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
13617 |
+
break
|
13618 |
+
case 'x':
|
13619 |
+
arg = (parseInt(arg, 10) >>> 0).toString(16)
|
13620 |
+
break
|
13621 |
+
case 'X':
|
13622 |
+
arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()
|
13623 |
+
break
|
13624 |
+
}
|
13625 |
+
if (re.json.test(ph.type)) {
|
13626 |
+
output += arg
|
13627 |
+
}
|
13628 |
+
else {
|
13629 |
+
if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
|
13630 |
+
sign = is_positive ? '+' : '-'
|
13631 |
+
arg = arg.toString().replace(re.sign, '')
|
13632 |
+
}
|
13633 |
+
else {
|
13634 |
+
sign = ''
|
13635 |
+
}
|
13636 |
+
pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '
|
13637 |
+
pad_length = ph.width - (sign + arg).length
|
13638 |
+
pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
|
13639 |
+
output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
|
13640 |
+
}
|
13641 |
+
}
|
13642 |
+
}
|
13643 |
+
return output
|
13644 |
+
}
|
13645 |
|
13646 |
+
var sprintf_cache = Object.create(null)
|
13647 |
+
|
13648 |
+
function sprintf_parse(fmt) {
|
13649 |
+
if (sprintf_cache[fmt]) {
|
13650 |
+
return sprintf_cache[fmt]
|
13651 |
+
}
|
13652 |
+
|
13653 |
+
var _fmt = fmt, match, parse_tree = [], arg_names = 0
|
13654 |
+
while (_fmt) {
|
13655 |
+
if ((match = re.text.exec(_fmt)) !== null) {
|
13656 |
+
parse_tree.push(match[0])
|
13657 |
+
}
|
13658 |
+
else if ((match = re.modulo.exec(_fmt)) !== null) {
|
13659 |
+
parse_tree.push('%')
|
13660 |
+
}
|
13661 |
+
else if ((match = re.placeholder.exec(_fmt)) !== null) {
|
13662 |
+
if (match[2]) {
|
13663 |
+
arg_names |= 1
|
13664 |
+
var field_list = [], replacement_field = match[2], field_match = []
|
13665 |
+
if ((field_match = re.key.exec(replacement_field)) !== null) {
|
13666 |
+
field_list.push(field_match[1])
|
13667 |
+
while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
|
13668 |
+
if ((field_match = re.key_access.exec(replacement_field)) !== null) {
|
13669 |
+
field_list.push(field_match[1])
|
13670 |
+
}
|
13671 |
+
else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
|
13672 |
+
field_list.push(field_match[1])
|
13673 |
+
}
|
13674 |
+
else {
|
13675 |
+
throw new SyntaxError('[sprintf] failed to parse named argument key')
|
13676 |
+
}
|
13677 |
+
}
|
13678 |
+
}
|
13679 |
+
else {
|
13680 |
+
throw new SyntaxError('[sprintf] failed to parse named argument key')
|
13681 |
+
}
|
13682 |
+
match[2] = field_list
|
13683 |
+
}
|
13684 |
+
else {
|
13685 |
+
arg_names |= 2
|
13686 |
+
}
|
13687 |
+
if (arg_names === 3) {
|
13688 |
+
throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')
|
13689 |
+
}
|
13690 |
+
|
13691 |
+
parse_tree.push(
|
13692 |
+
{
|
13693 |
+
placeholder: match[0],
|
13694 |
+
param_no: match[1],
|
13695 |
+
keys: match[2],
|
13696 |
+
sign: match[3],
|
13697 |
+
pad_char: match[4],
|
13698 |
+
align: match[5],
|
13699 |
+
width: match[6],
|
13700 |
+
precision: match[7],
|
13701 |
+
type: match[8]
|
13702 |
+
}
|
13703 |
+
)
|
13704 |
+
}
|
13705 |
+
else {
|
13706 |
+
throw new SyntaxError('[sprintf] unexpected placeholder')
|
13707 |
+
}
|
13708 |
+
_fmt = _fmt.substring(match[0].length)
|
13709 |
+
}
|
13710 |
+
return sprintf_cache[fmt] = parse_tree
|
13711 |
+
}
|
13712 |
+
|
13713 |
+
/**
|
13714 |
+
* export to either browser or node.js
|
13715 |
+
*/
|
13716 |
+
/* eslint-disable quote-props */
|
13717 |
+
if (true) {
|
13718 |
+
exports['sprintf'] = sprintf
|
13719 |
+
exports['vsprintf'] = vsprintf
|
13720 |
+
}
|
13721 |
+
if (typeof window !== 'undefined') {
|
13722 |
+
window['sprintf'] = sprintf
|
13723 |
+
window['vsprintf'] = vsprintf
|
13724 |
+
|
13725 |
+
if (true) {
|
13726 |
+
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
|
13727 |
+
return {
|
13728 |
+
'sprintf': sprintf,
|
13729 |
+
'vsprintf': vsprintf
|
13730 |
+
}
|
13731 |
+
}).call(exports, __webpack_require__, exports, module),
|
13732 |
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
|
13733 |
+
}
|
13734 |
+
}
|
13735 |
+
/* eslint-enable quote-props */
|
13736 |
+
}(); // eslint-disable-line
|
13737 |
|
|
|
|
|
13738 |
|
13739 |
/***/ }),
|
13740 |
+
/* 96 */
|
13741 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13742 |
|
13743 |
"use strict";
|
13744 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = Tannin;
|
13745 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tannin_plural_forms__ = __webpack_require__(450);
|
|
|
|
|
|
|
|
|
|
|
13746 |
|
13747 |
|
13748 |
+
/**
|
13749 |
+
* Tannin constructor options.
|
13750 |
+
*
|
13751 |
+
* @typedef {Object} TanninOptions
|
13752 |
+
*
|
13753 |
+
* @property {string} [contextDelimiter] Joiner in string lookup with context.
|
13754 |
+
* @property {Function} [onMissingKey] Callback to invoke when key missing.
|
13755 |
+
*/
|
13756 |
|
13757 |
+
/**
|
13758 |
+
* Domain metadata.
|
13759 |
+
*
|
13760 |
+
* @typedef {Object} TanninDomainMetadata
|
13761 |
+
*
|
13762 |
+
* @property {string} [domain] Domain name.
|
13763 |
+
* @property {string} [lang] Language code.
|
13764 |
+
* @property {(string|Function)} [plural_forms] Plural forms expression or
|
13765 |
+
* function evaluator.
|
13766 |
+
*/
|
13767 |
|
13768 |
+
/**
|
13769 |
+
* Domain translation pair respectively representing the singular and plural
|
13770 |
+
* translation.
|
13771 |
+
*
|
13772 |
+
* @typedef {[string,string]} TanninTranslation
|
13773 |
+
*/
|
13774 |
|
13775 |
+
/**
|
13776 |
+
* Locale data domain. The key is used as reference for lookup, the value an
|
13777 |
+
* array of two string entries respectively representing the singular and plural
|
13778 |
+
* translation.
|
13779 |
+
*
|
13780 |
+
* @typedef {{[key:string]:TanninDomainMetadata|TanninTranslation,'':TanninDomainMetadata|TanninTranslation}} TanninLocaleDomain
|
13781 |
+
*/
|
13782 |
|
13783 |
+
/**
|
13784 |
+
* Jed-formatted locale data.
|
13785 |
+
*
|
13786 |
+
* @see http://messageformat.github.io/Jed/
|
13787 |
+
*
|
13788 |
+
* @typedef {{[domain:string]:TanninLocaleDomain}} TanninLocaleData
|
13789 |
+
*/
|
13790 |
|
13791 |
/**
|
13792 |
+
* Default Tannin constructor options.
|
13793 |
+
*
|
13794 |
+
* @type {TanninOptions}
|
13795 |
+
*/
|
13796 |
+
var DEFAULT_OPTIONS = {
|
13797 |
+
contextDelimiter: '\u0004',
|
13798 |
+
onMissingKey: null,
|
13799 |
+
};
|
13800 |
+
|
13801 |
+
/**
|
13802 |
+
* Given a specific locale data's config `plural_forms` value, returns the
|
13803 |
+
* expression.
|
13804 |
+
*
|
13805 |
+
* @example
|
13806 |
+
*
|
13807 |
+
* ```
|
13808 |
+
* getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'
|
13809 |
+
* ```
|
13810 |
+
*
|
13811 |
+
* @param {string} pf Locale data plural forms.
|
13812 |
+
*
|
13813 |
+
* @return {string} Plural forms expression.
|
13814 |
*/
|
13815 |
+
function getPluralExpression( pf ) {
|
13816 |
+
var parts, i, part;
|
13817 |
+
|
13818 |
+
parts = pf.split( ';' );
|
13819 |
|
13820 |
+
for ( i = 0; i < parts.length; i++ ) {
|
13821 |
+
part = parts[ i ].trim();
|
13822 |
+
if ( part.indexOf( 'plural=' ) === 0 ) {
|
13823 |
+
return part.substr( 7 );
|
13824 |
+
}
|
13825 |
+
}
|
13826 |
+
}
|
13827 |
|
13828 |
/**
|
13829 |
+
* Tannin constructor.
|
|
|
|
|
|
|
13830 |
*
|
13831 |
+
* @class
|
13832 |
*
|
13833 |
+
* @param {TanninLocaleData} data Jed-formatted locale data.
|
13834 |
+
* @param {TanninOptions} [options] Tannin options.
|
13835 |
*/
|
13836 |
+
function Tannin( data, options ) {
|
13837 |
+
var key;
|
13838 |
|
13839 |
+
/**
|
13840 |
+
* Jed-formatted locale data.
|
13841 |
+
*
|
13842 |
+
* @name Tannin#data
|
13843 |
+
* @type {TanninLocaleData}
|
13844 |
+
*/
|
13845 |
+
this.data = data;
|
13846 |
|
13847 |
+
/**
|
13848 |
+
* Plural forms function cache, keyed by plural forms string.
|
13849 |
+
*
|
13850 |
+
* @name Tannin#pluralForms
|
13851 |
+
* @type {Object<string,Function>}
|
13852 |
+
*/
|
13853 |
+
this.pluralForms = {};
|
13854 |
|
13855 |
+
/**
|
13856 |
+
* Effective options for instance, including defaults.
|
13857 |
+
*
|
13858 |
+
* @name Tannin#options
|
13859 |
+
* @type {TanninOptions}
|
13860 |
+
*/
|
13861 |
+
this.options = {};
|
13862 |
|
13863 |
+
for ( key in DEFAULT_OPTIONS ) {
|
13864 |
+
this.options[ key ] = options !== undefined && key in options
|
13865 |
+
? options[ key ]
|
13866 |
+
: DEFAULT_OPTIONS[ key ];
|
13867 |
+
}
|
13868 |
+
}
|
13869 |
|
13870 |
+
/**
|
13871 |
+
* Returns the plural form index for the given domain and value.
|
13872 |
+
*
|
13873 |
+
* @param {string} domain Domain on which to calculate plural form.
|
13874 |
+
* @param {number} n Value for which plural form is to be calculated.
|
13875 |
+
*
|
13876 |
+
* @return {number} Plural form index.
|
13877 |
+
*/
|
13878 |
+
Tannin.prototype.getPluralForm = function( domain, n ) {
|
13879 |
+
var getPluralForm = this.pluralForms[ domain ],
|
13880 |
+
config, plural, pf;
|
13881 |
|
13882 |
+
if ( ! getPluralForm ) {
|
13883 |
+
config = this.data[ domain ][ '' ];
|
|
|
13884 |
|
13885 |
+
pf = (
|
13886 |
+
config[ 'Plural-Forms' ] ||
|
13887 |
+
config[ 'plural-forms' ] ||
|
13888 |
+
// Ignore reason: As known, there's no way to document the empty
|
13889 |
+
// string property on a key to guarantee this as metadata.
|
13890 |
+
// @ts-ignore
|
13891 |
+
config.plural_forms
|
13892 |
+
);
|
13893 |
|
13894 |
+
if ( typeof pf !== 'function' ) {
|
13895 |
+
plural = getPluralExpression(
|
13896 |
+
config[ 'Plural-Forms' ] ||
|
13897 |
+
config[ 'plural-forms' ] ||
|
13898 |
+
// Ignore reason: As known, there's no way to document the empty
|
13899 |
+
// string property on a key to guarantee this as metadata.
|
13900 |
+
// @ts-ignore
|
13901 |
+
config.plural_forms
|
13902 |
+
);
|
13903 |
+
|
13904 |
+
pf = Object(__WEBPACK_IMPORTED_MODULE_0__tannin_plural_forms__["a" /* default */])( plural );
|
13905 |
+
}
|
13906 |
|
13907 |
+
getPluralForm = this.pluralForms[ domain ] = pf;
|
13908 |
+
}
|
|
|
13909 |
|
13910 |
+
return getPluralForm( n );
|
13911 |
+
};
|
|
|
13912 |
|
13913 |
+
/**
|
13914 |
+
* Translate a string.
|
13915 |
+
*
|
13916 |
+
* @param {string} domain Translation domain.
|
13917 |
+
* @param {string|void} context Context distinguishing terms of the same name.
|
13918 |
+
* @param {string} singular Primary key for translation lookup.
|
13919 |
+
* @param {string=} plural Fallback value used for non-zero plural
|
13920 |
+
* form index.
|
13921 |
+
* @param {number=} n Value to use in calculating plural form.
|
13922 |
+
*
|
13923 |
+
* @return {string} Translated string.
|
13924 |
+
*/
|
13925 |
+
Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
|
13926 |
+
var index, key, entry;
|
13927 |
|
13928 |
+
if ( n === undefined ) {
|
13929 |
+
// Default to singular.
|
13930 |
+
index = 0;
|
13931 |
+
} else {
|
13932 |
+
// Find index by evaluating plural form for value.
|
13933 |
+
index = this.getPluralForm( domain, n );
|
13934 |
+
}
|
13935 |
|
13936 |
+
key = singular;
|
|
|
|
|
13937 |
|
13938 |
+
// If provided, context is prepended to key with delimiter.
|
13939 |
+
if ( context ) {
|
13940 |
+
key = context + this.options.contextDelimiter + singular;
|
13941 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13942 |
|
13943 |
+
entry = this.data[ domain ][ key ];
|
13944 |
|
13945 |
+
// Verify not only that entry exists, but that the intended index is within
|
13946 |
+
// range and non-empty.
|
13947 |
+
if ( entry && entry[ index ] ) {
|
13948 |
+
return entry[ index ];
|
13949 |
+
}
|
13950 |
|
13951 |
+
if ( this.options.onMissingKey ) {
|
13952 |
+
this.options.onMissingKey( singular, domain );
|
13953 |
+
}
|
13954 |
|
13955 |
+
// If entry not found, fall back to singular vs. plural with zero index
|
13956 |
+
// representing the singular value.
|
13957 |
+
return index === 0 ? singular : plural;
|
13958 |
+
};
|
13959 |
|
13960 |
|
13961 |
+
/***/ }),
|
13962 |
+
/* 97 */
|
13963 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13964 |
|
13965 |
+
"use strict";
|
13966 |
+
/* unused harmony export concatChildren */
|
13967 |
+
/* unused harmony export switchChildrenNodeName */
|
13968 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
13969 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
13970 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(10);
|
13971 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
13972 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
|
13973 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
|
13974 |
+
/* unused harmony reexport Children */
|
13975 |
+
/* unused harmony reexport cloneElement */
|
13976 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Component")) __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Component"]; });
|
13977 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createContext")) __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createContext"]; });
|
13978 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createElement")) __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"]; });
|
13979 |
+
/* unused harmony reexport createRef */
|
13980 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "forwardRef")) __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["forwardRef"]; });
|
13981 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Fragment")) __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Fragment"]; });
|
13982 |
+
/* unused harmony reexport isValidElement */
|
13983 |
+
/* unused harmony reexport memo */
|
13984 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "StrictMode")) __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["StrictMode"]; });
|
13985 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useCallback")) __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useCallback"]; });
|
13986 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useContext")) __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useContext"]; });
|
13987 |
+
/* unused harmony reexport useDebugValue */
|
13988 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useEffect")) __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useEffect"]; });
|
13989 |
+
/* unused harmony reexport useImperativeHandle */
|
13990 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useLayoutEffect")) __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useLayoutEffect"]; });
|
13991 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useMemo")) __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useMemo"]; });
|
13992 |
+
/* unused harmony reexport useReducer */
|
13993 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useRef")) __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useRef"]; });
|
13994 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useState")) __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useState"]; });
|
13995 |
+
/* unused harmony reexport lazy */
|
13996 |
+
/* unused harmony reexport Suspense */
|
13997 |
+
|
13998 |
+
|
13999 |
+
|
14000 |
+
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; }
|
14001 |
+
|
14002 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
14003 |
|
14004 |
/**
|
14005 |
+
* External dependencies
|
14006 |
*/
|
14007 |
|
14008 |
|
14009 |
+
/**
|
14010 |
+
* Object containing a React element.
|
14011 |
+
*
|
14012 |
+
* @typedef {import('react').ReactElement} WPElement
|
14013 |
+
*/
|
14014 |
|
14015 |
+
/**
|
14016 |
+
* Object containing a React component.
|
14017 |
+
*
|
14018 |
+
* @typedef {import('react').ComponentType} WPComponent
|
14019 |
+
*/
|
14020 |
|
14021 |
+
/**
|
14022 |
+
* Object containing a React synthetic event.
|
14023 |
+
*
|
14024 |
+
* @typedef {import('react').SyntheticEvent} WPSyntheticEvent
|
14025 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14026 |
|
14027 |
+
/**
|
14028 |
+
* Object that provides utilities for dealing with React children.
|
14029 |
+
*/
|
14030 |
|
14031 |
|
14032 |
/**
|
14033 |
+
* Creates a copy of an element with extended props.
|
14034 |
+
*
|
14035 |
+
* @param {WPElement} element Element
|
14036 |
+
* @param {?Object} props Props to apply to cloned element
|
14037 |
+
*
|
14038 |
+
* @return {WPElement} Cloned element.
|
14039 |
*/
|
14040 |
|
14041 |
+
|
14042 |
/**
|
14043 |
+
* A base class to create WordPress Components (Refs, state and lifecycle hooks)
|
14044 |
*/
|
14045 |
|
14046 |
|
14047 |
/**
|
14048 |
+
* Creates a context object containing two components: a provider and consumer.
|
14049 |
+
*
|
14050 |
+
* @param {Object} defaultValue A default data stored in the context.
|
14051 |
+
*
|
14052 |
+
* @return {Object} Context object.
|
14053 |
*/
|
14054 |
|
14055 |
|
|
|
14056 |
/**
|
14057 |
+
* Returns a new element of given type. Type can be either a string tag name or
|
14058 |
+
* another function which itself returns an element.
|
14059 |
*
|
14060 |
+
* @param {?(string|Function)} type Tag name or element creator
|
14061 |
+
* @param {Object} props Element properties, either attribute
|
14062 |
+
* set to apply to DOM node or values to
|
14063 |
+
* pass through to element creator
|
14064 |
+
* @param {...WPElement} children Descendant elements
|
14065 |
+
*
|
14066 |
+
* @return {WPElement} Element.
|
14067 |
*/
|
14068 |
|
|
|
14069 |
|
14070 |
+
/**
|
14071 |
+
* Returns an object tracking a reference to a rendered element via its
|
14072 |
+
* `current` property as either a DOMElement or Element, dependent upon the
|
14073 |
+
* type of element rendered with the ref attribute.
|
14074 |
+
*
|
14075 |
+
* @return {Object} Ref object.
|
14076 |
+
*/
|
14077 |
|
|
|
|
|
14078 |
|
14079 |
+
/**
|
14080 |
+
* Component enhancer used to enable passing a ref to its wrapped component.
|
14081 |
+
* Pass a function argument which receives `props` and `ref` as its arguments,
|
14082 |
+
* returning an element using the forwarded ref. The return value is a new
|
14083 |
+
* component which forwards its ref.
|
14084 |
+
*
|
14085 |
+
* @param {Function} forwarder Function passed `props` and `ref`, expected to
|
14086 |
+
* return an element.
|
14087 |
+
*
|
14088 |
+
* @return {WPComponent} Enhanced component.
|
14089 |
+
*/
|
14090 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14091 |
|
14092 |
+
/**
|
14093 |
+
* A component which renders its children without any wrapping element.
|
14094 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
14095 |
|
|
|
|
|
|
|
14096 |
|
14097 |
+
/**
|
14098 |
+
* Checks if an object is a valid WPElement.
|
14099 |
+
*
|
14100 |
+
* @param {Object} objectToCheck The object to be checked.
|
14101 |
+
*
|
14102 |
+
* @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
|
14103 |
+
*/
|
14104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14105 |
|
14106 |
+
/**
|
14107 |
+
* @see https://reactjs.org/docs/react-api.html#reactmemo
|
14108 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
14109 |
|
14110 |
|
14111 |
+
/**
|
14112 |
+
* Component that activates additional checks and warnings for its descendants.
|
14113 |
+
*/
|
|
|
14114 |
|
14115 |
|
14116 |
+
/**
|
14117 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usecallback
|
14118 |
+
*/
|
14119 |
|
|
|
14120 |
|
14121 |
+
/**
|
14122 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usecontext
|
14123 |
+
*/
|
14124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14125 |
|
14126 |
+
/**
|
14127 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
|
14128 |
+
*/
|
|
|
|
|
14129 |
|
|
|
|
|
14130 |
|
14131 |
+
/**
|
14132 |
+
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
|
14133 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14134 |
|
|
|
|
|
14135 |
|
14136 |
+
/**
|
14137 |
+
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
|
14138 |
+
*/
|
14139 |
|
|
|
|
|
|
|
14140 |
|
14141 |
+
/**
|
14142 |
+
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
14143 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14144 |
|
14145 |
|
14146 |
+
/**
|
14147 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usememo
|
14148 |
+
*/
|
14149 |
|
14150 |
|
14151 |
+
/**
|
14152 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usereducer
|
14153 |
+
*/
|
14154 |
|
14155 |
|
14156 |
+
/**
|
14157 |
+
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
14158 |
+
*/
|
14159 |
|
14160 |
|
14161 |
+
/**
|
14162 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usestate
|
14163 |
+
*/
|
14164 |
|
14165 |
|
14166 |
/**
|
14167 |
+
* @see https://reactjs.org/docs/react-api.html#reactlazy
|
14168 |
*/
|
14169 |
|
14170 |
|
14171 |
+
/**
|
14172 |
+
* @see https://reactjs.org/docs/react-api.html#reactsuspense
|
14173 |
+
*/
|
|
|
14174 |
|
|
|
|
|
14175 |
|
14176 |
+
/**
|
14177 |
+
* Concatenate two or more React children objects.
|
14178 |
+
*
|
14179 |
+
* @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
|
14180 |
+
*
|
14181 |
+
* @return {Array} The concatenated value.
|
14182 |
+
*/
|
14183 |
|
14184 |
+
function concatChildren() {
|
14185 |
+
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
|
14186 |
+
childrenArguments[_key] = arguments[_key];
|
14187 |
}
|
14188 |
|
14189 |
+
return childrenArguments.reduce(function (accumulator, children, i) {
|
14190 |
+
__WEBPACK_IMPORTED_MODULE_2_react__["Children"].forEach(children, function (child, j) {
|
14191 |
+
if (child && 'string' !== typeof child) {
|
14192 |
+
child = Object(__WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"])(child, {
|
14193 |
+
key: [i, j].join()
|
14194 |
+
});
|
14195 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14196 |
|
14197 |
+
accumulator.push(child);
|
14198 |
+
});
|
14199 |
+
return accumulator;
|
14200 |
+
}, []);
|
14201 |
+
}
|
14202 |
+
/**
|
14203 |
+
* Switches the nodeName of all the elements in the children object.
|
14204 |
+
*
|
14205 |
+
* @param {?Object} children Children object.
|
14206 |
+
* @param {string} nodeName Node name.
|
14207 |
+
*
|
14208 |
+
* @return {?Object} The updated children object.
|
14209 |
+
*/
|
14210 |
|
14211 |
+
function switchChildrenNodeName(children, nodeName) {
|
14212 |
+
return children && __WEBPACK_IMPORTED_MODULE_2_react__["Children"].map(children, function (elt, index) {
|
14213 |
+
if (Object(__WEBPACK_IMPORTED_MODULE_3_lodash__["isString"])(elt)) {
|
14214 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, {
|
14215 |
+
key: index
|
14216 |
+
}, elt);
|
14217 |
}
|
|
|
14218 |
|
14219 |
+
var _elt$props = elt.props,
|
14220 |
+
childrenProp = _elt$props.children,
|
14221 |
+
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_elt$props, ["children"]);
|
14222 |
|
14223 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, _objectSpread({
|
14224 |
+
key: index
|
14225 |
+
}, props), childrenProp);
|
14226 |
+
});
|
14227 |
+
}
|
14228 |
+
//# sourceMappingURL=react.js.map
|
14229 |
|
14230 |
/***/ }),
|
14231 |
+
/* 98 */
|
14232 |
+
/***/ (function(module, exports, __webpack_require__) {
|
14233 |
|
14234 |
+
var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
|
14235 |
+
/**
|
14236 |
+
* Copyright 2012-2017 Craig Campbell
|
14237 |
+
*
|
14238 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
14239 |
+
* you may not use this file except in compliance with the License.
|
14240 |
+
* You may obtain a copy of the License at
|
14241 |
+
*
|
14242 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14243 |
+
*
|
14244 |
+
* Unless required by applicable law or agreed to in writing, software
|
14245 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14246 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14247 |
+
* See the License for the specific language governing permissions and
|
14248 |
+
* limitations under the License.
|
14249 |
+
*
|
14250 |
+
* Mousetrap is a simple keyboard shortcut library for Javascript with
|
14251 |
+
* no external dependencies
|
14252 |
+
*
|
14253 |
+
* @version 1.6.5
|
14254 |
+
* @url craig.is/killing/mice
|
14255 |
+
*/
|
14256 |
+
(function(window, document, undefined) {
|
14257 |
|
14258 |
+
// Check if mousetrap is used inside browser, if not, return
|
14259 |
+
if (!window) {
|
14260 |
+
return;
|
14261 |
+
}
|
14262 |
|
14263 |
+
/**
|
14264 |
+
* mapping of special keycodes to their corresponding keys
|
14265 |
+
*
|
14266 |
+
* everything in this dictionary cannot use keypress events
|
14267 |
+
* so it has to be here to map to the correct keycodes for
|
14268 |
+
* keyup/keydown events
|
14269 |
+
*
|
14270 |
+
* @type {Object}
|
14271 |
+
*/
|
14272 |
+
var _MAP = {
|
14273 |
+
8: 'backspace',
|
14274 |
+
9: 'tab',
|
14275 |
+
13: 'enter',
|
14276 |
+
16: 'shift',
|
14277 |
+
17: 'ctrl',
|
14278 |
+
18: 'alt',
|
14279 |
+
20: 'capslock',
|
14280 |
+
27: 'esc',
|
14281 |
+
32: 'space',
|
14282 |
+
33: 'pageup',
|
14283 |
+
34: 'pagedown',
|
14284 |
+
35: 'end',
|
14285 |
+
36: 'home',
|
14286 |
+
37: 'left',
|
14287 |
+
38: 'up',
|
14288 |
+
39: 'right',
|
14289 |
+
40: 'down',
|
14290 |
+
45: 'ins',
|
14291 |
+
46: 'del',
|
14292 |
+
91: 'meta',
|
14293 |
+
93: 'meta',
|
14294 |
+
224: 'meta'
|
14295 |
+
};
|
14296 |
|
14297 |
+
/**
|
14298 |
+
* mapping for special characters so they can support
|
14299 |
+
*
|
14300 |
+
* this dictionary is only used incase you want to bind a
|
14301 |
+
* keyup or keydown event to one of these keys
|
14302 |
+
*
|
14303 |
+
* @type {Object}
|
14304 |
+
*/
|
14305 |
+
var _KEYCODE_MAP = {
|
14306 |
+
106: '*',
|
14307 |
+
107: '+',
|
14308 |
+
109: '-',
|
14309 |
+
110: '.',
|
14310 |
+
111 : '/',
|
14311 |
+
186: ';',
|
14312 |
+
187: '=',
|
14313 |
+
188: ',',
|
14314 |
+
189: '-',
|
14315 |
+
190: '.',
|
14316 |
+
191: '/',
|
14317 |
+
192: '`',
|
14318 |
+
219: '[',
|
14319 |
+
220: '\\',
|
14320 |
+
221: ']',
|
14321 |
+
222: '\''
|
14322 |
+
};
|
14323 |
|
14324 |
+
/**
|
14325 |
+
* this is a mapping of keys that require shift on a US keypad
|
14326 |
+
* back to the non shift equivelents
|
14327 |
+
*
|
14328 |
+
* this is so you can use keyup events with these keys
|
14329 |
+
*
|
14330 |
+
* note that this will only work reliably on US keyboards
|
14331 |
+
*
|
14332 |
+
* @type {Object}
|
14333 |
+
*/
|
14334 |
+
var _SHIFT_MAP = {
|
14335 |
+
'~': '`',
|
14336 |
+
'!': '1',
|
14337 |
+
'@': '2',
|
14338 |
+
'#': '3',
|
14339 |
+
'$': '4',
|
14340 |
+
'%': '5',
|
14341 |
+
'^': '6',
|
14342 |
+
'&': '7',
|
14343 |
+
'*': '8',
|
14344 |
+
'(': '9',
|
14345 |
+
')': '0',
|
14346 |
+
'_': '-',
|
14347 |
+
'+': '=',
|
14348 |
+
':': ';',
|
14349 |
+
'\"': '\'',
|
14350 |
+
'<': ',',
|
14351 |
+
'>': '.',
|
14352 |
+
'?': '/',
|
14353 |
+
'|': '\\'
|
14354 |
+
};
|
14355 |
|
14356 |
+
/**
|
14357 |
+
* this is a list of special strings you can use to map
|
14358 |
+
* to modifier keys when you specify your keyboard shortcuts
|
14359 |
+
*
|
14360 |
+
* @type {Object}
|
14361 |
+
*/
|
14362 |
+
var _SPECIAL_ALIASES = {
|
14363 |
+
'option': 'alt',
|
14364 |
+
'command': 'meta',
|
14365 |
+
'return': 'enter',
|
14366 |
+
'escape': 'esc',
|
14367 |
+
'plus': '+',
|
14368 |
+
'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
|
14369 |
+
};
|
14370 |
|
14371 |
+
/**
|
14372 |
+
* variable to store the flipped version of _MAP from above
|
14373 |
+
* needed to check if we should use keypress or not when no action
|
14374 |
+
* is specified
|
14375 |
+
*
|
14376 |
+
* @type {Object|undefined}
|
14377 |
+
*/
|
14378 |
+
var _REVERSE_MAP;
|
14379 |
|
14380 |
+
/**
|
14381 |
+
* loop through the f keys, f1 to f19 and add them to the map
|
14382 |
+
* programatically
|
14383 |
+
*/
|
14384 |
+
for (var i = 1; i < 20; ++i) {
|
14385 |
+
_MAP[111 + i] = 'f' + i;
|
14386 |
+
}
|
14387 |
|
14388 |
+
/**
|
14389 |
+
* loop through to map numbers on the numeric keypad
|
14390 |
+
*/
|
14391 |
+
for (i = 0; i <= 9; ++i) {
|
14392 |
|
14393 |
+
// This needs to use a string cause otherwise since 0 is falsey
|
14394 |
+
// mousetrap will never fire for numpad 0 pressed as part of a keydown
|
14395 |
+
// event.
|
14396 |
+
//
|
14397 |
+
// @see https://github.com/ccampbell/mousetrap/pull/258
|
14398 |
+
_MAP[i + 96] = i.toString();
|
14399 |
+
}
|
14400 |
|
14401 |
+
/**
|
14402 |
+
* cross browser add event method
|
14403 |
+
*
|
14404 |
+
* @param {Element|HTMLDocument} object
|
14405 |
+
* @param {string} type
|
14406 |
+
* @param {Function} callback
|
14407 |
+
* @returns void
|
14408 |
+
*/
|
14409 |
+
function _addEvent(object, type, callback) {
|
14410 |
+
if (object.addEventListener) {
|
14411 |
+
object.addEventListener(type, callback, false);
|
14412 |
+
return;
|
14413 |
+
}
|
14414 |
|
14415 |
+
object.attachEvent('on' + type, callback);
|
14416 |
+
}
|
14417 |
|
14418 |
+
/**
|
14419 |
+
* takes the event and returns the key character
|
14420 |
+
*
|
14421 |
+
* @param {Event} e
|
14422 |
+
* @return {string}
|
14423 |
+
*/
|
14424 |
+
function _characterFromEvent(e) {
|
14425 |
|
14426 |
+
// for keypress events we should return the character as is
|
14427 |
+
if (e.type == 'keypress') {
|
14428 |
+
var character = String.fromCharCode(e.which);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14429 |
|
14430 |
+
// if the shift key is not pressed then it is safe to assume
|
14431 |
+
// that we want the character to be lowercase. this means if
|
14432 |
+
// you accidentally have caps lock on then your key bindings
|
14433 |
+
// will continue to work
|
14434 |
+
//
|
14435 |
+
// the only side effect that might not be desired is if you
|
14436 |
+
// bind something like 'A' cause you want to trigger an
|
14437 |
+
// event when capital A is pressed caps lock will no longer
|
14438 |
+
// trigger the event. shift+a will though.
|
14439 |
+
if (!e.shiftKey) {
|
14440 |
+
character = character.toLowerCase();
|
14441 |
+
}
|
14442 |
|
14443 |
+
return character;
|
14444 |
+
}
|
14445 |
|
14446 |
+
// for non keypress events the special maps are needed
|
14447 |
+
if (_MAP[e.which]) {
|
14448 |
+
return _MAP[e.which];
|
14449 |
+
}
|
14450 |
|
14451 |
+
if (_KEYCODE_MAP[e.which]) {
|
14452 |
+
return _KEYCODE_MAP[e.which];
|
14453 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14454 |
|
14455 |
+
// if it is not in the special map
|
|
|
|
|
|
|
|
|
|
|
14456 |
|
14457 |
+
// with keydown and keyup events the character seems to always
|
14458 |
+
// come in as an uppercase character whether you are pressing shift
|
14459 |
+
// or not. we should make sure it is always lowercase for comparisons
|
14460 |
+
return String.fromCharCode(e.which).toLowerCase();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14461 |
}
|
|
|
|
|
|
|
|
|
14462 |
|
14463 |
+
/**
|
14464 |
+
* checks if two arrays are equal
|
14465 |
+
*
|
14466 |
+
* @param {Array} modifiers1
|
14467 |
+
* @param {Array} modifiers2
|
14468 |
+
* @returns {boolean}
|
14469 |
+
*/
|
14470 |
+
function _modifiersMatch(modifiers1, modifiers2) {
|
14471 |
+
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
|
|
|
14472 |
}
|
|
|
|
|
|
|
|
|
14473 |
|
14474 |
+
/**
|
14475 |
+
* takes a key event and figures out what the modifiers are
|
14476 |
+
*
|
14477 |
+
* @param {Event} e
|
14478 |
+
* @returns {Array}
|
14479 |
+
*/
|
14480 |
+
function _eventModifiers(e) {
|
14481 |
+
var modifiers = [];
|
14482 |
|
14483 |
+
if (e.shiftKey) {
|
14484 |
+
modifiers.push('shift');
|
14485 |
+
}
|
14486 |
|
14487 |
+
if (e.altKey) {
|
14488 |
+
modifiers.push('alt');
|
14489 |
+
}
|
14490 |
|
14491 |
+
if (e.ctrlKey) {
|
14492 |
+
modifiers.push('ctrl');
|
14493 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14494 |
|
14495 |
+
if (e.metaKey) {
|
14496 |
+
modifiers.push('meta');
|
14497 |
+
}
|
14498 |
|
14499 |
+
return modifiers;
|
14500 |
+
}
|
14501 |
|
14502 |
+
/**
|
14503 |
+
* prevents default for this event
|
14504 |
+
*
|
14505 |
+
* @param {Event} e
|
14506 |
+
* @returns void
|
14507 |
+
*/
|
14508 |
+
function _preventDefault(e) {
|
14509 |
+
if (e.preventDefault) {
|
14510 |
+
e.preventDefault();
|
14511 |
+
return;
|
14512 |
+
}
|
14513 |
|
14514 |
+
e.returnValue = false;
|
14515 |
+
}
|
14516 |
|
14517 |
+
/**
|
14518 |
+
* stops propogation for this event
|
14519 |
+
*
|
14520 |
+
* @param {Event} e
|
14521 |
+
* @returns void
|
14522 |
+
*/
|
14523 |
+
function _stopPropagation(e) {
|
14524 |
+
if (e.stopPropagation) {
|
14525 |
+
e.stopPropagation();
|
14526 |
+
return;
|
14527 |
+
}
|
14528 |
|
14529 |
+
e.cancelBubble = true;
|
14530 |
+
}
|
14531 |
|
14532 |
+
/**
|
14533 |
+
* determines if the keycode specified is a modifier key or not
|
14534 |
+
*
|
14535 |
+
* @param {string} key
|
14536 |
+
* @returns {boolean}
|
14537 |
+
*/
|
14538 |
+
function _isModifier(key) {
|
14539 |
+
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
|
14540 |
+
}
|
14541 |
|
14542 |
+
/**
|
14543 |
+
* reverses the map lookup so that we can look for specific keys
|
14544 |
+
* to see what can and can't use keypress
|
14545 |
+
*
|
14546 |
+
* @return {Object}
|
14547 |
+
*/
|
14548 |
+
function _getReverseMap() {
|
14549 |
+
if (!_REVERSE_MAP) {
|
14550 |
+
_REVERSE_MAP = {};
|
14551 |
+
for (var key in _MAP) {
|
14552 |
|
14553 |
+
// pull out the numeric keypad from here cause keypress should
|
14554 |
+
// be able to detect the keys from the character
|
14555 |
+
if (key > 95 && key < 112) {
|
14556 |
+
continue;
|
14557 |
+
}
|
14558 |
|
14559 |
+
if (_MAP.hasOwnProperty(key)) {
|
14560 |
+
_REVERSE_MAP[_MAP[key]] = key;
|
14561 |
+
}
|
14562 |
+
}
|
14563 |
+
}
|
14564 |
+
return _REVERSE_MAP;
|
14565 |
+
}
|
14566 |
|
14567 |
+
/**
|
14568 |
+
* picks the best action based on the key combination
|
14569 |
+
*
|
14570 |
+
* @param {string} key - character for key
|
14571 |
+
* @param {Array} modifiers
|
14572 |
+
* @param {string=} action passed in
|
14573 |
+
*/
|
14574 |
+
function _pickBestAction(key, modifiers, action) {
|
14575 |
|
14576 |
+
// if no action was picked in we should try to pick the one
|
14577 |
+
// that we think would work best for this key
|
14578 |
+
if (!action) {
|
14579 |
+
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
|
14580 |
+
}
|
14581 |
|
14582 |
+
// modifier keys don't work as expected with keypress,
|
14583 |
+
// switch to keydown
|
14584 |
+
if (action == 'keypress' && modifiers.length) {
|
14585 |
+
action = 'keydown';
|
14586 |
+
}
|
14587 |
|
14588 |
+
return action;
|
14589 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
14590 |
|
14591 |
+
/**
|
14592 |
+
* Converts from a string key combination to an array
|
14593 |
+
*
|
14594 |
+
* @param {string} combination like "command+shift+l"
|
14595 |
+
* @return {Array}
|
14596 |
+
*/
|
14597 |
+
function _keysFromString(combination) {
|
14598 |
+
if (combination === '+') {
|
14599 |
+
return ['+'];
|
14600 |
+
}
|
14601 |
|
14602 |
+
combination = combination.replace(/\+{2}/g, '+plus');
|
14603 |
+
return combination.split('+');
|
14604 |
+
}
|
14605 |
|
14606 |
+
/**
|
14607 |
+
* Gets info for a specific key combination
|
14608 |
+
*
|
14609 |
+
* @param {string} combination key combination ("command+s" or "a" or "*")
|
14610 |
+
* @param {string=} action
|
14611 |
+
* @returns {Object}
|
14612 |
+
*/
|
14613 |
+
function _getKeyInfo(combination, action) {
|
14614 |
+
var keys;
|
14615 |
+
var key;
|
14616 |
+
var i;
|
14617 |
+
var modifiers = [];
|
14618 |
|
14619 |
+
// take the keys from this pattern and figure out what the actual
|
14620 |
+
// pattern is all about
|
14621 |
+
keys = _keysFromString(combination);
|
|
|
14622 |
|
14623 |
+
for (i = 0; i < keys.length; ++i) {
|
14624 |
+
key = keys[i];
|
|
|
|
|
14625 |
|
14626 |
+
// normalize key names
|
14627 |
+
if (_SPECIAL_ALIASES[key]) {
|
14628 |
+
key = _SPECIAL_ALIASES[key];
|
14629 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14630 |
|
14631 |
+
// if this is not a keypress event then we should
|
14632 |
+
// be smart about using shift keys
|
14633 |
+
// this will only work for US keyboards however
|
14634 |
+
if (action && action != 'keypress' && _SHIFT_MAP[key]) {
|
14635 |
+
key = _SHIFT_MAP[key];
|
14636 |
+
modifiers.push('shift');
|
14637 |
+
}
|
14638 |
|
14639 |
+
// if this key is a modifier then add it to the list of modifiers
|
14640 |
+
if (_isModifier(key)) {
|
14641 |
+
modifiers.push(key);
|
14642 |
+
}
|
14643 |
+
}
|
14644 |
|
14645 |
+
// depending on what the key combination is
|
14646 |
+
// we will try to pick the best event for it
|
14647 |
+
action = _pickBestAction(key, modifiers, action);
|
14648 |
|
14649 |
+
return {
|
14650 |
+
key: key,
|
14651 |
+
modifiers: modifiers,
|
14652 |
+
action: action
|
14653 |
+
};
|
14654 |
+
}
|
14655 |
|
14656 |
+
function _belongsTo(element, ancestor) {
|
14657 |
+
if (element === null || element === document) {
|
14658 |
+
return false;
|
14659 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14660 |
|
14661 |
+
if (element === ancestor) {
|
14662 |
+
return true;
|
14663 |
+
}
|
|
|
|
|
|
|
14664 |
|
14665 |
+
return _belongsTo(element.parentNode, ancestor);
|
14666 |
+
}
|
|
|
14667 |
|
14668 |
+
function Mousetrap(targetElement) {
|
14669 |
+
var self = this;
|
|
|
|
|
|
|
|
|
14670 |
|
14671 |
+
targetElement = targetElement || document;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14672 |
|
14673 |
+
if (!(self instanceof Mousetrap)) {
|
14674 |
+
return new Mousetrap(targetElement);
|
14675 |
+
}
|
14676 |
|
14677 |
+
/**
|
14678 |
+
* element to attach key events to
|
14679 |
+
*
|
14680 |
+
* @type {Element}
|
14681 |
+
*/
|
14682 |
+
self.target = targetElement;
|
|
|
|
|
14683 |
|
14684 |
+
/**
|
14685 |
+
* a list of all the callbacks setup via Mousetrap.bind()
|
14686 |
+
*
|
14687 |
+
* @type {Object}
|
14688 |
+
*/
|
14689 |
+
self._callbacks = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14690 |
|
14691 |
+
/**
|
14692 |
+
* direct map of string combinations to callbacks used for trigger()
|
14693 |
+
*
|
14694 |
+
* @type {Object}
|
14695 |
+
*/
|
14696 |
+
self._directMap = {};
|
14697 |
|
14698 |
+
/**
|
14699 |
+
* keeps track of what level each sequence is at since multiple
|
14700 |
+
* sequences can start out with the same sequence
|
14701 |
+
*
|
14702 |
+
* @type {Object}
|
14703 |
+
*/
|
14704 |
+
var _sequenceLevels = {};
|
14705 |
|
14706 |
+
/**
|
14707 |
+
* variable to store the setTimeout call
|
14708 |
+
*
|
14709 |
+
* @type {null|number}
|
14710 |
+
*/
|
14711 |
+
var _resetTimer;
|
14712 |
|
14713 |
+
/**
|
14714 |
+
* temporary state where we will ignore the next keyup
|
14715 |
+
*
|
14716 |
+
* @type {boolean|string}
|
14717 |
+
*/
|
14718 |
+
var _ignoreNextKeyup = false;
|
14719 |
|
14720 |
+
/**
|
14721 |
+
* temporary state where we will ignore the next keypress
|
14722 |
+
*
|
14723 |
+
* @type {boolean}
|
14724 |
+
*/
|
14725 |
+
var _ignoreNextKeypress = false;
|
14726 |
|
14727 |
+
/**
|
14728 |
+
* are we currently inside of a sequence?
|
14729 |
+
* type of action ("keyup" or "keydown" or "keypress") or false
|
14730 |
+
*
|
14731 |
+
* @type {boolean|string}
|
14732 |
+
*/
|
14733 |
+
var _nextExpectedAction = false;
|
|
|
|
|
|
|
|
|
|
|
14734 |
|
14735 |
+
/**
|
14736 |
+
* resets all sequence counters except for the ones passed in
|
14737 |
+
*
|
14738 |
+
* @param {Object} doNotReset
|
14739 |
+
* @returns void
|
14740 |
+
*/
|
14741 |
+
function _resetSequences(doNotReset) {
|
14742 |
+
doNotReset = doNotReset || {};
|
14743 |
|
14744 |
+
var activeSequences = false,
|
14745 |
+
key;
|
|
|
14746 |
|
14747 |
+
for (key in _sequenceLevels) {
|
14748 |
+
if (doNotReset[key]) {
|
14749 |
+
activeSequences = true;
|
14750 |
+
continue;
|
14751 |
+
}
|
14752 |
+
_sequenceLevels[key] = 0;
|
14753 |
+
}
|
14754 |
|
14755 |
+
if (!activeSequences) {
|
14756 |
+
_nextExpectedAction = false;
|
14757 |
+
}
|
14758 |
+
}
|
14759 |
|
14760 |
+
/**
|
14761 |
+
* finds all callbacks that match based on the keycode, modifiers,
|
14762 |
+
* and action
|
14763 |
+
*
|
14764 |
+
* @param {string} character
|
14765 |
+
* @param {Array} modifiers
|
14766 |
+
* @param {Event|Object} e
|
14767 |
+
* @param {string=} sequenceName - name of the sequence we are looking for
|
14768 |
+
* @param {string=} combination
|
14769 |
+
* @param {number=} level
|
14770 |
+
* @returns {Array}
|
14771 |
+
*/
|
14772 |
+
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
|
14773 |
+
var i;
|
14774 |
+
var callback;
|
14775 |
+
var matches = [];
|
14776 |
+
var action = e.type;
|
14777 |
|
14778 |
+
// if there are no events related to this keycode
|
14779 |
+
if (!self._callbacks[character]) {
|
14780 |
+
return [];
|
14781 |
+
}
|
14782 |
|
14783 |
+
// if a modifier key is coming up on its own we should allow it
|
14784 |
+
if (action == 'keyup' && _isModifier(character)) {
|
14785 |
+
modifiers = [character];
|
14786 |
+
}
|
14787 |
|
14788 |
+
// loop through all callbacks for the key that was pressed
|
14789 |
+
// and see if any of them match
|
14790 |
+
for (i = 0; i < self._callbacks[character].length; ++i) {
|
14791 |
+
callback = self._callbacks[character][i];
|
14792 |
|
14793 |
+
// if a sequence name is not specified, but this is a sequence at
|
14794 |
+
// the wrong level then move onto the next match
|
14795 |
+
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
|
14796 |
+
continue;
|
14797 |
+
}
|
14798 |
|
14799 |
+
// if the action we are looking for doesn't match the action we got
|
14800 |
+
// then we should keep going
|
14801 |
+
if (action != callback.action) {
|
14802 |
+
continue;
|
14803 |
+
}
|
14804 |
|
14805 |
+
// if this is a keypress event and the meta key and control key
|
14806 |
+
// are not pressed that means that we need to only look at the
|
14807 |
+
// character, otherwise check the modifiers as well
|
14808 |
+
//
|
14809 |
+
// chrome will not fire a keypress if meta or control is down
|
14810 |
+
// safari will fire a keypress if meta or meta+shift is down
|
14811 |
+
// firefox will fire a keypress if meta or control is down
|
14812 |
+
if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {
|
14813 |
|
14814 |
+
// when you bind a combination or sequence a second time it
|
14815 |
+
// should overwrite the first one. if a sequenceName or
|
14816 |
+
// combination is specified in this call it does just that
|
14817 |
+
//
|
14818 |
+
// @todo make deleting its own method?
|
14819 |
+
var deleteCombo = !sequenceName && callback.combo == combination;
|
14820 |
+
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
|
14821 |
+
if (deleteCombo || deleteSequence) {
|
14822 |
+
self._callbacks[character].splice(i, 1);
|
14823 |
+
}
|
14824 |
|
14825 |
+
matches.push(callback);
|
14826 |
+
}
|
14827 |
+
}
|
14828 |
|
14829 |
+
return matches;
|
14830 |
+
}
|
14831 |
|
14832 |
+
/**
|
14833 |
+
* actually calls the callback function
|
14834 |
+
*
|
14835 |
+
* if your callback function returns false this will use the jquery
|
14836 |
+
* convention - prevent default and stop propogation on the event
|
14837 |
+
*
|
14838 |
+
* @param {Function} callback
|
14839 |
+
* @param {Event} e
|
14840 |
+
* @returns void
|
14841 |
+
*/
|
14842 |
+
function _fireCallback(callback, e, combo, sequence) {
|
14843 |
|
14844 |
+
// if this event should not happen stop here
|
14845 |
+
if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
|
14846 |
+
return;
|
14847 |
+
}
|
14848 |
|
14849 |
+
if (callback(e, combo) === false) {
|
14850 |
+
_preventDefault(e);
|
14851 |
+
_stopPropagation(e);
|
14852 |
+
}
|
14853 |
+
}
|
14854 |
|
14855 |
+
/**
|
14856 |
+
* handles a character key event
|
14857 |
+
*
|
14858 |
+
* @param {string} character
|
14859 |
+
* @param {Array} modifiers
|
14860 |
+
* @param {Event} e
|
14861 |
+
* @returns void
|
14862 |
+
*/
|
14863 |
+
self._handleKey = function(character, modifiers, e) {
|
14864 |
+
var callbacks = _getMatches(character, modifiers, e);
|
14865 |
+
var i;
|
14866 |
+
var doNotReset = {};
|
14867 |
+
var maxLevel = 0;
|
14868 |
+
var processedSequenceCallback = false;
|
14869 |
|
14870 |
+
// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
|
14871 |
+
for (i = 0; i < callbacks.length; ++i) {
|
14872 |
+
if (callbacks[i].seq) {
|
14873 |
+
maxLevel = Math.max(maxLevel, callbacks[i].level);
|
14874 |
+
}
|
14875 |
+
}
|
14876 |
|
14877 |
+
// loop through matching callbacks for this key event
|
14878 |
+
for (i = 0; i < callbacks.length; ++i) {
|
14879 |
|
14880 |
+
// fire for all sequence callbacks
|
14881 |
+
// this is because if for example you have multiple sequences
|
14882 |
+
// bound such as "g i" and "g t" they both need to fire the
|
14883 |
+
// callback for matching g cause otherwise you can only ever
|
14884 |
+
// match the first one
|
14885 |
+
if (callbacks[i].seq) {
|
14886 |
|
14887 |
+
// only fire callbacks for the maxLevel to prevent
|
14888 |
+
// subsequences from also firing
|
14889 |
+
//
|
14890 |
+
// for example 'a option b' should not cause 'option b' to fire
|
14891 |
+
// even though 'option b' is part of the other sequence
|
14892 |
+
//
|
14893 |
+
// any sequences that do not match here will be discarded
|
14894 |
+
// below by the _resetSequences call
|
14895 |
+
if (callbacks[i].level != maxLevel) {
|
14896 |
+
continue;
|
14897 |
+
}
|
14898 |
|
14899 |
+
processedSequenceCallback = true;
|
14900 |
|
14901 |
+
// keep a list of which sequences were matches for later
|
14902 |
+
doNotReset[callbacks[i].seq] = 1;
|
14903 |
+
_fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
|
14904 |
+
continue;
|
14905 |
+
}
|
14906 |
|
14907 |
+
// if there were no sequence matches but we are still here
|
14908 |
+
// that means this is a regular match so we should fire that
|
14909 |
+
if (!processedSequenceCallback) {
|
14910 |
+
_fireCallback(callbacks[i].callback, e, callbacks[i].combo);
|
14911 |
+
}
|
14912 |
+
}
|
14913 |
|
14914 |
+
// if the key you pressed matches the type of sequence without
|
14915 |
+
// being a modifier (ie "keyup" or "keypress") then we should
|
14916 |
+
// reset all sequences that were not matched by this event
|
14917 |
+
//
|
14918 |
+
// this is so, for example, if you have the sequence "h a t" and you
|
14919 |
+
// type "h e a r t" it does not match. in this case the "e" will
|
14920 |
+
// cause the sequence to reset
|
14921 |
+
//
|
14922 |
+
// modifier keys are ignored because you can have a sequence
|
14923 |
+
// that contains modifiers such as "enter ctrl+space" and in most
|
14924 |
+
// cases the modifier key will be pressed before the next key
|
14925 |
+
//
|
14926 |
+
// also if you have a sequence such as "ctrl+b a" then pressing the
|
14927 |
+
// "b" key will trigger a "keypress" and a "keydown"
|
14928 |
+
//
|
14929 |
+
// the "keydown" is expected when there is a modifier, but the
|
14930 |
+
// "keypress" ends up matching the _nextExpectedAction since it occurs
|
14931 |
+
// after and that causes the sequence to reset
|
14932 |
+
//
|
14933 |
+
// we ignore keypresses in a sequence that directly follow a keydown
|
14934 |
+
// for the same character
|
14935 |
+
var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
|
14936 |
+
if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
|
14937 |
+
_resetSequences(doNotReset);
|
14938 |
+
}
|
14939 |
|
14940 |
+
_ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
|
14941 |
+
};
|
14942 |
|
14943 |
+
/**
|
14944 |
+
* handles a keydown event
|
14945 |
+
*
|
14946 |
+
* @param {Event} e
|
14947 |
+
* @returns void
|
14948 |
+
*/
|
14949 |
+
function _handleKeyEvent(e) {
|
14950 |
|
14951 |
+
// normalize e.which for key events
|
14952 |
+
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
|
14953 |
+
if (typeof e.which !== 'number') {
|
14954 |
+
e.which = e.keyCode;
|
14955 |
+
}
|
14956 |
|
14957 |
+
var character = _characterFromEvent(e);
|
14958 |
|
14959 |
+
// no character found then stop
|
14960 |
+
if (!character) {
|
14961 |
+
return;
|
14962 |
+
}
|
14963 |
|
14964 |
+
// need to use === for the character check because the character can be 0
|
14965 |
+
if (e.type == 'keyup' && _ignoreNextKeyup === character) {
|
14966 |
+
_ignoreNextKeyup = false;
|
14967 |
+
return;
|
14968 |
+
}
|
14969 |
|
14970 |
+
self.handleKey(character, _eventModifiers(e), e);
|
14971 |
+
}
|
14972 |
|
14973 |
+
/**
|
14974 |
+
* called to set a 1 second timeout on the specified sequence
|
14975 |
+
*
|
14976 |
+
* this is so after each key press in the sequence you have 1 second
|
14977 |
+
* to press the next key before you have to start over
|
14978 |
+
*
|
14979 |
+
* @returns void
|
14980 |
+
*/
|
14981 |
+
function _resetSequenceTimer() {
|
14982 |
+
clearTimeout(_resetTimer);
|
14983 |
+
_resetTimer = setTimeout(_resetSequences, 1000);
|
14984 |
+
}
|
14985 |
|
14986 |
+
/**
|
14987 |
+
* binds a key sequence to an event
|
14988 |
+
*
|
14989 |
+
* @param {string} combo - combo specified in bind call
|
14990 |
+
* @param {Array} keys
|
14991 |
+
* @param {Function} callback
|
14992 |
+
* @param {string=} action
|
14993 |
+
* @returns void
|
14994 |
+
*/
|
14995 |
+
function _bindSequence(combo, keys, callback, action) {
|
14996 |
|
14997 |
+
// start off by adding a sequence level record for this combination
|
14998 |
+
// and setting the level to 0
|
14999 |
+
_sequenceLevels[combo] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
15000 |
|
15001 |
+
/**
|
15002 |
+
* callback to increase the sequence level for this sequence and reset
|
15003 |
+
* all other sequences that were active
|
15004 |
+
*
|
15005 |
+
* @param {string} nextAction
|
15006 |
+
* @returns {Function}
|
15007 |
+
*/
|
15008 |
+
function _increaseSequence(nextAction) {
|
15009 |
+
return function() {
|
15010 |
+
_nextExpectedAction = nextAction;
|
15011 |
+
++_sequenceLevels[combo];
|
15012 |
+
_resetSequenceTimer();
|
15013 |
+
};
|
15014 |
+
}
|
15015 |
|
15016 |
+
/**
|
15017 |
+
* wraps the specified callback inside of another function in order
|
15018 |
+
* to reset all sequence counters as soon as this sequence is done
|
15019 |
+
*
|
15020 |
+
* @param {Event} e
|
15021 |
+
* @returns void
|
15022 |
+
*/
|
15023 |
+
function _callbackAndReset(e) {
|
15024 |
+
_fireCallback(callback, e, combo);
|
15025 |
|
15026 |
+
// we should ignore the next key up if the action is key down
|
15027 |
+
// or keypress. this is so if you finish a sequence and
|
15028 |
+
// release the key the final key will not trigger a keyup
|
15029 |
+
if (action !== 'keyup') {
|
15030 |
+
_ignoreNextKeyup = _characterFromEvent(e);
|
15031 |
+
}
|
15032 |
|
15033 |
+
// weird race condition if a sequence ends with the key
|
15034 |
+
// another sequence begins with
|
15035 |
+
setTimeout(_resetSequences, 10);
|
15036 |
+
}
|
15037 |
|
15038 |
+
// loop through keys one at a time and bind the appropriate callback
|
15039 |
+
// function. for any key leading up to the final one it should
|
15040 |
+
// increase the sequence. after the final, it should reset all sequences
|
15041 |
+
//
|
15042 |
+
// if an action is specified in the original bind call then that will
|
15043 |
+
// be used throughout. otherwise we will pass the action that the
|
15044 |
+
// next key in the sequence should match. this allows a sequence
|
15045 |
+
// to mix and match keypress and keydown events depending on which
|
15046 |
+
// ones are better suited to the key provided
|
15047 |
+
for (var i = 0; i < keys.length; ++i) {
|
15048 |
+
var isFinal = i + 1 === keys.length;
|
15049 |
+
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
|
15050 |
+
_bindSingle(keys[i], wrappedCallback, action, combo, i);
|
15051 |
+
}
|
15052 |
+
}
|
15053 |
|
15054 |
+
/**
|
15055 |
+
* binds a single keyboard combination
|
15056 |
+
*
|
15057 |
+
* @param {string} combination
|
15058 |
+
* @param {Function} callback
|
15059 |
+
* @param {string=} action
|
15060 |
+
* @param {string=} sequenceName - name of sequence if part of sequence
|
15061 |
+
* @param {number=} level - what part of the sequence the command is
|
15062 |
+
* @returns void
|
15063 |
+
*/
|
15064 |
+
function _bindSingle(combination, callback, action, sequenceName, level) {
|
15065 |
|
15066 |
+
// store a direct mapped reference for use with Mousetrap.trigger
|
15067 |
+
self._directMap[combination + ':' + action] = callback;
|
15068 |
|
15069 |
+
// make sure multiple spaces in a row become a single space
|
15070 |
+
combination = combination.replace(/\s+/g, ' ');
|
15071 |
|
15072 |
+
var sequence = combination.split(' ');
|
15073 |
+
var info;
|
|
|
15074 |
|
15075 |
+
// if this pattern is a sequence of keys then run through this method
|
15076 |
+
// to reprocess each pattern one key at a time
|
15077 |
+
if (sequence.length > 1) {
|
15078 |
+
_bindSequence(combination, sequence, callback, action);
|
15079 |
+
return;
|
15080 |
+
}
|
15081 |
|
15082 |
+
info = _getKeyInfo(combination, action);
|
|
|
|
|
15083 |
|
15084 |
+
// make sure to initialize array if this is the first time
|
15085 |
+
// a callback is added for this key
|
15086 |
+
self._callbacks[info.key] = self._callbacks[info.key] || [];
|
|
|
|
|
|
|
15087 |
|
15088 |
+
// remove an existing match if there is one
|
15089 |
+
_getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15090 |
|
15091 |
+
// add this call back to the array
|
15092 |
+
// if it is a sequence put it at the beginning
|
15093 |
+
// if not put it at the end
|
15094 |
+
//
|
15095 |
+
// this is important because the way these are processed expects
|
15096 |
+
// the sequence ones to come first
|
15097 |
+
self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({
|
15098 |
+
callback: callback,
|
15099 |
+
modifiers: info.modifiers,
|
15100 |
+
action: info.action,
|
15101 |
+
seq: sequenceName,
|
15102 |
+
level: level,
|
15103 |
+
combo: combination
|
15104 |
+
});
|
15105 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15106 |
|
15107 |
+
/**
|
15108 |
+
* binds multiple combinations to the same callback
|
15109 |
+
*
|
15110 |
+
* @param {Array} combinations
|
15111 |
+
* @param {Function} callback
|
15112 |
+
* @param {string|undefined} action
|
15113 |
+
* @returns void
|
15114 |
+
*/
|
15115 |
+
self._bindMultiple = function(combinations, callback, action) {
|
15116 |
+
for (var i = 0; i < combinations.length; ++i) {
|
15117 |
+
_bindSingle(combinations[i], callback, action);
|
15118 |
+
}
|
15119 |
+
};
|
15120 |
|
15121 |
+
// start!
|
15122 |
+
_addEvent(targetElement, 'keypress', _handleKeyEvent);
|
15123 |
+
_addEvent(targetElement, 'keydown', _handleKeyEvent);
|
15124 |
+
_addEvent(targetElement, 'keyup', _handleKeyEvent);
|
15125 |
+
}
|
|
|
|
|
15126 |
|
15127 |
+
/**
|
15128 |
+
* binds an event to mousetrap
|
15129 |
+
*
|
15130 |
+
* can be a single key, a combination of keys separated with +,
|
15131 |
+
* an array of keys, or a sequence of keys separated by spaces
|
15132 |
+
*
|
15133 |
+
* be sure to list the modifier keys first to make sure that the
|
15134 |
+
* correct key ends up getting bound (the last key in the pattern)
|
15135 |
+
*
|
15136 |
+
* @param {string|Array} keys
|
15137 |
+
* @param {Function} callback
|
15138 |
+
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
|
15139 |
+
* @returns void
|
15140 |
+
*/
|
15141 |
+
Mousetrap.prototype.bind = function(keys, callback, action) {
|
15142 |
+
var self = this;
|
15143 |
+
keys = keys instanceof Array ? keys : [keys];
|
15144 |
+
self._bindMultiple.call(self, keys, callback, action);
|
15145 |
+
return self;
|
15146 |
+
};
|
15147 |
|
15148 |
+
/**
|
15149 |
+
* unbinds an event to mousetrap
|
15150 |
+
*
|
15151 |
+
* the unbinding sets the callback function of the specified key combo
|
15152 |
+
* to an empty function and deletes the corresponding key in the
|
15153 |
+
* _directMap dict.
|
15154 |
+
*
|
15155 |
+
* TODO: actually remove this from the _callbacks dictionary instead
|
15156 |
+
* of binding an empty function
|
15157 |
+
*
|
15158 |
+
* the keycombo+action has to be exactly the same as
|
15159 |
+
* it was defined in the bind method
|
15160 |
+
*
|
15161 |
+
* @param {string|Array} keys
|
15162 |
+
* @param {string} action
|
15163 |
+
* @returns void
|
15164 |
+
*/
|
15165 |
+
Mousetrap.prototype.unbind = function(keys, action) {
|
15166 |
+
var self = this;
|
15167 |
+
return self.bind.call(self, keys, function() {}, action);
|
15168 |
+
};
|
15169 |
|
15170 |
+
/**
|
15171 |
+
* triggers an event that has already been bound
|
15172 |
+
*
|
15173 |
+
* @param {string} keys
|
15174 |
+
* @param {string=} action
|
15175 |
+
* @returns void
|
15176 |
+
*/
|
15177 |
+
Mousetrap.prototype.trigger = function(keys, action) {
|
15178 |
+
var self = this;
|
15179 |
+
if (self._directMap[keys + ':' + action]) {
|
15180 |
+
self._directMap[keys + ':' + action]({}, keys);
|
|
|
|
|
|
|
15181 |
}
|
15182 |
+
return self;
|
15183 |
+
};
|
15184 |
|
15185 |
+
/**
|
15186 |
+
* resets the library back to its initial state. this is useful
|
15187 |
+
* if you want to clear out the current keyboard shortcuts and bind
|
15188 |
+
* new ones - for example if you switch to another page
|
15189 |
+
*
|
15190 |
+
* @returns void
|
15191 |
+
*/
|
15192 |
+
Mousetrap.prototype.reset = function() {
|
15193 |
+
var self = this;
|
15194 |
+
self._callbacks = {};
|
15195 |
+
self._directMap = {};
|
15196 |
+
return self;
|
15197 |
+
};
|
15198 |
|
15199 |
+
/**
|
15200 |
+
* should we stop this event before firing off callbacks
|
15201 |
+
*
|
15202 |
+
* @param {Event} e
|
15203 |
+
* @param {Element} element
|
15204 |
+
* @return {boolean}
|
15205 |
+
*/
|
15206 |
+
Mousetrap.prototype.stopCallback = function(e, element) {
|
15207 |
+
var self = this;
|
15208 |
|
15209 |
+
// if the element has the class "mousetrap" then no need to stop
|
15210 |
+
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
|
15211 |
+
return false;
|
15212 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
15213 |
|
15214 |
+
if (_belongsTo(element, self.target)) {
|
15215 |
+
return false;
|
15216 |
+
}
|
15217 |
|
15218 |
+
// Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
|
15219 |
+
// not the initial event target in the shadow tree. Note that not all events cross the
|
15220 |
+
// shadow boundary.
|
15221 |
+
// For shadow trees with `mode: 'open'`, the initial event target is the first element in
|
15222 |
+
// the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
|
15223 |
+
// target cannot be obtained.
|
15224 |
+
if ('composedPath' in e && typeof e.composedPath === 'function') {
|
15225 |
+
// For open shadow trees, update `element` so that the following check works.
|
15226 |
+
var initialEventTarget = e.composedPath()[0];
|
15227 |
+
if (initialEventTarget !== e.target) {
|
15228 |
+
element = initialEventTarget;
|
15229 |
+
}
|
15230 |
+
}
|
15231 |
|
15232 |
+
// stop for input, select, and textarea
|
15233 |
+
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
|
15234 |
+
};
|
|
|
|
|
|
|
|
|
15235 |
|
15236 |
+
/**
|
15237 |
+
* exposes _handleKey publicly so it can be overwritten by extensions
|
15238 |
+
*/
|
15239 |
+
Mousetrap.prototype.handleKey = function() {
|
15240 |
+
var self = this;
|
15241 |
+
return self._handleKey.apply(self, arguments);
|
15242 |
+
};
|
|
|
|
|
|
|
15243 |
|
15244 |
+
/**
|
15245 |
+
* allow custom key mappings
|
15246 |
+
*/
|
15247 |
+
Mousetrap.addKeycodes = function(object) {
|
15248 |
+
for (var key in object) {
|
15249 |
+
if (object.hasOwnProperty(key)) {
|
15250 |
+
_MAP[key] = object[key];
|
15251 |
+
}
|
15252 |
+
}
|
15253 |
+
_REVERSE_MAP = null;
|
15254 |
+
};
|
15255 |
|
15256 |
+
/**
|
15257 |
+
* Init the global mousetrap functions
|
15258 |
+
*
|
15259 |
+
* This method is needed to allow the global mousetrap functions to work
|
15260 |
+
* now that mousetrap is a constructor function.
|
15261 |
+
*/
|
15262 |
+
Mousetrap.init = function() {
|
15263 |
+
var documentMousetrap = Mousetrap(document);
|
15264 |
+
for (var method in documentMousetrap) {
|
15265 |
+
if (method.charAt(0) !== '_') {
|
15266 |
+
Mousetrap[method] = (function(method) {
|
15267 |
+
return function() {
|
15268 |
+
return documentMousetrap[method].apply(documentMousetrap, arguments);
|
15269 |
+
};
|
15270 |
+
} (method));
|
15271 |
+
}
|
15272 |
+
}
|
15273 |
+
};
|
15274 |
|
15275 |
+
Mousetrap.init();
|
|
|
|
|
|
|
|
|
|
|
15276 |
|
15277 |
+
// expose mousetrap to the global object
|
15278 |
+
window.Mousetrap = Mousetrap;
|
|
|
|
|
|
|
|
|
15279 |
|
15280 |
+
// expose as a common js module
|
15281 |
+
if (typeof module !== 'undefined' && module.exports) {
|
15282 |
+
module.exports = Mousetrap;
|
15283 |
+
}
|
|
|
|
|
|
|
15284 |
|
15285 |
+
// expose mousetrap as an AMD module
|
15286 |
+
if (true) {
|
15287 |
+
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
|
15288 |
+
return Mousetrap;
|
15289 |
+
}).call(exports, __webpack_require__, exports, module),
|
15290 |
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
15291 |
+
}
|
15292 |
+
}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
|
15293 |
|
|
|
|
|
15294 |
|
15295 |
+
/***/ }),
|
15296 |
+
/* 99 */
|
15297 |
+
/***/ (function(module, exports) {
|
15298 |
|
15299 |
+
/**
|
15300 |
+
* adds a bindGlobal method to Mousetrap that allows you to
|
15301 |
+
* bind specific keyboard shortcuts that will still work
|
15302 |
+
* inside a text input field
|
15303 |
+
*
|
15304 |
+
* usage:
|
15305 |
+
* Mousetrap.bindGlobal('ctrl+s', _saveChanges);
|
15306 |
+
*/
|
15307 |
+
/* global Mousetrap:true */
|
15308 |
+
(function(Mousetrap) {
|
15309 |
+
if (! Mousetrap) {
|
15310 |
+
return;
|
15311 |
+
}
|
15312 |
+
var _globalCallbacks = {};
|
15313 |
+
var _originalStopCallback = Mousetrap.prototype.stopCallback;
|
15314 |
|
15315 |
+
Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
|
15316 |
+
var self = this;
|
|
|
|
|
15317 |
|
15318 |
+
if (self.paused) {
|
15319 |
+
return true;
|
15320 |
+
}
|
15321 |
|
15322 |
+
if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
|
15323 |
+
return false;
|
15324 |
+
}
|
|
|
15325 |
|
15326 |
+
return _originalStopCallback.call(self, e, element, combo);
|
15327 |
+
};
|
|
|
|
|
|
|
|
|
15328 |
|
15329 |
+
Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
|
15330 |
+
var self = this;
|
15331 |
+
self.bind(keys, callback, action);
|
|
|
|
|
15332 |
|
15333 |
+
if (keys instanceof Array) {
|
15334 |
+
for (var i = 0; i < keys.length; i++) {
|
15335 |
+
_globalCallbacks[keys[i]] = true;
|
15336 |
+
}
|
15337 |
+
return;
|
15338 |
+
}
|
15339 |
|
15340 |
+
_globalCallbacks[keys] = true;
|
15341 |
+
};
|
|
|
|
|
15342 |
|
15343 |
+
Mousetrap.init();
|
15344 |
+
}) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined);
|
|
|
|
|
15345 |
|
|
|
|
|
|
|
|
|
15346 |
|
15347 |
+
/***/ }),
|
15348 |
+
/* 100 */
|
15349 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
15350 |
|
15351 |
+
"use strict";
|
15352 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useMediaQuery;
|
15353 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(33);
|
15354 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wordpress_element__ = __webpack_require__(28);
|
15355 |
|
|
|
|
|
|
|
|
|
15356 |
|
15357 |
+
/**
|
15358 |
+
* WordPress dependencies
|
15359 |
+
*/
|
|
|
|
|
15360 |
|
15361 |
+
/**
|
15362 |
+
* Runs a media query and returns its value when it changes.
|
15363 |
+
*
|
15364 |
+
* @param {string} [query] Media Query.
|
15365 |
+
* @return {boolean} return value of the media query.
|
15366 |
+
*/
|
15367 |
|
15368 |
+
function useMediaQuery(query) {
|
15369 |
+
var _useState = Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["k" /* useState */])(query && window.matchMedia(query).matches),
|
15370 |
+
_useState2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_useState, 2),
|
15371 |
+
match = _useState2[0],
|
15372 |
+
setMatch = _useState2[1];
|
15373 |
|
15374 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["g" /* useEffect */])(function () {
|
15375 |
+
if (!query) {
|
15376 |
+
return;
|
15377 |
+
}
|
|
|
|
|
15378 |
|
15379 |
+
var updateMatch = function updateMatch() {
|
15380 |
+
return setMatch(window.matchMedia(query).matches);
|
15381 |
+
};
|
15382 |
|
15383 |
+
updateMatch();
|
15384 |
+
var list = window.matchMedia(query);
|
15385 |
+
list.addListener(updateMatch);
|
15386 |
+
return function () {
|
15387 |
+
list.removeListener(updateMatch);
|
15388 |
+
};
|
15389 |
+
}, [query]);
|
15390 |
+
return query && match;
|
15391 |
+
}
|
15392 |
+
//# sourceMappingURL=index.js.map
|
15393 |
|
15394 |
+
/***/ }),
|
15395 |
+
/* 101 */
|
15396 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
15397 |
|
15398 |
+
"use strict";
|
15399 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__registry__ = __webpack_require__(151);
|
15400 |
+
/**
|
15401 |
+
* Internal dependencies
|
15402 |
+
*/
|
|
|
15403 |
|
15404 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__registry__["a" /* createRegistry */])());
|
15405 |
+
//# sourceMappingURL=default-registry.js.map
|
|
|
|
|
15406 |
|
15407 |
+
/***/ }),
|
15408 |
+
/* 102 */
|
15409 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
15410 |
|
15411 |
+
"use strict";
|
15412 |
+
/* unused harmony export logged */
|
15413 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = deprecated;
|
15414 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_hooks__ = __webpack_require__(62);
|
15415 |
+
/**
|
15416 |
+
* WordPress dependencies
|
15417 |
+
*/
|
15418 |
|
15419 |
+
/**
|
15420 |
+
* Object map tracking messages which have been logged, for use in ensuring a
|
15421 |
+
* message is only logged once.
|
15422 |
+
*
|
15423 |
+
* @type {Object}
|
15424 |
+
*/
|
15425 |
|
15426 |
+
var logged = Object.create(null);
|
15427 |
+
/**
|
15428 |
+
* Logs a message to notify developers about a deprecated feature.
|
15429 |
+
*
|
15430 |
+
* @param {string} feature Name of the deprecated feature.
|
15431 |
+
* @param {?Object} options Personalisation options
|
15432 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
15433 |
+
* @param {?string} options.alternative Feature to use instead
|
15434 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
15435 |
+
* @param {?string} options.link Link to documentation
|
15436 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
15437 |
+
*
|
15438 |
+
* @example
|
15439 |
+
* ```js
|
15440 |
+
* import deprecated from '@wordpress/deprecated';
|
15441 |
+
*
|
15442 |
+
* deprecated( 'Eating meat', {
|
15443 |
+
* version: 'the future',
|
15444 |
+
* alternative: 'vegetables',
|
15445 |
+
* plugin: 'the earth',
|
15446 |
+
* hint: 'You may find it beneficial to transition gradually.',
|
15447 |
+
* } );
|
15448 |
+
*
|
15449 |
+
* // Logs: 'Eating meat is deprecated and will be removed from the earth in the future. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
|
15450 |
+
* ```
|
15451 |
+
*/
|
15452 |
|
15453 |
+
function deprecated(feature) {
|
15454 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
15455 |
+
var version = options.version,
|
15456 |
+
alternative = options.alternative,
|
15457 |
+
plugin = options.plugin,
|
15458 |
+
link = options.link,
|
15459 |
+
hint = options.hint;
|
15460 |
+
var pluginMessage = plugin ? " from ".concat(plugin) : '';
|
15461 |
+
var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
|
15462 |
+
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
|
15463 |
+
var linkMessage = link ? " See: ".concat(link) : '';
|
15464 |
+
var hintMessage = hint ? " Note: ".concat(hint) : '';
|
15465 |
+
var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
|
15466 |
|
15467 |
+
if (message in logged) {
|
15468 |
+
return;
|
15469 |
+
}
|
15470 |
+
/**
|
15471 |
+
* Fires whenever a deprecated feature is encountered
|
15472 |
+
*
|
15473 |
+
* @param {string} feature Name of the deprecated feature.
|
15474 |
+
* @param {?Object} options Personalisation options
|
15475 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
15476 |
+
* @param {?string} options.alternative Feature to use instead
|
15477 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
15478 |
+
* @param {?string} options.link Link to documentation
|
15479 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
15480 |
+
* @param {?string} message Message sent to console.warn
|
15481 |
+
*/
|
15482 |
|
|
|
|
|
|
|
|
|
|
|
15483 |
|
15484 |
+
Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_hooks__["c" /* doAction */])('deprecated', feature, options, message); // eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
|
|
|
15485 |
|
15486 |
+
console.warn(message);
|
15487 |
+
logged[message] = true;
|
15488 |
+
}
|
15489 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
15490 |
|
15491 |
/***/ }),
|
15492 |
+
/* 103 */
|
15493 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15494 |
|
15495 |
+
"use strict";
|
15496 |
+
/**
|
15497 |
+
* Validate a hookName string.
|
15498 |
+
*
|
15499 |
+
* @param {string} hookName The hook name to validate. Should be a non empty string containing
|
15500 |
+
* only numbers, letters, dashes, periods and underscores. Also,
|
15501 |
+
* the hook name cannot begin with `__`.
|
15502 |
+
*
|
15503 |
+
* @return {boolean} Whether the hook name is valid.
|
15504 |
+
*/
|
15505 |
+
function validateHookName(hookName) {
|
15506 |
+
if ('string' !== typeof hookName || '' === hookName) {
|
15507 |
+
// eslint-disable-next-line no-console
|
15508 |
+
console.error('The hook name must be a non-empty string.');
|
15509 |
+
return false;
|
15510 |
+
}
|
15511 |
|
15512 |
+
if (/^__/.test(hookName)) {
|
15513 |
+
// eslint-disable-next-line no-console
|
15514 |
+
console.error('The hook name cannot begin with `__`.');
|
15515 |
+
return false;
|
15516 |
+
}
|
15517 |
|
15518 |
+
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
|
15519 |
+
// eslint-disable-next-line no-console
|
15520 |
+
console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.');
|
15521 |
+
return false;
|
15522 |
+
}
|
15523 |
|
15524 |
+
return true;
|
15525 |
+
}
|
15526 |
|
15527 |
+
/* harmony default export */ __webpack_exports__["a"] = (validateHookName);
|
15528 |
+
//# sourceMappingURL=validateHookName.js.map
|
15529 |
|
15530 |
+
/***/ }),
|
15531 |
+
/* 104 */
|
15532 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15533 |
|
15534 |
+
"use strict";
|
15535 |
+
/* unused harmony export concatChildren */
|
15536 |
+
/* unused harmony export switchChildrenNodeName */
|
15537 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
15538 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
15539 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(10);
|
15540 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
15541 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
|
15542 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
|
15543 |
+
/* unused harmony reexport Children */
|
15544 |
+
/* unused harmony reexport cloneElement */
|
15545 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Component")) __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Component"]; });
|
15546 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createContext")) __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createContext"]; });
|
15547 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createElement")) __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"]; });
|
15548 |
+
/* unused harmony reexport createRef */
|
15549 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "forwardRef")) __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["forwardRef"]; });
|
15550 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Fragment")) __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Fragment"]; });
|
15551 |
+
/* unused harmony reexport isValidElement */
|
15552 |
+
/* unused harmony reexport memo */
|
15553 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "StrictMode")) __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["StrictMode"]; });
|
15554 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useCallback")) __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useCallback"]; });
|
15555 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useContext")) __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useContext"]; });
|
15556 |
+
/* unused harmony reexport useDebugValue */
|
15557 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useEffect")) __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useEffect"]; });
|
15558 |
+
/* unused harmony reexport useImperativeHandle */
|
15559 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useLayoutEffect")) __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useLayoutEffect"]; });
|
15560 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useMemo")) __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useMemo"]; });
|
15561 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useReducer")) __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useReducer"]; });
|
15562 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useRef")) __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useRef"]; });
|
15563 |
+
/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useState")) __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useState"]; });
|
15564 |
+
/* unused harmony reexport lazy */
|
15565 |
+
/* unused harmony reexport Suspense */
|
15566 |
+
|
15567 |
+
|
15568 |
+
|
15569 |
+
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; }
|
15570 |
+
|
15571 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
15572 |
|
15573 |
+
/**
|
15574 |
+
* External dependencies
|
15575 |
+
*/
|
15576 |
|
|
|
|
|
|
|
|
|
|
|
15577 |
|
15578 |
+
/**
|
15579 |
+
* Object containing a React element.
|
15580 |
+
*
|
15581 |
+
* @typedef {import('react').ReactElement} WPElement
|
15582 |
+
*/
|
15583 |
|
15584 |
+
/**
|
15585 |
+
* Object containing a React component.
|
15586 |
+
*
|
15587 |
+
* @typedef {import('react').ComponentType} WPComponent
|
15588 |
+
*/
|
15589 |
|
15590 |
+
/**
|
15591 |
+
* Object containing a React synthetic event.
|
15592 |
+
*
|
15593 |
+
* @typedef {import('react').SyntheticEvent} WPSyntheticEvent
|
15594 |
+
*/
|
15595 |
|
15596 |
+
/**
|
15597 |
+
* Object that provides utilities for dealing with React children.
|
15598 |
+
*/
|
15599 |
|
|
|
|
|
15600 |
|
15601 |
+
/**
|
15602 |
+
* Creates a copy of an element with extended props.
|
15603 |
+
*
|
15604 |
+
* @param {WPElement} element Element
|
15605 |
+
* @param {?Object} props Props to apply to cloned element
|
15606 |
+
*
|
15607 |
+
* @return {WPElement} Cloned element.
|
15608 |
+
*/
|
15609 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15610 |
|
15611 |
+
/**
|
15612 |
+
* A base class to create WordPress Components (Refs, state and lifecycle hooks)
|
15613 |
+
*/
|
15614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15615 |
|
15616 |
+
/**
|
15617 |
+
* Creates a context object containing two components: a provider and consumer.
|
15618 |
+
*
|
15619 |
+
* @param {Object} defaultValue A default data stored in the context.
|
15620 |
+
*
|
15621 |
+
* @return {Object} Context object.
|
15622 |
+
*/
|
15623 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15624 |
|
15625 |
+
/**
|
15626 |
+
* Returns a new element of given type. Type can be either a string tag name or
|
15627 |
+
* another function which itself returns an element.
|
15628 |
+
*
|
15629 |
+
* @param {?(string|Function)} type Tag name or element creator
|
15630 |
+
* @param {Object} props Element properties, either attribute
|
15631 |
+
* set to apply to DOM node or values to
|
15632 |
+
* pass through to element creator
|
15633 |
+
* @param {...WPElement} children Descendant elements
|
15634 |
+
*
|
15635 |
+
* @return {WPElement} Element.
|
15636 |
+
*/
|
15637 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15638 |
|
15639 |
+
/**
|
15640 |
+
* Returns an object tracking a reference to a rendered element via its
|
15641 |
+
* `current` property as either a DOMElement or Element, dependent upon the
|
15642 |
+
* type of element rendered with the ref attribute.
|
15643 |
+
*
|
15644 |
+
* @return {Object} Ref object.
|
15645 |
+
*/
|
15646 |
|
|
|
|
|
|
|
|
|
|
|
15647 |
|
15648 |
+
/**
|
15649 |
+
* Component enhancer used to enable passing a ref to its wrapped component.
|
15650 |
+
* Pass a function argument which receives `props` and `ref` as its arguments,
|
15651 |
+
* returning an element using the forwarded ref. The return value is a new
|
15652 |
+
* component which forwards its ref.
|
15653 |
+
*
|
15654 |
+
* @param {Function} forwarder Function passed `props` and `ref`, expected to
|
15655 |
+
* return an element.
|
15656 |
+
*
|
15657 |
+
* @return {WPComponent} Enhanced component.
|
15658 |
+
*/
|
15659 |
|
|
|
|
|
|
|
|
|
|
|
15660 |
|
15661 |
+
/**
|
15662 |
+
* A component which renders its children without any wrapping element.
|
15663 |
+
*/
|
|
|
15664 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15665 |
|
15666 |
+
/**
|
15667 |
+
* Checks if an object is a valid WPElement.
|
15668 |
+
*
|
15669 |
+
* @param {Object} objectToCheck The object to be checked.
|
15670 |
+
*
|
15671 |
+
* @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
|
15672 |
+
*/
|
15673 |
|
|
|
|
|
|
|
|
|
|
|
15674 |
|
15675 |
+
/**
|
15676 |
+
* @see https://reactjs.org/docs/react-api.html#reactmemo
|
15677 |
+
*/
|
15678 |
|
|
|
|
|
|
|
15679 |
|
15680 |
+
/**
|
15681 |
+
* Component that activates additional checks and warnings for its descendants.
|
15682 |
+
*/
|
15683 |
|
|
|
|
|
|
|
15684 |
|
15685 |
+
/**
|
15686 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usecallback
|
15687 |
+
*/
|
15688 |
|
|
|
|
|
|
|
15689 |
|
15690 |
+
/**
|
15691 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usecontext
|
15692 |
+
*/
|
|
|
15693 |
|
|
|
|
|
|
|
15694 |
|
15695 |
+
/**
|
15696 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
|
15697 |
+
*/
|
15698 |
|
|
|
|
|
|
|
|
|
|
|
15699 |
|
15700 |
+
/**
|
15701 |
+
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
|
15702 |
+
*/
|
15703 |
|
|
|
15704 |
|
15705 |
+
/**
|
15706 |
+
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
|
15707 |
+
*/
|
15708 |
|
|
|
|
|
|
|
|
|
15709 |
|
15710 |
+
/**
|
15711 |
+
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
15712 |
+
*/
|
15713 |
|
|
|
|
|
15714 |
|
15715 |
+
/**
|
15716 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usememo
|
15717 |
+
*/
|
15718 |
|
|
|
|
|
|
|
15719 |
|
15720 |
+
/**
|
15721 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usereducer
|
15722 |
+
*/
|
15723 |
|
|
|
|
|
|
|
|
|
15724 |
|
15725 |
+
/**
|
15726 |
+
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
15727 |
+
*/
|
15728 |
|
|
|
15729 |
|
15730 |
+
/**
|
15731 |
+
* @see https://reactjs.org/docs/hooks-reference.html#usestate
|
15732 |
+
*/
|
15733 |
|
|
|
15734 |
|
15735 |
+
/**
|
15736 |
+
* @see https://reactjs.org/docs/react-api.html#reactlazy
|
15737 |
+
*/
|
15738 |
|
|
|
|
|
|
|
|
|
15739 |
|
15740 |
+
/**
|
15741 |
+
* @see https://reactjs.org/docs/react-api.html#reactsuspense
|
15742 |
+
*/
|
15743 |
|
|
|
|
|
|
|
|
|
|
|
15744 |
|
15745 |
+
/**
|
15746 |
+
* Concatenate two or more React children objects.
|
15747 |
+
*
|
15748 |
+
* @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
|
15749 |
+
*
|
15750 |
+
* @return {Array} The concatenated value.
|
15751 |
+
*/
|
15752 |
|
15753 |
+
function concatChildren() {
|
15754 |
+
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
|
15755 |
+
childrenArguments[_key] = arguments[_key];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15756 |
}
|
15757 |
|
15758 |
+
return childrenArguments.reduce(function (accumulator, children, i) {
|
15759 |
+
__WEBPACK_IMPORTED_MODULE_2_react__["Children"].forEach(children, function (child, j) {
|
15760 |
+
if (child && 'string' !== typeof child) {
|
15761 |
+
child = Object(__WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"])(child, {
|
15762 |
+
key: [i, j].join()
|
15763 |
+
});
|
15764 |
}
|
15765 |
|
15766 |
+
accumulator.push(child);
|
15767 |
+
});
|
15768 |
+
return accumulator;
|
15769 |
+
}, []);
|
15770 |
+
}
|
15771 |
+
/**
|
15772 |
+
* Switches the nodeName of all the elements in the children object.
|
15773 |
+
*
|
15774 |
+
* @param {?Object} children Children object.
|
15775 |
+
* @param {string} nodeName Node name.
|
15776 |
+
*
|
15777 |
+
* @return {?Object} The updated children object.
|
15778 |
+
*/
|
15779 |
|
15780 |
+
function switchChildrenNodeName(children, nodeName) {
|
15781 |
+
return children && __WEBPACK_IMPORTED_MODULE_2_react__["Children"].map(children, function (elt, index) {
|
15782 |
+
if (Object(__WEBPACK_IMPORTED_MODULE_3_lodash__["isString"])(elt)) {
|
15783 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, {
|
15784 |
+
key: index
|
15785 |
+
}, elt);
|
15786 |
}
|
15787 |
|
15788 |
+
var _elt$props = elt.props,
|
15789 |
+
childrenProp = _elt$props.children,
|
15790 |
+
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_elt$props, ["children"]);
|
15791 |
|
15792 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, _objectSpread({
|
15793 |
+
key: index
|
15794 |
+
}, props), childrenProp);
|
15795 |
+
});
|
15796 |
}
|
15797 |
+
//# sourceMappingURL=react.js.map
|
15798 |
|
15799 |
/***/ }),
|
15800 |
+
/* 105 */
|
15801 |
/***/ (function(module, exports, __webpack_require__) {
|
15802 |
|
15803 |
+
"use strict";
|
|
|
|
|
|
|
15804 |
|
|
|
15805 |
|
15806 |
+
/**
|
15807 |
+
* Internal dependencies;
|
15808 |
+
*/
|
15809 |
+
var isShallowEqualObjects = __webpack_require__( 531 );
|
15810 |
+
var isShallowEqualArrays = __webpack_require__( 532 );
|
15811 |
|
15812 |
+
var isArray = Array.isArray;
|
15813 |
|
15814 |
+
/**
|
15815 |
+
* @typedef {Record<string, any>} ComparableObject
|
15816 |
+
*/
|
15817 |
+
|
15818 |
+
/**
|
15819 |
+
* Returns true if the two arrays or objects are shallow equal, or false
|
15820 |
+
* otherwise.
|
15821 |
+
*
|
15822 |
+
* @param {any[]|ComparableObject} a First object or array to compare.
|
15823 |
+
* @param {any[]|ComparableObject} b Second object or array to compare.
|
15824 |
+
*
|
15825 |
+
* @return {boolean} Whether the two values are shallow equal.
|
15826 |
+
*/
|
15827 |
+
function isShallowEqual( a, b ) {
|
15828 |
+
if ( a && b ) {
|
15829 |
+
if ( a.constructor === Object && b.constructor === Object ) {
|
15830 |
+
return isShallowEqualObjects( a, b );
|
15831 |
+
} else if ( isArray( a ) && isArray( b ) ) {
|
15832 |
+
return isShallowEqualArrays( a, b );
|
15833 |
+
}
|
15834 |
+
}
|
15835 |
+
|
15836 |
+
return a === b;
|
15837 |
}
|
|
|
15838 |
|
15839 |
+
module.exports = isShallowEqual;
|
15840 |
+
module.exports.isShallowEqualObjects = isShallowEqualObjects;
|
15841 |
+
module.exports.isShallowEqualArrays = isShallowEqualArrays;
|
15842 |
|
|
|
|
|
|
|
|
|
15843 |
|
15844 |
+
/***/ }),
|
15845 |
+
/* 106 */
|
15846 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15847 |
|
15848 |
+
"use strict";
|
15849 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useMediaQuery;
|
15850 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(33);
|
15851 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wordpress_element__ = __webpack_require__(15);
|
15852 |
|
|
|
15853 |
|
15854 |
+
/**
|
15855 |
+
* WordPress dependencies
|
15856 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15857 |
|
15858 |
+
/**
|
15859 |
+
* Runs a media query and returns its value when it changes.
|
15860 |
+
*
|
15861 |
+
* @param {string} [query] Media Query.
|
15862 |
+
* @return {boolean} return value of the media query.
|
15863 |
+
*/
|
15864 |
|
15865 |
+
function useMediaQuery(query) {
|
15866 |
+
var _useState = Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["m" /* useState */])(query && window.matchMedia(query).matches),
|
15867 |
+
_useState2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_useState, 2),
|
15868 |
+
match = _useState2[0],
|
15869 |
+
setMatch = _useState2[1];
|
15870 |
|
15871 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["h" /* useEffect */])(function () {
|
15872 |
+
if (!query) {
|
15873 |
+
return;
|
15874 |
+
}
|
15875 |
|
15876 |
+
var updateMatch = function updateMatch() {
|
15877 |
+
return setMatch(window.matchMedia(query).matches);
|
15878 |
+
};
|
15879 |
|
15880 |
+
updateMatch();
|
15881 |
+
var list = window.matchMedia(query);
|
15882 |
+
list.addListener(updateMatch);
|
15883 |
+
return function () {
|
15884 |
+
list.removeListener(updateMatch);
|
15885 |
+
};
|
15886 |
+
}, [query]);
|
15887 |
+
return query && match;
|
15888 |
+
}
|
15889 |
+
//# sourceMappingURL=index.js.map
|
15890 |
|
15891 |
+
/***/ }),
|
15892 |
+
/* 107 */
|
15893 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15894 |
|
15895 |
+
"use strict";
|
15896 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = isFormatEqual;
|
15897 |
+
/**
|
15898 |
+
* Optimised equality check for format objects.
|
15899 |
+
*
|
15900 |
+
* @param {?Object} format1 Format to compare.
|
15901 |
+
* @param {?Object} format2 Format to compare.
|
15902 |
+
*
|
15903 |
+
* @return {boolean} True if formats are equal, false if not.
|
15904 |
+
*/
|
15905 |
+
function isFormatEqual(format1, format2) {
|
15906 |
+
// Both not defined.
|
15907 |
+
if (format1 === format2) {
|
15908 |
+
return true;
|
15909 |
+
} // Either not defined.
|
15910 |
|
|
|
|
|
15911 |
|
15912 |
+
if (!format1 || !format2) {
|
15913 |
+
return false;
|
15914 |
}
|
|
|
|
|
15915 |
|
15916 |
+
if (format1.type !== format2.type) {
|
15917 |
+
return false;
|
15918 |
+
}
|
15919 |
|
15920 |
+
var attributes1 = format1.attributes;
|
15921 |
+
var attributes2 = format2.attributes; // Both not defined.
|
15922 |
|
15923 |
+
if (attributes1 === attributes2) {
|
15924 |
+
return true;
|
15925 |
+
} // Either not defined.
|
15926 |
|
|
|
|
|
|
|
15927 |
|
15928 |
+
if (!attributes1 || !attributes2) {
|
15929 |
+
return false;
|
15930 |
}
|
15931 |
|
15932 |
+
var keys1 = Object.keys(attributes1);
|
15933 |
+
var keys2 = Object.keys(attributes2);
|
15934 |
|
15935 |
+
if (keys1.length !== keys2.length) {
|
15936 |
+
return false;
|
15937 |
+
}
|
15938 |
|
15939 |
+
var length = keys1.length; // Optimise for speed.
|
|
|
|
|
|
|
15940 |
|
15941 |
+
for (var i = 0; i < length; i++) {
|
15942 |
+
var name = keys1[i];
|
|
|
15943 |
|
15944 |
+
if (attributes1[name] !== attributes2[name]) {
|
15945 |
+
return false;
|
15946 |
+
}
|
15947 |
+
}
|
15948 |
|
15949 |
+
return true;
|
15950 |
+
}
|
15951 |
+
//# sourceMappingURL=is-format-equal.js.map
|
15952 |
|
15953 |
/***/ }),
|
15954 |
+
/* 108 */
|
15955 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15956 |
|
15957 |
"use strict";
|
15958 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = createElement;
|
15959 |
+
/**
|
15960 |
+
* Parse the given HTML into a body element.
|
15961 |
+
*
|
15962 |
+
* Note: The current implementation will return a shared reference, reset on
|
15963 |
+
* each call to `createElement`. Therefore, you should not hold a reference to
|
15964 |
+
* the value to operate upon asynchronously, as it may have unexpected results.
|
15965 |
+
*
|
15966 |
+
* @param {HTMLDocument} document The HTML document to use to parse.
|
15967 |
+
* @param {string} html The HTML to parse.
|
15968 |
+
*
|
15969 |
+
* @return {HTMLBodyElement} Body element with parsed HTML.
|
15970 |
+
*/
|
15971 |
+
function createElement(_ref, html) {
|
15972 |
+
var implementation = _ref.implementation;
|
15973 |
|
15974 |
+
// Because `createHTMLDocument` is an expensive operation, and with this
|
15975 |
+
// function being internal to `rich-text` (full control in avoiding a risk
|
15976 |
+
// of asynchronous operations on the shared reference), a single document
|
15977 |
+
// is reused and reset for each call to the function.
|
15978 |
+
if (!createElement.body) {
|
15979 |
+
createElement.body = implementation.createHTMLDocument('').body;
|
15980 |
+
}
|
15981 |
|
15982 |
+
createElement.body.innerHTML = html;
|
15983 |
+
return createElement.body;
|
15984 |
+
}
|
15985 |
+
//# sourceMappingURL=create-element.js.map
|
15986 |
|
15987 |
+
/***/ }),
|
15988 |
+
/* 109 */
|
15989 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15990 |
|
15991 |
+
"use strict";
|
15992 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = getActiveFormat;
|
15993 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
|
15994 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
|
15995 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_active_formats__ = __webpack_require__(110);
|
15996 |
+
/**
|
15997 |
+
* External dependencies
|
15998 |
+
*/
|
15999 |
|
16000 |
+
/**
|
16001 |
+
* Internal dependencies
|
16002 |
+
*/
|
|
|
|
|
16003 |
|
|
|
16004 |
|
16005 |
+
/**
|
16006 |
+
* Gets the format object by type at the start of the selection. This can be
|
16007 |
+
* used to get e.g. the URL of a link format at the current selection, but also
|
16008 |
+
* to check if a format is active at the selection. Returns undefined if there
|
16009 |
+
* is no format at the selection.
|
16010 |
+
*
|
16011 |
+
* @param {Object} value Value to inspect.
|
16012 |
+
* @param {string} formatType Format type to look for.
|
16013 |
+
*
|
16014 |
+
* @return {Object|undefined} Active format object of the specified type, or undefined.
|
16015 |
+
*/
|
16016 |
+
|
16017 |
+
function getActiveFormat(value, formatType) {
|
16018 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["find"])(Object(__WEBPACK_IMPORTED_MODULE_1__get_active_formats__["a" /* getActiveFormats */])(value), {
|
16019 |
+
type: formatType
|
16020 |
+
});
|
16021 |
+
}
|
16022 |
+
//# sourceMappingURL=get-active-format.js.map
|
16023 |
|
16024 |
/***/ }),
|
16025 |
+
/* 110 */
|
16026 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16027 |
|
16028 |
"use strict";
|
16029 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = getActiveFormats;
|
16030 |
+
/**
|
16031 |
+
* Gets the all format objects at the start of the selection.
|
16032 |
+
*
|
16033 |
+
* @param {Object} value Value to inspect.
|
16034 |
+
* @param {Array} EMPTY_ACTIVE_FORMATS Array to return if there are no active
|
16035 |
+
* formats.
|
16036 |
+
*
|
16037 |
+
* @return {?Object} Active format objects.
|
16038 |
+
*/
|
16039 |
+
function getActiveFormats(_ref) {
|
16040 |
+
var formats = _ref.formats,
|
16041 |
+
start = _ref.start,
|
16042 |
+
end = _ref.end,
|
16043 |
+
activeFormats = _ref.activeFormats;
|
16044 |
+
var EMPTY_ACTIVE_FORMATS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
16045 |
|
16046 |
+
if (start === undefined) {
|
16047 |
+
return EMPTY_ACTIVE_FORMATS;
|
16048 |
+
}
|
16049 |
|
16050 |
+
if (start === end) {
|
16051 |
+
// For a collapsed caret, it is possible to override the active formats.
|
16052 |
+
if (activeFormats) {
|
16053 |
+
return activeFormats;
|
16054 |
+
}
|
16055 |
|
16056 |
+
var formatsBefore = formats[start - 1] || EMPTY_ACTIVE_FORMATS;
|
16057 |
+
var formatsAfter = formats[start] || EMPTY_ACTIVE_FORMATS; // By default, select the lowest amount of formats possible (which means
|
16058 |
+
// the caret is positioned outside the format boundary). The user can
|
16059 |
+
// then use arrow keys to define `activeFormats`.
|
16060 |
|
16061 |
+
if (formatsBefore.length < formatsAfter.length) {
|
16062 |
+
return formatsBefore;
|
16063 |
+
}
|
16064 |
|
16065 |
+
return formatsAfter;
|
|
|
16066 |
}
|
16067 |
|
16068 |
+
return formats[start] || EMPTY_ACTIVE_FORMATS;
|
16069 |
+
}
|
16070 |
+
//# sourceMappingURL=get-active-formats.js.map
|
16071 |
|
16072 |
+
/***/ }),
|
16073 |
+
/* 111 */
|
16074 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16075 |
|
16076 |
+
"use strict";
|
16077 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = isCollapsed;
|
16078 |
+
/**
|
16079 |
+
* Check if the selection of a Rich Text value is collapsed or not. Collapsed
|
16080 |
+
* means that no characters are selected, but there is a caret present. If there
|
16081 |
+
* is no selection, `undefined` will be returned. This is similar to
|
16082 |
+
* `window.getSelection().isCollapsed()`.
|
16083 |
+
*
|
16084 |
+
* @param {Object} value The rich text value to check.
|
16085 |
+
*
|
16086 |
+
* @return {boolean|undefined} True if the selection is collapsed, false if not,
|
16087 |
+
* undefined if there is no selection.
|
16088 |
+
*/
|
16089 |
+
function isCollapsed(_ref) {
|
16090 |
+
var start = _ref.start,
|
16091 |
+
end = _ref.end;
|
16092 |
|
16093 |
+
if (start === undefined || end === undefined) {
|
16094 |
+
return;
|
16095 |
}
|
16096 |
|
16097 |
+
return start === end;
|
16098 |
}
|
16099 |
+
//# sourceMappingURL=is-collapsed.js.map
|
16100 |
|
16101 |
+
/***/ }),
|
16102 |
+
/* 112 */
|
16103 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16104 |
|
16105 |
+
"use strict";
|
16106 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = removeFormat;
|
16107 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
16108 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(2);
|
16109 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);
|
16110 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__normalise_formats__ = __webpack_require__(50);
|
16111 |
|
|
|
16112 |
|
16113 |
+
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; }
|
|
|
16114 |
|
16115 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
|
|
|
|
16116 |
|
16117 |
/**
|
16118 |
+
* External dependencies
|
16119 |
+
*/
|
16120 |
+
|
16121 |
+
/**
|
16122 |
+
* Internal dependencies
|
16123 |
+
*/
|
16124 |
+
|
16125 |
+
|
16126 |
+
/**
|
16127 |
+
* Remove any format object from a Rich Text value by type from the given
|
16128 |
+
* `startIndex` to the given `endIndex`. Indices are retrieved from the
|
16129 |
+
* selection if none are provided.
|
|
|
|
|
|
|
|
|
|
|
16130 |
*
|
16131 |
+
* @param {Object} value Value to modify.
|
16132 |
+
* @param {string} formatType Format type to remove.
|
16133 |
+
* @param {number} [startIndex] Start index.
|
16134 |
+
* @param {number} [endIndex] End index.
|
16135 |
*
|
16136 |
+
* @return {Object} A new value with the format applied.
|
|
|
16137 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
16138 |
|
16139 |
+
function removeFormat(value, formatType) {
|
16140 |
+
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
16141 |
+
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
16142 |
+
var formats = value.formats,
|
16143 |
+
activeFormats = value.activeFormats;
|
16144 |
+
var newFormats = formats.slice(); // If the selection is collapsed, expand start and end to the edges of the
|
16145 |
+
// format.
|
16146 |
|
16147 |
+
if (startIndex === endIndex) {
|
16148 |
+
var format = Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["find"])(newFormats[startIndex], {
|
16149 |
+
type: formatType
|
16150 |
+
});
|
16151 |
|
16152 |
+
if (format) {
|
16153 |
+
while (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["find"])(newFormats[startIndex], format)) {
|
16154 |
+
filterFormats(newFormats, startIndex, formatType);
|
16155 |
+
startIndex--;
|
16156 |
+
}
|
16157 |
|
16158 |
+
endIndex++;
|
16159 |
|
16160 |
+
while (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["find"])(newFormats[endIndex], format)) {
|
16161 |
+
filterFormats(newFormats, endIndex, formatType);
|
16162 |
+
endIndex++;
|
16163 |
+
}
|
16164 |
+
}
|
16165 |
+
} else {
|
16166 |
+
for (var i = startIndex; i < endIndex; i++) {
|
16167 |
+
if (newFormats[i]) {
|
16168 |
+
filterFormats(newFormats, i, formatType);
|
16169 |
+
}
|
16170 |
+
}
|
16171 |
+
}
|
16172 |
|
16173 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2__normalise_formats__["a" /* normaliseFormats */])(_objectSpread({}, value, {
|
16174 |
+
formats: newFormats,
|
16175 |
+
activeFormats: Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["reject"])(activeFormats, {
|
16176 |
+
type: formatType
|
16177 |
+
})
|
16178 |
+
}));
|
16179 |
+
}
|
16180 |
|
16181 |
+
function filterFormats(formats, index, formatType) {
|
16182 |
+
var newFormats = formats[index].filter(function (_ref) {
|
16183 |
+
var type = _ref.type;
|
16184 |
+
return type !== formatType;
|
16185 |
+
});
|
16186 |
|
16187 |
+
if (newFormats.length) {
|
16188 |
+
formats[index] = newFormats;
|
16189 |
+
} else {
|
16190 |
+
delete formats[index];
|
16191 |
+
}
|
16192 |
+
}
|
16193 |
+
//# sourceMappingURL=remove-format.js.map
|
16194 |
|
16195 |
+
/***/ }),
|
16196 |
+
/* 113 */
|
16197 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16198 |
|
16199 |
+
"use strict";
|
16200 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = remove;
|
16201 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__insert__ = __webpack_require__(63);
|
16202 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create__ = __webpack_require__(51);
|
16203 |
+
/**
|
16204 |
+
* Internal dependencies
|
16205 |
+
*/
|
16206 |
|
|
|
16207 |
|
16208 |
+
/**
|
16209 |
+
* Remove content from a Rich Text value between the given `startIndex` and
|
16210 |
+
* `endIndex`. Indices are retrieved from the selection if none are provided.
|
16211 |
+
*
|
16212 |
+
* @param {Object} value Value to modify.
|
16213 |
+
* @param {number} [startIndex] Start index.
|
16214 |
+
* @param {number} [endIndex] End index.
|
16215 |
+
*
|
16216 |
+
* @return {Object} A new value with the content removed.
|
16217 |
+
*/
|
16218 |
|
16219 |
+
function remove(value, startIndex, endIndex) {
|
16220 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__insert__["a" /* insert */])(value, Object(__WEBPACK_IMPORTED_MODULE_1__create__["a" /* create */])(), startIndex, endIndex);
|
16221 |
}
|
16222 |
+
//# sourceMappingURL=remove.js.map
|
16223 |
|
16224 |
/***/ }),
|
16225 |
+
/* 114 */
|
16226 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16227 |
|
16228 |
"use strict";
|
16229 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
16230 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
16231 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
16232 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
16233 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
16234 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
|
16235 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_compose__ = __webpack_require__(18);
|
16236 |
|
16237 |
|
|
|
|
|
|
|
|
|
16238 |
|
|
|
16239 |
|
|
|
16240 |
|
|
|
16241 |
|
|
|
16242 |
|
16243 |
+
/**
|
16244 |
+
* WordPress dependencies
|
16245 |
+
*/
|
16246 |
|
|
|
|
|
|
|
|
|
16247 |
|
16248 |
+
/**
|
16249 |
+
* Higher Order Component used to be used to wrap disposable elements like
|
16250 |
+
* sidebars, modals, dropdowns. When mounting the wrapped component, we track a
|
16251 |
+
* reference to the current active element so we know where to restore focus
|
16252 |
+
* when the component is unmounted.
|
16253 |
+
*
|
16254 |
+
* @param {WPElement} WrappedComponent The disposable component.
|
16255 |
+
*
|
16256 |
+
* @return {Component} Component with the focus restauration behaviour.
|
16257 |
+
*/
|
16258 |
|
16259 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
|
16260 |
+
return (
|
16261 |
+
/*#__PURE__*/
|
16262 |
+
function (_Component) {
|
16263 |
+
Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
|
16264 |
|
16265 |
+
function _class() {
|
16266 |
+
var _this;
|
16267 |
|
16268 |
+
Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
|
16269 |
|
16270 |
+
_this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
|
|
|
|
|
|
|
16271 |
|
16272 |
+
_this.setIsFocusedTrue = function () {
|
16273 |
+
return _this.isFocused = true;
|
16274 |
+
};
|
16275 |
|
16276 |
+
_this.setIsFocusedFalse = function () {
|
16277 |
+
return _this.isFocused = false;
|
16278 |
+
};
|
16279 |
|
16280 |
+
_this.activeElementOnMount = document.activeElement;
|
16281 |
+
return _this;
|
16282 |
+
}
|
16283 |
|
16284 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
|
16285 |
+
key: "componentWillUnmount",
|
16286 |
+
value: function componentWillUnmount() {
|
16287 |
+
var activeElementOnMount = this.activeElementOnMount,
|
16288 |
+
isFocused = this.isFocused;
|
16289 |
|
16290 |
+
if (!activeElementOnMount) {
|
16291 |
+
return;
|
16292 |
+
}
|
16293 |
|
16294 |
+
var _document = document,
|
16295 |
+
body = _document.body,
|
16296 |
+
activeElement = _document.activeElement;
|
16297 |
|
16298 |
+
if (isFocused || null === activeElement || body === activeElement) {
|
16299 |
+
activeElementOnMount.focus();
|
16300 |
+
}
|
16301 |
+
}
|
16302 |
+
}, {
|
16303 |
+
key: "render",
|
16304 |
+
value: function render() {
|
16305 |
+
return Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])("div", {
|
16306 |
+
onFocus: this.setIsFocusedTrue,
|
16307 |
+
onBlur: this.setIsFocusedFalse
|
16308 |
+
}, Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(WrappedComponent, this.props));
|
16309 |
+
}
|
16310 |
+
}]);
|
16311 |
|
16312 |
+
return _class;
|
16313 |
+
}(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */])
|
16314 |
+
);
|
16315 |
+
}, 'withFocusReturn'));
|
16316 |
+
//# sourceMappingURL=index.js.map
|
16317 |
|
16318 |
+
/***/ }),
|
16319 |
+
/* 115 */
|
16320 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16321 |
|
16322 |
+
"use strict";
|
16323 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
16324 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
16325 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
16326 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
16327 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
16328 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
16329 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
|
16330 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_compose__ = __webpack_require__(18);
|
16331 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_keycodes__ = __webpack_require__(31);
|
16332 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_dom__ = __webpack_require__(52);
|
16333 |
|
|
|
16334 |
|
|
|
16335 |
|
|
|
16336 |
|
|
|
16337 |
|
|
|
16338 |
|
|
|
16339 |
|
|
|
16340 |
|
16341 |
+
/**
|
16342 |
+
* WordPress dependencies
|
16343 |
+
*/
|
16344 |
|
|
|
16345 |
|
|
|
16346 |
|
|
|
16347 |
|
16348 |
+
var withConstrainedTabbing = Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
|
16349 |
+
return (
|
16350 |
+
/*#__PURE__*/
|
16351 |
+
function (_Component) {
|
16352 |
+
Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
|
16353 |
|
16354 |
+
function _class() {
|
16355 |
+
var _this;
|
16356 |
|
16357 |
+
Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
|
16358 |
|
16359 |
+
_this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
|
16360 |
+
_this.focusContainRef = Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["j" /* createRef */])();
|
16361 |
+
_this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16362 |
+
return _this;
|
16363 |
+
}
|
16364 |
|
16365 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
|
16366 |
+
key: "handleTabBehaviour",
|
16367 |
+
value: function handleTabBehaviour(event) {
|
16368 |
+
if (event.keyCode !== __WEBPACK_IMPORTED_MODULE_8__wordpress_keycodes__["i" /* TAB */]) {
|
16369 |
+
return;
|
16370 |
+
}
|
16371 |
|
16372 |
+
var tabbables = __WEBPACK_IMPORTED_MODULE_9__wordpress_dom__["a" /* focus */].tabbable.find(this.focusContainRef.current);
|
16373 |
|
16374 |
+
if (!tabbables.length) {
|
16375 |
+
return;
|
16376 |
+
}
|
16377 |
|
16378 |
+
var firstTabbable = tabbables[0];
|
16379 |
+
var lastTabbable = tabbables[tabbables.length - 1];
|
16380 |
|
16381 |
+
if (event.shiftKey && event.target === firstTabbable) {
|
16382 |
+
event.preventDefault();
|
16383 |
+
lastTabbable.focus();
|
16384 |
+
} else if (!event.shiftKey && event.target === lastTabbable) {
|
16385 |
+
event.preventDefault();
|
16386 |
+
firstTabbable.focus();
|
16387 |
+
/*
|
16388 |
+
* When pressing Tab and none of the tabbables has focus, the keydown
|
16389 |
+
* event happens on the wrapper div: move focus on the first tabbable.
|
16390 |
+
*/
|
16391 |
+
} else if (!tabbables.includes(event.target)) {
|
16392 |
+
event.preventDefault();
|
16393 |
+
firstTabbable.focus();
|
16394 |
+
}
|
16395 |
+
}
|
16396 |
+
}, {
|
16397 |
+
key: "render",
|
16398 |
+
value: function render() {
|
16399 |
+
// Disable reason: this component is non-interactive, but must capture
|
16400 |
+
// events from the wrapped component to determine when the Tab key is used.
|
16401 |
|
16402 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
16403 |
+
return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
|
16404 |
+
onKeyDown: this.handleTabBehaviour,
|
16405 |
+
ref: this.focusContainRef,
|
16406 |
+
tabIndex: "-1"
|
16407 |
+
}, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(WrappedComponent, this.props));
|
16408 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
16409 |
+
}
|
16410 |
+
}]);
|
16411 |
|
16412 |
+
return _class;
|
16413 |
+
}(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */])
|
16414 |
+
);
|
16415 |
+
}, 'withConstrainedTabbing');
|
16416 |
+
/* harmony default export */ __webpack_exports__["a"] = (withConstrainedTabbing);
|
16417 |
+
//# sourceMappingURL=index.js.map
|
16418 |
|
16419 |
+
/***/ }),
|
16420 |
+
/* 116 */
|
16421 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16422 |
|
16423 |
+
"use strict";
|
16424 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
16425 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
16426 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
16427 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
16428 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
16429 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
|
16430 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash__ = __webpack_require__(2);
|
16431 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash__);
|
16432 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__popover__ = __webpack_require__(81);
|
16433 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__shortcut__ = __webpack_require__(183);
|
16434 |
|
|
|
16435 |
|
|
|
16436 |
|
|
|
16437 |
|
|
|
16438 |
|
|
|
16439 |
|
|
|
16440 |
|
16441 |
+
/**
|
16442 |
+
* External dependencies
|
16443 |
+
*/
|
16444 |
|
16445 |
+
/**
|
16446 |
+
* WordPress dependencies
|
16447 |
+
*/
|
16448 |
|
|
|
16449 |
|
16450 |
+
/**
|
16451 |
+
* Internal dependencies
|
16452 |
+
*/
|
16453 |
|
|
|
16454 |
|
|
|
16455 |
|
16456 |
+
/**
|
16457 |
+
* Time over children to wait before showing tooltip
|
16458 |
+
*
|
16459 |
+
* @type {Number}
|
16460 |
+
*/
|
16461 |
|
16462 |
+
var TOOLTIP_DELAY = 700;
|
16463 |
|
16464 |
+
var Tooltip =
|
16465 |
+
/*#__PURE__*/
|
16466 |
+
function (_Component) {
|
16467 |
+
Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(Tooltip, _Component);
|
16468 |
|
16469 |
+
function Tooltip() {
|
16470 |
+
var _this;
|
16471 |
|
16472 |
+
Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Tooltip);
|
16473 |
|
16474 |
+
_this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Tooltip).apply(this, arguments));
|
16475 |
+
_this.delayedSetIsOver = Object(__WEBPACK_IMPORTED_MODULE_6_lodash__["debounce"])(function (isOver) {
|
16476 |
+
return _this.setState({
|
16477 |
+
isOver: isOver
|
16478 |
+
});
|
16479 |
+
}, TOOLTIP_DELAY);
|
16480 |
+
_this.state = {
|
16481 |
+
isOver: false
|
16482 |
+
};
|
16483 |
+
return _this;
|
16484 |
+
}
|
16485 |
|
16486 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(Tooltip, [{
|
16487 |
+
key: "componentWillUnmount",
|
16488 |
+
value: function componentWillUnmount() {
|
16489 |
+
this.delayedSetIsOver.cancel();
|
16490 |
+
}
|
16491 |
+
}, {
|
16492 |
+
key: "emitToChild",
|
16493 |
+
value: function emitToChild(eventName, event) {
|
16494 |
+
var children = this.props.children;
|
16495 |
|
16496 |
+
if (__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].count(children) !== 1) {
|
16497 |
+
return;
|
16498 |
+
}
|
|
|
|
|
16499 |
|
16500 |
+
var child = __WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].only(children);
|
16501 |
|
16502 |
+
if (typeof child.props[eventName] === 'function') {
|
16503 |
+
child.props[eventName](event);
|
16504 |
+
}
|
16505 |
+
}
|
16506 |
+
}, {
|
16507 |
+
key: "createToggleIsOver",
|
16508 |
+
value: function createToggleIsOver(eventName, isDelayed) {
|
16509 |
+
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16510 |
|
16511 |
+
return function (event) {
|
16512 |
+
// Preserve original child callback behavior
|
16513 |
+
_this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
|
16514 |
+
// firing on mouseenter but not mouseleave. Further, the default
|
16515 |
+
// behavior for disabled elements in some browsers is to ignore
|
16516 |
+
// mouse events. Don't bother trying to to handle them.
|
16517 |
+
//
|
16518 |
+
// See: https://github.com/facebook/react/issues/4251
|
|
|
16519 |
|
|
|
|
|
|
|
16520 |
|
16521 |
+
if (event.currentTarget.disabled) {
|
16522 |
+
return;
|
16523 |
+
} // Needed in case unsetting is over while delayed set pending, i.e.
|
16524 |
+
// quickly blur/mouseleave before delayedSetIsOver is called
|
|
|
|
|
|
|
16525 |
|
|
|
|
|
|
|
|
|
|
|
16526 |
|
16527 |
+
_this2.delayedSetIsOver.cancel();
|
|
|
|
|
|
|
|
|
|
|
16528 |
|
16529 |
+
var isOver = Object(__WEBPACK_IMPORTED_MODULE_6_lodash__["includes"])(['focus', 'mouseenter'], event.type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16530 |
|
16531 |
+
if (isOver === _this2.state.isOver) {
|
16532 |
+
return;
|
16533 |
+
}
|
16534 |
|
16535 |
+
if (isDelayed) {
|
16536 |
+
_this2.delayedSetIsOver(isOver);
|
16537 |
+
} else {
|
16538 |
+
_this2.setState({
|
16539 |
+
isOver: isOver
|
16540 |
+
});
|
16541 |
+
}
|
16542 |
+
};
|
16543 |
}
|
16544 |
+
}, {
|
16545 |
+
key: "render",
|
16546 |
+
value: function render() {
|
16547 |
+
var _this$props = this.props,
|
16548 |
+
children = _this$props.children,
|
16549 |
+
position = _this$props.position,
|
16550 |
+
text = _this$props.text,
|
16551 |
+
shortcut = _this$props.shortcut;
|
16552 |
|
16553 |
+
if (__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].count(children) !== 1) {
|
16554 |
+
if ('development' === process.env.NODE_ENV) {
|
16555 |
+
// eslint-disable-next-line no-console
|
16556 |
+
console.error('Tooltip should be called with only a single child element.');
|
16557 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16558 |
|
16559 |
+
return children;
|
16560 |
+
}
|
|
|
|
|
|
|
|
|
16561 |
|
16562 |
+
var child = __WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].only(children);
|
16563 |
+
var isOver = this.state.isOver;
|
16564 |
+
return Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["e" /* cloneElement */])(child, {
|
16565 |
+
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
|
16566 |
+
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
|
16567 |
+
onClick: this.createToggleIsOver('onClick'),
|
16568 |
+
onFocus: this.createToggleIsOver('onFocus'),
|
16569 |
+
onBlur: this.createToggleIsOver('onBlur'),
|
16570 |
+
children: Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["f" /* concatChildren */])(child.props.children, isOver && Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_7__popover__["a" /* default */], {
|
16571 |
+
focusOnMount: false,
|
16572 |
+
position: position,
|
16573 |
+
className: "components-tooltip",
|
16574 |
+
"aria-hidden": "true"
|
16575 |
+
}, text, Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_8__shortcut__["a" /* default */], {
|
16576 |
+
className: "components-tooltip__shortcut",
|
16577 |
+
shortcut: shortcut
|
16578 |
+
})))
|
16579 |
+
});
|
16580 |
+
}
|
16581 |
+
}]);
|
16582 |
|
16583 |
+
return Tooltip;
|
16584 |
+
}(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */]);
|
|
|
|
|
16585 |
|
16586 |
+
/* harmony default export */ __webpack_exports__["a"] = (Tooltip);
|
16587 |
+
//# sourceMappingURL=index.js.map
|
16588 |
+
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(20)))
|
|
|
16589 |
|
16590 |
+
/***/ }),
|
16591 |
+
/* 117 */
|
16592 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
16593 |
|
16594 |
+
"use strict";
|
16595 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
16596 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
16597 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
16598 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
16599 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
16600 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
16601 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
16602 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
16603 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_element__ = __webpack_require__(1);
|
16604 |
|
16605 |
|
|
|
|
|
|
|
16606 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16607 |
|
|
|
|
|
|
|
|
|
16608 |
|
|
|
|
|
|
|
|
|
16609 |
|
|
|
|
|
16610 |
|
16611 |
|
|
|
|
|
|
|
|
|
|
|
16612 |
|
|
|
|
|
16613 |
|
16614 |
+
/**
|
16615 |
+
* External dependencies
|
16616 |
+
*/
|
16617 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16618 |
|
16619 |
+
var IsolatedEventContainer =
|
16620 |
+
/*#__PURE__*/
|
16621 |
+
function (_Component) {
|
16622 |
+
Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__["a" /* default */])(IsolatedEventContainer, _Component);
|
16623 |
|
16624 |
+
function IsolatedEventContainer(props) {
|
16625 |
+
var _this;
|
16626 |
|
16627 |
+
Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, IsolatedEventContainer);
|
16628 |
|
16629 |
+
_this = Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(IsolatedEventContainer).call(this, props));
|
16630 |
+
_this.stopEventPropagationOutsideContainer = _this.stopEventPropagationOutsideContainer.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16631 |
+
return _this;
|
16632 |
+
}
|
16633 |
|
16634 |
+
Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__["a" /* default */])(IsolatedEventContainer, [{
|
16635 |
+
key: "stopEventPropagationOutsideContainer",
|
16636 |
+
value: function stopEventPropagationOutsideContainer(event) {
|
16637 |
+
event.stopPropagation();
|
16638 |
}
|
16639 |
+
}, {
|
16640 |
+
key: "render",
|
16641 |
+
value: function render() {
|
16642 |
+
var _this$props = this.props,
|
16643 |
+
children = _this$props.children,
|
16644 |
+
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_this$props, ["children"]); // Disable reason: this stops certain events from propagating outside of the component.
|
16645 |
+
// - onMouseDown is disabled as this can cause interactions with other DOM elements
|
16646 |
|
16647 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
|
16648 |
|
|
|
16649 |
|
16650 |
+
return Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])("div", Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, props, {
|
16651 |
+
onMouseDown: this.stopEventPropagationOutsideContainer
|
16652 |
+
}), children);
|
16653 |
+
}
|
16654 |
+
}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16655 |
|
16656 |
+
return IsolatedEventContainer;
|
16657 |
+
}(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["b" /* Component */]);
|
16658 |
|
16659 |
+
/* harmony default export */ __webpack_exports__["a"] = (IsolatedEventContainer);
|
16660 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
16661 |
|
16662 |
+
/***/ }),
|
16663 |
+
/* 118 */
|
16664 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16665 |
|
16666 |
+
"use strict";
|
16667 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Consumer; });
|
16668 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(23);
|
16669 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
16670 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
16671 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
16672 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
16673 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
16674 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
16675 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
|
16676 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
|
16677 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
|
16678 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16679 |
|
|
|
|
|
16680 |
|
|
|
|
|
16681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16682 |
|
|
|
|
|
|
|
|
|
|
|
16683 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16684 |
|
|
|
|
|
16685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16686 |
|
16687 |
+
/**
|
16688 |
+
* External dependencies
|
16689 |
+
*/
|
16690 |
|
16691 |
+
/**
|
16692 |
+
* WordPress dependencies
|
16693 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
16694 |
|
|
|
|
|
|
|
|
|
16695 |
|
16696 |
|
16697 |
+
var _createContext = Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["g" /* createContext */])({
|
16698 |
+
registerSlot: function registerSlot() {},
|
16699 |
+
unregisterSlot: function unregisterSlot() {},
|
16700 |
+
registerFill: function registerFill() {},
|
16701 |
+
unregisterFill: function unregisterFill() {},
|
16702 |
+
getSlot: function getSlot() {},
|
16703 |
+
getFills: function getFills() {}
|
16704 |
+
}),
|
16705 |
+
Provider = _createContext.Provider,
|
16706 |
+
Consumer = _createContext.Consumer;
|
16707 |
|
16708 |
+
var SlotFillProvider =
|
16709 |
+
/*#__PURE__*/
|
16710 |
+
function (_Component) {
|
16711 |
+
Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__["a" /* default */])(SlotFillProvider, _Component);
|
16712 |
|
16713 |
+
function SlotFillProvider() {
|
16714 |
+
var _this;
|
16715 |
|
16716 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, SlotFillProvider);
|
|
|
|
|
|
|
16717 |
|
16718 |
+
_this = Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(SlotFillProvider).apply(this, arguments));
|
16719 |
+
_this.registerSlot = _this.registerSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16720 |
+
_this.registerFill = _this.registerFill.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16721 |
+
_this.unregisterSlot = _this.unregisterSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16722 |
+
_this.unregisterFill = _this.unregisterFill.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16723 |
+
_this.getSlot = _this.getSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16724 |
+
_this.getFills = _this.getFills.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
16725 |
+
_this.slots = {};
|
16726 |
+
_this.fills = {};
|
16727 |
+
_this.state = {
|
16728 |
+
registerSlot: _this.registerSlot,
|
16729 |
+
unregisterSlot: _this.unregisterSlot,
|
16730 |
+
registerFill: _this.registerFill,
|
16731 |
+
unregisterFill: _this.unregisterFill,
|
16732 |
+
getSlot: _this.getSlot,
|
16733 |
+
getFills: _this.getFills
|
16734 |
+
};
|
16735 |
+
return _this;
|
16736 |
+
}
|
16737 |
|
16738 |
+
Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__["a" /* default */])(SlotFillProvider, [{
|
16739 |
+
key: "registerSlot",
|
16740 |
+
value: function registerSlot(name, slot) {
|
16741 |
+
this.slots[name] = slot;
|
16742 |
+
this.forceUpdateFills(name); // Sometimes the fills are registered after the initial render of slot
|
16743 |
+
// But before the registerSlot call, we need to rerender the slot
|
16744 |
|
16745 |
+
this.forceUpdateSlot(name);
|
16746 |
+
}
|
16747 |
}, {
|
16748 |
+
key: "registerFill",
|
16749 |
+
value: function registerFill(name, instance) {
|
16750 |
+
this.fills[name] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(this.fills[name] || []).concat([instance]);
|
16751 |
+
this.forceUpdateSlot(name);
|
16752 |
+
}
|
16753 |
+
}, {
|
16754 |
+
key: "unregisterSlot",
|
16755 |
+
value: function unregisterSlot(name) {
|
16756 |
+
delete this.slots[name];
|
16757 |
+
this.forceUpdateFills(name);
|
16758 |
+
}
|
16759 |
+
}, {
|
16760 |
+
key: "unregisterFill",
|
16761 |
+
value: function unregisterFill(name, instance) {
|
16762 |
+
this.fills[name] = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["without"])(this.fills[name], instance);
|
16763 |
+
this.resetFillOccurrence(name);
|
16764 |
+
this.forceUpdateSlot(name);
|
16765 |
+
}
|
16766 |
+
}, {
|
16767 |
+
key: "getSlot",
|
16768 |
+
value: function getSlot(name) {
|
16769 |
+
return this.slots[name];
|
16770 |
+
}
|
16771 |
+
}, {
|
16772 |
+
key: "getFills",
|
16773 |
+
value: function getFills(name) {
|
16774 |
+
return Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["sortBy"])(this.fills[name], 'occurrence');
|
16775 |
+
}
|
16776 |
+
}, {
|
16777 |
+
key: "resetFillOccurrence",
|
16778 |
+
value: function resetFillOccurrence(name) {
|
16779 |
+
Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["forEach"])(this.fills[name], function (instance) {
|
16780 |
+
instance.resetOccurrence();
|
16781 |
+
});
|
16782 |
+
}
|
16783 |
+
}, {
|
16784 |
+
key: "forceUpdateFills",
|
16785 |
+
value: function forceUpdateFills(name) {
|
16786 |
+
Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["forEach"])(this.fills[name], function (instance) {
|
16787 |
+
instance.forceUpdate();
|
16788 |
+
});
|
16789 |
+
}
|
16790 |
+
}, {
|
16791 |
+
key: "forceUpdateSlot",
|
16792 |
+
value: function forceUpdateSlot(name) {
|
16793 |
+
var slot = this.getSlot(name);
|
16794 |
|
16795 |
+
if (slot) {
|
16796 |
+
slot.forceUpdate();
|
16797 |
+
}
|
16798 |
+
}
|
16799 |
}, {
|
16800 |
+
key: "render",
|
16801 |
+
value: function render() {
|
16802 |
+
return Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(Provider, {
|
16803 |
+
value: this.state
|
16804 |
+
}, this.props.children);
|
16805 |
+
}
|
16806 |
+
}]);
|
16807 |
|
16808 |
+
return SlotFillProvider;
|
16809 |
+
}(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */]);
|
16810 |
|
16811 |
+
/* unused harmony default export */ var _unused_webpack_default_export = (SlotFillProvider);
|
|
|
|
|
16812 |
|
16813 |
+
//# sourceMappingURL=context.js.map
|
|
|
|
|
16814 |
|
16815 |
+
/***/ }),
|
16816 |
+
/* 119 */
|
16817 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
16818 |
|
16819 |
+
"use strict";
|
16820 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
|
16821 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
|
16822 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
|
16823 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
|
16824 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
|
16825 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
|
16826 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(9);
|
16827 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
|
16828 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
|
16829 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
|
16830 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_a11y__ = __webpack_require__(186);
|
16831 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_compose__ = __webpack_require__(18);
|
|
|
16832 |
|
16833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16834 |
|
|
|
|
|
|
|
|
|
16835 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16836 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16837 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16838 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16839 |
|
|
|
16840 |
|
16841 |
+
/**
|
16842 |
+
* External dependencies
|
16843 |
+
*/
|
16844 |
|
16845 |
+
/**
|
16846 |
+
* WordPress dependencies
|
16847 |
+
*/
|
16848 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16849 |
|
|
|
|
|
16850 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16851 |
|
16852 |
+
/**
|
16853 |
+
* A Higher Order Component used to be provide a unique instance ID by
|
16854 |
+
* component.
|
16855 |
+
*
|
16856 |
+
* @param {WPElement} WrappedComponent The wrapped component.
|
16857 |
+
*
|
16858 |
+
* @return {Component} Component with an instanceId prop.
|
16859 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16860 |
|
16861 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_10__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
|
16862 |
+
return (
|
16863 |
+
/*#__PURE__*/
|
16864 |
+
function (_Component) {
|
16865 |
+
Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
|
16866 |
|
16867 |
+
function _class() {
|
16868 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
16869 |
|
16870 |
+
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
|
|
|
|
|
16871 |
|
16872 |
+
_this = Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
|
16873 |
+
_this.debouncedSpeak = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["debounce"])(_this.speak.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this))), 500);
|
16874 |
+
return _this;
|
|
|
|
|
|
|
|
|
|
|
16875 |
}
|
16876 |
|
16877 |
+
Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
|
16878 |
+
key: "speak",
|
16879 |
+
value: function speak(message) {
|
16880 |
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polite';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16881 |
|
16882 |
+
Object(__WEBPACK_IMPORTED_MODULE_9__wordpress_a11y__["a" /* speak */])(message, type);
|
16883 |
+
}
|
16884 |
+
}, {
|
16885 |
+
key: "componentWillUnmount",
|
16886 |
+
value: function componentWillUnmount() {
|
16887 |
+
this.debouncedSpeak.cancel();
|
16888 |
+
}
|
16889 |
+
}, {
|
16890 |
+
key: "render",
|
16891 |
+
value: function render() {
|
16892 |
+
return Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(WrappedComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, this.props, {
|
16893 |
+
speak: this.speak,
|
16894 |
+
debouncedSpeak: this.debouncedSpeak
|
16895 |
+
}));
|
16896 |
+
}
|
16897 |
+
}]);
|
16898 |
|
16899 |
+
return _class;
|
16900 |
+
}(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */])
|
16901 |
+
);
|
16902 |
+
}, 'withSpokenMessages'));
|
16903 |
+
//# sourceMappingURL=index.js.map
|
16904 |
|
16905 |
+
/***/ }),
|
16906 |
+
/* 120 */
|
16907 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
16908 |
|
16909 |
+
"use strict";
|
|
|
|
|
|
|
|
|
16910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16911 |
|
16912 |
+
var GetIntrinsic = __webpack_require__(19);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16913 |
|
16914 |
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16915 |
|
16916 |
+
var inspect = __webpack_require__(194);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16917 |
|
16918 |
+
var IsPropertyKey = __webpack_require__(66);
|
16919 |
+
var Type = __webpack_require__(37);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16920 |
|
16921 |
+
/**
|
16922 |
+
* 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
|
16923 |
+
* 1. Assert: Type(O) is Object.
|
16924 |
+
* 2. Assert: IsPropertyKey(P) is true.
|
16925 |
+
* 3. Return O.[[Get]](P, O).
|
16926 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16927 |
|
16928 |
+
module.exports = function Get(O, P) {
|
16929 |
+
// 7.3.1.1
|
16930 |
+
if (Type(O) !== 'Object') {
|
16931 |
+
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
16932 |
+
}
|
16933 |
+
// 7.3.1.2
|
16934 |
+
if (!IsPropertyKey(P)) {
|
16935 |
+
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
|
16936 |
+
}
|
16937 |
+
// 7.3.1.3
|
16938 |
+
return O[P];
|
16939 |
+
};
|
16940 |
|
|
|
16941 |
|
16942 |
+
/***/ }),
|
16943 |
+
/* 121 */
|
16944 |
+
/***/ (function(module, exports, __webpack_require__) {
|
16945 |
|
16946 |
+
"use strict";
|
|
|
|
|
|
|
|
|
16947 |
|
|
|
|
|
|
|
|
|
|
|
16948 |
|
16949 |
+
var GetIntrinsic = __webpack_require__(19);
|
|
|
|
|
|
|
|
|
16950 |
|
16951 |
+
var $Array = GetIntrinsic('%Array%');
|
|
|
|
|
|
|
|
|
|
|
|
|
16952 |
|
16953 |
+
// eslint-disable-next-line global-require
|
16954 |
+
var toStr = !$Array.isArray && __webpack_require__(46)('Object.prototype.toString');
|
|
|
|
|
|
|
|
|
|
|
16955 |
|
16956 |
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
|
|
|
|
|
16957 |
|
16958 |
+
module.exports = $Array.isArray || function IsArray(argument) {
|
16959 |
+
return toStr(argument) === '[object Array]';
|
16960 |
+
};
|
16961 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16962 |
|
16963 |
+
/***/ }),
|
16964 |
+
/* 122 */
|
16965 |
+
/***/ (function(module, exports, __webpack_require__) {
|
16966 |
|
16967 |
+
"use strict";
|
16968 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16969 |
|
16970 |
+
module.exports = Number.isNaN || function isNaN(a) {
|
16971 |
+
return a !== a;
|
16972 |
+
};
|
16973 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16974 |
|
16975 |
+
/***/ }),
|
16976 |
+
/* 123 */
|
16977 |
+
/***/ (function(module, exports, __webpack_require__) {
|
16978 |
|
16979 |
+
"use strict";
|
|
|
|
|
|
|
16980 |
|
|
|
|
|
|
|
16981 |
|
16982 |
+
var MAX_SAFE_INTEGER = __webpack_require__(196);
|
|
|
16983 |
|
16984 |
+
var ToInteger = __webpack_require__(202);
|
|
|
|
|
|
|
|
|
|
|
|
|
16985 |
|
16986 |
+
module.exports = function ToLength(argument) {
|
16987 |
+
var len = ToInteger(argument);
|
16988 |
+
if (len <= 0) { return 0; } // includes converting -0 to +0
|
16989 |
+
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
|
16990 |
+
return len;
|
16991 |
+
};
|
16992 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16993 |
|
16994 |
+
/***/ }),
|
16995 |
+
/* 124 */
|
16996 |
+
/***/ (function(module, exports, __webpack_require__) {
|
16997 |
|
16998 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16999 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17000 |
|
17001 |
+
Object.defineProperty(exports, "__esModule", {
|
17002 |
+
value: true
|
17003 |
+
});
|
17004 |
+
exports.PureCalendarDay = undefined;
|
|
|
|
|
|
|
|
|
17005 |
|
17006 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17007 |
|
17008 |
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17009 |
|
17010 |
+
var _object = __webpack_require__(24);
|
17011 |
|
17012 |
+
var _object2 = _interopRequireDefault(_object);
|
|
|
|
|
|
|
|
|
|
|
|
|
17013 |
|
17014 |
+
var _react = __webpack_require__(10);
|
|
|
17015 |
|
17016 |
+
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17017 |
|
17018 |
+
var _propTypes = __webpack_require__(11);
|
17019 |
|
17020 |
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
|
|
|
17021 |
|
17022 |
+
var _reactAddonsShallowCompare = __webpack_require__(55);
|
|
|
17023 |
|
17024 |
+
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
|
|
|
|
|
|
|
|
|
|
|
|
|
17025 |
|
17026 |
+
var _reactMomentProptypes = __webpack_require__(38);
|
17027 |
|
17028 |
+
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
|
17029 |
|
17030 |
+
var _airbnbPropTypes = __webpack_require__(21);
|
|
|
|
|
|
|
|
|
|
|
|
|
17031 |
|
17032 |
+
var _reactWithStyles = __webpack_require__(32);
|
|
|
|
|
|
|
|
|
|
|
|
|
17033 |
|
17034 |
+
var _moment = __webpack_require__(0);
|
|
|
17035 |
|
17036 |
+
var _moment2 = _interopRequireDefault(_moment);
|
|
|
|
|
|
|
|
|
|
|
|
|
17037 |
|
17038 |
+
var _defaultPhrases = __webpack_require__(27);
|
|
|
17039 |
|
17040 |
+
var _getPhrasePropTypes = __webpack_require__(30);
|
|
|
|
|
|
|
|
|
|
|
|
|
17041 |
|
17042 |
+
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17043 |
|
17044 |
+
var _getCalendarDaySettings = __webpack_require__(365);
|
17045 |
|
17046 |
+
var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
|
17047 |
|
17048 |
+
var _ModifiersShape = __webpack_require__(86);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17049 |
|
17050 |
+
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
|
|
|
|
|
|
|
|
|
|
|
17051 |
|
17052 |
+
var _constants = __webpack_require__(17);
|
17053 |
+
|
17054 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17055 |
+
|
17056 |
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17057 |
+
|
17058 |
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
17059 |
+
|
17060 |
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
17061 |
+
|
17062 |
+
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
|
17063 |
+
day: _reactMomentProptypes2['default'].momentObj,
|
17064 |
+
daySize: _airbnbPropTypes.nonNegativeInteger,
|
17065 |
+
isOutsideDay: _propTypes2['default'].bool,
|
17066 |
+
modifiers: _ModifiersShape2['default'],
|
17067 |
+
isFocused: _propTypes2['default'].bool,
|
17068 |
+
tabIndex: _propTypes2['default'].oneOf([0, -1]),
|
17069 |
+
onDayClick: _propTypes2['default'].func,
|
17070 |
+
onDayMouseEnter: _propTypes2['default'].func,
|
17071 |
+
onDayMouseLeave: _propTypes2['default'].func,
|
17072 |
+
renderDayContents: _propTypes2['default'].func,
|
17073 |
+
ariaLabelFormat: _propTypes2['default'].string,
|
17074 |
+
|
17075 |
+
// internationalization
|
17076 |
+
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
|
17077 |
+
}));
|
17078 |
+
|
17079 |
+
var defaultProps = {
|
17080 |
+
day: (0, _moment2['default'])(),
|
17081 |
+
daySize: _constants.DAY_SIZE,
|
17082 |
+
isOutsideDay: false,
|
17083 |
+
modifiers: new Set(),
|
17084 |
+
isFocused: false,
|
17085 |
+
tabIndex: -1,
|
17086 |
+
onDayClick: function () {
|
17087 |
+
function onDayClick() {}
|
17088 |
+
|
17089 |
+
return onDayClick;
|
17090 |
+
}(),
|
17091 |
+
onDayMouseEnter: function () {
|
17092 |
+
function onDayMouseEnter() {}
|
17093 |
+
|
17094 |
+
return onDayMouseEnter;
|
17095 |
+
}(),
|
17096 |
+
onDayMouseLeave: function () {
|
17097 |
+
function onDayMouseLeave() {}
|
17098 |
+
|
17099 |
+
return onDayMouseLeave;
|
17100 |
+
}(),
|
17101 |
+
|
17102 |
+
renderDayContents: null,
|
17103 |
+
ariaLabelFormat: 'dddd, LL',
|
17104 |
+
|
17105 |
+
// internationalization
|
17106 |
+
phrases: _defaultPhrases.CalendarDayPhrases
|
17107 |
+
};
|
17108 |
+
|
17109 |
+
var CalendarDay = function (_React$Component) {
|
17110 |
+
_inherits(CalendarDay, _React$Component);
|
17111 |
+
|
17112 |
+
function CalendarDay() {
|
17113 |
+
var _ref;
|
17114 |
+
|
17115 |
+
_classCallCheck(this, CalendarDay);
|
17116 |
+
|
17117 |
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
17118 |
+
args[_key] = arguments[_key];
|
17119 |
+
}
|
17120 |
+
|
17121 |
+
var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args)));
|
17122 |
+
|
17123 |
+
_this.setButtonRef = _this.setButtonRef.bind(_this);
|
17124 |
+
return _this;
|
17125 |
+
}
|
17126 |
+
|
17127 |
+
_createClass(CalendarDay, [{
|
17128 |
+
key: 'shouldComponentUpdate',
|
17129 |
+
value: function () {
|
17130 |
+
function shouldComponentUpdate(nextProps, nextState) {
|
17131 |
+
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
|
17132 |
}
|
17133 |
|
17134 |
+
return shouldComponentUpdate;
|
17135 |
}()
|
17136 |
}, {
|
17137 |
+
key: 'componentDidUpdate',
|
17138 |
value: function () {
|
17139 |
+
function componentDidUpdate(prevProps) {
|
17140 |
+
var _props = this.props,
|
17141 |
+
isFocused = _props.isFocused,
|
17142 |
+
tabIndex = _props.tabIndex;
|
17143 |
|
17144 |
+
if (tabIndex === 0) {
|
17145 |
+
if (isFocused || tabIndex !== prevProps.tabIndex) {
|
17146 |
+
this.buttonRef.focus();
|
|
|
|
|
|
|
|
|
17147 |
}
|
|
|
17148 |
}
|
17149 |
}
|
17150 |
|
17151 |
+
return componentDidUpdate;
|
17152 |
}()
|
17153 |
}, {
|
17154 |
+
key: 'onDayClick',
|
17155 |
value: function () {
|
17156 |
+
function onDayClick(day, e) {
|
17157 |
+
var onDayClick = this.props.onDayClick;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17158 |
|
17159 |
+
onDayClick(day, e);
|
|
|
|
|
17160 |
}
|
17161 |
|
17162 |
+
return onDayClick;
|
17163 |
}()
|
17164 |
}, {
|
17165 |
+
key: 'onDayMouseEnter',
|
17166 |
value: function () {
|
17167 |
+
function onDayMouseEnter(day, e) {
|
17168 |
+
var onDayMouseEnter = this.props.onDayMouseEnter;
|
17169 |
+
|
17170 |
+
onDayMouseEnter(day, e);
|
|
|
17171 |
}
|
17172 |
|
17173 |
+
return onDayMouseEnter;
|
17174 |
}()
|
17175 |
}, {
|
17176 |
+
key: 'onDayMouseLeave',
|
17177 |
value: function () {
|
17178 |
+
function onDayMouseLeave(day, e) {
|
17179 |
+
var onDayMouseLeave = this.props.onDayMouseLeave;
|
|
|
|
|
|
|
|
|
|
|
17180 |
|
17181 |
+
onDayMouseLeave(day, e);
|
|
|
|
|
|
|
17182 |
}
|
17183 |
|
17184 |
+
return onDayMouseLeave;
|
17185 |
}()
|
17186 |
}, {
|
17187 |
+
key: 'onKeyDown',
|
17188 |
value: function () {
|
17189 |
+
function onKeyDown(day, e) {
|
17190 |
+
var onDayClick = this.props.onDayClick;
|
17191 |
+
var key = e.key;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17192 |
|
17193 |
+
if (key === 'Enter' || key === ' ') {
|
17194 |
+
onDayClick(day, e);
|
17195 |
}
|
17196 |
+
}
|
17197 |
|
17198 |
+
return onKeyDown;
|
17199 |
+
}()
|
17200 |
+
}, {
|
17201 |
+
key: 'setButtonRef',
|
17202 |
+
value: function () {
|
17203 |
+
function setButtonRef(ref) {
|
17204 |
+
this.buttonRef = ref;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17205 |
}
|
17206 |
|
17207 |
+
return setButtonRef;
|
17208 |
}()
|
17209 |
}, {
|
17210 |
+
key: 'render',
|
17211 |
value: function () {
|
17212 |
+
function render() {
|
17213 |
+
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
17214 |
|
17215 |
+
var _props2 = this.props,
|
17216 |
+
day = _props2.day,
|
17217 |
+
ariaLabelFormat = _props2.ariaLabelFormat,
|
17218 |
+
daySize = _props2.daySize,
|
17219 |
+
isOutsideDay = _props2.isOutsideDay,
|
17220 |
+
modifiers = _props2.modifiers,
|
17221 |
+
renderDayContents = _props2.renderDayContents,
|
17222 |
+
tabIndex = _props2.tabIndex,
|
17223 |
+
styles = _props2.styles,
|
17224 |
+
phrases = _props2.phrases;
|
17225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
17226 |
|
17227 |
+
if (!day) return _react2['default'].createElement('td', null);
|
17228 |
|
17229 |
+
var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
|
17230 |
+
daySizeStyles = _getCalendarDaySettin.daySizeStyles,
|
17231 |
+
useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
|
17232 |
+
selected = _getCalendarDaySettin.selected,
|
17233 |
+
hoveredSpan = _getCalendarDaySettin.hoveredSpan,
|
17234 |
+
isOutsideRange = _getCalendarDaySettin.isOutsideRange,
|
17235 |
+
ariaLabel = _getCalendarDaySettin.ariaLabel;
|
|
|
|
|
|
|
|
|
|
|
17236 |
|
17237 |
return _react2['default'].createElement(
|
17238 |
+
'td',
|
17239 |
+
_extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), {
|
17240 |
+
role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
|
17241 |
+
, ref: this.setButtonRef,
|
17242 |
+
'aria-label': ariaLabel,
|
17243 |
+
onMouseEnter: function () {
|
17244 |
+
function onMouseEnter(e) {
|
17245 |
+
_this2.onDayMouseEnter(day, e);
|
17246 |
+
}
|
17247 |
+
|
17248 |
+
return onMouseEnter;
|
17249 |
+
}(),
|
17250 |
+
onMouseLeave: function () {
|
17251 |
+
function onMouseLeave(e) {
|
17252 |
+
_this2.onDayMouseLeave(day, e);
|
17253 |
+
}
|
17254 |
+
|
17255 |
+
return onMouseLeave;
|
17256 |
+
}(),
|
17257 |
+
onMouseUp: function () {
|
17258 |
+
function onMouseUp(e) {
|
17259 |
+
e.currentTarget.blur();
|
17260 |
+
}
|
17261 |
+
|
17262 |
+
return onMouseUp;
|
17263 |
+
}(),
|
17264 |
+
onClick: function () {
|
17265 |
+
function onClick(e) {
|
17266 |
+
_this2.onDayClick(day, e);
|
17267 |
+
}
|
17268 |
+
|
17269 |
+
return onClick;
|
17270 |
+
}(),
|
17271 |
+
onKeyDown: function () {
|
17272 |
+
function onKeyDown(e) {
|
17273 |
+
_this2.onKeyDown(day, e);
|
17274 |
+
}
|
17275 |
+
|
17276 |
+
return onKeyDown;
|
17277 |
+
}(),
|
17278 |
+
tabIndex: tabIndex
|
17279 |
}),
|
17280 |
+
renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
|
|
|
|
|
|
|
|
|
17281 |
);
|
17282 |
}
|
17283 |
|
17284 |
+
return render;
|
17285 |
}()
|
17286 |
+
}]);
|
|
|
|
|
|
|
|
|
17287 |
|
17288 |
+
return CalendarDay;
|
17289 |
+
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17290 |
|
17291 |
+
CalendarDay.propTypes = propTypes;
|
17292 |
+
CalendarDay.defaultProps = defaultProps;
|
17293 |
|
17294 |
+
exports.PureCalendarDay = CalendarDay;
|
17295 |
+
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
|
17296 |
+
var _ref2$reactDates = _ref2.reactDates,
|
17297 |
+
color = _ref2$reactDates.color,
|
17298 |
+
font = _ref2$reactDates.font;
|
17299 |
+
return {
|
17300 |
+
CalendarDay: {
|
17301 |
+
boxSizing: 'border-box',
|
17302 |
+
cursor: 'pointer',
|
17303 |
+
fontSize: font.size,
|
17304 |
+
textAlign: 'center',
|
17305 |
|
17306 |
+
':active': {
|
17307 |
+
outline: 0
|
17308 |
+
}
|
17309 |
+
},
|
|
|
17310 |
|
17311 |
+
CalendarDay__defaultCursor: {
|
17312 |
+
cursor: 'default'
|
17313 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
17314 |
|
17315 |
+
CalendarDay__default: {
|
17316 |
+
border: '1px solid ' + String(color.core.borderLight),
|
17317 |
+
color: color.text,
|
17318 |
+
background: color.background,
|
17319 |
|
17320 |
+
':hover': {
|
17321 |
+
background: color.core.borderLight,
|
17322 |
+
border: '1px double ' + String(color.core.borderLight),
|
17323 |
+
color: 'inherit'
|
17324 |
+
}
|
17325 |
+
},
|
17326 |
|
17327 |
+
CalendarDay__hovered_offset: {
|
17328 |
+
background: color.core.borderBright,
|
17329 |
+
border: '1px double ' + String(color.core.borderLight),
|
17330 |
+
color: 'inherit'
|
17331 |
+
},
|
17332 |
|
17333 |
+
CalendarDay__outside: {
|
17334 |
+
border: 0,
|
17335 |
+
background: color.outside.backgroundColor,
|
17336 |
+
color: color.outside.color,
|
17337 |
|
17338 |
+
':hover': {
|
17339 |
+
border: 0
|
17340 |
+
}
|
17341 |
+
},
|
|
|
17342 |
|
17343 |
+
CalendarDay__blocked_minimum_nights: {
|
17344 |
+
background: color.minimumNights.backgroundColor,
|
17345 |
+
border: '1px solid ' + String(color.minimumNights.borderColor),
|
17346 |
+
color: color.minimumNights.color,
|
|
|
|
|
|
|
17347 |
|
17348 |
+
':hover': {
|
17349 |
+
background: color.minimumNights.backgroundColor_hover,
|
17350 |
+
color: color.minimumNights.color_active
|
17351 |
+
},
|
17352 |
|
17353 |
+
':active': {
|
17354 |
+
background: color.minimumNights.backgroundColor_active,
|
17355 |
+
color: color.minimumNights.color_active
|
17356 |
+
}
|
17357 |
+
},
|
17358 |
|
17359 |
+
CalendarDay__highlighted_calendar: {
|
17360 |
+
background: color.highlighted.backgroundColor,
|
17361 |
+
color: color.highlighted.color,
|
|
|
17362 |
|
17363 |
+
':hover': {
|
17364 |
+
background: color.highlighted.backgroundColor_hover,
|
17365 |
+
color: color.highlighted.color_active
|
17366 |
+
},
|
17367 |
|
17368 |
+
':active': {
|
17369 |
+
background: color.highlighted.backgroundColor_active,
|
17370 |
+
color: color.highlighted.color_active
|
17371 |
+
}
|
17372 |
+
},
|
17373 |
|
17374 |
+
CalendarDay__selected_span: {
|
17375 |
+
background: color.selectedSpan.backgroundColor,
|
17376 |
+
border: '1px solid ' + String(color.selectedSpan.borderColor),
|
17377 |
+
color: color.selectedSpan.color,
|
17378 |
|
17379 |
+
':hover': {
|
17380 |
+
background: color.selectedSpan.backgroundColor_hover,
|
17381 |
+
border: '1px solid ' + String(color.selectedSpan.borderColor),
|
17382 |
+
color: color.selectedSpan.color_active
|
17383 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17384 |
|
17385 |
+
':active': {
|
17386 |
+
background: color.selectedSpan.backgroundColor_active,
|
17387 |
+
border: '1px solid ' + String(color.selectedSpan.borderColor),
|
17388 |
+
color: color.selectedSpan.color_active
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17389 |
}
|
17390 |
+
},
|
17391 |
|
17392 |
+
CalendarDay__last_in_range: {
|
17393 |
+
borderRight: color.core.primary
|
17394 |
+
},
|
17395 |
|
17396 |
+
CalendarDay__selected: {
|
17397 |
+
background: color.selected.backgroundColor,
|
17398 |
+
border: '1px solid ' + String(color.selected.borderColor),
|
17399 |
+
color: color.selected.color,
|
17400 |
|
17401 |
+
':hover': {
|
17402 |
+
background: color.selected.backgroundColor_hover,
|
17403 |
+
border: '1px solid ' + String(color.selected.borderColor),
|
17404 |
+
color: color.selected.color_active
|
17405 |
+
},
|
17406 |
|
17407 |
+
':active': {
|
17408 |
+
background: color.selected.backgroundColor_active,
|
17409 |
+
border: '1px solid ' + String(color.selected.borderColor),
|
17410 |
+
color: color.selected.color_active
|
17411 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17412 |
},
|
17413 |
|
17414 |
+
CalendarDay__hovered_span: {
|
17415 |
+
background: color.hoveredSpan.backgroundColor,
|
17416 |
+
border: '1px solid ' + String(color.hoveredSpan.borderColor),
|
17417 |
+
color: color.hoveredSpan.color,
|
17418 |
|
17419 |
+
':hover': {
|
17420 |
+
background: color.hoveredSpan.backgroundColor_hover,
|
17421 |
+
border: '1px solid ' + String(color.hoveredSpan.borderColor),
|
17422 |
+
color: color.hoveredSpan.color_active
|
17423 |
+
},
|
17424 |
|
17425 |
+
':active': {
|
17426 |
+
background: color.hoveredSpan.backgroundColor_active,
|
17427 |
+
border: '1px solid ' + String(color.hoveredSpan.borderColor),
|
17428 |
+
color: color.hoveredSpan.color_active
|
17429 |
+
}
|
17430 |
},
|
17431 |
|
17432 |
+
CalendarDay__blocked_calendar: {
|
17433 |
+
background: color.blocked_calendar.backgroundColor,
|
17434 |
+
border: '1px solid ' + String(color.blocked_calendar.borderColor),
|
17435 |
+
color: color.blocked_calendar.color,
|
17436 |
|
17437 |
+
':hover': {
|
17438 |
+
background: color.blocked_calendar.backgroundColor_hover,
|
17439 |
+
border: '1px solid ' + String(color.blocked_calendar.borderColor),
|
17440 |
+
color: color.blocked_calendar.color_active
|
17441 |
+
},
|
|
|
17442 |
|
17443 |
+
':active': {
|
17444 |
+
background: color.blocked_calendar.backgroundColor_active,
|
17445 |
+
border: '1px solid ' + String(color.blocked_calendar.borderColor),
|
17446 |
+
color: color.blocked_calendar.color_active
|
17447 |
+
}
|
17448 |
},
|
17449 |
|
17450 |
+
CalendarDay__blocked_out_of_range: {
|
17451 |
+
background: color.blocked_out_of_range.backgroundColor,
|
17452 |
+
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
|
17453 |
+
color: color.blocked_out_of_range.color,
|
17454 |
|
17455 |
+
':hover': {
|
17456 |
+
background: color.blocked_out_of_range.backgroundColor_hover,
|
17457 |
+
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
|
17458 |
+
color: color.blocked_out_of_range.color_active
|
17459 |
+
},
|
17460 |
|
17461 |
+
':active': {
|
17462 |
+
background: color.blocked_out_of_range.backgroundColor_active,
|
17463 |
+
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
|
17464 |
+
color: color.blocked_out_of_range.color_active
|
17465 |
+
}
|
17466 |
},
|
17467 |
|
17468 |
+
CalendarDay__selected_start: {},
|
17469 |
+
CalendarDay__selected_end: {},
|
17470 |
+
CalendarDay__today: {},
|
17471 |
+
CalendarDay__firstDayOfWeek: {},
|
17472 |
+
CalendarDay__lastDayOfWeek: {}
|
17473 |
+
};
|
17474 |
+
})(CalendarDay);
|
17475 |
|
17476 |
+
/***/ }),
|
17477 |
+
/* 125 */
|
17478 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17479 |
|
17480 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
17481 |
|
|
|
|
|
|
|
17482 |
|
17483 |
+
Object.defineProperty(exports, "__esModule", {
|
17484 |
+
value: true
|
17485 |
+
});
|
17486 |
+
exports["default"] = betweenValidator;
|
|
|
|
|
|
|
|
|
|
|
|
|
17487 |
|
17488 |
+
var _object = _interopRequireDefault(__webpack_require__(660));
|
|
|
|
|
|
|
|
|
|
|
|
|
17489 |
|
17490 |
+
var _shape = _interopRequireDefault(__webpack_require__(126));
|
|
|
|
|
|
|
17491 |
|
17492 |
+
var _valuesOf = _interopRequireDefault(__webpack_require__(345));
|
|
|
|
|
|
|
|
|
17493 |
|
17494 |
+
var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
|
|
|
|
|
17495 |
|
17496 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
17497 |
|
17498 |
+
function _typeof(obj) { 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); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17499 |
|
17500 |
+
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; }
|
|
|
|
|
17501 |
|
17502 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17503 |
|
17504 |
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17505 |
|
17506 |
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17507 |
|
17508 |
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
|
17509 |
|
17510 |
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17511 |
|
17512 |
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
17513 |
+
|
17514 |
+
function number(props, propName, componentName) {
|
17515 |
+
var value = props[propName];
|
17516 |
+
|
17517 |
+
if (typeof value === 'number' && !isNaN(value)) {
|
17518 |
+
return null;
|
17519 |
}
|
17520 |
|
17521 |
+
return new TypeError("".concat(componentName, ": ").concat(propName, " must be a non-NaN number."));
|
17522 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17523 |
|
17524 |
+
function numberOrPropsFunc(props, propName) {
|
17525 |
+
var value = props[propName];
|
17526 |
|
17527 |
+
if (typeof value === 'function') {
|
17528 |
+
return null;
|
17529 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17530 |
|
17531 |
+
if (typeof value === 'number' && !isNaN(value)) {
|
17532 |
+
return null;
|
|
|
17533 |
}
|
17534 |
|
17535 |
+
return new TypeError("".concat(propName, ": a function, or a non-NaN number is required"));
|
17536 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17537 |
|
17538 |
+
function lowerCompare(value, _ref) {
|
17539 |
+
var gt = _ref.gt,
|
17540 |
+
gte = _ref.gte;
|
17541 |
|
17542 |
+
if (typeof gt === 'number') {
|
17543 |
+
return value > gt;
|
17544 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17545 |
|
17546 |
+
if (typeof gte === 'number') {
|
17547 |
+
return value >= gte;
|
|
|
17548 |
}
|
17549 |
|
17550 |
+
return true;
|
17551 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17552 |
|
17553 |
+
function upperCompare(value, _ref2) {
|
17554 |
+
var lt = _ref2.lt,
|
17555 |
+
lte = _ref2.lte;
|
17556 |
|
17557 |
+
if (typeof lt === 'number') {
|
17558 |
+
return value < lt;
|
17559 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17560 |
|
17561 |
+
if (typeof lte === 'number') {
|
17562 |
+
return value <= lte;
|
|
|
17563 |
}
|
17564 |
|
17565 |
+
return true;
|
17566 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17567 |
|
17568 |
+
function greaterThanError(_ref3) {
|
17569 |
+
var gt = _ref3.gt,
|
17570 |
+
gte = _ref3.gte;
|
17571 |
|
17572 |
+
if (typeof gt === 'number') {
|
17573 |
+
return "greater than ".concat(gt);
|
17574 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17575 |
|
17576 |
+
if (typeof gte === 'number') {
|
17577 |
+
return "greater than or equal to ".concat(gte);
|
|
|
17578 |
}
|
17579 |
|
17580 |
+
return '';
|
17581 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17582 |
|
17583 |
+
function lessThanError(_ref4) {
|
17584 |
+
var lt = _ref4.lt,
|
17585 |
+
lte = _ref4.lte;
|
17586 |
|
17587 |
+
if (typeof lt === 'number') {
|
17588 |
+
return "less than ".concat(lt);
|
17589 |
+
}
|
17590 |
|
17591 |
+
if (typeof lte === 'number') {
|
17592 |
+
return "less than or equal to ".concat(lte);
|
17593 |
}
|
17594 |
|
17595 |
+
return '';
|
17596 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17597 |
|
17598 |
+
function errorMessage(componentName, propName, opts) {
|
17599 |
+
var errors = [greaterThanError(opts), lessThanError(opts)].filter(Boolean).join(' and ');
|
17600 |
+
return "".concat(componentName, ": ").concat(propName, " must be ").concat(errors);
|
|
|
17601 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17602 |
|
17603 |
+
function propsThunkify(opts) {
|
17604 |
+
return (0, _object["default"])(opts).reduce(function (acc, _ref5) {
|
17605 |
+
var _ref6 = _slicedToArray(_ref5, 2),
|
17606 |
+
key = _ref6[0],
|
17607 |
+
value = _ref6[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
17608 |
|
17609 |
+
var numberThunk = typeof value === 'number' ? function () {
|
17610 |
+
return value;
|
17611 |
+
} : value;
|
17612 |
+
return _objectSpread({}, acc, _defineProperty({}, key, numberThunk));
|
17613 |
+
}, {});
|
17614 |
+
}
|
17615 |
|
17616 |
+
function invokeWithProps(optsThunks, props) {
|
17617 |
+
return (0, _object["default"])(optsThunks).reduce(function (acc, _ref7) {
|
17618 |
+
var _ref8 = _slicedToArray(_ref7, 2),
|
17619 |
+
key = _ref8[0],
|
17620 |
+
thunk = _ref8[1];
|
17621 |
|
17622 |
+
var value = thunk(props);
|
17623 |
+
return _objectSpread({}, acc, _defineProperty({}, key, value));
|
17624 |
+
}, {});
|
|
|
17625 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17626 |
|
17627 |
+
var argValidators = [(0, _shape["default"])({
|
17628 |
+
lt: numberOrPropsFunc,
|
17629 |
+
gt: numberOrPropsFunc
|
17630 |
+
}).isRequired, (0, _shape["default"])({
|
17631 |
+
lte: numberOrPropsFunc,
|
17632 |
+
gt: numberOrPropsFunc
|
17633 |
+
}).isRequired, (0, _shape["default"])({
|
17634 |
+
lt: numberOrPropsFunc,
|
17635 |
+
gte: numberOrPropsFunc
|
17636 |
+
}).isRequired, (0, _shape["default"])({
|
17637 |
+
lte: numberOrPropsFunc,
|
17638 |
+
gte: numberOrPropsFunc
|
17639 |
+
}).isRequired, (0, _shape["default"])({
|
17640 |
+
lt: numberOrPropsFunc
|
17641 |
+
}).isRequired, (0, _shape["default"])({
|
17642 |
+
lte: numberOrPropsFunc
|
17643 |
+
}).isRequired, (0, _shape["default"])({
|
17644 |
+
gt: numberOrPropsFunc
|
17645 |
+
}).isRequired, (0, _shape["default"])({
|
17646 |
+
gte: numberOrPropsFunc
|
17647 |
+
}).isRequired];
|
17648 |
|
17649 |
+
function argValidator(props, propName) {
|
17650 |
+
return argValidators.every(function (validator) {
|
17651 |
+
return !!validator(props, propName);
|
17652 |
+
});
|
17653 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17654 |
|
17655 |
+
var thunkValueValidator = (0, _valuesOf["default"])(number).isRequired;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17656 |
|
17657 |
+
function betweenValidator(options) {
|
17658 |
+
var argError = argValidator({
|
17659 |
+
options: options
|
17660 |
+
}, 'options');
|
17661 |
|
17662 |
+
if (argError) {
|
17663 |
+
throw new TypeError('between: only one of the pairs of `lt`/`lte`, and `gt`/`gte`, may be supplied, and at least one pair must be provided.');
|
17664 |
}
|
17665 |
|
17666 |
+
var optsThunks = propsThunkify(options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17667 |
|
17668 |
+
var validator = function between(props, propName, componentName) {
|
17669 |
+
var propValue = props[propName];
|
|
|
|
|
|
|
17670 |
|
17671 |
+
if (propValue == null) {
|
17672 |
+
return null;
|
17673 |
+
}
|
17674 |
|
17675 |
+
if (typeof propValue !== 'number') {
|
17676 |
+
return new RangeError("".concat(componentName, ": ").concat(propName, " must be a number, got \"").concat(_typeof(propValue), "\""));
|
17677 |
+
}
|
17678 |
|
17679 |
+
var opts = invokeWithProps(optsThunks, props);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17680 |
|
17681 |
+
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
17682 |
+
rest[_key - 3] = arguments[_key];
|
17683 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17684 |
|
17685 |
+
var thunkValuesError = thunkValueValidator.apply(void 0, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17686 |
|
17687 |
+
if (thunkValuesError) {
|
17688 |
+
return thunkValuesError;
|
17689 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17690 |
|
17691 |
+
if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
|
17692 |
+
return new RangeError(errorMessage(componentName, propName, opts));
|
17693 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17694 |
|
17695 |
+
return null;
|
17696 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17697 |
|
17698 |
+
validator.isRequired = function betweenRequired(props, propName, componentName) {
|
17699 |
+
var propValue = props[propName];
|
|
|
|
|
17700 |
|
17701 |
+
if (typeof propValue !== 'number') {
|
17702 |
+
return new RangeError("".concat(componentName, ": ").concat(propName, " must be a number, got \"").concat(_typeof(propValue), "\""));
|
17703 |
+
}
|
17704 |
|
17705 |
+
var opts = invokeWithProps(optsThunks, props);
|
|
|
|
|
|
|
|
|
17706 |
|
17707 |
+
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
17708 |
+
rest[_key2 - 3] = arguments[_key2];
|
17709 |
+
}
|
17710 |
|
17711 |
+
var thunkValuesError = thunkValueValidator.apply(void 0, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
|
17712 |
|
17713 |
+
if (thunkValuesError) {
|
17714 |
+
return thunkValuesError;
|
17715 |
+
}
|
17716 |
|
17717 |
+
if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
|
17718 |
+
return new RangeError(errorMessage(componentName, propName, opts));
|
17719 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17720 |
|
17721 |
+
return null;
|
17722 |
+
};
|
|
|
17723 |
|
17724 |
+
return (0, _wrapValidator["default"])(validator, 'between', options);
|
|
|
|
|
|
|
|
|
|
|
|
|
17725 |
}
|
17726 |
+
//# sourceMappingURL=between.js.map
|
17727 |
|
17728 |
/***/ }),
|
17729 |
+
/* 126 */
|
17730 |
/***/ (function(module, exports, __webpack_require__) {
|
17731 |
|
17732 |
+
"use strict";
|
|
|
|
|
17733 |
|
|
|
|
|
|
|
17734 |
|
17735 |
+
Object.defineProperty(exports, "__esModule", {
|
17736 |
+
value: true
|
17737 |
+
});
|
17738 |
+
exports["default"] = shapeValidator;
|
17739 |
|
17740 |
+
var _isPlainObject = _interopRequireDefault(__webpack_require__(127));
|
|
|
|
|
|
|
|
|
|
|
17741 |
|
17742 |
+
var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
|
|
|
|
|
|
|
|
|
17743 |
|
17744 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
|
|
|
17745 |
|
17746 |
+
function shapeValidator(shapeTypes) {
|
17747 |
+
if (!(0, _isPlainObject["default"])(shapeTypes)) {
|
17748 |
+
throw new TypeError('shape must be a normal object');
|
17749 |
+
}
|
17750 |
|
17751 |
+
function shape(props, propName, componentName, location) {
|
17752 |
+
var propValue = props[propName];
|
|
|
|
|
|
|
|
|
|
|
17753 |
|
17754 |
+
if (propValue == null) {
|
17755 |
+
return null;
|
17756 |
+
} // code adapted from PropTypes.shape: https://github.com/facebook/react/blob/14156e56b9cf18ac86963185c5af4abddf3ff811/src/isomorphic/classic/types/ReactPropTypes.js#L381
|
17757 |
+
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
|
|
|
17758 |
|
|
|
|
|
|
|
|
|
|
|
17759 |
|
17760 |
+
for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
|
17761 |
+
rest[_key - 4] = arguments[_key];
|
17762 |
+
}
|
17763 |
|
17764 |
+
for (var key in shapeTypes) {
|
17765 |
+
var checker = shapeTypes[key];
|
17766 |
|
17767 |
+
if (checker) {
|
17768 |
+
var error = checker.apply(void 0, [propValue, key, componentName, location].concat(rest));
|
|
|
|
|
|
|
17769 |
|
17770 |
+
if (error) {
|
17771 |
+
return error;
|
17772 |
+
}
|
17773 |
+
}
|
17774 |
+
}
|
17775 |
|
17776 |
+
return null;
|
17777 |
+
}
|
|
|
17778 |
|
17779 |
+
shape.isRequired = function shapeRequired(props, propName, componentName) {
|
17780 |
+
var propValue = props[propName];
|
17781 |
|
17782 |
+
if (propValue == null) {
|
17783 |
+
return new TypeError("".concat(componentName, ": ").concat(propName, " is required."));
|
17784 |
+
}
|
|
|
|
|
|
|
|
|
|
|
17785 |
|
17786 |
+
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
17787 |
+
rest[_key2 - 3] = arguments[_key2];
|
17788 |
+
}
|
|
|
|
|
|
|
|
|
17789 |
|
17790 |
+
return shape.apply(void 0, [props, propName, componentName].concat(rest));
|
17791 |
+
};
|
17792 |
|
17793 |
+
return (0, _wrapValidator["default"])(shape, 'shape', shapeTypes);
|
17794 |
+
}
|
17795 |
+
//# sourceMappingURL=shape.js.map
|
17796 |
|
17797 |
+
/***/ }),
|
17798 |
+
/* 127 */
|
17799 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
17800 |
|
17801 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
17802 |
|
|
|
|
|
17803 |
|
17804 |
+
Object.defineProperty(exports, "__esModule", {
|
17805 |
+
value: true
|
17806 |
+
});
|
17807 |
+
exports["default"] = void 0;
|
17808 |
|
17809 |
+
var _isPlainObject = _interopRequireDefault(__webpack_require__(342));
|
|
|
|
|
17810 |
|
17811 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
17812 |
|
17813 |
+
var _default = _isPlainObject["default"];
|
17814 |
+
exports["default"] = _default;
|
17815 |
+
//# sourceMappingURL=isPlainObject.js.map
|
17816 |
|
17817 |
/***/ }),
|
17818 |
+
/* 128 */
|
17819 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17820 |
|
17821 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17822 |
|
17823 |
|
17824 |
+
Object.defineProperty(exports, "__esModule", {
|
17825 |
+
value: true
|
17826 |
+
});
|
17827 |
+
exports["default"] = renderableChildren;
|
17828 |
|
17829 |
+
var _react = _interopRequireDefault(__webpack_require__(10));
|
|
|
|
|
17830 |
|
17831 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
17832 |
|
17833 |
+
function renderableChildren(childrenProp) {
|
17834 |
+
return _react["default"].Children.toArray(childrenProp).filter(function (child) {
|
17835 |
+
return child === 0 || child;
|
17836 |
+
});
|
17837 |
+
}
|
17838 |
+
//# sourceMappingURL=renderableChildren.js.map
|
17839 |
|
17840 |
+
/***/ }),
|
17841 |
+
/* 129 */
|
17842 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17843 |
|
17844 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17845 |
|
|
|
|
|
|
|
|
|
|
|
17846 |
|
17847 |
+
Object.defineProperty(exports, "__esModule", {
|
17848 |
+
value: true
|
17849 |
+
});
|
17850 |
+
exports["default"] = getComponentName;
|
|
|
|
|
|
|
|
|
17851 |
|
17852 |
+
var _functionPrototype = _interopRequireDefault(__webpack_require__(667));
|
|
|
|
|
|
|
|
|
|
|
|
|
17853 |
|
17854 |
+
var _reactIs = __webpack_require__(67);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17855 |
|
17856 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17857 |
|
17858 |
+
function getComponentName(Component) {
|
17859 |
+
if (typeof Component === 'string') {
|
17860 |
+
return Component;
|
17861 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17862 |
|
17863 |
+
if (typeof Component === 'function') {
|
17864 |
+
return Component.displayName || (0, _functionPrototype["default"])(Component);
|
17865 |
+
}
|
17866 |
|
17867 |
+
if ((0, _reactIs.isForwardRef)({
|
17868 |
+
type: Component,
|
17869 |
+
$$typeof: _reactIs.Element
|
17870 |
+
})) {
|
17871 |
+
return Component.displayName;
|
17872 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17873 |
|
17874 |
+
if ((0, _reactIs.isMemo)(Component)) {
|
17875 |
+
return getComponentName(Component.type);
|
17876 |
+
}
|
17877 |
|
17878 |
+
return null;
|
17879 |
+
}
|
17880 |
+
//# sourceMappingURL=getComponentName.js.map
|
|
|
|
|
|
|
|
|
17881 |
|
17882 |
+
/***/ }),
|
17883 |
+
/* 130 */
|
17884 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17885 |
|
17886 |
+
"use strict";
|
|
|
|
|
|
|
|
|
17887 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17888 |
|
17889 |
+
Object.defineProperty(exports, "__esModule", {
|
17890 |
+
value: true
|
17891 |
+
});
|
17892 |
+
exports["default"] = void 0;
|
17893 |
|
17894 |
+
var _isInteger = _interopRequireDefault(__webpack_require__(355));
|
|
|
|
|
|
|
17895 |
|
17896 |
+
var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
|
|
|
|
|
17897 |
|
17898 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
17899 |
|
17900 |
+
function requiredInteger(props, propName, componentName) {
|
17901 |
+
var propValue = props[propName];
|
17902 |
+
|
17903 |
+
if (propValue == null || !(0, _isInteger["default"])(propValue)) {
|
17904 |
+
return new RangeError("".concat(propName, " in ").concat(componentName, " must be an integer"));
|
17905 |
}
|
17906 |
|
17907 |
+
return null;
|
17908 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17909 |
|
17910 |
+
var validator = function integer(props, propName) {
|
17911 |
+
var propValue = props[propName];
|
|
|
|
|
|
|
|
|
|
|
17912 |
|
17913 |
+
if (propValue == null) {
|
17914 |
+
return null;
|
17915 |
+
}
|
17916 |
|
17917 |
+
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
17918 |
+
rest[_key - 2] = arguments[_key];
|
|
|
17919 |
}
|
17920 |
|
17921 |
+
return requiredInteger.apply(void 0, [props, propName].concat(rest));
|
17922 |
+
};
|
|
|
|
|
|
|
|
|
17923 |
|
17924 |
+
validator.isRequired = requiredInteger;
|
17925 |
+
|
17926 |
+
var _default = function _default() {
|
17927 |
+
return (0, _wrapValidator["default"])(validator, 'integer');
|
17928 |
+
};
|
17929 |
+
|
17930 |
+
exports["default"] = _default;
|
17931 |
+
//# sourceMappingURL=integer.js.map
|
17932 |
|
17933 |
/***/ }),
|
17934 |
+
/* 131 */
|
17935 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17936 |
|
17937 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17938 |
|
17939 |
+
|
17940 |
+
Object.defineProperty(exports, "__esModule", {
|
17941 |
+
value: true
|
17942 |
+
});
|
17943 |
+
exports["default"] = withShape;
|
17944 |
+
|
17945 |
+
var _and = _interopRequireDefault(__webpack_require__(47));
|
17946 |
+
|
17947 |
+
var _shape = _interopRequireDefault(__webpack_require__(126));
|
17948 |
+
|
17949 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17950 |
+
|
17951 |
+
function withShape(type, shapeTypes) {
|
17952 |
+
if (typeof type !== 'function') {
|
17953 |
+
throw new TypeError('type must be a valid PropType');
|
17954 |
}
|
17955 |
+
|
17956 |
+
var shapeValidator = (0, _shape["default"])(shapeTypes);
|
17957 |
+
return (0, _and["default"])([type, shapeValidator], 'withShape');
|
17958 |
}
|
17959 |
+
//# sourceMappingURL=withShape.js.map
|
17960 |
|
17961 |
+
/***/ }),
|
17962 |
+
/* 132 */
|
17963 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
17964 |
|
17965 |
+
// eslint-disable-next-line import/no-unresolved
|
17966 |
+
module.exports = __webpack_require__(703);
|
|
|
17967 |
|
|
|
|
|
|
|
17968 |
|
17969 |
+
/***/ }),
|
17970 |
+
/* 133 */
|
17971 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17972 |
+
|
17973 |
+
"use strict";
|
17974 |
+
|
17975 |
+
|
17976 |
+
var define = __webpack_require__(26);
|
17977 |
+
|
17978 |
+
var implementation = __webpack_require__(373);
|
17979 |
+
var getPolyfill = __webpack_require__(374);
|
17980 |
+
var shim = __webpack_require__(704);
|
17981 |
+
|
17982 |
+
var polyfill = getPolyfill();
|
17983 |
+
|
17984 |
+
define(polyfill, {
|
17985 |
+
getPolyfill: getPolyfill,
|
17986 |
+
implementation: implementation,
|
17987 |
+
shim: shim
|
17988 |
+
});
|
17989 |
+
|
17990 |
+
module.exports = polyfill;
|
17991 |
+
|
17992 |
|
17993 |
/***/ }),
|
17994 |
+
/* 134 */
|
17995 |
+
/***/ (function(module, exports, __webpack_require__) {
|
17996 |
|
17997 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17998 |
|
17999 |
|
18000 |
+
Object.defineProperty(exports, "__esModule", {
|
18001 |
+
value: true
|
18002 |
+
});
|
18003 |
+
exports['default'] = getInputHeight;
|
18004 |
+
/* eslint-disable camelcase */
|
|
|
|
|
|
|
|
|
18005 |
|
18006 |
+
function getPadding(vertical, top, bottom) {
|
18007 |
+
var isTopDefined = typeof top === 'number';
|
18008 |
+
var isBottomDefined = typeof bottom === 'number';
|
18009 |
+
var isVerticalDefined = typeof vertical === 'number';
|
18010 |
+
|
18011 |
+
if (isTopDefined && isBottomDefined) {
|
18012 |
+
return top + bottom;
|
18013 |
}
|
|
|
18014 |
|
18015 |
+
if (isTopDefined && isVerticalDefined) {
|
18016 |
+
return top + vertical;
|
18017 |
+
}
|
|
|
|
|
|
|
|
|
18018 |
|
18019 |
+
if (isTopDefined) {
|
18020 |
+
return top;
|
18021 |
}
|
18022 |
|
18023 |
+
if (isBottomDefined && isVerticalDefined) {
|
18024 |
+
return bottom + vertical;
|
18025 |
+
}
|
18026 |
+
|
18027 |
+
if (isBottomDefined) {
|
18028 |
+
return bottom;
|
18029 |
+
}
|
18030 |
+
|
18031 |
+
if (isVerticalDefined) {
|
18032 |
+
return 2 * vertical;
|
18033 |
+
}
|
18034 |
+
|
18035 |
+
return 0;
|
18036 |
+
}
|
18037 |
+
|
18038 |
+
function getInputHeight(_ref, small) {
|
18039 |
+
var _ref$font$input = _ref.font.input,
|
18040 |
+
lineHeight = _ref$font$input.lineHeight,
|
18041 |
+
lineHeight_small = _ref$font$input.lineHeight_small,
|
18042 |
+
_ref$spacing = _ref.spacing,
|
18043 |
+
inputPadding = _ref$spacing.inputPadding,
|
18044 |
+
displayTextPaddingVertical = _ref$spacing.displayTextPaddingVertical,
|
18045 |
+
displayTextPaddingTop = _ref$spacing.displayTextPaddingTop,
|
18046 |
+
displayTextPaddingBottom = _ref$spacing.displayTextPaddingBottom,
|
18047 |
+
displayTextPaddingVertical_small = _ref$spacing.displayTextPaddingVertical_small,
|
18048 |
+
displayTextPaddingTop_small = _ref$spacing.displayTextPaddingTop_small,
|
18049 |
+
displayTextPaddingBottom_small = _ref$spacing.displayTextPaddingBottom_small;
|
18050 |
+
|
18051 |
+
var calcLineHeight = small ? lineHeight_small : lineHeight;
|
18052 |
+
|
18053 |
+
var padding = small ? getPadding(displayTextPaddingVertical_small, displayTextPaddingTop_small, displayTextPaddingBottom_small) : getPadding(displayTextPaddingVertical, displayTextPaddingTop, displayTextPaddingBottom);
|
18054 |
+
|
18055 |
+
return parseInt(calcLineHeight, 10) + 2 * inputPadding + padding;
|
18056 |
}
|
18057 |
|
18058 |
+
/***/ }),
|
18059 |
+
/* 135 */
|
18060 |
+
/***/ (function(module, exports) {
|
18061 |
+
|
18062 |
/**
|
18063 |
+
* Checks if `value` is the
|
18064 |
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
18065 |
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
18066 |
*
|
18067 |
+
* @static
|
18068 |
+
* @memberOf _
|
18069 |
+
* @since 0.1.0
|
18070 |
+
* @category Lang
|
18071 |
+
* @param {*} value The value to check.
|
18072 |
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
18073 |
+
* @example
|
18074 |
*
|
18075 |
+
* _.isObject({});
|
18076 |
+
* // => true
|
18077 |
*
|
18078 |
+
* _.isObject([1, 2, 3]);
|
18079 |
+
* // => true
|
|
|
|
|
|
|
18080 |
*
|
18081 |
+
* _.isObject(_.noop);
|
18082 |
+
* // => true
|
|
|
|
|
18083 |
*
|
18084 |
+
* _.isObject(null);
|
18085 |
+
* // => false
|
18086 |
*/
|
18087 |
+
function isObject(value) {
|
18088 |
+
var type = typeof value;
|
18089 |
+
return value != null && (type == 'object' || type == 'function');
|
18090 |
+
}
|
18091 |
|
18092 |
+
module.exports = isObject;
|
|
|
18093 |
|
|
|
|
|
|
|
18094 |
|
18095 |
+
/***/ }),
|
18096 |
+
/* 136 */
|
18097 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
18098 |
|
18099 |
+
"use strict";
|
|
|
|
|
|
|
18100 |
|
|
|
|
|
18101 |
|
18102 |
+
Object.defineProperty(exports, "__esModule", {
|
18103 |
+
value: true
|
18104 |
+
});
|
18105 |
+
exports['default'] = toLocalizedDateString;
|
18106 |
|
18107 |
+
var _moment = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
18108 |
|
18109 |
+
var _moment2 = _interopRequireDefault(_moment);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18110 |
|
18111 |
+
var _toMomentObject = __webpack_require__(57);
|
18112 |
|
18113 |
+
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
|
|
|
|
|
|
|
18114 |
|
18115 |
+
var _constants = __webpack_require__(17);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18116 |
|
18117 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
18118 |
|
18119 |
+
function toLocalizedDateString(date, currentFormat) {
|
18120 |
+
var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
|
18121 |
+
if (!dateObj) return null;
|
|
|
18122 |
|
18123 |
+
return dateObj.format(_constants.DISPLAY_FORMAT);
|
18124 |
+
}
|
|
|
18125 |
|
18126 |
+
/***/ }),
|
18127 |
+
/* 137 */
|
18128 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
18129 |
|
18130 |
+
"use strict";
|
|
|
|
|
18131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18132 |
|
18133 |
+
Object.defineProperty(exports, "__esModule", {
|
18134 |
+
value: true
|
18135 |
+
});
|
18136 |
+
exports['default'] = isDayVisible;
|
18137 |
|
18138 |
+
var _isBeforeDay = __webpack_require__(71);
|
|
|
|
|
|
|
18139 |
|
18140 |
+
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
|
|
|
|
|
18141 |
|
18142 |
+
var _isAfterDay = __webpack_require__(91);
|
|
|
|
|
18143 |
|
18144 |
+
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
|
|
|
|
|
|
|
|
|
|
|
18145 |
|
18146 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
18147 |
|
18148 |
+
function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
|
18149 |
+
var firstDayOfFirstMonth = month.clone().startOf('month');
|
18150 |
+
if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
|
18151 |
+
if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
|
18152 |
|
18153 |
+
var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month');
|
18154 |
+
if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week');
|
18155 |
+
return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth);
|
18156 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18157 |
|
18158 |
+
/***/ }),
|
18159 |
+
/* 138 */
|
18160 |
+
/***/ (function(module, exports, __webpack_require__) {
|
18161 |
|
18162 |
+
"use strict";
|
|
|
|
|
|
|
18163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18164 |
|
18165 |
+
Object.defineProperty(exports, "__esModule", {
|
18166 |
+
value: true
|
18167 |
+
});
|
18168 |
+
exports.PureDayPicker = exports.defaultProps = undefined;
|
18169 |
|
18170 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
|
18171 |
|
18172 |
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18173 |
|
18174 |
+
var _object = __webpack_require__(24);
|
|
|
|
|
|
|
|
|
18175 |
|
18176 |
+
var _object2 = _interopRequireDefault(_object);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18177 |
|
18178 |
+
var _react = __webpack_require__(10);
|
18179 |
|
18180 |
+
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18181 |
|
18182 |
+
var _propTypes = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18183 |
|
18184 |
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
18185 |
|
18186 |
+
var _reactAddonsShallowCompare = __webpack_require__(55);
|
|
|
|
|
|
|
|
|
|
|
18187 |
|
18188 |
+
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
|
18189 |
|
18190 |
+
var _airbnbPropTypes = __webpack_require__(21);
|
|
|
|
|
|
|
|
|
18191 |
|
18192 |
+
var _reactWithStyles = __webpack_require__(32);
|
|
|
|
|
18193 |
|
18194 |
+
var _moment = __webpack_require__(0);
|
|
|
|
|
18195 |
|
18196 |
+
var _moment2 = _interopRequireDefault(_moment);
|
|
|
|
|
18197 |
|
18198 |
+
var _throttle = __webpack_require__(387);
|
|
|
|
|
|
|
|
|
|
|
|
|
18199 |
|
18200 |
+
var _throttle2 = _interopRequireDefault(_throttle);
|
|
|
|
|
|
|
18201 |
|
18202 |
+
var _isTouchDevice = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
|
18203 |
|
18204 |
+
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
|
|
|
|
|
18205 |
|
18206 |
+
var _reactOutsideClickHandler = __webpack_require__(132);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18207 |
|
18208 |
+
var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
|
18209 |
|
18210 |
+
var _defaultPhrases = __webpack_require__(27);
|
|
|
|
|
18211 |
|
18212 |
+
var _getPhrasePropTypes = __webpack_require__(30);
|
|
|
18213 |
|
18214 |
+
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
|
|
|
|
|
|
|
|
|
18215 |
|
18216 |
+
var _CalendarMonthGrid = __webpack_require__(368);
|
|
|
|
|
|
|
18217 |
|
18218 |
+
var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
|
|
|
18219 |
|
18220 |
+
var _DayPickerNavigation = __webpack_require__(717);
|
|
|
|
|
18221 |
|
18222 |
+
var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
|
18223 |
|
18224 |
+
var _DayPickerKeyboardShortcuts = __webpack_require__(720);
|
|
|
|
|
|
|
|
|
18225 |
|
18226 |
+
var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
|
|
|
|
|
|
|
18227 |
|
18228 |
+
var _getNumberOfCalendarMonthWeeks = __webpack_require__(722);
|
|
|
|
|
18229 |
|
18230 |
+
var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
|
|
|
18231 |
|
18232 |
+
var _getCalendarMonthWidth = __webpack_require__(369);
|
|
|
|
|
|
|
18233 |
|
18234 |
+
var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
|
|
|
18235 |
|
18236 |
+
var _calculateDimension = __webpack_require__(367);
|
|
|
|
|
|
|
|
|
18237 |
|
18238 |
+
var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
|
|
|
|
|
|
|
18239 |
|
18240 |
+
var _getActiveElement = __webpack_require__(723);
|
|
|
|
|
18241 |
|
18242 |
+
var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
|
|
|
|
|
18243 |
|
18244 |
+
var _isDayVisible = __webpack_require__(137);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18245 |
|
18246 |
+
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
|
18247 |
|
18248 |
+
var _ModifiersShape = __webpack_require__(86);
|
|
|
|
|
|
|
18249 |
|
18250 |
+
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
|
|
|
|
|
18251 |
|
18252 |
+
var _ScrollableOrientationShape = __webpack_require__(58);
|
|
|
18253 |
|
18254 |
+
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
|
|
|
|
|
18255 |
|
18256 |
+
var _DayOfWeekShape = __webpack_require__(48);
|
|
|
|
|
|
|
18257 |
|
18258 |
+
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
|
|
|
18259 |
|
18260 |
+
var _CalendarInfoPositionShape = __webpack_require__(69);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18261 |
|
18262 |
+
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
|
|
|
18263 |
|
18264 |
+
var _constants = __webpack_require__(17);
|
|
|
|
|
|
|
18265 |
|
18266 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
18267 |
|
18268 |
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
|
|
|
|
|
18269 |
|
18270 |
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
18271 |
|
18272 |
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18273 |
|
18274 |
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
18275 |
|
18276 |
+
var MONTH_PADDING = 23;
|
18277 |
+
var PREV_TRANSITION = 'prev';
|
18278 |
+
var NEXT_TRANSITION = 'next';
|
18279 |
+
var MONTH_SELECTION_TRANSITION = 'month_selection';
|
18280 |
+
var YEAR_SELECTION_TRANSITION = 'year_selection';
|
18281 |
|
18282 |
+
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
|
|
|
|
|
|
|
|
|
|
|
18283 |
|
18284 |
+
// calendar presentation props
|
18285 |
+
enableOutsideDays: _propTypes2['default'].bool,
|
18286 |
+
numberOfMonths: _propTypes2['default'].number,
|
18287 |
+
orientation: _ScrollableOrientationShape2['default'],
|
18288 |
+
withPortal: _propTypes2['default'].bool,
|
18289 |
+
onOutsideClick: _propTypes2['default'].func,
|
18290 |
+
hidden: _propTypes2['default'].bool,
|
18291 |
+
initialVisibleMonth: _propTypes2['default'].func,
|
18292 |
+
firstDayOfWeek: _DayOfWeekShape2['default'],
|
18293 |
+
renderCalendarInfo: _propTypes2['default'].func,
|
18294 |
+
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
|
18295 |
+
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
|
18296 |
+
daySize: _airbnbPropTypes.nonNegativeInteger,
|
18297 |
+
isRTL: _propTypes2['default'].bool,
|
18298 |
+
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
|
18299 |
+
noBorder: _propTypes2['default'].bool,
|
18300 |
+
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
|
18301 |
+
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
|
18302 |
+
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
|
18303 |
|
18304 |
+
// navigation props
|
18305 |
+
navPrev: _propTypes2['default'].node,
|
18306 |
+
navNext: _propTypes2['default'].node,
|
18307 |
+
noNavButtons: _propTypes2['default'].bool,
|
18308 |
+
onPrevMonthClick: _propTypes2['default'].func,
|
18309 |
+
onNextMonthClick: _propTypes2['default'].func,
|
18310 |
+
onMonthChange: _propTypes2['default'].func,
|
18311 |
+
onYearChange: _propTypes2['default'].func,
|
18312 |
+
onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
|
18313 |
|
18314 |
+
// month props
|
18315 |
+
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
|
18316 |
+
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
|
18317 |
|
18318 |
+
// day props
|
18319 |
+
modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
|
18320 |
+
renderCalendarDay: _propTypes2['default'].func,
|
18321 |
+
renderDayContents: _propTypes2['default'].func,
|
18322 |
+
onDayClick: _propTypes2['default'].func,
|
18323 |
+
onDayMouseEnter: _propTypes2['default'].func,
|
18324 |
+
onDayMouseLeave: _propTypes2['default'].func,
|
18325 |
|
18326 |
+
// accessibility props
|
18327 |
+
isFocused: _propTypes2['default'].bool,
|
18328 |
+
getFirstFocusableDay: _propTypes2['default'].func,
|
18329 |
+
onBlur: _propTypes2['default'].func,
|
18330 |
+
showKeyboardShortcuts: _propTypes2['default'].bool,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18331 |
|
18332 |
+
// internationalization
|
18333 |
+
monthFormat: _propTypes2['default'].string,
|
18334 |
+
weekDayFormat: _propTypes2['default'].string,
|
18335 |
+
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
|
18336 |
+
dayAriaLabelFormat: _propTypes2['default'].string
|
18337 |
+
}));
|
18338 |
|
18339 |
+
var defaultProps = exports.defaultProps = {
|
18340 |
+
// calendar presentation props
|
18341 |
+
enableOutsideDays: false,
|
18342 |
+
numberOfMonths: 2,
|
18343 |
+
orientation: _constants.HORIZONTAL_ORIENTATION,
|
18344 |
+
withPortal: false,
|
18345 |
+
onOutsideClick: function () {
|
18346 |
+
function onOutsideClick() {}
|
18347 |
|
18348 |
+
return onOutsideClick;
|
18349 |
+
}(),
|
|
|
18350 |
|
18351 |
+
hidden: false,
|
18352 |
+
initialVisibleMonth: function () {
|
18353 |
+
function initialVisibleMonth() {
|
18354 |
+
return (0, _moment2['default'])();
|
18355 |
+
}
|
18356 |
|
18357 |
+
return initialVisibleMonth;
|
18358 |
+
}(),
|
18359 |
+
firstDayOfWeek: null,
|
18360 |
+
renderCalendarInfo: null,
|
18361 |
+
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
|
18362 |
+
hideKeyboardShortcutsPanel: false,
|
18363 |
+
daySize: _constants.DAY_SIZE,
|
18364 |
+
isRTL: false,
|
18365 |
+
verticalHeight: null,
|
18366 |
+
noBorder: false,
|
18367 |
+
transitionDuration: undefined,
|
18368 |
+
verticalBorderSpacing: undefined,
|
18369 |
+
horizontalMonthPadding: 13,
|
18370 |
|
18371 |
+
// navigation props
|
18372 |
+
navPrev: null,
|
18373 |
+
navNext: null,
|
18374 |
+
noNavButtons: false,
|
18375 |
+
onPrevMonthClick: function () {
|
18376 |
+
function onPrevMonthClick() {}
|
18377 |
|
18378 |
+
return onPrevMonthClick;
|
18379 |
+
}(),
|
18380 |
+
onNextMonthClick: function () {
|
18381 |
+
function onNextMonthClick() {}
|
18382 |
|
18383 |
+
return onNextMonthClick;
|
18384 |
+
}(),
|
18385 |
+
onMonthChange: function () {
|
18386 |
+
function onMonthChange() {}
|
18387 |
|
18388 |
+
return onMonthChange;
|
18389 |
+
}(),
|
18390 |
+
onYearChange: function () {
|
18391 |
+
function onYearChange() {}
|
18392 |
|
18393 |
+
return onYearChange;
|
18394 |
+
}(),
|
18395 |
+
onMultiplyScrollableMonths: function () {
|
18396 |
+
function onMultiplyScrollableMonths() {}
|
18397 |
|
18398 |
+
return onMultiplyScrollableMonths;
|
18399 |
+
}(),
|
|
|
18400 |
|
|
|
18401 |
|
18402 |
+
// month props
|
18403 |
+
renderMonthText: null,
|
18404 |
+
renderMonthElement: null,
|
18405 |
|
18406 |
+
// day props
|
18407 |
+
modifiers: {},
|
18408 |
+
renderCalendarDay: undefined,
|
18409 |
+
renderDayContents: null,
|
18410 |
+
onDayClick: function () {
|
18411 |
+
function onDayClick() {}
|
18412 |
|
18413 |
+
return onDayClick;
|
18414 |
+
}(),
|
18415 |
+
onDayMouseEnter: function () {
|
18416 |
+
function onDayMouseEnter() {}
|
18417 |
|
18418 |
+
return onDayMouseEnter;
|
18419 |
+
}(),
|
18420 |
+
onDayMouseLeave: function () {
|
18421 |
+
function onDayMouseLeave() {}
|
18422 |
|
18423 |
+
return onDayMouseLeave;
|
18424 |
+
}(),
|
18425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18426 |
|
18427 |
+
// accessibility props
|
18428 |
+
isFocused: false,
|
18429 |
+
getFirstFocusableDay: null,
|
18430 |
+
onBlur: function () {
|
18431 |
+
function onBlur() {}
|
|
|
18432 |
|
18433 |
+
return onBlur;
|
18434 |
+
}(),
|
|
|
|
|
18435 |
|
18436 |
+
showKeyboardShortcuts: false,
|
|
|
|
|
|
|
|
|
|
|
18437 |
|
18438 |
+
// internationalization
|
18439 |
+
monthFormat: 'MMMM YYYY',
|
18440 |
+
weekDayFormat: 'dd',
|
18441 |
+
phrases: _defaultPhrases.DayPickerPhrases,
|
18442 |
+
dayAriaLabelFormat: undefined
|
18443 |
};
|
18444 |
|
18445 |
+
var DayPicker = function (_React$Component) {
|
18446 |
+
_inherits(DayPicker, _React$Component);
|
|
|
|
|
|
|
|
|
18447 |
|
18448 |
+
function DayPicker(props) {
|
18449 |
+
_classCallCheck(this, DayPicker);
|
|
|
|
|
|
|
|
|
|
|
18450 |
|
18451 |
+
var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
|
|
|
|
|
|
|
18452 |
|
18453 |
+
var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
|
|
|
|
|
|
|
|
|
|
|
|
|
18454 |
|
18455 |
+
var focusedDate = currentMonth.clone().startOf('month');
|
18456 |
+
if (props.getFirstFocusableDay) {
|
18457 |
+
focusedDate = props.getFirstFocusableDay(currentMonth);
|
18458 |
+
}
|
18459 |
|
18460 |
+
var horizontalMonthPadding = props.horizontalMonthPadding;
|
|
|
|
|
|
|
|
|
|
|
|
|
18461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18462 |
|
18463 |
+
var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
|
|
|
|
|
|
|
18464 |
|
18465 |
+
_this.hasSetInitialVisibleMonth = !props.hidden;
|
18466 |
+
_this.state = {
|
18467 |
+
currentMonth: currentMonth,
|
18468 |
+
monthTransition: null,
|
18469 |
+
translationValue: translationValue,
|
18470 |
+
scrollableMonthMultiple: 1,
|
18471 |
+
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
|
18472 |
+
focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
|
18473 |
+
nextFocusedDate: null,
|
18474 |
+
showKeyboardShortcuts: props.showKeyboardShortcuts,
|
18475 |
+
onKeyboardShortcutsPanelClose: function () {
|
18476 |
+
function onKeyboardShortcutsPanelClose() {}
|
18477 |
|
18478 |
+
return onKeyboardShortcutsPanelClose;
|
18479 |
+
}(),
|
|
|
|
|
|
|
|
|
18480 |
|
18481 |
+
isTouchDevice: (0, _isTouchDevice2['default'])(),
|
18482 |
+
withMouseInteractions: true,
|
18483 |
+
calendarInfoWidth: 0,
|
18484 |
+
monthTitleHeight: null,
|
18485 |
+
hasSetHeight: false
|
|
|
18486 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18487 |
|
18488 |
+
_this.setCalendarMonthWeeks(currentMonth);
|
|
|
|
|
|
|
18489 |
|
18490 |
+
_this.calendarMonthGridHeight = 0;
|
18491 |
+
_this.setCalendarInfoWidthTimeout = null;
|
|
|
18492 |
|
18493 |
+
_this.onKeyDown = _this.onKeyDown.bind(_this);
|
18494 |
+
_this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
|
18495 |
+
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
|
18496 |
+
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
|
18497 |
+
_this.onMonthChange = _this.onMonthChange.bind(_this);
|
18498 |
+
_this.onYearChange = _this.onYearChange.bind(_this);
|
18499 |
|
18500 |
+
_this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
|
18501 |
+
_this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
|
18502 |
|
18503 |
+
_this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
|
18504 |
+
_this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18505 |
|
18506 |
+
_this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
|
18507 |
+
_this.setContainerRef = _this.setContainerRef.bind(_this);
|
18508 |
+
_this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
|
18509 |
+
_this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
|
18510 |
+
return _this;
|
18511 |
+
}
|
18512 |
|
18513 |
+
_createClass(DayPicker, [{
|
18514 |
+
key: 'componentDidMount',
|
18515 |
+
value: function () {
|
18516 |
+
function componentDidMount() {
|
18517 |
+
var currentMonth = this.state.currentMonth;
|
18518 |
|
18519 |
+
if (this.calendarInfo) {
|
18520 |
+
this.setState({
|
18521 |
+
isTouchDevice: (0, _isTouchDevice2['default'])(),
|
18522 |
+
calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
|
18523 |
+
});
|
18524 |
+
} else {
|
18525 |
+
this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
|
18526 |
+
}
|
18527 |
|
18528 |
+
this.setCalendarMonthWeeks(currentMonth);
|
18529 |
+
}
|
18530 |
+
|
18531 |
+
return componentDidMount;
|
18532 |
+
}()
|
18533 |
+
}, {
|
18534 |
+
key: 'componentWillReceiveProps',
|
18535 |
+
value: function () {
|
18536 |
+
function componentWillReceiveProps(nextProps) {
|
18537 |
+
var hidden = nextProps.hidden,
|
18538 |
+
isFocused = nextProps.isFocused,
|
18539 |
+
showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
|
18540 |
+
onBlur = nextProps.onBlur,
|
18541 |
+
renderMonthText = nextProps.renderMonthText,
|
18542 |
+
horizontalMonthPadding = nextProps.horizontalMonthPadding;
|
18543 |
+
var currentMonth = this.state.currentMonth;
|
18544 |
|
18545 |
|
18546 |
+
if (!hidden) {
|
18547 |
+
if (!this.hasSetInitialVisibleMonth) {
|
18548 |
+
this.hasSetInitialVisibleMonth = true;
|
18549 |
+
this.setState({
|
18550 |
+
currentMonth: nextProps.initialVisibleMonth()
|
18551 |
+
});
|
18552 |
+
}
|
18553 |
+
}
|
|
|
|
|
|
|
|
|
18554 |
|
18555 |
+
var _props = this.props,
|
18556 |
+
daySize = _props.daySize,
|
18557 |
+
prevIsFocused = _props.isFocused,
|
18558 |
+
prevRenderMonthText = _props.renderMonthText;
|
|
|
|
|
|
|
|
|
18559 |
|
|
|
|
|
|
|
|
|
|
|
18560 |
|
18561 |
+
if (nextProps.daySize !== daySize) {
|
18562 |
+
this.setState({
|
18563 |
+
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
|
18564 |
+
});
|
18565 |
+
}
|
18566 |
|
18567 |
+
if (isFocused !== prevIsFocused) {
|
18568 |
+
if (isFocused) {
|
18569 |
+
var focusedDate = this.getFocusedDay(currentMonth);
|
18570 |
|
18571 |
+
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
|
|
|
|
|
|
|
|
|
18572 |
|
18573 |
+
if (nextProps.showKeyboardShortcuts) {
|
18574 |
+
// the ? shortcut came from the input and we should return input there once it is close
|
18575 |
+
onKeyboardShortcutsPanelClose = onBlur;
|
18576 |
+
}
|
18577 |
+
|
18578 |
+
this.setState({
|
18579 |
+
showKeyboardShortcuts: showKeyboardShortcuts,
|
18580 |
+
onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
|
18581 |
+
focusedDate: focusedDate,
|
18582 |
+
withMouseInteractions: false
|
18583 |
+
});
|
18584 |
+
} else {
|
18585 |
+
this.setState({ focusedDate: null });
|
18586 |
+
}
|
18587 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18588 |
|
18589 |
+
if (renderMonthText !== prevRenderMonthText) {
|
18590 |
+
this.setState({
|
18591 |
+
monthTitleHeight: null
|
18592 |
+
});
|
18593 |
+
}
|
18594 |
+
}
|
|
|
18595 |
|
18596 |
+
return componentWillReceiveProps;
|
18597 |
+
}()
|
18598 |
+
}, {
|
18599 |
+
key: 'shouldComponentUpdate',
|
18600 |
+
value: function () {
|
18601 |
+
function shouldComponentUpdate(nextProps, nextState) {
|
18602 |
+
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
|
18603 |
+
}
|
|
|
|
|
|
|
|
|
|
|
18604 |
|
18605 |
+
return shouldComponentUpdate;
|
18606 |
+
}()
|
18607 |
+
}, {
|
18608 |
+
key: 'componentWillUpdate',
|
18609 |
+
value: function () {
|
18610 |
+
function componentWillUpdate() {
|
18611 |
+
var _this2 = this;
|
18612 |
|
18613 |
+
var transitionDuration = this.props.transitionDuration;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18614 |
|
18615 |
+
// Calculating the dimensions trigger a DOM repaint which
|
18616 |
+
// breaks the CSS transition.
|
18617 |
+
// The setTimeout will wait until the transition ends.
|
18618 |
|
18619 |
+
if (this.calendarInfo) {
|
18620 |
+
this.setCalendarInfoWidthTimeout = setTimeout(function () {
|
18621 |
+
var calendarInfoWidth = _this2.state.calendarInfoWidth;
|
18622 |
|
18623 |
+
var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
|
18624 |
+
if (calendarInfoWidth !== calendarInfoPanelWidth) {
|
18625 |
+
_this2.setState({
|
18626 |
+
calendarInfoWidth: calendarInfoPanelWidth
|
18627 |
+
});
|
18628 |
+
}
|
18629 |
+
}, transitionDuration);
|
18630 |
+
}
|
18631 |
+
}
|
18632 |
|
18633 |
+
return componentWillUpdate;
|
18634 |
+
}()
|
18635 |
+
}, {
|
18636 |
+
key: 'componentDidUpdate',
|
18637 |
+
value: function () {
|
18638 |
+
function componentDidUpdate(prevProps) {
|
18639 |
+
var _props2 = this.props,
|
18640 |
+
orientation = _props2.orientation,
|
18641 |
+
daySize = _props2.daySize,
|
18642 |
+
isFocused = _props2.isFocused,
|
18643 |
+
numberOfMonths = _props2.numberOfMonths;
|
18644 |
+
var _state = this.state,
|
18645 |
+
focusedDate = _state.focusedDate,
|
18646 |
+
monthTitleHeight = _state.monthTitleHeight;
|
18647 |
|
|
|
|
|
|
|
18648 |
|
18649 |
+
if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
|
18650 |
+
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
|
18651 |
+
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
18652 |
+
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
|
18653 |
+
this.adjustDayPickerHeight(newMonthHeight);
|
18654 |
+
}
|
18655 |
|
18656 |
+
if (!prevProps.isFocused && isFocused && !focusedDate) {
|
18657 |
+
this.container.focus();
|
18658 |
+
}
|
18659 |
+
}
|
18660 |
|
18661 |
+
return componentDidUpdate;
|
18662 |
+
}()
|
18663 |
+
}, {
|
18664 |
+
key: 'componentWillUnmount',
|
18665 |
+
value: function () {
|
18666 |
+
function componentWillUnmount() {
|
18667 |
+
clearTimeout(this.setCalendarInfoWidthTimeout);
|
18668 |
+
}
|
18669 |
|
18670 |
+
return componentWillUnmount;
|
18671 |
+
}()
|
18672 |
+
}, {
|
18673 |
+
key: 'onKeyDown',
|
18674 |
+
value: function () {
|
18675 |
+
function onKeyDown(e) {
|
18676 |
+
e.stopPropagation();
|
18677 |
+
if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
|
18678 |
+
this.throttledKeyDown(e);
|
18679 |
+
}
|
18680 |
+
}
|
18681 |
|
18682 |
+
return onKeyDown;
|
18683 |
+
}()
|
18684 |
+
}, {
|
18685 |
+
key: 'onFinalKeyDown',
|
18686 |
+
value: function () {
|
18687 |
+
function onFinalKeyDown(e) {
|
18688 |
+
this.setState({ withMouseInteractions: false });
|
18689 |
|
18690 |
+
var _props3 = this.props,
|
18691 |
+
onBlur = _props3.onBlur,
|
18692 |
+
isRTL = _props3.isRTL;
|
18693 |
+
var _state2 = this.state,
|
18694 |
+
focusedDate = _state2.focusedDate,
|
18695 |
+
showKeyboardShortcuts = _state2.showKeyboardShortcuts;
|
18696 |
|
18697 |
+
if (!focusedDate) return;
|
|
|
|
|
|
|
18698 |
|
18699 |
+
var newFocusedDate = focusedDate.clone();
|
|
|
|
|
18700 |
|
18701 |
+
var didTransitionMonth = false;
|
|
|
|
|
18702 |
|
18703 |
+
// focus might be anywhere when the keyboard shortcuts panel is opened so we want to
|
18704 |
+
// return it to wherever it was before when the panel was opened
|
18705 |
+
var activeElement = (0, _getActiveElement2['default'])();
|
18706 |
+
var onKeyboardShortcutsPanelClose = function () {
|
18707 |
+
function onKeyboardShortcutsPanelClose() {
|
18708 |
+
if (activeElement) activeElement.focus();
|
18709 |
+
}
|
18710 |
|
18711 |
+
return onKeyboardShortcutsPanelClose;
|
18712 |
+
}();
|
|
|
|
|
|
|
|
|
|
|
|
|
18713 |
|
18714 |
+
switch (e.key) {
|
18715 |
+
case 'ArrowUp':
|
18716 |
+
e.preventDefault();
|
18717 |
+
newFocusedDate.subtract(1, 'week');
|
18718 |
+
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
18719 |
+
break;
|
18720 |
+
case 'ArrowLeft':
|
18721 |
+
e.preventDefault();
|
18722 |
+
if (isRTL) {
|
18723 |
+
newFocusedDate.add(1, 'day');
|
18724 |
+
} else {
|
18725 |
+
newFocusedDate.subtract(1, 'day');
|
18726 |
+
}
|
18727 |
+
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
18728 |
+
break;
|
18729 |
+
case 'Home':
|
18730 |
+
e.preventDefault();
|
18731 |
+
newFocusedDate.startOf('week');
|
18732 |
+
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
18733 |
+
break;
|
18734 |
+
case 'PageUp':
|
18735 |
+
e.preventDefault();
|
18736 |
+
newFocusedDate.subtract(1, 'month');
|
18737 |
+
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
|
18738 |
+
break;
|
18739 |
|
18740 |
+
case 'ArrowDown':
|
18741 |
+
e.preventDefault();
|
18742 |
+
newFocusedDate.add(1, 'week');
|
18743 |
+
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
18744 |
+
break;
|
18745 |
+
case 'ArrowRight':
|
18746 |
+
e.preventDefault();
|
18747 |
+
if (isRTL) {
|
18748 |
+
newFocusedDate.subtract(1, 'day');
|
18749 |
+
} else {
|
18750 |
+
newFocusedDate.add(1, 'day');
|
18751 |
+
}
|
18752 |
+
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
18753 |
+
break;
|
18754 |
+
case 'End':
|
18755 |
+
e.preventDefault();
|
18756 |
+
newFocusedDate.endOf('week');
|
18757 |
+
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
18758 |
+
break;
|
18759 |
+
case 'PageDown':
|
18760 |
+
e.preventDefault();
|
18761 |
+
newFocusedDate.add(1, 'month');
|
18762 |
+
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
|
18763 |
+
break;
|
18764 |
|
18765 |
+
case '?':
|
18766 |
+
this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
|
18767 |
+
break;
|
18768 |
|
18769 |
+
case 'Escape':
|
18770 |
+
if (showKeyboardShortcuts) {
|
18771 |
+
this.closeKeyboardShortcutsPanel();
|
18772 |
+
} else {
|
18773 |
+
onBlur();
|
18774 |
+
}
|
18775 |
+
break;
|
18776 |
|
18777 |
+
default:
|
18778 |
+
break;
|
18779 |
+
}
|
18780 |
|
18781 |
+
// If there was a month transition, do not update the focused date until the transition has
|
18782 |
+
// completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
|
18783 |
+
// didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
|
18784 |
+
if (!didTransitionMonth) {
|
18785 |
+
this.setState({
|
18786 |
+
focusedDate: newFocusedDate
|
18787 |
+
});
|
18788 |
+
}
|
18789 |
+
}
|
18790 |
|
18791 |
+
return onFinalKeyDown;
|
18792 |
+
}()
|
18793 |
+
}, {
|
18794 |
+
key: 'onPrevMonthClick',
|
18795 |
+
value: function () {
|
18796 |
+
function onPrevMonthClick(nextFocusedDate, e) {
|
18797 |
+
var _props4 = this.props,
|
18798 |
+
daySize = _props4.daySize,
|
18799 |
+
isRTL = _props4.isRTL,
|
18800 |
+
numberOfMonths = _props4.numberOfMonths;
|
18801 |
+
var _state3 = this.state,
|
18802 |
+
calendarMonthWidth = _state3.calendarMonthWidth,
|
18803 |
+
monthTitleHeight = _state3.monthTitleHeight;
|
18804 |
|
|
|
|
|
|
|
18805 |
|
18806 |
+
if (e) e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18807 |
|
18808 |
+
var translationValue = void 0;
|
18809 |
+
if (this.isVertical()) {
|
18810 |
+
var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
|
18811 |
+
translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
|
18812 |
+
} else if (this.isHorizontal()) {
|
18813 |
+
translationValue = calendarMonthWidth;
|
18814 |
+
if (isRTL) {
|
18815 |
+
translationValue = -2 * calendarMonthWidth;
|
18816 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18817 |
|
18818 |
+
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
|
18819 |
+
var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
18820 |
+
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
|
18821 |
+
this.adjustDayPickerHeight(newMonthHeight);
|
18822 |
+
}
|
|
|
|
|
18823 |
|
18824 |
+
this.setState({
|
18825 |
+
monthTransition: PREV_TRANSITION,
|
18826 |
+
translationValue: translationValue,
|
18827 |
+
focusedDate: null,
|
18828 |
+
nextFocusedDate: nextFocusedDate
|
18829 |
+
});
|
18830 |
+
}
|
|
|
|
|
|
|
|
|
18831 |
|
18832 |
+
return onPrevMonthClick;
|
18833 |
+
}()
|
18834 |
+
}, {
|
18835 |
+
key: 'onMonthChange',
|
18836 |
+
value: function () {
|
18837 |
+
function onMonthChange(currentMonth) {
|
18838 |
+
this.setCalendarMonthWeeks(currentMonth);
|
18839 |
+
this.calculateAndSetDayPickerHeight();
|
18840 |
|
18841 |
+
// Translation value is a hack to force an invisible transition that
|
18842 |
+
// properly rerenders the CalendarMonthGrid
|
18843 |
+
this.setState({
|
18844 |
+
monthTransition: MONTH_SELECTION_TRANSITION,
|
18845 |
+
translationValue: 0.00001,
|
18846 |
+
focusedDate: null,
|
18847 |
+
nextFocusedDate: currentMonth,
|
18848 |
+
currentMonth: currentMonth
|
18849 |
+
});
|
18850 |
+
}
|
18851 |
|
18852 |
+
return onMonthChange;
|
18853 |
+
}()
|
18854 |
+
}, {
|
18855 |
+
key: 'onYearChange',
|
18856 |
+
value: function () {
|
18857 |
+
function onYearChange(currentMonth) {
|
18858 |
+
this.setCalendarMonthWeeks(currentMonth);
|
18859 |
+
this.calculateAndSetDayPickerHeight();
|
18860 |
|
18861 |
+
// Translation value is a hack to force an invisible transition that
|
18862 |
+
// properly rerenders the CalendarMonthGrid
|
18863 |
+
this.setState({
|
18864 |
+
monthTransition: YEAR_SELECTION_TRANSITION,
|
18865 |
+
translationValue: 0.0001,
|
18866 |
+
focusedDate: null,
|
18867 |
+
nextFocusedDate: currentMonth,
|
18868 |
+
currentMonth: currentMonth
|
18869 |
+
});
|
18870 |
+
}
|
18871 |
|
18872 |
+
return onYearChange;
|
18873 |
+
}()
|
18874 |
+
}, {
|
18875 |
+
key: 'onNextMonthClick',
|
18876 |
+
value: function () {
|
18877 |
+
function onNextMonthClick(nextFocusedDate, e) {
|
18878 |
+
var _props5 = this.props,
|
18879 |
+
isRTL = _props5.isRTL,
|
18880 |
+
numberOfMonths = _props5.numberOfMonths,
|
18881 |
+
daySize = _props5.daySize;
|
18882 |
+
var _state4 = this.state,
|
18883 |
+
calendarMonthWidth = _state4.calendarMonthWidth,
|
18884 |
+
monthTitleHeight = _state4.monthTitleHeight;
|
|
|
|
|
18885 |
|
|
|
|
|
|
|
18886 |
|
18887 |
+
if (e) e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18888 |
|
18889 |
+
var translationValue = void 0;
|
|
|
|
|
|
|
|
|
18890 |
|
18891 |
+
if (this.isVertical()) {
|
18892 |
+
var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
|
18893 |
+
var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
|
18894 |
+
translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
|
18895 |
+
}
|
18896 |
|
18897 |
+
if (this.isHorizontal()) {
|
18898 |
+
translationValue = -calendarMonthWidth;
|
18899 |
+
if (isRTL) {
|
18900 |
+
translationValue = 0;
|
18901 |
+
}
|
18902 |
|
18903 |
+
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
|
18904 |
+
var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
18905 |
+
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
|
18906 |
+
this.adjustDayPickerHeight(newMonthHeight);
|
18907 |
+
}
|
18908 |
|
18909 |
+
this.setState({
|
18910 |
+
monthTransition: NEXT_TRANSITION,
|
18911 |
+
translationValue: translationValue,
|
18912 |
+
focusedDate: null,
|
18913 |
+
nextFocusedDate: nextFocusedDate
|
18914 |
+
});
|
18915 |
+
}
|
|
|
18916 |
|
18917 |
+
return onNextMonthClick;
|
18918 |
+
}()
|
18919 |
+
}, {
|
18920 |
+
key: 'getFirstDayOfWeek',
|
18921 |
+
value: function () {
|
18922 |
+
function getFirstDayOfWeek() {
|
18923 |
+
var firstDayOfWeek = this.props.firstDayOfWeek;
|
18924 |
|
18925 |
+
if (firstDayOfWeek == null) {
|
18926 |
+
return _moment2['default'].localeData().firstDayOfWeek();
|
18927 |
+
}
|
18928 |
|
18929 |
+
return firstDayOfWeek;
|
18930 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18931 |
|
18932 |
+
return getFirstDayOfWeek;
|
18933 |
+
}()
|
18934 |
+
}, {
|
18935 |
+
key: 'getFirstVisibleIndex',
|
18936 |
+
value: function () {
|
18937 |
+
function getFirstVisibleIndex() {
|
18938 |
+
var orientation = this.props.orientation;
|
18939 |
+
var monthTransition = this.state.monthTransition;
|
|
|
18940 |
|
|
|
|
|
|
|
|
|
18941 |
|
18942 |
+
if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
|
|
|
|
|
|
|
18943 |
|
18944 |
+
var firstVisibleMonthIndex = 1;
|
18945 |
+
if (monthTransition === PREV_TRANSITION) {
|
18946 |
+
firstVisibleMonthIndex -= 1;
|
18947 |
+
} else if (monthTransition === NEXT_TRANSITION) {
|
18948 |
+
firstVisibleMonthIndex += 1;
|
18949 |
+
}
|
18950 |
|
18951 |
+
return firstVisibleMonthIndex;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18952 |
}
|
|
|
|
|
18953 |
|
18954 |
+
return getFirstVisibleIndex;
|
18955 |
+
}()
|
18956 |
+
}, {
|
18957 |
+
key: 'getFocusedDay',
|
18958 |
+
value: function () {
|
18959 |
+
function getFocusedDay(newMonth) {
|
18960 |
+
var _props6 = this.props,
|
18961 |
+
getFirstFocusableDay = _props6.getFirstFocusableDay,
|
18962 |
+
numberOfMonths = _props6.numberOfMonths;
|
18963 |
|
|
|
|
|
|
|
|
|
|
|
18964 |
|
18965 |
+
var focusedDate = void 0;
|
18966 |
+
if (getFirstFocusableDay) {
|
18967 |
+
focusedDate = getFirstFocusableDay(newMonth);
|
18968 |
+
}
|
|
|
|
|
|
|
18969 |
|
18970 |
+
if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
|
18971 |
+
focusedDate = newMonth.clone().startOf('month');
|
18972 |
+
}
|
18973 |
|
18974 |
+
return focusedDate;
|
18975 |
+
}
|
|
|
|
|
18976 |
|
18977 |
+
return getFocusedDay;
|
18978 |
+
}()
|
18979 |
+
}, {
|
18980 |
+
key: 'setMonthTitleHeight',
|
18981 |
+
value: function () {
|
18982 |
+
function setMonthTitleHeight(monthTitleHeight) {
|
18983 |
+
var _this3 = this;
|
18984 |
|
18985 |
+
this.setState({
|
18986 |
+
monthTitleHeight: monthTitleHeight
|
18987 |
+
}, function () {
|
18988 |
+
_this3.calculateAndSetDayPickerHeight();
|
18989 |
+
});
|
18990 |
+
}
|
18991 |
|
18992 |
+
return setMonthTitleHeight;
|
18993 |
+
}()
|
18994 |
+
}, {
|
18995 |
+
key: 'setCalendarMonthWeeks',
|
18996 |
+
value: function () {
|
18997 |
+
function setCalendarMonthWeeks(currentMonth) {
|
18998 |
+
var numberOfMonths = this.props.numberOfMonths;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18999 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19000 |
|
19001 |
+
this.calendarMonthWeeks = [];
|
19002 |
+
var month = currentMonth.clone().subtract(1, 'months');
|
19003 |
+
var firstDayOfWeek = this.getFirstDayOfWeek();
|
19004 |
+
for (var i = 0; i < numberOfMonths + 2; i += 1) {
|
19005 |
+
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
|
19006 |
+
this.calendarMonthWeeks.push(numberOfWeeks);
|
19007 |
+
month = month.add(1, 'months');
|
19008 |
+
}
|
19009 |
+
}
|
19010 |
|
19011 |
+
return setCalendarMonthWeeks;
|
19012 |
+
}()
|
19013 |
+
}, {
|
19014 |
+
key: 'setContainerRef',
|
19015 |
+
value: function () {
|
19016 |
+
function setContainerRef(ref) {
|
19017 |
+
this.container = ref;
|
19018 |
+
}
|
19019 |
|
19020 |
+
return setContainerRef;
|
19021 |
+
}()
|
19022 |
+
}, {
|
19023 |
+
key: 'setCalendarInfoRef',
|
19024 |
+
value: function () {
|
19025 |
+
function setCalendarInfoRef(ref) {
|
19026 |
+
this.calendarInfo = ref;
|
19027 |
+
}
|
19028 |
|
19029 |
+
return setCalendarInfoRef;
|
19030 |
+
}()
|
19031 |
+
}, {
|
19032 |
+
key: 'setTransitionContainerRef',
|
19033 |
+
value: function () {
|
19034 |
+
function setTransitionContainerRef(ref) {
|
19035 |
+
this.transitionContainer = ref;
|
19036 |
}
|
|
|
19037 |
|
19038 |
+
return setTransitionContainerRef;
|
19039 |
+
}()
|
19040 |
+
}, {
|
19041 |
+
key: 'maybeTransitionNextMonth',
|
19042 |
+
value: function () {
|
19043 |
+
function maybeTransitionNextMonth(newFocusedDate) {
|
19044 |
+
var numberOfMonths = this.props.numberOfMonths;
|
19045 |
+
var _state5 = this.state,
|
19046 |
+
currentMonth = _state5.currentMonth,
|
19047 |
+
focusedDate = _state5.focusedDate;
|
19048 |
|
|
|
|
|
|
|
19049 |
|
19050 |
+
var newFocusedDateMonth = newFocusedDate.month();
|
19051 |
+
var focusedDateMonth = focusedDate.month();
|
19052 |
+
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
|
19053 |
+
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
|
19054 |
+
this.onNextMonthClick(newFocusedDate);
|
19055 |
+
return true;
|
19056 |
+
}
|
|
|
|
|
|
|
19057 |
|
19058 |
+
return false;
|
19059 |
+
}
|
|
|
19060 |
|
19061 |
+
return maybeTransitionNextMonth;
|
19062 |
+
}()
|
19063 |
+
}, {
|
19064 |
+
key: 'maybeTransitionPrevMonth',
|
19065 |
+
value: function () {
|
19066 |
+
function maybeTransitionPrevMonth(newFocusedDate) {
|
19067 |
+
var numberOfMonths = this.props.numberOfMonths;
|
19068 |
+
var _state6 = this.state,
|
19069 |
+
currentMonth = _state6.currentMonth,
|
19070 |
+
focusedDate = _state6.focusedDate;
|
19071 |
|
19072 |
|
19073 |
+
var newFocusedDateMonth = newFocusedDate.month();
|
19074 |
+
var focusedDateMonth = focusedDate.month();
|
19075 |
+
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
|
19076 |
+
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
|
19077 |
+
this.onPrevMonthClick(newFocusedDate);
|
19078 |
+
return true;
|
19079 |
+
}
|
19080 |
|
19081 |
+
return false;
|
19082 |
+
}
|
|
|
19083 |
|
19084 |
+
return maybeTransitionPrevMonth;
|
19085 |
+
}()
|
19086 |
+
}, {
|
19087 |
+
key: 'multiplyScrollableMonths',
|
19088 |
+
value: function () {
|
19089 |
+
function multiplyScrollableMonths(e) {
|
19090 |
+
var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
|
19091 |
|
19092 |
+
if (e) e.preventDefault();
|
19093 |
|
19094 |
+
if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
|
|
|
|
|
|
|
|
|
|
|
19095 |
|
19096 |
+
this.setState(function (_ref) {
|
19097 |
+
var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
|
19098 |
+
return {
|
19099 |
+
scrollableMonthMultiple: scrollableMonthMultiple + 1
|
19100 |
+
};
|
19101 |
+
});
|
19102 |
+
}
|
19103 |
|
19104 |
+
return multiplyScrollableMonths;
|
19105 |
+
}()
|
19106 |
+
}, {
|
19107 |
+
key: 'isHorizontal',
|
19108 |
+
value: function () {
|
19109 |
+
function isHorizontal() {
|
19110 |
+
var orientation = this.props.orientation;
|
19111 |
|
19112 |
+
return orientation === _constants.HORIZONTAL_ORIENTATION;
|
19113 |
+
}
|
19114 |
|
19115 |
+
return isHorizontal;
|
19116 |
+
}()
|
19117 |
+
}, {
|
19118 |
+
key: 'isVertical',
|
19119 |
+
value: function () {
|
19120 |
+
function isVertical() {
|
19121 |
+
var orientation = this.props.orientation;
|
19122 |
|
19123 |
+
return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
|
19124 |
+
}
|
|
|
|
|
|
|
|
|
|
|
19125 |
|
19126 |
+
return isVertical;
|
19127 |
+
}()
|
19128 |
+
}, {
|
19129 |
+
key: 'updateStateAfterMonthTransition',
|
19130 |
+
value: function () {
|
19131 |
+
function updateStateAfterMonthTransition() {
|
19132 |
+
var _this4 = this;
|
19133 |
|
19134 |
+
var _props7 = this.props,
|
19135 |
+
onPrevMonthClick = _props7.onPrevMonthClick,
|
19136 |
+
onNextMonthClick = _props7.onNextMonthClick,
|
19137 |
+
numberOfMonths = _props7.numberOfMonths,
|
19138 |
+
onMonthChange = _props7.onMonthChange,
|
19139 |
+
onYearChange = _props7.onYearChange,
|
19140 |
+
isRTL = _props7.isRTL;
|
19141 |
+
var _state7 = this.state,
|
19142 |
+
currentMonth = _state7.currentMonth,
|
19143 |
+
monthTransition = _state7.monthTransition,
|
19144 |
+
focusedDate = _state7.focusedDate,
|
19145 |
+
nextFocusedDate = _state7.nextFocusedDate,
|
19146 |
+
withMouseInteractions = _state7.withMouseInteractions,
|
19147 |
+
calendarMonthWidth = _state7.calendarMonthWidth;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19148 |
|
|
|
|
|
|
|
|
|
|
|
19149 |
|
19150 |
+
if (!monthTransition) return;
|
|
|
19151 |
|
19152 |
+
var newMonth = currentMonth.clone();
|
19153 |
+
var firstDayOfWeek = this.getFirstDayOfWeek();
|
19154 |
+
if (monthTransition === PREV_TRANSITION) {
|
19155 |
+
newMonth.subtract(1, 'month');
|
19156 |
+
if (onPrevMonthClick) onPrevMonthClick(newMonth);
|
19157 |
+
var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
|
19158 |
+
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
|
19159 |
+
this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
|
19160 |
+
} else if (monthTransition === NEXT_TRANSITION) {
|
19161 |
+
newMonth.add(1, 'month');
|
19162 |
+
if (onNextMonthClick) onNextMonthClick(newMonth);
|
19163 |
+
var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
|
19164 |
+
var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
|
19165 |
+
this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
|
19166 |
+
} else if (monthTransition === MONTH_SELECTION_TRANSITION) {
|
19167 |
+
if (onMonthChange) onMonthChange(newMonth);
|
19168 |
+
} else if (monthTransition === YEAR_SELECTION_TRANSITION) {
|
19169 |
+
if (onYearChange) onYearChange(newMonth);
|
19170 |
+
}
|
19171 |
|
19172 |
+
var newFocusedDate = null;
|
19173 |
+
if (nextFocusedDate) {
|
19174 |
+
newFocusedDate = nextFocusedDate;
|
19175 |
+
} else if (!focusedDate && !withMouseInteractions) {
|
19176 |
+
newFocusedDate = this.getFocusedDay(newMonth);
|
19177 |
+
}
|
19178 |
|
19179 |
+
this.setState({
|
19180 |
+
currentMonth: newMonth,
|
19181 |
+
monthTransition: null,
|
19182 |
+
translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
|
19183 |
+
nextFocusedDate: null,
|
19184 |
+
focusedDate: newFocusedDate
|
19185 |
+
}, function () {
|
19186 |
+
// we don't want to focus on the relevant calendar day after a month transition
|
19187 |
+
// if the user is navigating around using a mouse
|
19188 |
+
if (withMouseInteractions) {
|
19189 |
+
var activeElement = (0, _getActiveElement2['default'])();
|
19190 |
+
if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
|
19191 |
+
activeElement.blur();
|
19192 |
+
}
|
19193 |
}
|
19194 |
+
});
|
|
|
|
|
|
|
|
|
19195 |
}
|
|
|
|
|
|
|
19196 |
|
19197 |
+
return updateStateAfterMonthTransition;
|
19198 |
+
}()
|
19199 |
+
}, {
|
19200 |
+
key: 'adjustDayPickerHeight',
|
19201 |
+
value: function () {
|
19202 |
+
function adjustDayPickerHeight(newMonthHeight) {
|
19203 |
+
var _this5 = this;
|
19204 |
|
19205 |
+
var monthHeight = newMonthHeight + MONTH_PADDING;
|
19206 |
+
if (monthHeight !== this.calendarMonthGridHeight) {
|
19207 |
+
this.transitionContainer.style.height = String(monthHeight) + 'px';
|
19208 |
+
if (!this.calendarMonthGridHeight) {
|
19209 |
+
setTimeout(function () {
|
19210 |
+
_this5.setState({ hasSetHeight: true });
|
19211 |
+
}, 0);
|
19212 |
+
}
|
19213 |
+
this.calendarMonthGridHeight = monthHeight;
|
19214 |
+
}
|
19215 |
}
|
19216 |
|
19217 |
+
return adjustDayPickerHeight;
|
19218 |
+
}()
|
19219 |
+
}, {
|
19220 |
+
key: 'calculateAndSetDayPickerHeight',
|
19221 |
+
value: function () {
|
19222 |
+
function calculateAndSetDayPickerHeight() {
|
19223 |
+
var _props8 = this.props,
|
19224 |
+
daySize = _props8.daySize,
|
19225 |
+
numberOfMonths = _props8.numberOfMonths;
|
19226 |
+
var monthTitleHeight = this.state.monthTitleHeight;
|
19227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19228 |
|
19229 |
+
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
|
19230 |
+
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
|
19231 |
+
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
|
19232 |
|
19233 |
+
if (this.isHorizontal()) {
|
19234 |
+
this.adjustDayPickerHeight(newMonthHeight);
|
19235 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19236 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19237 |
|
19238 |
+
return calculateAndSetDayPickerHeight;
|
19239 |
+
}()
|
19240 |
+
}, {
|
19241 |
+
key: 'openKeyboardShortcutsPanel',
|
19242 |
+
value: function () {
|
19243 |
+
function openKeyboardShortcutsPanel(onCloseCallBack) {
|
19244 |
+
this.setState({
|
19245 |
+
showKeyboardShortcuts: true,
|
19246 |
+
onKeyboardShortcutsPanelClose: onCloseCallBack
|
19247 |
+
});
|
19248 |
}
|
|
|
19249 |
|
19250 |
+
return openKeyboardShortcutsPanel;
|
19251 |
+
}()
|
19252 |
+
}, {
|
19253 |
+
key: 'closeKeyboardShortcutsPanel',
|
19254 |
+
value: function () {
|
19255 |
+
function closeKeyboardShortcutsPanel() {
|
19256 |
+
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
|
19257 |
|
|
|
|
|
|
|
19258 |
|
19259 |
+
if (onKeyboardShortcutsPanelClose) {
|
19260 |
+
onKeyboardShortcutsPanelClose();
|
19261 |
+
}
|
19262 |
|
19263 |
+
this.setState({
|
19264 |
+
onKeyboardShortcutsPanelClose: null,
|
19265 |
+
showKeyboardShortcuts: false
|
19266 |
+
});
|
19267 |
+
}
|
19268 |
|
19269 |
+
return closeKeyboardShortcutsPanel;
|
19270 |
+
}()
|
19271 |
+
}, {
|
19272 |
+
key: 'renderNavigation',
|
19273 |
+
value: function () {
|
19274 |
+
function renderNavigation() {
|
19275 |
+
var _this6 = this;
|
19276 |
|
19277 |
+
var _props9 = this.props,
|
19278 |
+
navPrev = _props9.navPrev,
|
19279 |
+
navNext = _props9.navNext,
|
19280 |
+
noNavButtons = _props9.noNavButtons,
|
19281 |
+
orientation = _props9.orientation,
|
19282 |
+
phrases = _props9.phrases,
|
19283 |
+
isRTL = _props9.isRTL;
|
19284 |
|
|
|
|
|
|
|
19285 |
|
19286 |
+
if (noNavButtons) {
|
19287 |
+
return null;
|
19288 |
+
}
|
19289 |
|
19290 |
+
var onNextMonthClick = void 0;
|
19291 |
+
if (orientation === _constants.VERTICAL_SCROLLABLE) {
|
19292 |
+
onNextMonthClick = this.multiplyScrollableMonths;
|
19293 |
+
} else {
|
19294 |
+
onNextMonthClick = function () {
|
19295 |
+
function onNextMonthClick(e) {
|
19296 |
+
_this6.onNextMonthClick(null, e);
|
19297 |
+
}
|
19298 |
|
19299 |
+
return onNextMonthClick;
|
19300 |
+
}();
|
19301 |
+
}
|
19302 |
|
19303 |
+
return _react2['default'].createElement(_DayPickerNavigation2['default'], {
|
19304 |
+
onPrevMonthClick: function () {
|
19305 |
+
function onPrevMonthClick(e) {
|
19306 |
+
_this6.onPrevMonthClick(null, e);
|
19307 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19308 |
|
19309 |
+
return onPrevMonthClick;
|
19310 |
+
}(),
|
19311 |
+
onNextMonthClick: onNextMonthClick,
|
19312 |
+
navPrev: navPrev,
|
19313 |
+
navNext: navNext,
|
19314 |
+
orientation: orientation,
|
19315 |
+
phrases: phrases,
|
19316 |
+
isRTL: isRTL
|
19317 |
+
});
|
19318 |
+
}
|
|
|
|
|
19319 |
|
19320 |
+
return renderNavigation;
|
19321 |
+
}()
|
19322 |
+
}, {
|
19323 |
+
key: 'renderWeekHeader',
|
19324 |
+
value: function () {
|
19325 |
+
function renderWeekHeader(index) {
|
19326 |
+
var _props10 = this.props,
|
19327 |
+
daySize = _props10.daySize,
|
19328 |
+
horizontalMonthPadding = _props10.horizontalMonthPadding,
|
19329 |
+
orientation = _props10.orientation,
|
19330 |
+
weekDayFormat = _props10.weekDayFormat,
|
19331 |
+
styles = _props10.styles;
|
19332 |
+
var calendarMonthWidth = this.state.calendarMonthWidth;
|
19333 |
|
19334 |
+
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
|
19335 |
+
var horizontalStyle = {
|
19336 |
+
left: index * calendarMonthWidth
|
19337 |
+
};
|
19338 |
+
var verticalStyle = {
|
19339 |
+
marginLeft: -calendarMonthWidth / 2
|
19340 |
+
};
|
19341 |
|
19342 |
+
var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
|
19343 |
+
if (this.isHorizontal()) {
|
19344 |
+
weekHeaderStyle = horizontalStyle;
|
19345 |
+
} else if (this.isVertical() && !verticalScrollable) {
|
19346 |
+
weekHeaderStyle = verticalStyle;
|
19347 |
+
}
|
19348 |
|
19349 |
+
var firstDayOfWeek = this.getFirstDayOfWeek();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19350 |
|
19351 |
+
var header = [];
|
19352 |
+
for (var i = 0; i < 7; i += 1) {
|
19353 |
+
header.push(_react2['default'].createElement(
|
19354 |
+
'li',
|
19355 |
+
_extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })),
|
19356 |
+
_react2['default'].createElement(
|
19357 |
+
'small',
|
19358 |
+
null,
|
19359 |
+
(0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
|
19360 |
+
)
|
19361 |
+
));
|
19362 |
+
}
|
19363 |
|
19364 |
+
return _react2['default'].createElement(
|
19365 |
+
'div',
|
19366 |
+
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
|
19367 |
+
key: 'week-' + String(index)
|
19368 |
+
}),
|
19369 |
+
_react2['default'].createElement(
|
19370 |
+
'ul',
|
19371 |
+
(0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
|
19372 |
+
header
|
19373 |
+
)
|
19374 |
+
);
|
19375 |
+
}
|
19376 |
|
19377 |
+
return renderWeekHeader;
|
19378 |
+
}()
|
19379 |
+
}, {
|
19380 |
+
key: 'render',
|
19381 |
+
value: function () {
|
19382 |
+
function render() {
|
19383 |
+
var _this7 = this;
|
19384 |
|
19385 |
+
var _state8 = this.state,
|
19386 |
+
calendarMonthWidth = _state8.calendarMonthWidth,
|
19387 |
+
currentMonth = _state8.currentMonth,
|
19388 |
+
monthTransition = _state8.monthTransition,
|
19389 |
+
translationValue = _state8.translationValue,
|
19390 |
+
scrollableMonthMultiple = _state8.scrollableMonthMultiple,
|
19391 |
+
focusedDate = _state8.focusedDate,
|
19392 |
+
showKeyboardShortcuts = _state8.showKeyboardShortcuts,
|
19393 |
+
isTouch = _state8.isTouchDevice,
|
19394 |
+
hasSetHeight = _state8.hasSetHeight,
|
19395 |
+
calendarInfoWidth = _state8.calendarInfoWidth,
|
19396 |
+
monthTitleHeight = _state8.monthTitleHeight;
|
19397 |
+
var _props11 = this.props,
|
19398 |
+
enableOutsideDays = _props11.enableOutsideDays,
|
19399 |
+
numberOfMonths = _props11.numberOfMonths,
|
19400 |
+
orientation = _props11.orientation,
|
19401 |
+
modifiers = _props11.modifiers,
|
19402 |
+
withPortal = _props11.withPortal,
|
19403 |
+
onDayClick = _props11.onDayClick,
|
19404 |
+
onDayMouseEnter = _props11.onDayMouseEnter,
|
19405 |
+
onDayMouseLeave = _props11.onDayMouseLeave,
|
19406 |
+
firstDayOfWeek = _props11.firstDayOfWeek,
|
19407 |
+
renderMonthText = _props11.renderMonthText,
|
19408 |
+
renderCalendarDay = _props11.renderCalendarDay,
|
19409 |
+
renderDayContents = _props11.renderDayContents,
|
19410 |
+
renderCalendarInfo = _props11.renderCalendarInfo,
|
19411 |
+
renderMonthElement = _props11.renderMonthElement,
|
19412 |
+
calendarInfoPosition = _props11.calendarInfoPosition,
|
19413 |
+
hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
|
19414 |
+
onOutsideClick = _props11.onOutsideClick,
|
19415 |
+
monthFormat = _props11.monthFormat,
|
19416 |
+
daySize = _props11.daySize,
|
19417 |
+
isFocused = _props11.isFocused,
|
19418 |
+
isRTL = _props11.isRTL,
|
19419 |
+
styles = _props11.styles,
|
19420 |
+
theme = _props11.theme,
|
19421 |
+
phrases = _props11.phrases,
|
19422 |
+
verticalHeight = _props11.verticalHeight,
|
19423 |
+
dayAriaLabelFormat = _props11.dayAriaLabelFormat,
|
19424 |
+
noBorder = _props11.noBorder,
|
19425 |
+
transitionDuration = _props11.transitionDuration,
|
19426 |
+
verticalBorderSpacing = _props11.verticalBorderSpacing,
|
19427 |
+
horizontalMonthPadding = _props11.horizontalMonthPadding;
|
19428 |
+
var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
|
19429 |
|
|
|
|
|
|
|
|
|
19430 |
|
19431 |
+
var isHorizontal = this.isHorizontal();
|
|
|
|
|
19432 |
|
19433 |
+
var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
|
19434 |
+
var weekHeaders = [];
|
19435 |
+
for (var i = 0; i < numOfWeekHeaders; i += 1) {
|
19436 |
+
weekHeaders.push(this.renderWeekHeader(i));
|
19437 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19438 |
|
19439 |
+
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
|
19440 |
+
var height = void 0;
|
19441 |
+
if (isHorizontal) {
|
19442 |
+
height = this.calendarMonthGridHeight;
|
19443 |
+
} else if (this.isVertical() && !verticalScrollable && !withPortal) {
|
19444 |
+
// If the user doesn't set a desired height,
|
19445 |
+
// we default back to this kind of made-up value that generally looks good
|
19446 |
+
height = verticalHeight || 1.75 * calendarMonthWidth;
|
19447 |
+
}
|
19448 |
|
19449 |
+
var isCalendarMonthGridAnimating = monthTransition !== null;
|
19450 |
|
19451 |
+
var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
|
19452 |
|
19453 |
+
var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
|
19454 |
+
if (this.isVertical()) {
|
19455 |
+
keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
|
19456 |
+
}
|
19457 |
|
19458 |
+
var shouldAnimateHeight = isHorizontal && hasSetHeight;
|
19459 |
|
19460 |
+
var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
|
19461 |
+
var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
|
19462 |
+
var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
|
19463 |
+
var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
|
19464 |
+
var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
|
19465 |
|
19466 |
+
var calendarInfo = renderCalendarInfo && _react2['default'].createElement(
|
19467 |
+
'div',
|
19468 |
+
_extends({
|
19469 |
+
ref: this.setCalendarInfoRef
|
19470 |
+
}, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
|
19471 |
+
renderCalendarInfo()
|
19472 |
+
);
|
19473 |
|
19474 |
+
var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
|
19475 |
|
19476 |
+
var firstVisibleMonthIndex = this.getFirstVisibleIndex();
|
19477 |
+
var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding;
|
19478 |
+
// Adding `1px` because of whitespace between 2 inline-block
|
19479 |
+
var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
|
19480 |
|
19481 |
+
var transitionContainerStyle = {
|
19482 |
+
width: isHorizontal && wrapperHorizontalWidth,
|
19483 |
+
height: height
|
19484 |
+
};
|
19485 |
|
19486 |
+
var dayPickerWrapperStyle = {
|
19487 |
+
width: isHorizontal && wrapperHorizontalWidth
|
19488 |
+
};
|
19489 |
|
19490 |
+
var dayPickerStyle = {
|
19491 |
+
width: isHorizontal && fullHorizontalWidth,
|
19492 |
|
19493 |
+
// These values are to center the datepicker (approximately) on the page
|
19494 |
+
marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
|
19495 |
+
marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
|
19496 |
+
};
|
|
|
|
|
19497 |
|
19498 |
+
return _react2['default'].createElement(
|
19499 |
+
'div',
|
19500 |
+
_extends({
|
19501 |
+
role: 'application',
|
19502 |
+
'aria-label': phrases.calendarLabel
|
19503 |
+
}, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
|
19504 |
+
_react2['default'].createElement(
|
19505 |
+
_reactOutsideClickHandler2['default'],
|
19506 |
+
{ onOutsideClick: onOutsideClick },
|
19507 |
+
(calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
|
19508 |
+
_react2['default'].createElement(
|
19509 |
+
'div',
|
19510 |
+
(0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
|
19511 |
+
_react2['default'].createElement(
|
19512 |
+
'div',
|
19513 |
+
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
|
19514 |
+
'aria-hidden': 'true',
|
19515 |
+
role: 'presentation'
|
19516 |
+
}),
|
19517 |
+
weekHeaders
|
19518 |
+
),
|
19519 |
+
_react2['default'].createElement(
|
19520 |
+
'div',
|
19521 |
+
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
|
19522 |
+
ref: this.setContainerRef,
|
19523 |
+
onClick: function () {
|
19524 |
+
function onClick(e) {
|
19525 |
+
e.stopPropagation();
|
19526 |
+
}
|
|
|
|
|
|
|
|
|
19527 |
|
19528 |
+
return onClick;
|
19529 |
+
}(),
|
19530 |
+
onKeyDown: this.onKeyDown,
|
19531 |
+
onMouseUp: function () {
|
19532 |
+
function onMouseUp() {
|
19533 |
+
_this7.setState({ withMouseInteractions: true });
|
19534 |
+
}
|
19535 |
|
19536 |
+
return onMouseUp;
|
19537 |
+
}(),
|
19538 |
+
role: 'region',
|
19539 |
+
tabIndex: -1
|
19540 |
+
}),
|
19541 |
+
!verticalScrollable && this.renderNavigation(),
|
19542 |
+
_react2['default'].createElement(
|
19543 |
+
'div',
|
19544 |
+
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
|
19545 |
+
ref: this.setTransitionContainerRef
|
19546 |
+
}),
|
19547 |
+
_react2['default'].createElement(_CalendarMonthGrid2['default'], {
|
19548 |
+
setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
|
19549 |
+
translationValue: translationValue,
|
19550 |
+
enableOutsideDays: enableOutsideDays,
|
19551 |
+
firstVisibleMonthIndex: firstVisibleMonthIndex,
|
19552 |
+
initialMonth: currentMonth,
|
19553 |
+
isAnimating: isCalendarMonthGridAnimating,
|
19554 |
+
modifiers: modifiers,
|
19555 |
+
orientation: orientation,
|
19556 |
+
numberOfMonths: numberOfMonths * scrollableMonthMultiple,
|
19557 |
+
onDayClick: onDayClick,
|
19558 |
+
onDayMouseEnter: onDayMouseEnter,
|
19559 |
+
onDayMouseLeave: onDayMouseLeave,
|
19560 |
+
onMonthChange: this.onMonthChange,
|
19561 |
+
onYearChange: this.onYearChange,
|
19562 |
+
renderMonthText: renderMonthText,
|
19563 |
+
renderCalendarDay: renderCalendarDay,
|
19564 |
+
renderDayContents: renderDayContents,
|
19565 |
+
renderMonthElement: renderMonthElement,
|
19566 |
+
onMonthTransitionEnd: this.updateStateAfterMonthTransition,
|
19567 |
+
monthFormat: monthFormat,
|
19568 |
+
daySize: daySize,
|
19569 |
+
firstDayOfWeek: firstDayOfWeek,
|
19570 |
+
isFocused: shouldFocusDate,
|
19571 |
+
focusedDate: focusedDate,
|
19572 |
+
phrases: phrases,
|
19573 |
+
isRTL: isRTL,
|
19574 |
+
dayAriaLabelFormat: dayAriaLabelFormat,
|
19575 |
+
transitionDuration: transitionDuration,
|
19576 |
+
verticalBorderSpacing: verticalBorderSpacing,
|
19577 |
+
horizontalMonthPadding: horizontalMonthPadding
|
19578 |
+
}),
|
19579 |
+
verticalScrollable && this.renderNavigation()
|
19580 |
+
),
|
19581 |
+
!isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
|
19582 |
+
block: this.isVertical() && !withPortal,
|
19583 |
+
buttonLocation: keyboardShortcutButtonLocation,
|
19584 |
+
showKeyboardShortcutsPanel: showKeyboardShortcuts,
|
19585 |
+
openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
|
19586 |
+
closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
|
19587 |
+
phrases: phrases
|
19588 |
+
})
|
19589 |
+
)
|
19590 |
+
),
|
19591 |
+
(calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
|
19592 |
+
)
|
19593 |
+
);
|
19594 |
}
|
19595 |
|
19596 |
+
return render;
|
19597 |
+
}()
|
19598 |
+
}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19599 |
|
19600 |
+
return DayPicker;
|
19601 |
+
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19602 |
|
19603 |
+
DayPicker.propTypes = propTypes;
|
19604 |
+
DayPicker.defaultProps = defaultProps;
|
|
|
|
|
|
|
|
|
19605 |
|
19606 |
+
exports.PureDayPicker = DayPicker;
|
19607 |
+
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
|
19608 |
+
var _ref2$reactDates = _ref2.reactDates,
|
19609 |
+
color = _ref2$reactDates.color,
|
19610 |
+
font = _ref2$reactDates.font,
|
19611 |
+
noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
|
19612 |
+
spacing = _ref2$reactDates.spacing,
|
19613 |
+
zIndex = _ref2$reactDates.zIndex;
|
19614 |
+
return {
|
19615 |
+
DayPicker: {
|
19616 |
+
background: color.background,
|
19617 |
+
position: 'relative',
|
19618 |
+
textAlign: 'left'
|
19619 |
+
},
|
19620 |
|
19621 |
+
DayPicker__horizontal: {
|
19622 |
+
background: color.background
|
19623 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19624 |
|
19625 |
+
DayPicker__verticalScrollable: {
|
19626 |
+
height: '100%'
|
19627 |
+
},
|
|
|
|
|
19628 |
|
19629 |
+
DayPicker__hidden: {
|
19630 |
+
visibility: 'hidden'
|
19631 |
+
},
|
19632 |
|
19633 |
+
DayPicker__withBorder: {
|
19634 |
+
boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
|
19635 |
+
borderRadius: 3
|
19636 |
+
},
|
19637 |
|
19638 |
+
DayPicker_portal__horizontal: {
|
19639 |
+
boxShadow: 'none',
|
19640 |
+
position: 'absolute',
|
19641 |
+
left: '50%',
|
19642 |
+
top: '50%'
|
19643 |
+
},
|
19644 |
|
19645 |
+
DayPicker_portal__vertical: {
|
19646 |
+
position: 'initial'
|
19647 |
+
},
|
19648 |
|
19649 |
+
DayPicker_focusRegion: {
|
19650 |
+
outline: 'none'
|
19651 |
+
},
|
19652 |
|
19653 |
+
DayPicker_calendarInfo__horizontal: {
|
19654 |
+
display: 'inline-block',
|
19655 |
+
verticalAlign: 'top'
|
19656 |
+
},
|
19657 |
|
19658 |
+
DayPicker_wrapper__horizontal: {
|
19659 |
+
display: 'inline-block',
|
19660 |
+
verticalAlign: 'top'
|
19661 |
+
},
|
19662 |
|
19663 |
+
DayPicker_weekHeaders: {
|
19664 |
+
position: 'relative'
|
19665 |
+
},
|
19666 |
|
19667 |
+
DayPicker_weekHeaders__horizontal: {
|
19668 |
+
marginLeft: spacing.dayPickerHorizontalPadding
|
19669 |
+
},
|
19670 |
|
19671 |
+
DayPicker_weekHeader: {
|
19672 |
+
color: color.placeholderText,
|
19673 |
+
position: 'absolute',
|
19674 |
+
top: 62,
|
19675 |
+
zIndex: zIndex + 2,
|
19676 |
+
textAlign: 'left'
|
19677 |
+
},
|
19678 |
|
19679 |
+
DayPicker_weekHeader__vertical: {
|
19680 |
+
left: '50%'
|
19681 |
+
},
|
19682 |
|
19683 |
+
DayPicker_weekHeader__verticalScrollable: {
|
19684 |
+
top: 0,
|
19685 |
+
display: 'table-row',
|
19686 |
+
borderBottom: '1px solid ' + String(color.core.border),
|
19687 |
+
background: color.background,
|
19688 |
+
marginLeft: 0,
|
19689 |
+
left: 0,
|
19690 |
+
width: '100%',
|
19691 |
+
textAlign: 'center'
|
19692 |
+
},
|
19693 |
|
19694 |
+
DayPicker_weekHeader_ul: {
|
19695 |
+
listStyle: 'none',
|
19696 |
+
margin: '1px 0',
|
19697 |
+
paddingLeft: 0,
|
19698 |
+
paddingRight: 0,
|
19699 |
+
fontSize: font.size
|
19700 |
+
},
|
19701 |
|
19702 |
+
DayPicker_weekHeader_li: {
|
19703 |
+
display: 'inline-block',
|
19704 |
+
textAlign: 'center'
|
19705 |
+
},
|
19706 |
|
19707 |
+
DayPicker_transitionContainer: {
|
19708 |
+
position: 'relative',
|
19709 |
+
overflow: 'hidden',
|
19710 |
+
borderRadius: 3
|
19711 |
+
},
|
19712 |
|
19713 |
+
DayPicker_transitionContainer__horizontal: {
|
19714 |
+
transition: 'height 0.2s ease-in-out'
|
19715 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19716 |
|
19717 |
+
DayPicker_transitionContainer__vertical: {
|
19718 |
+
width: '100%'
|
19719 |
+
},
|
19720 |
|
19721 |
+
DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
|
19722 |
+
paddingTop: 20,
|
19723 |
+
height: '100%',
|
19724 |
+
position: 'absolute',
|
19725 |
+
top: 0,
|
19726 |
+
bottom: 0,
|
19727 |
+
right: 0,
|
19728 |
+
left: 0,
|
19729 |
+
overflowY: 'scroll'
|
19730 |
+
}, noScrollBarOnVerticalScrollable && {
|
19731 |
+
'-webkitOverflowScrolling': 'touch',
|
19732 |
+
'::-webkit-scrollbar': {
|
19733 |
+
'-webkit-appearance': 'none',
|
19734 |
+
display: 'none'
|
19735 |
}
|
19736 |
+
})
|
19737 |
+
};
|
19738 |
+
})(DayPicker);
|
|
|
|
|
|
|
|
|
|
|
|
|
19739 |
|
19740 |
/***/ }),
|
19741 |
+
/* 139 */
|
19742 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
19743 |
|
19744 |
"use strict";
|
19745 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_url__ = __webpack_require__(769);
|
19746 |
+
/* unused harmony reexport isURL */
|
19747 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_email__ = __webpack_require__(415);
|
19748 |
+
/* unused harmony reexport isEmail */
|
19749 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_protocol__ = __webpack_require__(770);
|
19750 |
+
/* unused harmony reexport getProtocol */
|
19751 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_valid_protocol__ = __webpack_require__(771);
|
19752 |
+
/* unused harmony reexport isValidProtocol */
|
19753 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__get_authority__ = __webpack_require__(772);
|
19754 |
+
/* unused harmony reexport getAuthority */
|
19755 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__is_valid_authority__ = __webpack_require__(773);
|
19756 |
+
/* unused harmony reexport isValidAuthority */
|
19757 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__get_path__ = __webpack_require__(774);
|
19758 |
+
/* unused harmony reexport getPath */
|
19759 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__is_valid_path__ = __webpack_require__(775);
|
19760 |
+
/* unused harmony reexport isValidPath */
|
19761 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__get_query_string__ = __webpack_require__(776);
|
19762 |
+
/* unused harmony reexport getQueryString */
|
19763 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__is_valid_query_string__ = __webpack_require__(777);
|
19764 |
+
/* unused harmony reexport isValidQueryString */
|
19765 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__get_fragment__ = __webpack_require__(778);
|
19766 |
+
/* unused harmony reexport getFragment */
|
19767 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__is_valid_fragment__ = __webpack_require__(779);
|
19768 |
+
/* unused harmony reexport isValidFragment */
|
19769 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__add_query_args__ = __webpack_require__(780);
|
19770 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_12__add_query_args__["a"]; });
|
19771 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__get_query_arg__ = __webpack_require__(417);
|
19772 |
+
/* unused harmony reexport getQueryArg */
|
19773 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__has_query_arg__ = __webpack_require__(783);
|
19774 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_14__has_query_arg__["a"]; });
|
19775 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__remove_query_args__ = __webpack_require__(784);
|
19776 |
+
/* unused harmony reexport removeQueryArgs */
|
19777 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__prepend_http__ = __webpack_require__(785);
|
19778 |
+
/* unused harmony reexport prependHTTP */
|
19779 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__safe_decode_uri__ = __webpack_require__(786);
|
19780 |
+
/* unused harmony reexport safeDecodeURI */
|
19781 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__safe_decode_uri_component__ = __webpack_require__(787);
|
19782 |
+
/* unused harmony reexport safeDecodeURIComponent */
|
19783 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__filter_url_for_display__ = __webpack_require__(788);
|
19784 |
+
/* unused harmony reexport filterURLForDisplay */
|
19785 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__clean_for_slug__ = __webpack_require__(789);
|
19786 |
+
/* unused harmony reexport cleanForSlug */
|
19787 |
|
19788 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19789 |
|
|
|
19790 |
|
|
|
|
|
|
|
19791 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19792 |
|
|
|
|
|
19793 |
|
|
|
|
|
19794 |
|
|
|
19795 |
|
19796 |
|
|
|
|
|
|
|
19797 |
|
|
|
|
|
|
|
|
|
19798 |
|
19799 |
|
|
|
|
|
|
|
19800 |
|
19801 |
|
|
|
|
|
|
|
19802 |
|
|
|
|
|
|
|
19803 |
|
|
|
|
|
19804 |
|
|
|
|
|
|
|
19805 |
|
|
|
|
|
|
|
|
|
19806 |
|
|
|
|
|
|
|
|
|
|
|
19807 |
|
|
|
19808 |
//# sourceMappingURL=index.js.map
|
19809 |
|
19810 |
/***/ }),
|
19811 |
+
/* 140 */
|
19812 |
+
/***/ (function(module, exports, __webpack_require__) {
|
19813 |
|
19814 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19815 |
|
19816 |
|
19817 |
+
var stringify = __webpack_require__(781);
|
19818 |
+
var parse = __webpack_require__(782);
|
19819 |
+
var formats = __webpack_require__(416);
|
19820 |
|
19821 |
+
module.exports = {
|
19822 |
+
formats: formats,
|
19823 |
+
parse: parse,
|
19824 |
+
stringify: stringify
|
19825 |
+
};
|
19826 |
|
19827 |
|
19828 |
+
/***/ }),
|
19829 |
+
/* 141 */
|
19830 |
+
/***/ (function(module, exports, __webpack_require__) {
|
19831 |
|
19832 |
+
"use strict";
|
|
|
|
|
19833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19834 |
|
19835 |
+
var has = Object.prototype.hasOwnProperty;
|
19836 |
+
var isArray = Array.isArray;
|
|
|
|
|
|
|
|
|
19837 |
|
19838 |
+
var hexTable = (function () {
|
19839 |
+
var array = [];
|
19840 |
+
for (var i = 0; i < 256; ++i) {
|
19841 |
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
19842 |
+
}
|
|
|
|
|
|
|
19843 |
|
19844 |
+
return array;
|
19845 |
+
}());
|
|
|
|
|
|
|
|
|
19846 |
|
19847 |
+
var compactQueue = function compactQueue(queue) {
|
19848 |
+
while (queue.length > 1) {
|
19849 |
+
var item = queue.pop();
|
19850 |
+
var obj = item.obj[item.prop];
|
19851 |
|
19852 |
+
if (isArray(obj)) {
|
19853 |
+
var compacted = [];
|
19854 |
+
|
19855 |
+
for (var j = 0; j < obj.length; ++j) {
|
19856 |
+
if (typeof obj[j] !== 'undefined') {
|
19857 |
+
compacted.push(obj[j]);
|
19858 |
+
}
|
19859 |
+
}
|
19860 |
+
|
19861 |
+
item.obj[item.prop] = compacted;
|
19862 |
+
}
|
19863 |
}
|
19864 |
+
};
|
19865 |
|
19866 |
+
var arrayToObject = function arrayToObject(source, options) {
|
19867 |
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
19868 |
+
for (var i = 0; i < source.length; ++i) {
|
19869 |
+
if (typeof source[i] !== 'undefined') {
|
19870 |
+
obj[i] = source[i];
|
19871 |
+
}
|
19872 |
+
}
|
19873 |
|
19874 |
+
return obj;
|
19875 |
+
};
|
19876 |
|
19877 |
+
var merge = function merge(target, source, options) {
|
19878 |
+
/* eslint no-param-reassign: 0 */
|
19879 |
+
if (!source) {
|
19880 |
+
return target;
|
19881 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19882 |
|
19883 |
+
if (typeof source !== 'object') {
|
19884 |
+
if (isArray(target)) {
|
19885 |
+
target.push(source);
|
19886 |
+
} else if (target && typeof target === 'object') {
|
19887 |
+
if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
|
19888 |
+
target[source] = true;
|
19889 |
+
}
|
19890 |
+
} else {
|
19891 |
+
return [target, source];
|
19892 |
+
}
|
19893 |
|
19894 |
+
return target;
|
|
|
|
|
19895 |
}
|
19896 |
|
19897 |
+
if (!target || typeof target !== 'object') {
|
19898 |
+
return [target].concat(source);
|
19899 |
+
}
|
|
|
|
|
|
|
|
|
|
|
19900 |
|
19901 |
+
var mergeTarget = target;
|
19902 |
+
if (isArray(target) && !isArray(source)) {
|
19903 |
+
mergeTarget = arrayToObject(target, options);
|
19904 |
+
}
|
19905 |
|
19906 |
+
if (isArray(target) && isArray(source)) {
|
19907 |
+
source.forEach(function (item, i) {
|
19908 |
+
if (has.call(target, i)) {
|
19909 |
+
var targetItem = target[i];
|
19910 |
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
19911 |
+
target[i] = merge(targetItem, item, options);
|
19912 |
+
} else {
|
19913 |
+
target.push(item);
|
19914 |
+
}
|
19915 |
+
} else {
|
19916 |
+
target[i] = item;
|
19917 |
+
}
|
19918 |
+
});
|
19919 |
+
return target;
|
19920 |
}
|
19921 |
|
19922 |
+
return Object.keys(source).reduce(function (acc, key) {
|
19923 |
+
var value = source[key];
|
19924 |
|
19925 |
+
if (has.call(acc, key)) {
|
19926 |
+
acc[key] = merge(acc[key], value, options);
|
19927 |
+
} else {
|
19928 |
+
acc[key] = value;
|
19929 |
+
}
|
19930 |
+
return acc;
|
19931 |
+
}, mergeTarget);
|
19932 |
+
};
|
19933 |
|
19934 |
+
var assign = function assignSingleSource(target, source) {
|
19935 |
+
return Object.keys(source).reduce(function (acc, key) {
|
19936 |
+
acc[key] = source[key];
|
19937 |
+
return acc;
|
19938 |
+
}, target);
|
19939 |
+
};
|
19940 |
|
19941 |
+
var decode = function (str, decoder, charset) {
|
19942 |
+
var strWithoutPlus = str.replace(/\+/g, ' ');
|
19943 |
+
if (charset === 'iso-8859-1') {
|
19944 |
+
// unescape never throws, no try...catch needed:
|
19945 |
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
19946 |
+
}
|
19947 |
+
// utf-8
|
19948 |
+
try {
|
19949 |
+
return decodeURIComponent(strWithoutPlus);
|
19950 |
+
} catch (e) {
|
19951 |
+
return strWithoutPlus;
|
19952 |
+
}
|
19953 |
+
};
|
19954 |
|
19955 |
+
var encode = function encode(str, defaultEncoder, charset) {
|
19956 |
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
19957 |
+
// It has been adapted here for stricter adherence to RFC 3986
|
19958 |
+
if (str.length === 0) {
|
19959 |
+
return str;
|
19960 |
+
}
|
19961 |
|
19962 |
+
var string = str;
|
19963 |
+
if (typeof str === 'symbol') {
|
19964 |
+
string = Symbol.prototype.toString.call(str);
|
19965 |
+
} else if (typeof str !== 'string') {
|
19966 |
+
string = String(str);
|
19967 |
+
}
|
19968 |
+
|
19969 |
+
if (charset === 'iso-8859-1') {
|
19970 |
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
19971 |
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
19972 |
+
});
|
19973 |
+
}
|
19974 |
+
|
19975 |
+
var out = '';
|
19976 |
+
for (var i = 0; i < string.length; ++i) {
|
19977 |
+
var c = string.charCodeAt(i);
|
19978 |
+
|
19979 |
+
if (
|
19980 |
+
c === 0x2D // -
|
19981 |
+
|| c === 0x2E // .
|
19982 |
+
|| c === 0x5F // _
|
19983 |
+
|| c === 0x7E // ~
|
19984 |
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
19985 |
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
19986 |
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
19987 |
+
) {
|
19988 |
+
out += string.charAt(i);
|
19989 |
+
continue;
|
19990 |
}
|
|
|
|
|
|
|
19991 |
|
19992 |
+
if (c < 0x80) {
|
19993 |
+
out = out + hexTable[c];
|
19994 |
+
continue;
|
|
|
19995 |
}
|
|
|
|
|
|
|
|
|
|
|
19996 |
|
19997 |
+
if (c < 0x800) {
|
19998 |
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
19999 |
+
continue;
|
|
|
20000 |
}
|
|
|
20001 |
|
20002 |
+
if (c < 0xD800 || c >= 0xE000) {
|
20003 |
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
20004 |
+
continue;
|
20005 |
+
}
|
|
|
|
|
20006 |
|
20007 |
+
i += 1;
|
20008 |
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
20009 |
+
out += hexTable[0xF0 | (c >> 18)]
|
20010 |
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
20011 |
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
20012 |
+
+ hexTable[0x80 | (c & 0x3F)];
|
20013 |
+
}
|
20014 |
|
20015 |
+
return out;
|
20016 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20017 |
|
20018 |
+
var compact = function compact(value) {
|
20019 |
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
20020 |
+
var refs = [];
|
20021 |
|
20022 |
+
for (var i = 0; i < queue.length; ++i) {
|
20023 |
+
var item = queue[i];
|
20024 |
+
var obj = item.obj[item.prop];
|
20025 |
|
20026 |
+
var keys = Object.keys(obj);
|
20027 |
+
for (var j = 0; j < keys.length; ++j) {
|
20028 |
+
var key = keys[j];
|
20029 |
+
var val = obj[key];
|
20030 |
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
20031 |
+
queue.push({ obj: obj, prop: key });
|
20032 |
+
refs.push(val);
|
20033 |
+
}
|
20034 |
+
}
|
20035 |
+
}
|
20036 |
|
20037 |
+
compactQueue(queue);
|
20038 |
|
20039 |
+
return value;
|
20040 |
+
};
|
20041 |
|
20042 |
+
var isRegExp = function isRegExp(obj) {
|
20043 |
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
20044 |
+
};
|
20045 |
|
20046 |
+
var isBuffer = function isBuffer(obj) {
|
20047 |
+
if (!obj || typeof obj !== 'object') {
|
20048 |
+
return false;
|
20049 |
+
}
|
20050 |
|
20051 |
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
20052 |
+
};
|
20053 |
|
20054 |
+
var combine = function combine(a, b) {
|
20055 |
+
return [].concat(a, b);
|
20056 |
+
};
|
|
|
|
|
|
|
20057 |
|
20058 |
+
var maybeMap = function maybeMap(val, fn) {
|
20059 |
+
if (isArray(val)) {
|
20060 |
+
var mapped = [];
|
20061 |
+
for (var i = 0; i < val.length; i += 1) {
|
20062 |
+
mapped.push(fn(val[i]));
|
20063 |
+
}
|
20064 |
+
return mapped;
|
20065 |
+
}
|
20066 |
+
return fn(val);
|
20067 |
+
};
|
20068 |
|
20069 |
+
module.exports = {
|
20070 |
+
arrayToObject: arrayToObject,
|
20071 |
+
assign: assign,
|
20072 |
+
combine: combine,
|
20073 |
+
compact: compact,
|
20074 |
+
decode: decode,
|
20075 |
+
encode: encode,
|
20076 |
+
isBuffer: isBuffer,
|
20077 |
+
isRegExp: isRegExp,
|
20078 |
+
maybeMap: maybeMap,
|
20079 |
+
merge: merge
|
20080 |
+
};
|
20081 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20082 |
|
20083 |
/***/ }),
|
20084 |
+
/* 142 */
|
20085 |
+
/***/ (function(module, exports, __webpack_require__) {
|
20086 |
|
20087 |
"use strict";
|
20088 |
+
/* WEBPACK VAR INJECTION */(function(process) {
|
|
|
|
|
|
|
|
|
|
|
20089 |
|
20090 |
+
if (process.env.NODE_ENV === 'production') {
|
20091 |
+
module.exports = __webpack_require__(433);
|
20092 |
+
} else {
|
20093 |
+
module.exports = __webpack_require__(434);
|
20094 |
+
}
|
20095 |
|
20096 |
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
|
20097 |
|
20098 |
+
/***/ }),
|
20099 |
+
/* 143 */
|
20100 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
20101 |
|
20102 |
+
"use strict";
|
20103 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
|
20104 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(22);
|
20105 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
20106 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(92);
|
20107 |
|
|
|
|
|
|
|
20108 |
|
|
|
|
|
|
|
20109 |
|
|
|
|
|
|
|
|
|
20110 |
/**
|
20111 |
+
* External dependencies
|
20112 |
*/
|
20113 |
|
|
|
20114 |
/**
|
20115 |
+
* Component used as equivalent of Fragment with unescaped HTML, in cases where
|
20116 |
+
* it is desirable to render dangerous HTML without needing a wrapper element.
|
20117 |
+
* To preserve additional props, a `div` wrapper _will_ be created if any props
|
20118 |
+
* aside from `children` are passed.
|
20119 |
*
|
20120 |
+
* @param {string} props.children HTML to render.
|
20121 |
+
*
|
20122 |
+
* @return {WPElement} Dangerously-rendering element.
|
20123 |
*/
|
20124 |
|
20125 |
+
function RawHTML(_ref) {
|
20126 |
+
var children = _ref.children,
|
20127 |
+
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
|
|
|
|
|
|
|
20128 |
|
20129 |
+
// The DIV wrapper will be stripped by serializer, unless there are
|
20130 |
+
// non-children props present.
|
20131 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2__react__["h" /* createElement */])('div', Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({
|
20132 |
+
dangerouslySetInnerHTML: {
|
20133 |
+
__html: children
|
20134 |
+
}
|
20135 |
+
}, props));
|
20136 |
+
}
|
20137 |
+
//# sourceMappingURL=raw-html.js.map
|
20138 |
|
20139 |
/***/ }),
|
20140 |
+
/* 144 */
|
20141 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
20142 |
|
20143 |
"use strict";
|
20144 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _arrayLikeToArray;
|
20145 |
+
function _arrayLikeToArray(arr, len) {
|
20146 |
+
if (len == null || len > arr.length) len = arr.length;
|
20147 |
+
|
20148 |
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
20149 |
+
arr2[i] = arr[i];
|
20150 |
+
}
|
20151 |
+
|
20152 |
+
return arr2;
|
20153 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20154 |
|
20155 |
+
/***/ }),
|
20156 |
+
/* 145 */
|
20157 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
20158 |
|
20159 |
+
"use strict";
|
20160 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _unsupportedIterableToArray;
|
20161 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayLikeToArray__ = __webpack_require__(144);
|
20162 |
|
20163 |
+
function _unsupportedIterableToArray(o, minLen) {
|
20164 |
+
if (!o) return;
|
20165 |
+
if (typeof o === "string") return Object(__WEBPACK_IMPORTED_MODULE_0__arrayLikeToArray__["a" /* default */])(o, minLen);
|
20166 |
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
20167 |
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
20168 |
+
if (n === "Map" || n === "Set") return Array.from(o);
|
20169 |
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(__WEBPACK_IMPORTED_MODULE_0__arrayLikeToArray__["a" /* default */])(o, minLen);
|
20170 |
+
}
|
20171 |
|
20172 |
+
/***/ }),
|
20173 |
+
/* 146 */
|
20174 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
20175 |
|
20176 |
+
"use strict";
|
20177 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createI18n; });
|
20178 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
20179 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tannin__ = __webpack_require__(96);
|
20180 |
|
20181 |
|
20182 |
+
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; }
|
20183 |
|
20184 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20185 |
|
20186 |
/**
|
20187 |
* External dependencies
|
20188 |
*/
|
20189 |
|
20190 |
+
/**
|
20191 |
+
* @typedef {Record<string,any>} LocaleData
|
20192 |
+
*/
|
20193 |
|
20194 |
/**
|
20195 |
+
* Default locale data to use for Tannin domain when not otherwise provided.
|
20196 |
+
* Assumes an English plural forms expression.
|
20197 |
+
*
|
20198 |
+
* @type {LocaleData}
|
20199 |
*/
|
20200 |
|
20201 |
+
var DEFAULT_LOCALE_DATA = {
|
20202 |
+
'': {
|
20203 |
+
/** @param {number} n */
|
20204 |
+
plural_forms: function plural_forms(n) {
|
20205 |
+
return n === 1 ? 0 : 1;
|
20206 |
+
}
|
20207 |
+
}
|
20208 |
+
};
|
20209 |
+
/**
|
20210 |
+
* An i18n instance
|
20211 |
+
*
|
20212 |
+
* @typedef {Object} I18n
|
20213 |
+
* @property {Function} setLocaleData Merges locale data into the Tannin instance by domain. Accepts data in a
|
20214 |
+
* Jed-formatted JSON object shape.
|
20215 |
+
* @property {Function} __ Retrieve the translation of text.
|
20216 |
+
* @property {Function} _x Retrieve translated string with gettext context.
|
20217 |
+
* @property {Function} _n Translates and retrieves the singular or plural form based on the supplied
|
20218 |
+
* number.
|
20219 |
+
* @property {Function} _nx Translates and retrieves the singular or plural form based on the supplied
|
20220 |
+
* number, with gettext context.
|
20221 |
+
* @property {Function} isRTL Check if current locale is RTL.
|
20222 |
+
*/
|
20223 |
|
20224 |
/**
|
20225 |
+
* Create an i18n instance
|
20226 |
+
*
|
20227 |
+
* @param {LocaleData} [initialData] Locale data configuration.
|
20228 |
+
* @param {string} [initialDomain] Domain for which configuration applies.
|
20229 |
+
* @return {I18n} I18n instance
|
20230 |
*/
|
20231 |
|
20232 |
+
var createI18n = function createI18n(initialData, initialDomain) {
|
20233 |
+
/**
|
20234 |
+
* The underlying instance of Tannin to which exported functions interface.
|
20235 |
+
*
|
20236 |
+
* @type {Tannin}
|
20237 |
+
*/
|
20238 |
+
var tannin = new __WEBPACK_IMPORTED_MODULE_1_tannin__["a" /* default */]({});
|
20239 |
+
/**
|
20240 |
+
* Merges locale data into the Tannin instance by domain. Accepts data in a
|
20241 |
+
* Jed-formatted JSON object shape.
|
20242 |
+
*
|
20243 |
+
* @see http://messageformat.github.io/Jed/
|
20244 |
+
*
|
20245 |
+
* @param {LocaleData} [data] Locale data configuration.
|
20246 |
+
* @param {string} [domain] Domain for which configuration applies.
|
20247 |
+
*/
|
20248 |
+
|
20249 |
+
var setLocaleData = function setLocaleData(data) {
|
20250 |
+
var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
20251 |
+
tannin.data[domain] = _objectSpread({}, DEFAULT_LOCALE_DATA, {}, tannin.data[domain], {}, data); // Populate default domain configuration (supported locale date which omits
|
20252 |
+
// a plural forms expression).
|
20253 |
+
|
20254 |
+
tannin.data[domain][''] = _objectSpread({}, DEFAULT_LOCALE_DATA[''], {}, tannin.data[domain]['']);
|
20255 |
+
};
|
20256 |
+
/**
|
20257 |
+
* Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
|
20258 |
+
* otherwise previously assigned.
|
20259 |
+
*
|
20260 |
+
* @param {string|undefined} domain Domain to retrieve the translated text.
|
20261 |
+
* @param {string|undefined} context Context information for the translators.
|
20262 |
+
* @param {string} single Text to translate if non-plural. Used as
|
20263 |
+
* fallback return value on a caught error.
|
20264 |
+
* @param {string} [plural] The text to be used if the number is
|
20265 |
+
* plural.
|
20266 |
+
* @param {number} [number] The number to compare against to use
|
20267 |
+
* either the singular or plural form.
|
20268 |
+
*
|
20269 |
+
* @return {string} The translated string.
|
20270 |
+
*/
|
20271 |
+
|
20272 |
|
20273 |
+
var dcnpgettext = function dcnpgettext() {
|
20274 |
+
var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
20275 |
+
var context = arguments.length > 1 ? arguments[1] : undefined;
|
20276 |
+
var single = arguments.length > 2 ? arguments[2] : undefined;
|
20277 |
+
var plural = arguments.length > 3 ? arguments[3] : undefined;
|
20278 |
+
var number = arguments.length > 4 ? arguments[4] : undefined;
|
20279 |
|
20280 |
+
if (!tannin.data[domain]) {
|
20281 |
+
setLocaleData(undefined, domain);
|
20282 |
+
}
|
20283 |
|
20284 |
+
return tannin.dcnpgettext(domain, context, single, plural, number);
|
20285 |
+
};
|
20286 |
+
/**
|
20287 |
+
* Retrieve the translation of text.
|
20288 |
+
*
|
20289 |
+
* @see https://developer.wordpress.org/reference/functions/__/
|
20290 |
+
*
|
20291 |
+
* @param {string} text Text to translate.
|
20292 |
+
* @param {string} [domain] Domain to retrieve the translated text.
|
20293 |
+
*
|
20294 |
+
* @return {string} Translated text.
|
20295 |
+
*/
|
20296 |
|
20297 |
|
20298 |
+
var __ = function __(text, domain) {
|
20299 |
+
return dcnpgettext(domain, undefined, text);
|
20300 |
+
};
|
20301 |
+
/**
|
20302 |
+
* Retrieve translated string with gettext context.
|
20303 |
+
*
|
20304 |
+
* @see https://developer.wordpress.org/reference/functions/_x/
|
20305 |
+
*
|
20306 |
+
* @param {string} text Text to translate.
|
20307 |
+
* @param {string} context Context information for the translators.
|
20308 |
+
* @param {string} [domain] Domain to retrieve the translated text.
|
20309 |
+
*
|
20310 |
+
* @return {string} Translated context string without pipe.
|
20311 |
+
*/
|
20312 |
|
|
|
|
|
|
|
|
|
20313 |
|
20314 |
+
var _x = function _x(text, context, domain) {
|
20315 |
+
return dcnpgettext(domain, context, text);
|
20316 |
+
};
|
20317 |
+
/**
|
20318 |
+
* Translates and retrieves the singular or plural form based on the supplied
|
20319 |
+
* number.
|
20320 |
+
*
|
20321 |
+
* @see https://developer.wordpress.org/reference/functions/_n/
|
20322 |
+
*
|
20323 |
+
* @param {string} single The text to be used if the number is singular.
|
20324 |
+
* @param {string} plural The text to be used if the number is plural.
|
20325 |
+
* @param {number} number The number to compare against to use either the
|
20326 |
+
* singular or plural form.
|
20327 |
+
* @param {string} [domain] Domain to retrieve the translated text.
|
20328 |
+
*
|
20329 |
+
* @return {string} The translated singular or plural form.
|
20330 |
+
*/
|
20331 |
|
|
|
|
|
20332 |
|
20333 |
+
var _n = function _n(single, plural, number, domain) {
|
20334 |
+
return dcnpgettext(domain, undefined, single, plural, number);
|
20335 |
+
};
|
20336 |
+
/**
|
20337 |
+
* Translates and retrieves the singular or plural form based on the supplied
|
20338 |
+
* number, with gettext context.
|
20339 |
+
*
|
20340 |
+
* @see https://developer.wordpress.org/reference/functions/_nx/
|
20341 |
+
*
|
20342 |
+
* @param {string} single The text to be used if the number is singular.
|
20343 |
+
* @param {string} plural The text to be used if the number is plural.
|
20344 |
+
* @param {number} number The number to compare against to use either the
|
20345 |
+
* singular or plural form.
|
20346 |
+
* @param {string} context Context information for the translators.
|
20347 |
+
* @param {string} [domain] Domain to retrieve the translated text.
|
20348 |
+
*
|
20349 |
+
* @return {string} The translated singular or plural form.
|
20350 |
+
*/
|
20351 |
|
20352 |
+
|
20353 |
+
var _nx = function _nx(single, plural, number, context, domain) {
|
20354 |
+
return dcnpgettext(domain, context, single, plural, number);
|
20355 |
+
};
|
20356 |
+
/**
|
20357 |
+
* Check if current locale is RTL.
|
20358 |
+
*
|
20359 |
+
* **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
|
20360 |
+
* For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
|
20361 |
+
* language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
|
20362 |
+
* including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
|
20363 |
+
*
|
20364 |
+
* @return {boolean} Whether locale is RTL.
|
20365 |
+
*/
|
20366 |
+
|
20367 |
+
|
20368 |
+
var isRTL = function isRTL() {
|
20369 |
+
return 'rtl' === _x('ltr', 'text direction');
|
20370 |
+
};
|
20371 |
+
|
20372 |
+
if (initialData) {
|
20373 |
+
setLocaleData(initialData, initialDomain);
|
20374 |
}
|
20375 |
|
20376 |
+
return {
|
20377 |
+
setLocaleData: setLocaleData,
|
20378 |
+
__: __,
|
20379 |
+
_x: _x,
|
20380 |
+
_n: _n,
|
20381 |
+
_nx: _nx,
|
20382 |
+
isRTL: isRTL
|
20383 |
+
};
|
20384 |
+
};
|
20385 |
+
//# sourceMappingURL=create-i18n.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20386 |
|
20387 |
/***/ }),
|
20388 |
+
/* 147 */
|
20389 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
20390 |
|
20391 |
"use strict";
|
20392 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
|
20393 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
20394 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
20395 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(97);
|
20396 |
+
|
20397 |
|
20398 |
|
20399 |
+
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; }
|
20400 |
|
20401 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
20402 |
|
20403 |
/**
|
20404 |
+
* Internal dependencies
|
20405 |
*/
|
20406 |
+
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
|
20407 |
+
|
20408 |
+
/* eslint-disable jsdoc/valid-types */
|
20409 |
+
|
20410 |
+
/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */
|
20411 |
+
|
20412 |
+
/* eslint-enable jsdoc/valid-types */
|
20413 |
|
20414 |
/**
|
20415 |
+
* Component used as equivalent of Fragment with unescaped HTML, in cases where
|
20416 |
+
* it is desirable to render dangerous HTML without needing a wrapper element.
|
20417 |
+
* To preserve additional props, a `div` wrapper _will_ be created if any props
|
20418 |
+
* aside from `children` are passed.
|
20419 |
+
*
|
20420 |
+
* @param {RawHTMLProps} props Children should be a string of HTML. Other props
|
20421 |
+
* will be passed through to div wrapper.
|
20422 |
+
*
|
20423 |
+
* @return {JSX.Element} Dangerously-rendering component.
|
20424 |
*/
|
20425 |
|
20426 |
+
function RawHTML(_ref) {
|
20427 |
+
var children = _ref.children,
|
20428 |
+
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
|
20429 |
|
20430 |
+
// The DIV wrapper will be stripped by serializer, unless there are
|
20431 |
+
// non-children props present.
|
20432 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2__react__["e" /* createElement */])('div', _objectSpread({
|
20433 |
+
dangerouslySetInnerHTML: {
|
20434 |
+
__html: children
|
20435 |
+
}
|
20436 |
+
}, props));
|
20437 |
+
}
|
20438 |
+
//# sourceMappingURL=raw-html.js.map
|
20439 |
|
20440 |
+
/***/ }),
|
20441 |
+
/* 148 */
|
20442 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20443 |
|
20444 |
+
"use strict";
|
20445 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useInstanceId;
|
20446 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(28);
|
20447 |
+
/**
|
20448 |
+
* WordPress dependencies
|
20449 |
+
*/
|
20450 |
|
20451 |
+
var instanceMap = new WeakMap();
|
20452 |
+
/**
|
20453 |
+
* Creates a new id for a given object.
|
20454 |
+
*
|
20455 |
+
* @param {Object} object Object reference to create an id for.
|
20456 |
+
*/
|
20457 |
|
20458 |
+
function createId(object) {
|
20459 |
+
var instances = instanceMap.get(object) || 0;
|
20460 |
+
instanceMap.set(object, instances + 1);
|
20461 |
+
return instances;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20462 |
}
|
20463 |
+
/**
|
20464 |
+
* Provides a unique instance ID.
|
20465 |
+
*
|
20466 |
+
* @param {Object} object Object reference to create an id for.
|
20467 |
+
*/
|
20468 |
|
20469 |
+
|
20470 |
+
function useInstanceId(object) {
|
20471 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["i" /* useMemo */])(function () {
|
20472 |
+
return createId(object);
|
20473 |
+
}, [object]);
|
20474 |
+
}
|
20475 |
//# sourceMappingURL=index.js.map
|
20476 |
|
20477 |
/***/ }),
|
20478 |
+
/* 149 */
|
20479 |
/***/ (function(module, exports, __webpack_require__) {
|
20480 |
|
20481 |
+
var e=__webpack_require__(10),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,"aria-label":"resize-listener",tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),i=u[0],o=u[1],c=e.useCallback((function(e){return o(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),i]};
|
20482 |
+
//# sourceMappingURL=index.js.map
|
20483 |
|
20484 |
|
20485 |
+
/***/ }),
|
20486 |
+
/* 150 */
|
20487 |
+
/***/ (function(module, exports) {
|
20488 |
|
20489 |
+
function combineReducers( reducers ) {
|
20490 |
+
var keys = Object.keys( reducers ),
|
20491 |
+
getNextState;
|
20492 |
|
20493 |
+
getNextState = ( function() {
|
20494 |
+
var fn, i, key;
|
|
|
|
|
20495 |
|
20496 |
+
fn = 'return {';
|
20497 |
+
for ( i = 0; i < keys.length; i++ ) {
|
20498 |
+
// Rely on Quoted escaping of JSON.stringify with guarantee that
|
20499 |
+
// each member of Object.keys is a string.
|
20500 |
+
//
|
20501 |
+
// "If Type(value) is String, then return the result of calling the
|
20502 |
+
// abstract operation Quote with argument value. [...] The abstract
|
20503 |
+
// operation Quote(value) wraps a String value in double quotes and
|
20504 |
+
// escapes characters within it."
|
20505 |
+
//
|
20506 |
+
// https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
|
20507 |
+
key = JSON.stringify( keys[ i ] );
|
20508 |
|
20509 |
+
fn += key + ':r[' + key + '](s[' + key + '],a),';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20510 |
}
|
20511 |
+
fn += '}';
|
|
|
20512 |
|
20513 |
+
return new Function( 'r,s,a', fn );
|
20514 |
+
} )();
|
20515 |
|
20516 |
+
return function combinedReducer( state, action ) {
|
20517 |
+
var nextState, i, key;
|
|
|
20518 |
|
20519 |
+
// Assumed changed if initial state.
|
20520 |
+
if ( state === undefined ) {
|
20521 |
+
return getNextState( reducers, {}, action );
|
20522 |
+
}
|
20523 |
|
20524 |
+
nextState = getNextState( reducers, state, action );
|
20525 |
+
|
20526 |
+
// Determine whether state has changed.
|
20527 |
+
i = keys.length;
|
20528 |
+
while ( i-- ) {
|
20529 |
+
key = keys[ i ];
|
20530 |
+
if ( state[ key ] !== nextState[ key ] ) {
|
20531 |
+
// Return immediately if a changed value is encountered.
|
20532 |
+
return nextState;
|
20533 |
+
}
|
20534 |
+
}
|
20535 |
+
|
20536 |
+
return state;
|
20537 |
+
};
|
20538 |
+
}
|
20539 |
+
|
20540 |
+
module.exports = combineReducers;
|
20541 |
|
20542 |
|
20543 |
/***/ }),
|
20544 |
+
/* 151 */
|
20545 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
20546 |
|
20547 |
"use strict";
|
20548 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = createRegistry;
|
20549 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(33);
|
20550 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
20551 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
|
20552 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
|
20553 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_memize__ = __webpack_require__(76);
|
20554 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_memize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_memize__);
|
20555 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__namespace_store__ = __webpack_require__(482);
|
20556 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__store__ = __webpack_require__(508);
|
20557 |
|
20558 |
|
|
|
|
|
20559 |
|
20560 |
+
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20561 |
|
20562 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
20563 |
|
20564 |
+
/**
|
20565 |
+
* External dependencies
|
20566 |
+
*/
|
20567 |
|
|
|
|
|
|
|
20568 |
|
20569 |
+
/**
|
20570 |
+
* Internal dependencies
|
20571 |
+
*/
|
20572 |
|
20573 |
|
|
|
|
|
|
|
20574 |
|
20575 |
+
/**
|
20576 |
+
* @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
|
20577 |
+
*
|
20578 |
+
* @property {Function} registerGenericStore Given a namespace key and settings
|
20579 |
+
* object, registers a new generic
|
20580 |
+
* store.
|
20581 |
+
* @property {Function} registerStore Given a namespace key and settings
|
20582 |
+
* object, registers a new namespace
|
20583 |
+
* store.
|
20584 |
+
* @property {Function} subscribe Given a function callback, invokes
|
20585 |
+
* the callback on any change to state
|
20586 |
+
* within any registered store.
|
20587 |
+
* @property {Function} select Given a namespace key, returns an
|
20588 |
+
* object of the store's registered
|
20589 |
+
* selectors.
|
20590 |
+
* @property {Function} dispatch Given a namespace key, returns an
|
20591 |
+
* object of the store's registered
|
20592 |
+
* action dispatchers.
|
20593 |
+
*/
|
20594 |
|
20595 |
+
/**
|
20596 |
+
* @typedef {Object} WPDataPlugin An object of registry function overrides.
|
20597 |
+
*
|
20598 |
+
* @property {Function} registerStore registers store.
|
20599 |
+
*/
|
|
|
|
|
|
|
20600 |
|
20601 |
+
/**
|
20602 |
+
* Creates a new store registry, given an optional object of initial store
|
20603 |
+
* configurations.
|
20604 |
+
*
|
20605 |
+
* @param {Object} storeConfigs Initial store configurations.
|
20606 |
+
* @param {Object?} parent Parent registry.
|
20607 |
+
*
|
20608 |
+
* @return {WPDataRegistry} Data registry.
|
20609 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20610 |
|
20611 |
+
function createRegistry() {
|
20612 |
+
var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
20613 |
+
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
20614 |
+
var stores = {};
|
20615 |
+
var listeners = [];
|
20616 |
+
/**
|
20617 |
+
* Global listener called for each store's update.
|
20618 |
+
*/
|
20619 |
|
20620 |
+
function globalListener() {
|
20621 |
+
listeners.forEach(function (listener) {
|
20622 |
+
return listener();
|
20623 |
+
});
|
20624 |
+
}
|
20625 |
+
/**
|
20626 |
+
* Subscribe to changes to any data.
|
20627 |
+
*
|
20628 |
+
* @param {Function} listener Listener function.
|
20629 |
+
*
|
20630 |
+
* @return {Function} Unsubscribe function.
|
20631 |
+
*/
|
20632 |
|
|
|
|
|
20633 |
|
20634 |
+
var subscribe = function subscribe(listener) {
|
20635 |
+
listeners.push(listener);
|
20636 |
+
return function () {
|
20637 |
+
listeners = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["without"])(listeners, listener);
|
20638 |
+
};
|
20639 |
+
};
|
20640 |
+
/**
|
20641 |
+
* Calls a selector given the current state and extra arguments.
|
20642 |
+
*
|
20643 |
+
* @param {string} reducerKey Part of the state shape to register the
|
20644 |
+
* selectors for.
|
20645 |
+
*
|
20646 |
+
* @return {*} The selector's returned value.
|
20647 |
+
*/
|
20648 |
|
|
|
20649 |
|
20650 |
+
function select(reducerKey) {
|
20651 |
+
var store = stores[reducerKey];
|
20652 |
|
20653 |
+
if (store) {
|
20654 |
+
return store.getSelectors();
|
20655 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20656 |
|
20657 |
+
return parent && parent.select(reducerKey);
|
20658 |
+
}
|
20659 |
|
20660 |
+
var getResolveSelectors = __WEBPACK_IMPORTED_MODULE_3_memize___default()(function (selectors) {
|
20661 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), function (selector, selectorName) {
|
20662 |
+
return function () {
|
20663 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
20664 |
+
args[_key] = arguments[_key];
|
20665 |
+
}
|
20666 |
|
20667 |
+
return new Promise(function (resolve) {
|
20668 |
+
var hasFinished = function hasFinished() {
|
20669 |
+
return selectors.hasFinishedResolution(selectorName, args);
|
20670 |
+
};
|
20671 |
|
20672 |
+
var getResult = function getResult() {
|
20673 |
+
return selector.apply(null, args);
|
20674 |
+
}; // trigger the selector (to trigger the resolver)
|
|
|
|
|
|
|
|
|
|
|
20675 |
|
|
|
|
|
20676 |
|
20677 |
+
var result = getResult();
|
|
|
20678 |
|
20679 |
+
if (hasFinished()) {
|
20680 |
+
return resolve(result);
|
20681 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20682 |
|
20683 |
+
var unsubscribe = subscribe(function () {
|
20684 |
+
if (hasFinished()) {
|
20685 |
+
unsubscribe();
|
20686 |
+
resolve(getResult());
|
20687 |
+
}
|
20688 |
+
});
|
20689 |
+
});
|
20690 |
+
};
|
20691 |
+
});
|
20692 |
+
}, {
|
20693 |
+
maxSize: 1
|
20694 |
+
});
|
20695 |
+
/**
|
20696 |
+
* Given the name of a registered store, returns an object containing the store's
|
20697 |
+
* selectors pre-bound to state so that you only need to supply additional arguments,
|
20698 |
+
* and modified so that they return promises that resolve to their eventual values,
|
20699 |
+
* after any resolvers have ran.
|
20700 |
+
*
|
20701 |
+
* @param {string} reducerKey Part of the state shape to register the
|
20702 |
+
* selectors for.
|
20703 |
+
*
|
20704 |
+
* @return {Object} Each key of the object matches the name of a selector.
|
20705 |
+
*/
|
20706 |
|
20707 |
+
function __experimentalResolveSelect(reducerKey) {
|
20708 |
+
return getResolveSelectors(select(reducerKey));
|
20709 |
+
}
|
20710 |
+
/**
|
20711 |
+
* Returns the available actions for a part of the state.
|
20712 |
+
*
|
20713 |
+
* @param {string} reducerKey Part of the state shape to dispatch the
|
20714 |
+
* action for.
|
20715 |
+
*
|
20716 |
+
* @return {*} The action's returned value.
|
20717 |
+
*/
|
20718 |
|
|
|
|
|
20719 |
|
20720 |
+
function dispatch(reducerKey) {
|
20721 |
+
var store = stores[reducerKey];
|
|
|
|
|
|
|
20722 |
|
20723 |
+
if (store) {
|
20724 |
+
return store.getActions();
|
20725 |
+
}
|
20726 |
|
20727 |
+
return parent && parent.dispatch(reducerKey);
|
20728 |
+
} //
|
20729 |
+
// Deprecated
|
20730 |
+
// TODO: Remove this after `use()` is removed.
|
20731 |
+
//
|
20732 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20733 |
|
20734 |
+
function withPlugins(attributes) {
|
20735 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(attributes, function (attribute, key) {
|
20736 |
+
if (typeof attribute !== 'function') {
|
20737 |
+
return attribute;
|
20738 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
20739 |
|
20740 |
+
return function () {
|
20741 |
+
return registry[key].apply(null, arguments);
|
20742 |
+
};
|
20743 |
+
});
|
20744 |
+
}
|
20745 |
+
/**
|
20746 |
+
* Registers a generic store.
|
20747 |
+
*
|
20748 |
+
* @param {string} key Store registry key.
|
20749 |
+
* @param {Object} config Configuration (getSelectors, getActions, subscribe).
|
20750 |
+
*/
|
20751 |
|
|
|
|
|
|
|
|
|
|
|
20752 |
|
20753 |
+
function registerGenericStore(key, config) {
|
20754 |
+
if (typeof config.getSelectors !== 'function') {
|
20755 |
+
throw new TypeError('config.getSelectors must be a function');
|
20756 |
+
}
|
|
|
20757 |
|
20758 |
+
if (typeof config.getActions !== 'function') {
|
20759 |
+
throw new TypeError('config.getActions must be a function');
|
20760 |
+
}
|
|
|
|
|
|
|
|
|
20761 |
|
20762 |
+
if (typeof config.subscribe !== 'function') {
|
20763 |
+
throw new TypeError('config.subscribe must be a function');
|
20764 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20765 |
|
20766 |
+
stores[key] = config;
|
20767 |
+
config.subscribe(globalListener);
|
20768 |
+
}
|
20769 |
|
20770 |
+
var registry = {
|
20771 |
+
registerGenericStore: registerGenericStore,
|
20772 |
+
stores: stores,
|
20773 |
+
namespaces: stores,
|
20774 |
+
// TODO: Deprecate/remove this.
|
20775 |
+
subscribe: subscribe,
|
20776 |
+
select: select,
|
20777 |
+
__experimentalResolveSelect: __experimentalResolveSelect,
|
20778 |
+
dispatch: dispatch,
|
20779 |
+
use: use
|
20780 |
+
};
|
20781 |
+
/**
|
20782 |
+
* Registers a standard `@wordpress/data` store.
|
20783 |
+
*
|
20784 |
+
* @param {string} reducerKey Reducer key.
|
20785 |
+
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
|
20786 |
+
*
|
20787 |
+
* @return {Object} Registered store object.
|
20788 |
+
*/
|
20789 |
|
20790 |
+
registry.registerStore = function (reducerKey, options) {
|
20791 |
+
if (!options.reducer) {
|
20792 |
+
throw new TypeError('Must specify store reducer');
|
20793 |
+
}
|
20794 |
|
20795 |
+
var namespace = Object(__WEBPACK_IMPORTED_MODULE_4__namespace_store__["a" /* default */])(reducerKey, options, registry);
|
20796 |
+
registerGenericStore(reducerKey, namespace);
|
20797 |
+
return namespace.store;
|
20798 |
+
}; //
|
20799 |
+
// TODO:
|
20800 |
+
// This function will be deprecated as soon as it is no longer internally referenced.
|
20801 |
+
//
|
20802 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20803 |
|
20804 |
+
function use(plugin, options) {
|
20805 |
+
registry = _objectSpread({}, registry, {}, plugin(registry, options));
|
20806 |
+
return registry;
|
20807 |
+
}
|
|
|
|
|
|
|
|
|
20808 |
|
20809 |
+
registerGenericStore('core/data', Object(__WEBPACK_IMPORTED_MODULE_5__store__["a" /* default */])(registry));
|
20810 |
+
Object.entries(storeConfigs).forEach(function (_ref) {
|
20811 |
+
var _ref2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_ref, 2),
|
20812 |
+
name = _ref2[0],
|
20813 |
+
config = _ref2[1];
|
20814 |
|
20815 |
+
return registry.registerStore(name, config);
|
20816 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20817 |
|
20818 |
+
if (parent) {
|
20819 |
+
parent.subscribe(globalListener);
|
20820 |
+
}
|
20821 |
|
20822 |
+
return withPlugins(registry);
|
20823 |
+
}
|
20824 |
+
//# sourceMappingURL=registry.js.map
|
|
|
20825 |
|
20826 |
+
/***/ }),
|
20827 |
+
/* 152 */
|
20828 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20829 |
|
20830 |
+
"use strict";
|
20831 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = _asyncToGenerator;
|
20832 |
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
20833 |
+
try {
|
20834 |
+
var info = gen[key](arg);
|
20835 |
+
var value = info.value;
|
20836 |
+
} catch (error) {
|
20837 |
+
reject(error);
|
20838 |
+
return;
|
20839 |
+
}
|
20840 |
|
20841 |
+
if (info.done) {
|
20842 |
+
resolve(value);
|
20843 |
+
} else {
|
20844 |
+
Promise.resolve(value).then(_next, _throw);
|
20845 |
+
}
|
20846 |
+
}
|
20847 |
|
20848 |
+
function _asyncToGenerator(fn) {
|
20849 |
+
return function () {
|
20850 |
+
var self = this,
|
20851 |
+
args = arguments;
|
20852 |
+
return new Promise(function (resolve, reject) {
|
20853 |
+
var gen = fn.apply(self, args);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20854 |
|
20855 |
+
function _next(value) {
|
20856 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
20857 |
+
}
|
20858 |
|
20859 |
+
function _throw(err) {
|
20860 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
20861 |
+
}
|
|
|
20862 |
|
20863 |
+
_next(undefined);
|
20864 |
+
});
|
20865 |
+
};
|
20866 |
+
}
|
20867 |
|
20868 |
+
/***/ }),
|
20869 |
+
/* 153 */
|
20870 |
+
/***/ (function(module, exports, __webpack_require__) {
|
20871 |
|
20872 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20873 |
|
|
|
|
|
|
|
|
|
|
|
|
|
20874 |
|
20875 |
+
Object.defineProperty(exports, "__esModule", {
|
20876 |
+
value: true
|
20877 |
+
});
|
20878 |
+
exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20879 |
|
20880 |
+
var _keys = __webpack_require__(154);
|
|
|
|
|
20881 |
|
20882 |
+
var _keys2 = _interopRequireDefault(_keys);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20883 |
|
20884 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
|
|
|
20885 |
|
20886 |
+
var all = exports.all = function all(value) {
|
20887 |
+
return {
|
20888 |
+
type: _keys2.default.all,
|
20889 |
+
value: value
|
20890 |
+
};
|
20891 |
+
};
|
20892 |
|
20893 |
+
var error = exports.error = function error(err) {
|
20894 |
+
return {
|
20895 |
+
type: _keys2.default.error,
|
20896 |
+
error: err
|
20897 |
+
};
|
20898 |
+
};
|
20899 |
|
20900 |
+
var fork = exports.fork = function fork(iterator) {
|
20901 |
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
20902 |
+
args[_key - 1] = arguments[_key];
|
20903 |
+
}
|
20904 |
|
20905 |
+
return {
|
20906 |
+
type: _keys2.default.fork,
|
20907 |
+
iterator: iterator,
|
20908 |
+
args: args
|
20909 |
+
};
|
20910 |
+
};
|
20911 |
|
20912 |
+
var join = exports.join = function join(task) {
|
20913 |
+
return {
|
20914 |
+
type: _keys2.default.join,
|
20915 |
+
task: task
|
20916 |
+
};
|
20917 |
+
};
|
|
|
|
|
|
|
|
|
20918 |
|
20919 |
+
var race = exports.race = function race(competitors) {
|
20920 |
+
return {
|
20921 |
+
type: _keys2.default.race,
|
20922 |
+
competitors: competitors
|
20923 |
+
};
|
20924 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20925 |
|
20926 |
+
var delay = exports.delay = function delay(timeout) {
|
20927 |
+
return new Promise(function (resolve) {
|
20928 |
+
setTimeout(function () {
|
20929 |
+
return resolve(true);
|
20930 |
+
}, timeout);
|
20931 |
+
});
|
20932 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20933 |
|
20934 |
+
var invoke = exports.invoke = function invoke(func) {
|
20935 |
+
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
20936 |
+
args[_key2 - 1] = arguments[_key2];
|
20937 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20938 |
|
20939 |
+
return {
|
20940 |
+
type: _keys2.default.call,
|
20941 |
+
func: func,
|
20942 |
+
context: null,
|
20943 |
+
args: args
|
20944 |
+
};
|
20945 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20946 |
|
20947 |
+
var call = exports.call = function call(func, context) {
|
20948 |
+
for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
20949 |
+
args[_key3 - 2] = arguments[_key3];
|
20950 |
+
}
|
|
|
|
|
|
|
|
|
|
|
20951 |
|
20952 |
+
return {
|
20953 |
+
type: _keys2.default.call,
|
20954 |
+
func: func,
|
20955 |
+
context: context,
|
20956 |
+
args: args
|
20957 |
+
};
|
20958 |
+
};
|
20959 |
|
20960 |
+
var apply = exports.apply = function apply(func, context, args) {
|
20961 |
+
return {
|
20962 |
+
type: _keys2.default.call,
|
20963 |
+
func: func,
|
20964 |
+
context: context,
|
20965 |
+
args: args
|
20966 |
+
};
|
20967 |
+
};
|
20968 |
|
20969 |
+
var cps = exports.cps = function cps(func) {
|
20970 |
+
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
20971 |
+
args[_key4 - 1] = arguments[_key4];
|
20972 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20973 |
|
20974 |
+
return {
|
20975 |
+
type: _keys2.default.cps,
|
20976 |
+
func: func,
|
20977 |
+
args: args
|
20978 |
+
};
|
20979 |
+
};
|
20980 |
|
20981 |
+
var subscribe = exports.subscribe = function subscribe(channel) {
|
20982 |
+
return {
|
20983 |
+
type: _keys2.default.subscribe,
|
20984 |
+
channel: channel
|
20985 |
+
};
|
20986 |
+
};
|
20987 |
|
20988 |
+
var createChannel = exports.createChannel = function createChannel(callback) {
|
20989 |
+
var listeners = [];
|
20990 |
+
var subscribe = function subscribe(l) {
|
20991 |
+
listeners.push(l);
|
20992 |
+
return function () {
|
20993 |
+
return listeners.splice(listeners.indexOf(l), 1);
|
20994 |
+
};
|
20995 |
+
};
|
20996 |
+
var next = function next(val) {
|
20997 |
+
return listeners.forEach(function (l) {
|
20998 |
+
return l(val);
|
20999 |
+
});
|
21000 |
+
};
|
21001 |
+
callback(next);
|
21002 |
|
21003 |
+
return {
|
21004 |
+
subscribe: subscribe
|
21005 |
+
};
|
21006 |
+
};
|
|
|
21007 |
|
21008 |
+
/***/ }),
|
21009 |
+
/* 154 */
|
21010 |
+
/***/ (function(module, exports, __webpack_require__) {
|
21011 |
|
21012 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21013 |
|
|
|
|
|
|
|
|
|
|
|
21014 |
|
21015 |
+
Object.defineProperty(exports, "__esModule", {
|
21016 |
+
value: true
|
21017 |
+
});
|
21018 |
+
var keys = {
|
21019 |
+
all: Symbol('all'),
|
21020 |
+
error: Symbol('error'),
|
21021 |
+
fork: Symbol('fork'),
|
21022 |
+
join: Symbol('join'),
|
21023 |
+
race: Symbol('race'),
|
21024 |
+
call: Symbol('call'),
|
21025 |
+
cps: Symbol('cps'),
|
21026 |
+
subscribe: Symbol('subscribe')
|
21027 |
+
};
|
21028 |
|
21029 |
+
exports.default = keys;
|
|
|
21030 |
|
21031 |
+
/***/ }),
|
21032 |
+
/* 155 */
|
21033 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
21034 |
|
21035 |
+
"use strict";
|
21036 |
+
/**
|
21037 |
+
* Validate a namespace string.
|
21038 |
+
*
|
21039 |
+
* @param {string} namespace The namespace to validate - should take the form
|
21040 |
+
* `vendor/plugin/function`.
|
21041 |
+
*
|
21042 |
+
* @return {boolean} Whether the namespace is valid.
|
21043 |
+
*/
|
21044 |
+
function validateNamespace(namespace) {
|
21045 |
+
if ('string' !== typeof namespace || '' === namespace) {
|
21046 |
+
// eslint-disable-next-line no-console
|
21047 |
+
console.error('The namespace must be a non-empty string.');
|
21048 |
+
return false;
|
21049 |
+
}
|
21050 |
|
21051 |
+
if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
|
21052 |
+
// eslint-disable-next-line no-console
|
21053 |
+
console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');
|
21054 |
+
return false;
|
21055 |
+
}
|
|
|
21056 |
|
21057 |
+
return true;
|
21058 |
+
}
|
|
|
|
|
|
|
21059 |
|
21060 |
+
/* harmony default export */ __webpack_exports__["a"] = (validateNamespace);
|
21061 |
+
//# sourceMappingURL=validateNamespace.js.map
|
21062 |
|
21063 |
+
/***/ }),
|
21064 |
+
/* 156 */
|
21065 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
21066 |
|
21067 |
+
"use strict";
|
21068 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
|
21069 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
21070 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
|
21071 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(104);
|
21072 |
|
|
|
|
|
|
|
|
|
|
|
21073 |
|
|
|
|
|
21074 |
|
21075 |
+
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; }
|
|
|
|
|
|
|
|
|
21076 |
|
21077 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
|
|
21078 |
|
21079 |
+
/**
|
21080 |
+
* Internal dependencies
|
21081 |
+
*/
|
21082 |
+
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
|
|
|
21083 |
|
21084 |
+
/* eslint-disable jsdoc/valid-types */
|
21085 |
|
21086 |
+
/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */
|
21087 |
|
21088 |
+
/* eslint-enable jsdoc/valid-types */
|
21089 |
|
21090 |
+
/**
|
21091 |
+
* Component used as equivalent of Fragment with unescaped HTML, in cases where
|
21092 |
+
* it is desirable to render dangerous HTML without needing a wrapper element.
|
21093 |
+
* To preserve additional props, a `div` wrapper _will_ be created if any props
|
21094 |
+
* aside from `children` are passed.
|
21095 |
+
*
|
21096 |
+
* @param {RawHTMLProps} props Children should be a string of HTML. Other props
|
21097 |
+
* will be passed through to div wrapper.
|
21098 |
+
*
|
21099 |
+
* @return {JSX.Element} Dangerously-rendering component.
|
21100 |
+
*/
|
21101 |
|
21102 |
+
function RawHTML(_ref) {
|
21103 |
+
var children = _ref.children,
|
21104 |
+
props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
|
21105 |
|
21106 |
+
// The DIV wrapper will be stripped by serializer, unless there are
|
21107 |
+
// non-children props present.
|
21108 |
+
return Object(__WEBPACK_IMPORTED_MODULE_2__react__["e" /* createElement */])('div', _objectSpread({
|
21109 |
+
dangerouslySetInnerHTML: {
|
21110 |
+
__html: children
|
21111 |
+
}
|
21112 |
+
}, props));
|
21113 |
+
}
|
21114 |
+
//# sourceMappingURL=raw-html.js.map
|
21115 |
|
21116 |
/***/ }),
|
21117 |
+
/* 157 */
|
21118 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21119 |
|
21120 |
"use strict";
|
21121 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useInstanceId;
|
21122 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
|
21123 |
+
/**
|
21124 |
+
* WordPress dependencies
|
21125 |
+
*/
|
21126 |
|
21127 |
+
var instanceMap = new WeakMap();
|
21128 |
+
/**
|
21129 |
+
* Creates a new id for a given object.
|
21130 |
+
*
|
21131 |
+
* @param {Object} object Object reference to create an id for.
|
21132 |
+
*/
|
21133 |
|
21134 |
+
function createId(object) {
|
21135 |
+
var instances = instanceMap.get(object) || 0;
|
21136 |
+
instanceMap.set(object, instances + 1);
|
21137 |
+
return instances;
|
21138 |
+
}
|
21139 |
+
/**
|
21140 |
+
* Provides a unique instance ID.
|
21141 |
+
*
|
21142 |
+
* @param {Object} object Object reference to create an id for.
|
21143 |
+
*/
|
|
|
|
|
21144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21145 |
|
21146 |
+
function useInstanceId(object) {
|
21147 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["j" /* useMemo */])(function () {
|
21148 |
+
return createId(object);
|
21149 |
+
}, [object]);
|
21150 |
}
|
21151 |
+
//# sourceMappingURL=index.js.map
|
21152 |
|
21153 |
/***/ }),
|
21154 |
+
/* 158 */
|
21155 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21156 |
|
21157 |
"use strict";
|
21158 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useSelect;
|
21159 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(33);
|
21160 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_use_memo_one__ = __webpack_require__(543);
|
21161 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__wordpress_priority_queue__ = __webpack_require__(544);
|
21162 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_element__ = __webpack_require__(15);
|
21163 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal__ = __webpack_require__(105);
|
21164 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal__);
|
21165 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__registry_provider_use_registry__ = __webpack_require__(80);
|
21166 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__async_mode_provider_use_async_mode__ = __webpack_require__(160);
|
21167 |
|
21168 |
|
21169 |
+
/**
|
21170 |
+
* External dependencies
|
21171 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21172 |
|
21173 |
+
/**
|
21174 |
+
* WordPress dependencies
|
21175 |
+
*/
|
|
|
21176 |
|
|
|
21177 |
|
|
|
|
|
21178 |
|
|
|
21179 |
|
21180 |
+
/**
|
21181 |
+
* Internal dependencies
|
21182 |
+
*/
|
|
|
21183 |
|
|
|
|
|
21184 |
|
21185 |
|
21186 |
+
/**
|
21187 |
+
* Favor useLayoutEffect to ensure the store subscription callback always has
|
21188 |
+
* the selector from the latest render. If a store update happens between render
|
21189 |
+
* and the effect, this could cause missed/stale updates or inconsistent state.
|
21190 |
+
*
|
21191 |
+
* Fallback to useEffect for server rendered components because currently React
|
21192 |
+
* throws a warning when using useLayoutEffect in that environment.
|
21193 |
+
*/
|
21194 |
|
21195 |
+
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? __WEBPACK_IMPORTED_MODULE_3__wordpress_element__["i" /* useLayoutEffect */] : __WEBPACK_IMPORTED_MODULE_3__wordpress_element__["h" /* useEffect */];
|
21196 |
+
var renderQueue = Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_priority_queue__["a" /* createQueue */])();
|
21197 |
+
/**
|
21198 |
+
* Custom react hook for retrieving props from registered selectors.
|
21199 |
+
*
|
21200 |
+
* In general, this custom React hook follows the
|
21201 |
+
* [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
|
21202 |
+
*
|
21203 |
+
* @param {Function} _mapSelect Function called on every state change. The
|
21204 |
+
* returned value is exposed to the component
|
21205 |
+
* implementing this hook. The function receives
|
21206 |
+
* the `registry.select` method on the first
|
21207 |
+
* argument and the `registry` on the second
|
21208 |
+
* argument.
|
21209 |
+
* @param {Array} deps If provided, this memoizes the mapSelect so the
|
21210 |
+
* same `mapSelect` is invoked on every state
|
21211 |
+
* change unless the dependencies change.
|
21212 |
+
*
|
21213 |
+
* @example
|
21214 |
+
* ```js
|
21215 |
+
* const { useSelect } = wp.data;
|
21216 |
+
*
|
21217 |
+
* function HammerPriceDisplay( { currency } ) {
|
21218 |
+
* const price = useSelect( ( select ) => {
|
21219 |
+
* return select( 'my-shop' ).getPrice( 'hammer', currency )
|
21220 |
+
* }, [ currency ] );
|
21221 |
+
* return new Intl.NumberFormat( 'en-US', {
|
21222 |
+
* style: 'currency',
|
21223 |
+
* currency,
|
21224 |
+
* } ).format( price );
|
21225 |
+
* }
|
21226 |
+
*
|
21227 |
+
* // Rendered in the application:
|
21228 |
+
* // <HammerPriceDisplay currency="USD" />
|
21229 |
+
* ```
|
21230 |
+
*
|
21231 |
+
* In the above example, when `HammerPriceDisplay` is rendered into an
|
21232 |
+
* application, the price will be retrieved from the store state using the
|
21233 |
+
* `mapSelect` callback on `useSelect`. If the currency prop changes then
|
21234 |
+
* any price in the state for that currency is retrieved. If the currency prop
|
21235 |
+
* doesn't change and other props are passed in that do change, the price will
|
21236 |
+
* not change because the dependency is just the currency.
|
21237 |
+
*
|
21238 |
+
* @return {Function} A custom react hook.
|
21239 |
+
*/
|
21240 |
|
21241 |
+
function useSelect(_mapSelect, deps) {
|
21242 |
+
var mapSelect = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["f" /* useCallback */])(_mapSelect, deps);
|
21243 |
+
var registry = Object(__WEBPACK_IMPORTED_MODULE_5__registry_provider_use_registry__["a" /* default */])();
|
21244 |
+
var isAsync = Object(__WEBPACK_IMPORTED_MODULE_6__async_mode_provider_use_async_mode__["a" /* default */])(); // React can sometimes clear the `useMemo` cache.
|
21245 |
+
// We use the cache-stable `useMemoOne` to avoid
|
21246 |
+
// losing queues.
|
21247 |
|
21248 |
+
var queueContext = Object(__WEBPACK_IMPORTED_MODULE_1_use_memo_one__["a" /* useMemoOne */])(function () {
|
21249 |
+
return {
|
21250 |
+
queue: true
|
21251 |
+
};
|
21252 |
+
}, [registry]);
|
21253 |
|
21254 |
+
var _useReducer = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["k" /* useReducer */])(function (s) {
|
21255 |
+
return s + 1;
|
21256 |
+
}, 0),
|
21257 |
+
_useReducer2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_useReducer, 2),
|
21258 |
+
forceRender = _useReducer2[1];
|
21259 |
|
21260 |
+
var latestMapSelect = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
|
21261 |
+
var latestIsAsync = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])(isAsync);
|
21262 |
+
var latestMapOutput = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
|
21263 |
+
var latestMapOutputError = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
|
21264 |
+
var isMountedAndNotUnsubscribing = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
|
21265 |
+
var mapOutput;
|
21266 |
|
21267 |
+
try {
|
21268 |
+
if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
|
21269 |
+
mapOutput = mapSelect(registry.select, registry);
|
21270 |
+
} else {
|
21271 |
+
mapOutput = latestMapOutput.current;
|
21272 |
}
|
21273 |
+
} catch (error) {
|
21274 |
+
var errorMessage = "An error occurred while running 'mapSelect': ".concat(error.message);
|
|
|
|
|
|
|
|
|
|
|
|
|
21275 |
|
21276 |
+
if (latestMapOutputError.current) {
|
21277 |
+
errorMessage += "\nThe error may be correlated with this previous error:\n";
|
21278 |
+
errorMessage += "".concat(latestMapOutputError.current.stack, "\n\n");
|
21279 |
+
errorMessage += 'Original stack trace:';
|
21280 |
+
throw new Error(errorMessage);
|
21281 |
+
} else {
|
21282 |
+
// eslint-disable-next-line no-console
|
21283 |
+
console.error(errorMessage);
|
21284 |
}
|
21285 |
+
}
|
21286 |
|
21287 |
+
useIsomorphicLayoutEffect(function () {
|
21288 |
+
latestMapSelect.current = mapSelect;
|
21289 |
+
latestMapOutput.current = mapOutput;
|
21290 |
+
latestMapOutputError.current = undefined;
|
21291 |
+
isMountedAndNotUnsubscribing.current = true; // This has to run after the other ref updates
|
21292 |
+
// to avoid using stale values in the flushed
|
21293 |
+
// callbacks or potentially overwriting a
|
21294 |
+
// changed `latestMapOutput.current`.
|
21295 |
+
|
21296 |
+
if (latestIsAsync.current !== isAsync) {
|
21297 |
+
latestIsAsync.current = isAsync;
|
21298 |
+
renderQueue.flush(queueContext);
|
21299 |
}
|
21300 |
+
});
|
21301 |
+
useIsomorphicLayoutEffect(function () {
|
21302 |
+
var onStoreChange = function onStoreChange() {
|
21303 |
+
if (isMountedAndNotUnsubscribing.current) {
|
21304 |
+
try {
|
21305 |
+
var newMapOutput = latestMapSelect.current(registry.select, registry);
|
21306 |
|
21307 |
+
if (__WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal___default()(latestMapOutput.current, newMapOutput)) {
|
21308 |
+
return;
|
21309 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21310 |
|
21311 |
+
latestMapOutput.current = newMapOutput;
|
21312 |
+
} catch (error) {
|
21313 |
+
latestMapOutputError.current = error;
|
21314 |
+
}
|
21315 |
|
21316 |
+
forceRender();
|
21317 |
+
}
|
21318 |
+
}; // catch any possible state changes during mount before the subscription
|
21319 |
+
// could be set.
|
21320 |
|
|
|
|
|
|
|
21321 |
|
21322 |
+
if (latestIsAsync.current) {
|
21323 |
+
renderQueue.add(queueContext, onStoreChange);
|
21324 |
+
} else {
|
21325 |
+
onStoreChange();
|
21326 |
+
}
|
21327 |
+
|
21328 |
+
var unsubscribe = registry.subscribe(function () {
|
21329 |
+
if (latestIsAsync.current) {
|
21330 |
+
renderQueue.add(queueContext, onStoreChange);
|
21331 |
+
} else {
|
21332 |
+
onStoreChange();
|
21333 |
+
}
|
21334 |
+
});
|
21335 |
+
return function () {
|
21336 |
+
isMountedAndNotUnsubscribing.current = false;
|
21337 |
+
unsubscribe();
|
21338 |
+
renderQueue.flush(queueContext);
|
21339 |
+
};
|
21340 |
+
}, [registry]);
|
21341 |
+
return mapOutput;
|
21342 |
+
}
|
21343 |
+
//# sourceMappingURL=index.js.map
|
21344 |
|
21345 |
/***/ }),
|
21346 |
+
/* 159 */
|
21347 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21348 |
|
21349 |
+
"use strict";
|
21350 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Context; });
|
21351 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return RegistryConsumer; });
|
21352 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
|
21353 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__default_registry__ = __webpack_require__(101);
|
21354 |
+
/**
|
21355 |
+
* WordPress dependencies
|
21356 |
+
*/
|
21357 |
|
21358 |
+
/**
|
21359 |
+
* Internal dependencies
|
21360 |
+
*/
|
21361 |
|
21362 |
|
21363 |
+
var Context = Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["c" /* createContext */])(__WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */]);
|
21364 |
+
var Consumer = Context.Consumer,
|
21365 |
+
Provider = Context.Provider;
|
21366 |
+
/**
|
21367 |
+
* A custom react Context consumer exposing the provided `registry` to
|
21368 |
+
* children components. Used along with the RegistryProvider.
|
21369 |
+
*
|
21370 |
+
* You can read more about the react context api here:
|
21371 |
+
* https://reactjs.org/docs/context.html#contextprovider
|
21372 |
+
*
|
21373 |
+
* @example
|
21374 |
+
* ```js
|
21375 |
+
* const {
|
21376 |
+
* RegistryProvider,
|
21377 |
+
* RegistryConsumer,
|
21378 |
+
* createRegistry
|
21379 |
+
* } = wp.data;
|
21380 |
+
*
|
21381 |
+
* const registry = createRegistry( {} );
|
21382 |
+
*
|
21383 |
+
* const App = ( { props } ) => {
|
21384 |
+
* return <RegistryProvider value={ registry }>
|
21385 |
+
* <div>Hello There</div>
|
21386 |
+
* <RegistryConsumer>
|
21387 |
+
* { ( registry ) => (
|
21388 |
+
* <ComponentUsingRegistry
|
21389 |
+
* { ...props }
|
21390 |
+
* registry={ registry }
|
21391 |
+
* ) }
|
21392 |
+
* </RegistryConsumer>
|
21393 |
+
* </RegistryProvider>
|
21394 |
+
* }
|
21395 |
+
* ```
|
21396 |
+
*/
|
21397 |
|
21398 |
+
var RegistryConsumer = Consumer;
|
21399 |
+
/**
|
21400 |
+
* A custom Context provider for exposing the provided `registry` to children
|
21401 |
+
* components via a consumer.
|
21402 |
+
*
|
21403 |
+
* See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
|
21404 |
+
* example.
|
21405 |
+
*/
|
21406 |
|
21407 |
+
/* unused harmony default export */ var _unused_webpack_default_export = (Provider);
|
21408 |
+
//# sourceMappingURL=context.js.map
|
21409 |
|
21410 |
/***/ }),
|
21411 |
+
/* 160 */
|
21412 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21413 |
|
21414 |
+
"use strict";
|
21415 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = useAsyncMode;
|
21416 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
|
21417 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__context__ = __webpack_require__(161);
|
21418 |
+
/**
|
21419 |
+
* WordPress dependencies
|
21420 |
+
*/
|
21421 |
+
|
21422 |
+
/**
|
21423 |
+
* Internal dependencies
|
21424 |
+
*/
|
21425 |
|
21426 |
|
21427 |
+
function useAsyncMode() {
|
21428 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["g" /* useContext */])(__WEBPACK_IMPORTED_MODULE_1__context__["a" /* Context */]);
|
21429 |
+
}
|
21430 |
+
//# sourceMappingURL=use-async-mode.js.map
|
21431 |
+
|
21432 |
/***/ }),
|
21433 |
+
/* 161 */
|
21434 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21435 |
|
21436 |
"use strict";
|
21437 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Context; });
|
21438 |
+
/* unused harmony export AsyncModeConsumer */
|
21439 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
|
21440 |
+
/**
|
21441 |
+
* WordPress dependencies
|
21442 |
+
*/
|
21443 |
|
21444 |
+
var Context = Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["c" /* createContext */])(false);
|
21445 |
+
var Consumer = Context.Consumer,
|
21446 |
+
Provider = Context.Provider;
|
21447 |
+
var AsyncModeConsumer = Consumer;
|
21448 |
+
/**
|
21449 |
+
* Context Provider Component used to switch the data module component rerendering
|
21450 |
+
* between Sync and Async modes.
|
21451 |
+
*
|
21452 |
+
* @example
|
21453 |
+
*
|
21454 |
+
* ```js
|
21455 |
+
* import { useSelect, AsyncModeProvider } from '@wordpress/data';
|
21456 |
+
*
|
21457 |
+
* function BlockCount() {
|
21458 |
+
* const count = useSelect( ( select ) => {
|
21459 |
+
* return select( 'core/block-editor' ).getBlockCount()
|
21460 |
+
* }, [] );
|
21461 |
+
*
|
21462 |
+
* return count;
|
21463 |
+
* }
|
21464 |
+
*
|
21465 |
+
* function App() {
|
21466 |
+
* return (
|
21467 |
+
* <AsyncModeProvider value={ true }>
|
21468 |
+
* <BlockCount />
|
21469 |
+
* </AsyncModeProvider>
|
21470 |
+
* );
|
21471 |
+
* }
|
21472 |
+
* ```
|
21473 |
+
*
|
21474 |
+
* In this example, the BlockCount component is rerendered asynchronously.
|
21475 |
+
* It means if a more critical task is being performed (like typing in an input),
|
21476 |
+
* the rerendering is delayed until the browser becomes IDLE.
|
21477 |
+
* It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.
|
21478 |
+
*
|
21479 |
+
* @param {boolean} props.value Enable Async Mode.
|
21480 |
+
* @return {WPComponent} The component to be rendered.
|
21481 |
+
*/
|
21482 |
|
21483 |
+
/* unused harmony default export */ var _unused_webpack_default_export = (Provider);
|
21484 |
+
//# sourceMappingURL=context.js.map
|
|
|
21485 |
|
21486 |
+
/***/ }),
|
21487 |
+
/* 162 */
|
21488 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
21489 |
|
21490 |
+
"use strict";
|
21491 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__use_dispatch__ = __webpack_require__(547);
|
21492 |
+
/* unused harmony reexport useDispatch */
|
21493 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__use_dispatch_with_map__ = __webpack_require__(548);
|
21494 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__use_dispatch_with_map__["a"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
21495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21496 |
|
21497 |
+
//# sourceMappingURL=index.js.map
|
21498 |
+
|
21499 |
+
/***/ }),
|
21500 |
+
/* 163 */
|
21501 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21502 |
+
|
21503 |
+
"use strict";
|
21504 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__context__ = __webpack_require__(159);
|
21505 |
+
/* unused harmony reexport RegistryProvider */
|
21506 |
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__context__["b"]; });
|
21507 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__use_registry__ = __webpack_require__(80);
|
21508 |
+
/* unused harmony reexport useRegistry */
|
21509 |
|
|
|
|
|
21510 |
|
21511 |
+
//# sourceMappingURL=index.js.map
|
21512 |
|
21513 |
/***/ }),
|
21514 |
+
/* 164 */
|
21515 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21516 |
|
21517 |
"use strict";
|
21518 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = applyFormat;
|
21519 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(23);
|
21520 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(14);
|
21521 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
|
21522 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
|
21523 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__normalise_formats__ = __webpack_require__(50);
|
21524 |
|
21525 |
|
|
|
21526 |
|
21527 |
+
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; }
|
|
|
|
|
21528 |
|
21529 |
+
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) { Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__["a" /* 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; }
|
21530 |
|
21531 |
+
/**
|
21532 |
+
* External dependencies
|
21533 |
+
*/
|
21534 |
|
21535 |
+
/**
|
21536 |
+
* Internal dependencies
|
21537 |
+
*/
|
|
|
|
|
21538 |
|
|
|
|
|
|
|
21539 |
|
|
|
|
|
|
|
21540 |
|
21541 |
+
function replace(array, index, value) {
|
21542 |
+
array = array.slice();
|
21543 |
+
array[index] = value;
|
21544 |
+
return array;
|
|
|
21545 |
}
|
21546 |
+
/**
|
21547 |
+
* Apply a format object to a Rich Text value from the given `startIndex` to the
|
21548 |
+
* given `endIndex`. Indices are retrieved from the selection if none are
|
21549 |
+
* provided.
|
21550 |
+
*
|
21551 |
+
* @param {Object} value Value to modify.
|
21552 |
+
* @param {Object} format Format to apply.
|
21553 |
+
* @param {number} [startIndex] Start index.
|
21554 |
+
* @param {number} [endIndex] End index.
|
21555 |
+
*
|
21556 |
+
* @return {Object} A new value with the format applied.
|
21557 |
+
*/
|
21558 |
|
|
|
|
|
|
|
21559 |
|
21560 |
+
function applyFormat(value, format) {
|
21561 |
+
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
21562 |
+
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
21563 |
+
var formats = value.formats,
|
21564 |
+
activeFormats = value.activeFormats;
|
21565 |
+
var newFormats = formats.slice(); // The selection is collapsed.
|
21566 |
+
|
21567 |
+
if (startIndex === endIndex) {
|
21568 |
+
var startFormat = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["find"])(newFormats[startIndex], {
|
21569 |
+
type: format.type
|
21570 |
+
}); // If the caret is at a format of the same type, expand start and end to
|
21571 |
+
// the edges of the format. This is useful to apply new attributes.
|
21572 |
+
|
21573 |
+
if (startFormat) {
|
21574 |
+
var index = newFormats[startIndex].indexOf(startFormat);
|
21575 |
+
|
21576 |
+
while (newFormats[startIndex] && newFormats[startIndex][index] === startFormat) {
|
21577 |
+
newFormats[startIndex] = replace(newFormats[startIndex], index, format);
|
21578 |
+
startIndex--;
|
21579 |
+
}
|
21580 |
+
|
21581 |
+
endIndex++;
|
21582 |
+
|
21583 |
+
while (newFormats[endIndex] && newFormats[endIndex][index] === startFormat) {
|
21584 |
+
newFormats[endIndex] = replace(newFormats[endIndex], index, format);
|
21585 |
+
endIndex++;
|
21586 |
+
}
|
21587 |
+
}
|
21588 |
+
} else {
|
21589 |
+
// Determine the highest position the new format can be inserted at.
|
21590 |
+
var position = +Infinity;
|
21591 |
+
|
21592 |
+
for (var _index = startIndex; _index < endIndex; _index++) {
|
21593 |
+
if (newFormats[_index]) {
|
21594 |
+
newFormats[_index] = newFormats[_index].filter(function (_ref) {
|
21595 |
+
var type = _ref.type;
|
21596 |
+
return type !== format.type;
|
21597 |
+
});
|
21598 |
+
var length = newFormats[_index].length;
|
21599 |
+
|
21600 |
+
if (length < position) {
|
21601 |
+
position = length;
|
21602 |
+
}
|
21603 |
+
} else {
|
21604 |
+
newFormats[_index] = [];
|
21605 |
+
position = 0;
|
21606 |
+
}
|
21607 |
+
}
|
21608 |
+
|
21609 |
+
for (var _index2 = startIndex; _index2 < endIndex; _index2++) {
|
21610 |
+
newFormats[_index2].splice(position, 0, format);
|
21611 |
+
}
|
21612 |
+
}
|
21613 |
+
|
21614 |
+
return Object(__WEBPACK_IMPORTED_MODULE_3__normalise_formats__["a" /* normaliseFormats */])(_objectSpread({}, value, {
|
21615 |
+
formats: newFormats,
|
21616 |
+
// Always revise active formats. This serves as a placeholder for new
|
21617 |
+
// inputs with the format so new input appears with the format applied,
|
21618 |
+
// and ensures a format of the same type uses the latest values.
|
21619 |
+
activeFormats: [].concat(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["reject"])(activeFormats, {
|
21620 |
+
type: format.type
|
21621 |
+
})), [format])
|
21622 |
+
}));
|
21623 |
}
|
21624 |
+
//# sourceMappingURL=apply-format.js.map
|
21625 |
|
21626 |
+
/***/ }),
|
21627 |
+
/* 165 */
|
21628 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21629 |
+
|
21630 |
+
"use strict";
|
21631 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = mergePair;
|
21632 |
+
/* unused harmony export concat */
|
21633 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__normalise_formats__ = __webpack_require__(50);
|
21634 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create__ = __webpack_require__(51);
|
21635 |
+
/**
|
21636 |
+
* Internal dependencies
|
21637 |
+
*/
|
21638 |
+
|
21639 |
+
|
21640 |
+
/**
|
21641 |
+
* Concats a pair of rich text values. Not that this mutates `a` and does NOT
|
21642 |
+
* normalise formats!
|
21643 |
+
*
|
21644 |
+
* @param {Object} a Value to mutate.
|
21645 |
+
* @param {Object} b Value to add read from.
|
21646 |
+
*
|
21647 |
+
* @return {Object} `a`, mutated.
|
21648 |
+
*/
|
21649 |
+
|
21650 |
+
function mergePair(a, b) {
|
21651 |
+
a.formats = a.formats.concat(b.formats);
|
21652 |
+
a.replacements = a.replacements.concat(b.replacements);
|
21653 |
+
a.text += b.text;
|
21654 |
+
return a;
|
21655 |
}
|
21656 |
+
/**
|
21657 |
+
* Combine all Rich Text values into one. This is similar to
|
21658 |
+
* `String.prototype.concat`.
|
21659 |
+
*
|
21660 |
+
* @param {...Object} values Objects to combine.
|
21661 |
+
*
|
21662 |
+
* @return {Object} A new value combining all given records.
|
21663 |
+
*/
|
21664 |
|
21665 |
+
function concat() {
|
21666 |
+
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
21667 |
+
values[_key] = arguments[_key];
|
21668 |
}
|
21669 |
|
21670 |
+
return Object(__WEBPACK_IMPORTED_MODULE_0__normalise_formats__["a" /* normaliseFormats */])(values.reduce(mergePair, Object(__WEBPACK_IMPORTED_MODULE_1__create__["a" /* create */])()));
|
21671 |
+
}
|
21672 |
+
//# sourceMappingURL=concat.js.map
|
21673 |
|
21674 |
+
/***/ }),
|
21675 |
+
/* 166 */
|
21676 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21677 |
+
|
21678 |
+
"use strict";
|
21679 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = getActiveObject;
|
21680 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(29);
|
21681 |
+
/**
|
21682 |
+
* Internal dependencies
|
21683 |
+
*/
|
21684 |
+
|
21685 |
+
/**
|
21686 |
+
* Gets the active object, if there is any.
|
21687 |
+
*
|
21688 |
+
* @param {Object} value Value to inspect.
|
21689 |
+
*
|
21690 |
+
* @return {?Object} Active object, or undefined.
|
21691 |
+
*/
|
21692 |
|
21693 |
+
function getActiveObject(_ref) {
|
21694 |
+
var start = _ref.start,
|
21695 |
+
end = _ref.end,
|
21696 |
+
replacements = _ref.replacements,
|
21697 |
+
text = _ref.text;
|
21698 |
|
21699 |
+
if (start + 1 !== end || text[start] !== __WEBPACK_IMPORTED_MODULE_0__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */]) {
|
21700 |
+
return;
|
21701 |
}
|
21702 |
|
21703 |
+
return replacements[start];
|
21704 |
}
|
21705 |
+
//# sourceMappingURL=get-active-object.js.map
|
21706 |
|
21707 |
+
/***/ }),
|
21708 |
+
/* 167 */
|
21709 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
21710 |
|
21711 |
+
"use strict";
|
21712 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = getTextContent;
|
21713 |
+
/**
|
21714 |
+
* Get the textual content of a Rich Text value. This is similar to
|
21715 |
+
* `Element.textContent`.
|
21716 |
+
*
|
21717 |
+
* @param {Object} value Value to use.
|
21718 |
+
*
|
21719 |
+
* @return {string} The text content.
|
21720 |
+
*/
|
21721 |
+
function getTextContent(_ref) {
|
21722 |
+
var text = _ref.text;
|
21723 |
+
return text;
|
21724 |
+
}
|
21725 |
+
//# sourceMappingURL=get-text-content.js.map
|
21726 |
|
21727 |
+
/***/ }),
|
21728 |
+
/* 168 */
|
21729 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21730 |
+
|
21731 |
+
"use strict";
|
21732 |
+
/* unused harmony export isEmpty */
|
21733 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = isEmptyLine;
|
21734 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(29);
|
21735 |
+
/**
|
21736 |
+
* Internal dependencies
|
21737 |
+
*/
|
21738 |
+
|
21739 |
+
/**
|
21740 |
+
* Check if a Rich Text value is Empty, meaning it contains no text or any
|
21741 |
+
* objects (such as images).
|
21742 |
+
*
|
21743 |
+
* @param {Object} value Value to use.
|
21744 |
+
*
|
21745 |
+
* @return {boolean} True if the value is empty, false if not.
|
21746 |
+
*/
|
21747 |
+
|
21748 |
+
function isEmpty(_ref) {
|
21749 |
+
var text = _ref.text;
|
21750 |
+
return text.length === 0;
|
21751 |
}
|
21752 |
+
/**
|
21753 |
+
* Check if the current collapsed selection is on an empty line in case of a
|
21754 |
+
* multiline value.
|
21755 |
+
*
|
21756 |
+
* @param {Object} value Value te check.
|
21757 |
+
*
|
21758 |
+
* @return {boolean} True if the line is empty, false if not.
|
21759 |
+
*/
|
21760 |
|
21761 |
+
function isEmptyLine(_ref2) {
|
21762 |
+
var text = _ref2.text,
|
21763 |
+
start = _ref2.start,
|
21764 |
+
end = _ref2.end;
|
21765 |
+
|
21766 |
+
if (start !== end) {
|
21767 |
+
return false;
|
21768 |
}
|
21769 |
|
21770 |
+
if (text.length === 0) {
|
21771 |
+
return true;
|
21772 |
}
|
21773 |
|
21774 |
+
if (start === 0 && text.slice(0, 1) === __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
|
21775 |
+
return true;
|
21776 |
+
}
|
21777 |
|
21778 |
+
if (start === text.length && text.slice(-1) === __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
|
21779 |
+
return true;
|
|
|
21780 |
}
|
|
|
21781 |
|
21782 |
+
return text.slice(start - 1, end + 1) === "".concat(__WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]).concat(__WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]);
|
21783 |
+
}
|
21784 |
+
//# sourceMappingURL=is-empty.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21785 |
|
21786 |
/***/ }),
|
21787 |
+
/* 169 */
|
21788 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
21789 |
|
21790 |
"use strict";
|
21791 |
+
/* harmony export (immutable) */ __webpack_exports__["a"] = replace;
|
21792 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__ = __webpack_require__(36);
|
21793 |
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__normalise_formats__ = __webpack_require__(50);
|
21794 |
|
21795 |
|
21796 |
+
/**
|
21797 |
+
* Internal dependencies
|
21798 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
21799 |
|
21800 |
+
/**
|
21801 |
+
* Search a Rich Text value and replace the match(es) with `replacement`. This
|
21802 |
+
* is similar to `String.prototype.replace`.
|
21803 |
+
*
|
21804 |
+
* @param {Object} value The value to modify.
|
21805 |
+
* @param {RegExp|string} pattern A RegExp object or literal. Can also be
|
21806 |
+
* a string. It is treated as a verbatim
|
21807 |
+
* string and is not interpreted as a
|
21808 |
+
* regular expression. Only the first
|
21809 |
+
* occurrence will be replaced.
|
21810 |
+
* @param {Function|string} replacement The match or matches are replaced with
|
21811 |
+
* the specified or the value returned by
|
21812 |
+
* the specified function.
|
21813 |
+
*
|
21814 |
+
* @return {Object} A new value with replacements applied.
|
21815 |
+
*/
|
21816 |
|
21817 |
+
function replace(_ref, pattern, replacement) {
|
21818 |
+
var formats = _ref.formats,
|
21819 |
+
replacements = _ref.replacements,
|
21820 |
+
text = _ref.text,
|
21821 |
+
start = _ref.start,
|
21822 |
+
end = _ref.end;
|
21823 |
+
text = text.replace(pattern, function (match) {
|
21824 |
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
21825 |
+
rest[_key - 1] = arguments[_key];
|
21826 |
+
}
|
21827 |
|
21828 |
+
var offset = rest[rest.length - 2];
|
21829 |
+
var newText = replacement;
|
21830 |
+
var newFormats;
|
21831 |
+
var newReplacements;
|
21832 |
|
21833 |
+
if (typeof newText === 'function') {
|
21834 |
+
newText = replacement.apply(void 0, [match].concat(rest));
|
21835 |
+
}
|
21836 |
|
21837 |
+
if (Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__["a" /* default */])(newText) === 'object') {
|
21838 |
+
newFormats = newText.formats;
|
21839 |
+
newReplacements = newText.replacements;
|
21840 |
+
newText = newText.text;
|
21841 |
+
} else {
|
21842 |
+
newFor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|