willba-component-library 0.0.69 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import * as React__default from 'react';
2
2
  import React__default__default, { useState, createContext, useContext, useRef, useEffect, forwardRef } from 'react';
3
3
 
4
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
-
6
4
  function getDefaultExportFromCjs (x) {
7
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
8
6
  }
@@ -6025,1833 +6023,6 @@ function DayPicker(props) {
6025
6023
  React__default__default.createElement(Root, { initialProps: props })));
6026
6024
  }
6027
6025
 
6028
- var reactResponsive = {exports: {}};
6029
-
6030
- (function (module, exports) {
6031
- (function webpackUniversalModuleDefinition(root, factory) {
6032
- module.exports = factory(React__default__default);
6033
- })(commonjsGlobal, (__WEBPACK_EXTERNAL_MODULE_react__) => {
6034
- return /******/ (() => { // webpackBootstrap
6035
- /******/ var __webpack_modules__ = ({
6036
-
6037
- /***/ "./node_modules/css-mediaquery/index.js":
6038
- /*!**********************************************!*\
6039
- !*** ./node_modules/css-mediaquery/index.js ***!
6040
- \**********************************************/
6041
- /***/ ((__unused_webpack_module, exports) => {
6042
- /*
6043
- Copyright (c) 2014, Yahoo! Inc. All rights reserved.
6044
- Copyrights licensed under the New BSD License.
6045
- See the accompanying LICENSE file for terms.
6046
- */
6047
-
6048
-
6049
-
6050
- exports.match = matchQuery;
6051
- exports.parse = parseQuery;
6052
-
6053
- // -----------------------------------------------------------------------------
6054
-
6055
- var RE_MEDIA_QUERY = /(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,
6056
- RE_MQ_EXPRESSION = /\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,
6057
- RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/,
6058
- RE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?$/,
6059
- RE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?$/;
6060
-
6061
- function matchQuery(mediaQuery, values) {
6062
- return parseQuery(mediaQuery).some(function (query) {
6063
- var inverse = query.inverse;
6064
-
6065
- // Either the parsed or specified `type` is "all", or the types must be
6066
- // equal for a match.
6067
- var typeMatch = query.type === 'all' || values.type === query.type;
6068
-
6069
- // Quit early when `type` doesn't match, but take "not" into account.
6070
- if ((typeMatch && inverse) || !(typeMatch || inverse)) {
6071
- return false;
6072
- }
6073
-
6074
- var expressionsMatch = query.expressions.every(function (expression) {
6075
- var feature = expression.feature,
6076
- modifier = expression.modifier,
6077
- expValue = expression.value,
6078
- value = values[feature];
6079
-
6080
- // Missing or falsy values don't match.
6081
- if (!value) { return false; }
6082
-
6083
- switch (feature) {
6084
- case 'orientation':
6085
- case 'scan':
6086
- return value.toLowerCase() === expValue.toLowerCase();
6087
-
6088
- case 'width':
6089
- case 'height':
6090
- case 'device-width':
6091
- case 'device-height':
6092
- expValue = toPx(expValue);
6093
- value = toPx(value);
6094
- break;
6095
-
6096
- case 'resolution':
6097
- expValue = toDpi(expValue);
6098
- value = toDpi(value);
6099
- break;
6100
-
6101
- case 'aspect-ratio':
6102
- case 'device-aspect-ratio':
6103
- case /* Deprecated */ 'device-pixel-ratio':
6104
- expValue = toDecimal(expValue);
6105
- value = toDecimal(value);
6106
- break;
6107
-
6108
- case 'grid':
6109
- case 'color':
6110
- case 'color-index':
6111
- case 'monochrome':
6112
- expValue = parseInt(expValue, 10) || 1;
6113
- value = parseInt(value, 10) || 0;
6114
- break;
6115
- }
6116
-
6117
- switch (modifier) {
6118
- case 'min': return value >= expValue;
6119
- case 'max': return value <= expValue;
6120
- default : return value === expValue;
6121
- }
6122
- });
6123
-
6124
- return (expressionsMatch && !inverse) || (!expressionsMatch && inverse);
6125
- });
6126
- }
6127
-
6128
- function parseQuery(mediaQuery) {
6129
- return mediaQuery.split(',').map(function (query) {
6130
- query = query.trim();
6131
-
6132
- var captures = query.match(RE_MEDIA_QUERY),
6133
- modifier = captures[1],
6134
- type = captures[2],
6135
- expressions = captures[3] || '',
6136
- parsed = {};
6137
-
6138
- parsed.inverse = !!modifier && modifier.toLowerCase() === 'not';
6139
- parsed.type = type ? type.toLowerCase() : 'all';
6140
-
6141
- // Split expressions into a list.
6142
- expressions = expressions.match(/\([^\)]+\)/g) || [];
6143
-
6144
- parsed.expressions = expressions.map(function (expression) {
6145
- var captures = expression.match(RE_MQ_EXPRESSION),
6146
- feature = captures[1].toLowerCase().match(RE_MQ_FEATURE);
6147
-
6148
- return {
6149
- modifier: feature[1],
6150
- feature : feature[2],
6151
- value : captures[2]
6152
- };
6153
- });
6154
-
6155
- return parsed;
6156
- });
6157
- }
6158
-
6159
- // -- Utilities ----------------------------------------------------------------
6160
-
6161
- function toDecimal(ratio) {
6162
- var decimal = Number(ratio),
6163
- numbers;
6164
-
6165
- if (!decimal) {
6166
- numbers = ratio.match(/^(\d+)\s*\/\s*(\d+)$/);
6167
- decimal = numbers[1] / numbers[2];
6168
- }
6169
-
6170
- return decimal;
6171
- }
6172
-
6173
- function toDpi(resolution) {
6174
- var value = parseFloat(resolution),
6175
- units = String(resolution).match(RE_RESOLUTION_UNIT)[1];
6176
-
6177
- switch (units) {
6178
- case 'dpcm': return value / 2.54;
6179
- case 'dppx': return value * 96;
6180
- default : return value;
6181
- }
6182
- }
6183
-
6184
- function toPx(length) {
6185
- var value = parseFloat(length),
6186
- units = String(length).match(RE_LENGTH_UNIT)[1];
6187
-
6188
- switch (units) {
6189
- case 'em' : return value * 16;
6190
- case 'rem': return value * 16;
6191
- case 'cm' : return value * 96 / 2.54;
6192
- case 'mm' : return value * 96 / 2.54 / 10;
6193
- case 'in' : return value * 96;
6194
- case 'pt' : return value * 72;
6195
- case 'pc' : return value * 72 / 12;
6196
- default : return value;
6197
- }
6198
- }
6199
-
6200
-
6201
- /***/ }),
6202
-
6203
- /***/ "./node_modules/hyphenate-style-name/index.js":
6204
- /*!****************************************************!*\
6205
- !*** ./node_modules/hyphenate-style-name/index.js ***!
6206
- \****************************************************/
6207
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6208
- __webpack_require__.r(__webpack_exports__);
6209
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6210
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6211
- /* harmony export */ });
6212
- /* eslint-disable no-var, prefer-template */
6213
- var uppercasePattern = /[A-Z]/g;
6214
- var msPattern = /^ms-/;
6215
- var cache = {};
6216
-
6217
- function toHyphenLower(match) {
6218
- return '-' + match.toLowerCase()
6219
- }
6220
-
6221
- function hyphenateStyleName(name) {
6222
- if (cache.hasOwnProperty(name)) {
6223
- return cache[name]
6224
- }
6225
-
6226
- var hName = name.replace(uppercasePattern, toHyphenLower);
6227
- return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
6228
- }
6229
-
6230
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hyphenateStyleName);
6231
-
6232
-
6233
- /***/ }),
6234
-
6235
- /***/ "./node_modules/matchmediaquery/index.js":
6236
- /*!***********************************************!*\
6237
- !*** ./node_modules/matchmediaquery/index.js ***!
6238
- \***********************************************/
6239
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6240
-
6241
-
6242
- var staticMatch = (__webpack_require__(/*! css-mediaquery */ "./node_modules/css-mediaquery/index.js").match);
6243
- var dynamicMatch = typeof window !== 'undefined' ? window.matchMedia : null;
6244
-
6245
- // our fake MediaQueryList
6246
- function Mql(query, values, forceStatic){
6247
- var self = this;
6248
- if(dynamicMatch && !forceStatic){
6249
- var mql = dynamicMatch.call(window, query);
6250
- this.matches = mql.matches;
6251
- this.media = mql.media;
6252
- // TODO: is there a time it makes sense to remove this listener?
6253
- mql.addListener(update);
6254
- } else {
6255
- this.matches = staticMatch(query, values);
6256
- this.media = query;
6257
- }
6258
-
6259
- this.addListener = addListener;
6260
- this.removeListener = removeListener;
6261
- this.dispose = dispose;
6262
-
6263
- function addListener(listener){
6264
- if(mql){
6265
- mql.addListener(listener);
6266
- }
6267
- }
6268
-
6269
- function removeListener(listener){
6270
- if(mql){
6271
- mql.removeListener(listener);
6272
- }
6273
- }
6274
-
6275
- // update ourselves!
6276
- function update(evt){
6277
- self.matches = evt.matches;
6278
- self.media = evt.media;
6279
- }
6280
-
6281
- function dispose(){
6282
- if(mql){
6283
- mql.removeListener(update);
6284
- }
6285
- }
6286
- }
6287
-
6288
- function matchMedia(query, values, forceStatic){
6289
- return new Mql(query, values, forceStatic);
6290
- }
6291
-
6292
- module.exports = matchMedia;
6293
-
6294
-
6295
- /***/ }),
6296
-
6297
- /***/ "./node_modules/object-assign/index.js":
6298
- /*!*********************************************!*\
6299
- !*** ./node_modules/object-assign/index.js ***!
6300
- \*********************************************/
6301
- /***/ ((module) => {
6302
- /*
6303
- object-assign
6304
- (c) Sindre Sorhus
6305
- @license MIT
6306
- */
6307
-
6308
-
6309
- /* eslint-disable no-unused-vars */
6310
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
6311
- var hasOwnProperty = Object.prototype.hasOwnProperty;
6312
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
6313
-
6314
- function toObject(val) {
6315
- if (val === null || val === undefined) {
6316
- throw new TypeError('Object.assign cannot be called with null or undefined');
6317
- }
6318
-
6319
- return Object(val);
6320
- }
6321
-
6322
- function shouldUseNative() {
6323
- try {
6324
- if (!Object.assign) {
6325
- return false;
6326
- }
6327
-
6328
- // Detect buggy property enumeration order in older V8 versions.
6329
-
6330
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
6331
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
6332
- test1[5] = 'de';
6333
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
6334
- return false;
6335
- }
6336
-
6337
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
6338
- var test2 = {};
6339
- for (var i = 0; i < 10; i++) {
6340
- test2['_' + String.fromCharCode(i)] = i;
6341
- }
6342
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
6343
- return test2[n];
6344
- });
6345
- if (order2.join('') !== '0123456789') {
6346
- return false;
6347
- }
6348
-
6349
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
6350
- var test3 = {};
6351
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
6352
- test3[letter] = letter;
6353
- });
6354
- if (Object.keys(Object.assign({}, test3)).join('') !==
6355
- 'abcdefghijklmnopqrst') {
6356
- return false;
6357
- }
6358
-
6359
- return true;
6360
- } catch (err) {
6361
- // We don't expect any of the above to throw, but better to be safe.
6362
- return false;
6363
- }
6364
- }
6365
-
6366
- module.exports = shouldUseNative() ? Object.assign : function (target, source) {
6367
- var from;
6368
- var to = toObject(target);
6369
- var symbols;
6370
-
6371
- for (var s = 1; s < arguments.length; s++) {
6372
- from = Object(arguments[s]);
6373
-
6374
- for (var key in from) {
6375
- if (hasOwnProperty.call(from, key)) {
6376
- to[key] = from[key];
6377
- }
6378
- }
6379
-
6380
- if (getOwnPropertySymbols) {
6381
- symbols = getOwnPropertySymbols(from);
6382
- for (var i = 0; i < symbols.length; i++) {
6383
- if (propIsEnumerable.call(from, symbols[i])) {
6384
- to[symbols[i]] = from[symbols[i]];
6385
- }
6386
- }
6387
- }
6388
- }
6389
-
6390
- return to;
6391
- };
6392
-
6393
-
6394
- /***/ }),
6395
-
6396
- /***/ "./node_modules/prop-types/checkPropTypes.js":
6397
- /*!***************************************************!*\
6398
- !*** ./node_modules/prop-types/checkPropTypes.js ***!
6399
- \***************************************************/
6400
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6401
- /**
6402
- * Copyright (c) 2013-present, Facebook, Inc.
6403
- *
6404
- * This source code is licensed under the MIT license found in the
6405
- * LICENSE file in the root directory of this source tree.
6406
- */
6407
-
6408
-
6409
-
6410
- var printWarning = function() {};
6411
-
6412
- {
6413
- var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
6414
- var loggedTypeFailures = {};
6415
- var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
6416
-
6417
- printWarning = function(text) {
6418
- var message = 'Warning: ' + text;
6419
- if (typeof console !== 'undefined') {
6420
- console.error(message);
6421
- }
6422
- try {
6423
- // --- Welcome to debugging React ---
6424
- // This error was thrown as a convenience so that you can use this stack
6425
- // to find the callsite that caused this warning to fire.
6426
- throw new Error(message);
6427
- } catch (x) { /**/ }
6428
- };
6429
- }
6430
-
6431
- /**
6432
- * Assert that the values match with the type specs.
6433
- * Error messages are memorized and will only be shown once.
6434
- *
6435
- * @param {object} typeSpecs Map of name to a ReactPropType
6436
- * @param {object} values Runtime values that need to be type-checked
6437
- * @param {string} location e.g. "prop", "context", "child context"
6438
- * @param {string} componentName Name of the component for error messages.
6439
- * @param {?Function} getStack Returns the component stack.
6440
- * @private
6441
- */
6442
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
6443
- {
6444
- for (var typeSpecName in typeSpecs) {
6445
- if (has(typeSpecs, typeSpecName)) {
6446
- var error;
6447
- // Prop type validation may throw. In case they do, we don't want to
6448
- // fail the render phase where it didn't fail before. So we log it.
6449
- // After these have been cleaned up, we'll let them throw.
6450
- try {
6451
- // This is intentionally an invariant that gets caught. It's the same
6452
- // behavior as without this statement except with a better message.
6453
- if (typeof typeSpecs[typeSpecName] !== 'function') {
6454
- var err = Error(
6455
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
6456
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
6457
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
6458
- );
6459
- err.name = 'Invariant Violation';
6460
- throw err;
6461
- }
6462
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
6463
- } catch (ex) {
6464
- error = ex;
6465
- }
6466
- if (error && !(error instanceof Error)) {
6467
- printWarning(
6468
- (componentName || 'React class') + ': type specification of ' +
6469
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
6470
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
6471
- 'You may have forgotten to pass an argument to the type checker ' +
6472
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
6473
- 'shape all require an argument).'
6474
- );
6475
- }
6476
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
6477
- // Only monitor this failure once because there tends to be a lot of the
6478
- // same error.
6479
- loggedTypeFailures[error.message] = true;
6480
-
6481
- var stack = getStack ? getStack() : '';
6482
-
6483
- printWarning(
6484
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
6485
- );
6486
- }
6487
- }
6488
- }
6489
- }
6490
- }
6491
-
6492
- /**
6493
- * Resets warning cache when testing.
6494
- *
6495
- * @private
6496
- */
6497
- checkPropTypes.resetWarningCache = function() {
6498
- {
6499
- loggedTypeFailures = {};
6500
- }
6501
- };
6502
-
6503
- module.exports = checkPropTypes;
6504
-
6505
-
6506
- /***/ }),
6507
-
6508
- /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
6509
- /*!************************************************************!*\
6510
- !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
6511
- \************************************************************/
6512
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6513
- /**
6514
- * Copyright (c) 2013-present, Facebook, Inc.
6515
- *
6516
- * This source code is licensed under the MIT license found in the
6517
- * LICENSE file in the root directory of this source tree.
6518
- */
6519
-
6520
-
6521
-
6522
- var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
6523
- var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
6524
-
6525
- var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
6526
- var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
6527
- var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
6528
-
6529
- var printWarning = function() {};
6530
-
6531
- {
6532
- printWarning = function(text) {
6533
- var message = 'Warning: ' + text;
6534
- if (typeof console !== 'undefined') {
6535
- console.error(message);
6536
- }
6537
- try {
6538
- // --- Welcome to debugging React ---
6539
- // This error was thrown as a convenience so that you can use this stack
6540
- // to find the callsite that caused this warning to fire.
6541
- throw new Error(message);
6542
- } catch (x) {}
6543
- };
6544
- }
6545
-
6546
- function emptyFunctionThatReturnsNull() {
6547
- return null;
6548
- }
6549
-
6550
- module.exports = function(isValidElement, throwOnDirectAccess) {
6551
- /* global Symbol */
6552
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
6553
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
6554
-
6555
- /**
6556
- * Returns the iterator method function contained on the iterable object.
6557
- *
6558
- * Be sure to invoke the function with the iterable as context:
6559
- *
6560
- * var iteratorFn = getIteratorFn(myIterable);
6561
- * if (iteratorFn) {
6562
- * var iterator = iteratorFn.call(myIterable);
6563
- * ...
6564
- * }
6565
- *
6566
- * @param {?object} maybeIterable
6567
- * @return {?function}
6568
- */
6569
- function getIteratorFn(maybeIterable) {
6570
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
6571
- if (typeof iteratorFn === 'function') {
6572
- return iteratorFn;
6573
- }
6574
- }
6575
-
6576
- /**
6577
- * Collection of methods that allow declaration and validation of props that are
6578
- * supplied to React components. Example usage:
6579
- *
6580
- * var Props = require('ReactPropTypes');
6581
- * var MyArticle = React.createClass({
6582
- * propTypes: {
6583
- * // An optional string prop named "description".
6584
- * description: Props.string,
6585
- *
6586
- * // A required enum prop named "category".
6587
- * category: Props.oneOf(['News','Photos']).isRequired,
6588
- *
6589
- * // A prop named "dialog" that requires an instance of Dialog.
6590
- * dialog: Props.instanceOf(Dialog).isRequired
6591
- * },
6592
- * render: function() { ... }
6593
- * });
6594
- *
6595
- * A more formal specification of how these methods are used:
6596
- *
6597
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
6598
- * decl := ReactPropTypes.{type}(.isRequired)?
6599
- *
6600
- * Each and every declaration produces a function with the same signature. This
6601
- * allows the creation of custom validation functions. For example:
6602
- *
6603
- * var MyLink = React.createClass({
6604
- * propTypes: {
6605
- * // An optional string or URI prop named "href".
6606
- * href: function(props, propName, componentName) {
6607
- * var propValue = props[propName];
6608
- * if (propValue != null && typeof propValue !== 'string' &&
6609
- * !(propValue instanceof URI)) {
6610
- * return new Error(
6611
- * 'Expected a string or an URI for ' + propName + ' in ' +
6612
- * componentName
6613
- * );
6614
- * }
6615
- * }
6616
- * },
6617
- * render: function() {...}
6618
- * });
6619
- *
6620
- * @internal
6621
- */
6622
-
6623
- var ANONYMOUS = '<<anonymous>>';
6624
-
6625
- // Important!
6626
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
6627
- var ReactPropTypes = {
6628
- array: createPrimitiveTypeChecker('array'),
6629
- bigint: createPrimitiveTypeChecker('bigint'),
6630
- bool: createPrimitiveTypeChecker('boolean'),
6631
- func: createPrimitiveTypeChecker('function'),
6632
- number: createPrimitiveTypeChecker('number'),
6633
- object: createPrimitiveTypeChecker('object'),
6634
- string: createPrimitiveTypeChecker('string'),
6635
- symbol: createPrimitiveTypeChecker('symbol'),
6636
-
6637
- any: createAnyTypeChecker(),
6638
- arrayOf: createArrayOfTypeChecker,
6639
- element: createElementTypeChecker(),
6640
- elementType: createElementTypeTypeChecker(),
6641
- instanceOf: createInstanceTypeChecker,
6642
- node: createNodeChecker(),
6643
- objectOf: createObjectOfTypeChecker,
6644
- oneOf: createEnumTypeChecker,
6645
- oneOfType: createUnionTypeChecker,
6646
- shape: createShapeTypeChecker,
6647
- exact: createStrictShapeTypeChecker,
6648
- };
6649
-
6650
- /**
6651
- * inlined Object.is polyfill to avoid requiring consumers ship their own
6652
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
6653
- */
6654
- /*eslint-disable no-self-compare*/
6655
- function is(x, y) {
6656
- // SameValue algorithm
6657
- if (x === y) {
6658
- // Steps 1-5, 7-10
6659
- // Steps 6.b-6.e: +0 != -0
6660
- return x !== 0 || 1 / x === 1 / y;
6661
- } else {
6662
- // Step 6.a: NaN == NaN
6663
- return x !== x && y !== y;
6664
- }
6665
- }
6666
- /*eslint-enable no-self-compare*/
6667
-
6668
- /**
6669
- * We use an Error-like object for backward compatibility as people may call
6670
- * PropTypes directly and inspect their output. However, we don't use real
6671
- * Errors anymore. We don't inspect their stack anyway, and creating them
6672
- * is prohibitively expensive if they are created too often, such as what
6673
- * happens in oneOfType() for any type before the one that matched.
6674
- */
6675
- function PropTypeError(message, data) {
6676
- this.message = message;
6677
- this.data = data && typeof data === 'object' ? data: {};
6678
- this.stack = '';
6679
- }
6680
- // Make `instanceof Error` still work for returned errors.
6681
- PropTypeError.prototype = Error.prototype;
6682
-
6683
- function createChainableTypeChecker(validate) {
6684
- {
6685
- var manualPropTypeCallCache = {};
6686
- var manualPropTypeWarningCount = 0;
6687
- }
6688
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
6689
- componentName = componentName || ANONYMOUS;
6690
- propFullName = propFullName || propName;
6691
-
6692
- if (secret !== ReactPropTypesSecret) {
6693
- if (throwOnDirectAccess) {
6694
- // New behavior only for users of `prop-types` package
6695
- var err = new Error(
6696
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
6697
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
6698
- 'Read more at http://fb.me/use-check-prop-types'
6699
- );
6700
- err.name = 'Invariant Violation';
6701
- throw err;
6702
- } else if ( typeof console !== 'undefined') {
6703
- // Old behavior for people using React.PropTypes
6704
- var cacheKey = componentName + ':' + propName;
6705
- if (
6706
- !manualPropTypeCallCache[cacheKey] &&
6707
- // Avoid spamming the console because they are often not actionable except for lib authors
6708
- manualPropTypeWarningCount < 3
6709
- ) {
6710
- printWarning(
6711
- 'You are manually calling a React.PropTypes validation ' +
6712
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
6713
- 'and will throw in the standalone `prop-types` package. ' +
6714
- 'You may be seeing this warning due to a third-party PropTypes ' +
6715
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
6716
- );
6717
- manualPropTypeCallCache[cacheKey] = true;
6718
- manualPropTypeWarningCount++;
6719
- }
6720
- }
6721
- }
6722
- if (props[propName] == null) {
6723
- if (isRequired) {
6724
- if (props[propName] === null) {
6725
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
6726
- }
6727
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
6728
- }
6729
- return null;
6730
- } else {
6731
- return validate(props, propName, componentName, location, propFullName);
6732
- }
6733
- }
6734
-
6735
- var chainedCheckType = checkType.bind(null, false);
6736
- chainedCheckType.isRequired = checkType.bind(null, true);
6737
-
6738
- return chainedCheckType;
6739
- }
6740
-
6741
- function createPrimitiveTypeChecker(expectedType) {
6742
- function validate(props, propName, componentName, location, propFullName, secret) {
6743
- var propValue = props[propName];
6744
- var propType = getPropType(propValue);
6745
- if (propType !== expectedType) {
6746
- // `propValue` being instance of, say, date/regexp, pass the 'object'
6747
- // check, but we can offer a more precise error message here rather than
6748
- // 'of type `object`'.
6749
- var preciseType = getPreciseType(propValue);
6750
-
6751
- return new PropTypeError(
6752
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
6753
- {expectedType: expectedType}
6754
- );
6755
- }
6756
- return null;
6757
- }
6758
- return createChainableTypeChecker(validate);
6759
- }
6760
-
6761
- function createAnyTypeChecker() {
6762
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
6763
- }
6764
-
6765
- function createArrayOfTypeChecker(typeChecker) {
6766
- function validate(props, propName, componentName, location, propFullName) {
6767
- if (typeof typeChecker !== 'function') {
6768
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
6769
- }
6770
- var propValue = props[propName];
6771
- if (!Array.isArray(propValue)) {
6772
- var propType = getPropType(propValue);
6773
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
6774
- }
6775
- for (var i = 0; i < propValue.length; i++) {
6776
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
6777
- if (error instanceof Error) {
6778
- return error;
6779
- }
6780
- }
6781
- return null;
6782
- }
6783
- return createChainableTypeChecker(validate);
6784
- }
6785
-
6786
- function createElementTypeChecker() {
6787
- function validate(props, propName, componentName, location, propFullName) {
6788
- var propValue = props[propName];
6789
- if (!isValidElement(propValue)) {
6790
- var propType = getPropType(propValue);
6791
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
6792
- }
6793
- return null;
6794
- }
6795
- return createChainableTypeChecker(validate);
6796
- }
6797
-
6798
- function createElementTypeTypeChecker() {
6799
- function validate(props, propName, componentName, location, propFullName) {
6800
- var propValue = props[propName];
6801
- if (!ReactIs.isValidElementType(propValue)) {
6802
- var propType = getPropType(propValue);
6803
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
6804
- }
6805
- return null;
6806
- }
6807
- return createChainableTypeChecker(validate);
6808
- }
6809
-
6810
- function createInstanceTypeChecker(expectedClass) {
6811
- function validate(props, propName, componentName, location, propFullName) {
6812
- if (!(props[propName] instanceof expectedClass)) {
6813
- var expectedClassName = expectedClass.name || ANONYMOUS;
6814
- var actualClassName = getClassName(props[propName]);
6815
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
6816
- }
6817
- return null;
6818
- }
6819
- return createChainableTypeChecker(validate);
6820
- }
6821
-
6822
- function createEnumTypeChecker(expectedValues) {
6823
- if (!Array.isArray(expectedValues)) {
6824
- {
6825
- if (arguments.length > 1) {
6826
- printWarning(
6827
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
6828
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
6829
- );
6830
- } else {
6831
- printWarning('Invalid argument supplied to oneOf, expected an array.');
6832
- }
6833
- }
6834
- return emptyFunctionThatReturnsNull;
6835
- }
6836
-
6837
- function validate(props, propName, componentName, location, propFullName) {
6838
- var propValue = props[propName];
6839
- for (var i = 0; i < expectedValues.length; i++) {
6840
- if (is(propValue, expectedValues[i])) {
6841
- return null;
6842
- }
6843
- }
6844
-
6845
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
6846
- var type = getPreciseType(value);
6847
- if (type === 'symbol') {
6848
- return String(value);
6849
- }
6850
- return value;
6851
- });
6852
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
6853
- }
6854
- return createChainableTypeChecker(validate);
6855
- }
6856
-
6857
- function createObjectOfTypeChecker(typeChecker) {
6858
- function validate(props, propName, componentName, location, propFullName) {
6859
- if (typeof typeChecker !== 'function') {
6860
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
6861
- }
6862
- var propValue = props[propName];
6863
- var propType = getPropType(propValue);
6864
- if (propType !== 'object') {
6865
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
6866
- }
6867
- for (var key in propValue) {
6868
- if (has(propValue, key)) {
6869
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
6870
- if (error instanceof Error) {
6871
- return error;
6872
- }
6873
- }
6874
- }
6875
- return null;
6876
- }
6877
- return createChainableTypeChecker(validate);
6878
- }
6879
-
6880
- function createUnionTypeChecker(arrayOfTypeCheckers) {
6881
- if (!Array.isArray(arrayOfTypeCheckers)) {
6882
- printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') ;
6883
- return emptyFunctionThatReturnsNull;
6884
- }
6885
-
6886
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
6887
- var checker = arrayOfTypeCheckers[i];
6888
- if (typeof checker !== 'function') {
6889
- printWarning(
6890
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
6891
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
6892
- );
6893
- return emptyFunctionThatReturnsNull;
6894
- }
6895
- }
6896
-
6897
- function validate(props, propName, componentName, location, propFullName) {
6898
- var expectedTypes = [];
6899
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
6900
- var checker = arrayOfTypeCheckers[i];
6901
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
6902
- if (checkerResult == null) {
6903
- return null;
6904
- }
6905
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
6906
- expectedTypes.push(checkerResult.data.expectedType);
6907
- }
6908
- }
6909
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
6910
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
6911
- }
6912
- return createChainableTypeChecker(validate);
6913
- }
6914
-
6915
- function createNodeChecker() {
6916
- function validate(props, propName, componentName, location, propFullName) {
6917
- if (!isNode(props[propName])) {
6918
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
6919
- }
6920
- return null;
6921
- }
6922
- return createChainableTypeChecker(validate);
6923
- }
6924
-
6925
- function invalidValidatorError(componentName, location, propFullName, key, type) {
6926
- return new PropTypeError(
6927
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
6928
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
6929
- );
6930
- }
6931
-
6932
- function createShapeTypeChecker(shapeTypes) {
6933
- function validate(props, propName, componentName, location, propFullName) {
6934
- var propValue = props[propName];
6935
- var propType = getPropType(propValue);
6936
- if (propType !== 'object') {
6937
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
6938
- }
6939
- for (var key in shapeTypes) {
6940
- var checker = shapeTypes[key];
6941
- if (typeof checker !== 'function') {
6942
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
6943
- }
6944
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
6945
- if (error) {
6946
- return error;
6947
- }
6948
- }
6949
- return null;
6950
- }
6951
- return createChainableTypeChecker(validate);
6952
- }
6953
-
6954
- function createStrictShapeTypeChecker(shapeTypes) {
6955
- function validate(props, propName, componentName, location, propFullName) {
6956
- var propValue = props[propName];
6957
- var propType = getPropType(propValue);
6958
- if (propType !== 'object') {
6959
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
6960
- }
6961
- // We need to check all keys in case some are required but missing from props.
6962
- var allKeys = assign({}, props[propName], shapeTypes);
6963
- for (var key in allKeys) {
6964
- var checker = shapeTypes[key];
6965
- if (has(shapeTypes, key) && typeof checker !== 'function') {
6966
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
6967
- }
6968
- if (!checker) {
6969
- return new PropTypeError(
6970
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
6971
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
6972
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
6973
- );
6974
- }
6975
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
6976
- if (error) {
6977
- return error;
6978
- }
6979
- }
6980
- return null;
6981
- }
6982
-
6983
- return createChainableTypeChecker(validate);
6984
- }
6985
-
6986
- function isNode(propValue) {
6987
- switch (typeof propValue) {
6988
- case 'number':
6989
- case 'string':
6990
- case 'undefined':
6991
- return true;
6992
- case 'boolean':
6993
- return !propValue;
6994
- case 'object':
6995
- if (Array.isArray(propValue)) {
6996
- return propValue.every(isNode);
6997
- }
6998
- if (propValue === null || isValidElement(propValue)) {
6999
- return true;
7000
- }
7001
-
7002
- var iteratorFn = getIteratorFn(propValue);
7003
- if (iteratorFn) {
7004
- var iterator = iteratorFn.call(propValue);
7005
- var step;
7006
- if (iteratorFn !== propValue.entries) {
7007
- while (!(step = iterator.next()).done) {
7008
- if (!isNode(step.value)) {
7009
- return false;
7010
- }
7011
- }
7012
- } else {
7013
- // Iterator will provide entry [k,v] tuples rather than values.
7014
- while (!(step = iterator.next()).done) {
7015
- var entry = step.value;
7016
- if (entry) {
7017
- if (!isNode(entry[1])) {
7018
- return false;
7019
- }
7020
- }
7021
- }
7022
- }
7023
- } else {
7024
- return false;
7025
- }
7026
-
7027
- return true;
7028
- default:
7029
- return false;
7030
- }
7031
- }
7032
-
7033
- function isSymbol(propType, propValue) {
7034
- // Native Symbol.
7035
- if (propType === 'symbol') {
7036
- return true;
7037
- }
7038
-
7039
- // falsy value can't be a Symbol
7040
- if (!propValue) {
7041
- return false;
7042
- }
7043
-
7044
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
7045
- if (propValue['@@toStringTag'] === 'Symbol') {
7046
- return true;
7047
- }
7048
-
7049
- // Fallback for non-spec compliant Symbols which are polyfilled.
7050
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
7051
- return true;
7052
- }
7053
-
7054
- return false;
7055
- }
7056
-
7057
- // Equivalent of `typeof` but with special handling for array and regexp.
7058
- function getPropType(propValue) {
7059
- var propType = typeof propValue;
7060
- if (Array.isArray(propValue)) {
7061
- return 'array';
7062
- }
7063
- if (propValue instanceof RegExp) {
7064
- // Old webkits (at least until Android 4.0) return 'function' rather than
7065
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
7066
- // passes PropTypes.object.
7067
- return 'object';
7068
- }
7069
- if (isSymbol(propType, propValue)) {
7070
- return 'symbol';
7071
- }
7072
- return propType;
7073
- }
7074
-
7075
- // This handles more types than `getPropType`. Only used for error messages.
7076
- // See `createPrimitiveTypeChecker`.
7077
- function getPreciseType(propValue) {
7078
- if (typeof propValue === 'undefined' || propValue === null) {
7079
- return '' + propValue;
7080
- }
7081
- var propType = getPropType(propValue);
7082
- if (propType === 'object') {
7083
- if (propValue instanceof Date) {
7084
- return 'date';
7085
- } else if (propValue instanceof RegExp) {
7086
- return 'regexp';
7087
- }
7088
- }
7089
- return propType;
7090
- }
7091
-
7092
- // Returns a string that is postfixed to a warning about an invalid type.
7093
- // For example, "undefined" or "of type array"
7094
- function getPostfixForTypeWarning(value) {
7095
- var type = getPreciseType(value);
7096
- switch (type) {
7097
- case 'array':
7098
- case 'object':
7099
- return 'an ' + type;
7100
- case 'boolean':
7101
- case 'date':
7102
- case 'regexp':
7103
- return 'a ' + type;
7104
- default:
7105
- return type;
7106
- }
7107
- }
7108
-
7109
- // Returns class name of the object, if any.
7110
- function getClassName(propValue) {
7111
- if (!propValue.constructor || !propValue.constructor.name) {
7112
- return ANONYMOUS;
7113
- }
7114
- return propValue.constructor.name;
7115
- }
7116
-
7117
- ReactPropTypes.checkPropTypes = checkPropTypes;
7118
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
7119
- ReactPropTypes.PropTypes = ReactPropTypes;
7120
-
7121
- return ReactPropTypes;
7122
- };
7123
-
7124
-
7125
- /***/ }),
7126
-
7127
- /***/ "./node_modules/prop-types/index.js":
7128
- /*!******************************************!*\
7129
- !*** ./node_modules/prop-types/index.js ***!
7130
- \******************************************/
7131
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7132
-
7133
- /**
7134
- * Copyright (c) 2013-present, Facebook, Inc.
7135
- *
7136
- * This source code is licensed under the MIT license found in the
7137
- * LICENSE file in the root directory of this source tree.
7138
- */
7139
-
7140
- {
7141
- var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
7142
-
7143
- // By explicitly using `prop-types` you are opting into new development behavior.
7144
- // http://fb.me/prop-types-in-prod
7145
- var throwOnDirectAccess = true;
7146
- module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
7147
- }
7148
-
7149
-
7150
- /***/ }),
7151
-
7152
- /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
7153
- /*!*************************************************************!*\
7154
- !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
7155
- \*************************************************************/
7156
- /***/ ((module) => {
7157
- /**
7158
- * Copyright (c) 2013-present, Facebook, Inc.
7159
- *
7160
- * This source code is licensed under the MIT license found in the
7161
- * LICENSE file in the root directory of this source tree.
7162
- */
7163
-
7164
-
7165
-
7166
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
7167
-
7168
- module.exports = ReactPropTypesSecret;
7169
-
7170
-
7171
- /***/ }),
7172
-
7173
- /***/ "./node_modules/prop-types/lib/has.js":
7174
- /*!********************************************!*\
7175
- !*** ./node_modules/prop-types/lib/has.js ***!
7176
- \********************************************/
7177
- /***/ ((module) => {
7178
-
7179
- module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
7180
-
7181
-
7182
- /***/ }),
7183
-
7184
- /***/ "./node_modules/react-is/cjs/react-is.development.js":
7185
- /*!***********************************************************!*\
7186
- !*** ./node_modules/react-is/cjs/react-is.development.js ***!
7187
- \***********************************************************/
7188
- /***/ ((__unused_webpack_module, exports) => {
7189
- /** @license React v16.13.1
7190
- * react-is.development.js
7191
- *
7192
- * Copyright (c) Facebook, Inc. and its affiliates.
7193
- *
7194
- * This source code is licensed under the MIT license found in the
7195
- * LICENSE file in the root directory of this source tree.
7196
- */
7197
-
7198
-
7199
-
7200
-
7201
-
7202
- {
7203
- (function() {
7204
-
7205
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
7206
- // nor polyfill, then a plain number is used for performance.
7207
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
7208
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
7209
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
7210
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
7211
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
7212
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
7213
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
7214
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
7215
- // (unstable) APIs that have been removed. Can we remove the symbols?
7216
-
7217
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
7218
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
7219
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
7220
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
7221
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
7222
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
7223
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
7224
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
7225
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
7226
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
7227
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
7228
-
7229
- function isValidElementType(type) {
7230
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
7231
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
7232
- }
7233
-
7234
- function typeOf(object) {
7235
- if (typeof object === 'object' && object !== null) {
7236
- var $$typeof = object.$$typeof;
7237
-
7238
- switch ($$typeof) {
7239
- case REACT_ELEMENT_TYPE:
7240
- var type = object.type;
7241
-
7242
- switch (type) {
7243
- case REACT_ASYNC_MODE_TYPE:
7244
- case REACT_CONCURRENT_MODE_TYPE:
7245
- case REACT_FRAGMENT_TYPE:
7246
- case REACT_PROFILER_TYPE:
7247
- case REACT_STRICT_MODE_TYPE:
7248
- case REACT_SUSPENSE_TYPE:
7249
- return type;
7250
-
7251
- default:
7252
- var $$typeofType = type && type.$$typeof;
7253
-
7254
- switch ($$typeofType) {
7255
- case REACT_CONTEXT_TYPE:
7256
- case REACT_FORWARD_REF_TYPE:
7257
- case REACT_LAZY_TYPE:
7258
- case REACT_MEMO_TYPE:
7259
- case REACT_PROVIDER_TYPE:
7260
- return $$typeofType;
7261
-
7262
- default:
7263
- return $$typeof;
7264
- }
7265
-
7266
- }
7267
-
7268
- case REACT_PORTAL_TYPE:
7269
- return $$typeof;
7270
- }
7271
- }
7272
-
7273
- return undefined;
7274
- } // AsyncMode is deprecated along with isAsyncMode
7275
-
7276
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
7277
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
7278
- var ContextConsumer = REACT_CONTEXT_TYPE;
7279
- var ContextProvider = REACT_PROVIDER_TYPE;
7280
- var Element = REACT_ELEMENT_TYPE;
7281
- var ForwardRef = REACT_FORWARD_REF_TYPE;
7282
- var Fragment = REACT_FRAGMENT_TYPE;
7283
- var Lazy = REACT_LAZY_TYPE;
7284
- var Memo = REACT_MEMO_TYPE;
7285
- var Portal = REACT_PORTAL_TYPE;
7286
- var Profiler = REACT_PROFILER_TYPE;
7287
- var StrictMode = REACT_STRICT_MODE_TYPE;
7288
- var Suspense = REACT_SUSPENSE_TYPE;
7289
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
7290
-
7291
- function isAsyncMode(object) {
7292
- {
7293
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
7294
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
7295
-
7296
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
7297
- }
7298
- }
7299
-
7300
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
7301
- }
7302
- function isConcurrentMode(object) {
7303
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
7304
- }
7305
- function isContextConsumer(object) {
7306
- return typeOf(object) === REACT_CONTEXT_TYPE;
7307
- }
7308
- function isContextProvider(object) {
7309
- return typeOf(object) === REACT_PROVIDER_TYPE;
7310
- }
7311
- function isElement(object) {
7312
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
7313
- }
7314
- function isForwardRef(object) {
7315
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
7316
- }
7317
- function isFragment(object) {
7318
- return typeOf(object) === REACT_FRAGMENT_TYPE;
7319
- }
7320
- function isLazy(object) {
7321
- return typeOf(object) === REACT_LAZY_TYPE;
7322
- }
7323
- function isMemo(object) {
7324
- return typeOf(object) === REACT_MEMO_TYPE;
7325
- }
7326
- function isPortal(object) {
7327
- return typeOf(object) === REACT_PORTAL_TYPE;
7328
- }
7329
- function isProfiler(object) {
7330
- return typeOf(object) === REACT_PROFILER_TYPE;
7331
- }
7332
- function isStrictMode(object) {
7333
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
7334
- }
7335
- function isSuspense(object) {
7336
- return typeOf(object) === REACT_SUSPENSE_TYPE;
7337
- }
7338
-
7339
- exports.AsyncMode = AsyncMode;
7340
- exports.ConcurrentMode = ConcurrentMode;
7341
- exports.ContextConsumer = ContextConsumer;
7342
- exports.ContextProvider = ContextProvider;
7343
- exports.Element = Element;
7344
- exports.ForwardRef = ForwardRef;
7345
- exports.Fragment = Fragment;
7346
- exports.Lazy = Lazy;
7347
- exports.Memo = Memo;
7348
- exports.Portal = Portal;
7349
- exports.Profiler = Profiler;
7350
- exports.StrictMode = StrictMode;
7351
- exports.Suspense = Suspense;
7352
- exports.isAsyncMode = isAsyncMode;
7353
- exports.isConcurrentMode = isConcurrentMode;
7354
- exports.isContextConsumer = isContextConsumer;
7355
- exports.isContextProvider = isContextProvider;
7356
- exports.isElement = isElement;
7357
- exports.isForwardRef = isForwardRef;
7358
- exports.isFragment = isFragment;
7359
- exports.isLazy = isLazy;
7360
- exports.isMemo = isMemo;
7361
- exports.isPortal = isPortal;
7362
- exports.isProfiler = isProfiler;
7363
- exports.isStrictMode = isStrictMode;
7364
- exports.isSuspense = isSuspense;
7365
- exports.isValidElementType = isValidElementType;
7366
- exports.typeOf = typeOf;
7367
- })();
7368
- }
7369
-
7370
-
7371
- /***/ }),
7372
-
7373
- /***/ "./node_modules/react-is/index.js":
7374
- /*!****************************************!*\
7375
- !*** ./node_modules/react-is/index.js ***!
7376
- \****************************************/
7377
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7378
-
7379
-
7380
- {
7381
- module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
7382
- }
7383
-
7384
-
7385
- /***/ }),
7386
-
7387
- /***/ "./node_modules/shallow-equal/dist/index.esm.js":
7388
- /*!******************************************************!*\
7389
- !*** ./node_modules/shallow-equal/dist/index.esm.js ***!
7390
- \******************************************************/
7391
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7392
- __webpack_require__.r(__webpack_exports__);
7393
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7394
- /* harmony export */ "shallowEqualArrays": () => (/* binding */ shallowEqualArrays),
7395
- /* harmony export */ "shallowEqualObjects": () => (/* binding */ shallowEqualObjects)
7396
- /* harmony export */ });
7397
- function shallowEqualObjects(objA, objB) {
7398
- if (objA === objB) {
7399
- return true;
7400
- }
7401
-
7402
- if (!objA || !objB) {
7403
- return false;
7404
- }
7405
-
7406
- var aKeys = Object.keys(objA);
7407
- var bKeys = Object.keys(objB);
7408
- var len = aKeys.length;
7409
-
7410
- if (bKeys.length !== len) {
7411
- return false;
7412
- }
7413
-
7414
- for (var i = 0; i < len; i++) {
7415
- var key = aKeys[i];
7416
-
7417
- if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {
7418
- return false;
7419
- }
7420
- }
7421
-
7422
- return true;
7423
- }
7424
-
7425
- function shallowEqualArrays(arrA, arrB) {
7426
- if (arrA === arrB) {
7427
- return true;
7428
- }
7429
-
7430
- if (!arrA || !arrB) {
7431
- return false;
7432
- }
7433
-
7434
- var len = arrA.length;
7435
-
7436
- if (arrB.length !== len) {
7437
- return false;
7438
- }
7439
-
7440
- for (var i = 0; i < len; i++) {
7441
- if (arrA[i] !== arrB[i]) {
7442
- return false;
7443
- }
7444
- }
7445
-
7446
- return true;
7447
- }
7448
-
7449
-
7450
-
7451
-
7452
- /***/ }),
7453
-
7454
- /***/ "./src/Component.ts":
7455
- /*!**************************!*\
7456
- !*** ./src/Component.ts ***!
7457
- \**************************/
7458
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7459
-
7460
- var __rest = (this && this.__rest) || function (s, e) {
7461
- var t = {};
7462
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7463
- t[p] = s[p];
7464
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7465
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7466
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7467
- t[p[i]] = s[p[i]];
7468
- }
7469
- return t;
7470
- };
7471
- var __importDefault = (this && this.__importDefault) || function (mod) {
7472
- return (mod && mod.__esModule) ? mod : { "default": mod };
7473
- };
7474
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7475
- var useMediaQuery_1 = __importDefault(__webpack_require__(/*! ./useMediaQuery */ "./src/useMediaQuery.ts"));
7476
- // ReactNode and ReactElement typings are a little funky for functional components, so the ReactElement cast is needed on the return
7477
- var MediaQuery = function (_a) {
7478
- var children = _a.children, device = _a.device, onChange = _a.onChange, settings = __rest(_a, ["children", "device", "onChange"]);
7479
- var matches = (0, useMediaQuery_1.default)(settings, device, onChange);
7480
- if (typeof children === 'function') {
7481
- return children(matches);
7482
- }
7483
- return matches ? children : null;
7484
- };
7485
- exports["default"] = MediaQuery;
7486
-
7487
-
7488
- /***/ }),
7489
-
7490
- /***/ "./src/Context.ts":
7491
- /*!************************!*\
7492
- !*** ./src/Context.ts ***!
7493
- \************************/
7494
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7495
-
7496
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7497
- var react_1 = __webpack_require__(/*! react */ "react");
7498
- var Context = (0, react_1.createContext)(undefined);
7499
- exports["default"] = Context;
7500
-
7501
-
7502
- /***/ }),
7503
-
7504
- /***/ "./src/index.ts":
7505
- /*!**********************!*\
7506
- !*** ./src/index.ts ***!
7507
- \**********************/
7508
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7509
-
7510
- var __importDefault = (this && this.__importDefault) || function (mod) {
7511
- return (mod && mod.__esModule) ? mod : { "default": mod };
7512
- };
7513
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7514
- exports.Context = exports.toQuery = exports.useMediaQuery = exports["default"] = void 0;
7515
- var useMediaQuery_1 = __importDefault(__webpack_require__(/*! ./useMediaQuery */ "./src/useMediaQuery.ts"));
7516
- exports.useMediaQuery = useMediaQuery_1.default;
7517
- var Component_1 = __importDefault(__webpack_require__(/*! ./Component */ "./src/Component.ts"));
7518
- exports["default"] = Component_1.default;
7519
- var toQuery_1 = __importDefault(__webpack_require__(/*! ./toQuery */ "./src/toQuery.ts"));
7520
- exports.toQuery = toQuery_1.default;
7521
- var Context_1 = __importDefault(__webpack_require__(/*! ./Context */ "./src/Context.ts"));
7522
- exports.Context = Context_1.default;
7523
-
7524
-
7525
- /***/ }),
7526
-
7527
- /***/ "./src/mediaQuery.ts":
7528
- /*!***************************!*\
7529
- !*** ./src/mediaQuery.ts ***!
7530
- \***************************/
7531
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7532
-
7533
- var __assign = (this && this.__assign) || function () {
7534
- __assign = Object.assign || function(t) {
7535
- for (var s, i = 1, n = arguments.length; i < n; i++) {
7536
- s = arguments[i];
7537
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7538
- t[p] = s[p];
7539
- }
7540
- return t;
7541
- };
7542
- return __assign.apply(this, arguments);
7543
- };
7544
- var __rest = (this && this.__rest) || function (s, e) {
7545
- var t = {};
7546
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7547
- t[p] = s[p];
7548
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7549
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7550
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7551
- t[p[i]] = s[p[i]];
7552
- }
7553
- return t;
7554
- };
7555
- var __importDefault = (this && this.__importDefault) || function (mod) {
7556
- return (mod && mod.__esModule) ? mod : { "default": mod };
7557
- };
7558
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7559
- var prop_types_1 = __importDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
7560
- var stringOrNumber = prop_types_1.default.oneOfType([
7561
- prop_types_1.default.string,
7562
- prop_types_1.default.number
7563
- ]);
7564
- // media types
7565
- var types = {
7566
- all: prop_types_1.default.bool,
7567
- grid: prop_types_1.default.bool,
7568
- aural: prop_types_1.default.bool,
7569
- braille: prop_types_1.default.bool,
7570
- handheld: prop_types_1.default.bool,
7571
- print: prop_types_1.default.bool,
7572
- projection: prop_types_1.default.bool,
7573
- screen: prop_types_1.default.bool,
7574
- tty: prop_types_1.default.bool,
7575
- tv: prop_types_1.default.bool,
7576
- embossed: prop_types_1.default.bool
7577
- };
7578
- // properties that match media queries
7579
- var matchers = {
7580
- orientation: prop_types_1.default.oneOf([
7581
- 'portrait',
7582
- 'landscape'
7583
- ]),
7584
- scan: prop_types_1.default.oneOf([
7585
- 'progressive',
7586
- 'interlace'
7587
- ]),
7588
- aspectRatio: prop_types_1.default.string,
7589
- deviceAspectRatio: prop_types_1.default.string,
7590
- height: stringOrNumber,
7591
- deviceHeight: stringOrNumber,
7592
- width: stringOrNumber,
7593
- deviceWidth: stringOrNumber,
7594
- color: prop_types_1.default.bool,
7595
- colorIndex: prop_types_1.default.bool,
7596
- monochrome: prop_types_1.default.bool,
7597
- resolution: stringOrNumber,
7598
- type: Object.keys(types)
7599
- };
7600
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
7601
- matchers.type; var featureMatchers = __rest(matchers
7602
- // media features
7603
- , ["type"]);
7604
- // media features
7605
- var features = __assign({ minAspectRatio: prop_types_1.default.string, maxAspectRatio: prop_types_1.default.string, minDeviceAspectRatio: prop_types_1.default.string, maxDeviceAspectRatio: prop_types_1.default.string, minHeight: stringOrNumber, maxHeight: stringOrNumber, minDeviceHeight: stringOrNumber, maxDeviceHeight: stringOrNumber, minWidth: stringOrNumber, maxWidth: stringOrNumber, minDeviceWidth: stringOrNumber, maxDeviceWidth: stringOrNumber, minColor: prop_types_1.default.number, maxColor: prop_types_1.default.number, minColorIndex: prop_types_1.default.number, maxColorIndex: prop_types_1.default.number, minMonochrome: prop_types_1.default.number, maxMonochrome: prop_types_1.default.number, minResolution: stringOrNumber, maxResolution: stringOrNumber }, featureMatchers);
7606
- var all = __assign(__assign({}, types), features);
7607
- exports["default"] = {
7608
- all: all,
7609
- types: types,
7610
- matchers: matchers,
7611
- features: features
7612
- };
7613
-
7614
-
7615
- /***/ }),
7616
-
7617
- /***/ "./src/toQuery.ts":
7618
- /*!************************!*\
7619
- !*** ./src/toQuery.ts ***!
7620
- \************************/
7621
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7622
-
7623
- var __importDefault = (this && this.__importDefault) || function (mod) {
7624
- return (mod && mod.__esModule) ? mod : { "default": mod };
7625
- };
7626
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7627
- var hyphenate_style_name_1 = __importDefault(__webpack_require__(/*! hyphenate-style-name */ "./node_modules/hyphenate-style-name/index.js"));
7628
- var mediaQuery_1 = __importDefault(__webpack_require__(/*! ./mediaQuery */ "./src/mediaQuery.ts"));
7629
- var negate = function (cond) { return "not ".concat(cond); };
7630
- var keyVal = function (k, v) {
7631
- var realKey = (0, hyphenate_style_name_1.default)(k);
7632
- // px shorthand
7633
- if (typeof v === 'number') {
7634
- v = "".concat(v, "px");
7635
- }
7636
- if (v === true) {
7637
- return realKey;
7638
- }
7639
- if (v === false) {
7640
- return negate(realKey);
7641
- }
7642
- return "(".concat(realKey, ": ").concat(v, ")");
7643
- };
7644
- var join = function (conds) { return conds.join(' and '); };
7645
- var toQuery = function (obj) {
7646
- var rules = [];
7647
- Object.keys(mediaQuery_1.default.all).forEach(function (k) {
7648
- var v = obj[k];
7649
- if (v != null) {
7650
- rules.push(keyVal(k, v));
7651
- }
7652
- });
7653
- return join(rules);
7654
- };
7655
- exports["default"] = toQuery;
7656
-
7657
-
7658
- /***/ }),
7659
-
7660
- /***/ "./src/useMediaQuery.ts":
7661
- /*!******************************!*\
7662
- !*** ./src/useMediaQuery.ts ***!
7663
- \******************************/
7664
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7665
-
7666
- var __importDefault = (this && this.__importDefault) || function (mod) {
7667
- return (mod && mod.__esModule) ? mod : { "default": mod };
7668
- };
7669
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7670
- var react_1 = __webpack_require__(/*! react */ "react");
7671
- var matchmediaquery_1 = __importDefault(__webpack_require__(/*! matchmediaquery */ "./node_modules/matchmediaquery/index.js"));
7672
- var hyphenate_style_name_1 = __importDefault(__webpack_require__(/*! hyphenate-style-name */ "./node_modules/hyphenate-style-name/index.js"));
7673
- var shallow_equal_1 = __webpack_require__(/*! shallow-equal */ "./node_modules/shallow-equal/dist/index.esm.js");
7674
- var toQuery_1 = __importDefault(__webpack_require__(/*! ./toQuery */ "./src/toQuery.ts"));
7675
- var Context_1 = __importDefault(__webpack_require__(/*! ./Context */ "./src/Context.ts"));
7676
- var makeQuery = function (settings) { return settings.query || (0, toQuery_1.default)(settings); };
7677
- var hyphenateKeys = function (obj) {
7678
- if (!obj)
7679
- return undefined;
7680
- var keys = Object.keys(obj);
7681
- return keys.reduce(function (result, key) {
7682
- result[(0, hyphenate_style_name_1.default)(key)] = obj[key];
7683
- return result;
7684
- }, {});
7685
- };
7686
- var useIsUpdate = function () {
7687
- var ref = (0, react_1.useRef)(false);
7688
- (0, react_1.useEffect)(function () {
7689
- ref.current = true;
7690
- }, []);
7691
- return ref.current;
7692
- };
7693
- var useDevice = function (deviceFromProps) {
7694
- var deviceFromContext = (0, react_1.useContext)(Context_1.default);
7695
- var getDevice = function () {
7696
- return hyphenateKeys(deviceFromProps) || hyphenateKeys(deviceFromContext);
7697
- };
7698
- var _a = (0, react_1.useState)(getDevice), device = _a[0], setDevice = _a[1];
7699
- (0, react_1.useEffect)(function () {
7700
- var newDevice = getDevice();
7701
- if (!(0, shallow_equal_1.shallowEqualObjects)(device, newDevice)) {
7702
- setDevice(newDevice);
7703
- }
7704
- }, [deviceFromProps, deviceFromContext]);
7705
- return device;
7706
- };
7707
- var useQuery = function (settings) {
7708
- var getQuery = function () { return makeQuery(settings); };
7709
- var _a = (0, react_1.useState)(getQuery), query = _a[0], setQuery = _a[1];
7710
- (0, react_1.useEffect)(function () {
7711
- var newQuery = getQuery();
7712
- if (query !== newQuery) {
7713
- setQuery(newQuery);
7714
- }
7715
- }, [settings]);
7716
- return query;
7717
- };
7718
- var useMatchMedia = function (query, device) {
7719
- var getMatchMedia = function () { return (0, matchmediaquery_1.default)(query, device || {}, !!device); };
7720
- var _a = (0, react_1.useState)(getMatchMedia), mq = _a[0], setMq = _a[1];
7721
- var isUpdate = useIsUpdate();
7722
- (0, react_1.useEffect)(function () {
7723
- if (isUpdate) {
7724
- // skip on mounting, it has already been set
7725
- var newMq_1 = getMatchMedia();
7726
- setMq(newMq_1);
7727
- return function () {
7728
- if (newMq_1) {
7729
- newMq_1.dispose();
7730
- }
7731
- };
7732
- }
7733
- }, [query, device]);
7734
- return mq;
7735
- };
7736
- var useMatches = function (mediaQuery) {
7737
- var _a = (0, react_1.useState)(mediaQuery.matches), matches = _a[0], setMatches = _a[1];
7738
- (0, react_1.useEffect)(function () {
7739
- var updateMatches = function (ev) {
7740
- setMatches(ev.matches);
7741
- };
7742
- mediaQuery.addListener(updateMatches);
7743
- setMatches(mediaQuery.matches);
7744
- return function () {
7745
- mediaQuery.removeListener(updateMatches);
7746
- };
7747
- }, [mediaQuery]);
7748
- return matches;
7749
- };
7750
- var useMediaQuery = function (settings, device, onChange) {
7751
- var deviceSettings = useDevice(device);
7752
- var query = useQuery(settings);
7753
- if (!query)
7754
- throw new Error('Invalid or missing MediaQuery!');
7755
- var mq = useMatchMedia(query, deviceSettings);
7756
- var matches = useMatches(mq);
7757
- var isUpdate = useIsUpdate();
7758
- (0, react_1.useEffect)(function () {
7759
- if (isUpdate && onChange) {
7760
- onChange(matches);
7761
- }
7762
- }, [matches]);
7763
- (0, react_1.useEffect)(function () { return function () {
7764
- if (mq) {
7765
- mq.dispose();
7766
- }
7767
- }; }, []);
7768
- return matches;
7769
- };
7770
- exports["default"] = useMediaQuery;
7771
-
7772
-
7773
- /***/ }),
7774
-
7775
- /***/ "react":
7776
- /*!**************************************************************************************!*\
7777
- !*** external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"} ***!
7778
- \**************************************************************************************/
7779
- /***/ ((module) => {
7780
- module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
7781
-
7782
- /***/ })
7783
-
7784
- /******/ });
7785
- /************************************************************************/
7786
- /******/ // The module cache
7787
- /******/ var __webpack_module_cache__ = {};
7788
- /******/
7789
- /******/ // The require function
7790
- /******/ function __webpack_require__(moduleId) {
7791
- /******/ // Check if module is in cache
7792
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
7793
- /******/ if (cachedModule !== undefined) {
7794
- /******/ return cachedModule.exports;
7795
- /******/ }
7796
- /******/ // Create a new module (and put it into the cache)
7797
- /******/ var module = __webpack_module_cache__[moduleId] = {
7798
- /******/ // no module.id needed
7799
- /******/ // no module.loaded needed
7800
- /******/ exports: {}
7801
- /******/ };
7802
- /******/
7803
- /******/ // Execute the module function
7804
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
7805
- /******/
7806
- /******/ // Return the exports of the module
7807
- /******/ return module.exports;
7808
- /******/ }
7809
- /******/
7810
- /************************************************************************/
7811
- /******/ /* webpack/runtime/define property getters */
7812
- /******/ (() => {
7813
- /******/ // define getter functions for harmony exports
7814
- /******/ __webpack_require__.d = (exports, definition) => {
7815
- /******/ for(var key in definition) {
7816
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
7817
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
7818
- /******/ }
7819
- /******/ }
7820
- /******/ };
7821
- /******/ })();
7822
- /******/
7823
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
7824
- /******/ (() => {
7825
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
7826
- /******/ })();
7827
- /******/
7828
- /******/ /* webpack/runtime/make namespace object */
7829
- /******/ (() => {
7830
- /******/ // define __esModule on exports
7831
- /******/ __webpack_require__.r = (exports) => {
7832
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
7833
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7834
- /******/ }
7835
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
7836
- /******/ };
7837
- /******/ })();
7838
- /******/
7839
- /************************************************************************/
7840
- /******/
7841
- /******/ // startup
7842
- /******/ // Load entry module and return exports
7843
- /******/ // This entry module is referenced by other modules so it can't be inlined
7844
- /******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
7845
- /******/
7846
- /******/ return __webpack_exports__;
7847
- /******/ })()
7848
- ;
7849
- });
7850
-
7851
- } (reactResponsive));
7852
-
7853
- var reactResponsiveExports = reactResponsive.exports;
7854
-
7855
6026
  var css_248z$5 = ".rdp {\n --rdp-cell-size: 40px;\n --rdp-caption-font-size: 18px;\n --rdp-accent-color: #0000ff;\n --rdp-background-color: #e7edff;\n --rdp-accent-color-dark: #3003e1;\n --rdp-background-color-dark: #180270;\n --rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */\n --rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */\n\n margin: 1em;\n}\n\n/* Hide elements for devices that are not screen readers */\n.rdp-vhidden {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n position: absolute !important;\n top: 0;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n overflow: hidden !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n border: 0 !important;\n}\n\n/* Buttons */\n.rdp-button_reset {\n appearance: none;\n position: relative;\n margin: 0;\n padding: 0;\n cursor: default;\n color: inherit;\n background: none;\n font: inherit;\n\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n\n.rdp-button_reset:focus-visible {\n /* Make sure to reset outline only when :focus-visible is supported */\n outline: none;\n}\n\n.rdp-button {\n border: 2px solid transparent;\n}\n\n.rdp-button[disabled]:not(.rdp-day_selected) {\n opacity: 0.25;\n}\n\n.rdp-button:not([disabled]) {\n cursor: pointer;\n}\n\n.rdp-button:focus-visible:not([disabled]) {\n color: inherit;\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n}\n\n.rdp-button:hover:not([disabled]):not(.rdp-day_selected) {\n background-color: var(--rdp-background-color);\n}\n\n.rdp-months {\n display: flex;\n}\n\n.rdp-month {\n margin: 0 1em;\n}\n\n.rdp-month:first-child {\n margin-left: 0;\n}\n\n.rdp-month:last-child {\n margin-right: 0;\n}\n\n.rdp-table {\n margin: 0;\n max-width: calc(var(--rdp-cell-size) * 7);\n border-collapse: collapse;\n}\n\n.rdp-with_weeknumber .rdp-table {\n max-width: calc(var(--rdp-cell-size) * 8);\n border-collapse: collapse;\n}\n\n.rdp-caption {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0;\n text-align: left;\n}\n\n.rdp-multiple_months .rdp-caption {\n position: relative;\n display: block;\n text-align: center;\n}\n\n.rdp-caption_dropdowns {\n position: relative;\n display: inline-flex;\n}\n\n.rdp-caption_label {\n position: relative;\n z-index: 1;\n display: inline-flex;\n align-items: center;\n margin: 0;\n padding: 0 0.25em;\n white-space: nowrap;\n color: currentColor;\n border: 0;\n border: 2px solid transparent;\n font-family: inherit;\n font-size: var(--rdp-caption-font-size);\n font-weight: bold;\n}\n\n.rdp-nav {\n white-space: nowrap;\n}\n\n.rdp-multiple_months .rdp-caption_start .rdp-nav {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n}\n\n.rdp-multiple_months .rdp-caption_end .rdp-nav {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n}\n\n.rdp-nav_button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n padding: 0.25em;\n border-radius: 100%;\n}\n\n/* ---------- */\n/* Dropdowns */\n/* ---------- */\n\n.rdp-dropdown_year,\n.rdp-dropdown_month {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown {\n appearance: none;\n position: absolute;\n z-index: 2;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n opacity: 0;\n border: none;\n background-color: transparent;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.rdp-dropdown[disabled] {\n opacity: unset;\n color: unset;\n}\n\n.rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n border-radius: 6px;\n}\n\n.rdp-dropdown_icon {\n margin: 0 0 0 5px;\n}\n\n.rdp-head {\n border: 0;\n}\n\n.rdp-head_row,\n.rdp-row {\n height: 100%;\n}\n\n.rdp-head_cell {\n vertical-align: middle;\n font-size: 0.75em;\n font-weight: 700;\n text-align: center;\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-transform: uppercase;\n}\n\n.rdp-tbody {\n border: 0;\n}\n\n.rdp-tfoot {\n margin: 0.5em;\n}\n\n.rdp-cell {\n width: var(--rdp-cell-size);\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-align: center;\n}\n\n.rdp-weeknumber {\n font-size: 0.75em;\n}\n\n.rdp-weeknumber,\n.rdp-day {\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--rdp-cell-size);\n max-width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n margin: 0;\n border: 2px solid transparent;\n border-radius: 100%;\n}\n\n.rdp-day_today:not(.rdp-day_outside) {\n font-weight: bold;\n}\n\n.rdp-day_selected,\n.rdp-day_selected:focus-visible,\n.rdp-day_selected:hover {\n color: white;\n opacity: 1;\n background-color: var(--rdp-accent-color);\n}\n\n.rdp-day_outside {\n opacity: 0.5;\n}\n\n.rdp-day_selected:focus-visible {\n /* Since the background is the same use again the outline */\n outline: var(--rdp-outline);\n outline-offset: 2px;\n z-index: 1;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp-day_range_end.rdp-day_range_start {\n border-radius: 100%;\n}\n\n.rdp-day_range_middle {\n border-radius: 0;\n}";
7856
6027
  styleInject(css_248z$5);
7857
6028
 
@@ -7862,7 +6033,7 @@ var currentMonth = new Date();
7862
6033
  function Calendar(_a) {
7863
6034
  var calendarRange = _a.calendarRange, setCalendarRange = _a.setCalendarRange;
7864
6035
  var t = useTranslation('filterBar').t;
7865
- var isTablet = reactResponsiveExports.useMediaQuery({ maxWidth: 1024 });
6036
+ //const isTablet = useMediaQuery({ maxWidth: 1024 })
7866
6037
  var defaultCalendarSelected = {
7867
6038
  from: currentMonth,
7868
6039
  to: addDays(currentMonth, 0),
@@ -7875,7 +6046,9 @@ function Calendar(_a) {
7875
6046
  React__default__default.createElement("div", { className: "will-calendar-filter-header" },
7876
6047
  React__default__default.createElement("h3", { className: "will-calendar-filter-title" }, t('calendar.title'))),
7877
6048
  React__default__default.createElement("div", { className: "will-calendar-filter-container" },
7878
- React__default__default.createElement(DayPicker, { id: "will-calendar", mode: "range", showOutsideDays: true, fixedWeeks: true, numberOfMonths: !isTablet ? 2 : 1, weekStartsOn: 1, max: 31, defaultMonth: currentMonth, selected: calendarRange, onSelect: setCalendarRange }))));
6049
+ React__default__default.createElement(DayPicker, { id: "will-calendar", mode: "range", showOutsideDays: true, fixedWeeks: true,
6050
+ //numberOfMonths={!isTablet ? 2 : 1}
6051
+ numberOfMonths: 2, weekStartsOn: 1, max: 31, defaultMonth: currentMonth, selected: calendarRange, onSelect: setCalendarRange }))));
7879
6052
  }
7880
6053
 
7881
6054
  var css_248z$3 = ".will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-title {\n font-size: 16px;\n text-transform: uppercase;\n margin: 10px 0;\n}\n\n.will-guests-filter-subtitle {\n font-size: 15px;\n font-weight: 500;\n color:var(--will-text)\n}\n\n\n.will-guests-filter-label, .will-guests-filter-count {\n font-size: 18px;\n color: var(--will-text)\n}\n\n.will-guests-filter-container {\n display: flex;\n margin-top: 30px;\n}\n\n.will-guests-filter-inner {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-inner:not(:last-child) {\n margin-right: 50px;\n}\n\n.will-guests-filter-label {\n display: block;\n margin-right: 20px;\n font-weight: bold;\n}\n\n.will-guests-filter-inner > div {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-count {\n margin: 0 15px;\n}\n\n.will-guests-filter-button {\n border-radius: 50%;\n border: none;\n background-color: var(--will-onahau);\n width: 25px;\n height: 25px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 20px;\n cursor: pointer;\n}";