components.js (1887691B)
1 this["wp"] = this["wp"] || {}; this["wp"]["components"] = 2 /******/ (function(modules) { // webpackBootstrap 3 /******/ // The module cache 4 /******/ var installedModules = {}; 5 /******/ 6 /******/ // The require function 7 /******/ function __webpack_require__(moduleId) { 8 /******/ 9 /******/ // Check if module is in cache 10 /******/ if(installedModules[moduleId]) { 11 /******/ return installedModules[moduleId].exports; 12 /******/ } 13 /******/ // Create a new module (and put it into the cache) 14 /******/ var module = installedModules[moduleId] = { 15 /******/ i: moduleId, 16 /******/ l: false, 17 /******/ exports: {} 18 /******/ }; 19 /******/ 20 /******/ // Execute the module function 21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 22 /******/ 23 /******/ // Flag the module as loaded 24 /******/ module.l = true; 25 /******/ 26 /******/ // Return the exports of the module 27 /******/ return module.exports; 28 /******/ } 29 /******/ 30 /******/ 31 /******/ // expose the modules object (__webpack_modules__) 32 /******/ __webpack_require__.m = modules; 33 /******/ 34 /******/ // expose the module cache 35 /******/ __webpack_require__.c = installedModules; 36 /******/ 37 /******/ // define getter function for harmony exports 38 /******/ __webpack_require__.d = function(exports, name, getter) { 39 /******/ if(!__webpack_require__.o(exports, name)) { 40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 41 /******/ } 42 /******/ }; 43 /******/ 44 /******/ // define __esModule on exports 45 /******/ __webpack_require__.r = function(exports) { 46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 48 /******/ } 49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 /******/ }; 51 /******/ 52 /******/ // create a fake namespace object 53 /******/ // mode & 1: value is a module id, require it 54 /******/ // mode & 2: merge all properties of value into the ns 55 /******/ // mode & 4: return value when already ns object 56 /******/ // mode & 8|1: behave like require 57 /******/ __webpack_require__.t = function(value, mode) { 58 /******/ if(mode & 1) value = __webpack_require__(value); 59 /******/ if(mode & 8) return value; 60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 61 /******/ var ns = Object.create(null); 62 /******/ __webpack_require__.r(ns); 63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 65 /******/ return ns; 66 /******/ }; 67 /******/ 68 /******/ // getDefaultExport function for compatibility with non-harmony modules 69 /******/ __webpack_require__.n = function(module) { 70 /******/ var getter = module && module.__esModule ? 71 /******/ function getDefault() { return module['default']; } : 72 /******/ function getModuleExports() { return module; }; 73 /******/ __webpack_require__.d(getter, 'a', getter); 74 /******/ return getter; 75 /******/ }; 76 /******/ 77 /******/ // Object.prototype.hasOwnProperty.call 78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 79 /******/ 80 /******/ // __webpack_public_path__ 81 /******/ __webpack_require__.p = ""; 82 /******/ 83 /******/ 84 /******/ // Load entry module and return exports 85 /******/ return __webpack_require__(__webpack_require__.s = "SB3u"); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ({ 89 90 /***/ "+51k": 91 /***/ (function(module, exports, __webpack_require__) { 92 93 "use strict"; 94 95 96 Object.defineProperty(exports, "__esModule", { 97 value: true 98 }); 99 exports['default'] = getActiveElement; 100 function getActiveElement() { 101 return typeof document !== 'undefined' && document.activeElement; 102 } 103 104 /***/ }), 105 106 /***/ "+WFq": 107 /***/ (function(module, __webpack_exports__, __webpack_require__) { 108 109 "use strict"; 110 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSlot; }); 111 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 112 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 113 /* harmony import */ var _slot_fill_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("JYkG"); 114 /** 115 * WordPress dependencies 116 */ 117 118 /** 119 * Internal dependencies 120 */ 121 122 123 function useSlot(name) { 124 const registry = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_slot_fill_context__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]); 125 const slot = registry.slots[name] || {}; 126 const slotFills = registry.fills[name]; 127 const fills = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => slotFills || [], [slotFills]); 128 const updateSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillProps => { 129 registry.updateSlot(name, fillProps); 130 }, [name, registry.updateSlot]); 131 const unregisterSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(slotRef => { 132 registry.unregisterSlot(name, slotRef); 133 }, [name, registry.unregisterSlot]); 134 const registerFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillRef => { 135 registry.registerFill(name, fillRef); 136 }, [name, registry.registerFill]); 137 const unregisterFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillRef => { 138 registry.unregisterFill(name, fillRef); 139 }, [name, registry.unregisterFill]); 140 return { ...slot, 141 updateSlot, 142 unregisterSlot, 143 fills, 144 registerFill, 145 unregisterFill 146 }; 147 } 148 149 150 /***/ }), 151 152 /***/ "+ipW": 153 /***/ (function(module, __webpack_exports__, __webpack_require__) { 154 155 "use strict"; 156 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canUseDOM; }); 157 /* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("SyVe"); 158 159 160 161 function checkIsBrowser() { 162 var _window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "a"])(); 163 164 return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement); 165 } 166 /** 167 * It's `true` if it is running in a browser environment or `false` if it is not (SSR). 168 * 169 * @example 170 * import { canUseDOM } from "reakit-utils"; 171 * 172 * const title = canUseDOM ? document.title : ""; 173 */ 174 175 176 var canUseDOM = checkIsBrowser(); 177 178 179 180 181 /***/ }), 182 183 /***/ "/9aa": 184 /***/ (function(module, exports, __webpack_require__) { 185 186 var baseGetTag = __webpack_require__("NykK"), 187 isObjectLike = __webpack_require__("ExA7"); 188 189 /** `Object#toString` result references. */ 190 var symbolTag = '[object Symbol]'; 191 192 /** 193 * Checks if `value` is classified as a `Symbol` primitive or object. 194 * 195 * @static 196 * @memberOf _ 197 * @since 4.0.0 198 * @category Lang 199 * @param {*} value The value to check. 200 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 201 * @example 202 * 203 * _.isSymbol(Symbol.iterator); 204 * // => true 205 * 206 * _.isSymbol('abc'); 207 * // => false 208 */ 209 function isSymbol(value) { 210 return typeof value == 'symbol' || 211 (isObjectLike(value) && baseGetTag(value) == symbolTag); 212 } 213 214 module.exports = isSymbol; 215 216 217 /***/ }), 218 219 /***/ "/ZKw": 220 /***/ (function(module, exports, __webpack_require__) { 221 222 "use strict"; 223 224 225 var define = __webpack_require__("82c2"); 226 var callBind = __webpack_require__("PrET"); 227 228 var implementation = __webpack_require__("yN6O"); 229 var getPolyfill = __webpack_require__("22yB"); 230 var polyfill = getPolyfill(); 231 var shim = __webpack_require__("v3P4"); 232 233 var boundFlat = callBind(polyfill); 234 235 define(boundFlat, { 236 getPolyfill: getPolyfill, 237 implementation: implementation, 238 shim: shim 239 }); 240 241 module.exports = boundFlat; 242 243 244 /***/ }), 245 246 /***/ "/sVA": 247 /***/ (function(module, exports, __webpack_require__) { 248 249 "use strict"; 250 251 252 var toStr = Object.prototype.toString; 253 var hasSymbols = __webpack_require__("UVaH")(); 254 255 if (hasSymbols) { 256 var symToStr = Symbol.prototype.toString; 257 var symStringRegex = /^Symbol\(.*\)$/; 258 var isSymbolObject = function isRealSymbolObject(value) { 259 if (typeof value.valueOf() !== 'symbol') { 260 return false; 261 } 262 return symStringRegex.test(symToStr.call(value)); 263 }; 264 265 module.exports = function isSymbol(value) { 266 if (typeof value === 'symbol') { 267 return true; 268 } 269 if (toStr.call(value) !== '[object Symbol]') { 270 return false; 271 } 272 try { 273 return isSymbolObject(value); 274 } catch (e) { 275 return false; 276 } 277 }; 278 } else { 279 280 module.exports = function isSymbol(value) { 281 // this environment does not support Symbols. 282 return false && false; 283 }; 284 } 285 286 287 /***/ }), 288 289 /***/ 0: 290 /***/ (function(module, exports) { 291 292 /* (ignored) */ 293 294 /***/ }), 295 296 /***/ "030x": 297 /***/ (function(module, exports, __webpack_require__) { 298 299 "use strict"; 300 301 302 Object.defineProperty(exports, "__esModule", { 303 value: true 304 }); 305 var styleInterface = void 0; 306 var styleTheme = void 0; 307 308 var START_MARK = 'react-with-styles.resolve.start'; 309 var END_MARK = 'react-with-styles.resolve.end'; 310 var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]'; 311 312 function registerTheme(theme) { 313 styleTheme = theme; 314 } 315 316 function registerInterface(interfaceToRegister) { 317 styleInterface = interfaceToRegister; 318 } 319 320 function create(makeFromTheme, createWithDirection) { 321 var styles = createWithDirection(makeFromTheme(styleTheme)); 322 return function () { 323 return styles; 324 }; 325 } 326 327 function createLTR(makeFromTheme) { 328 return create(makeFromTheme, styleInterface.createLTR || styleInterface.create); 329 } 330 331 function createRTL(makeFromTheme) { 332 return create(makeFromTheme, styleInterface.createRTL || styleInterface.create); 333 } 334 335 function get() { 336 return styleTheme; 337 } 338 339 function resolve() { 340 if (false) {} 341 342 for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) { 343 styles[_key] = arguments[_key]; 344 } 345 346 var result = styleInterface.resolve(styles); 347 348 if (false) {} 349 350 return result; 351 } 352 353 function resolveLTR() { 354 for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 355 styles[_key2] = arguments[_key2]; 356 } 357 358 if (styleInterface.resolveLTR) { 359 return styleInterface.resolveLTR(styles); 360 } 361 362 return resolve(styles); 363 } 364 365 function resolveRTL() { 366 for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 367 styles[_key3] = arguments[_key3]; 368 } 369 370 if (styleInterface.resolveRTL) { 371 return styleInterface.resolveRTL(styles); 372 } 373 374 return resolve(styles); 375 } 376 377 function flush() { 378 if (styleInterface.flush) { 379 styleInterface.flush(); 380 } 381 } 382 383 exports['default'] = { 384 registerTheme: registerTheme, 385 registerInterface: registerInterface, 386 create: createLTR, 387 createLTR: createLTR, 388 createRTL: createRTL, 389 get: get, 390 resolve: resolveLTR, 391 resolveLTR: resolveLTR, 392 resolveRTL: resolveRTL, 393 flush: flush 394 }; 395 396 /***/ }), 397 398 /***/ "0Dl3": 399 /***/ (function(module, exports, __webpack_require__) { 400 401 "use strict"; 402 403 404 Object.defineProperty(exports, "__esModule", { 405 value: true 406 }); 407 exports['default'] = getNumberOfCalendarMonthWeeks; 408 409 var _moment = __webpack_require__("wy2R"); 410 411 var _moment2 = _interopRequireDefault(_moment); 412 413 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 414 415 function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) { 416 var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek; 417 return (weekDayDiff + 7) % 7; 418 } 419 420 function getNumberOfCalendarMonthWeeks(month) { 421 var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek(); 422 423 var firstDayOfMonth = month.clone().startOf('month'); 424 var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek); 425 return Math.ceil((numBlankDays + month.daysInMonth()) / 7); 426 } 427 428 /***/ }), 429 430 /***/ "0HL0": 431 /***/ (function(module, __webpack_exports__, __webpack_require__) { 432 433 "use strict"; 434 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setTextFieldValue; }); 435 /* harmony import */ var reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("qOxZ"); 436 437 438 function setTextFieldValue(element, value) { 439 if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) { 440 var _Object$getOwnPropert; 441 442 var proto = Object.getPrototypeOf(element); 443 var setValue = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set; 444 445 if (setValue) { 446 setValue.call(element, value); 447 Object(reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_0__[/* fireEvent */ "a"])(element, "input", { 448 bubbles: true 449 }); 450 } 451 } 452 } 453 454 455 456 457 /***/ }), 458 459 /***/ "0XP8": 460 /***/ (function(module, exports, __webpack_require__) { 461 462 "use strict"; 463 464 465 Object.defineProperty(exports, "__esModule", { 466 value: true 467 }); 468 469 var _react = __webpack_require__("cDcd"); 470 471 var _react2 = _interopRequireDefault(_react); 472 473 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 474 475 var LeftArrow = function () { 476 function LeftArrow(props) { 477 return _react2['default'].createElement( 478 'svg', 479 props, 480 _react2['default'].createElement('path', { 481 d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z' 482 }) 483 ); 484 } 485 486 return LeftArrow; 487 }(); 488 489 LeftArrow.defaultProps = { 490 viewBox: '0 0 1000 1000' 491 }; 492 exports['default'] = LeftArrow; 493 494 /***/ }), 495 496 /***/ "1+Kn": 497 /***/ (function(module, exports, __webpack_require__) { 498 499 "use strict"; 500 501 502 Object.defineProperty(exports, "__esModule", { 503 value: true 504 }); 505 exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = undefined; 506 507 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; }; 508 509 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; }; }(); 510 511 var _object = __webpack_require__("Koq/"); 512 513 var _object2 = _interopRequireDefault(_object); 514 515 var _react = __webpack_require__("cDcd"); 516 517 var _react2 = _interopRequireDefault(_react); 518 519 var _propTypes = __webpack_require__("17x9"); 520 521 var _propTypes2 = _interopRequireDefault(_propTypes); 522 523 var _airbnbPropTypes = __webpack_require__("Hsqg"); 524 525 var _reactWithStyles = __webpack_require__("TG4+"); 526 527 var _defaultPhrases = __webpack_require__("vV+G"); 528 529 var _getPhrasePropTypes = __webpack_require__("yc2e"); 530 531 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 532 533 var _KeyboardShortcutRow = __webpack_require__("zN8g"); 534 535 var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow); 536 537 var _CloseButton = __webpack_require__("xEte"); 538 539 var _CloseButton2 = _interopRequireDefault(_CloseButton); 540 541 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 542 543 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 544 545 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; } 546 547 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; } 548 549 var TOP_LEFT = exports.TOP_LEFT = 'top-left'; 550 var TOP_RIGHT = exports.TOP_RIGHT = 'top-right'; 551 var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right'; 552 553 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 554 block: _propTypes2['default'].bool, 555 buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]), 556 showKeyboardShortcutsPanel: _propTypes2['default'].bool, 557 openKeyboardShortcutsPanel: _propTypes2['default'].func, 558 closeKeyboardShortcutsPanel: _propTypes2['default'].func, 559 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases)) 560 })); 561 562 var defaultProps = { 563 block: false, 564 buttonLocation: BOTTOM_RIGHT, 565 showKeyboardShortcutsPanel: false, 566 openKeyboardShortcutsPanel: function () { 567 function openKeyboardShortcutsPanel() {} 568 569 return openKeyboardShortcutsPanel; 570 }(), 571 closeKeyboardShortcutsPanel: function () { 572 function closeKeyboardShortcutsPanel() {} 573 574 return closeKeyboardShortcutsPanel; 575 }(), 576 577 phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases 578 }; 579 580 function getKeyboardShortcuts(phrases) { 581 return [{ 582 unicode: '↵', 583 label: phrases.enterKey, 584 action: phrases.selectFocusedDate 585 }, { 586 unicode: '←/→', 587 label: phrases.leftArrowRightArrow, 588 action: phrases.moveFocusByOneDay 589 }, { 590 unicode: '↑/↓', 591 label: phrases.upArrowDownArrow, 592 action: phrases.moveFocusByOneWeek 593 }, { 594 unicode: 'PgUp/PgDn', 595 label: phrases.pageUpPageDown, 596 action: phrases.moveFocusByOneMonth 597 }, { 598 unicode: 'Home/End', 599 label: phrases.homeEnd, 600 action: phrases.moveFocustoStartAndEndOfWeek 601 }, { 602 unicode: 'Esc', 603 label: phrases.escape, 604 action: phrases.returnFocusToInput 605 }, { 606 unicode: '?', 607 label: phrases.questionMark, 608 action: phrases.openThisPanel 609 }]; 610 } 611 612 var DayPickerKeyboardShortcuts = function (_React$Component) { 613 _inherits(DayPickerKeyboardShortcuts, _React$Component); 614 615 function DayPickerKeyboardShortcuts() { 616 var _ref; 617 618 _classCallCheck(this, DayPickerKeyboardShortcuts); 619 620 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 621 args[_key] = arguments[_key]; 622 } 623 624 var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args))); 625 626 var phrases = _this.props.phrases; 627 628 _this.keyboardShortcuts = getKeyboardShortcuts(phrases); 629 630 _this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this); 631 _this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this); 632 _this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this); 633 _this.handleFocus = _this.handleFocus.bind(_this); 634 _this.onKeyDown = _this.onKeyDown.bind(_this); 635 return _this; 636 } 637 638 _createClass(DayPickerKeyboardShortcuts, [{ 639 key: 'componentWillReceiveProps', 640 value: function () { 641 function componentWillReceiveProps(nextProps) { 642 var phrases = this.props.phrases; 643 644 if (nextProps.phrases !== phrases) { 645 this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases); 646 } 647 } 648 649 return componentWillReceiveProps; 650 }() 651 }, { 652 key: 'componentDidUpdate', 653 value: function () { 654 function componentDidUpdate() { 655 this.handleFocus(); 656 } 657 658 return componentDidUpdate; 659 }() 660 }, { 661 key: 'onKeyDown', 662 value: function () { 663 function onKeyDown(e) { 664 e.stopPropagation(); 665 666 var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel; 667 // Because the close button is the only focusable element inside of the panel, this 668 // amounts to a very basic focus trap. The user can exit the panel by "pressing" the 669 // close button or hitting escape 670 671 switch (e.key) { 672 case 'Enter': 673 case ' ': 674 case 'Spacebar': // for older browsers 675 case 'Escape': 676 closeKeyboardShortcutsPanel(); 677 break; 678 679 // do nothing - this allows the up and down arrows continue their 680 // default behavior of scrolling the content of the Keyboard Shortcuts Panel 681 // which is needed when only a single month is shown for instance. 682 case 'ArrowUp': 683 case 'ArrowDown': 684 break; 685 686 // completely block the rest of the keys that have functionality outside of this panel 687 case 'Tab': 688 case 'Home': 689 case 'End': 690 case 'PageUp': 691 case 'PageDown': 692 case 'ArrowLeft': 693 case 'ArrowRight': 694 e.preventDefault(); 695 break; 696 697 default: 698 break; 699 } 700 } 701 702 return onKeyDown; 703 }() 704 }, { 705 key: 'onShowKeyboardShortcutsButtonClick', 706 value: function () { 707 function onShowKeyboardShortcutsButtonClick() { 708 var _this2 = this; 709 710 var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel; 711 712 // we want to return focus to this button after closing the keyboard shortcuts panel 713 714 openKeyboardShortcutsPanel(function () { 715 _this2.showKeyboardShortcutsButton.focus(); 716 }); 717 } 718 719 return onShowKeyboardShortcutsButtonClick; 720 }() 721 }, { 722 key: 'setShowKeyboardShortcutsButtonRef', 723 value: function () { 724 function setShowKeyboardShortcutsButtonRef(ref) { 725 this.showKeyboardShortcutsButton = ref; 726 } 727 728 return setShowKeyboardShortcutsButtonRef; 729 }() 730 }, { 731 key: 'setHideKeyboardShortcutsButtonRef', 732 value: function () { 733 function setHideKeyboardShortcutsButtonRef(ref) { 734 this.hideKeyboardShortcutsButton = ref; 735 } 736 737 return setHideKeyboardShortcutsButtonRef; 738 }() 739 }, { 740 key: 'handleFocus', 741 value: function () { 742 function handleFocus() { 743 if (this.hideKeyboardShortcutsButton) { 744 // automatically move focus into the dialog by moving 745 // to the only interactive element, the hide button 746 this.hideKeyboardShortcutsButton.focus(); 747 } 748 } 749 750 return handleFocus; 751 }() 752 }, { 753 key: 'render', 754 value: function () { 755 function render() { 756 var _this3 = this; 757 758 var _props = this.props, 759 block = _props.block, 760 buttonLocation = _props.buttonLocation, 761 showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel, 762 closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel, 763 styles = _props.styles, 764 phrases = _props.phrases; 765 766 767 var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel; 768 769 var bottomRight = buttonLocation === BOTTOM_RIGHT; 770 var topRight = buttonLocation === TOP_RIGHT; 771 var topLeft = buttonLocation === TOP_LEFT; 772 773 return _react2['default'].createElement( 774 'div', 775 null, 776 _react2['default'].createElement( 777 'button', 778 _extends({ 779 ref: this.setShowKeyboardShortcutsButtonRef 780 }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), { 781 type: 'button', 782 'aria-label': toggleButtonText, 783 onClick: this.onShowKeyboardShortcutsButtonClick, 784 onKeyDown: function () { 785 function onKeyDown(e) { 786 if (e.key === 'Enter') { 787 e.preventDefault(); 788 } else if (e.key === 'Space') { 789 _this3.onShowKeyboardShortcutsButtonClick(e); 790 } 791 } 792 793 return onKeyDown; 794 }(), 795 onMouseUp: function () { 796 function onMouseUp(e) { 797 e.currentTarget.blur(); 798 } 799 800 return onMouseUp; 801 }() 802 }), 803 _react2['default'].createElement( 804 'span', 805 (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft), 806 '?' 807 ) 808 ), 809 showKeyboardShortcutsPanel && _react2['default'].createElement( 810 'div', 811 _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), { 812 role: 'dialog', 813 'aria-labelledby': 'DayPickerKeyboardShortcuts_title', 814 'aria-describedby': 'DayPickerKeyboardShortcuts_description' 815 }), 816 _react2['default'].createElement( 817 'div', 818 _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), { 819 id: 'DayPickerKeyboardShortcuts_title' 820 }), 821 phrases.keyboardShortcuts 822 ), 823 _react2['default'].createElement( 824 'button', 825 _extends({ 826 ref: this.setHideKeyboardShortcutsButtonRef 827 }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), { 828 type: 'button', 829 tabIndex: '0', 830 'aria-label': phrases.hideKeyboardShortcutsPanel, 831 onClick: closeKeyboardShortcutsPanel, 832 onKeyDown: this.onKeyDown 833 }), 834 _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg)) 835 ), 836 _react2['default'].createElement( 837 'ul', 838 _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), { 839 id: 'DayPickerKeyboardShortcuts_description' 840 }), 841 this.keyboardShortcuts.map(function (_ref2) { 842 var unicode = _ref2.unicode, 843 label = _ref2.label, 844 action = _ref2.action; 845 return _react2['default'].createElement(_KeyboardShortcutRow2['default'], { 846 key: label, 847 unicode: unicode, 848 label: label, 849 action: action, 850 block: block 851 }); 852 }) 853 ) 854 ) 855 ); 856 } 857 858 return render; 859 }() 860 }]); 861 862 return DayPickerKeyboardShortcuts; 863 }(_react2['default'].Component); 864 865 DayPickerKeyboardShortcuts.propTypes = propTypes; 866 DayPickerKeyboardShortcuts.defaultProps = defaultProps; 867 868 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref3) { 869 var _ref3$reactDates = _ref3.reactDates, 870 color = _ref3$reactDates.color, 871 font = _ref3$reactDates.font, 872 zIndex = _ref3$reactDates.zIndex; 873 return { 874 DayPickerKeyboardShortcuts_buttonReset: { 875 background: 'none', 876 border: 0, 877 borderRadius: 0, 878 color: 'inherit', 879 font: 'inherit', 880 lineHeight: 'normal', 881 overflow: 'visible', 882 padding: 0, 883 cursor: 'pointer', 884 fontSize: font.size, 885 886 ':active': { 887 outline: 'none' 888 } 889 }, 890 891 DayPickerKeyboardShortcuts_show: { 892 width: 22, 893 position: 'absolute', 894 zIndex: zIndex + 2 895 }, 896 897 DayPickerKeyboardShortcuts_show__bottomRight: { 898 borderTop: '26px solid transparent', 899 borderRight: '33px solid ' + String(color.core.primary), 900 bottom: 0, 901 right: 0, 902 903 ':hover': { 904 borderRight: '33px solid ' + String(color.core.primary_dark) 905 } 906 }, 907 908 DayPickerKeyboardShortcuts_show__topRight: { 909 borderBottom: '26px solid transparent', 910 borderRight: '33px solid ' + String(color.core.primary), 911 top: 0, 912 right: 0, 913 914 ':hover': { 915 borderRight: '33px solid ' + String(color.core.primary_dark) 916 } 917 }, 918 919 DayPickerKeyboardShortcuts_show__topLeft: { 920 borderBottom: '26px solid transparent', 921 borderLeft: '33px solid ' + String(color.core.primary), 922 top: 0, 923 left: 0, 924 925 ':hover': { 926 borderLeft: '33px solid ' + String(color.core.primary_dark) 927 } 928 }, 929 930 DayPickerKeyboardShortcuts_showSpan: { 931 color: color.core.white, 932 position: 'absolute' 933 }, 934 935 DayPickerKeyboardShortcuts_showSpan__bottomRight: { 936 bottom: 0, 937 right: -28 938 }, 939 940 DayPickerKeyboardShortcuts_showSpan__topRight: { 941 top: 1, 942 right: -28 943 }, 944 945 DayPickerKeyboardShortcuts_showSpan__topLeft: { 946 top: 1, 947 left: -28 948 }, 949 950 DayPickerKeyboardShortcuts_panel: { 951 overflow: 'auto', 952 background: color.background, 953 border: '1px solid ' + String(color.core.border), 954 borderRadius: 2, 955 position: 'absolute', 956 top: 0, 957 bottom: 0, 958 right: 0, 959 left: 0, 960 zIndex: zIndex + 2, 961 padding: 22, 962 margin: 33 963 }, 964 965 DayPickerKeyboardShortcuts_title: { 966 fontSize: 16, 967 fontWeight: 'bold', 968 margin: 0 969 }, 970 971 DayPickerKeyboardShortcuts_list: { 972 listStyle: 'none', 973 padding: 0, 974 fontSize: font.size 975 }, 976 977 DayPickerKeyboardShortcuts_close: { 978 position: 'absolute', 979 right: 22, 980 top: 22, 981 zIndex: zIndex + 2, 982 983 ':active': { 984 outline: 'none' 985 } 986 }, 987 988 DayPickerKeyboardShortcuts_closeSvg: { 989 height: 15, 990 width: 15, 991 fill: color.core.grayLighter, 992 993 ':hover': { 994 fill: color.core.grayLight 995 }, 996 997 ':focus': { 998 fill: color.core.grayLight 999 } 1000 } 1001 }; 1002 })(DayPickerKeyboardShortcuts); 1003 1004 /***/ }), 1005 1006 /***/ "10Kj": 1007 /***/ (function(module, exports, __webpack_require__) { 1008 1009 "use strict"; 1010 1011 1012 var GetIntrinsic = __webpack_require__("rZ7t"); 1013 1014 var $TypeError = GetIntrinsic('%TypeError%'); 1015 var $SyntaxError = GetIntrinsic('%SyntaxError%'); 1016 1017 var has = __webpack_require__("oNNP"); 1018 1019 var predicates = { 1020 // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type 1021 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { 1022 if (Type(Desc) !== 'Object') { 1023 return false; 1024 } 1025 var allowed = { 1026 '[[Configurable]]': true, 1027 '[[Enumerable]]': true, 1028 '[[Get]]': true, 1029 '[[Set]]': true, 1030 '[[Value]]': true, 1031 '[[Writable]]': true 1032 }; 1033 1034 for (var key in Desc) { // eslint-disable-line 1035 if (has(Desc, key) && !allowed[key]) { 1036 return false; 1037 } 1038 } 1039 1040 var isData = has(Desc, '[[Value]]'); 1041 var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); 1042 if (isData && IsAccessor) { 1043 throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); 1044 } 1045 return true; 1046 } 1047 }; 1048 1049 module.exports = function assertRecord(Type, recordType, argumentName, value) { 1050 var predicate = predicates[recordType]; 1051 if (typeof predicate !== 'function') { 1052 throw new $SyntaxError('unknown record type: ' + recordType); 1053 } 1054 if (!predicate(Type, value)) { 1055 throw new $TypeError(argumentName + ' must be a ' + recordType); 1056 } 1057 }; 1058 1059 1060 /***/ }), 1061 1062 /***/ "16Al": 1063 /***/ (function(module, exports, __webpack_require__) { 1064 1065 "use strict"; 1066 /** 1067 * Copyright (c) 2013-present, Facebook, Inc. 1068 * 1069 * This source code is licensed under the MIT license found in the 1070 * LICENSE file in the root directory of this source tree. 1071 */ 1072 1073 1074 1075 var ReactPropTypesSecret = __webpack_require__("WbBG"); 1076 1077 function emptyFunction() {} 1078 function emptyFunctionWithReset() {} 1079 emptyFunctionWithReset.resetWarningCache = emptyFunction; 1080 1081 module.exports = function() { 1082 function shim(props, propName, componentName, location, propFullName, secret) { 1083 if (secret === ReactPropTypesSecret) { 1084 // It is still safe when called from React. 1085 return; 1086 } 1087 var err = new Error( 1088 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 1089 'Use PropTypes.checkPropTypes() to call them. ' + 1090 'Read more at http://fb.me/use-check-prop-types' 1091 ); 1092 err.name = 'Invariant Violation'; 1093 throw err; 1094 }; 1095 shim.isRequired = shim; 1096 function getShim() { 1097 return shim; 1098 }; 1099 // Important! 1100 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. 1101 var ReactPropTypes = { 1102 array: shim, 1103 bool: shim, 1104 func: shim, 1105 number: shim, 1106 object: shim, 1107 string: shim, 1108 symbol: shim, 1109 1110 any: shim, 1111 arrayOf: getShim, 1112 element: shim, 1113 elementType: shim, 1114 instanceOf: getShim, 1115 node: shim, 1116 objectOf: getShim, 1117 oneOf: getShim, 1118 oneOfType: getShim, 1119 shape: getShim, 1120 exact: getShim, 1121 1122 checkPropTypes: emptyFunctionWithReset, 1123 resetWarningCache: emptyFunction 1124 }; 1125 1126 ReactPropTypes.PropTypes = ReactPropTypes; 1127 1128 return ReactPropTypes; 1129 }; 1130 1131 1132 /***/ }), 1133 1134 /***/ "17x9": 1135 /***/ (function(module, exports, __webpack_require__) { 1136 1137 /** 1138 * Copyright (c) 2013-present, Facebook, Inc. 1139 * 1140 * This source code is licensed under the MIT license found in the 1141 * LICENSE file in the root directory of this source tree. 1142 */ 1143 1144 if (false) { var throwOnDirectAccess, ReactIs; } else { 1145 // By explicitly using `prop-types` you are opting into new production behavior. 1146 // http://fb.me/prop-types-in-prod 1147 module.exports = __webpack_require__("16Al")(); 1148 } 1149 1150 1151 /***/ }), 1152 1153 /***/ "1CF3": 1154 /***/ (function(module, exports) { 1155 1156 (function() { module.exports = window["wp"]["dom"]; }()); 1157 1158 /***/ }), 1159 1160 /***/ "1KsK": 1161 /***/ (function(module, exports, __webpack_require__) { 1162 1163 "use strict"; 1164 1165 1166 var toStr = Object.prototype.toString; 1167 1168 module.exports = function isArguments(value) { 1169 var str = toStr.call(value); 1170 var isArgs = str === '[object Arguments]'; 1171 if (!isArgs) { 1172 isArgs = str !== '[object Array]' && 1173 value !== null && 1174 typeof value === 'object' && 1175 typeof value.length === 'number' && 1176 value.length >= 0 && 1177 toStr.call(value.callee) === '[object Function]'; 1178 } 1179 return isArgs; 1180 }; 1181 1182 1183 /***/ }), 1184 1185 /***/ "1LY1": 1186 /***/ (function(module, exports, __webpack_require__) { 1187 1188 "use strict"; 1189 1190 1191 var bind = __webpack_require__("D3zA"); 1192 var GetIntrinsic = __webpack_require__("rZ7t"); 1193 1194 var $apply = GetIntrinsic('%Function.prototype.apply%'); 1195 var $call = GetIntrinsic('%Function.prototype.call%'); 1196 var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); 1197 1198 var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); 1199 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 1200 var $max = GetIntrinsic('%Math.max%'); 1201 1202 if ($defineProperty) { 1203 try { 1204 $defineProperty({}, 'a', { value: 1 }); 1205 } catch (e) { 1206 // IE 8 has a broken defineProperty 1207 $defineProperty = null; 1208 } 1209 } 1210 1211 module.exports = function callBind(originalFunction) { 1212 var func = $reflectApply(bind, $call, arguments); 1213 if ($gOPD && $defineProperty) { 1214 var desc = $gOPD(func, 'length'); 1215 if (desc.configurable) { 1216 // original length, plus the receiver, minus any additional arguments (after the receiver) 1217 $defineProperty( 1218 func, 1219 'length', 1220 { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } 1221 ); 1222 } 1223 } 1224 return func; 1225 }; 1226 1227 var applyBind = function applyBind() { 1228 return $reflectApply(bind, $apply, arguments); 1229 }; 1230 1231 if ($defineProperty) { 1232 $defineProperty(module.exports, 'apply', { value: applyBind }); 1233 } else { 1234 module.exports.apply = applyBind; 1235 } 1236 1237 1238 /***/ }), 1239 1240 /***/ "1TsT": 1241 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1242 1243 "use strict"; 1244 __webpack_require__.r(__webpack_exports__); 1245 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEventListener", function() { return addEventListener; }); 1246 var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); 1247 1248 // Adapted from Modernizr 1249 // https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37 1250 function testPassiveEventListeners() { 1251 if (!CAN_USE_DOM) { 1252 return false; 1253 } 1254 1255 if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) { 1256 return false; 1257 } 1258 1259 var supportsPassiveOption = false; 1260 try { 1261 var opts = Object.defineProperty({}, 'passive', { 1262 // eslint-disable-next-line getter-return 1263 get: function () { 1264 function get() { 1265 supportsPassiveOption = true; 1266 } 1267 1268 return get; 1269 }() 1270 }); 1271 var noop = function noop() {}; 1272 window.addEventListener('testPassiveEventSupport', noop, opts); 1273 window.removeEventListener('testPassiveEventSupport', noop, opts); 1274 } catch (e) { 1275 // do nothing 1276 } 1277 1278 return supportsPassiveOption; 1279 } 1280 1281 var memoized = void 0; 1282 1283 function canUsePassiveEventListeners() { 1284 if (memoized === undefined) { 1285 memoized = testPassiveEventListeners(); 1286 } 1287 return memoized; 1288 } 1289 1290 function normalizeEventOptions(eventOptions) { 1291 if (!eventOptions) { 1292 return undefined; 1293 } 1294 1295 if (!canUsePassiveEventListeners()) { 1296 // If the browser does not support the passive option, then it is expecting 1297 // a boolean for the options argument to specify whether it should use 1298 // capture or not. In more modern browsers, this is passed via the `capture` 1299 // option, so let's just hoist that value up. 1300 return !!eventOptions.capture; 1301 } 1302 1303 return eventOptions; 1304 } 1305 1306 /* eslint-disable no-bitwise */ 1307 1308 /** 1309 * Generate a unique key for any set of event options 1310 */ 1311 function eventOptionsKey(normalizedEventOptions) { 1312 if (!normalizedEventOptions) { 1313 return 0; 1314 } 1315 1316 // If the browser does not support passive event listeners, the normalized 1317 // event options will be a boolean. 1318 if (normalizedEventOptions === true) { 1319 return 100; 1320 } 1321 1322 // At this point, the browser supports passive event listeners, so we expect 1323 // the event options to be an object with possible properties of capture, 1324 // passive, and once. 1325 // 1326 // We want to consistently return the same value, regardless of the order of 1327 // these properties, so let's use binary maths to assign each property to a 1328 // bit, and then add those together (with an offset to account for the 1329 // booleans at the beginning of this function). 1330 var capture = normalizedEventOptions.capture << 0; 1331 var passive = normalizedEventOptions.passive << 1; 1332 var once = normalizedEventOptions.once << 2; 1333 return capture + passive + once; 1334 } 1335 1336 function ensureCanMutateNextEventHandlers(eventHandlers) { 1337 if (eventHandlers.handlers === eventHandlers.nextHandlers) { 1338 // eslint-disable-next-line no-param-reassign 1339 eventHandlers.nextHandlers = eventHandlers.handlers.slice(); 1340 } 1341 } 1342 1343 function TargetEventHandlers(target) { 1344 this.target = target; 1345 this.events = {}; 1346 } 1347 1348 TargetEventHandlers.prototype.getEventHandlers = function () { 1349 function getEventHandlers(eventName, options) { 1350 var key = String(eventName) + ' ' + String(eventOptionsKey(options)); 1351 1352 if (!this.events[key]) { 1353 this.events[key] = { 1354 handlers: [], 1355 handleEvent: undefined 1356 }; 1357 this.events[key].nextHandlers = this.events[key].handlers; 1358 } 1359 1360 return this.events[key]; 1361 } 1362 1363 return getEventHandlers; 1364 }(); 1365 1366 TargetEventHandlers.prototype.handleEvent = function () { 1367 function handleEvent(eventName, options, event) { 1368 var eventHandlers = this.getEventHandlers(eventName, options); 1369 eventHandlers.handlers = eventHandlers.nextHandlers; 1370 eventHandlers.handlers.forEach(function (handler) { 1371 if (handler) { 1372 // We need to check for presence here because a handler function may 1373 // cause later handlers to get removed. This can happen if you for 1374 // instance have a waypoint that unmounts another waypoint as part of an 1375 // onEnter/onLeave handler. 1376 handler(event); 1377 } 1378 }); 1379 } 1380 1381 return handleEvent; 1382 }(); 1383 1384 TargetEventHandlers.prototype.add = function () { 1385 function add(eventName, listener, options) { 1386 var _this = this; 1387 1388 // options has already been normalized at this point. 1389 var eventHandlers = this.getEventHandlers(eventName, options); 1390 1391 ensureCanMutateNextEventHandlers(eventHandlers); 1392 1393 if (eventHandlers.nextHandlers.length === 0) { 1394 eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options); 1395 1396 this.target.addEventListener(eventName, eventHandlers.handleEvent, options); 1397 } 1398 1399 eventHandlers.nextHandlers.push(listener); 1400 1401 var isSubscribed = true; 1402 var unsubscribe = function () { 1403 function unsubscribe() { 1404 if (!isSubscribed) { 1405 return; 1406 } 1407 1408 isSubscribed = false; 1409 1410 ensureCanMutateNextEventHandlers(eventHandlers); 1411 var index = eventHandlers.nextHandlers.indexOf(listener); 1412 eventHandlers.nextHandlers.splice(index, 1); 1413 1414 if (eventHandlers.nextHandlers.length === 0) { 1415 // All event handlers have been removed, so we want to remove the event 1416 // listener from the target node. 1417 1418 if (_this.target) { 1419 // There can be a race condition where the target may no longer exist 1420 // when this function is called, e.g. when a React component is 1421 // unmounting. Guarding against this prevents the following error: 1422 // 1423 // Cannot read property 'removeEventListener' of undefined 1424 _this.target.removeEventListener(eventName, eventHandlers.handleEvent, options); 1425 } 1426 1427 eventHandlers.handleEvent = undefined; 1428 } 1429 } 1430 1431 return unsubscribe; 1432 }(); 1433 return unsubscribe; 1434 } 1435 1436 return add; 1437 }(); 1438 1439 var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__'; 1440 1441 // eslint-disable-next-line import/prefer-default-export 1442 function addEventListener(target, eventName, listener, options) { 1443 if (!target[EVENT_HANDLERS_KEY]) { 1444 // eslint-disable-next-line no-param-reassign 1445 target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target); 1446 } 1447 var normalizedEventOptions = normalizeEventOptions(options); 1448 return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions); 1449 } 1450 1451 1452 1453 1454 /***/ }), 1455 1456 /***/ "1iEr": 1457 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1458 1459 "use strict"; 1460 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 1461 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1462 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 1463 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1464 1465 1466 /** 1467 * WordPress dependencies 1468 */ 1469 1470 const chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1471 xmlns: "http://www.w3.org/2000/svg", 1472 viewBox: "0 0 24 24" 1473 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1474 d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" 1475 })); 1476 /* harmony default export */ __webpack_exports__["a"] = (chevronRight); 1477 1478 1479 /***/ }), 1480 1481 /***/ "1seS": 1482 /***/ (function(module, exports, __webpack_require__) { 1483 1484 "use strict"; 1485 1486 1487 var slice = Array.prototype.slice; 1488 var isArgs = __webpack_require__("1KsK"); 1489 1490 var origKeys = Object.keys; 1491 var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__("sYn3"); 1492 1493 var originalKeys = Object.keys; 1494 1495 keysShim.shim = function shimObjectKeys() { 1496 if (Object.keys) { 1497 var keysWorksWithArguments = (function () { 1498 // Safari 5.0 bug 1499 var args = Object.keys(arguments); 1500 return args && args.length === arguments.length; 1501 }(1, 2)); 1502 if (!keysWorksWithArguments) { 1503 Object.keys = function keys(object) { // eslint-disable-line func-name-matching 1504 if (isArgs(object)) { 1505 return originalKeys(slice.call(object)); 1506 } 1507 return originalKeys(object); 1508 }; 1509 } 1510 } else { 1511 Object.keys = keysShim; 1512 } 1513 return Object.keys || keysShim; 1514 }; 1515 1516 module.exports = keysShim; 1517 1518 1519 /***/ }), 1520 1521 /***/ "22yB": 1522 /***/ (function(module, exports, __webpack_require__) { 1523 1524 "use strict"; 1525 1526 1527 var implementation = __webpack_require__("yN6O"); 1528 1529 module.exports = function getPolyfill() { 1530 return Array.prototype.flat || implementation; 1531 }; 1532 1533 1534 /***/ }), 1535 1536 /***/ "25kQ": 1537 /***/ (function(module, exports, __webpack_require__) { 1538 1539 "use strict"; 1540 1541 1542 module.exports = __webpack_require__("aUaa"); 1543 1544 1545 /***/ }), 1546 1547 /***/ "2Q00": 1548 /***/ (function(module, exports, __webpack_require__) { 1549 1550 "use strict"; 1551 1552 1553 Object.defineProperty(exports, "__esModule", { 1554 value: true 1555 }); 1556 exports['default'] = CalendarWeek; 1557 1558 var _react = __webpack_require__("cDcd"); 1559 1560 var _react2 = _interopRequireDefault(_react); 1561 1562 var _airbnbPropTypes = __webpack_require__("Hsqg"); 1563 1564 var _CalendarDay = __webpack_require__("N3k4"); 1565 1566 var _CalendarDay2 = _interopRequireDefault(_CalendarDay); 1567 1568 var _CustomizableCalendarDay = __webpack_require__("GET3"); 1569 1570 var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay); 1571 1572 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 1573 1574 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({ 1575 children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired 1576 }); 1577 1578 function CalendarWeek(_ref) { 1579 var children = _ref.children; 1580 1581 return _react2['default'].createElement( 1582 'tr', 1583 null, 1584 children 1585 ); 1586 } 1587 1588 CalendarWeek.propTypes = propTypes; 1589 1590 /***/ }), 1591 1592 /***/ "2S2E": 1593 /***/ (function(module, exports, __webpack_require__) { 1594 1595 "use strict"; 1596 1597 1598 Object.defineProperty(exports, "__esModule", { 1599 value: true 1600 }); 1601 1602 var _propTypes = __webpack_require__("17x9"); 1603 1604 var _propTypes2 = _interopRequireDefault(_propTypes); 1605 1606 var _constants = __webpack_require__("Fv1B"); 1607 1608 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 1609 1610 exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS); 1611 1612 /***/ }), 1613 1614 /***/ "2gm7": 1615 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1616 1617 "use strict"; 1618 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 1619 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1620 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 1621 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1622 1623 1624 /** 1625 * WordPress dependencies 1626 */ 1627 1628 const chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1629 xmlns: "http://www.w3.org/2000/svg", 1630 viewBox: "0 0 24 24" 1631 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1632 d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" 1633 })); 1634 /* harmony default export */ __webpack_exports__["a"] = (chevronLeft); 1635 1636 1637 /***/ }), 1638 1639 /***/ "2mql": 1640 /***/ (function(module, exports, __webpack_require__) { 1641 1642 "use strict"; 1643 1644 1645 var reactIs = __webpack_require__("TOwV"); 1646 1647 /** 1648 * Copyright 2015, Yahoo! Inc. 1649 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. 1650 */ 1651 var REACT_STATICS = { 1652 childContextTypes: true, 1653 contextType: true, 1654 contextTypes: true, 1655 defaultProps: true, 1656 displayName: true, 1657 getDefaultProps: true, 1658 getDerivedStateFromError: true, 1659 getDerivedStateFromProps: true, 1660 mixins: true, 1661 propTypes: true, 1662 type: true 1663 }; 1664 var KNOWN_STATICS = { 1665 name: true, 1666 length: true, 1667 prototype: true, 1668 caller: true, 1669 callee: true, 1670 arguments: true, 1671 arity: true 1672 }; 1673 var FORWARD_REF_STATICS = { 1674 '$$typeof': true, 1675 render: true, 1676 defaultProps: true, 1677 displayName: true, 1678 propTypes: true 1679 }; 1680 var MEMO_STATICS = { 1681 '$$typeof': true, 1682 compare: true, 1683 defaultProps: true, 1684 displayName: true, 1685 propTypes: true, 1686 type: true 1687 }; 1688 var TYPE_STATICS = {}; 1689 TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; 1690 TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; 1691 1692 function getStatics(component) { 1693 // React v16.11 and below 1694 if (reactIs.isMemo(component)) { 1695 return MEMO_STATICS; 1696 } // React v16.12 and above 1697 1698 1699 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; 1700 } 1701 1702 var defineProperty = Object.defineProperty; 1703 var getOwnPropertyNames = Object.getOwnPropertyNames; 1704 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 1705 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 1706 var getPrototypeOf = Object.getPrototypeOf; 1707 var objectPrototype = Object.prototype; 1708 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { 1709 if (typeof sourceComponent !== 'string') { 1710 // don't hoist over string (html) components 1711 if (objectPrototype) { 1712 var inheritedComponent = getPrototypeOf(sourceComponent); 1713 1714 if (inheritedComponent && inheritedComponent !== objectPrototype) { 1715 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 1716 } 1717 } 1718 1719 var keys = getOwnPropertyNames(sourceComponent); 1720 1721 if (getOwnPropertySymbols) { 1722 keys = keys.concat(getOwnPropertySymbols(sourceComponent)); 1723 } 1724 1725 var targetStatics = getStatics(targetComponent); 1726 var sourceStatics = getStatics(sourceComponent); 1727 1728 for (var i = 0; i < keys.length; ++i) { 1729 var key = keys[i]; 1730 1731 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 1732 var descriptor = getOwnPropertyDescriptor(sourceComponent, key); 1733 1734 try { 1735 // Avoid failures from read-only properties 1736 defineProperty(targetComponent, key, descriptor); 1737 } catch (e) {} 1738 } 1739 } 1740 } 1741 1742 return targetComponent; 1743 } 1744 1745 module.exports = hoistNonReactStatics; 1746 1747 1748 /***/ }), 1749 1750 /***/ "3HjQ": 1751 /***/ (function(module, exports) { 1752 1753 Object.defineProperty(exports, "__esModule", { 1754 value: true 1755 }); 1756 // This function takes an array of styles and separates them into styles that 1757 // are handled by Aphrodite and inline styles. 1758 function separateStyles(stylesArray) { 1759 var classNames = []; 1760 1761 // Since determining if an Object is empty requires collecting all of its 1762 // keys, and we want the best performance in this code because we are in the 1763 // render path, we are going to do a little bookkeeping ourselves. 1764 var hasInlineStyles = false; 1765 var inlineStyles = {}; 1766 1767 // This is run on potentially every node in the tree when rendering, where 1768 // performance is critical. Normally we would prefer using `forEach`, but 1769 // old-fashioned for loops are faster so that's what we have chosen here. 1770 for (var i = 0; i < stylesArray.length; i++) { 1771 // eslint-disable-line no-plusplus 1772 var style = stylesArray[i]; 1773 1774 // If this style is falsy, we just want to disregard it. This allows for 1775 // syntax like: 1776 // 1777 // css(isFoo && styles.foo) 1778 if (style) { 1779 if (typeof style === 'string') { 1780 classNames.push(style); 1781 } else { 1782 Object.assign(inlineStyles, style); 1783 hasInlineStyles = true; 1784 } 1785 } 1786 } 1787 1788 return { 1789 classNames: classNames, 1790 hasInlineStyles: hasInlineStyles, 1791 inlineStyles: inlineStyles 1792 }; 1793 } 1794 1795 exports['default'] = separateStyles; 1796 1797 /***/ }), 1798 1799 /***/ "3aeR": 1800 /***/ (function(module, exports, __webpack_require__) { 1801 1802 "use strict"; 1803 1804 1805 var GetIntrinsic = __webpack_require__("rZ7t"); 1806 1807 var $TypeError = GetIntrinsic('%TypeError%'); 1808 1809 var inspect = __webpack_require__("4qvr"); 1810 1811 var IsPropertyKey = __webpack_require__("i10q"); 1812 var Type = __webpack_require__("V1cy"); 1813 1814 /** 1815 * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p 1816 * 1. Assert: Type(O) is Object. 1817 * 2. Assert: IsPropertyKey(P) is true. 1818 * 3. Return O.[[Get]](P, O). 1819 */ 1820 1821 module.exports = function Get(O, P) { 1822 // 7.3.1.1 1823 if (Type(O) !== 'Object') { 1824 throw new $TypeError('Assertion failed: Type(O) is not Object'); 1825 } 1826 // 7.3.1.2 1827 if (!IsPropertyKey(P)) { 1828 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); 1829 } 1830 // 7.3.1.3 1831 return O[P]; 1832 }; 1833 1834 1835 /***/ }), 1836 1837 /***/ "3gBW": 1838 /***/ (function(module, exports, __webpack_require__) { 1839 1840 // eslint-disable-next-line import/no-unresolved 1841 module.exports = __webpack_require__("50qU"); 1842 1843 1844 /***/ }), 1845 1846 /***/ "4HRn": 1847 /***/ (function(module, exports, __webpack_require__) { 1848 1849 "use strict"; 1850 1851 1852 // var modulo = require('./modulo'); 1853 var $floor = Math.floor; 1854 1855 // http://262.ecma-international.org/5.1/#sec-5.2 1856 1857 module.exports = function floor(x) { 1858 // return x - modulo(x, 1); 1859 return $floor(x); 1860 }; 1861 1862 1863 /***/ }), 1864 1865 /***/ "4cSd": 1866 /***/ (function(module, exports, __webpack_require__) { 1867 1868 "use strict"; 1869 1870 1871 var define = __webpack_require__("82c2"); 1872 var callBind = __webpack_require__("PrET"); 1873 1874 var implementation = __webpack_require__("rQy3"); 1875 var getPolyfill = __webpack_require__("xoj2"); 1876 var shim = __webpack_require__("ib7Q"); 1877 1878 var polyfill = callBind(getPolyfill(), Object); 1879 1880 define(polyfill, { 1881 getPolyfill: getPolyfill, 1882 implementation: implementation, 1883 shim: shim 1884 }); 1885 1886 module.exports = polyfill; 1887 1888 1889 /***/ }), 1890 1891 /***/ "4eJC": 1892 /***/ (function(module, exports, __webpack_require__) { 1893 1894 /** 1895 * Memize options object. 1896 * 1897 * @typedef MemizeOptions 1898 * 1899 * @property {number} [maxSize] Maximum size of the cache. 1900 */ 1901 1902 /** 1903 * Internal cache entry. 1904 * 1905 * @typedef MemizeCacheNode 1906 * 1907 * @property {?MemizeCacheNode|undefined} [prev] Previous node. 1908 * @property {?MemizeCacheNode|undefined} [next] Next node. 1909 * @property {Array<*>} args Function arguments for cache 1910 * entry. 1911 * @property {*} val Function result. 1912 */ 1913 1914 /** 1915 * Properties of the enhanced function for controlling cache. 1916 * 1917 * @typedef MemizeMemoizedFunction 1918 * 1919 * @property {()=>void} clear Clear the cache. 1920 */ 1921 1922 /** 1923 * Accepts a function to be memoized, and returns a new memoized function, with 1924 * optional options. 1925 * 1926 * @template {Function} F 1927 * 1928 * @param {F} fn Function to memoize. 1929 * @param {MemizeOptions} [options] Options object. 1930 * 1931 * @return {F & MemizeMemoizedFunction} Memoized function. 1932 */ 1933 function memize( fn, options ) { 1934 var size = 0; 1935 1936 /** @type {?MemizeCacheNode|undefined} */ 1937 var head; 1938 1939 /** @type {?MemizeCacheNode|undefined} */ 1940 var tail; 1941 1942 options = options || {}; 1943 1944 function memoized( /* ...args */ ) { 1945 var node = head, 1946 len = arguments.length, 1947 args, i; 1948 1949 searchCache: while ( node ) { 1950 // Perform a shallow equality test to confirm that whether the node 1951 // under test is a candidate for the arguments passed. Two arrays 1952 // are shallowly equal if their length matches and each entry is 1953 // strictly equal between the two sets. Avoid abstracting to a 1954 // function which could incur an arguments leaking deoptimization. 1955 1956 // Check whether node arguments match arguments length 1957 if ( node.args.length !== arguments.length ) { 1958 node = node.next; 1959 continue; 1960 } 1961 1962 // Check whether node arguments match arguments values 1963 for ( i = 0; i < len; i++ ) { 1964 if ( node.args[ i ] !== arguments[ i ] ) { 1965 node = node.next; 1966 continue searchCache; 1967 } 1968 } 1969 1970 // At this point we can assume we've found a match 1971 1972 // Surface matched node to head if not already 1973 if ( node !== head ) { 1974 // As tail, shift to previous. Must only shift if not also 1975 // head, since if both head and tail, there is no previous. 1976 if ( node === tail ) { 1977 tail = node.prev; 1978 } 1979 1980 // Adjust siblings to point to each other. If node was tail, 1981 // this also handles new tail's empty `next` assignment. 1982 /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; 1983 if ( node.next ) { 1984 node.next.prev = node.prev; 1985 } 1986 1987 node.next = head; 1988 node.prev = null; 1989 /** @type {MemizeCacheNode} */ ( head ).prev = node; 1990 head = node; 1991 } 1992 1993 // Return immediately 1994 return node.val; 1995 } 1996 1997 // No cached value found. Continue to insertion phase: 1998 1999 // Create a copy of arguments (avoid leaking deoptimization) 2000 args = new Array( len ); 2001 for ( i = 0; i < len; i++ ) { 2002 args[ i ] = arguments[ i ]; 2003 } 2004 2005 node = { 2006 args: args, 2007 2008 // Generate the result from original function 2009 val: fn.apply( null, args ), 2010 }; 2011 2012 // Don't need to check whether node is already head, since it would 2013 // have been returned above already if it was 2014 2015 // Shift existing head down list 2016 if ( head ) { 2017 head.prev = node; 2018 node.next = head; 2019 } else { 2020 // If no head, follows that there's no tail (at initial or reset) 2021 tail = node; 2022 } 2023 2024 // Trim tail if we're reached max size and are pending cache insertion 2025 if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { 2026 tail = /** @type {MemizeCacheNode} */ ( tail ).prev; 2027 /** @type {MemizeCacheNode} */ ( tail ).next = null; 2028 } else { 2029 size++; 2030 } 2031 2032 head = node; 2033 2034 return node.val; 2035 } 2036 2037 memoized.clear = function() { 2038 head = null; 2039 tail = null; 2040 size = 0; 2041 }; 2042 2043 if ( false ) {} 2044 2045 // Ignore reason: There's not a clear solution to create an intersection of 2046 // the function with additional properties, where the goal is to retain the 2047 // function signature of the incoming argument and add control properties 2048 // on the return value. 2049 2050 // @ts-ignore 2051 return memoized; 2052 } 2053 2054 module.exports = memize; 2055 2056 2057 /***/ }), 2058 2059 /***/ "4po3": 2060 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2061 2062 "use strict"; 2063 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isTextField; }); 2064 /** 2065 * Check whether the given element is a text field, where text field is defined 2066 * by the ability to select within the input, or that it is contenteditable. 2067 * 2068 * @example 2069 * import { isTextField } from "reakit-utils"; 2070 * 2071 * isTextField(document.querySelector("div")); // false 2072 * isTextField(document.querySelector("input")); // true 2073 * isTextField(document.querySelector("input[type='button']")); // false 2074 * isTextField(document.querySelector("textarea")); // true 2075 * isTextField(document.querySelector("div[contenteditable='true']")); // true 2076 */ 2077 function isTextField(element) { 2078 try { 2079 var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; 2080 var isTextArea = element.tagName === "TEXTAREA"; 2081 var isContentEditable = element.contentEditable === "true"; 2082 return isTextInput || isTextArea || isContentEditable || false; 2083 } catch (error) { 2084 // Safari throws an exception when trying to get `selectionStart` 2085 // on non-text <input> elements (which, understandably, don't 2086 // have the text selection API). We catch this via a try/catch 2087 // block, as opposed to a more explicit check of the element's 2088 // input types, because of Safari's non-standard behavior. This 2089 // also means we don't have to worry about the list of input 2090 // types that support `selectionStart` changing as the HTML spec 2091 // evolves over time. 2092 return false; 2093 } 2094 } 2095 2096 2097 2098 2099 /***/ }), 2100 2101 /***/ "4qRI": 2102 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2103 2104 "use strict"; 2105 function memoize(fn) { 2106 var cache = {}; 2107 return function (arg) { 2108 if (cache[arg] === undefined) cache[arg] = fn(arg); 2109 return cache[arg]; 2110 }; 2111 } 2112 2113 /* harmony default export */ __webpack_exports__["a"] = (memoize); 2114 2115 2116 /***/ }), 2117 2118 /***/ "4qvr": 2119 /***/ (function(module, exports, __webpack_require__) { 2120 2121 var hasMap = typeof Map === 'function' && Map.prototype; 2122 var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; 2123 var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; 2124 var mapForEach = hasMap && Map.prototype.forEach; 2125 var hasSet = typeof Set === 'function' && Set.prototype; 2126 var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; 2127 var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; 2128 var setForEach = hasSet && Set.prototype.forEach; 2129 var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; 2130 var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; 2131 var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; 2132 var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; 2133 var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; 2134 var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; 2135 var booleanValueOf = Boolean.prototype.valueOf; 2136 var objectToString = Object.prototype.toString; 2137 var functionToString = Function.prototype.toString; 2138 var match = String.prototype.match; 2139 var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; 2140 var gOPS = Object.getOwnPropertySymbols; 2141 var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; 2142 var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; 2143 var isEnumerable = Object.prototype.propertyIsEnumerable; 2144 2145 var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( 2146 [].__proto__ === Array.prototype // eslint-disable-line no-proto 2147 ? function (O) { 2148 return O.__proto__; // eslint-disable-line no-proto 2149 } 2150 : null 2151 ); 2152 2153 var inspectCustom = __webpack_require__(0).custom; 2154 var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; 2155 var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null; 2156 2157 module.exports = function inspect_(obj, options, depth, seen) { 2158 var opts = options || {}; 2159 2160 if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { 2161 throw new TypeError('option "quoteStyle" must be "single" or "double"'); 2162 } 2163 if ( 2164 has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' 2165 ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity 2166 : opts.maxStringLength !== null 2167 ) 2168 ) { 2169 throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); 2170 } 2171 var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; 2172 if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { 2173 throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); 2174 } 2175 2176 if ( 2177 has(opts, 'indent') 2178 && opts.indent !== null 2179 && opts.indent !== '\t' 2180 && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) 2181 ) { 2182 throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); 2183 } 2184 2185 if (typeof obj === 'undefined') { 2186 return 'undefined'; 2187 } 2188 if (obj === null) { 2189 return 'null'; 2190 } 2191 if (typeof obj === 'boolean') { 2192 return obj ? 'true' : 'false'; 2193 } 2194 2195 if (typeof obj === 'string') { 2196 return inspectString(obj, opts); 2197 } 2198 if (typeof obj === 'number') { 2199 if (obj === 0) { 2200 return Infinity / obj > 0 ? '0' : '-0'; 2201 } 2202 return String(obj); 2203 } 2204 if (typeof obj === 'bigint') { 2205 return String(obj) + 'n'; 2206 } 2207 2208 var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; 2209 if (typeof depth === 'undefined') { depth = 0; } 2210 if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { 2211 return isArray(obj) ? '[Array]' : '[Object]'; 2212 } 2213 2214 var indent = getIndent(opts, depth); 2215 2216 if (typeof seen === 'undefined') { 2217 seen = []; 2218 } else if (indexOf(seen, obj) >= 0) { 2219 return '[Circular]'; 2220 } 2221 2222 function inspect(value, from, noIndent) { 2223 if (from) { 2224 seen = seen.slice(); 2225 seen.push(from); 2226 } 2227 if (noIndent) { 2228 var newOpts = { 2229 depth: opts.depth 2230 }; 2231 if (has(opts, 'quoteStyle')) { 2232 newOpts.quoteStyle = opts.quoteStyle; 2233 } 2234 return inspect_(value, newOpts, depth + 1, seen); 2235 } 2236 return inspect_(value, opts, depth + 1, seen); 2237 } 2238 2239 if (typeof obj === 'function') { 2240 var name = nameOf(obj); 2241 var keys = arrObjKeys(obj, inspect); 2242 return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : ''); 2243 } 2244 if (isSymbol(obj)) { 2245 var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); 2246 return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; 2247 } 2248 if (isElement(obj)) { 2249 var s = '<' + String(obj.nodeName).toLowerCase(); 2250 var attrs = obj.attributes || []; 2251 for (var i = 0; i < attrs.length; i++) { 2252 s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); 2253 } 2254 s += '>'; 2255 if (obj.childNodes && obj.childNodes.length) { s += '...'; } 2256 s += '</' + String(obj.nodeName).toLowerCase() + '>'; 2257 return s; 2258 } 2259 if (isArray(obj)) { 2260 if (obj.length === 0) { return '[]'; } 2261 var xs = arrObjKeys(obj, inspect); 2262 if (indent && !singleLineValues(xs)) { 2263 return '[' + indentedJoin(xs, indent) + ']'; 2264 } 2265 return '[ ' + xs.join(', ') + ' ]'; 2266 } 2267 if (isError(obj)) { 2268 var parts = arrObjKeys(obj, inspect); 2269 if (parts.length === 0) { return '[' + String(obj) + ']'; } 2270 return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; 2271 } 2272 if (typeof obj === 'object' && customInspect) { 2273 if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { 2274 return obj[inspectSymbol](); 2275 } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { 2276 return obj.inspect(); 2277 } 2278 } 2279 if (isMap(obj)) { 2280 var mapParts = []; 2281 mapForEach.call(obj, function (value, key) { 2282 mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); 2283 }); 2284 return collectionOf('Map', mapSize.call(obj), mapParts, indent); 2285 } 2286 if (isSet(obj)) { 2287 var setParts = []; 2288 setForEach.call(obj, function (value) { 2289 setParts.push(inspect(value, obj)); 2290 }); 2291 return collectionOf('Set', setSize.call(obj), setParts, indent); 2292 } 2293 if (isWeakMap(obj)) { 2294 return weakCollectionOf('WeakMap'); 2295 } 2296 if (isWeakSet(obj)) { 2297 return weakCollectionOf('WeakSet'); 2298 } 2299 if (isWeakRef(obj)) { 2300 return weakCollectionOf('WeakRef'); 2301 } 2302 if (isNumber(obj)) { 2303 return markBoxed(inspect(Number(obj))); 2304 } 2305 if (isBigInt(obj)) { 2306 return markBoxed(inspect(bigIntValueOf.call(obj))); 2307 } 2308 if (isBoolean(obj)) { 2309 return markBoxed(booleanValueOf.call(obj)); 2310 } 2311 if (isString(obj)) { 2312 return markBoxed(inspect(String(obj))); 2313 } 2314 if (!isDate(obj) && !isRegExp(obj)) { 2315 var ys = arrObjKeys(obj, inspect); 2316 var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; 2317 var protoTag = obj instanceof Object ? '' : 'null prototype'; 2318 var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : ''; 2319 var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; 2320 var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : ''); 2321 if (ys.length === 0) { return tag + '{}'; } 2322 if (indent) { 2323 return tag + '{' + indentedJoin(ys, indent) + '}'; 2324 } 2325 return tag + '{ ' + ys.join(', ') + ' }'; 2326 } 2327 return String(obj); 2328 }; 2329 2330 function wrapQuotes(s, defaultStyle, opts) { 2331 var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; 2332 return quoteChar + s + quoteChar; 2333 } 2334 2335 function quote(s) { 2336 return String(s).replace(/"/g, '"'); 2337 } 2338 2339 function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2340 function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2341 function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2342 function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2343 function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2344 function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2345 function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 2346 2347 // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives 2348 function isSymbol(obj) { 2349 if (hasShammedSymbols) { 2350 return obj && typeof obj === 'object' && obj instanceof Symbol; 2351 } 2352 if (typeof obj === 'symbol') { 2353 return true; 2354 } 2355 if (!obj || typeof obj !== 'object' || !symToString) { 2356 return false; 2357 } 2358 try { 2359 symToString.call(obj); 2360 return true; 2361 } catch (e) {} 2362 return false; 2363 } 2364 2365 function isBigInt(obj) { 2366 if (!obj || typeof obj !== 'object' || !bigIntValueOf) { 2367 return false; 2368 } 2369 try { 2370 bigIntValueOf.call(obj); 2371 return true; 2372 } catch (e) {} 2373 return false; 2374 } 2375 2376 var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; 2377 function has(obj, key) { 2378 return hasOwn.call(obj, key); 2379 } 2380 2381 function toStr(obj) { 2382 return objectToString.call(obj); 2383 } 2384 2385 function nameOf(f) { 2386 if (f.name) { return f.name; } 2387 var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); 2388 if (m) { return m[1]; } 2389 return null; 2390 } 2391 2392 function indexOf(xs, x) { 2393 if (xs.indexOf) { return xs.indexOf(x); } 2394 for (var i = 0, l = xs.length; i < l; i++) { 2395 if (xs[i] === x) { return i; } 2396 } 2397 return -1; 2398 } 2399 2400 function isMap(x) { 2401 if (!mapSize || !x || typeof x !== 'object') { 2402 return false; 2403 } 2404 try { 2405 mapSize.call(x); 2406 try { 2407 setSize.call(x); 2408 } catch (s) { 2409 return true; 2410 } 2411 return x instanceof Map; // core-js workaround, pre-v2.5.0 2412 } catch (e) {} 2413 return false; 2414 } 2415 2416 function isWeakMap(x) { 2417 if (!weakMapHas || !x || typeof x !== 'object') { 2418 return false; 2419 } 2420 try { 2421 weakMapHas.call(x, weakMapHas); 2422 try { 2423 weakSetHas.call(x, weakSetHas); 2424 } catch (s) { 2425 return true; 2426 } 2427 return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 2428 } catch (e) {} 2429 return false; 2430 } 2431 2432 function isWeakRef(x) { 2433 if (!weakRefDeref || !x || typeof x !== 'object') { 2434 return false; 2435 } 2436 try { 2437 weakRefDeref.call(x); 2438 return true; 2439 } catch (e) {} 2440 return false; 2441 } 2442 2443 function isSet(x) { 2444 if (!setSize || !x || typeof x !== 'object') { 2445 return false; 2446 } 2447 try { 2448 setSize.call(x); 2449 try { 2450 mapSize.call(x); 2451 } catch (m) { 2452 return true; 2453 } 2454 return x instanceof Set; // core-js workaround, pre-v2.5.0 2455 } catch (e) {} 2456 return false; 2457 } 2458 2459 function isWeakSet(x) { 2460 if (!weakSetHas || !x || typeof x !== 'object') { 2461 return false; 2462 } 2463 try { 2464 weakSetHas.call(x, weakSetHas); 2465 try { 2466 weakMapHas.call(x, weakMapHas); 2467 } catch (s) { 2468 return true; 2469 } 2470 return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 2471 } catch (e) {} 2472 return false; 2473 } 2474 2475 function isElement(x) { 2476 if (!x || typeof x !== 'object') { return false; } 2477 if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { 2478 return true; 2479 } 2480 return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; 2481 } 2482 2483 function inspectString(str, opts) { 2484 if (str.length > opts.maxStringLength) { 2485 var remaining = str.length - opts.maxStringLength; 2486 var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); 2487 return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; 2488 } 2489 // eslint-disable-next-line no-control-regex 2490 var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); 2491 return wrapQuotes(s, 'single', opts); 2492 } 2493 2494 function lowbyte(c) { 2495 var n = c.charCodeAt(0); 2496 var x = { 2497 8: 'b', 2498 9: 't', 2499 10: 'n', 2500 12: 'f', 2501 13: 'r' 2502 }[n]; 2503 if (x) { return '\\' + x; } 2504 return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase(); 2505 } 2506 2507 function markBoxed(str) { 2508 return 'Object(' + str + ')'; 2509 } 2510 2511 function weakCollectionOf(type) { 2512 return type + ' { ? }'; 2513 } 2514 2515 function collectionOf(type, size, entries, indent) { 2516 var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); 2517 return type + ' (' + size + ') {' + joinedEntries + '}'; 2518 } 2519 2520 function singleLineValues(xs) { 2521 for (var i = 0; i < xs.length; i++) { 2522 if (indexOf(xs[i], '\n') >= 0) { 2523 return false; 2524 } 2525 } 2526 return true; 2527 } 2528 2529 function getIndent(opts, depth) { 2530 var baseIndent; 2531 if (opts.indent === '\t') { 2532 baseIndent = '\t'; 2533 } else if (typeof opts.indent === 'number' && opts.indent > 0) { 2534 baseIndent = Array(opts.indent + 1).join(' '); 2535 } else { 2536 return null; 2537 } 2538 return { 2539 base: baseIndent, 2540 prev: Array(depth + 1).join(baseIndent) 2541 }; 2542 } 2543 2544 function indentedJoin(xs, indent) { 2545 if (xs.length === 0) { return ''; } 2546 var lineJoiner = '\n' + indent.prev + indent.base; 2547 return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; 2548 } 2549 2550 function arrObjKeys(obj, inspect) { 2551 var isArr = isArray(obj); 2552 var xs = []; 2553 if (isArr) { 2554 xs.length = obj.length; 2555 for (var i = 0; i < obj.length; i++) { 2556 xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; 2557 } 2558 } 2559 var syms = typeof gOPS === 'function' ? gOPS(obj) : []; 2560 var symMap; 2561 if (hasShammedSymbols) { 2562 symMap = {}; 2563 for (var k = 0; k < syms.length; k++) { 2564 symMap['$' + syms[k]] = syms[k]; 2565 } 2566 } 2567 2568 for (var key in obj) { // eslint-disable-line no-restricted-syntax 2569 if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 2570 if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 2571 if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { 2572 // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section 2573 continue; // eslint-disable-line no-restricted-syntax, no-continue 2574 } else if ((/[^\w$]/).test(key)) { 2575 xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); 2576 } else { 2577 xs.push(key + ': ' + inspect(obj[key], obj)); 2578 } 2579 } 2580 if (typeof gOPS === 'function') { 2581 for (var j = 0; j < syms.length; j++) { 2582 if (isEnumerable.call(obj, syms[j])) { 2583 xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); 2584 } 2585 } 2586 } 2587 return xs; 2588 } 2589 2590 2591 /***/ }), 2592 2593 /***/ "50qU": 2594 /***/ (function(module, exports, __webpack_require__) { 2595 2596 "use strict"; 2597 2598 2599 Object.defineProperty(exports, "__esModule", { 2600 value: true 2601 }); 2602 2603 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; }; }(); 2604 2605 var _react = __webpack_require__("cDcd"); 2606 2607 var _react2 = _interopRequireDefault(_react); 2608 2609 var _propTypes = __webpack_require__("17x9"); 2610 2611 var _propTypes2 = _interopRequireDefault(_propTypes); 2612 2613 var _airbnbPropTypes = __webpack_require__("Hsqg"); 2614 2615 var _consolidatedEvents = __webpack_require__("1TsT"); 2616 2617 var _object = __webpack_require__("4cSd"); 2618 2619 var _object2 = _interopRequireDefault(_object); 2620 2621 var _document = __webpack_require__("n1Y7"); 2622 2623 var _document2 = _interopRequireDefault(_document); 2624 2625 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 2626 2627 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2628 2629 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; } 2630 2631 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; } 2632 2633 var DISPLAY = { 2634 BLOCK: 'block', 2635 FLEX: 'flex', 2636 INLINE: 'inline', 2637 INLINE_BLOCK: 'inline-block', 2638 CONTENTS: 'contents' 2639 }; 2640 2641 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({ 2642 children: _propTypes2['default'].node.isRequired, 2643 onOutsideClick: _propTypes2['default'].func.isRequired, 2644 disabled: _propTypes2['default'].bool, 2645 useCapture: _propTypes2['default'].bool, 2646 display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY)) 2647 }); 2648 2649 var defaultProps = { 2650 disabled: false, 2651 2652 // `useCapture` is set to true by default so that a `stopPropagation` in the 2653 // children will not prevent all outside click handlers from firing - maja 2654 useCapture: true, 2655 display: DISPLAY.BLOCK 2656 }; 2657 2658 var OutsideClickHandler = function (_React$Component) { 2659 _inherits(OutsideClickHandler, _React$Component); 2660 2661 function OutsideClickHandler() { 2662 var _ref; 2663 2664 _classCallCheck(this, OutsideClickHandler); 2665 2666 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 2667 args[_key] = arguments[_key]; 2668 } 2669 2670 var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args))); 2671 2672 _this.onMouseDown = _this.onMouseDown.bind(_this); 2673 _this.onMouseUp = _this.onMouseUp.bind(_this); 2674 _this.setChildNodeRef = _this.setChildNodeRef.bind(_this); 2675 return _this; 2676 } 2677 2678 _createClass(OutsideClickHandler, [{ 2679 key: 'componentDidMount', 2680 value: function () { 2681 function componentDidMount() { 2682 var _props = this.props, 2683 disabled = _props.disabled, 2684 useCapture = _props.useCapture; 2685 2686 2687 if (!disabled) this.addMouseDownEventListener(useCapture); 2688 } 2689 2690 return componentDidMount; 2691 }() 2692 }, { 2693 key: 'componentDidUpdate', 2694 value: function () { 2695 function componentDidUpdate(_ref2) { 2696 var prevDisabled = _ref2.disabled; 2697 var _props2 = this.props, 2698 disabled = _props2.disabled, 2699 useCapture = _props2.useCapture; 2700 2701 if (prevDisabled !== disabled) { 2702 if (disabled) { 2703 this.removeEventListeners(); 2704 } else { 2705 this.addMouseDownEventListener(useCapture); 2706 } 2707 } 2708 } 2709 2710 return componentDidUpdate; 2711 }() 2712 }, { 2713 key: 'componentWillUnmount', 2714 value: function () { 2715 function componentWillUnmount() { 2716 this.removeEventListeners(); 2717 } 2718 2719 return componentWillUnmount; 2720 }() 2721 2722 // Use mousedown/mouseup to enforce that clicks remain outside the root's 2723 // descendant tree, even when dragged. This should also get triggered on 2724 // touch devices. 2725 2726 }, { 2727 key: 'onMouseDown', 2728 value: function () { 2729 function onMouseDown(e) { 2730 var useCapture = this.props.useCapture; 2731 2732 2733 var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target); 2734 if (!isDescendantOfRoot) { 2735 if (this.removeMouseUp) { 2736 this.removeMouseUp(); 2737 this.removeMouseUp = null; 2738 } 2739 this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, { capture: useCapture }); 2740 } 2741 } 2742 2743 return onMouseDown; 2744 }() 2745 2746 // Use mousedown/mouseup to enforce that clicks remain outside the root's 2747 // descendant tree, even when dragged. This should also get triggered on 2748 // touch devices. 2749 2750 }, { 2751 key: 'onMouseUp', 2752 value: function () { 2753 function onMouseUp(e) { 2754 var onOutsideClick = this.props.onOutsideClick; 2755 2756 2757 var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target); 2758 if (this.removeMouseUp) { 2759 this.removeMouseUp(); 2760 this.removeMouseUp = null; 2761 } 2762 2763 if (!isDescendantOfRoot) { 2764 onOutsideClick(e); 2765 } 2766 } 2767 2768 return onMouseUp; 2769 }() 2770 }, { 2771 key: 'setChildNodeRef', 2772 value: function () { 2773 function setChildNodeRef(ref) { 2774 this.childNode = ref; 2775 } 2776 2777 return setChildNodeRef; 2778 }() 2779 }, { 2780 key: 'addMouseDownEventListener', 2781 value: function () { 2782 function addMouseDownEventListener(useCapture) { 2783 this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, { capture: useCapture }); 2784 } 2785 2786 return addMouseDownEventListener; 2787 }() 2788 }, { 2789 key: 'removeEventListeners', 2790 value: function () { 2791 function removeEventListeners() { 2792 if (this.removeMouseDown) this.removeMouseDown(); 2793 if (this.removeMouseUp) this.removeMouseUp(); 2794 } 2795 2796 return removeEventListeners; 2797 }() 2798 }, { 2799 key: 'render', 2800 value: function () { 2801 function render() { 2802 var _props3 = this.props, 2803 children = _props3.children, 2804 display = _props3.display; 2805 2806 2807 return _react2['default'].createElement( 2808 'div', 2809 { 2810 ref: this.setChildNodeRef, 2811 style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined 2812 }, 2813 children 2814 ); 2815 } 2816 2817 return render; 2818 }() 2819 }]); 2820 2821 return OutsideClickHandler; 2822 }(_react2['default'].Component); 2823 2824 exports['default'] = OutsideClickHandler; 2825 2826 2827 OutsideClickHandler.propTypes = propTypes; 2828 OutsideClickHandler.defaultProps = defaultProps; 2829 2830 /***/ }), 2831 2832 /***/ "5V/u": 2833 /***/ (function(module, exports) { 2834 2835 module.exports = 2836 /******/ (function(modules) { // webpackBootstrap 2837 /******/ // The module cache 2838 /******/ var installedModules = {}; 2839 /******/ 2840 /******/ // The require function 2841 /******/ function __webpack_require__(moduleId) { 2842 /******/ 2843 /******/ // Check if module is in cache 2844 /******/ if(installedModules[moduleId]) 2845 /******/ return installedModules[moduleId].exports; 2846 /******/ 2847 /******/ // Create a new module (and put it into the cache) 2848 /******/ var module = installedModules[moduleId] = { 2849 /******/ exports: {}, 2850 /******/ id: moduleId, 2851 /******/ loaded: false 2852 /******/ }; 2853 /******/ 2854 /******/ // Execute the module function 2855 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 2856 /******/ 2857 /******/ // Flag the module as loaded 2858 /******/ module.loaded = true; 2859 /******/ 2860 /******/ // Return the exports of the module 2861 /******/ return module.exports; 2862 /******/ } 2863 /******/ 2864 /******/ 2865 /******/ // expose the modules object (__webpack_modules__) 2866 /******/ __webpack_require__.m = modules; 2867 /******/ 2868 /******/ // expose the module cache 2869 /******/ __webpack_require__.c = installedModules; 2870 /******/ 2871 /******/ // __webpack_public_path__ 2872 /******/ __webpack_require__.p = ""; 2873 /******/ 2874 /******/ // Load entry module and return exports 2875 /******/ return __webpack_require__(0); 2876 /******/ }) 2877 /************************************************************************/ 2878 /******/ ([ 2879 /* 0 */ 2880 /***/ (function(module, exports, __webpack_require__) { 2881 2882 module.exports = __webpack_require__(1); 2883 2884 2885 /***/ }), 2886 /* 1 */ 2887 /***/ (function(module, exports, __webpack_require__) { 2888 2889 'use strict'; 2890 2891 Object.defineProperty(exports, "__esModule", { 2892 value: true 2893 }); 2894 2895 var _utils = __webpack_require__(2); 2896 2897 Object.defineProperty(exports, 'combineChunks', { 2898 enumerable: true, 2899 get: function get() { 2900 return _utils.combineChunks; 2901 } 2902 }); 2903 Object.defineProperty(exports, 'fillInChunks', { 2904 enumerable: true, 2905 get: function get() { 2906 return _utils.fillInChunks; 2907 } 2908 }); 2909 Object.defineProperty(exports, 'findAll', { 2910 enumerable: true, 2911 get: function get() { 2912 return _utils.findAll; 2913 } 2914 }); 2915 Object.defineProperty(exports, 'findChunks', { 2916 enumerable: true, 2917 get: function get() { 2918 return _utils.findChunks; 2919 } 2920 }); 2921 2922 /***/ }), 2923 /* 2 */ 2924 /***/ (function(module, exports) { 2925 2926 'use strict'; 2927 2928 Object.defineProperty(exports, "__esModule", { 2929 value: true 2930 }); 2931 2932 2933 /** 2934 * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. 2935 * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) 2936 */ 2937 var findAll = exports.findAll = function findAll(_ref) { 2938 var autoEscape = _ref.autoEscape, 2939 _ref$caseSensitive = _ref.caseSensitive, 2940 caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive, 2941 _ref$findChunks = _ref.findChunks, 2942 findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks, 2943 sanitize = _ref.sanitize, 2944 searchWords = _ref.searchWords, 2945 textToHighlight = _ref.textToHighlight; 2946 return fillInChunks({ 2947 chunksToHighlight: combineChunks({ 2948 chunks: findChunks({ 2949 autoEscape: autoEscape, 2950 caseSensitive: caseSensitive, 2951 sanitize: sanitize, 2952 searchWords: searchWords, 2953 textToHighlight: textToHighlight 2954 }) 2955 }), 2956 totalLength: textToHighlight ? textToHighlight.length : 0 2957 }); 2958 }; 2959 2960 /** 2961 * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. 2962 * @return {start:number, end:number}[] 2963 */ 2964 2965 2966 var combineChunks = exports.combineChunks = function combineChunks(_ref2) { 2967 var chunks = _ref2.chunks; 2968 2969 chunks = chunks.sort(function (first, second) { 2970 return first.start - second.start; 2971 }).reduce(function (processedChunks, nextChunk) { 2972 // First chunk just goes straight in the array... 2973 if (processedChunks.length === 0) { 2974 return [nextChunk]; 2975 } else { 2976 // ... subsequent chunks get checked to see if they overlap... 2977 var prevChunk = processedChunks.pop(); 2978 if (nextChunk.start <= prevChunk.end) { 2979 // It may be the case that prevChunk completely surrounds nextChunk, so take the 2980 // largest of the end indeces. 2981 var endIndex = Math.max(prevChunk.end, nextChunk.end); 2982 processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex }); 2983 } else { 2984 processedChunks.push(prevChunk, nextChunk); 2985 } 2986 return processedChunks; 2987 } 2988 }, []); 2989 2990 return chunks; 2991 }; 2992 2993 /** 2994 * Examine text for any matches. 2995 * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). 2996 * @return {start:number, end:number}[] 2997 */ 2998 var defaultFindChunks = function defaultFindChunks(_ref3) { 2999 var autoEscape = _ref3.autoEscape, 3000 caseSensitive = _ref3.caseSensitive, 3001 _ref3$sanitize = _ref3.sanitize, 3002 sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize, 3003 searchWords = _ref3.searchWords, 3004 textToHighlight = _ref3.textToHighlight; 3005 3006 textToHighlight = sanitize(textToHighlight); 3007 3008 return searchWords.filter(function (searchWord) { 3009 return searchWord; 3010 }) // Remove empty words 3011 .reduce(function (chunks, searchWord) { 3012 searchWord = sanitize(searchWord); 3013 3014 if (autoEscape) { 3015 searchWord = escapeRegExpFn(searchWord); 3016 } 3017 3018 var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi'); 3019 3020 var match = void 0; 3021 while (match = regex.exec(textToHighlight)) { 3022 var _start = match.index; 3023 var _end = regex.lastIndex; 3024 // We do not return zero-length matches 3025 if (_end > _start) { 3026 chunks.push({ highlight: false, start: _start, end: _end }); 3027 } 3028 3029 // Prevent browsers like Firefox from getting stuck in an infinite loop 3030 // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ 3031 if (match.index === regex.lastIndex) { 3032 regex.lastIndex++; 3033 } 3034 } 3035 3036 return chunks; 3037 }, []); 3038 }; 3039 // Allow the findChunks to be overridden in findAll, 3040 // but for backwards compatibility we export as the old name 3041 exports.findChunks = defaultFindChunks; 3042 3043 /** 3044 * Given a set of chunks to highlight, create an additional set of chunks 3045 * to represent the bits of text between the highlighted text. 3046 * @param chunksToHighlight {start:number, end:number}[] 3047 * @param totalLength number 3048 * @return {start:number, end:number, highlight:boolean}[] 3049 */ 3050 3051 var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) { 3052 var chunksToHighlight = _ref4.chunksToHighlight, 3053 totalLength = _ref4.totalLength; 3054 3055 var allChunks = []; 3056 var append = function append(start, end, highlight) { 3057 if (end - start > 0) { 3058 allChunks.push({ 3059 start: start, 3060 end: end, 3061 highlight: highlight 3062 }); 3063 } 3064 }; 3065 3066 if (chunksToHighlight.length === 0) { 3067 append(0, totalLength, false); 3068 } else { 3069 var lastIndex = 0; 3070 chunksToHighlight.forEach(function (chunk) { 3071 append(lastIndex, chunk.start, false); 3072 append(chunk.start, chunk.end, true); 3073 lastIndex = chunk.end; 3074 }); 3075 append(lastIndex, totalLength, false); 3076 } 3077 return allChunks; 3078 }; 3079 3080 function defaultSanitize(string) { 3081 return string; 3082 } 3083 3084 function escapeRegExpFn(string) { 3085 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); 3086 } 3087 3088 /***/ }) 3089 /******/ ]); 3090 3091 3092 /***/ }), 3093 3094 /***/ "5aBA": 3095 /***/ (function(module, exports, __webpack_require__) { 3096 3097 "use strict"; 3098 /** @license React v17.0.2 3099 * react-is.production.min.js 3100 * 3101 * Copyright (c) Facebook, Inc. and its affiliates. 3102 * 3103 * This source code is licensed under the MIT license found in the 3104 * LICENSE file in the root directory of this source tree. 3105 */ 3106 var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131; 3107 if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")} 3108 function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H; 3109 exports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n}; 3110 exports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1}; 3111 exports.typeOf=y; 3112 3113 3114 /***/ }), 3115 3116 /***/ "5yQQ": 3117 /***/ (function(module, exports, __webpack_require__) { 3118 3119 "use strict"; 3120 3121 3122 var implementation = __webpack_require__("nRDI"); 3123 3124 module.exports = function getPolyfill() { 3125 if (typeof document !== 'undefined') { 3126 if (document.contains) { 3127 return document.contains; 3128 } 3129 if (document.body && document.body.contains) { 3130 try { 3131 if (typeof document.body.contains.call(document, '') === 'boolean') { 3132 return document.body.contains; 3133 } 3134 } catch (e) { /**/ } 3135 } 3136 } 3137 return implementation; 3138 }; 3139 3140 3141 /***/ }), 3142 3143 /***/ "60zJ": 3144 /***/ (function(module, exports, __webpack_require__) { 3145 3146 "use strict"; 3147 3148 3149 // https://262.ecma-international.org/5.1/#sec-8 3150 3151 module.exports = function Type(x) { 3152 if (x === null) { 3153 return 'Null'; 3154 } 3155 if (typeof x === 'undefined') { 3156 return 'Undefined'; 3157 } 3158 if (typeof x === 'function' || typeof x === 'object') { 3159 return 'Object'; 3160 } 3161 if (typeof x === 'number') { 3162 return 'Number'; 3163 } 3164 if (typeof x === 'boolean') { 3165 return 'Boolean'; 3166 } 3167 if (typeof x === 'string') { 3168 return 'String'; 3169 } 3170 }; 3171 3172 3173 /***/ }), 3174 3175 /***/ "6HWY": 3176 /***/ (function(module, exports, __webpack_require__) { 3177 3178 "use strict"; 3179 3180 3181 Object.defineProperty(exports, "__esModule", { 3182 value: true 3183 }); 3184 exports['default'] = isNextMonth; 3185 3186 var _moment = __webpack_require__("wy2R"); 3187 3188 var _moment2 = _interopRequireDefault(_moment); 3189 3190 var _isSameMonth = __webpack_require__("ulUS"); 3191 3192 var _isSameMonth2 = _interopRequireDefault(_isSameMonth); 3193 3194 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 3195 3196 function isNextMonth(a, b) { 3197 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 3198 return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b); 3199 } 3200 3201 /***/ }), 3202 3203 /***/ "6I5v": 3204 /***/ (function(module, exports, __webpack_require__) { 3205 3206 "use strict"; 3207 3208 3209 module.exports = function sign(number) { 3210 return number >= 0 ? 1 : -1; 3211 }; 3212 3213 3214 /***/ }), 3215 3216 /***/ "6ZB3": 3217 /***/ (function(module, exports, __webpack_require__) { 3218 3219 "use strict"; 3220 3221 3222 var GetIntrinsic = __webpack_require__("rZ7t"); 3223 3224 var callBind = __webpack_require__("1LY1"); 3225 3226 var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 3227 3228 module.exports = function callBoundIntrinsic(name, allowMissing) { 3229 var intrinsic = GetIntrinsic(name, !!allowMissing); 3230 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 3231 return callBind(intrinsic); 3232 } 3233 return intrinsic; 3234 }; 3235 3236 3237 /***/ }), 3238 3239 /***/ "6zzY": 3240 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3241 3242 "use strict"; 3243 3244 // EXPORTS 3245 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ useComponentsContext; }); 3246 3247 // UNUSED EXPORTS: ComponentsContext, ContextSystemProvider 3248 3249 // EXTERNAL MODULE: external ["wp","element"] 3250 var external_wp_element_ = __webpack_require__("GRId"); 3251 3252 // EXTERNAL MODULE: external "lodash" 3253 var external_lodash_ = __webpack_require__("YLtl"); 3254 3255 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/use-isomorphic-layout-effect.js 3256 /** 3257 * WordPress dependencies 3258 */ 3259 3260 /** 3261 * Copied from `@wordpress/compose` in order for us to be able to maintain all the types for the ui folder 3262 */ 3263 3264 const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_wp_element_["useLayoutEffect"] : external_wp_element_["useEffect"]; 3265 3266 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-system-provider.js 3267 3268 3269 /** 3270 * External dependencies 3271 */ 3272 3273 /** 3274 * WordPress dependencies 3275 */ 3276 3277 3278 /** 3279 * Internal dependencies 3280 */ 3281 3282 3283 const ComponentsContext = Object(external_wp_element_["createContext"])( 3284 /** @type {Record<string, any>} */ 3285 {}); 3286 const useComponentsContext = () => Object(external_wp_element_["useContext"])(ComponentsContext); 3287 /** 3288 * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value. 3289 * 3290 * @param {Object} props 3291 * @param {Record<string, any>} props.value 3292 * @return {Record<string, any>} The consolidated value. 3293 */ 3294 3295 function useContextSystemBridge({ 3296 value 3297 }) { 3298 const parentContext = useComponentsContext(); 3299 const parentContextRef = Object(external_wp_element_["useRef"])(parentContext); 3300 const valueRef = Object(external_wp_element_["useRef"])(Object(external_lodash_["merge"])(parentContext, value)); 3301 const [config, setConfig] = Object(external_wp_element_["useState"])(valueRef.current); 3302 useIsomorphicLayoutEffect(() => { 3303 let hasChange = false; 3304 3305 if (!Object(external_lodash_["isEqual"])(value, valueRef.current)) { 3306 valueRef.current = value; 3307 hasChange = true; 3308 } 3309 3310 if (!Object(external_lodash_["isEqual"])(parentContext, parentContextRef.current)) { 3311 valueRef.current = Object(external_lodash_["merge"])(parentContext, valueRef.current); 3312 parentContextRef.current = parentContext; 3313 hasChange = true; 3314 } 3315 3316 if (hasChange) { 3317 setConfig(prev => ({ ...prev, 3318 ...valueRef.current 3319 })); 3320 } 3321 }, [value, parentContext]); 3322 return config; 3323 } 3324 /** 3325 * A Provider component that can modify props for connected components within 3326 * the Context system. 3327 * 3328 * @example 3329 * ```jsx 3330 * <ContextSystemProvider value={{ Button: { size: 'small' }}}> 3331 * <Button>...</Button> 3332 * </ContextSystemProvider> 3333 * ``` 3334 * 3335 * @template {Record<string, any>} T 3336 * @param {Object} options 3337 * @param {import('react').ReactNode} options.children Children to render. 3338 * @param {T} options.value Props to render into connected components. 3339 * @return {JSX.Element} A Provider wrapped component. 3340 */ 3341 3342 3343 const BaseContextSystemProvider = ({ 3344 children, 3345 value 3346 }) => { 3347 const contextValue = useContextSystemBridge({ 3348 value 3349 }); 3350 return Object(external_wp_element_["createElement"])(ComponentsContext.Provider, { 3351 value: contextValue 3352 }, children); 3353 }; 3354 3355 const ContextSystemProvider = Object(external_wp_element_["memo"])(BaseContextSystemProvider); 3356 3357 3358 /***/ }), 3359 3360 /***/ "71Og": 3361 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3362 3363 "use strict"; 3364 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isButton; }); 3365 var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"]; 3366 /** 3367 * Checks whether `element` is a native HTML button element. 3368 * 3369 * @example 3370 * import { isButton } from "reakit-utils"; 3371 * 3372 * isButton(document.querySelector("button")); // true 3373 * isButton(document.querySelector("input[type='button']")); // true 3374 * isButton(document.querySelector("div")); // false 3375 * isButton(document.querySelector("input[type='text']")); // false 3376 * isButton(document.querySelector("div[role='button']")); // false 3377 * 3378 * @returns {boolean} 3379 */ 3380 3381 function isButton(element) { 3382 if (element.tagName === "BUTTON") return true; 3383 3384 if (element.tagName === "INPUT") { 3385 var input = element; 3386 return buttonInputTypes.indexOf(input.type) !== -1; 3387 } 3388 3389 return false; 3390 } 3391 3392 3393 3394 3395 /***/ }), 3396 3397 /***/ "75pU": 3398 /***/ (function(module, exports) { 3399 3400 // 3401 // Main 3402 // 3403 3404 function memoize (fn, options) { 3405 var cache = options && options.cache 3406 ? options.cache 3407 : cacheDefault 3408 3409 var serializer = options && options.serializer 3410 ? options.serializer 3411 : serializerDefault 3412 3413 var strategy = options && options.strategy 3414 ? options.strategy 3415 : strategyDefault 3416 3417 return strategy(fn, { 3418 cache: cache, 3419 serializer: serializer 3420 }) 3421 } 3422 3423 // 3424 // Strategy 3425 // 3426 3427 function isPrimitive (value) { 3428 return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs 3429 } 3430 3431 function monadic (fn, cache, serializer, arg) { 3432 var cacheKey = isPrimitive(arg) ? arg : serializer(arg) 3433 3434 var computedValue = cache.get(cacheKey) 3435 if (typeof computedValue === 'undefined') { 3436 computedValue = fn.call(this, arg) 3437 cache.set(cacheKey, computedValue) 3438 } 3439 3440 return computedValue 3441 } 3442 3443 function variadic (fn, cache, serializer) { 3444 var args = Array.prototype.slice.call(arguments, 3) 3445 var cacheKey = serializer(args) 3446 3447 var computedValue = cache.get(cacheKey) 3448 if (typeof computedValue === 'undefined') { 3449 computedValue = fn.apply(this, args) 3450 cache.set(cacheKey, computedValue) 3451 } 3452 3453 return computedValue 3454 } 3455 3456 function assemble (fn, context, strategy, cache, serialize) { 3457 return strategy.bind( 3458 context, 3459 fn, 3460 cache, 3461 serialize 3462 ) 3463 } 3464 3465 function strategyDefault (fn, options) { 3466 var strategy = fn.length === 1 ? monadic : variadic 3467 3468 return assemble( 3469 fn, 3470 this, 3471 strategy, 3472 options.cache.create(), 3473 options.serializer 3474 ) 3475 } 3476 3477 function strategyVariadic (fn, options) { 3478 var strategy = variadic 3479 3480 return assemble( 3481 fn, 3482 this, 3483 strategy, 3484 options.cache.create(), 3485 options.serializer 3486 ) 3487 } 3488 3489 function strategyMonadic (fn, options) { 3490 var strategy = monadic 3491 3492 return assemble( 3493 fn, 3494 this, 3495 strategy, 3496 options.cache.create(), 3497 options.serializer 3498 ) 3499 } 3500 3501 // 3502 // Serializer 3503 // 3504 3505 function serializerDefault () { 3506 return JSON.stringify(arguments) 3507 } 3508 3509 // 3510 // Cache 3511 // 3512 3513 function ObjectWithoutPrototypeCache () { 3514 this.cache = Object.create(null) 3515 } 3516 3517 ObjectWithoutPrototypeCache.prototype.has = function (key) { 3518 return (key in this.cache) 3519 } 3520 3521 ObjectWithoutPrototypeCache.prototype.get = function (key) { 3522 return this.cache[key] 3523 } 3524 3525 ObjectWithoutPrototypeCache.prototype.set = function (key, value) { 3526 this.cache[key] = value 3527 } 3528 3529 var cacheDefault = { 3530 create: function create () { 3531 return new ObjectWithoutPrototypeCache() 3532 } 3533 } 3534 3535 // 3536 // API 3537 // 3538 3539 module.exports = memoize 3540 module.exports.strategies = { 3541 variadic: strategyVariadic, 3542 monadic: strategyMonadic 3543 } 3544 3545 3546 /***/ }), 3547 3548 /***/ "7Cbv": 3549 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3550 3551 "use strict"; 3552 3553 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js 3554 // Unique ID creation requires a high quality random # generator. In the browser we therefore 3555 // require the crypto API and do not support built-in fallback to lower quality random number 3556 // generators (like Math.random()). 3557 var getRandomValues; 3558 var rnds8 = new Uint8Array(16); 3559 function rng() { 3560 // lazy load so that environments that need to polyfill have a chance to do so 3561 if (!getRandomValues) { 3562 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, 3563 // find the complete implementation of crypto (msCrypto) on IE11. 3564 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); 3565 3566 if (!getRandomValues) { 3567 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); 3568 } 3569 } 3570 3571 return getRandomValues(rnds8); 3572 } 3573 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js 3574 /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); 3575 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js 3576 3577 3578 function validate(uuid) { 3579 return typeof uuid === 'string' && regex.test(uuid); 3580 } 3581 3582 /* harmony default export */ var esm_browser_validate = (validate); 3583 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js 3584 3585 /** 3586 * Convert array of 16 byte values to UUID string format of the form: 3587 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 3588 */ 3589 3590 var byteToHex = []; 3591 3592 for (var stringify_i = 0; stringify_i < 256; ++stringify_i) { 3593 byteToHex.push((stringify_i + 0x100).toString(16).substr(1)); 3594 } 3595 3596 function stringify(arr) { 3597 var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 3598 // Note: Be careful editing this code! It's been tuned for performance 3599 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 3600 var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one 3601 // of the following: 3602 // - One or more input array values don't map to a hex octet (leading to 3603 // "undefined" in the uuid) 3604 // - Invalid input values for the RFC `version` or `variant` fields 3605 3606 if (!esm_browser_validate(uuid)) { 3607 throw TypeError('Stringified UUID is invalid'); 3608 } 3609 3610 return uuid; 3611 } 3612 3613 /* harmony default export */ var esm_browser_stringify = (stringify); 3614 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js 3615 3616 3617 3618 function v4(options, buf, offset) { 3619 options = options || {}; 3620 var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 3621 3622 rnds[6] = rnds[6] & 0x0f | 0x40; 3623 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided 3624 3625 if (buf) { 3626 offset = offset || 0; 3627 3628 for (var i = 0; i < 16; ++i) { 3629 buf[offset + i] = rnds[i]; 3630 } 3631 3632 return buf; 3633 } 3634 3635 return esm_browser_stringify(rnds); 3636 } 3637 3638 /* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4); 3639 3640 /***/ }), 3641 3642 /***/ "7Ji+": 3643 /***/ (function(module, exports, __webpack_require__) { 3644 3645 "use strict"; 3646 3647 3648 var GetIntrinsic = __webpack_require__("rZ7t"); 3649 3650 var $Array = GetIntrinsic('%Array%'); 3651 var $species = GetIntrinsic('%Symbol.species%', true); 3652 var $TypeError = GetIntrinsic('%TypeError%'); 3653 3654 var Get = __webpack_require__("3aeR"); 3655 var IsArray = __webpack_require__("9cOx"); 3656 var IsConstructor = __webpack_require__("kuGu"); 3657 var IsInteger = __webpack_require__("R/b7"); 3658 var Type = __webpack_require__("V1cy"); 3659 3660 // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate 3661 3662 module.exports = function ArraySpeciesCreate(originalArray, length) { 3663 if (!IsInteger(length) || length < 0) { 3664 throw new $TypeError('Assertion failed: length must be an integer >= 0'); 3665 } 3666 var len = length === 0 ? 0 : length; 3667 var C; 3668 var isArray = IsArray(originalArray); 3669 if (isArray) { 3670 C = Get(originalArray, 'constructor'); 3671 // TODO: figure out how to make a cross-realm normal Array, a same-realm Array 3672 // if (IsConstructor(C)) { 3673 // if C is another realm's Array, C = undefined 3674 // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? 3675 // } 3676 if ($species && Type(C) === 'Object') { 3677 C = Get(C, $species); 3678 if (C === null) { 3679 C = void 0; 3680 } 3681 } 3682 } 3683 if (typeof C === 'undefined') { 3684 return $Array(len); 3685 } 3686 if (!IsConstructor(C)) { 3687 throw new $TypeError('C must be a constructor'); 3688 } 3689 return new C(len); // Construct(C, len); 3690 }; 3691 3692 3693 3694 /***/ }), 3695 3696 /***/ "7Jlx": 3697 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3698 3699 "use strict"; 3700 /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contextConnect; }); 3701 /* unused harmony export getConnectNamespace */ 3702 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasConnectNamespace; }); 3703 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); 3704 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 3705 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); 3706 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 3707 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Z23Y"); 3708 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_2__); 3709 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tQ+x"); 3710 /* harmony import */ var _get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("UAm0"); 3711 /** 3712 * External dependencies 3713 */ 3714 3715 /** 3716 * WordPress dependencies 3717 */ 3718 3719 3720 3721 /** 3722 * Internal dependencies 3723 */ 3724 3725 3726 3727 /* eslint-disable jsdoc/valid-types */ 3728 3729 /** 3730 * Forwards ref (React.ForwardRef) and "Connects" (or registers) a component 3731 * within the Context system under a specified namespace. 3732 * 3733 * This is an (experimental) evolution of the initial connect() HOC. 3734 * The hope is that we can improve render performance by removing functional 3735 * component wrappers. 3736 * 3737 * @template {import('./polymorphic-component').ViewOwnProps<{}, any>} P 3738 * @param {(props: P, ref: import('react').Ref<any>) => JSX.Element | null} Component The component to register into the Context system. 3739 * @param {string} namespace The namespace to register the component under. 3740 * @param {Object} options 3741 * @param {boolean} [options.memo=false] 3742 * @return {import('./polymorphic-component').PolymorphicComponent<import('./polymorphic-component').ElementTypeFromViewOwnProps<P>, import('./polymorphic-component').PropsFromViewOwnProps<P>>} The connected PolymorphicComponent 3743 */ 3744 3745 function contextConnect(Component, namespace, options = {}) { 3746 /* eslint-enable jsdoc/valid-types */ 3747 const { 3748 memo: memoProp = false 3749 } = options; 3750 let WrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Component); 3751 3752 if (memoProp) { 3753 // @ts-ignore 3754 WrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["memo"])(WrappedComponent); 3755 } 3756 3757 if (typeof namespace === 'undefined') { 3758 typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default()('contextConnect: Please provide a namespace') : void 0; 3759 } // @ts-ignore internal property 3760 3761 3762 let mergedNamespace = WrappedComponent[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]] || [namespace]; 3763 /** 3764 * Consolidate (merge) namespaces before attaching it to the WrappedComponent. 3765 */ 3766 3767 if (Array.isArray(namespace)) { 3768 mergedNamespace = [...mergedNamespace, ...namespace]; 3769 } 3770 3771 if (typeof namespace === 'string') { 3772 mergedNamespace = [...mergedNamespace, namespace]; 3773 } 3774 3775 WrappedComponent.displayName = namespace; // @ts-ignore internal property 3776 3777 WrappedComponent[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]] = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["uniq"])(mergedNamespace); // @ts-ignore PolymorphicComponent property 3778 3779 WrappedComponent.selector = `.${Object(_get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__[/* getStyledClassNameFromKey */ "a"])(namespace)}`; // @ts-ignore 3780 3781 return WrappedComponent; 3782 } 3783 /** 3784 * Attempts to retrieve the connected namespace from a component. 3785 * 3786 * @param {import('react').ReactChild | undefined | {}} Component The component to retrieve a namespace from. 3787 * @return {Array<string>} The connected namespaces. 3788 */ 3789 3790 function getConnectNamespace(Component) { 3791 if (!Component) return []; 3792 let namespaces = []; // @ts-ignore internal property 3793 3794 if (Component[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]) { 3795 // @ts-ignore internal property 3796 namespaces = Component[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]; 3797 } // @ts-ignore 3798 3799 3800 if (Component.type && Component.type[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]) { 3801 // @ts-ignore 3802 namespaces = Component.type[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]; 3803 } 3804 3805 return namespaces; 3806 } 3807 /** 3808 * Checks to see if a component is connected within the Context system. 3809 * 3810 * @param {import('react').ReactNode} Component The component to retrieve a namespace from. 3811 * @param {Array<string>|string} match The namespace to check. 3812 * @return {boolean} The result. 3813 */ 3814 3815 function hasConnectNamespace(Component, match) { 3816 if (!Component) return false; 3817 3818 if (typeof match === 'string') { 3819 return getConnectNamespace(Component).includes(match); 3820 } 3821 3822 if (Array.isArray(match)) { 3823 return match.some(result => getConnectNamespace(Component).includes(result)); 3824 } 3825 3826 return false; 3827 } 3828 3829 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) 3830 3831 /***/ }), 3832 3833 /***/ "82c2": 3834 /***/ (function(module, exports, __webpack_require__) { 3835 3836 "use strict"; 3837 3838 3839 var keys = __webpack_require__("1seS"); 3840 var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; 3841 3842 var toStr = Object.prototype.toString; 3843 var concat = Array.prototype.concat; 3844 var origDefineProperty = Object.defineProperty; 3845 3846 var isFunction = function (fn) { 3847 return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; 3848 }; 3849 3850 var arePropertyDescriptorsSupported = function () { 3851 var obj = {}; 3852 try { 3853 origDefineProperty(obj, 'x', { enumerable: false, value: obj }); 3854 // eslint-disable-next-line no-unused-vars, no-restricted-syntax 3855 for (var _ in obj) { // jscs:ignore disallowUnusedVariables 3856 return false; 3857 } 3858 return obj.x === obj; 3859 } catch (e) { /* this is IE 8. */ 3860 return false; 3861 } 3862 }; 3863 var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); 3864 3865 var defineProperty = function (object, name, value, predicate) { 3866 if (name in object && (!isFunction(predicate) || !predicate())) { 3867 return; 3868 } 3869 if (supportsDescriptors) { 3870 origDefineProperty(object, name, { 3871 configurable: true, 3872 enumerable: false, 3873 value: value, 3874 writable: true 3875 }); 3876 } else { 3877 object[name] = value; 3878 } 3879 }; 3880 3881 var defineProperties = function (object, map) { 3882 var predicates = arguments.length > 2 ? arguments[2] : {}; 3883 var props = keys(map); 3884 if (hasSymbols) { 3885 props = concat.call(props, Object.getOwnPropertySymbols(map)); 3886 } 3887 for (var i = 0; i < props.length; i += 1) { 3888 defineProperty(object, props[i], map[props[i]], predicates[props[i]]); 3889 } 3890 }; 3891 3892 defineProperties.supportsDescriptors = !!supportsDescriptors; 3893 3894 module.exports = defineProperties; 3895 3896 3897 /***/ }), 3898 3899 /***/ "8OQS": 3900 /***/ (function(module, exports) { 3901 3902 function _objectWithoutPropertiesLoose(source, excluded) { 3903 if (source == null) return {}; 3904 var target = {}; 3905 var sourceKeys = Object.keys(source); 3906 var key, i; 3907 3908 for (i = 0; i < sourceKeys.length; i++) { 3909 key = sourceKeys[i]; 3910 if (excluded.indexOf(key) >= 0) continue; 3911 target[key] = source[key]; 3912 } 3913 3914 return target; 3915 } 3916 3917 module.exports = _objectWithoutPropertiesLoose; 3918 module.exports["default"] = module.exports, module.exports.__esModule = true; 3919 3920 /***/ }), 3921 3922 /***/ "8R9v": 3923 /***/ (function(module, exports, __webpack_require__) { 3924 3925 "use strict"; 3926 3927 3928 var define = __webpack_require__("82c2"); 3929 var getPolyfill = __webpack_require__("yLpt"); 3930 3931 module.exports = function shimAssign() { 3932 var polyfill = getPolyfill(); 3933 define( 3934 Object, 3935 { assign: polyfill }, 3936 { assign: function () { return Object.assign !== polyfill; } } 3937 ); 3938 return polyfill; 3939 }; 3940 3941 3942 /***/ }), 3943 3944 /***/ "8oxB": 3945 /***/ (function(module, exports) { 3946 3947 // shim for using process in browser 3948 var process = module.exports = {}; 3949 3950 // cached from whatever global is present so that test runners that stub it 3951 // don't break things. But we need to wrap it in a try catch in case it is 3952 // wrapped in strict mode code which doesn't define any globals. It's inside a 3953 // function because try/catches deoptimize in certain engines. 3954 3955 var cachedSetTimeout; 3956 var cachedClearTimeout; 3957 3958 function defaultSetTimout() { 3959 throw new Error('setTimeout has not been defined'); 3960 } 3961 function defaultClearTimeout () { 3962 throw new Error('clearTimeout has not been defined'); 3963 } 3964 (function () { 3965 try { 3966 if (typeof setTimeout === 'function') { 3967 cachedSetTimeout = setTimeout; 3968 } else { 3969 cachedSetTimeout = defaultSetTimout; 3970 } 3971 } catch (e) { 3972 cachedSetTimeout = defaultSetTimout; 3973 } 3974 try { 3975 if (typeof clearTimeout === 'function') { 3976 cachedClearTimeout = clearTimeout; 3977 } else { 3978 cachedClearTimeout = defaultClearTimeout; 3979 } 3980 } catch (e) { 3981 cachedClearTimeout = defaultClearTimeout; 3982 } 3983 } ()) 3984 function runTimeout(fun) { 3985 if (cachedSetTimeout === setTimeout) { 3986 //normal enviroments in sane situations 3987 return setTimeout(fun, 0); 3988 } 3989 // if setTimeout wasn't available but was latter defined 3990 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 3991 cachedSetTimeout = setTimeout; 3992 return setTimeout(fun, 0); 3993 } 3994 try { 3995 // when when somebody has screwed with setTimeout but no I.E. maddness 3996 return cachedSetTimeout(fun, 0); 3997 } catch(e){ 3998 try { 3999 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 4000 return cachedSetTimeout.call(null, fun, 0); 4001 } catch(e){ 4002 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 4003 return cachedSetTimeout.call(this, fun, 0); 4004 } 4005 } 4006 4007 4008 } 4009 function runClearTimeout(marker) { 4010 if (cachedClearTimeout === clearTimeout) { 4011 //normal enviroments in sane situations 4012 return clearTimeout(marker); 4013 } 4014 // if clearTimeout wasn't available but was latter defined 4015 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 4016 cachedClearTimeout = clearTimeout; 4017 return clearTimeout(marker); 4018 } 4019 try { 4020 // when when somebody has screwed with setTimeout but no I.E. maddness 4021 return cachedClearTimeout(marker); 4022 } catch (e){ 4023 try { 4024 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 4025 return cachedClearTimeout.call(null, marker); 4026 } catch (e){ 4027 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 4028 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 4029 return cachedClearTimeout.call(this, marker); 4030 } 4031 } 4032 4033 4034 4035 } 4036 var queue = []; 4037 var draining = false; 4038 var currentQueue; 4039 var queueIndex = -1; 4040 4041 function cleanUpNextTick() { 4042 if (!draining || !currentQueue) { 4043 return; 4044 } 4045 draining = false; 4046 if (currentQueue.length) { 4047 queue = currentQueue.concat(queue); 4048 } else { 4049 queueIndex = -1; 4050 } 4051 if (queue.length) { 4052 drainQueue(); 4053 } 4054 } 4055 4056 function drainQueue() { 4057 if (draining) { 4058 return; 4059 } 4060 var timeout = runTimeout(cleanUpNextTick); 4061 draining = true; 4062 4063 var len = queue.length; 4064 while(len) { 4065 currentQueue = queue; 4066 queue = []; 4067 while (++queueIndex < len) { 4068 if (currentQueue) { 4069 currentQueue[queueIndex].run(); 4070 } 4071 } 4072 queueIndex = -1; 4073 len = queue.length; 4074 } 4075 currentQueue = null; 4076 draining = false; 4077 runClearTimeout(timeout); 4078 } 4079 4080 process.nextTick = function (fun) { 4081 var args = new Array(arguments.length - 1); 4082 if (arguments.length > 1) { 4083 for (var i = 1; i < arguments.length; i++) { 4084 args[i - 1] = arguments[i]; 4085 } 4086 } 4087 queue.push(new Item(fun, args)); 4088 if (queue.length === 1 && !draining) { 4089 runTimeout(drainQueue); 4090 } 4091 }; 4092 4093 // v8 likes predictible objects 4094 function Item(fun, array) { 4095 this.fun = fun; 4096 this.array = array; 4097 } 4098 Item.prototype.run = function () { 4099 this.fun.apply(null, this.array); 4100 }; 4101 process.title = 'browser'; 4102 process.browser = true; 4103 process.env = {}; 4104 process.argv = []; 4105 process.version = ''; // empty string to avoid regexp issues 4106 process.versions = {}; 4107 4108 function noop() {} 4109 4110 process.on = noop; 4111 process.addListener = noop; 4112 process.once = noop; 4113 process.off = noop; 4114 process.removeListener = noop; 4115 process.removeAllListeners = noop; 4116 process.emit = noop; 4117 process.prependListener = noop; 4118 process.prependOnceListener = noop; 4119 4120 process.listeners = function (name) { return [] } 4121 4122 process.binding = function (name) { 4123 throw new Error('process.binding is not supported'); 4124 }; 4125 4126 process.cwd = function () { return '/' }; 4127 process.chdir = function (dir) { 4128 throw new Error('process.chdir is not supported'); 4129 }; 4130 process.umask = function() { return 0; }; 4131 4132 4133 /***/ }), 4134 4135 /***/ "9Do8": 4136 /***/ (function(module, exports, __webpack_require__) { 4137 4138 "use strict"; 4139 4140 4141 module.exports = __webpack_require__("zt9T"); 4142 4143 /***/ }), 4144 4145 /***/ "9NHk": 4146 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4147 4148 "use strict"; 4149 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return withNext; }); 4150 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); 4151 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); 4152 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 4153 4154 4155 4156 /** 4157 * Internal dependencies 4158 */ 4159 4160 4161 /** 4162 * @template {{}} TCurrentProps 4163 * @template {{}} TNextProps 4164 * @param {import('react').ForwardRefExoticComponent<TCurrentProps>} CurrentComponent 4165 * @param {import('react').ComponentType<TNextProps>} NextComponent 4166 * @param {string} namespace 4167 * @param {(props: TCurrentProps) => TNextProps} adapter 4168 */ 4169 4170 function withNext(CurrentComponent, NextComponent = () => null, namespace = 'Component', adapter = p => 4171 /** @type {any} */ 4172 p) { 4173 if (false) {} 4174 4175 return CurrentComponent; 4176 } 4177 4178 4179 /***/ }), 4180 4181 /***/ "9VDH": 4182 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4183 4184 "use strict"; 4185 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); 4186 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); 4187 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 4188 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Tqx9"); 4189 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__); 4190 /* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vUUf"); 4191 4192 4193 /** 4194 * WordPress dependencies 4195 */ 4196 4197 4198 /** 4199 * Internal dependencies 4200 */ 4201 4202 4203 4204 function Icon({ 4205 icon = null, 4206 size, 4207 ...additionalProps 4208 }) { 4209 if ('string' === typeof icon) { 4210 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ 4211 icon: icon 4212 }, additionalProps)); 4213 } 4214 4215 if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"] === icon.type) { 4216 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["cloneElement"])(icon, { ...additionalProps 4217 }); 4218 } // Icons should be 24x24 by default. 4219 4220 4221 const iconSize = size || 24; 4222 4223 if ('function' === typeof icon) { 4224 if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Component"]) { 4225 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(icon, { 4226 size: iconSize, 4227 ...additionalProps 4228 }); 4229 } 4230 4231 return icon({ 4232 size: iconSize, 4233 ...additionalProps 4234 }); 4235 } 4236 4237 if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__["SVG"])) { 4238 const appliedProps = { 4239 width: iconSize, 4240 height: iconSize, 4241 ...icon.props, 4242 ...additionalProps 4243 }; 4244 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__["SVG"], appliedProps); 4245 } 4246 4247 if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["isValidElement"])(icon)) { 4248 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["cloneElement"])(icon, { 4249 size: iconSize, 4250 ...additionalProps 4251 }); 4252 } 4253 4254 return icon; 4255 } 4256 4257 /* harmony default export */ __webpack_exports__["a"] = (Icon); 4258 4259 4260 /***/ }), 4261 4262 /***/ "9cOx": 4263 /***/ (function(module, exports, __webpack_require__) { 4264 4265 "use strict"; 4266 4267 4268 var GetIntrinsic = __webpack_require__("rZ7t"); 4269 4270 var $Array = GetIntrinsic('%Array%'); 4271 4272 // eslint-disable-next-line global-require 4273 var toStr = !$Array.isArray && __webpack_require__("EXo9")('Object.prototype.toString'); 4274 4275 // https://ecma-international.org/ecma-262/6.0/#sec-isarray 4276 4277 module.exports = $Array.isArray || function IsArray(argument) { 4278 return toStr(argument) === '[object Array]'; 4279 }; 4280 4281 4282 /***/ }), 4283 4284 /***/ "9gmn": 4285 /***/ (function(module, exports, __webpack_require__) { 4286 4287 "use strict"; 4288 4289 4290 Object.defineProperty(exports, "__esModule", { 4291 value: true 4292 }); 4293 4294 var _react = __webpack_require__("cDcd"); 4295 4296 var _react2 = _interopRequireDefault(_react); 4297 4298 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 4299 4300 var ChevronUp = function () { 4301 function ChevronUp(props) { 4302 return _react2['default'].createElement( 4303 'svg', 4304 props, 4305 _react2['default'].createElement('path', { 4306 d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z' 4307 }) 4308 ); 4309 } 4310 4311 return ChevronUp; 4312 }(); 4313 4314 ChevronUp.defaultProps = { 4315 viewBox: '0 0 1000 1000' 4316 }; 4317 exports['default'] = ChevronUp; 4318 4319 /***/ }), 4320 4321 /***/ "9pTB": 4322 /***/ (function(module, exports, __webpack_require__) { 4323 4324 "use strict"; 4325 /* WEBPACK VAR INJECTION */(function(global) { 4326 4327 var define = __webpack_require__("82c2"); 4328 var isSymbol = __webpack_require__("/sVA"); 4329 4330 var globalKey = '__ global cache key __'; 4331 /* istanbul ignore else */ 4332 // eslint-disable-next-line no-restricted-properties 4333 if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') { 4334 // eslint-disable-next-line no-restricted-properties 4335 globalKey = Symbol['for'](globalKey); 4336 } 4337 4338 var trueThunk = function () { 4339 return true; 4340 }; 4341 4342 var ensureCache = function ensureCache() { 4343 if (!global[globalKey]) { 4344 var properties = {}; 4345 properties[globalKey] = {}; 4346 var predicates = {}; 4347 predicates[globalKey] = trueThunk; 4348 define(global, properties, predicates); 4349 } 4350 return global[globalKey]; 4351 }; 4352 4353 var cache = ensureCache(); 4354 4355 var isPrimitive = function isPrimitive(val) { 4356 return val === null || (typeof val !== 'object' && typeof val !== 'function'); 4357 }; 4358 4359 var getPrimitiveKey = function getPrimitiveKey(val) { 4360 if (isSymbol(val)) { 4361 return Symbol.prototype.valueOf.call(val); 4362 } 4363 return typeof val + ' | ' + String(val); 4364 }; 4365 4366 var requirePrimitiveKey = function requirePrimitiveKey(val) { 4367 if (!isPrimitive(val)) { 4368 throw new TypeError('key must not be an object'); 4369 } 4370 }; 4371 4372 var globalCache = { 4373 clear: function clear() { 4374 delete global[globalKey]; 4375 cache = ensureCache(); 4376 }, 4377 4378 'delete': function deleteKey(key) { 4379 requirePrimitiveKey(key); 4380 delete cache[getPrimitiveKey(key)]; 4381 return !globalCache.has(key); 4382 }, 4383 4384 get: function get(key) { 4385 requirePrimitiveKey(key); 4386 return cache[getPrimitiveKey(key)]; 4387 }, 4388 4389 has: function has(key) { 4390 requirePrimitiveKey(key); 4391 return getPrimitiveKey(key) in cache; 4392 }, 4393 4394 set: function set(key, value) { 4395 requirePrimitiveKey(key); 4396 var primitiveKey = getPrimitiveKey(key); 4397 var props = {}; 4398 props[primitiveKey] = value; 4399 var predicates = {}; 4400 predicates[primitiveKey] = trueThunk; 4401 define(cache, props, predicates); 4402 return globalCache.has(key); 4403 }, 4404 4405 setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) { 4406 if (globalCache.has(key)) { 4407 return globalCache.get(key); 4408 } 4409 var item = valueThunk(); 4410 globalCache.set(key, item); 4411 return item; 4412 } 4413 }; 4414 4415 module.exports = globalCache; 4416 4417 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) 4418 4419 /***/ }), 4420 4421 /***/ "9uj6": 4422 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4423 4424 "use strict"; 4425 __webpack_require__.r(__webpack_exports__); 4426 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4qRI"); 4427 4428 4429 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 4430 4431 var index = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(function (prop) { 4432 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 4433 /* o */ 4434 && prop.charCodeAt(1) === 110 4435 /* n */ 4436 && prop.charCodeAt(2) < 91; 4437 } 4438 /* Z+1 */ 4439 ); 4440 4441 /* harmony default export */ __webpack_exports__["default"] = (index); 4442 4443 4444 /***/ }), 4445 4446 /***/ "AClM": 4447 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4448 4449 "use strict"; 4450 4451 // EXPORTS 4452 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ensureFocus; }); 4453 4454 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js 4455 var getActiveElement = __webpack_require__("Nym8"); 4456 4457 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocus.js 4458 4459 4460 4461 /** 4462 * Checks if `element` has focus. Elements that are referenced by 4463 * `aria-activedescendant` are also considered. 4464 * 4465 * @example 4466 * import { hasFocus } from "reakit-utils"; 4467 * 4468 * hasFocus(document.getElementById("id")); 4469 */ 4470 4471 function hasFocus(element) { 4472 var activeElement = Object(getActiveElement["a" /* getActiveElement */])(element); 4473 if (!activeElement) return false; 4474 if (activeElement === element) return true; 4475 var activeDescendant = activeElement.getAttribute("aria-activedescendant"); 4476 if (!activeDescendant) return false; 4477 return activeDescendant === element.id; 4478 } 4479 4480 4481 4482 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/ensureFocus.js 4483 4484 4485 4486 4487 /** 4488 * Ensures `element` will receive focus if it's not already. 4489 * 4490 * @example 4491 * import { ensureFocus } from "reakit-utils"; 4492 * 4493 * ensureFocus(document.activeElement); // does nothing 4494 * 4495 * const element = document.querySelector("input"); 4496 * 4497 * ensureFocus(element); // focuses element 4498 * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump 4499 * 4500 * function isActive(el) { 4501 * return el.dataset.active === "true"; 4502 * } 4503 * 4504 * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing 4505 * 4506 * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed. 4507 */ 4508 function ensureFocus(element, _temp) { 4509 var _ref = _temp === void 0 ? {} : _temp, 4510 preventScroll = _ref.preventScroll, 4511 _ref$isActive = _ref.isActive, 4512 isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive; 4513 4514 if (isActive(element)) return -1; 4515 element.focus({ 4516 preventScroll: preventScroll 4517 }); 4518 if (isActive(element)) return -1; 4519 return requestAnimationFrame(function () { 4520 element.focus({ 4521 preventScroll: preventScroll 4522 }); 4523 }); 4524 } 4525 4526 4527 4528 4529 /***/ }), 4530 4531 /***/ "AM7I": 4532 /***/ (function(module, exports, __webpack_require__) { 4533 4534 "use strict"; 4535 4536 4537 /* globals 4538 AggregateError, 4539 Atomics, 4540 FinalizationRegistry, 4541 SharedArrayBuffer, 4542 WeakRef, 4543 */ 4544 4545 var undefined; 4546 4547 var $SyntaxError = SyntaxError; 4548 var $Function = Function; 4549 var $TypeError = TypeError; 4550 4551 // eslint-disable-next-line consistent-return 4552 var getEvalledConstructor = function (expressionSyntax) { 4553 try { 4554 // eslint-disable-next-line no-new-func 4555 return Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 4556 } catch (e) {} 4557 }; 4558 4559 var $gOPD = Object.getOwnPropertyDescriptor; 4560 if ($gOPD) { 4561 try { 4562 $gOPD({}, ''); 4563 } catch (e) { 4564 $gOPD = null; // this is IE 8, which has a broken gOPD 4565 } 4566 } 4567 4568 var throwTypeError = function () { 4569 throw new $TypeError(); 4570 }; 4571 var ThrowTypeError = $gOPD 4572 ? (function () { 4573 try { 4574 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 4575 arguments.callee; // IE 8 does not throw here 4576 return throwTypeError; 4577 } catch (calleeThrows) { 4578 try { 4579 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 4580 return $gOPD(arguments, 'callee').get; 4581 } catch (gOPDthrows) { 4582 return throwTypeError; 4583 } 4584 } 4585 }()) 4586 : throwTypeError; 4587 4588 var hasSymbols = __webpack_require__("UVaH")(); 4589 4590 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 4591 4592 var asyncGenFunction = getEvalledConstructor('async function* () {}'); 4593 var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined; 4594 var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined; 4595 4596 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 4597 4598 var INTRINSICS = { 4599 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 4600 '%Array%': Array, 4601 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 4602 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 4603 '%AsyncFromSyncIteratorPrototype%': undefined, 4604 '%AsyncFunction%': getEvalledConstructor('async function () {}'), 4605 '%AsyncGenerator%': asyncGenFunctionPrototype, 4606 '%AsyncGeneratorFunction%': asyncGenFunction, 4607 '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined, 4608 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 4609 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 4610 '%Boolean%': Boolean, 4611 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 4612 '%Date%': Date, 4613 '%decodeURI%': decodeURI, 4614 '%decodeURIComponent%': decodeURIComponent, 4615 '%encodeURI%': encodeURI, 4616 '%encodeURIComponent%': encodeURIComponent, 4617 '%Error%': Error, 4618 '%eval%': eval, // eslint-disable-line no-eval 4619 '%EvalError%': EvalError, 4620 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 4621 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 4622 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 4623 '%Function%': $Function, 4624 '%GeneratorFunction%': getEvalledConstructor('function* () {}'), 4625 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 4626 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 4627 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 4628 '%isFinite%': isFinite, 4629 '%isNaN%': isNaN, 4630 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 4631 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 4632 '%Map%': typeof Map === 'undefined' ? undefined : Map, 4633 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 4634 '%Math%': Math, 4635 '%Number%': Number, 4636 '%Object%': Object, 4637 '%parseFloat%': parseFloat, 4638 '%parseInt%': parseInt, 4639 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 4640 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 4641 '%RangeError%': RangeError, 4642 '%ReferenceError%': ReferenceError, 4643 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 4644 '%RegExp%': RegExp, 4645 '%Set%': typeof Set === 'undefined' ? undefined : Set, 4646 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 4647 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 4648 '%String%': String, 4649 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 4650 '%Symbol%': hasSymbols ? Symbol : undefined, 4651 '%SyntaxError%': $SyntaxError, 4652 '%ThrowTypeError%': ThrowTypeError, 4653 '%TypedArray%': TypedArray, 4654 '%TypeError%': $TypeError, 4655 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 4656 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 4657 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 4658 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 4659 '%URIError%': URIError, 4660 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 4661 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 4662 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 4663 }; 4664 4665 var LEGACY_ALIASES = { 4666 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 4667 '%ArrayPrototype%': ['Array', 'prototype'], 4668 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 4669 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 4670 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 4671 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 4672 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 4673 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 4674 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 4675 '%BooleanPrototype%': ['Boolean', 'prototype'], 4676 '%DataViewPrototype%': ['DataView', 'prototype'], 4677 '%DatePrototype%': ['Date', 'prototype'], 4678 '%ErrorPrototype%': ['Error', 'prototype'], 4679 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 4680 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 4681 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 4682 '%FunctionPrototype%': ['Function', 'prototype'], 4683 '%Generator%': ['GeneratorFunction', 'prototype'], 4684 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 4685 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 4686 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 4687 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 4688 '%JSONParse%': ['JSON', 'parse'], 4689 '%JSONStringify%': ['JSON', 'stringify'], 4690 '%MapPrototype%': ['Map', 'prototype'], 4691 '%NumberPrototype%': ['Number', 'prototype'], 4692 '%ObjectPrototype%': ['Object', 'prototype'], 4693 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 4694 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 4695 '%PromisePrototype%': ['Promise', 'prototype'], 4696 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 4697 '%Promise_all%': ['Promise', 'all'], 4698 '%Promise_reject%': ['Promise', 'reject'], 4699 '%Promise_resolve%': ['Promise', 'resolve'], 4700 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 4701 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 4702 '%RegExpPrototype%': ['RegExp', 'prototype'], 4703 '%SetPrototype%': ['Set', 'prototype'], 4704 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 4705 '%StringPrototype%': ['String', 'prototype'], 4706 '%SymbolPrototype%': ['Symbol', 'prototype'], 4707 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 4708 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 4709 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 4710 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 4711 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 4712 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 4713 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 4714 '%URIErrorPrototype%': ['URIError', 'prototype'], 4715 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 4716 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 4717 }; 4718 4719 var bind = __webpack_require__("D3zA"); 4720 var hasOwn = __webpack_require__("oNNP"); 4721 var $concat = bind.call(Function.call, Array.prototype.concat); 4722 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 4723 var $replace = bind.call(Function.call, String.prototype.replace); 4724 var $strSlice = bind.call(Function.call, String.prototype.slice); 4725 4726 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 4727 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 4728 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 4729 var stringToPath = function stringToPath(string) { 4730 var first = $strSlice(string, 0, 1); 4731 var last = $strSlice(string, -1); 4732 if (first === '%' && last !== '%') { 4733 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 4734 } else if (last === '%' && first !== '%') { 4735 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 4736 } 4737 var result = []; 4738 $replace(string, rePropName, function (match, number, quote, subString) { 4739 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 4740 }); 4741 return result; 4742 }; 4743 /* end adaptation */ 4744 4745 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 4746 var intrinsicName = name; 4747 var alias; 4748 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 4749 alias = LEGACY_ALIASES[intrinsicName]; 4750 intrinsicName = '%' + alias[0] + '%'; 4751 } 4752 4753 if (hasOwn(INTRINSICS, intrinsicName)) { 4754 var value = INTRINSICS[intrinsicName]; 4755 if (typeof value === 'undefined' && !allowMissing) { 4756 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 4757 } 4758 4759 return { 4760 alias: alias, 4761 name: intrinsicName, 4762 value: value 4763 }; 4764 } 4765 4766 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 4767 }; 4768 4769 module.exports = function GetIntrinsic(name, allowMissing) { 4770 if (typeof name !== 'string' || name.length === 0) { 4771 throw new $TypeError('intrinsic name must be a non-empty string'); 4772 } 4773 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 4774 throw new $TypeError('"allowMissing" argument must be a boolean'); 4775 } 4776 4777 var parts = stringToPath(name); 4778 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 4779 4780 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 4781 var intrinsicRealName = intrinsic.name; 4782 var value = intrinsic.value; 4783 var skipFurtherCaching = false; 4784 4785 var alias = intrinsic.alias; 4786 if (alias) { 4787 intrinsicBaseName = alias[0]; 4788 $spliceApply(parts, $concat([0, 1], alias)); 4789 } 4790 4791 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 4792 var part = parts[i]; 4793 var first = $strSlice(part, 0, 1); 4794 var last = $strSlice(part, -1); 4795 if ( 4796 ( 4797 (first === '"' || first === "'" || first === '`') 4798 || (last === '"' || last === "'" || last === '`') 4799 ) 4800 && first !== last 4801 ) { 4802 throw new $SyntaxError('property names with quotes must have matching quotes'); 4803 } 4804 if (part === 'constructor' || !isOwn) { 4805 skipFurtherCaching = true; 4806 } 4807 4808 intrinsicBaseName += '.' + part; 4809 intrinsicRealName = '%' + intrinsicBaseName + '%'; 4810 4811 if (hasOwn(INTRINSICS, intrinsicRealName)) { 4812 value = INTRINSICS[intrinsicRealName]; 4813 } else if (value != null) { 4814 if (!(part in value)) { 4815 if (!allowMissing) { 4816 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 4817 } 4818 return void undefined; 4819 } 4820 if ($gOPD && (i + 1) >= parts.length) { 4821 var desc = $gOPD(value, part); 4822 isOwn = !!desc; 4823 4824 // By convention, when a data property is converted to an accessor 4825 // property to emulate a data property that does not suffer from 4826 // the override mistake, that accessor's getter is marked with 4827 // an `originalValue` property. Here, when we detect this, we 4828 // uphold the illusion by pretending to see that original data 4829 // property, i.e., returning the value rather than the getter 4830 // itself. 4831 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 4832 value = desc.get; 4833 } else { 4834 value = value[part]; 4835 } 4836 } else { 4837 isOwn = hasOwn(value, part); 4838 value = value[part]; 4839 } 4840 4841 if (isOwn && !skipFurtherCaching) { 4842 INTRINSICS[intrinsicRealName] = value; 4843 } 4844 } 4845 } 4846 return value; 4847 }; 4848 4849 4850 /***/ }), 4851 4852 /***/ "AP2z": 4853 /***/ (function(module, exports, __webpack_require__) { 4854 4855 var Symbol = __webpack_require__("nmnc"); 4856 4857 /** Used for built-in method references. */ 4858 var objectProto = Object.prototype; 4859 4860 /** Used to check objects for own properties. */ 4861 var hasOwnProperty = objectProto.hasOwnProperty; 4862 4863 /** 4864 * Used to resolve the 4865 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 4866 * of values. 4867 */ 4868 var nativeObjectToString = objectProto.toString; 4869 4870 /** Built-in value references. */ 4871 var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 4872 4873 /** 4874 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 4875 * 4876 * @private 4877 * @param {*} value The value to query. 4878 * @returns {string} Returns the raw `toStringTag`. 4879 */ 4880 function getRawTag(value) { 4881 var isOwn = hasOwnProperty.call(value, symToStringTag), 4882 tag = value[symToStringTag]; 4883 4884 try { 4885 value[symToStringTag] = undefined; 4886 var unmasked = true; 4887 } catch (e) {} 4888 4889 var result = nativeObjectToString.call(value); 4890 if (unmasked) { 4891 if (isOwn) { 4892 value[symToStringTag] = tag; 4893 } else { 4894 delete value[symToStringTag]; 4895 } 4896 } 4897 return result; 4898 } 4899 4900 module.exports = getRawTag; 4901 4902 4903 /***/ }), 4904 4905 /***/ "AXvK": 4906 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4907 4908 "use strict"; 4909 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsomorphicEffect; }); 4910 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd"); 4911 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 4912 /* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+ipW"); 4913 4914 4915 4916 4917 4918 /** 4919 * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side 4920 * rendering. 4921 */ 4922 4923 var useIsomorphicEffect = !_canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__[/* canUseDOM */ "a"] ? react__WEBPACK_IMPORTED_MODULE_0__["useEffect"] : react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"]; 4924 4925 4926 4927 4928 /***/ }), 4929 4930 /***/ "Ae65": 4931 /***/ (function(module, exports, __webpack_require__) { 4932 4933 "use strict"; 4934 4935 4936 Object.defineProperty(exports, "__esModule", { 4937 value: true 4938 }); 4939 exports['default'] = getCalendarDaySettings; 4940 4941 var _getPhrase = __webpack_require__("oOcr"); 4942 4943 var _getPhrase2 = _interopRequireDefault(_getPhrase); 4944 4945 var _constants = __webpack_require__("Fv1B"); 4946 4947 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 4948 4949 function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) { 4950 var chooseAvailableDate = phrases.chooseAvailableDate, 4951 dateIsUnavailable = phrases.dateIsUnavailable, 4952 dateIsSelected = phrases.dateIsSelected; 4953 4954 4955 var daySizeStyles = { 4956 width: daySize, 4957 height: daySize - 1 4958 }; 4959 4960 var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range'); 4961 4962 var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end'); 4963 4964 var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start')); 4965 4966 var isOutsideRange = modifiers.has('blocked-out-of-range'); 4967 4968 var formattedDate = { date: day.format(ariaLabelFormat) }; 4969 4970 var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate); 4971 if (modifiers.has(_constants.BLOCKED_MODIFIER)) { 4972 ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate); 4973 } else if (selected) { 4974 ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate); 4975 } 4976 4977 return { 4978 daySizeStyles: daySizeStyles, 4979 useDefaultCursor: useDefaultCursor, 4980 selected: selected, 4981 hoveredSpan: hoveredSpan, 4982 isOutsideRange: isOutsideRange, 4983 ariaLabel: ariaLabel 4984 }; 4985 } 4986 4987 /***/ }), 4988 4989 /***/ "Asd8": 4990 /***/ (function(module, exports, __webpack_require__) { 4991 4992 "use strict"; 4993 4994 4995 var fnToStr = Function.prototype.toString; 4996 var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; 4997 var badArrayLike; 4998 var isCallableMarker; 4999 if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { 5000 try { 5001 badArrayLike = Object.defineProperty({}, 'length', { 5002 get: function () { 5003 throw isCallableMarker; 5004 } 5005 }); 5006 isCallableMarker = {}; 5007 // eslint-disable-next-line no-throw-literal 5008 reflectApply(function () { throw 42; }, null, badArrayLike); 5009 } catch (_) { 5010 if (_ !== isCallableMarker) { 5011 reflectApply = null; 5012 } 5013 } 5014 } else { 5015 reflectApply = null; 5016 } 5017 5018 var constructorRegex = /^\s*class\b/; 5019 var isES6ClassFn = function isES6ClassFunction(value) { 5020 try { 5021 var fnStr = fnToStr.call(value); 5022 return constructorRegex.test(fnStr); 5023 } catch (e) { 5024 return false; // not a function 5025 } 5026 }; 5027 5028 var tryFunctionObject = function tryFunctionToStr(value) { 5029 try { 5030 if (isES6ClassFn(value)) { return false; } 5031 fnToStr.call(value); 5032 return true; 5033 } catch (e) { 5034 return false; 5035 } 5036 }; 5037 var toStr = Object.prototype.toString; 5038 var fnClass = '[object Function]'; 5039 var genClass = '[object GeneratorFunction]'; 5040 var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` 5041 /* globals document: false */ 5042 var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {}; 5043 5044 module.exports = reflectApply 5045 ? function isCallable(value) { 5046 if (value === documentDotAll) { return true; } 5047 if (!value) { return false; } 5048 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 5049 if (typeof value === 'function' && !value.prototype) { return true; } 5050 try { 5051 reflectApply(value, null, badArrayLike); 5052 } catch (e) { 5053 if (e !== isCallableMarker) { return false; } 5054 } 5055 return !isES6ClassFn(value); 5056 } 5057 : function isCallable(value) { 5058 if (value === documentDotAll) { return true; } 5059 if (!value) { return false; } 5060 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 5061 if (typeof value === 'function' && !value.prototype) { return true; } 5062 if (hasToStringTag) { return tryFunctionObject(value); } 5063 if (isES6ClassFn(value)) { return false; } 5064 var strClass = toStr.call(value); 5065 return strClass === fnClass || strClass === genClass; 5066 }; 5067 5068 5069 /***/ }), 5070 5071 /***/ "B6Q+": 5072 /***/ (function(module, exports, __webpack_require__) { 5073 5074 "use strict"; 5075 5076 5077 var hasSymbols = __webpack_require__("qGip"); 5078 5079 module.exports = function hasToStringTagShams() { 5080 return hasSymbols() && !!Symbol.toStringTag; 5081 }; 5082 5083 5084 /***/ }), 5085 5086 /***/ "B9Az": 5087 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5088 5089 "use strict"; 5090 5091 // EXTERNAL MODULE: external ["wp","element"] 5092 var external_wp_element_ = __webpack_require__("GRId"); 5093 5094 // EXTERNAL MODULE: external ["wp","primitives"] 5095 var external_wp_primitives_ = __webpack_require__("Tqx9"); 5096 5097 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js 5098 5099 5100 /** 5101 * WordPress dependencies 5102 */ 5103 5104 const pencil = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 5105 xmlns: "http://www.w3.org/2000/svg", 5106 viewBox: "0 0 24 24" 5107 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 5108 d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" 5109 })); 5110 /* harmony default export */ var library_pencil = (pencil); 5111 5112 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js 5113 /** 5114 * Internal dependencies 5115 */ 5116 5117 /* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil); 5118 5119 5120 /***/ }), 5121 5122 /***/ "BZp5": 5123 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5124 5125 "use strict"; 5126 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 5127 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; }); 5128 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; }); 5129 function _defineProperty(obj, key, value) { 5130 if (key in obj) { 5131 Object.defineProperty(obj, key, { 5132 value: value, 5133 enumerable: true, 5134 configurable: true, 5135 writable: true 5136 }); 5137 } else { 5138 obj[key] = value; 5139 } 5140 5141 return obj; 5142 } 5143 5144 function ownKeys(object, enumerableOnly) { 5145 var keys = Object.keys(object); 5146 5147 if (Object.getOwnPropertySymbols) { 5148 var symbols = Object.getOwnPropertySymbols(object); 5149 if (enumerableOnly) symbols = symbols.filter(function (sym) { 5150 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 5151 }); 5152 keys.push.apply(keys, symbols); 5153 } 5154 5155 return keys; 5156 } 5157 5158 function _objectSpread2(target) { 5159 for (var i = 1; i < arguments.length; i++) { 5160 var source = arguments[i] != null ? arguments[i] : {}; 5161 5162 if (i % 2) { 5163 ownKeys(Object(source), true).forEach(function (key) { 5164 _defineProperty(target, key, source[key]); 5165 }); 5166 } else if (Object.getOwnPropertyDescriptors) { 5167 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 5168 } else { 5169 ownKeys(Object(source)).forEach(function (key) { 5170 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 5171 }); 5172 } 5173 } 5174 5175 return target; 5176 } 5177 5178 function _objectWithoutPropertiesLoose(source, excluded) { 5179 if (source == null) return {}; 5180 var target = {}; 5181 var sourceKeys = Object.keys(source); 5182 var key, i; 5183 5184 for (i = 0; i < sourceKeys.length; i++) { 5185 key = sourceKeys[i]; 5186 if (excluded.indexOf(key) >= 0) continue; 5187 target[key] = source[key]; 5188 } 5189 5190 return target; 5191 } 5192 5193 function _unsupportedIterableToArray(o, minLen) { 5194 if (!o) return; 5195 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 5196 var n = Object.prototype.toString.call(o).slice(8, -1); 5197 if (n === "Object" && o.constructor) n = o.constructor.name; 5198 if (n === "Map" || n === "Set") return Array.from(o); 5199 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 5200 } 5201 5202 function _arrayLikeToArray(arr, len) { 5203 if (len == null || len > arr.length) len = arr.length; 5204 5205 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 5206 5207 return arr2; 5208 } 5209 5210 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 5211 var it; 5212 5213 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 5214 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 5215 if (it) o = it; 5216 var i = 0; 5217 return function () { 5218 if (i >= o.length) return { 5219 done: true 5220 }; 5221 return { 5222 done: false, 5223 value: o[i++] 5224 }; 5225 }; 5226 } 5227 5228 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 5229 } 5230 5231 it = o[Symbol.iterator](); 5232 return it.next.bind(it); 5233 } 5234 5235 5236 5237 5238 /***/ }), 5239 5240 /***/ "BeK9": 5241 /***/ (function(module, exports, __webpack_require__) { 5242 5243 "use strict"; 5244 5245 5246 module.exports = function isPrimitive(value) { 5247 return value === null || (typeof value !== 'function' && typeof value !== 'object'); 5248 }; 5249 5250 5251 /***/ }), 5252 5253 /***/ "Bpkj": 5254 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5255 5256 "use strict"; 5257 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 5258 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5259 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 5260 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 5261 5262 5263 /** 5264 * WordPress dependencies 5265 */ 5266 5267 const link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 5268 xmlns: "http://www.w3.org/2000/svg", 5269 viewBox: "0 0 24 24" 5270 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 5271 d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" 5272 })); 5273 /* harmony default export */ __webpack_exports__["a"] = (link); 5274 5275 5276 /***/ }), 5277 5278 /***/ "C6yU": 5279 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5280 5281 "use strict"; 5282 /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useContextSystem; }); 5283 /* harmony import */ var emotion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("kDDq"); 5284 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Z23Y"); 5285 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__); 5286 /* harmony import */ var _context_system_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6zzY"); 5287 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Ohaz"); 5288 /* harmony import */ var _get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("UAm0"); 5289 5290 5291 /** 5292 * WordPress dependencies 5293 */ 5294 5295 /** 5296 * Internal dependencies 5297 */ 5298 5299 5300 5301 5302 /* eslint-disable jsdoc/valid-types */ 5303 5304 /** 5305 * @template TProps 5306 * @typedef {TProps & { className: string; children?: import('react').ReactNode }} ConnectedProps 5307 */ 5308 5309 /* eslint-enable jsdoc/valid-types */ 5310 5311 /** 5312 * Custom hook that derives registered props from the Context system. 5313 * These derived props are then consolidated with incoming component props. 5314 * 5315 * @template {{ className?: string }} P 5316 * @param {P} props Incoming props from the component. 5317 * @param {string} namespace The namespace to register and to derive context props from. 5318 * @return {ConnectedProps<P>} The connected props. 5319 */ 5320 5321 function useContextSystem(props, namespace) { 5322 const contextSystemProps = Object(_context_system_provider__WEBPACK_IMPORTED_MODULE_2__[/* useComponentsContext */ "a"])(); 5323 5324 if (typeof namespace === 'undefined') { 5325 typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default()('useContextSystem: Please provide a namespace') : void 0; 5326 } 5327 5328 const contextProps = (contextSystemProps === null || contextSystemProps === void 0 ? void 0 : contextSystemProps[namespace]) || {}; 5329 /* eslint-disable jsdoc/no-undefined-types */ 5330 5331 /** @type {ConnectedProps<P>} */ 5332 // @ts-ignore We fill in the missing properties below 5333 5334 const finalComponentProps = { ...Object(_utils__WEBPACK_IMPORTED_MODULE_3__[/* getConnectedNamespace */ "a"])(), 5335 ...Object(_utils__WEBPACK_IMPORTED_MODULE_3__[/* getNamespace */ "b"])(namespace) 5336 }; 5337 /* eslint-enable jsdoc/no-undefined-types */ 5338 5339 const { 5340 _overrides: overrideProps, 5341 ...otherContextProps 5342 } = contextProps; 5343 const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props; 5344 5345 const classes = Object(emotion__WEBPACK_IMPORTED_MODULE_0__[/* cx */ "b"])(Object(_get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__[/* getStyledClassNameFromKey */ "a"])(namespace), props.className); // Provides the ability to customize the render of the component. 5346 5347 5348 const rendered = typeof initialMergedProps.renderChildren === 'function' ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children; 5349 5350 for (const key in initialMergedProps) { 5351 // @ts-ignore filling in missing props 5352 finalComponentProps[key] = initialMergedProps[key]; 5353 } 5354 5355 for (const key in overrideProps) { 5356 // @ts-ignore filling in missing props 5357 finalComponentProps[key] = overrideProps[key]; 5358 } 5359 5360 finalComponentProps.children = rendered; 5361 finalComponentProps.className = classes; 5362 return finalComponentProps; 5363 } 5364 5365 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) 5366 5367 /***/ }), 5368 5369 /***/ "CGNl": 5370 /***/ (function(module, exports, __webpack_require__) { 5371 5372 "use strict"; 5373 5374 5375 var has = __webpack_require__("oNNP"); 5376 5377 var assertRecord = __webpack_require__("10Kj"); 5378 5379 var Type = __webpack_require__("V1cy"); 5380 5381 // https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor 5382 5383 module.exports = function IsDataDescriptor(Desc) { 5384 if (typeof Desc === 'undefined') { 5385 return false; 5386 } 5387 5388 assertRecord(Type, 'Property Descriptor', 'Desc', Desc); 5389 5390 if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { 5391 return false; 5392 } 5393 5394 return true; 5395 }; 5396 5397 5398 /***/ }), 5399 5400 /***/ "Cw+6": 5401 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5402 5403 "use strict"; 5404 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 5405 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 5406 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl"); 5407 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 5408 5409 5410 /** 5411 * External dependencies 5412 */ 5413 5414 /** @typedef {string | { display: string, ariaLabel: string }} Shortcut */ 5415 5416 /** 5417 * @typedef Props 5418 * @property {Shortcut} shortcut Shortcut configuration 5419 * @property {string} [className] Classname 5420 */ 5421 5422 /** 5423 * @param {Props} props Props 5424 * @return {JSX.Element | null} Element 5425 */ 5426 5427 function Shortcut({ 5428 shortcut, 5429 className 5430 }) { 5431 if (!shortcut) { 5432 return null; 5433 } 5434 5435 let displayText; 5436 let ariaLabel; 5437 5438 if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) { 5439 displayText = shortcut; 5440 } 5441 5442 if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) { 5443 displayText = shortcut.display; 5444 ariaLabel = shortcut.ariaLabel; 5445 } 5446 5447 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 5448 className: className, 5449 "aria-label": ariaLabel 5450 }, displayText); 5451 } 5452 5453 /* harmony default export */ __webpack_exports__["a"] = (Shortcut); 5454 5455 5456 /***/ }), 5457 5458 /***/ "D3zA": 5459 /***/ (function(module, exports, __webpack_require__) { 5460 5461 "use strict"; 5462 5463 5464 var implementation = __webpack_require__("aI7X"); 5465 5466 module.exports = Function.prototype.bind || implementation; 5467 5468 5469 /***/ }), 5470 5471 /***/ "DHWS": 5472 /***/ (function(module, exports, __webpack_require__) { 5473 5474 "use strict"; 5475 5476 5477 Object.defineProperty(exports, "__esModule", { 5478 value: true 5479 }); 5480 5481 var _react = __webpack_require__("cDcd"); 5482 5483 var _react2 = _interopRequireDefault(_react); 5484 5485 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 5486 5487 var ChevronDown = function () { 5488 function ChevronDown(props) { 5489 return _react2['default'].createElement( 5490 'svg', 5491 props, 5492 _react2['default'].createElement('path', { 5493 d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z' 5494 }) 5495 ); 5496 } 5497 5498 return ChevronDown; 5499 }(); 5500 5501 ChevronDown.defaultProps = { 5502 viewBox: '0 0 1000 1000' 5503 }; 5504 exports['default'] = ChevronDown; 5505 5506 /***/ }), 5507 5508 /***/ "DciD": 5509 /***/ (function(module, exports, __webpack_require__) { 5510 5511 "use strict"; 5512 5513 5514 function noop() { 5515 return null; 5516 } 5517 5518 noop.isRequired = noop; 5519 5520 function noopThunk() { 5521 return noop; 5522 } 5523 5524 module.exports = { 5525 and: noopThunk, 5526 between: noopThunk, 5527 booleanSome: noopThunk, 5528 childrenHavePropXorChildren: noopThunk, 5529 childrenOf: noopThunk, 5530 childrenOfType: noopThunk, 5531 childrenSequenceOf: noopThunk, 5532 componentWithName: noopThunk, 5533 disallowedIf: noopThunk, 5534 elementType: noopThunk, 5535 empty: noopThunk, 5536 explicitNull: noopThunk, 5537 forbidExtraProps: Object, 5538 integer: noopThunk, 5539 keysOf: noopThunk, 5540 mutuallyExclusiveProps: noopThunk, 5541 mutuallyExclusiveTrueProps: noopThunk, 5542 nChildren: noopThunk, 5543 nonNegativeInteger: noop, 5544 nonNegativeNumber: noopThunk, 5545 numericString: noopThunk, 5546 object: noopThunk, 5547 or: noopThunk, 5548 predicate: noopThunk, 5549 range: noopThunk, 5550 ref: noopThunk, 5551 requiredBy: noopThunk, 5552 restrictedProp: noopThunk, 5553 sequenceOf: noopThunk, 5554 shape: noopThunk, 5555 stringEndsWith: noopThunk, 5556 stringStartsWith: noopThunk, 5557 uniqueArray: noopThunk, 5558 uniqueArrayOf: noopThunk, 5559 valuesOf: noopThunk, 5560 withShape: noopThunk 5561 }; 5562 5563 5564 /***/ }), 5565 5566 /***/ "DmXP": 5567 /***/ (function(module, exports, __webpack_require__) { 5568 5569 "use strict"; 5570 5571 5572 var getDay = Date.prototype.getDay; 5573 var tryDateObject = function tryDateGetDayCall(value) { 5574 try { 5575 getDay.call(value); 5576 return true; 5577 } catch (e) { 5578 return false; 5579 } 5580 }; 5581 5582 var toStr = Object.prototype.toString; 5583 var dateClass = '[object Date]'; 5584 var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; 5585 5586 module.exports = function isDateObject(value) { 5587 if (typeof value !== 'object' || value === null) { 5588 return false; 5589 } 5590 return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; 5591 }; 5592 5593 5594 /***/ }), 5595 5596 /***/ "DvWQ": 5597 /***/ (function(module, exports, __webpack_require__) { 5598 5599 "use strict"; 5600 5601 5602 var GetIntrinsic = __webpack_require__("rZ7t"); 5603 5604 var $TypeError = GetIntrinsic('%TypeError%'); 5605 5606 var DefineOwnProperty = __webpack_require__("wTIp"); 5607 5608 var FromPropertyDescriptor = __webpack_require__("zYbv"); 5609 var OrdinaryGetOwnProperty = __webpack_require__("kgBv"); 5610 var IsDataDescriptor = __webpack_require__("CGNl"); 5611 var IsExtensible = __webpack_require__("rDFq"); 5612 var IsPropertyKey = __webpack_require__("i10q"); 5613 var SameValue = __webpack_require__("HI8u"); 5614 var Type = __webpack_require__("V1cy"); 5615 5616 // https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty 5617 5618 module.exports = function CreateDataProperty(O, P, V) { 5619 if (Type(O) !== 'Object') { 5620 throw new $TypeError('Assertion failed: Type(O) is not Object'); 5621 } 5622 if (!IsPropertyKey(P)) { 5623 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); 5624 } 5625 var oldDesc = OrdinaryGetOwnProperty(O, P); 5626 var extensible = !oldDesc || IsExtensible(O); 5627 var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); 5628 if (immutable || !extensible) { 5629 return false; 5630 } 5631 return DefineOwnProperty( 5632 IsDataDescriptor, 5633 SameValue, 5634 FromPropertyDescriptor, 5635 O, 5636 P, 5637 { 5638 '[[Configurable]]': true, 5639 '[[Enumerable]]': true, 5640 '[[Value]]': V, 5641 '[[Writable]]': true 5642 } 5643 ); 5644 }; 5645 5646 5647 /***/ }), 5648 5649 /***/ "DzJC": 5650 /***/ (function(module, exports, __webpack_require__) { 5651 5652 var debounce = __webpack_require__("sEfC"), 5653 isObject = __webpack_require__("GoyQ"); 5654 5655 /** Error message constants. */ 5656 var FUNC_ERROR_TEXT = 'Expected a function'; 5657 5658 /** 5659 * Creates a throttled function that only invokes `func` at most once per 5660 * every `wait` milliseconds. The throttled function comes with a `cancel` 5661 * method to cancel delayed `func` invocations and a `flush` method to 5662 * immediately invoke them. Provide `options` to indicate whether `func` 5663 * should be invoked on the leading and/or trailing edge of the `wait` 5664 * timeout. The `func` is invoked with the last arguments provided to the 5665 * throttled function. Subsequent calls to the throttled function return the 5666 * result of the last `func` invocation. 5667 * 5668 * **Note:** If `leading` and `trailing` options are `true`, `func` is 5669 * invoked on the trailing edge of the timeout only if the throttled function 5670 * is invoked more than once during the `wait` timeout. 5671 * 5672 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 5673 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 5674 * 5675 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 5676 * for details over the differences between `_.throttle` and `_.debounce`. 5677 * 5678 * @static 5679 * @memberOf _ 5680 * @since 0.1.0 5681 * @category Function 5682 * @param {Function} func The function to throttle. 5683 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 5684 * @param {Object} [options={}] The options object. 5685 * @param {boolean} [options.leading=true] 5686 * Specify invoking on the leading edge of the timeout. 5687 * @param {boolean} [options.trailing=true] 5688 * Specify invoking on the trailing edge of the timeout. 5689 * @returns {Function} Returns the new throttled function. 5690 * @example 5691 * 5692 * // Avoid excessively updating the position while scrolling. 5693 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 5694 * 5695 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 5696 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 5697 * jQuery(element).on('click', throttled); 5698 * 5699 * // Cancel the trailing throttled invocation. 5700 * jQuery(window).on('popstate', throttled.cancel); 5701 */ 5702 function throttle(func, wait, options) { 5703 var leading = true, 5704 trailing = true; 5705 5706 if (typeof func != 'function') { 5707 throw new TypeError(FUNC_ERROR_TEXT); 5708 } 5709 if (isObject(options)) { 5710 leading = 'leading' in options ? !!options.leading : leading; 5711 trailing = 'trailing' in options ? !!options.trailing : trailing; 5712 } 5713 return debounce(func, wait, { 5714 'leading': leading, 5715 'maxWait': wait, 5716 'trailing': trailing 5717 }); 5718 } 5719 5720 module.exports = throttle; 5721 5722 5723 /***/ }), 5724 5725 /***/ "EXo9": 5726 /***/ (function(module, exports, __webpack_require__) { 5727 5728 "use strict"; 5729 5730 5731 var GetIntrinsic = __webpack_require__("rZ7t"); 5732 5733 var callBind = __webpack_require__("hZ2/"); 5734 5735 var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 5736 5737 module.exports = function callBoundIntrinsic(name, allowMissing) { 5738 var intrinsic = GetIntrinsic(name, !!allowMissing); 5739 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 5740 return callBind(intrinsic); 5741 } 5742 return intrinsic; 5743 }; 5744 5745 5746 /***/ }), 5747 5748 /***/ "ExA7": 5749 /***/ (function(module, exports) { 5750 5751 /** 5752 * Checks if `value` is object-like. A value is object-like if it's not `null` 5753 * and has a `typeof` result of "object". 5754 * 5755 * @static 5756 * @memberOf _ 5757 * @since 4.0.0 5758 * @category Lang 5759 * @param {*} value The value to check. 5760 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 5761 * @example 5762 * 5763 * _.isObjectLike({}); 5764 * // => true 5765 * 5766 * _.isObjectLike([1, 2, 3]); 5767 * // => true 5768 * 5769 * _.isObjectLike(_.noop); 5770 * // => false 5771 * 5772 * _.isObjectLike(null); 5773 * // => false 5774 */ 5775 function isObjectLike(value) { 5776 return value != null && typeof value == 'object'; 5777 } 5778 5779 module.exports = isObjectLike; 5780 5781 5782 /***/ }), 5783 5784 /***/ "F7ZS": 5785 /***/ (function(module, exports, __webpack_require__) { 5786 5787 "use strict"; 5788 5789 5790 Object.defineProperty(exports, "__esModule", { 5791 value: true 5792 }); 5793 exports['default'] = getCalendarMonthWeeks; 5794 5795 var _moment = __webpack_require__("wy2R"); 5796 5797 var _moment2 = _interopRequireDefault(_moment); 5798 5799 var _constants = __webpack_require__("Fv1B"); 5800 5801 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 5802 5803 function getCalendarMonthWeeks(month, enableOutsideDays) { 5804 var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek(); 5805 5806 if (!_moment2['default'].isMoment(month) || !month.isValid()) { 5807 throw new TypeError('`month` must be a valid moment object'); 5808 } 5809 if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) { 5810 throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6'); 5811 } 5812 5813 // set utc offset to get correct dates in future (when timezone changes) 5814 var firstOfMonth = month.clone().startOf('month').hour(12); 5815 var lastOfMonth = month.clone().endOf('month').hour(12); 5816 5817 // calculate the exact first and last days to fill the entire matrix 5818 // (considering days outside month) 5819 var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7; 5820 var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7; 5821 var firstDay = firstOfMonth.clone().subtract(prevDays, 'day'); 5822 var lastDay = lastOfMonth.clone().add(nextDays, 'day'); 5823 5824 var totalDays = lastDay.diff(firstDay, 'days') + 1; 5825 5826 var currentDay = firstDay.clone(); 5827 var weeksInMonth = []; 5828 5829 for (var i = 0; i < totalDays; i += 1) { 5830 if (i % 7 === 0) { 5831 weeksInMonth.push([]); 5832 } 5833 5834 var day = null; 5835 if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) { 5836 day = currentDay.clone(); 5837 } 5838 5839 weeksInMonth[weeksInMonth.length - 1].push(day); 5840 5841 currentDay.add(1, 'day'); 5842 } 5843 5844 return weeksInMonth; 5845 } 5846 5847 /***/ }), 5848 5849 /***/ "FpZJ": 5850 /***/ (function(module, exports, __webpack_require__) { 5851 5852 "use strict"; 5853 5854 5855 /* eslint complexity: [2, 18], max-statements: [2, 33] */ 5856 module.exports = function hasSymbols() { 5857 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 5858 if (typeof Symbol.iterator === 'symbol') { return true; } 5859 5860 var obj = {}; 5861 var sym = Symbol('test'); 5862 var symObj = Object(sym); 5863 if (typeof sym === 'string') { return false; } 5864 5865 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 5866 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 5867 5868 // temp disabled per https://github.com/ljharb/object.assign/issues/17 5869 // if (sym instanceof Symbol) { return false; } 5870 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 5871 // if (!(symObj instanceof Symbol)) { return false; } 5872 5873 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 5874 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 5875 5876 var symVal = 42; 5877 obj[sym] = symVal; 5878 for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax 5879 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 5880 5881 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 5882 5883 var syms = Object.getOwnPropertySymbols(obj); 5884 if (syms.length !== 1 || syms[0] !== sym) { return false; } 5885 5886 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 5887 5888 if (typeof Object.getOwnPropertyDescriptor === 'function') { 5889 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 5890 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 5891 } 5892 5893 return true; 5894 }; 5895 5896 5897 /***/ }), 5898 5899 /***/ "FqII": 5900 /***/ (function(module, exports) { 5901 5902 (function() { module.exports = window["wp"]["date"]; }()); 5903 5904 /***/ }), 5905 5906 /***/ "FufO": 5907 /***/ (function(module, exports, __webpack_require__) { 5908 5909 "use strict"; 5910 5911 5912 // modified from https://github.com/es-shims/es6-shim 5913 var keys = __webpack_require__("1seS"); 5914 var canBeObject = function (obj) { 5915 return typeof obj !== 'undefined' && obj !== null; 5916 }; 5917 var hasSymbols = __webpack_require__("FpZJ")(); 5918 var callBound = __webpack_require__("VF6F"); 5919 var toObject = Object; 5920 var $push = callBound('Array.prototype.push'); 5921 var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 5922 var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; 5923 5924 // eslint-disable-next-line no-unused-vars 5925 module.exports = function assign(target, source1) { 5926 if (!canBeObject(target)) { throw new TypeError('target must be an object'); } 5927 var objTarget = toObject(target); 5928 var s, source, i, props, syms, value, key; 5929 for (s = 1; s < arguments.length; ++s) { 5930 source = toObject(arguments[s]); 5931 props = keys(source); 5932 var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); 5933 if (getSymbols) { 5934 syms = getSymbols(source); 5935 for (i = 0; i < syms.length; ++i) { 5936 key = syms[i]; 5937 if ($propIsEnumerable(source, key)) { 5938 $push(props, key); 5939 } 5940 } 5941 } 5942 for (i = 0; i < props.length; ++i) { 5943 key = props[i]; 5944 value = source[key]; 5945 if ($propIsEnumerable(source, key)) { 5946 objTarget[key] = value; 5947 } 5948 } 5949 } 5950 return objTarget; 5951 }; 5952 5953 5954 /***/ }), 5955 5956 /***/ "Fv1B": 5957 /***/ (function(module, exports, __webpack_require__) { 5958 5959 "use strict"; 5960 5961 5962 Object.defineProperty(exports, "__esModule", { 5963 value: true 5964 }); 5965 var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L'; 5966 var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD'; 5967 var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM'; 5968 5969 var START_DATE = exports.START_DATE = 'startDate'; 5970 var END_DATE = exports.END_DATE = 'endDate'; 5971 5972 var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal'; 5973 var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical'; 5974 var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable'; 5975 5976 var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before'; 5977 var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after'; 5978 5979 var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top'; 5980 var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom'; 5981 var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before'; 5982 var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after'; 5983 5984 var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left'; 5985 var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right'; 5986 5987 var OPEN_DOWN = exports.OPEN_DOWN = 'down'; 5988 var OPEN_UP = exports.OPEN_UP = 'up'; 5989 5990 var DAY_SIZE = exports.DAY_SIZE = 39; 5991 var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked'; 5992 var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6]; 5993 5994 var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20; 5995 var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10; 5996 var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22; 5997 5998 var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']); 5999 6000 /***/ }), 6001 6002 /***/ "G3V0": 6003 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6004 6005 "use strict"; 6006 /* unused harmony export Tabbable */ 6007 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useTabbable; }); 6008 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5"); 6009 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48"); 6010 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes"); 6011 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd"); 6012 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); 6013 /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aU41"); 6014 /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("71Og"); 6015 /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("KA1K"); 6016 /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("eNtd"); 6017 /* harmony import */ var reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("AXvK"); 6018 /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("PcHe"); 6019 /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("Vq1w"); 6020 /* harmony import */ var reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("reMF"); 6021 /* harmony import */ var reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("kqkJ"); 6022 /* harmony import */ var _Role_Role_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("zGFp"); 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 // Automatically generated 6040 var TABBABLE_KEYS = ["disabled", "focusable"]; 6041 6042 var isSafariOrFirefoxOnMac = Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Mac") && !Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Chrome") && (Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Safari") || Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Firefox")); 6043 6044 function focusIfNeeded(element) { 6045 if (!Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__[/* hasFocusWithin */ "a"])(element) && Object(reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_12__[/* isFocusable */ "a"])(element)) { 6046 element.focus(); 6047 } 6048 } 6049 6050 function isNativeTabbable(element) { 6051 return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA" || element.tagName === "A"; 6052 } 6053 6054 function supportsDisabledAttribute(element) { 6055 return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA"; 6056 } 6057 6058 function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) { 6059 if (trulyDisabled) { 6060 if (nativeTabbable && !supportsDisabled) { 6061 // Anchor, audio and video tags don't support the `disabled` attribute. 6062 // We must pass tabIndex={-1} so they don't receive focus on tab. 6063 return -1; 6064 } // Elements that support the `disabled` attribute don't need tabIndex. 6065 6066 6067 return undefined; 6068 } 6069 6070 if (nativeTabbable) { 6071 // If the element is enabled and it's natively tabbable, we don't need to 6072 // specify a tabIndex attribute unless it's explicitly set by the user. 6073 return htmlTabIndex; 6074 } // If the element is enabled and is not natively tabbable, we have to 6075 // fallback tabIndex={0}. 6076 6077 6078 return htmlTabIndex || 0; 6079 } 6080 6081 function useDisableEvent(htmlEventRef, disabled) { 6082 return Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 6083 var _htmlEventRef$current; 6084 6085 (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event); 6086 if (event.defaultPrevented) return; 6087 6088 if (disabled) { 6089 event.stopPropagation(); 6090 event.preventDefault(); 6091 } 6092 }, [htmlEventRef, disabled]); 6093 } 6094 6095 var useTabbable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 6096 name: "Tabbable", 6097 compose: _Role_Role_js__WEBPACK_IMPORTED_MODULE_13__[/* useRole */ "a"], 6098 keys: TABBABLE_KEYS, 6099 useOptions: function useOptions(options, _ref) { 6100 var disabled = _ref.disabled; 6101 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 6102 disabled: disabled 6103 }, options); 6104 }, 6105 useProps: function useProps(options, _ref2) { 6106 var htmlRef = _ref2.ref, 6107 htmlTabIndex = _ref2.tabIndex, 6108 htmlOnClickCapture = _ref2.onClickCapture, 6109 htmlOnMouseDownCapture = _ref2.onMouseDownCapture, 6110 htmlOnMouseDown = _ref2.onMouseDown, 6111 htmlOnKeyPressCapture = _ref2.onKeyPressCapture, 6112 htmlStyle = _ref2.style, 6113 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]); 6114 6115 var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null); 6116 var onClickCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnClickCapture); 6117 var onMouseDownCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDownCapture); 6118 var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDown); 6119 var onKeyPressCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnKeyPressCapture); 6120 var trulyDisabled = !!options.disabled && !options.focusable; 6121 6122 var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true), 6123 nativeTabbable = _React$useState[0], 6124 setNativeTabbable = _React$useState[1]; 6125 6126 var _React$useState2 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true), 6127 supportsDisabled = _React$useState2[0], 6128 setSupportsDisabled = _React$useState2[1]; 6129 6130 var style = options.disabled ? Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 6131 pointerEvents: "none" 6132 }, htmlStyle) : htmlStyle; 6133 Object(reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__[/* useIsomorphicEffect */ "a"])(function () { 6134 var tabbable = ref.current; 6135 6136 if (!tabbable) { 6137 false ? undefined : void 0; 6138 return; 6139 } 6140 6141 if (!isNativeTabbable(tabbable)) { 6142 setNativeTabbable(false); 6143 } 6144 6145 if (!supportsDisabledAttribute(tabbable)) { 6146 setSupportsDisabled(false); 6147 } 6148 }, []); 6149 var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled); 6150 var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled); 6151 var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled); 6152 var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 6153 var _onMouseDownRef$curre; 6154 6155 (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); 6156 var element = event.currentTarget; 6157 if (event.defaultPrevented) return; // Safari and Firefox on MacOS don't focus on buttons on mouse down 6158 // like other browsers/platforms. Instead, they focus on the closest 6159 // focusable ancestor element, which is ultimately the body element. So 6160 // we make sure to give focus to the tabbable element on mouse down so 6161 // it works consistently across browsers. 6162 6163 if (!isSafariOrFirefoxOnMac) return; 6164 if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__[/* isPortalEvent */ "a"])(event)) return; 6165 if (!Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__[/* isButton */ "a"])(element)) return; // We can't focus right away after on mouse down, otherwise it would 6166 // prevent drag events from happening. So we schedule the focus to the 6167 // next animation frame. 6168 6169 var raf = requestAnimationFrame(function () { 6170 element.removeEventListener("mouseup", focusImmediately, true); 6171 focusIfNeeded(element); 6172 }); // If mouseUp happens before the next animation frame (which is common 6173 // on touch screens or by just tapping the trackpad on MacBook's), we 6174 // cancel the animation frame and immediately focus on the element. 6175 6176 var focusImmediately = function focusImmediately() { 6177 cancelAnimationFrame(raf); 6178 focusIfNeeded(element); 6179 }; // By listening to the event in the capture phase, we make sure the 6180 // focus event is fired before the onMouseUp and onMouseUpCapture React 6181 // events, which is aligned with the default browser behavior. 6182 6183 6184 element.addEventListener("mouseup", focusImmediately, { 6185 once: true, 6186 capture: true 6187 }); 6188 }, []); 6189 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 6190 ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef), 6191 style: style, 6192 tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex), 6193 disabled: trulyDisabled && supportsDisabled ? true : undefined, 6194 "aria-disabled": options.disabled ? true : undefined, 6195 onClickCapture: onClickCapture, 6196 onMouseDownCapture: onMouseDownCapture, 6197 onMouseDown: onMouseDown, 6198 onKeyPressCapture: onKeyPressCapture 6199 }, htmlProps); 6200 } 6201 }); 6202 var Tabbable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 6203 as: "div", 6204 useHook: useTabbable 6205 }); 6206 6207 6208 6209 6210 /***/ }), 6211 6212 /***/ "GET3": 6213 /***/ (function(module, exports, __webpack_require__) { 6214 6215 "use strict"; 6216 6217 6218 Object.defineProperty(exports, "__esModule", { 6219 value: true 6220 }); 6221 exports.PureCustomizableCalendarDay = exports.selectedStyles = exports.lastInRangeStyles = exports.selectedSpanStyles = exports.hoveredSpanStyles = exports.blockedOutOfRangeStyles = exports.blockedCalendarStyles = exports.blockedMinNightsStyles = exports.highlightedCalendarStyles = exports.outsideStyles = exports.defaultStyles = undefined; 6222 6223 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; }; 6224 6225 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; }; }(); 6226 6227 var _object = __webpack_require__("Koq/"); 6228 6229 var _object2 = _interopRequireDefault(_object); 6230 6231 var _react = __webpack_require__("cDcd"); 6232 6233 var _react2 = _interopRequireDefault(_react); 6234 6235 var _propTypes = __webpack_require__("17x9"); 6236 6237 var _propTypes2 = _interopRequireDefault(_propTypes); 6238 6239 var _reactAddonsShallowCompare = __webpack_require__("YZDV"); 6240 6241 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 6242 6243 var _reactMomentProptypes = __webpack_require__("XGBb"); 6244 6245 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 6246 6247 var _airbnbPropTypes = __webpack_require__("Hsqg"); 6248 6249 var _reactWithStyles = __webpack_require__("TG4+"); 6250 6251 var _moment = __webpack_require__("wy2R"); 6252 6253 var _moment2 = _interopRequireDefault(_moment); 6254 6255 var _defaultPhrases = __webpack_require__("vV+G"); 6256 6257 var _getPhrasePropTypes = __webpack_require__("yc2e"); 6258 6259 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 6260 6261 var _getCalendarDaySettings = __webpack_require__("Ae65"); 6262 6263 var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings); 6264 6265 var _constants = __webpack_require__("Fv1B"); 6266 6267 var _DefaultTheme = __webpack_require__("xOhs"); 6268 6269 var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme); 6270 6271 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6272 6273 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6274 6275 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; } 6276 6277 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; } 6278 6279 var color = _DefaultTheme2['default'].reactDates.color; 6280 6281 6282 function getStyles(stylesObj, isHovered) { 6283 if (!stylesObj) return null; 6284 6285 var hover = stylesObj.hover; 6286 6287 if (isHovered && hover) { 6288 return hover; 6289 } 6290 6291 return stylesObj; 6292 } 6293 6294 var DayStyleShape = _propTypes2['default'].shape({ 6295 background: _propTypes2['default'].string, 6296 border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]), 6297 color: _propTypes2['default'].string, 6298 6299 hover: _propTypes2['default'].shape({ 6300 background: _propTypes2['default'].string, 6301 border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]), 6302 color: _propTypes2['default'].string 6303 }) 6304 }); 6305 6306 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 6307 day: _reactMomentProptypes2['default'].momentObj, 6308 daySize: _airbnbPropTypes.nonNegativeInteger, 6309 isOutsideDay: _propTypes2['default'].bool, 6310 modifiers: _propTypes2['default'].instanceOf(Set), 6311 isFocused: _propTypes2['default'].bool, 6312 tabIndex: _propTypes2['default'].oneOf([0, -1]), 6313 onDayClick: _propTypes2['default'].func, 6314 onDayMouseEnter: _propTypes2['default'].func, 6315 onDayMouseLeave: _propTypes2['default'].func, 6316 renderDayContents: _propTypes2['default'].func, 6317 ariaLabelFormat: _propTypes2['default'].string, 6318 6319 // style overrides 6320 defaultStyles: DayStyleShape, 6321 outsideStyles: DayStyleShape, 6322 todayStyles: DayStyleShape, 6323 firstDayOfWeekStyles: DayStyleShape, 6324 lastDayOfWeekStyles: DayStyleShape, 6325 highlightedCalendarStyles: DayStyleShape, 6326 blockedMinNightsStyles: DayStyleShape, 6327 blockedCalendarStyles: DayStyleShape, 6328 blockedOutOfRangeStyles: DayStyleShape, 6329 hoveredSpanStyles: DayStyleShape, 6330 selectedSpanStyles: DayStyleShape, 6331 lastInRangeStyles: DayStyleShape, 6332 selectedStyles: DayStyleShape, 6333 selectedStartStyles: DayStyleShape, 6334 selectedEndStyles: DayStyleShape, 6335 afterHoveredStartStyles: DayStyleShape, 6336 6337 // internationalization 6338 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)) 6339 })); 6340 6341 var defaultStyles = exports.defaultStyles = { 6342 border: '1px solid ' + String(color.core.borderLight), 6343 color: color.text, 6344 background: color.background, 6345 6346 hover: { 6347 background: color.core.borderLight, 6348 border: '1px double ' + String(color.core.borderLight), 6349 color: 'inherit' 6350 } 6351 }; 6352 6353 var outsideStyles = exports.outsideStyles = { 6354 background: color.outside.backgroundColor, 6355 border: 0, 6356 color: color.outside.color 6357 }; 6358 6359 var highlightedCalendarStyles = exports.highlightedCalendarStyles = { 6360 background: color.highlighted.backgroundColor, 6361 color: color.highlighted.color, 6362 6363 hover: { 6364 background: color.highlighted.backgroundColor_hover, 6365 color: color.highlighted.color_active 6366 } 6367 }; 6368 6369 var blockedMinNightsStyles = exports.blockedMinNightsStyles = { 6370 background: color.minimumNights.backgroundColor, 6371 border: '1px solid ' + String(color.minimumNights.borderColor), 6372 color: color.minimumNights.color, 6373 6374 hover: { 6375 background: color.minimumNights.backgroundColor_hover, 6376 color: color.minimumNights.color_active 6377 } 6378 }; 6379 6380 var blockedCalendarStyles = exports.blockedCalendarStyles = { 6381 background: color.blocked_calendar.backgroundColor, 6382 border: '1px solid ' + String(color.blocked_calendar.borderColor), 6383 color: color.blocked_calendar.color, 6384 6385 hover: { 6386 background: color.blocked_calendar.backgroundColor_hover, 6387 border: '1px solid ' + String(color.blocked_calendar.borderColor), 6388 color: color.blocked_calendar.color_active 6389 } 6390 }; 6391 6392 var blockedOutOfRangeStyles = exports.blockedOutOfRangeStyles = { 6393 background: color.blocked_out_of_range.backgroundColor, 6394 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 6395 color: color.blocked_out_of_range.color, 6396 6397 hover: { 6398 background: color.blocked_out_of_range.backgroundColor_hover, 6399 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 6400 color: color.blocked_out_of_range.color_active 6401 } 6402 }; 6403 6404 var hoveredSpanStyles = exports.hoveredSpanStyles = { 6405 background: color.hoveredSpan.backgroundColor, 6406 border: '1px solid ' + String(color.hoveredSpan.borderColor), 6407 color: color.hoveredSpan.color, 6408 6409 hover: { 6410 background: color.hoveredSpan.backgroundColor_hover, 6411 border: '1px solid ' + String(color.hoveredSpan.borderColor), 6412 color: color.hoveredSpan.color_active 6413 } 6414 }; 6415 6416 var selectedSpanStyles = exports.selectedSpanStyles = { 6417 background: color.selectedSpan.backgroundColor, 6418 border: '1px solid ' + String(color.selectedSpan.borderColor), 6419 color: color.selectedSpan.color, 6420 6421 hover: { 6422 background: color.selectedSpan.backgroundColor_hover, 6423 border: '1px solid ' + String(color.selectedSpan.borderColor), 6424 color: color.selectedSpan.color_active 6425 } 6426 }; 6427 6428 var lastInRangeStyles = exports.lastInRangeStyles = { 6429 borderRight: color.core.primary 6430 }; 6431 6432 var selectedStyles = exports.selectedStyles = { 6433 background: color.selected.backgroundColor, 6434 border: '1px solid ' + String(color.selected.borderColor), 6435 color: color.selected.color, 6436 6437 hover: { 6438 background: color.selected.backgroundColor_hover, 6439 border: '1px solid ' + String(color.selected.borderColor), 6440 color: color.selected.color_active 6441 } 6442 }; 6443 6444 var defaultProps = { 6445 day: (0, _moment2['default'])(), 6446 daySize: _constants.DAY_SIZE, 6447 isOutsideDay: false, 6448 modifiers: new Set(), 6449 isFocused: false, 6450 tabIndex: -1, 6451 onDayClick: function () { 6452 function onDayClick() {} 6453 6454 return onDayClick; 6455 }(), 6456 onDayMouseEnter: function () { 6457 function onDayMouseEnter() {} 6458 6459 return onDayMouseEnter; 6460 }(), 6461 onDayMouseLeave: function () { 6462 function onDayMouseLeave() {} 6463 6464 return onDayMouseLeave; 6465 }(), 6466 6467 renderDayContents: null, 6468 ariaLabelFormat: 'dddd, LL', 6469 6470 // style defaults 6471 defaultStyles: defaultStyles, 6472 outsideStyles: outsideStyles, 6473 todayStyles: {}, 6474 highlightedCalendarStyles: highlightedCalendarStyles, 6475 blockedMinNightsStyles: blockedMinNightsStyles, 6476 blockedCalendarStyles: blockedCalendarStyles, 6477 blockedOutOfRangeStyles: blockedOutOfRangeStyles, 6478 hoveredSpanStyles: hoveredSpanStyles, 6479 selectedSpanStyles: selectedSpanStyles, 6480 lastInRangeStyles: lastInRangeStyles, 6481 selectedStyles: selectedStyles, 6482 selectedStartStyles: {}, 6483 selectedEndStyles: {}, 6484 afterHoveredStartStyles: {}, 6485 firstDayOfWeekStyles: {}, 6486 lastDayOfWeekStyles: {}, 6487 6488 // internationalization 6489 phrases: _defaultPhrases.CalendarDayPhrases 6490 }; 6491 6492 var CustomizableCalendarDay = function (_React$Component) { 6493 _inherits(CustomizableCalendarDay, _React$Component); 6494 6495 function CustomizableCalendarDay() { 6496 var _ref; 6497 6498 _classCallCheck(this, CustomizableCalendarDay); 6499 6500 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 6501 args[_key] = arguments[_key]; 6502 } 6503 6504 var _this = _possibleConstructorReturn(this, (_ref = CustomizableCalendarDay.__proto__ || Object.getPrototypeOf(CustomizableCalendarDay)).call.apply(_ref, [this].concat(args))); 6505 6506 _this.state = { 6507 isHovered: false 6508 }; 6509 6510 _this.setButtonRef = _this.setButtonRef.bind(_this); 6511 return _this; 6512 } 6513 6514 _createClass(CustomizableCalendarDay, [{ 6515 key: 'shouldComponentUpdate', 6516 value: function () { 6517 function shouldComponentUpdate(nextProps, nextState) { 6518 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 6519 } 6520 6521 return shouldComponentUpdate; 6522 }() 6523 }, { 6524 key: 'componentDidUpdate', 6525 value: function () { 6526 function componentDidUpdate(prevProps) { 6527 var _props = this.props, 6528 isFocused = _props.isFocused, 6529 tabIndex = _props.tabIndex; 6530 6531 if (tabIndex === 0) { 6532 if (isFocused || tabIndex !== prevProps.tabIndex) { 6533 this.buttonRef.focus(); 6534 } 6535 } 6536 } 6537 6538 return componentDidUpdate; 6539 }() 6540 }, { 6541 key: 'onDayClick', 6542 value: function () { 6543 function onDayClick(day, e) { 6544 var onDayClick = this.props.onDayClick; 6545 6546 onDayClick(day, e); 6547 } 6548 6549 return onDayClick; 6550 }() 6551 }, { 6552 key: 'onDayMouseEnter', 6553 value: function () { 6554 function onDayMouseEnter(day, e) { 6555 var onDayMouseEnter = this.props.onDayMouseEnter; 6556 6557 this.setState({ isHovered: true }); 6558 onDayMouseEnter(day, e); 6559 } 6560 6561 return onDayMouseEnter; 6562 }() 6563 }, { 6564 key: 'onDayMouseLeave', 6565 value: function () { 6566 function onDayMouseLeave(day, e) { 6567 var onDayMouseLeave = this.props.onDayMouseLeave; 6568 6569 this.setState({ isHovered: false }); 6570 onDayMouseLeave(day, e); 6571 } 6572 6573 return onDayMouseLeave; 6574 }() 6575 }, { 6576 key: 'onKeyDown', 6577 value: function () { 6578 function onKeyDown(day, e) { 6579 var onDayClick = this.props.onDayClick; 6580 var key = e.key; 6581 6582 if (key === 'Enter' || key === ' ') { 6583 onDayClick(day, e); 6584 } 6585 } 6586 6587 return onKeyDown; 6588 }() 6589 }, { 6590 key: 'setButtonRef', 6591 value: function () { 6592 function setButtonRef(ref) { 6593 this.buttonRef = ref; 6594 } 6595 6596 return setButtonRef; 6597 }() 6598 }, { 6599 key: 'render', 6600 value: function () { 6601 function render() { 6602 var _this2 = this; 6603 6604 var _props2 = this.props, 6605 day = _props2.day, 6606 ariaLabelFormat = _props2.ariaLabelFormat, 6607 daySize = _props2.daySize, 6608 isOutsideDay = _props2.isOutsideDay, 6609 modifiers = _props2.modifiers, 6610 tabIndex = _props2.tabIndex, 6611 renderDayContents = _props2.renderDayContents, 6612 styles = _props2.styles, 6613 phrases = _props2.phrases, 6614 defaultStylesWithHover = _props2.defaultStyles, 6615 outsideStylesWithHover = _props2.outsideStyles, 6616 todayStylesWithHover = _props2.todayStyles, 6617 firstDayOfWeekStylesWithHover = _props2.firstDayOfWeekStyles, 6618 lastDayOfWeekStylesWithHover = _props2.lastDayOfWeekStyles, 6619 highlightedCalendarStylesWithHover = _props2.highlightedCalendarStyles, 6620 blockedMinNightsStylesWithHover = _props2.blockedMinNightsStyles, 6621 blockedCalendarStylesWithHover = _props2.blockedCalendarStyles, 6622 blockedOutOfRangeStylesWithHover = _props2.blockedOutOfRangeStyles, 6623 hoveredSpanStylesWithHover = _props2.hoveredSpanStyles, 6624 selectedSpanStylesWithHover = _props2.selectedSpanStyles, 6625 lastInRangeStylesWithHover = _props2.lastInRangeStyles, 6626 selectedStylesWithHover = _props2.selectedStyles, 6627 selectedStartStylesWithHover = _props2.selectedStartStyles, 6628 selectedEndStylesWithHover = _props2.selectedEndStyles, 6629 afterHoveredStartStylesWithHover = _props2.afterHoveredStartStyles; 6630 var isHovered = this.state.isHovered; 6631 6632 6633 if (!day) return _react2['default'].createElement('td', null); 6634 6635 var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases), 6636 daySizeStyles = _getCalendarDaySettin.daySizeStyles, 6637 useDefaultCursor = _getCalendarDaySettin.useDefaultCursor, 6638 selected = _getCalendarDaySettin.selected, 6639 hoveredSpan = _getCalendarDaySettin.hoveredSpan, 6640 isOutsideRange = _getCalendarDaySettin.isOutsideRange, 6641 ariaLabel = _getCalendarDaySettin.ariaLabel; 6642 6643 return _react2['default'].createElement( 6644 'td', 6645 _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, daySizeStyles, getStyles(defaultStylesWithHover, isHovered), isOutsideDay && getStyles(outsideStylesWithHover, isHovered), modifiers.has('today') && getStyles(todayStylesWithHover, isHovered), modifiers.has('first-day-of-week') && getStyles(firstDayOfWeekStylesWithHover, isHovered), modifiers.has('last-day-of-week') && getStyles(lastDayOfWeekStylesWithHover, isHovered), modifiers.has('highlighted-calendar') && getStyles(highlightedCalendarStylesWithHover, isHovered), modifiers.has('blocked-minimum-nights') && getStyles(blockedMinNightsStylesWithHover, isHovered), modifiers.has('blocked-calendar') && getStyles(blockedCalendarStylesWithHover, isHovered), hoveredSpan && getStyles(hoveredSpanStylesWithHover, isHovered), modifiers.has('after-hovered-start') && getStyles(afterHoveredStartStylesWithHover, isHovered), modifiers.has('selected-span') && getStyles(selectedSpanStylesWithHover, isHovered), modifiers.has('last-in-range') && getStyles(lastInRangeStylesWithHover, isHovered), selected && getStyles(selectedStylesWithHover, isHovered), modifiers.has('selected-start') && getStyles(selectedStartStylesWithHover, isHovered), modifiers.has('selected-end') && getStyles(selectedEndStylesWithHover, isHovered), isOutsideRange && getStyles(blockedOutOfRangeStylesWithHover, isHovered)), { 6646 role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role 6647 , ref: this.setButtonRef, 6648 'aria-label': ariaLabel, 6649 onMouseEnter: function () { 6650 function onMouseEnter(e) { 6651 _this2.onDayMouseEnter(day, e); 6652 } 6653 6654 return onMouseEnter; 6655 }(), 6656 onMouseLeave: function () { 6657 function onMouseLeave(e) { 6658 _this2.onDayMouseLeave(day, e); 6659 } 6660 6661 return onMouseLeave; 6662 }(), 6663 onMouseUp: function () { 6664 function onMouseUp(e) { 6665 e.currentTarget.blur(); 6666 } 6667 6668 return onMouseUp; 6669 }(), 6670 onClick: function () { 6671 function onClick(e) { 6672 _this2.onDayClick(day, e); 6673 } 6674 6675 return onClick; 6676 }(), 6677 onKeyDown: function () { 6678 function onKeyDown(e) { 6679 _this2.onKeyDown(day, e); 6680 } 6681 6682 return onKeyDown; 6683 }(), 6684 tabIndex: tabIndex 6685 }), 6686 renderDayContents ? renderDayContents(day, modifiers) : day.format('D') 6687 ); 6688 } 6689 6690 return render; 6691 }() 6692 }]); 6693 6694 return CustomizableCalendarDay; 6695 }(_react2['default'].Component); 6696 6697 CustomizableCalendarDay.propTypes = propTypes; 6698 CustomizableCalendarDay.defaultProps = defaultProps; 6699 6700 exports.PureCustomizableCalendarDay = CustomizableCalendarDay; 6701 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) { 6702 var font = _ref2.reactDates.font; 6703 return { 6704 CalendarDay: { 6705 boxSizing: 'border-box', 6706 cursor: 'pointer', 6707 fontSize: font.size, 6708 textAlign: 'center', 6709 6710 ':active': { 6711 outline: 0 6712 } 6713 }, 6714 6715 CalendarDay__defaultCursor: { 6716 cursor: 'default' 6717 } 6718 }; 6719 })(CustomizableCalendarDay); 6720 6721 /***/ }), 6722 6723 /***/ "GG7f": 6724 /***/ (function(module, exports, __webpack_require__) { 6725 6726 // eslint-disable-next-line import/no-unresolved 6727 __webpack_require__("H24B"); 6728 6729 6730 /***/ }), 6731 6732 /***/ "GK4x": 6733 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6734 6735 "use strict"; 6736 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 6737 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 6738 /** 6739 * WordPress dependencies 6740 */ 6741 6742 const ToolbarContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(); 6743 /* harmony default export */ __webpack_exports__["a"] = (ToolbarContext); 6744 6745 6746 /***/ }), 6747 6748 /***/ "GRId": 6749 /***/ (function(module, exports) { 6750 6751 (function() { module.exports = window["wp"]["element"]; }()); 6752 6753 /***/ }), 6754 6755 /***/ "Gn0q": 6756 /***/ (function(module, exports, __webpack_require__) { 6757 6758 "use strict"; 6759 6760 6761 var define = __webpack_require__("82c2"); 6762 var getPolyfill = __webpack_require__("5yQQ"); 6763 6764 module.exports = function shimContains() { 6765 var polyfill = getPolyfill(); 6766 if (typeof document !== 'undefined') { 6767 define( 6768 document, 6769 { contains: polyfill }, 6770 { contains: function () { return document.contains !== polyfill; } } 6771 ); 6772 if (typeof Element !== 'undefined') { 6773 define( 6774 Element.prototype, 6775 { contains: polyfill }, 6776 { contains: function () { return Element.prototype.contains !== polyfill; } } 6777 ); 6778 } 6779 } 6780 return polyfill; 6781 }; 6782 6783 6784 /***/ }), 6785 6786 /***/ "GoyQ": 6787 /***/ (function(module, exports) { 6788 6789 /** 6790 * Checks if `value` is the 6791 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 6792 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 6793 * 6794 * @static 6795 * @memberOf _ 6796 * @since 0.1.0 6797 * @category Lang 6798 * @param {*} value The value to check. 6799 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 6800 * @example 6801 * 6802 * _.isObject({}); 6803 * // => true 6804 * 6805 * _.isObject([1, 2, 3]); 6806 * // => true 6807 * 6808 * _.isObject(_.noop); 6809 * // => true 6810 * 6811 * _.isObject(null); 6812 * // => false 6813 */ 6814 function isObject(value) { 6815 var type = typeof value; 6816 return value != null && (type == 'object' || type == 'function'); 6817 } 6818 6819 module.exports = isObject; 6820 6821 6822 /***/ }), 6823 6824 /***/ "H24B": 6825 /***/ (function(module, exports, __webpack_require__) { 6826 6827 "use strict"; 6828 6829 6830 var _registerCSSInterfaceWithDefaultTheme = __webpack_require__("TUyu"); 6831 6832 var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme); 6833 6834 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6835 6836 (0, _registerCSSInterfaceWithDefaultTheme2['default'])(); 6837 6838 /***/ }), 6839 6840 /***/ "HI8u": 6841 /***/ (function(module, exports, __webpack_require__) { 6842 6843 "use strict"; 6844 6845 6846 var $isNaN = __webpack_require__("HwJD"); 6847 6848 // http://262.ecma-international.org/5.1/#sec-9.12 6849 6850 module.exports = function SameValue(x, y) { 6851 if (x === y) { // 0 === -0, but they are not identical. 6852 if (x === 0) { return 1 / x === 1 / y; } 6853 return true; 6854 } 6855 return $isNaN(x) && $isNaN(y); 6856 }; 6857 6858 6859 /***/ }), 6860 6861 /***/ "Hsqg": 6862 /***/ (function(module, exports, __webpack_require__) { 6863 6864 module.exports = true ? __webpack_require__("DciD") : undefined; 6865 6866 6867 6868 /***/ }), 6869 6870 /***/ "HwJD": 6871 /***/ (function(module, exports, __webpack_require__) { 6872 6873 "use strict"; 6874 6875 6876 module.exports = Number.isNaN || function isNaN(a) { 6877 return a !== a; 6878 }; 6879 6880 6881 /***/ }), 6882 6883 /***/ "Hx/O": 6884 /***/ (function(module, exports, __webpack_require__) { 6885 6886 "use strict"; 6887 6888 6889 var GetIntrinsic = __webpack_require__("rZ7t"); 6890 6891 var $String = GetIntrinsic('%String%'); 6892 var $TypeError = GetIntrinsic('%TypeError%'); 6893 6894 // https://ecma-international.org/ecma-262/6.0/#sec-tostring 6895 6896 module.exports = function ToString(argument) { 6897 if (typeof argument === 'symbol') { 6898 throw new $TypeError('Cannot convert a Symbol value to a string'); 6899 } 6900 return $String(argument); 6901 }; 6902 6903 6904 /***/ }), 6905 6906 /***/ "HyUg": 6907 /***/ (function(module, exports, __webpack_require__) { 6908 6909 "use strict"; 6910 6911 6912 var origSymbol = typeof Symbol !== 'undefined' && Symbol; 6913 var hasSymbolSham = __webpack_require__("eJkf"); 6914 6915 module.exports = function hasNativeSymbols() { 6916 if (typeof origSymbol !== 'function') { return false; } 6917 if (typeof Symbol !== 'function') { return false; } 6918 if (typeof origSymbol('foo') !== 'symbol') { return false; } 6919 if (typeof Symbol('bar') !== 'symbol') { return false; } 6920 6921 return hasSymbolSham(); 6922 }; 6923 6924 6925 /***/ }), 6926 6927 /***/ "I/A+": 6928 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6929 6930 "use strict"; 6931 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 6932 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; }); 6933 /* unused harmony export b */ 6934 function _defineProperty(obj, key, value) { 6935 if (key in obj) { 6936 Object.defineProperty(obj, key, { 6937 value: value, 6938 enumerable: true, 6939 configurable: true, 6940 writable: true 6941 }); 6942 } else { 6943 obj[key] = value; 6944 } 6945 6946 return obj; 6947 } 6948 6949 function ownKeys(object, enumerableOnly) { 6950 var keys = Object.keys(object); 6951 6952 if (Object.getOwnPropertySymbols) { 6953 var symbols = Object.getOwnPropertySymbols(object); 6954 if (enumerableOnly) symbols = symbols.filter(function (sym) { 6955 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 6956 }); 6957 keys.push.apply(keys, symbols); 6958 } 6959 6960 return keys; 6961 } 6962 6963 function _objectSpread2(target) { 6964 for (var i = 1; i < arguments.length; i++) { 6965 var source = arguments[i] != null ? arguments[i] : {}; 6966 6967 if (i % 2) { 6968 ownKeys(Object(source), true).forEach(function (key) { 6969 _defineProperty(target, key, source[key]); 6970 }); 6971 } else if (Object.getOwnPropertyDescriptors) { 6972 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 6973 } else { 6974 ownKeys(Object(source)).forEach(function (key) { 6975 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 6976 }); 6977 } 6978 } 6979 6980 return target; 6981 } 6982 6983 function _objectWithoutPropertiesLoose(source, excluded) { 6984 if (source == null) return {}; 6985 var target = {}; 6986 var sourceKeys = Object.keys(source); 6987 var key, i; 6988 6989 for (i = 0; i < sourceKeys.length; i++) { 6990 key = sourceKeys[i]; 6991 if (excluded.indexOf(key) >= 0) continue; 6992 target[key] = source[key]; 6993 } 6994 6995 return target; 6996 } 6997 6998 function _unsupportedIterableToArray(o, minLen) { 6999 if (!o) return; 7000 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 7001 var n = Object.prototype.toString.call(o).slice(8, -1); 7002 if (n === "Object" && o.constructor) n = o.constructor.name; 7003 if (n === "Map" || n === "Set") return Array.from(o); 7004 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 7005 } 7006 7007 function _arrayLikeToArray(arr, len) { 7008 if (len == null || len > arr.length) len = arr.length; 7009 7010 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 7011 7012 return arr2; 7013 } 7014 7015 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 7016 var it; 7017 7018 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 7019 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 7020 if (it) o = it; 7021 var i = 0; 7022 return function () { 7023 if (i >= o.length) return { 7024 done: true 7025 }; 7026 return { 7027 done: false, 7028 value: o[i++] 7029 }; 7030 }; 7031 } 7032 7033 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 7034 } 7035 7036 it = o[Symbol.iterator](); 7037 return it.next.bind(it); 7038 } 7039 7040 7041 7042 7043 /***/ }), 7044 7045 /***/ "IVEb": 7046 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7047 7048 "use strict"; 7049 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useCreateElement; }); 7050 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd"); 7051 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 7052 /* harmony import */ var _SystemContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("eUCI"); 7053 /* harmony import */ var _rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("RDTF"); 7054 7055 7056 7057 7058 function isRenderProp(children) { 7059 return typeof children === "function"; 7060 } 7061 7062 /** 7063 * Custom hook that will call `children` if it's a function. If 7064 * `useCreateElement` has been passed to the context, it'll be used instead. 7065 * 7066 * @example 7067 * import React from "react"; 7068 * import { SystemProvider, useCreateElement } from "reakit-system"; 7069 * 7070 * const system = { 7071 * useCreateElement(type, props, children = props.children) { 7072 * // very similar to what `useCreateElement` does already 7073 * if (typeof children === "function") { 7074 * const { children: _, ...rest } = props; 7075 * return children(rest); 7076 * } 7077 * return React.createElement(type, props, children); 7078 * }, 7079 * }; 7080 * 7081 * function Component(props) { 7082 * return useCreateElement("div", props); 7083 * } 7084 * 7085 * function App() { 7086 * return ( 7087 * <SystemProvider unstable_system={system}> 7088 * <Component url="url">{({ url }) => <a href={url}>link</a>}</Component> 7089 * </SystemProvider> 7090 * ); 7091 * } 7092 */ 7093 7094 var useCreateElement = function useCreateElement(type, props, children) { 7095 if (children === void 0) { 7096 children = props.children; 7097 } 7098 7099 var context = Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_SystemContext_js__WEBPACK_IMPORTED_MODULE_1__[/* SystemContext */ "a"]); 7100 7101 if (context.useCreateElement) { 7102 return context.useCreateElement(type, props, children); 7103 } 7104 7105 if (typeof type === "string" && isRenderProp(children)) { 7106 var _ = props.children, 7107 rest = Object(_rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__[/* a */ "b"])(props, ["children"]); 7108 7109 return children(rest); 7110 } 7111 7112 return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(type, props, children); 7113 }; 7114 7115 7116 7117 7118 /***/ }), 7119 7120 /***/ "IdCN": 7121 /***/ (function(module, exports, __webpack_require__) { 7122 7123 "use strict"; 7124 7125 7126 var fnToStr = Function.prototype.toString; 7127 var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; 7128 var badArrayLike; 7129 var isCallableMarker; 7130 if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { 7131 try { 7132 badArrayLike = Object.defineProperty({}, 'length', { 7133 get: function () { 7134 throw isCallableMarker; 7135 } 7136 }); 7137 isCallableMarker = {}; 7138 // eslint-disable-next-line no-throw-literal 7139 reflectApply(function () { throw 42; }, null, badArrayLike); 7140 } catch (_) { 7141 if (_ !== isCallableMarker) { 7142 reflectApply = null; 7143 } 7144 } 7145 } else { 7146 reflectApply = null; 7147 } 7148 7149 var constructorRegex = /^\s*class\b/; 7150 var isES6ClassFn = function isES6ClassFunction(value) { 7151 try { 7152 var fnStr = fnToStr.call(value); 7153 return constructorRegex.test(fnStr); 7154 } catch (e) { 7155 return false; // not a function 7156 } 7157 }; 7158 7159 var tryFunctionObject = function tryFunctionToStr(value) { 7160 try { 7161 if (isES6ClassFn(value)) { return false; } 7162 fnToStr.call(value); 7163 return true; 7164 } catch (e) { 7165 return false; 7166 } 7167 }; 7168 var toStr = Object.prototype.toString; 7169 var fnClass = '[object Function]'; 7170 var genClass = '[object GeneratorFunction]'; 7171 var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; 7172 7173 module.exports = reflectApply 7174 ? function isCallable(value) { 7175 if (!value) { return false; } 7176 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 7177 if (typeof value === 'function' && !value.prototype) { return true; } 7178 try { 7179 reflectApply(value, null, badArrayLike); 7180 } catch (e) { 7181 if (e !== isCallableMarker) { return false; } 7182 } 7183 return !isES6ClassFn(value); 7184 } 7185 : function isCallable(value) { 7186 if (!value) { return false; } 7187 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 7188 if (typeof value === 'function' && !value.prototype) { return true; } 7189 if (hasToStringTag) { return tryFunctionObject(value); } 7190 if (isES6ClassFn(value)) { return false; } 7191 var strClass = toStr.call(value); 7192 return strClass === fnClass || strClass === genClass; 7193 }; 7194 7195 7196 /***/ }), 7197 7198 /***/ "IgE5": 7199 /***/ (function(module, exports, __webpack_require__) { 7200 7201 "use strict"; 7202 7203 7204 Object.defineProperty(exports, "__esModule", { 7205 value: true 7206 }); 7207 exports['default'] = isDayVisible; 7208 7209 var _isBeforeDay = __webpack_require__("h6xH"); 7210 7211 var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay); 7212 7213 var _isAfterDay = __webpack_require__("Nho6"); 7214 7215 var _isAfterDay2 = _interopRequireDefault(_isAfterDay); 7216 7217 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7218 7219 function isDayVisible(day, month, numberOfMonths, enableOutsideDays) { 7220 var firstDayOfFirstMonth = month.clone().startOf('month'); 7221 if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week'); 7222 if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false; 7223 7224 var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month'); 7225 if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week'); 7226 return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth); 7227 } 7228 7229 /***/ }), 7230 7231 /***/ "In1I": 7232 /***/ (function(module, exports, __webpack_require__) { 7233 7234 "use strict"; 7235 7236 7237 var GetIntrinsic = __webpack_require__("rZ7t"); 7238 7239 var $abs = GetIntrinsic('%Math.abs%'); 7240 7241 // http://262.ecma-international.org/5.1/#sec-5.2 7242 7243 module.exports = function abs(x) { 7244 return $abs(x); 7245 }; 7246 7247 7248 /***/ }), 7249 7250 /***/ "J7JS": 7251 /***/ (function(module, exports, __webpack_require__) { 7252 7253 "use strict"; 7254 7255 7256 Object.defineProperty(exports, "__esModule", { 7257 value: true 7258 }); 7259 7260 var _propTypes = __webpack_require__("17x9"); 7261 7262 var _propTypes2 = _interopRequireDefault(_propTypes); 7263 7264 var _airbnbPropTypes = __webpack_require__("Hsqg"); 7265 7266 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7267 7268 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; } 7269 7270 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); } } 7271 7272 exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () { 7273 function modifiers(props, propName) { 7274 for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 7275 rest[_key - 2] = arguments[_key]; 7276 } 7277 7278 var propValue = props[propName]; 7279 7280 var firstError = void 0; 7281 [].concat(_toConsumableArray(propValue)).some(function (v, i) { 7282 var _PropTypes$string; 7283 7284 var fakePropName = String(propName) + ': index ' + String(i); 7285 firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest)); 7286 return firstError != null; 7287 }); 7288 return firstError == null ? null : firstError; 7289 } 7290 7291 return modifiers; 7292 }()], 'Modifiers (Set of Strings)'); 7293 7294 /***/ }), 7295 7296 /***/ "JLmN": 7297 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7298 7299 "use strict"; 7300 /* unused harmony export Clickable */ 7301 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useClickable; }); 7302 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5"); 7303 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48"); 7304 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes"); 7305 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd"); 7306 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); 7307 /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("71Og"); 7308 /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("KA1K"); 7309 /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("eNtd"); 7310 /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("k2cL"); 7311 /* harmony import */ var _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("G3V0"); 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 // Automatically generated 7331 var CLICKABLE_KEYS = ["unstable_clickOnEnter", "unstable_clickOnSpace"]; 7332 7333 function isNativeClick(event) { 7334 var element = event.currentTarget; 7335 if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet 7336 7337 return Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__[/* isButton */ "a"])(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT"; 7338 } 7339 7340 var useClickable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 7341 name: "Clickable", 7342 compose: _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__[/* useTabbable */ "a"], 7343 keys: CLICKABLE_KEYS, 7344 useOptions: function useOptions(_ref) { 7345 var _ref$unstable_clickOn = _ref.unstable_clickOnEnter, 7346 unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn, 7347 _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace, 7348 unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2, 7349 options = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]); 7350 7351 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 7352 unstable_clickOnEnter: unstable_clickOnEnter, 7353 unstable_clickOnSpace: unstable_clickOnSpace 7354 }, options); 7355 }, 7356 useProps: function useProps(options, _ref2) { 7357 var htmlOnKeyDown = _ref2.onKeyDown, 7358 htmlOnKeyUp = _ref2.onKeyUp, 7359 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["onKeyDown", "onKeyUp"]); 7360 7361 var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(false), 7362 active = _React$useState[0], 7363 setActive = _React$useState[1]; 7364 7365 var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown); 7366 var onKeyUpRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyUp); 7367 var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 7368 var _onKeyDownRef$current; 7369 7370 (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); 7371 if (event.defaultPrevented) return; 7372 if (options.disabled) return; 7373 if (event.metaKey) return; 7374 if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return; 7375 var isEnter = options.unstable_clickOnEnter && event.key === "Enter"; 7376 var isSpace = options.unstable_clickOnSpace && event.key === " "; 7377 7378 if (isEnter || isSpace) { 7379 if (isNativeClick(event)) return; 7380 event.preventDefault(); 7381 7382 if (isEnter) { 7383 event.currentTarget.click(); 7384 } else if (isSpace) { 7385 setActive(true); 7386 } 7387 } 7388 }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]); 7389 var onKeyUp = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 7390 var _onKeyUpRef$current; 7391 7392 (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event); 7393 if (event.defaultPrevented) return; 7394 if (options.disabled) return; 7395 if (event.metaKey) return; 7396 var isSpace = options.unstable_clickOnSpace && event.key === " "; 7397 7398 if (active && isSpace) { 7399 setActive(false); 7400 event.currentTarget.click(); 7401 } 7402 }, [options.disabled, options.unstable_clickOnSpace, active]); 7403 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 7404 "data-active": active || undefined, 7405 onKeyDown: onKeyDown, 7406 onKeyUp: onKeyUp 7407 }, htmlProps); 7408 } 7409 }); 7410 var Clickable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 7411 as: "button", 7412 memo: true, 7413 useHook: useClickable 7414 }); 7415 7416 7417 7418 7419 /***/ }), 7420 7421 /***/ "JYkG": 7422 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7423 7424 "use strict"; 7425 /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 7426 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 7427 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Z23Y"); 7428 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__); 7429 /** 7430 * WordPress dependencies 7431 */ 7432 7433 7434 const SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({ 7435 slots: {}, 7436 fills: {}, 7437 registerSlot: () => { 7438 typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default()('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0; 7439 }, 7440 updateSlot: () => {}, 7441 unregisterSlot: () => {}, 7442 registerFill: () => {}, 7443 unregisterFill: () => {} 7444 }); 7445 /* harmony default export */ __webpack_exports__["a"] = (SlotFillContext); 7446 7447 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) 7448 7449 /***/ }), 7450 7451 /***/ "Jt44": 7452 /***/ (function(module, exports, __webpack_require__) { 7453 7454 "use strict"; 7455 7456 7457 // TODO: remove, semver-major 7458 7459 module.exports = __webpack_require__("rZ7t"); 7460 7461 7462 /***/ }), 7463 7464 /***/ "Jx1U": 7465 /***/ (function(module, exports) { 7466 7467 // Copyright (c) 2014 Rafael Caricio. All rights reserved. 7468 // Use of this source code is governed by a BSD-style license that can be 7469 // found in the LICENSE file. 7470 7471 var GradientParser = {}; 7472 7473 GradientParser.parse = (function() { 7474 7475 var tokens = { 7476 linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i, 7477 repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i, 7478 radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i, 7479 repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i, 7480 sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i, 7481 extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/, 7482 positionKeywords: /^(left|center|right|top|bottom)/i, 7483 pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, 7484 percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/, 7485 emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, 7486 angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, 7487 startCall: /^\(/, 7488 endCall: /^\)/, 7489 comma: /^,/, 7490 hexColor: /^\#([0-9a-fA-F]+)/, 7491 literalColor: /^([a-zA-Z]+)/, 7492 rgbColor: /^rgb/i, 7493 rgbaColor: /^rgba/i, 7494 number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ 7495 }; 7496 7497 var input = ''; 7498 7499 function error(msg) { 7500 var err = new Error(input + ': ' + msg); 7501 err.source = input; 7502 throw err; 7503 } 7504 7505 function getAST() { 7506 var ast = matchListDefinitions(); 7507 7508 if (input.length > 0) { 7509 error('Invalid input not EOF'); 7510 } 7511 7512 return ast; 7513 } 7514 7515 function matchListDefinitions() { 7516 return matchListing(matchDefinition); 7517 } 7518 7519 function matchDefinition() { 7520 return matchGradient( 7521 'linear-gradient', 7522 tokens.linearGradient, 7523 matchLinearOrientation) || 7524 7525 matchGradient( 7526 'repeating-linear-gradient', 7527 tokens.repeatingLinearGradient, 7528 matchLinearOrientation) || 7529 7530 matchGradient( 7531 'radial-gradient', 7532 tokens.radialGradient, 7533 matchListRadialOrientations) || 7534 7535 matchGradient( 7536 'repeating-radial-gradient', 7537 tokens.repeatingRadialGradient, 7538 matchListRadialOrientations); 7539 } 7540 7541 function matchGradient(gradientType, pattern, orientationMatcher) { 7542 return matchCall(pattern, function(captures) { 7543 7544 var orientation = orientationMatcher(); 7545 if (orientation) { 7546 if (!scan(tokens.comma)) { 7547 error('Missing comma before color stops'); 7548 } 7549 } 7550 7551 return { 7552 type: gradientType, 7553 orientation: orientation, 7554 colorStops: matchListing(matchColorStop) 7555 }; 7556 }); 7557 } 7558 7559 function matchCall(pattern, callback) { 7560 var captures = scan(pattern); 7561 7562 if (captures) { 7563 if (!scan(tokens.startCall)) { 7564 error('Missing ('); 7565 } 7566 7567 result = callback(captures); 7568 7569 if (!scan(tokens.endCall)) { 7570 error('Missing )'); 7571 } 7572 7573 return result; 7574 } 7575 } 7576 7577 function matchLinearOrientation() { 7578 return matchSideOrCorner() || 7579 matchAngle(); 7580 } 7581 7582 function matchSideOrCorner() { 7583 return match('directional', tokens.sideOrCorner, 1); 7584 } 7585 7586 function matchAngle() { 7587 return match('angular', tokens.angleValue, 1); 7588 } 7589 7590 function matchListRadialOrientations() { 7591 var radialOrientations, 7592 radialOrientation = matchRadialOrientation(), 7593 lookaheadCache; 7594 7595 if (radialOrientation) { 7596 radialOrientations = []; 7597 radialOrientations.push(radialOrientation); 7598 7599 lookaheadCache = input; 7600 if (scan(tokens.comma)) { 7601 radialOrientation = matchRadialOrientation(); 7602 if (radialOrientation) { 7603 radialOrientations.push(radialOrientation); 7604 } else { 7605 input = lookaheadCache; 7606 } 7607 } 7608 } 7609 7610 return radialOrientations; 7611 } 7612 7613 function matchRadialOrientation() { 7614 var radialType = matchCircle() || 7615 matchEllipse(); 7616 7617 if (radialType) { 7618 radialType.at = matchAtPosition(); 7619 } else { 7620 var defaultPosition = matchPositioning(); 7621 if (defaultPosition) { 7622 radialType = { 7623 type: 'default-radial', 7624 at: defaultPosition 7625 }; 7626 } 7627 } 7628 7629 return radialType; 7630 } 7631 7632 function matchCircle() { 7633 var circle = match('shape', /^(circle)/i, 0); 7634 7635 if (circle) { 7636 circle.style = matchLength() || matchExtentKeyword(); 7637 } 7638 7639 return circle; 7640 } 7641 7642 function matchEllipse() { 7643 var ellipse = match('shape', /^(ellipse)/i, 0); 7644 7645 if (ellipse) { 7646 ellipse.style = matchDistance() || matchExtentKeyword(); 7647 } 7648 7649 return ellipse; 7650 } 7651 7652 function matchExtentKeyword() { 7653 return match('extent-keyword', tokens.extentKeywords, 1); 7654 } 7655 7656 function matchAtPosition() { 7657 if (match('position', /^at/, 0)) { 7658 var positioning = matchPositioning(); 7659 7660 if (!positioning) { 7661 error('Missing positioning value'); 7662 } 7663 7664 return positioning; 7665 } 7666 } 7667 7668 function matchPositioning() { 7669 var location = matchCoordinates(); 7670 7671 if (location.x || location.y) { 7672 return { 7673 type: 'position', 7674 value: location 7675 }; 7676 } 7677 } 7678 7679 function matchCoordinates() { 7680 return { 7681 x: matchDistance(), 7682 y: matchDistance() 7683 }; 7684 } 7685 7686 function matchListing(matcher) { 7687 var captures = matcher(), 7688 result = []; 7689 7690 if (captures) { 7691 result.push(captures); 7692 while (scan(tokens.comma)) { 7693 captures = matcher(); 7694 if (captures) { 7695 result.push(captures); 7696 } else { 7697 error('One extra comma'); 7698 } 7699 } 7700 } 7701 7702 return result; 7703 } 7704 7705 function matchColorStop() { 7706 var color = matchColor(); 7707 7708 if (!color) { 7709 error('Expected color definition'); 7710 } 7711 7712 color.length = matchDistance(); 7713 return color; 7714 } 7715 7716 function matchColor() { 7717 return matchHexColor() || 7718 matchRGBAColor() || 7719 matchRGBColor() || 7720 matchLiteralColor(); 7721 } 7722 7723 function matchLiteralColor() { 7724 return match('literal', tokens.literalColor, 0); 7725 } 7726 7727 function matchHexColor() { 7728 return match('hex', tokens.hexColor, 1); 7729 } 7730 7731 function matchRGBColor() { 7732 return matchCall(tokens.rgbColor, function() { 7733 return { 7734 type: 'rgb', 7735 value: matchListing(matchNumber) 7736 }; 7737 }); 7738 } 7739 7740 function matchRGBAColor() { 7741 return matchCall(tokens.rgbaColor, function() { 7742 return { 7743 type: 'rgba', 7744 value: matchListing(matchNumber) 7745 }; 7746 }); 7747 } 7748 7749 function matchNumber() { 7750 return scan(tokens.number)[1]; 7751 } 7752 7753 function matchDistance() { 7754 return match('%', tokens.percentageValue, 1) || 7755 matchPositionKeyword() || 7756 matchLength(); 7757 } 7758 7759 function matchPositionKeyword() { 7760 return match('position-keyword', tokens.positionKeywords, 1); 7761 } 7762 7763 function matchLength() { 7764 return match('px', tokens.pixelValue, 1) || 7765 match('em', tokens.emValue, 1); 7766 } 7767 7768 function match(type, pattern, captureIndex) { 7769 var captures = scan(pattern); 7770 if (captures) { 7771 return { 7772 type: type, 7773 value: captures[captureIndex] 7774 }; 7775 } 7776 } 7777 7778 function scan(regexp) { 7779 var captures, 7780 blankCaptures; 7781 7782 blankCaptures = /^[\n\r\t\s]+/.exec(input); 7783 if (blankCaptures) { 7784 consume(blankCaptures[0].length); 7785 } 7786 7787 captures = regexp.exec(input); 7788 if (captures) { 7789 consume(captures[0].length); 7790 } 7791 7792 return captures; 7793 } 7794 7795 function consume(size) { 7796 input = input.substr(size); 7797 } 7798 7799 return function(code) { 7800 input = code.toString(); 7801 return getAST(); 7802 }; 7803 })(); 7804 7805 exports.parse = (GradientParser || {}).parse; 7806 7807 7808 /***/ }), 7809 7810 /***/ "K+tz": 7811 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7812 7813 "use strict"; 7814 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 7815 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 7816 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 7817 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 7818 7819 7820 /** 7821 * WordPress dependencies 7822 */ 7823 7824 const external = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 7825 xmlns: "http://www.w3.org/2000/svg", 7826 viewBox: "0 0 24 24" 7827 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 7828 d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z" 7829 })); 7830 /* harmony default export */ __webpack_exports__["a"] = (external); 7831 7832 7833 /***/ }), 7834 7835 /***/ "K9lf": 7836 /***/ (function(module, exports) { 7837 7838 (function() { module.exports = window["wp"]["compose"]; }()); 7839 7840 /***/ }), 7841 7842 /***/ "KA1K": 7843 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7844 7845 "use strict"; 7846 7847 // UNUSED EXPORTS: warning, useWarning 7848 7849 // EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js 7850 var warning = __webpack_require__("WnOg"); 7851 7852 // EXTERNAL MODULE: external "React" 7853 var external_React_ = __webpack_require__("cDcd"); 7854 7855 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js 7856 var isObject = __webpack_require__("Ptb8"); 7857 7858 // CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js 7859 7860 7861 7862 7863 7864 function isRefObject(ref) { 7865 return Object(isObject["a" /* isObject */])(ref) && "current" in ref; 7866 } 7867 /** 7868 * Logs `messages` to the console using `console.warn` based on a `condition`. 7869 * This should be used inside components. 7870 */ 7871 7872 7873 function useWarning(condition) { 7874 for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 7875 messages[_key - 1] = arguments[_key]; 7876 } 7877 7878 if (false) {} 7879 } 7880 7881 7882 7883 // CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js 7884 7885 7886 7887 7888 7889 7890 7891 /***/ }), 7892 7893 /***/ "KCH1": 7894 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7895 7896 "use strict"; 7897 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_IdContext; }); 7898 /* unused harmony export unstable_IdProvider */ 7899 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd"); 7900 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 7901 7902 7903 var defaultPrefix = "id"; 7904 function generateRandomString(prefix) { 7905 if (prefix === void 0) { 7906 prefix = defaultPrefix; 7907 } 7908 7909 return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6); 7910 } 7911 7912 var unstable_IdContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])(generateRandomString); 7913 function unstable_IdProvider(_ref) { 7914 var children = _ref.children, 7915 _ref$prefix = _ref.prefix, 7916 prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix; 7917 var count = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0); 7918 var generateId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function (localPrefix) { 7919 if (localPrefix === void 0) { 7920 localPrefix = prefix; 7921 } 7922 7923 return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current; 7924 }, [prefix]); 7925 return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(unstable_IdContext.Provider, { 7926 value: generateId 7927 }, children); 7928 } 7929 7930 7931 7932 7933 /***/ }), 7934 7935 /***/ "KfNM": 7936 /***/ (function(module, exports) { 7937 7938 /** Used for built-in method references. */ 7939 var objectProto = Object.prototype; 7940 7941 /** 7942 * Used to resolve the 7943 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 7944 * of values. 7945 */ 7946 var nativeObjectToString = objectProto.toString; 7947 7948 /** 7949 * Converts `value` to a string using `Object.prototype.toString`. 7950 * 7951 * @private 7952 * @param {*} value The value to convert. 7953 * @returns {string} Returns the converted string. 7954 */ 7955 function objectToString(value) { 7956 return nativeObjectToString.call(value); 7957 } 7958 7959 module.exports = objectToString; 7960 7961 7962 /***/ }), 7963 7964 /***/ "Koq/": 7965 /***/ (function(module, exports, __webpack_require__) { 7966 7967 "use strict"; 7968 7969 7970 var defineProperties = __webpack_require__("82c2"); 7971 var callBind = __webpack_require__("PrET"); 7972 7973 var implementation = __webpack_require__("FufO"); 7974 var getPolyfill = __webpack_require__("yLpt"); 7975 var shim = __webpack_require__("8R9v"); 7976 7977 var polyfill = callBind.apply(getPolyfill()); 7978 // eslint-disable-next-line no-unused-vars 7979 var bound = function assign(target, source1) { 7980 return polyfill(Object, arguments); 7981 }; 7982 7983 defineProperties(bound, { 7984 getPolyfill: getPolyfill, 7985 implementation: implementation, 7986 shim: shim 7987 }); 7988 7989 module.exports = bound; 7990 7991 7992 /***/ }), 7993 7994 /***/ "Kz5y": 7995 /***/ (function(module, exports, __webpack_require__) { 7996 7997 var freeGlobal = __webpack_require__("WFqU"); 7998 7999 /** Detect free variable `self`. */ 8000 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 8001 8002 /** Used as a reference to the global object. */ 8003 var root = freeGlobal || freeSelf || Function('return this')(); 8004 8005 module.exports = root; 8006 8007 8008 /***/ }), 8009 8010 /***/ "L7Wv": 8011 /***/ (function(module, exports, __webpack_require__) { 8012 8013 "use strict"; 8014 8015 8016 var toPrimitive = __webpack_require__("WZeS"); 8017 8018 // https://ecma-international.org/ecma-262/6.0/#sec-toprimitive 8019 8020 module.exports = function ToPrimitive(input) { 8021 if (arguments.length > 1) { 8022 return toPrimitive(input, arguments[1]); 8023 } 8024 return toPrimitive(input); 8025 }; 8026 8027 8028 /***/ }), 8029 8030 /***/ "L8Kx": 8031 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8032 8033 "use strict"; 8034 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getAnimateClassName; }); 8035 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Animate; }); 8036 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TSYQ"); 8037 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); 8038 /** 8039 * External dependencies 8040 */ 8041 8042 /** 8043 * @typedef {'top' | 'top left' | 'top right' | 'middle' | 'middle left' | 'middle right' | 'bottom' | 'bottom left' | 'bottom right'} AppearOrigin 8044 * @typedef {'left' | 'right'} SlideInOrigin 8045 * @typedef {{ type: 'appear'; origin?: AppearOrigin }} AppearOptions 8046 * @typedef {{ type: 'slide-in'; origin?: SlideInOrigin }} SlideInOptions 8047 * @typedef {{ type: 'loading'; }} LoadingOptions 8048 * @typedef {AppearOptions | SlideInOptions | LoadingOptions} GetAnimateOptions 8049 */ 8050 8051 /* eslint-disable jsdoc/valid-types */ 8052 8053 /** 8054 * @param {GetAnimateOptions['type']} type The animation type 8055 * @return {'top' | 'left'} Default origin 8056 */ 8057 8058 function getDefaultOrigin(type) { 8059 return type === 'appear' ? 'top' : 'left'; 8060 } 8061 /* eslint-enable jsdoc/valid-types */ 8062 8063 /** 8064 * @param {GetAnimateOptions} options 8065 * 8066 * @return {string | void} ClassName that applies the animations 8067 */ 8068 8069 8070 function getAnimateClassName(options) { 8071 if (options.type === 'loading') { 8072 return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__loading'); 8073 } 8074 8075 const { 8076 type, 8077 origin = getDefaultOrigin(type) 8078 } = options; 8079 8080 if (type === 'appear') { 8081 const [yAxis, xAxis = 'center'] = origin.split(' '); 8082 return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__appear', { 8083 ['is-from-' + xAxis]: xAxis !== 'center', 8084 ['is-from-' + yAxis]: yAxis !== 'middle' 8085 }); 8086 } 8087 8088 if (type === 'slide-in') { 8089 return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__slide-in', 'is-from-' + origin); 8090 } 8091 } // @ts-ignore Reason: Planned for deprecation 8092 8093 function Animate({ 8094 type, 8095 options = {}, 8096 children 8097 }) { 8098 return children({ 8099 className: getAnimateClassName({ 8100 type, 8101 ...options 8102 }) 8103 }); 8104 } 8105 8106 8107 /***/ }), 8108 8109 /***/ "LTAC": 8110 /***/ (function(module, exports) { 8111 8112 Object.defineProperty(exports, "__esModule", { 8113 value: true 8114 }); 8115 exports['default'] = isTouchDevice; 8116 function isTouchDevice() { 8117 return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)); 8118 } 8119 module.exports = exports['default']; 8120 8121 /***/ }), 8122 8123 /***/ "Lxf3": 8124 /***/ (function(module, exports, __webpack_require__) { 8125 8126 "use strict"; 8127 8128 8129 var toStr = Object.prototype.toString; 8130 8131 var isPrimitive = __webpack_require__("Teho"); 8132 8133 var isCallable = __webpack_require__("IdCN"); 8134 8135 // http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 8136 var ES5internalSlots = { 8137 '[[DefaultValue]]': function (O) { 8138 var actualHint; 8139 if (arguments.length > 1) { 8140 actualHint = arguments[1]; 8141 } else { 8142 actualHint = toStr.call(O) === '[object Date]' ? String : Number; 8143 } 8144 8145 if (actualHint === String || actualHint === Number) { 8146 var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; 8147 var value, i; 8148 for (i = 0; i < methods.length; ++i) { 8149 if (isCallable(O[methods[i]])) { 8150 value = O[methods[i]](); 8151 if (isPrimitive(value)) { 8152 return value; 8153 } 8154 } 8155 } 8156 throw new TypeError('No default value'); 8157 } 8158 throw new TypeError('invalid [[DefaultValue]] hint supplied'); 8159 } 8160 }; 8161 8162 // http://ecma-international.org/ecma-262/5.1/#sec-9.1 8163 module.exports = function ToPrimitive(input) { 8164 if (isPrimitive(input)) { 8165 return input; 8166 } 8167 if (arguments.length > 1) { 8168 return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); 8169 } 8170 return ES5internalSlots['[[DefaultValue]]'](input); 8171 }; 8172 8173 8174 /***/ }), 8175 8176 /***/ "MiSq": 8177 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8178 8179 "use strict"; 8180 8181 // EXPORTS 8182 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ serialize_browser_esm_serializeStyles; }); 8183 8184 // CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js 8185 /* eslint-disable */ 8186 // Inspired by https://github.com/garycourt/murmurhash-js 8187 // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 8188 function murmur2(str) { 8189 // 'm' and 'r' are mixing constants generated offline. 8190 // They're not really 'magic', they just happen to work well. 8191 // const m = 0x5bd1e995; 8192 // const r = 24; 8193 // Initialize the hash 8194 var h = 0; // Mix 4 bytes at a time into the hash 8195 8196 var k, 8197 i = 0, 8198 len = str.length; 8199 8200 for (; len >= 4; ++i, len -= 4) { 8201 k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; 8202 k = 8203 /* Math.imul(k, m): */ 8204 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); 8205 k ^= 8206 /* k >>> r: */ 8207 k >>> 24; 8208 h = 8209 /* Math.imul(k, m): */ 8210 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ 8211 /* Math.imul(h, m): */ 8212 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 8213 } // Handle the last few bytes of the input array 8214 8215 8216 switch (len) { 8217 case 3: 8218 h ^= (str.charCodeAt(i + 2) & 0xff) << 16; 8219 8220 case 2: 8221 h ^= (str.charCodeAt(i + 1) & 0xff) << 8; 8222 8223 case 1: 8224 h ^= str.charCodeAt(i) & 0xff; 8225 h = 8226 /* Math.imul(h, m): */ 8227 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 8228 } // Do a few final mixes of the hash to ensure the last few 8229 // bytes are well-incorporated. 8230 8231 8232 h ^= h >>> 13; 8233 h = 8234 /* Math.imul(h, m): */ 8235 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 8236 return ((h ^ h >>> 15) >>> 0).toString(36); 8237 } 8238 8239 /* harmony default export */ var hash_browser_esm = (murmur2); 8240 8241 // CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js 8242 var unitlessKeys = { 8243 animationIterationCount: 1, 8244 borderImageOutset: 1, 8245 borderImageSlice: 1, 8246 borderImageWidth: 1, 8247 boxFlex: 1, 8248 boxFlexGroup: 1, 8249 boxOrdinalGroup: 1, 8250 columnCount: 1, 8251 columns: 1, 8252 flex: 1, 8253 flexGrow: 1, 8254 flexPositive: 1, 8255 flexShrink: 1, 8256 flexNegative: 1, 8257 flexOrder: 1, 8258 gridRow: 1, 8259 gridRowEnd: 1, 8260 gridRowSpan: 1, 8261 gridRowStart: 1, 8262 gridColumn: 1, 8263 gridColumnEnd: 1, 8264 gridColumnSpan: 1, 8265 gridColumnStart: 1, 8266 msGridRow: 1, 8267 msGridRowSpan: 1, 8268 msGridColumn: 1, 8269 msGridColumnSpan: 1, 8270 fontWeight: 1, 8271 lineHeight: 1, 8272 opacity: 1, 8273 order: 1, 8274 orphans: 1, 8275 tabSize: 1, 8276 widows: 1, 8277 zIndex: 1, 8278 zoom: 1, 8279 WebkitLineClamp: 1, 8280 // SVG-related properties 8281 fillOpacity: 1, 8282 floodOpacity: 1, 8283 stopOpacity: 1, 8284 strokeDasharray: 1, 8285 strokeDashoffset: 1, 8286 strokeMiterlimit: 1, 8287 strokeOpacity: 1, 8288 strokeWidth: 1 8289 }; 8290 8291 /* harmony default export */ var unitless_browser_esm = (unitlessKeys); 8292 8293 // EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js 8294 var memoize_browser_esm = __webpack_require__("4qRI"); 8295 8296 // CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js 8297 8298 8299 8300 8301 var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; 8302 var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; 8303 var hyphenateRegex = /[A-Z]|^ms/g; 8304 var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; 8305 8306 var isCustomProperty = function isCustomProperty(property) { 8307 return property.charCodeAt(1) === 45; 8308 }; 8309 8310 var isProcessableValue = function isProcessableValue(value) { 8311 return value != null && typeof value !== 'boolean'; 8312 }; 8313 8314 var processStyleName = Object(memoize_browser_esm["a" /* default */])(function (styleName) { 8315 return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); 8316 }); 8317 8318 var serialize_browser_esm_processStyleValue = function processStyleValue(key, value) { 8319 switch (key) { 8320 case 'animation': 8321 case 'animationName': 8322 { 8323 if (typeof value === 'string') { 8324 return value.replace(animationRegex, function (match, p1, p2) { 8325 cursor = { 8326 name: p1, 8327 styles: p2, 8328 next: cursor 8329 }; 8330 return p1; 8331 }); 8332 } 8333 } 8334 } 8335 8336 if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { 8337 return value + 'px'; 8338 } 8339 8340 return value; 8341 }; 8342 8343 if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } 8344 8345 var shouldWarnAboutInterpolatingClassNameFromCss = true; 8346 8347 function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) { 8348 if (interpolation == null) { 8349 return ''; 8350 } 8351 8352 if (interpolation.__emotion_styles !== undefined) { 8353 if (false) {} 8354 8355 return interpolation; 8356 } 8357 8358 switch (typeof interpolation) { 8359 case 'boolean': 8360 { 8361 return ''; 8362 } 8363 8364 case 'object': 8365 { 8366 if (interpolation.anim === 1) { 8367 cursor = { 8368 name: interpolation.name, 8369 styles: interpolation.styles, 8370 next: cursor 8371 }; 8372 return interpolation.name; 8373 } 8374 8375 if (interpolation.styles !== undefined) { 8376 var next = interpolation.next; 8377 8378 if (next !== undefined) { 8379 // not the most efficient thing ever but this is a pretty rare case 8380 // and there will be very few iterations of this generally 8381 while (next !== undefined) { 8382 cursor = { 8383 name: next.name, 8384 styles: next.styles, 8385 next: cursor 8386 }; 8387 next = next.next; 8388 } 8389 } 8390 8391 var styles = interpolation.styles + ";"; 8392 8393 if (false) {} 8394 8395 return styles; 8396 } 8397 8398 return createStringFromObject(mergedProps, registered, interpolation); 8399 } 8400 8401 case 'function': 8402 { 8403 if (mergedProps !== undefined) { 8404 var previousCursor = cursor; 8405 var result = interpolation(mergedProps); 8406 cursor = previousCursor; 8407 return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation); 8408 } else if (false) {} 8409 8410 break; 8411 } 8412 8413 case 'string': 8414 if (false) { var replaced, matched; } 8415 8416 break; 8417 } // finalize string values (regular strings and functions interpolated into css calls) 8418 8419 8420 if (registered == null) { 8421 return interpolation; 8422 } 8423 8424 var cached = registered[interpolation]; 8425 8426 if (false) {} 8427 8428 return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation; 8429 } 8430 8431 function createStringFromObject(mergedProps, registered, obj) { 8432 var string = ''; 8433 8434 if (Array.isArray(obj)) { 8435 for (var i = 0; i < obj.length; i++) { 8436 string += handleInterpolation(mergedProps, registered, obj[i], false); 8437 } 8438 } else { 8439 for (var _key in obj) { 8440 var value = obj[_key]; 8441 8442 if (typeof value !== 'object') { 8443 if (registered != null && registered[value] !== undefined) { 8444 string += _key + "{" + registered[value] + "}"; 8445 } else if (isProcessableValue(value)) { 8446 string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value) + ";"; 8447 } 8448 } else { 8449 if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') { 8450 throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.'); 8451 } 8452 8453 if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { 8454 for (var _i = 0; _i < value.length; _i++) { 8455 if (isProcessableValue(value[_i])) { 8456 string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value[_i]) + ";"; 8457 } 8458 } 8459 } else { 8460 var interpolated = handleInterpolation(mergedProps, registered, value, false); 8461 8462 switch (_key) { 8463 case 'animation': 8464 case 'animationName': 8465 { 8466 string += processStyleName(_key) + ":" + interpolated + ";"; 8467 break; 8468 } 8469 8470 default: 8471 { 8472 if (false) {} 8473 8474 string += _key + "{" + interpolated + "}"; 8475 } 8476 } 8477 } 8478 } 8479 } 8480 } 8481 8482 return string; 8483 } 8484 8485 var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g; 8486 var sourceMapPattern; 8487 8488 if (false) {} // this is the cursor for keyframes 8489 // keyframes are stored on the SerializedStyles object as a linked list 8490 8491 8492 var cursor; 8493 var serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) { 8494 if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { 8495 return args[0]; 8496 } 8497 8498 var stringMode = true; 8499 var styles = ''; 8500 cursor = undefined; 8501 var strings = args[0]; 8502 8503 if (strings == null || strings.raw === undefined) { 8504 stringMode = false; 8505 styles += handleInterpolation(mergedProps, registered, strings, false); 8506 } else { 8507 if (false) {} 8508 8509 styles += strings[0]; 8510 } // we start at 1 since we've already handled the first arg 8511 8512 8513 for (var i = 1; i < args.length; i++) { 8514 styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46); 8515 8516 if (stringMode) { 8517 if (false) {} 8518 8519 styles += strings[i]; 8520 } 8521 } 8522 8523 var sourceMap; 8524 8525 if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time 8526 8527 8528 labelPattern.lastIndex = 0; 8529 var identifierName = ''; 8530 var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 8531 8532 while ((match = labelPattern.exec(styles)) !== null) { 8533 identifierName += '-' + // $FlowFixMe we know it's not null 8534 match[1]; 8535 } 8536 8537 var name = hash_browser_esm(styles) + identifierName; 8538 8539 if (false) {} 8540 8541 return { 8542 name: name, 8543 styles: styles, 8544 next: cursor 8545 }; 8546 }; 8547 8548 8549 8550 8551 /***/ }), 8552 8553 /***/ "Mih7": 8554 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8555 8556 "use strict"; 8557 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasUserFocus; }); 8558 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setUserFocus; }); 8559 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return userFocus; }); 8560 function userFocus(element) { 8561 element.userFocus = true; 8562 element.focus(); 8563 element.userFocus = false; 8564 } 8565 function hasUserFocus(element) { 8566 return !!element.userFocus; 8567 } 8568 function setUserFocus(element, value) { 8569 element.userFocus = value; 8570 } 8571 8572 8573 8574 8575 /***/ }), 8576 8577 /***/ "Mp0b": 8578 /***/ (function(module, __webpack_exports__, __webpack_require__) { 8579 8580 "use strict"; 8581 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 8582 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 8583 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 8584 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 8585 8586 8587 /** 8588 * WordPress dependencies 8589 */ 8590 8591 const linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 8592 xmlns: "http://www.w3.org/2000/svg", 8593 viewBox: "0 0 24 24" 8594 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 8595 d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" 8596 })); 8597 /* harmony default export */ __webpack_exports__["a"] = (linkOff); 8598 8599 8600 /***/ }), 8601 8602 /***/ "N3k4": 8603 /***/ (function(module, exports, __webpack_require__) { 8604 8605 "use strict"; 8606 8607 8608 Object.defineProperty(exports, "__esModule", { 8609 value: true 8610 }); 8611 exports.PureCalendarDay = undefined; 8612 8613 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; }; 8614 8615 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; }; }(); 8616 8617 var _object = __webpack_require__("Koq/"); 8618 8619 var _object2 = _interopRequireDefault(_object); 8620 8621 var _react = __webpack_require__("cDcd"); 8622 8623 var _react2 = _interopRequireDefault(_react); 8624 8625 var _propTypes = __webpack_require__("17x9"); 8626 8627 var _propTypes2 = _interopRequireDefault(_propTypes); 8628 8629 var _reactAddonsShallowCompare = __webpack_require__("YZDV"); 8630 8631 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 8632 8633 var _reactMomentProptypes = __webpack_require__("XGBb"); 8634 8635 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 8636 8637 var _airbnbPropTypes = __webpack_require__("Hsqg"); 8638 8639 var _reactWithStyles = __webpack_require__("TG4+"); 8640 8641 var _moment = __webpack_require__("wy2R"); 8642 8643 var _moment2 = _interopRequireDefault(_moment); 8644 8645 var _defaultPhrases = __webpack_require__("vV+G"); 8646 8647 var _getPhrasePropTypes = __webpack_require__("yc2e"); 8648 8649 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 8650 8651 var _getCalendarDaySettings = __webpack_require__("Ae65"); 8652 8653 var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings); 8654 8655 var _ModifiersShape = __webpack_require__("J7JS"); 8656 8657 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 8658 8659 var _constants = __webpack_require__("Fv1B"); 8660 8661 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8662 8663 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8664 8665 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; } 8666 8667 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; } 8668 8669 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 8670 day: _reactMomentProptypes2['default'].momentObj, 8671 daySize: _airbnbPropTypes.nonNegativeInteger, 8672 isOutsideDay: _propTypes2['default'].bool, 8673 modifiers: _ModifiersShape2['default'], 8674 isFocused: _propTypes2['default'].bool, 8675 tabIndex: _propTypes2['default'].oneOf([0, -1]), 8676 onDayClick: _propTypes2['default'].func, 8677 onDayMouseEnter: _propTypes2['default'].func, 8678 onDayMouseLeave: _propTypes2['default'].func, 8679 renderDayContents: _propTypes2['default'].func, 8680 ariaLabelFormat: _propTypes2['default'].string, 8681 8682 // internationalization 8683 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)) 8684 })); 8685 8686 var defaultProps = { 8687 day: (0, _moment2['default'])(), 8688 daySize: _constants.DAY_SIZE, 8689 isOutsideDay: false, 8690 modifiers: new Set(), 8691 isFocused: false, 8692 tabIndex: -1, 8693 onDayClick: function () { 8694 function onDayClick() {} 8695 8696 return onDayClick; 8697 }(), 8698 onDayMouseEnter: function () { 8699 function onDayMouseEnter() {} 8700 8701 return onDayMouseEnter; 8702 }(), 8703 onDayMouseLeave: function () { 8704 function onDayMouseLeave() {} 8705 8706 return onDayMouseLeave; 8707 }(), 8708 8709 renderDayContents: null, 8710 ariaLabelFormat: 'dddd, LL', 8711 8712 // internationalization 8713 phrases: _defaultPhrases.CalendarDayPhrases 8714 }; 8715 8716 var CalendarDay = function (_React$Component) { 8717 _inherits(CalendarDay, _React$Component); 8718 8719 function CalendarDay() { 8720 var _ref; 8721 8722 _classCallCheck(this, CalendarDay); 8723 8724 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 8725 args[_key] = arguments[_key]; 8726 } 8727 8728 var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args))); 8729 8730 _this.setButtonRef = _this.setButtonRef.bind(_this); 8731 return _this; 8732 } 8733 8734 _createClass(CalendarDay, [{ 8735 key: 'shouldComponentUpdate', 8736 value: function () { 8737 function shouldComponentUpdate(nextProps, nextState) { 8738 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 8739 } 8740 8741 return shouldComponentUpdate; 8742 }() 8743 }, { 8744 key: 'componentDidUpdate', 8745 value: function () { 8746 function componentDidUpdate(prevProps) { 8747 var _props = this.props, 8748 isFocused = _props.isFocused, 8749 tabIndex = _props.tabIndex; 8750 8751 if (tabIndex === 0) { 8752 if (isFocused || tabIndex !== prevProps.tabIndex) { 8753 this.buttonRef.focus(); 8754 } 8755 } 8756 } 8757 8758 return componentDidUpdate; 8759 }() 8760 }, { 8761 key: 'onDayClick', 8762 value: function () { 8763 function onDayClick(day, e) { 8764 var onDayClick = this.props.onDayClick; 8765 8766 onDayClick(day, e); 8767 } 8768 8769 return onDayClick; 8770 }() 8771 }, { 8772 key: 'onDayMouseEnter', 8773 value: function () { 8774 function onDayMouseEnter(day, e) { 8775 var onDayMouseEnter = this.props.onDayMouseEnter; 8776 8777 onDayMouseEnter(day, e); 8778 } 8779 8780 return onDayMouseEnter; 8781 }() 8782 }, { 8783 key: 'onDayMouseLeave', 8784 value: function () { 8785 function onDayMouseLeave(day, e) { 8786 var onDayMouseLeave = this.props.onDayMouseLeave; 8787 8788 onDayMouseLeave(day, e); 8789 } 8790 8791 return onDayMouseLeave; 8792 }() 8793 }, { 8794 key: 'onKeyDown', 8795 value: function () { 8796 function onKeyDown(day, e) { 8797 var onDayClick = this.props.onDayClick; 8798 var key = e.key; 8799 8800 if (key === 'Enter' || key === ' ') { 8801 onDayClick(day, e); 8802 } 8803 } 8804 8805 return onKeyDown; 8806 }() 8807 }, { 8808 key: 'setButtonRef', 8809 value: function () { 8810 function setButtonRef(ref) { 8811 this.buttonRef = ref; 8812 } 8813 8814 return setButtonRef; 8815 }() 8816 }, { 8817 key: 'render', 8818 value: function () { 8819 function render() { 8820 var _this2 = this; 8821 8822 var _props2 = this.props, 8823 day = _props2.day, 8824 ariaLabelFormat = _props2.ariaLabelFormat, 8825 daySize = _props2.daySize, 8826 isOutsideDay = _props2.isOutsideDay, 8827 modifiers = _props2.modifiers, 8828 renderDayContents = _props2.renderDayContents, 8829 tabIndex = _props2.tabIndex, 8830 styles = _props2.styles, 8831 phrases = _props2.phrases; 8832 8833 8834 if (!day) return _react2['default'].createElement('td', null); 8835 8836 var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases), 8837 daySizeStyles = _getCalendarDaySettin.daySizeStyles, 8838 useDefaultCursor = _getCalendarDaySettin.useDefaultCursor, 8839 selected = _getCalendarDaySettin.selected, 8840 hoveredSpan = _getCalendarDaySettin.hoveredSpan, 8841 isOutsideRange = _getCalendarDaySettin.isOutsideRange, 8842 ariaLabel = _getCalendarDaySettin.ariaLabel; 8843 8844 return _react2['default'].createElement( 8845 'td', 8846 _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), { 8847 role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role 8848 , ref: this.setButtonRef, 8849 'aria-label': ariaLabel, 8850 onMouseEnter: function () { 8851 function onMouseEnter(e) { 8852 _this2.onDayMouseEnter(day, e); 8853 } 8854 8855 return onMouseEnter; 8856 }(), 8857 onMouseLeave: function () { 8858 function onMouseLeave(e) { 8859 _this2.onDayMouseLeave(day, e); 8860 } 8861 8862 return onMouseLeave; 8863 }(), 8864 onMouseUp: function () { 8865 function onMouseUp(e) { 8866 e.currentTarget.blur(); 8867 } 8868 8869 return onMouseUp; 8870 }(), 8871 onClick: function () { 8872 function onClick(e) { 8873 _this2.onDayClick(day, e); 8874 } 8875 8876 return onClick; 8877 }(), 8878 onKeyDown: function () { 8879 function onKeyDown(e) { 8880 _this2.onKeyDown(day, e); 8881 } 8882 8883 return onKeyDown; 8884 }(), 8885 tabIndex: tabIndex 8886 }), 8887 renderDayContents ? renderDayContents(day, modifiers) : day.format('D') 8888 ); 8889 } 8890 8891 return render; 8892 }() 8893 }]); 8894 8895 return CalendarDay; 8896 }(_react2['default'].Component); 8897 8898 CalendarDay.propTypes = propTypes; 8899 CalendarDay.defaultProps = defaultProps; 8900 8901 exports.PureCalendarDay = CalendarDay; 8902 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) { 8903 var _ref2$reactDates = _ref2.reactDates, 8904 color = _ref2$reactDates.color, 8905 font = _ref2$reactDates.font; 8906 return { 8907 CalendarDay: { 8908 boxSizing: 'border-box', 8909 cursor: 'pointer', 8910 fontSize: font.size, 8911 textAlign: 'center', 8912 8913 ':active': { 8914 outline: 0 8915 } 8916 }, 8917 8918 CalendarDay__defaultCursor: { 8919 cursor: 'default' 8920 }, 8921 8922 CalendarDay__default: { 8923 border: '1px solid ' + String(color.core.borderLight), 8924 color: color.text, 8925 background: color.background, 8926 8927 ':hover': { 8928 background: color.core.borderLight, 8929 border: '1px double ' + String(color.core.borderLight), 8930 color: 'inherit' 8931 } 8932 }, 8933 8934 CalendarDay__hovered_offset: { 8935 background: color.core.borderBright, 8936 border: '1px double ' + String(color.core.borderLight), 8937 color: 'inherit' 8938 }, 8939 8940 CalendarDay__outside: { 8941 border: 0, 8942 background: color.outside.backgroundColor, 8943 color: color.outside.color, 8944 8945 ':hover': { 8946 border: 0 8947 } 8948 }, 8949 8950 CalendarDay__blocked_minimum_nights: { 8951 background: color.minimumNights.backgroundColor, 8952 border: '1px solid ' + String(color.minimumNights.borderColor), 8953 color: color.minimumNights.color, 8954 8955 ':hover': { 8956 background: color.minimumNights.backgroundColor_hover, 8957 color: color.minimumNights.color_active 8958 }, 8959 8960 ':active': { 8961 background: color.minimumNights.backgroundColor_active, 8962 color: color.minimumNights.color_active 8963 } 8964 }, 8965 8966 CalendarDay__highlighted_calendar: { 8967 background: color.highlighted.backgroundColor, 8968 color: color.highlighted.color, 8969 8970 ':hover': { 8971 background: color.highlighted.backgroundColor_hover, 8972 color: color.highlighted.color_active 8973 }, 8974 8975 ':active': { 8976 background: color.highlighted.backgroundColor_active, 8977 color: color.highlighted.color_active 8978 } 8979 }, 8980 8981 CalendarDay__selected_span: { 8982 background: color.selectedSpan.backgroundColor, 8983 border: '1px solid ' + String(color.selectedSpan.borderColor), 8984 color: color.selectedSpan.color, 8985 8986 ':hover': { 8987 background: color.selectedSpan.backgroundColor_hover, 8988 border: '1px solid ' + String(color.selectedSpan.borderColor), 8989 color: color.selectedSpan.color_active 8990 }, 8991 8992 ':active': { 8993 background: color.selectedSpan.backgroundColor_active, 8994 border: '1px solid ' + String(color.selectedSpan.borderColor), 8995 color: color.selectedSpan.color_active 8996 } 8997 }, 8998 8999 CalendarDay__last_in_range: { 9000 borderRight: color.core.primary 9001 }, 9002 9003 CalendarDay__selected: { 9004 background: color.selected.backgroundColor, 9005 border: '1px solid ' + String(color.selected.borderColor), 9006 color: color.selected.color, 9007 9008 ':hover': { 9009 background: color.selected.backgroundColor_hover, 9010 border: '1px solid ' + String(color.selected.borderColor), 9011 color: color.selected.color_active 9012 }, 9013 9014 ':active': { 9015 background: color.selected.backgroundColor_active, 9016 border: '1px solid ' + String(color.selected.borderColor), 9017 color: color.selected.color_active 9018 } 9019 }, 9020 9021 CalendarDay__hovered_span: { 9022 background: color.hoveredSpan.backgroundColor, 9023 border: '1px solid ' + String(color.hoveredSpan.borderColor), 9024 color: color.hoveredSpan.color, 9025 9026 ':hover': { 9027 background: color.hoveredSpan.backgroundColor_hover, 9028 border: '1px solid ' + String(color.hoveredSpan.borderColor), 9029 color: color.hoveredSpan.color_active 9030 }, 9031 9032 ':active': { 9033 background: color.hoveredSpan.backgroundColor_active, 9034 border: '1px solid ' + String(color.hoveredSpan.borderColor), 9035 color: color.hoveredSpan.color_active 9036 } 9037 }, 9038 9039 CalendarDay__blocked_calendar: { 9040 background: color.blocked_calendar.backgroundColor, 9041 border: '1px solid ' + String(color.blocked_calendar.borderColor), 9042 color: color.blocked_calendar.color, 9043 9044 ':hover': { 9045 background: color.blocked_calendar.backgroundColor_hover, 9046 border: '1px solid ' + String(color.blocked_calendar.borderColor), 9047 color: color.blocked_calendar.color_active 9048 }, 9049 9050 ':active': { 9051 background: color.blocked_calendar.backgroundColor_active, 9052 border: '1px solid ' + String(color.blocked_calendar.borderColor), 9053 color: color.blocked_calendar.color_active 9054 } 9055 }, 9056 9057 CalendarDay__blocked_out_of_range: { 9058 background: color.blocked_out_of_range.backgroundColor, 9059 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 9060 color: color.blocked_out_of_range.color, 9061 9062 ':hover': { 9063 background: color.blocked_out_of_range.backgroundColor_hover, 9064 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 9065 color: color.blocked_out_of_range.color_active 9066 }, 9067 9068 ':active': { 9069 background: color.blocked_out_of_range.backgroundColor_active, 9070 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 9071 color: color.blocked_out_of_range.color_active 9072 } 9073 }, 9074 9075 CalendarDay__selected_start: {}, 9076 CalendarDay__selected_end: {}, 9077 CalendarDay__today: {}, 9078 CalendarDay__firstDayOfWeek: {}, 9079 CalendarDay__lastDayOfWeek: {} 9080 }; 9081 })(CalendarDay); 9082 9083 /***/ }), 9084 9085 /***/ "NMb1": 9086 /***/ (function(module, exports) { 9087 9088 (function() { module.exports = window["wp"]["deprecated"]; }()); 9089 9090 /***/ }), 9091 9092 /***/ "NTP4": 9093 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9094 9095 "use strict"; 9096 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 9097 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 9098 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 9099 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 9100 9101 9102 /** 9103 * WordPress dependencies 9104 */ 9105 9106 const upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 9107 xmlns: "http://www.w3.org/2000/svg", 9108 viewBox: "0 0 24 24" 9109 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 9110 d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" 9111 })); 9112 /* harmony default export */ __webpack_exports__["a"] = (upload); 9113 9114 9115 /***/ }), 9116 9117 /***/ "NWDH": 9118 /***/ (function(module, __webpack_exports__, __webpack_require__) { 9119 9120 "use strict"; 9121 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 9122 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 9123 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 9124 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 9125 9126 9127 /** 9128 * WordPress dependencies 9129 */ 9130 9131 const chevronDown = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 9132 viewBox: "0 0 24 24", 9133 xmlns: "http://www.w3.org/2000/svg" 9134 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 9135 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" 9136 })); 9137 /* harmony default export */ __webpack_exports__["a"] = (chevronDown); 9138 9139 9140 /***/ }), 9141 9142 /***/ "Nho6": 9143 /***/ (function(module, exports, __webpack_require__) { 9144 9145 "use strict"; 9146 9147 9148 Object.defineProperty(exports, "__esModule", { 9149 value: true 9150 }); 9151 exports['default'] = isAfterDay; 9152 9153 var _moment = __webpack_require__("wy2R"); 9154 9155 var _moment2 = _interopRequireDefault(_moment); 9156 9157 var _isBeforeDay = __webpack_require__("h6xH"); 9158 9159 var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay); 9160 9161 var _isSameDay = __webpack_require__("pRvc"); 9162 9163 var _isSameDay2 = _interopRequireDefault(_isSameDay); 9164 9165 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9166 9167 function isAfterDay(a, b) { 9168 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 9169 return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b); 9170 } 9171 9172 /***/ }), 9173 9174 /***/ "Nloh": 9175 /***/ (function(module, exports, __webpack_require__) { 9176 9177 "use strict"; 9178 9179 9180 Object.defineProperty(exports, "__esModule", { 9181 value: true 9182 }); 9183 exports.PureDayPicker = exports.defaultProps = undefined; 9184 9185 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; }; 9186 9187 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; }; }(); 9188 9189 var _object = __webpack_require__("Koq/"); 9190 9191 var _object2 = _interopRequireDefault(_object); 9192 9193 var _react = __webpack_require__("cDcd"); 9194 9195 var _react2 = _interopRequireDefault(_react); 9196 9197 var _propTypes = __webpack_require__("17x9"); 9198 9199 var _propTypes2 = _interopRequireDefault(_propTypes); 9200 9201 var _reactAddonsShallowCompare = __webpack_require__("YZDV"); 9202 9203 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 9204 9205 var _airbnbPropTypes = __webpack_require__("Hsqg"); 9206 9207 var _reactWithStyles = __webpack_require__("TG4+"); 9208 9209 var _moment = __webpack_require__("wy2R"); 9210 9211 var _moment2 = _interopRequireDefault(_moment); 9212 9213 var _throttle = __webpack_require__("DzJC"); 9214 9215 var _throttle2 = _interopRequireDefault(_throttle); 9216 9217 var _isTouchDevice = __webpack_require__("LTAC"); 9218 9219 var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice); 9220 9221 var _reactOutsideClickHandler = __webpack_require__("3gBW"); 9222 9223 var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler); 9224 9225 var _defaultPhrases = __webpack_require__("vV+G"); 9226 9227 var _getPhrasePropTypes = __webpack_require__("yc2e"); 9228 9229 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 9230 9231 var _CalendarMonthGrid = __webpack_require__("Thzv"); 9232 9233 var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid); 9234 9235 var _DayPickerNavigation = __webpack_require__("zfJ5"); 9236 9237 var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation); 9238 9239 var _DayPickerKeyboardShortcuts = __webpack_require__("1+Kn"); 9240 9241 var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts); 9242 9243 var _getNumberOfCalendarMonthWeeks = __webpack_require__("0Dl3"); 9244 9245 var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks); 9246 9247 var _getCalendarMonthWidth = __webpack_require__("m2ax"); 9248 9249 var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth); 9250 9251 var _calculateDimension = __webpack_require__("ixyq"); 9252 9253 var _calculateDimension2 = _interopRequireDefault(_calculateDimension); 9254 9255 var _getActiveElement = __webpack_require__("+51k"); 9256 9257 var _getActiveElement2 = _interopRequireDefault(_getActiveElement); 9258 9259 var _isDayVisible = __webpack_require__("IgE5"); 9260 9261 var _isDayVisible2 = _interopRequireDefault(_isDayVisible); 9262 9263 var _ModifiersShape = __webpack_require__("J7JS"); 9264 9265 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 9266 9267 var _ScrollableOrientationShape = __webpack_require__("aE6U"); 9268 9269 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 9270 9271 var _DayOfWeekShape = __webpack_require__("2S2E"); 9272 9273 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 9274 9275 var _CalendarInfoPositionShape = __webpack_require__("oR9Z"); 9276 9277 var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape); 9278 9279 var _constants = __webpack_require__("Fv1B"); 9280 9281 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9282 9283 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); } } 9284 9285 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9286 9287 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; } 9288 9289 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; } 9290 9291 var MONTH_PADDING = 23; 9292 var PREV_TRANSITION = 'prev'; 9293 var NEXT_TRANSITION = 'next'; 9294 var MONTH_SELECTION_TRANSITION = 'month_selection'; 9295 var YEAR_SELECTION_TRANSITION = 'year_selection'; 9296 9297 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 9298 9299 // calendar presentation props 9300 enableOutsideDays: _propTypes2['default'].bool, 9301 numberOfMonths: _propTypes2['default'].number, 9302 orientation: _ScrollableOrientationShape2['default'], 9303 withPortal: _propTypes2['default'].bool, 9304 onOutsideClick: _propTypes2['default'].func, 9305 hidden: _propTypes2['default'].bool, 9306 initialVisibleMonth: _propTypes2['default'].func, 9307 firstDayOfWeek: _DayOfWeekShape2['default'], 9308 renderCalendarInfo: _propTypes2['default'].func, 9309 calendarInfoPosition: _CalendarInfoPositionShape2['default'], 9310 hideKeyboardShortcutsPanel: _propTypes2['default'].bool, 9311 daySize: _airbnbPropTypes.nonNegativeInteger, 9312 isRTL: _propTypes2['default'].bool, 9313 verticalHeight: _airbnbPropTypes.nonNegativeInteger, 9314 noBorder: _propTypes2['default'].bool, 9315 transitionDuration: _airbnbPropTypes.nonNegativeInteger, 9316 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 9317 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 9318 9319 // navigation props 9320 navPrev: _propTypes2['default'].node, 9321 navNext: _propTypes2['default'].node, 9322 noNavButtons: _propTypes2['default'].bool, 9323 onPrevMonthClick: _propTypes2['default'].func, 9324 onNextMonthClick: _propTypes2['default'].func, 9325 onMonthChange: _propTypes2['default'].func, 9326 onYearChange: _propTypes2['default'].func, 9327 onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only 9328 9329 // month props 9330 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 9331 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 9332 9333 // day props 9334 modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])), 9335 renderCalendarDay: _propTypes2['default'].func, 9336 renderDayContents: _propTypes2['default'].func, 9337 onDayClick: _propTypes2['default'].func, 9338 onDayMouseEnter: _propTypes2['default'].func, 9339 onDayMouseLeave: _propTypes2['default'].func, 9340 9341 // accessibility props 9342 isFocused: _propTypes2['default'].bool, 9343 getFirstFocusableDay: _propTypes2['default'].func, 9344 onBlur: _propTypes2['default'].func, 9345 showKeyboardShortcuts: _propTypes2['default'].bool, 9346 9347 // internationalization 9348 monthFormat: _propTypes2['default'].string, 9349 weekDayFormat: _propTypes2['default'].string, 9350 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)), 9351 dayAriaLabelFormat: _propTypes2['default'].string 9352 })); 9353 9354 var defaultProps = exports.defaultProps = { 9355 // calendar presentation props 9356 enableOutsideDays: false, 9357 numberOfMonths: 2, 9358 orientation: _constants.HORIZONTAL_ORIENTATION, 9359 withPortal: false, 9360 onOutsideClick: function () { 9361 function onOutsideClick() {} 9362 9363 return onOutsideClick; 9364 }(), 9365 9366 hidden: false, 9367 initialVisibleMonth: function () { 9368 function initialVisibleMonth() { 9369 return (0, _moment2['default'])(); 9370 } 9371 9372 return initialVisibleMonth; 9373 }(), 9374 firstDayOfWeek: null, 9375 renderCalendarInfo: null, 9376 calendarInfoPosition: _constants.INFO_POSITION_BOTTOM, 9377 hideKeyboardShortcutsPanel: false, 9378 daySize: _constants.DAY_SIZE, 9379 isRTL: false, 9380 verticalHeight: null, 9381 noBorder: false, 9382 transitionDuration: undefined, 9383 verticalBorderSpacing: undefined, 9384 horizontalMonthPadding: 13, 9385 9386 // navigation props 9387 navPrev: null, 9388 navNext: null, 9389 noNavButtons: false, 9390 onPrevMonthClick: function () { 9391 function onPrevMonthClick() {} 9392 9393 return onPrevMonthClick; 9394 }(), 9395 onNextMonthClick: function () { 9396 function onNextMonthClick() {} 9397 9398 return onNextMonthClick; 9399 }(), 9400 onMonthChange: function () { 9401 function onMonthChange() {} 9402 9403 return onMonthChange; 9404 }(), 9405 onYearChange: function () { 9406 function onYearChange() {} 9407 9408 return onYearChange; 9409 }(), 9410 onMultiplyScrollableMonths: function () { 9411 function onMultiplyScrollableMonths() {} 9412 9413 return onMultiplyScrollableMonths; 9414 }(), 9415 9416 9417 // month props 9418 renderMonthText: null, 9419 renderMonthElement: null, 9420 9421 // day props 9422 modifiers: {}, 9423 renderCalendarDay: undefined, 9424 renderDayContents: null, 9425 onDayClick: function () { 9426 function onDayClick() {} 9427 9428 return onDayClick; 9429 }(), 9430 onDayMouseEnter: function () { 9431 function onDayMouseEnter() {} 9432 9433 return onDayMouseEnter; 9434 }(), 9435 onDayMouseLeave: function () { 9436 function onDayMouseLeave() {} 9437 9438 return onDayMouseLeave; 9439 }(), 9440 9441 9442 // accessibility props 9443 isFocused: false, 9444 getFirstFocusableDay: null, 9445 onBlur: function () { 9446 function onBlur() {} 9447 9448 return onBlur; 9449 }(), 9450 9451 showKeyboardShortcuts: false, 9452 9453 // internationalization 9454 monthFormat: 'MMMM YYYY', 9455 weekDayFormat: 'dd', 9456 phrases: _defaultPhrases.DayPickerPhrases, 9457 dayAriaLabelFormat: undefined 9458 }; 9459 9460 var DayPicker = function (_React$Component) { 9461 _inherits(DayPicker, _React$Component); 9462 9463 function DayPicker(props) { 9464 _classCallCheck(this, DayPicker); 9465 9466 var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props)); 9467 9468 var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth(); 9469 9470 var focusedDate = currentMonth.clone().startOf('month'); 9471 if (props.getFirstFocusableDay) { 9472 focusedDate = props.getFirstFocusableDay(currentMonth); 9473 } 9474 9475 var horizontalMonthPadding = props.horizontalMonthPadding; 9476 9477 9478 var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0; 9479 9480 _this.hasSetInitialVisibleMonth = !props.hidden; 9481 _this.state = { 9482 currentMonth: currentMonth, 9483 monthTransition: null, 9484 translationValue: translationValue, 9485 scrollableMonthMultiple: 1, 9486 calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding), 9487 focusedDate: !props.hidden || props.isFocused ? focusedDate : null, 9488 nextFocusedDate: null, 9489 showKeyboardShortcuts: props.showKeyboardShortcuts, 9490 onKeyboardShortcutsPanelClose: function () { 9491 function onKeyboardShortcutsPanelClose() {} 9492 9493 return onKeyboardShortcutsPanelClose; 9494 }(), 9495 9496 isTouchDevice: (0, _isTouchDevice2['default'])(), 9497 withMouseInteractions: true, 9498 calendarInfoWidth: 0, 9499 monthTitleHeight: null, 9500 hasSetHeight: false 9501 }; 9502 9503 _this.setCalendarMonthWeeks(currentMonth); 9504 9505 _this.calendarMonthGridHeight = 0; 9506 _this.setCalendarInfoWidthTimeout = null; 9507 9508 _this.onKeyDown = _this.onKeyDown.bind(_this); 9509 _this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false }); 9510 _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this); 9511 _this.onNextMonthClick = _this.onNextMonthClick.bind(_this); 9512 _this.onMonthChange = _this.onMonthChange.bind(_this); 9513 _this.onYearChange = _this.onYearChange.bind(_this); 9514 9515 _this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this); 9516 _this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this); 9517 9518 _this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this); 9519 _this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this); 9520 9521 _this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this); 9522 _this.setContainerRef = _this.setContainerRef.bind(_this); 9523 _this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this); 9524 _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this); 9525 return _this; 9526 } 9527 9528 _createClass(DayPicker, [{ 9529 key: 'componentDidMount', 9530 value: function () { 9531 function componentDidMount() { 9532 var currentMonth = this.state.currentMonth; 9533 9534 if (this.calendarInfo) { 9535 this.setState({ 9536 isTouchDevice: (0, _isTouchDevice2['default'])(), 9537 calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true) 9538 }); 9539 } else { 9540 this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() }); 9541 } 9542 9543 this.setCalendarMonthWeeks(currentMonth); 9544 } 9545 9546 return componentDidMount; 9547 }() 9548 }, { 9549 key: 'componentWillReceiveProps', 9550 value: function () { 9551 function componentWillReceiveProps(nextProps) { 9552 var hidden = nextProps.hidden, 9553 isFocused = nextProps.isFocused, 9554 showKeyboardShortcuts = nextProps.showKeyboardShortcuts, 9555 onBlur = nextProps.onBlur, 9556 renderMonthText = nextProps.renderMonthText, 9557 horizontalMonthPadding = nextProps.horizontalMonthPadding; 9558 var currentMonth = this.state.currentMonth; 9559 9560 9561 if (!hidden) { 9562 if (!this.hasSetInitialVisibleMonth) { 9563 this.hasSetInitialVisibleMonth = true; 9564 this.setState({ 9565 currentMonth: nextProps.initialVisibleMonth() 9566 }); 9567 } 9568 } 9569 9570 var _props = this.props, 9571 daySize = _props.daySize, 9572 prevIsFocused = _props.isFocused, 9573 prevRenderMonthText = _props.renderMonthText; 9574 9575 9576 if (nextProps.daySize !== daySize) { 9577 this.setState({ 9578 calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding) 9579 }); 9580 } 9581 9582 if (isFocused !== prevIsFocused) { 9583 if (isFocused) { 9584 var focusedDate = this.getFocusedDay(currentMonth); 9585 9586 var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose; 9587 9588 if (nextProps.showKeyboardShortcuts) { 9589 // the ? shortcut came from the input and we should return input there once it is close 9590 onKeyboardShortcutsPanelClose = onBlur; 9591 } 9592 9593 this.setState({ 9594 showKeyboardShortcuts: showKeyboardShortcuts, 9595 onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose, 9596 focusedDate: focusedDate, 9597 withMouseInteractions: false 9598 }); 9599 } else { 9600 this.setState({ focusedDate: null }); 9601 } 9602 } 9603 9604 if (renderMonthText !== prevRenderMonthText) { 9605 this.setState({ 9606 monthTitleHeight: null 9607 }); 9608 } 9609 } 9610 9611 return componentWillReceiveProps; 9612 }() 9613 }, { 9614 key: 'shouldComponentUpdate', 9615 value: function () { 9616 function shouldComponentUpdate(nextProps, nextState) { 9617 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 9618 } 9619 9620 return shouldComponentUpdate; 9621 }() 9622 }, { 9623 key: 'componentWillUpdate', 9624 value: function () { 9625 function componentWillUpdate() { 9626 var _this2 = this; 9627 9628 var transitionDuration = this.props.transitionDuration; 9629 9630 // Calculating the dimensions trigger a DOM repaint which 9631 // breaks the CSS transition. 9632 // The setTimeout will wait until the transition ends. 9633 9634 if (this.calendarInfo) { 9635 this.setCalendarInfoWidthTimeout = setTimeout(function () { 9636 var calendarInfoWidth = _this2.state.calendarInfoWidth; 9637 9638 var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true); 9639 if (calendarInfoWidth !== calendarInfoPanelWidth) { 9640 _this2.setState({ 9641 calendarInfoWidth: calendarInfoPanelWidth 9642 }); 9643 } 9644 }, transitionDuration); 9645 } 9646 } 9647 9648 return componentWillUpdate; 9649 }() 9650 }, { 9651 key: 'componentDidUpdate', 9652 value: function () { 9653 function componentDidUpdate(prevProps) { 9654 var _props2 = this.props, 9655 orientation = _props2.orientation, 9656 daySize = _props2.daySize, 9657 isFocused = _props2.isFocused, 9658 numberOfMonths = _props2.numberOfMonths; 9659 var _state = this.state, 9660 focusedDate = _state.focusedDate, 9661 monthTitleHeight = _state.monthTitleHeight; 9662 9663 9664 if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) { 9665 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1); 9666 var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 9667 var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1; 9668 this.adjustDayPickerHeight(newMonthHeight); 9669 } 9670 9671 if (!prevProps.isFocused && isFocused && !focusedDate) { 9672 this.container.focus(); 9673 } 9674 } 9675 9676 return componentDidUpdate; 9677 }() 9678 }, { 9679 key: 'componentWillUnmount', 9680 value: function () { 9681 function componentWillUnmount() { 9682 clearTimeout(this.setCalendarInfoWidthTimeout); 9683 } 9684 9685 return componentWillUnmount; 9686 }() 9687 }, { 9688 key: 'onKeyDown', 9689 value: function () { 9690 function onKeyDown(e) { 9691 e.stopPropagation(); 9692 if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) { 9693 this.throttledKeyDown(e); 9694 } 9695 } 9696 9697 return onKeyDown; 9698 }() 9699 }, { 9700 key: 'onFinalKeyDown', 9701 value: function () { 9702 function onFinalKeyDown(e) { 9703 this.setState({ withMouseInteractions: false }); 9704 9705 var _props3 = this.props, 9706 onBlur = _props3.onBlur, 9707 isRTL = _props3.isRTL; 9708 var _state2 = this.state, 9709 focusedDate = _state2.focusedDate, 9710 showKeyboardShortcuts = _state2.showKeyboardShortcuts; 9711 9712 if (!focusedDate) return; 9713 9714 var newFocusedDate = focusedDate.clone(); 9715 9716 var didTransitionMonth = false; 9717 9718 // focus might be anywhere when the keyboard shortcuts panel is opened so we want to 9719 // return it to wherever it was before when the panel was opened 9720 var activeElement = (0, _getActiveElement2['default'])(); 9721 var onKeyboardShortcutsPanelClose = function () { 9722 function onKeyboardShortcutsPanelClose() { 9723 if (activeElement) activeElement.focus(); 9724 } 9725 9726 return onKeyboardShortcutsPanelClose; 9727 }(); 9728 9729 switch (e.key) { 9730 case 'ArrowUp': 9731 e.preventDefault(); 9732 newFocusedDate.subtract(1, 'week'); 9733 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 9734 break; 9735 case 'ArrowLeft': 9736 e.preventDefault(); 9737 if (isRTL) { 9738 newFocusedDate.add(1, 'day'); 9739 } else { 9740 newFocusedDate.subtract(1, 'day'); 9741 } 9742 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 9743 break; 9744 case 'Home': 9745 e.preventDefault(); 9746 newFocusedDate.startOf('week'); 9747 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 9748 break; 9749 case 'PageUp': 9750 e.preventDefault(); 9751 newFocusedDate.subtract(1, 'month'); 9752 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 9753 break; 9754 9755 case 'ArrowDown': 9756 e.preventDefault(); 9757 newFocusedDate.add(1, 'week'); 9758 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 9759 break; 9760 case 'ArrowRight': 9761 e.preventDefault(); 9762 if (isRTL) { 9763 newFocusedDate.subtract(1, 'day'); 9764 } else { 9765 newFocusedDate.add(1, 'day'); 9766 } 9767 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 9768 break; 9769 case 'End': 9770 e.preventDefault(); 9771 newFocusedDate.endOf('week'); 9772 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 9773 break; 9774 case 'PageDown': 9775 e.preventDefault(); 9776 newFocusedDate.add(1, 'month'); 9777 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 9778 break; 9779 9780 case '?': 9781 this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose); 9782 break; 9783 9784 case 'Escape': 9785 if (showKeyboardShortcuts) { 9786 this.closeKeyboardShortcutsPanel(); 9787 } else { 9788 onBlur(); 9789 } 9790 break; 9791 9792 default: 9793 break; 9794 } 9795 9796 // If there was a month transition, do not update the focused date until the transition has 9797 // completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If 9798 // didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition 9799 if (!didTransitionMonth) { 9800 this.setState({ 9801 focusedDate: newFocusedDate 9802 }); 9803 } 9804 } 9805 9806 return onFinalKeyDown; 9807 }() 9808 }, { 9809 key: 'onPrevMonthClick', 9810 value: function () { 9811 function onPrevMonthClick(nextFocusedDate, e) { 9812 var _props4 = this.props, 9813 daySize = _props4.daySize, 9814 isRTL = _props4.isRTL, 9815 numberOfMonths = _props4.numberOfMonths; 9816 var _state3 = this.state, 9817 calendarMonthWidth = _state3.calendarMonthWidth, 9818 monthTitleHeight = _state3.monthTitleHeight; 9819 9820 9821 if (e) e.preventDefault(); 9822 9823 var translationValue = void 0; 9824 if (this.isVertical()) { 9825 var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1); 9826 translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1; 9827 } else if (this.isHorizontal()) { 9828 translationValue = calendarMonthWidth; 9829 if (isRTL) { 9830 translationValue = -2 * calendarMonthWidth; 9831 } 9832 9833 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths); 9834 var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 9835 var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1; 9836 this.adjustDayPickerHeight(newMonthHeight); 9837 } 9838 9839 this.setState({ 9840 monthTransition: PREV_TRANSITION, 9841 translationValue: translationValue, 9842 focusedDate: null, 9843 nextFocusedDate: nextFocusedDate 9844 }); 9845 } 9846 9847 return onPrevMonthClick; 9848 }() 9849 }, { 9850 key: 'onMonthChange', 9851 value: function () { 9852 function onMonthChange(currentMonth) { 9853 this.setCalendarMonthWeeks(currentMonth); 9854 this.calculateAndSetDayPickerHeight(); 9855 9856 // Translation value is a hack to force an invisible transition that 9857 // properly rerenders the CalendarMonthGrid 9858 this.setState({ 9859 monthTransition: MONTH_SELECTION_TRANSITION, 9860 translationValue: 0.00001, 9861 focusedDate: null, 9862 nextFocusedDate: currentMonth, 9863 currentMonth: currentMonth 9864 }); 9865 } 9866 9867 return onMonthChange; 9868 }() 9869 }, { 9870 key: 'onYearChange', 9871 value: function () { 9872 function onYearChange(currentMonth) { 9873 this.setCalendarMonthWeeks(currentMonth); 9874 this.calculateAndSetDayPickerHeight(); 9875 9876 // Translation value is a hack to force an invisible transition that 9877 // properly rerenders the CalendarMonthGrid 9878 this.setState({ 9879 monthTransition: YEAR_SELECTION_TRANSITION, 9880 translationValue: 0.0001, 9881 focusedDate: null, 9882 nextFocusedDate: currentMonth, 9883 currentMonth: currentMonth 9884 }); 9885 } 9886 9887 return onYearChange; 9888 }() 9889 }, { 9890 key: 'onNextMonthClick', 9891 value: function () { 9892 function onNextMonthClick(nextFocusedDate, e) { 9893 var _props5 = this.props, 9894 isRTL = _props5.isRTL, 9895 numberOfMonths = _props5.numberOfMonths, 9896 daySize = _props5.daySize; 9897 var _state4 = this.state, 9898 calendarMonthWidth = _state4.calendarMonthWidth, 9899 monthTitleHeight = _state4.monthTitleHeight; 9900 9901 9902 if (e) e.preventDefault(); 9903 9904 var translationValue = void 0; 9905 9906 if (this.isVertical()) { 9907 var firstVisibleMonthWeeks = this.calendarMonthWeeks[1]; 9908 var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1); 9909 translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1); 9910 } 9911 9912 if (this.isHorizontal()) { 9913 translationValue = -calendarMonthWidth; 9914 if (isRTL) { 9915 translationValue = 0; 9916 } 9917 9918 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2); 9919 var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 9920 var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1; 9921 this.adjustDayPickerHeight(newMonthHeight); 9922 } 9923 9924 this.setState({ 9925 monthTransition: NEXT_TRANSITION, 9926 translationValue: translationValue, 9927 focusedDate: null, 9928 nextFocusedDate: nextFocusedDate 9929 }); 9930 } 9931 9932 return onNextMonthClick; 9933 }() 9934 }, { 9935 key: 'getFirstDayOfWeek', 9936 value: function () { 9937 function getFirstDayOfWeek() { 9938 var firstDayOfWeek = this.props.firstDayOfWeek; 9939 9940 if (firstDayOfWeek == null) { 9941 return _moment2['default'].localeData().firstDayOfWeek(); 9942 } 9943 9944 return firstDayOfWeek; 9945 } 9946 9947 return getFirstDayOfWeek; 9948 }() 9949 }, { 9950 key: 'getFirstVisibleIndex', 9951 value: function () { 9952 function getFirstVisibleIndex() { 9953 var orientation = this.props.orientation; 9954 var monthTransition = this.state.monthTransition; 9955 9956 9957 if (orientation === _constants.VERTICAL_SCROLLABLE) return 0; 9958 9959 var firstVisibleMonthIndex = 1; 9960 if (monthTransition === PREV_TRANSITION) { 9961 firstVisibleMonthIndex -= 1; 9962 } else if (monthTransition === NEXT_TRANSITION) { 9963 firstVisibleMonthIndex += 1; 9964 } 9965 9966 return firstVisibleMonthIndex; 9967 } 9968 9969 return getFirstVisibleIndex; 9970 }() 9971 }, { 9972 key: 'getFocusedDay', 9973 value: function () { 9974 function getFocusedDay(newMonth) { 9975 var _props6 = this.props, 9976 getFirstFocusableDay = _props6.getFirstFocusableDay, 9977 numberOfMonths = _props6.numberOfMonths; 9978 9979 9980 var focusedDate = void 0; 9981 if (getFirstFocusableDay) { 9982 focusedDate = getFirstFocusableDay(newMonth); 9983 } 9984 9985 if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) { 9986 focusedDate = newMonth.clone().startOf('month'); 9987 } 9988 9989 return focusedDate; 9990 } 9991 9992 return getFocusedDay; 9993 }() 9994 }, { 9995 key: 'setMonthTitleHeight', 9996 value: function () { 9997 function setMonthTitleHeight(monthTitleHeight) { 9998 var _this3 = this; 9999 10000 this.setState({ 10001 monthTitleHeight: monthTitleHeight 10002 }, function () { 10003 _this3.calculateAndSetDayPickerHeight(); 10004 }); 10005 } 10006 10007 return setMonthTitleHeight; 10008 }() 10009 }, { 10010 key: 'setCalendarMonthWeeks', 10011 value: function () { 10012 function setCalendarMonthWeeks(currentMonth) { 10013 var numberOfMonths = this.props.numberOfMonths; 10014 10015 10016 this.calendarMonthWeeks = []; 10017 var month = currentMonth.clone().subtract(1, 'months'); 10018 var firstDayOfWeek = this.getFirstDayOfWeek(); 10019 for (var i = 0; i < numberOfMonths + 2; i += 1) { 10020 var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek); 10021 this.calendarMonthWeeks.push(numberOfWeeks); 10022 month = month.add(1, 'months'); 10023 } 10024 } 10025 10026 return setCalendarMonthWeeks; 10027 }() 10028 }, { 10029 key: 'setContainerRef', 10030 value: function () { 10031 function setContainerRef(ref) { 10032 this.container = ref; 10033 } 10034 10035 return setContainerRef; 10036 }() 10037 }, { 10038 key: 'setCalendarInfoRef', 10039 value: function () { 10040 function setCalendarInfoRef(ref) { 10041 this.calendarInfo = ref; 10042 } 10043 10044 return setCalendarInfoRef; 10045 }() 10046 }, { 10047 key: 'setTransitionContainerRef', 10048 value: function () { 10049 function setTransitionContainerRef(ref) { 10050 this.transitionContainer = ref; 10051 } 10052 10053 return setTransitionContainerRef; 10054 }() 10055 }, { 10056 key: 'maybeTransitionNextMonth', 10057 value: function () { 10058 function maybeTransitionNextMonth(newFocusedDate) { 10059 var numberOfMonths = this.props.numberOfMonths; 10060 var _state5 = this.state, 10061 currentMonth = _state5.currentMonth, 10062 focusedDate = _state5.focusedDate; 10063 10064 10065 var newFocusedDateMonth = newFocusedDate.month(); 10066 var focusedDateMonth = focusedDate.month(); 10067 var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths); 10068 if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) { 10069 this.onNextMonthClick(newFocusedDate); 10070 return true; 10071 } 10072 10073 return false; 10074 } 10075 10076 return maybeTransitionNextMonth; 10077 }() 10078 }, { 10079 key: 'maybeTransitionPrevMonth', 10080 value: function () { 10081 function maybeTransitionPrevMonth(newFocusedDate) { 10082 var numberOfMonths = this.props.numberOfMonths; 10083 var _state6 = this.state, 10084 currentMonth = _state6.currentMonth, 10085 focusedDate = _state6.focusedDate; 10086 10087 10088 var newFocusedDateMonth = newFocusedDate.month(); 10089 var focusedDateMonth = focusedDate.month(); 10090 var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths); 10091 if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) { 10092 this.onPrevMonthClick(newFocusedDate); 10093 return true; 10094 } 10095 10096 return false; 10097 } 10098 10099 return maybeTransitionPrevMonth; 10100 }() 10101 }, { 10102 key: 'multiplyScrollableMonths', 10103 value: function () { 10104 function multiplyScrollableMonths(e) { 10105 var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths; 10106 10107 if (e) e.preventDefault(); 10108 10109 if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e); 10110 10111 this.setState(function (_ref) { 10112 var scrollableMonthMultiple = _ref.scrollableMonthMultiple; 10113 return { 10114 scrollableMonthMultiple: scrollableMonthMultiple + 1 10115 }; 10116 }); 10117 } 10118 10119 return multiplyScrollableMonths; 10120 }() 10121 }, { 10122 key: 'isHorizontal', 10123 value: function () { 10124 function isHorizontal() { 10125 var orientation = this.props.orientation; 10126 10127 return orientation === _constants.HORIZONTAL_ORIENTATION; 10128 } 10129 10130 return isHorizontal; 10131 }() 10132 }, { 10133 key: 'isVertical', 10134 value: function () { 10135 function isVertical() { 10136 var orientation = this.props.orientation; 10137 10138 return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE; 10139 } 10140 10141 return isVertical; 10142 }() 10143 }, { 10144 key: 'updateStateAfterMonthTransition', 10145 value: function () { 10146 function updateStateAfterMonthTransition() { 10147 var _this4 = this; 10148 10149 var _props7 = this.props, 10150 onPrevMonthClick = _props7.onPrevMonthClick, 10151 onNextMonthClick = _props7.onNextMonthClick, 10152 numberOfMonths = _props7.numberOfMonths, 10153 onMonthChange = _props7.onMonthChange, 10154 onYearChange = _props7.onYearChange, 10155 isRTL = _props7.isRTL; 10156 var _state7 = this.state, 10157 currentMonth = _state7.currentMonth, 10158 monthTransition = _state7.monthTransition, 10159 focusedDate = _state7.focusedDate, 10160 nextFocusedDate = _state7.nextFocusedDate, 10161 withMouseInteractions = _state7.withMouseInteractions, 10162 calendarMonthWidth = _state7.calendarMonthWidth; 10163 10164 10165 if (!monthTransition) return; 10166 10167 var newMonth = currentMonth.clone(); 10168 var firstDayOfWeek = this.getFirstDayOfWeek(); 10169 if (monthTransition === PREV_TRANSITION) { 10170 newMonth.subtract(1, 'month'); 10171 if (onPrevMonthClick) onPrevMonthClick(newMonth); 10172 var newInvisibleMonth = newMonth.clone().subtract(1, 'month'); 10173 var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek); 10174 this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1))); 10175 } else if (monthTransition === NEXT_TRANSITION) { 10176 newMonth.add(1, 'month'); 10177 if (onNextMonthClick) onNextMonthClick(newMonth); 10178 var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month'); 10179 var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek); 10180 this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]); 10181 } else if (monthTransition === MONTH_SELECTION_TRANSITION) { 10182 if (onMonthChange) onMonthChange(newMonth); 10183 } else if (monthTransition === YEAR_SELECTION_TRANSITION) { 10184 if (onYearChange) onYearChange(newMonth); 10185 } 10186 10187 var newFocusedDate = null; 10188 if (nextFocusedDate) { 10189 newFocusedDate = nextFocusedDate; 10190 } else if (!focusedDate && !withMouseInteractions) { 10191 newFocusedDate = this.getFocusedDay(newMonth); 10192 } 10193 10194 this.setState({ 10195 currentMonth: newMonth, 10196 monthTransition: null, 10197 translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0, 10198 nextFocusedDate: null, 10199 focusedDate: newFocusedDate 10200 }, function () { 10201 // we don't want to focus on the relevant calendar day after a month transition 10202 // if the user is navigating around using a mouse 10203 if (withMouseInteractions) { 10204 var activeElement = (0, _getActiveElement2['default'])(); 10205 if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) { 10206 activeElement.blur(); 10207 } 10208 } 10209 }); 10210 } 10211 10212 return updateStateAfterMonthTransition; 10213 }() 10214 }, { 10215 key: 'adjustDayPickerHeight', 10216 value: function () { 10217 function adjustDayPickerHeight(newMonthHeight) { 10218 var _this5 = this; 10219 10220 var monthHeight = newMonthHeight + MONTH_PADDING; 10221 if (monthHeight !== this.calendarMonthGridHeight) { 10222 this.transitionContainer.style.height = String(monthHeight) + 'px'; 10223 if (!this.calendarMonthGridHeight) { 10224 setTimeout(function () { 10225 _this5.setState({ hasSetHeight: true }); 10226 }, 0); 10227 } 10228 this.calendarMonthGridHeight = monthHeight; 10229 } 10230 } 10231 10232 return adjustDayPickerHeight; 10233 }() 10234 }, { 10235 key: 'calculateAndSetDayPickerHeight', 10236 value: function () { 10237 function calculateAndSetDayPickerHeight() { 10238 var _props8 = this.props, 10239 daySize = _props8.daySize, 10240 numberOfMonths = _props8.numberOfMonths; 10241 var monthTitleHeight = this.state.monthTitleHeight; 10242 10243 10244 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1); 10245 var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 10246 var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1; 10247 10248 if (this.isHorizontal()) { 10249 this.adjustDayPickerHeight(newMonthHeight); 10250 } 10251 } 10252 10253 return calculateAndSetDayPickerHeight; 10254 }() 10255 }, { 10256 key: 'openKeyboardShortcutsPanel', 10257 value: function () { 10258 function openKeyboardShortcutsPanel(onCloseCallBack) { 10259 this.setState({ 10260 showKeyboardShortcuts: true, 10261 onKeyboardShortcutsPanelClose: onCloseCallBack 10262 }); 10263 } 10264 10265 return openKeyboardShortcutsPanel; 10266 }() 10267 }, { 10268 key: 'closeKeyboardShortcutsPanel', 10269 value: function () { 10270 function closeKeyboardShortcutsPanel() { 10271 var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose; 10272 10273 10274 if (onKeyboardShortcutsPanelClose) { 10275 onKeyboardShortcutsPanelClose(); 10276 } 10277 10278 this.setState({ 10279 onKeyboardShortcutsPanelClose: null, 10280 showKeyboardShortcuts: false 10281 }); 10282 } 10283 10284 return closeKeyboardShortcutsPanel; 10285 }() 10286 }, { 10287 key: 'renderNavigation', 10288 value: function () { 10289 function renderNavigation() { 10290 var _this6 = this; 10291 10292 var _props9 = this.props, 10293 navPrev = _props9.navPrev, 10294 navNext = _props9.navNext, 10295 noNavButtons = _props9.noNavButtons, 10296 orientation = _props9.orientation, 10297 phrases = _props9.phrases, 10298 isRTL = _props9.isRTL; 10299 10300 10301 if (noNavButtons) { 10302 return null; 10303 } 10304 10305 var onNextMonthClick = void 0; 10306 if (orientation === _constants.VERTICAL_SCROLLABLE) { 10307 onNextMonthClick = this.multiplyScrollableMonths; 10308 } else { 10309 onNextMonthClick = function () { 10310 function onNextMonthClick(e) { 10311 _this6.onNextMonthClick(null, e); 10312 } 10313 10314 return onNextMonthClick; 10315 }(); 10316 } 10317 10318 return _react2['default'].createElement(_DayPickerNavigation2['default'], { 10319 onPrevMonthClick: function () { 10320 function onPrevMonthClick(e) { 10321 _this6.onPrevMonthClick(null, e); 10322 } 10323 10324 return onPrevMonthClick; 10325 }(), 10326 onNextMonthClick: onNextMonthClick, 10327 navPrev: navPrev, 10328 navNext: navNext, 10329 orientation: orientation, 10330 phrases: phrases, 10331 isRTL: isRTL 10332 }); 10333 } 10334 10335 return renderNavigation; 10336 }() 10337 }, { 10338 key: 'renderWeekHeader', 10339 value: function () { 10340 function renderWeekHeader(index) { 10341 var _props10 = this.props, 10342 daySize = _props10.daySize, 10343 horizontalMonthPadding = _props10.horizontalMonthPadding, 10344 orientation = _props10.orientation, 10345 weekDayFormat = _props10.weekDayFormat, 10346 styles = _props10.styles; 10347 var calendarMonthWidth = this.state.calendarMonthWidth; 10348 10349 var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 10350 var horizontalStyle = { 10351 left: index * calendarMonthWidth 10352 }; 10353 var verticalStyle = { 10354 marginLeft: -calendarMonthWidth / 2 10355 }; 10356 10357 var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation 10358 if (this.isHorizontal()) { 10359 weekHeaderStyle = horizontalStyle; 10360 } else if (this.isVertical() && !verticalScrollable) { 10361 weekHeaderStyle = verticalStyle; 10362 } 10363 10364 var firstDayOfWeek = this.getFirstDayOfWeek(); 10365 10366 var header = []; 10367 for (var i = 0; i < 7; i += 1) { 10368 header.push(_react2['default'].createElement( 10369 'li', 10370 _extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })), 10371 _react2['default'].createElement( 10372 'small', 10373 null, 10374 (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat) 10375 ) 10376 )); 10377 } 10378 10379 return _react2['default'].createElement( 10380 'div', 10381 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), { 10382 key: 'week-' + String(index) 10383 }), 10384 _react2['default'].createElement( 10385 'ul', 10386 (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul), 10387 header 10388 ) 10389 ); 10390 } 10391 10392 return renderWeekHeader; 10393 }() 10394 }, { 10395 key: 'render', 10396 value: function () { 10397 function render() { 10398 var _this7 = this; 10399 10400 var _state8 = this.state, 10401 calendarMonthWidth = _state8.calendarMonthWidth, 10402 currentMonth = _state8.currentMonth, 10403 monthTransition = _state8.monthTransition, 10404 translationValue = _state8.translationValue, 10405 scrollableMonthMultiple = _state8.scrollableMonthMultiple, 10406 focusedDate = _state8.focusedDate, 10407 showKeyboardShortcuts = _state8.showKeyboardShortcuts, 10408 isTouch = _state8.isTouchDevice, 10409 hasSetHeight = _state8.hasSetHeight, 10410 calendarInfoWidth = _state8.calendarInfoWidth, 10411 monthTitleHeight = _state8.monthTitleHeight; 10412 var _props11 = this.props, 10413 enableOutsideDays = _props11.enableOutsideDays, 10414 numberOfMonths = _props11.numberOfMonths, 10415 orientation = _props11.orientation, 10416 modifiers = _props11.modifiers, 10417 withPortal = _props11.withPortal, 10418 onDayClick = _props11.onDayClick, 10419 onDayMouseEnter = _props11.onDayMouseEnter, 10420 onDayMouseLeave = _props11.onDayMouseLeave, 10421 firstDayOfWeek = _props11.firstDayOfWeek, 10422 renderMonthText = _props11.renderMonthText, 10423 renderCalendarDay = _props11.renderCalendarDay, 10424 renderDayContents = _props11.renderDayContents, 10425 renderCalendarInfo = _props11.renderCalendarInfo, 10426 renderMonthElement = _props11.renderMonthElement, 10427 calendarInfoPosition = _props11.calendarInfoPosition, 10428 hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel, 10429 onOutsideClick = _props11.onOutsideClick, 10430 monthFormat = _props11.monthFormat, 10431 daySize = _props11.daySize, 10432 isFocused = _props11.isFocused, 10433 isRTL = _props11.isRTL, 10434 styles = _props11.styles, 10435 theme = _props11.theme, 10436 phrases = _props11.phrases, 10437 verticalHeight = _props11.verticalHeight, 10438 dayAriaLabelFormat = _props11.dayAriaLabelFormat, 10439 noBorder = _props11.noBorder, 10440 transitionDuration = _props11.transitionDuration, 10441 verticalBorderSpacing = _props11.verticalBorderSpacing, 10442 horizontalMonthPadding = _props11.horizontalMonthPadding; 10443 var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding; 10444 10445 10446 var isHorizontal = this.isHorizontal(); 10447 10448 var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths; 10449 var weekHeaders = []; 10450 for (var i = 0; i < numOfWeekHeaders; i += 1) { 10451 weekHeaders.push(this.renderWeekHeader(i)); 10452 } 10453 10454 var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 10455 var height = void 0; 10456 if (isHorizontal) { 10457 height = this.calendarMonthGridHeight; 10458 } else if (this.isVertical() && !verticalScrollable && !withPortal) { 10459 // If the user doesn't set a desired height, 10460 // we default back to this kind of made-up value that generally looks good 10461 height = verticalHeight || 1.75 * calendarMonthWidth; 10462 } 10463 10464 var isCalendarMonthGridAnimating = monthTransition !== null; 10465 10466 var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused; 10467 10468 var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT; 10469 if (this.isVertical()) { 10470 keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT; 10471 } 10472 10473 var shouldAnimateHeight = isHorizontal && hasSetHeight; 10474 10475 var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP; 10476 var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM; 10477 var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE; 10478 var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER; 10479 var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter; 10480 10481 var calendarInfo = renderCalendarInfo && _react2['default'].createElement( 10482 'div', 10483 _extends({ 10484 ref: this.setCalendarInfoRef 10485 }, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)), 10486 renderCalendarInfo() 10487 ); 10488 10489 var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0; 10490 10491 var firstVisibleMonthIndex = this.getFirstVisibleIndex(); 10492 var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding; 10493 // Adding `1px` because of whitespace between 2 inline-block 10494 var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1; 10495 10496 var transitionContainerStyle = { 10497 width: isHorizontal && wrapperHorizontalWidth, 10498 height: height 10499 }; 10500 10501 var dayPickerWrapperStyle = { 10502 width: isHorizontal && wrapperHorizontalWidth 10503 }; 10504 10505 var dayPickerStyle = { 10506 width: isHorizontal && fullHorizontalWidth, 10507 10508 // These values are to center the datepicker (approximately) on the page 10509 marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null, 10510 marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null 10511 }; 10512 10513 return _react2['default'].createElement( 10514 'div', 10515 _extends({ 10516 role: 'application', 10517 'aria-label': phrases.calendarLabel 10518 }, (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)), 10519 _react2['default'].createElement( 10520 _reactOutsideClickHandler2['default'], 10521 { onOutsideClick: onOutsideClick }, 10522 (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo, 10523 _react2['default'].createElement( 10524 'div', 10525 (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal), 10526 _react2['default'].createElement( 10527 'div', 10528 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), { 10529 'aria-hidden': 'true', 10530 role: 'presentation' 10531 }), 10532 weekHeaders 10533 ), 10534 _react2['default'].createElement( 10535 'div', 10536 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), { 10537 ref: this.setContainerRef, 10538 onClick: function () { 10539 function onClick(e) { 10540 e.stopPropagation(); 10541 } 10542 10543 return onClick; 10544 }(), 10545 onKeyDown: this.onKeyDown, 10546 onMouseUp: function () { 10547 function onMouseUp() { 10548 _this7.setState({ withMouseInteractions: true }); 10549 } 10550 10551 return onMouseUp; 10552 }(), 10553 role: 'region', 10554 tabIndex: -1 10555 }), 10556 !verticalScrollable && this.renderNavigation(), 10557 _react2['default'].createElement( 10558 'div', 10559 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), { 10560 ref: this.setTransitionContainerRef 10561 }), 10562 _react2['default'].createElement(_CalendarMonthGrid2['default'], { 10563 setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined, 10564 translationValue: translationValue, 10565 enableOutsideDays: enableOutsideDays, 10566 firstVisibleMonthIndex: firstVisibleMonthIndex, 10567 initialMonth: currentMonth, 10568 isAnimating: isCalendarMonthGridAnimating, 10569 modifiers: modifiers, 10570 orientation: orientation, 10571 numberOfMonths: numberOfMonths * scrollableMonthMultiple, 10572 onDayClick: onDayClick, 10573 onDayMouseEnter: onDayMouseEnter, 10574 onDayMouseLeave: onDayMouseLeave, 10575 onMonthChange: this.onMonthChange, 10576 onYearChange: this.onYearChange, 10577 renderMonthText: renderMonthText, 10578 renderCalendarDay: renderCalendarDay, 10579 renderDayContents: renderDayContents, 10580 renderMonthElement: renderMonthElement, 10581 onMonthTransitionEnd: this.updateStateAfterMonthTransition, 10582 monthFormat: monthFormat, 10583 daySize: daySize, 10584 firstDayOfWeek: firstDayOfWeek, 10585 isFocused: shouldFocusDate, 10586 focusedDate: focusedDate, 10587 phrases: phrases, 10588 isRTL: isRTL, 10589 dayAriaLabelFormat: dayAriaLabelFormat, 10590 transitionDuration: transitionDuration, 10591 verticalBorderSpacing: verticalBorderSpacing, 10592 horizontalMonthPadding: horizontalMonthPadding 10593 }), 10594 verticalScrollable && this.renderNavigation() 10595 ), 10596 !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], { 10597 block: this.isVertical() && !withPortal, 10598 buttonLocation: keyboardShortcutButtonLocation, 10599 showKeyboardShortcutsPanel: showKeyboardShortcuts, 10600 openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel, 10601 closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel, 10602 phrases: phrases 10603 }) 10604 ) 10605 ), 10606 (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo 10607 ) 10608 ); 10609 } 10610 10611 return render; 10612 }() 10613 }]); 10614 10615 return DayPicker; 10616 }(_react2['default'].Component); 10617 10618 DayPicker.propTypes = propTypes; 10619 DayPicker.defaultProps = defaultProps; 10620 10621 exports.PureDayPicker = DayPicker; 10622 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) { 10623 var _ref2$reactDates = _ref2.reactDates, 10624 color = _ref2$reactDates.color, 10625 font = _ref2$reactDates.font, 10626 noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable, 10627 spacing = _ref2$reactDates.spacing, 10628 zIndex = _ref2$reactDates.zIndex; 10629 return { 10630 DayPicker: { 10631 background: color.background, 10632 position: 'relative', 10633 textAlign: 'left' 10634 }, 10635 10636 DayPicker__horizontal: { 10637 background: color.background 10638 }, 10639 10640 DayPicker__verticalScrollable: { 10641 height: '100%' 10642 }, 10643 10644 DayPicker__hidden: { 10645 visibility: 'hidden' 10646 }, 10647 10648 DayPicker__withBorder: { 10649 boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)', 10650 borderRadius: 3 10651 }, 10652 10653 DayPicker_portal__horizontal: { 10654 boxShadow: 'none', 10655 position: 'absolute', 10656 left: '50%', 10657 top: '50%' 10658 }, 10659 10660 DayPicker_portal__vertical: { 10661 position: 'initial' 10662 }, 10663 10664 DayPicker_focusRegion: { 10665 outline: 'none' 10666 }, 10667 10668 DayPicker_calendarInfo__horizontal: { 10669 display: 'inline-block', 10670 verticalAlign: 'top' 10671 }, 10672 10673 DayPicker_wrapper__horizontal: { 10674 display: 'inline-block', 10675 verticalAlign: 'top' 10676 }, 10677 10678 DayPicker_weekHeaders: { 10679 position: 'relative' 10680 }, 10681 10682 DayPicker_weekHeaders__horizontal: { 10683 marginLeft: spacing.dayPickerHorizontalPadding 10684 }, 10685 10686 DayPicker_weekHeader: { 10687 color: color.placeholderText, 10688 position: 'absolute', 10689 top: 62, 10690 zIndex: zIndex + 2, 10691 textAlign: 'left' 10692 }, 10693 10694 DayPicker_weekHeader__vertical: { 10695 left: '50%' 10696 }, 10697 10698 DayPicker_weekHeader__verticalScrollable: { 10699 top: 0, 10700 display: 'table-row', 10701 borderBottom: '1px solid ' + String(color.core.border), 10702 background: color.background, 10703 marginLeft: 0, 10704 left: 0, 10705 width: '100%', 10706 textAlign: 'center' 10707 }, 10708 10709 DayPicker_weekHeader_ul: { 10710 listStyle: 'none', 10711 margin: '1px 0', 10712 paddingLeft: 0, 10713 paddingRight: 0, 10714 fontSize: font.size 10715 }, 10716 10717 DayPicker_weekHeader_li: { 10718 display: 'inline-block', 10719 textAlign: 'center' 10720 }, 10721 10722 DayPicker_transitionContainer: { 10723 position: 'relative', 10724 overflow: 'hidden', 10725 borderRadius: 3 10726 }, 10727 10728 DayPicker_transitionContainer__horizontal: { 10729 transition: 'height 0.2s ease-in-out' 10730 }, 10731 10732 DayPicker_transitionContainer__vertical: { 10733 width: '100%' 10734 }, 10735 10736 DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({ 10737 paddingTop: 20, 10738 height: '100%', 10739 position: 'absolute', 10740 top: 0, 10741 bottom: 0, 10742 right: 0, 10743 left: 0, 10744 overflowY: 'scroll' 10745 }, noScrollBarOnVerticalScrollable && { 10746 '-webkitOverflowScrolling': 'touch', 10747 '::-webkit-scrollbar': { 10748 '-webkit-appearance': 'none', 10749 display: 'none' 10750 } 10751 }) 10752 }; 10753 })(DayPicker); 10754 10755 /***/ }), 10756 10757 /***/ "NykK": 10758 /***/ (function(module, exports, __webpack_require__) { 10759 10760 var Symbol = __webpack_require__("nmnc"), 10761 getRawTag = __webpack_require__("AP2z"), 10762 objectToString = __webpack_require__("KfNM"); 10763 10764 /** `Object#toString` result references. */ 10765 var nullTag = '[object Null]', 10766 undefinedTag = '[object Undefined]'; 10767 10768 /** Built-in value references. */ 10769 var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 10770 10771 /** 10772 * The base implementation of `getTag` without fallbacks for buggy environments. 10773 * 10774 * @private 10775 * @param {*} value The value to query. 10776 * @returns {string} Returns the `toStringTag`. 10777 */ 10778 function baseGetTag(value) { 10779 if (value == null) { 10780 return value === undefined ? undefinedTag : nullTag; 10781 } 10782 return (symToStringTag && symToStringTag in Object(value)) 10783 ? getRawTag(value) 10784 : objectToString(value); 10785 } 10786 10787 module.exports = baseGetTag; 10788 10789 10790 /***/ }), 10791 10792 /***/ "Nym8": 10793 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10794 10795 "use strict"; 10796 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getActiveElement; }); 10797 /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs"); 10798 10799 10800 /** 10801 * Returns `element.ownerDocument.activeElement`. 10802 */ 10803 10804 function getActiveElement(element) { 10805 var _getDocument = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element), 10806 activeElement = _getDocument.activeElement; 10807 10808 if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) { 10809 // In IE11, activeElement might be an empty object if we're interacting 10810 // with elements inside of an iframe. 10811 return null; 10812 } 10813 10814 return activeElement; 10815 } 10816 10817 10818 10819 10820 /***/ }), 10821 10822 /***/ "Ohaz": 10823 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10824 10825 "use strict"; 10826 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getNamespace; }); 10827 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getConnectedNamespace; }); 10828 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tQ+x"); 10829 /** 10830 * Internal dependencies 10831 */ 10832 10833 /** 10834 * Creates a dedicated context namespace HTML attribute for components. 10835 * ns is short for "namespace" 10836 * 10837 * @example 10838 * ```jsx 10839 * <div {...ns('Container')} /> 10840 * ``` 10841 * 10842 * @param {string} componentName The name for the component. 10843 * @return {Record<string, any>} A props object with the namespaced HTML attribute. 10844 */ 10845 10846 function getNamespace(componentName) { 10847 return { 10848 [_constants__WEBPACK_IMPORTED_MODULE_0__[/* COMPONENT_NAMESPACE */ "a"]]: componentName 10849 }; 10850 } 10851 /** 10852 * Creates a dedicated connected context namespace HTML attribute for components. 10853 * ns is short for "namespace" 10854 * 10855 * @example 10856 * ```jsx 10857 * <div {...cns()} /> 10858 * ``` 10859 * 10860 * @return {Record<string, any>} A props object with the namespaced HTML attribute. 10861 */ 10862 10863 function getConnectedNamespace() { 10864 return { 10865 [_constants__WEBPACK_IMPORTED_MODULE_0__[/* CONNECTED_NAMESPACE */ "b"]]: true 10866 }; 10867 } 10868 10869 10870 /***/ }), 10871 10872 /***/ "PJYZ": 10873 /***/ (function(module, exports) { 10874 10875 function _assertThisInitialized(self) { 10876 if (self === void 0) { 10877 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 10878 } 10879 10880 return self; 10881 } 10882 10883 module.exports = _assertThisInitialized; 10884 module.exports["default"] = module.exports, module.exports.__esModule = true; 10885 10886 /***/ }), 10887 10888 /***/ "PcHe": 10889 /***/ (function(module, __webpack_exports__, __webpack_require__) { 10890 10891 "use strict"; 10892 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasFocusWithin; }); 10893 /* harmony import */ var _getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Nym8"); 10894 /* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("utzN"); 10895 10896 10897 10898 10899 /** 10900 * Checks if `element` has focus within. Elements that are referenced by 10901 * `aria-activedescendant` are also considered. 10902 * 10903 * @example 10904 * import { hasFocusWithin } from "reakit-utils"; 10905 * 10906 * hasFocusWithin(document.getElementById("id")); 10907 */ 10908 10909 function hasFocusWithin(element) { 10910 var activeElement = Object(_getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__[/* getActiveElement */ "a"])(element); 10911 if (!activeElement) return false; 10912 if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* contains */ "a"])(element, activeElement)) return true; 10913 var activeDescendant = activeElement.getAttribute("aria-activedescendant"); 10914 if (!activeDescendant) return false; 10915 if (activeDescendant === element.id) return true; 10916 return !!element.querySelector("#" + activeDescendant); 10917 } 10918 10919 10920 10921 10922 /***/ }), 10923 10924 /***/ "Pjai": 10925 /***/ (function(module, exports, __webpack_require__) { 10926 10927 "use strict"; 10928 10929 10930 var ToPrimitive = __webpack_require__("vLdR"); 10931 10932 // http://262.ecma-international.org/5.1/#sec-9.3 10933 10934 module.exports = function ToNumber(value) { 10935 var prim = ToPrimitive(value, Number); 10936 if (typeof prim !== 'string') { 10937 return +prim; // eslint-disable-line no-implicit-coercion 10938 } 10939 10940 // eslint-disable-next-line no-control-regex 10941 var trimmed = prim.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g, ''); 10942 if ((/^0[ob]|^[+-]0x/).test(trimmed)) { 10943 return NaN; 10944 } 10945 10946 return +trimmed; // eslint-disable-line no-implicit-coercion 10947 }; 10948 10949 10950 /***/ }), 10951 10952 /***/ "Pq96": 10953 /***/ (function(module, exports, __webpack_require__) { 10954 10955 "use strict"; 10956 10957 10958 Object.defineProperty(exports, "__esModule", { 10959 value: true 10960 }); 10961 exports['default'] = isPrevMonth; 10962 10963 var _moment = __webpack_require__("wy2R"); 10964 10965 var _moment2 = _interopRequireDefault(_moment); 10966 10967 var _isSameMonth = __webpack_require__("ulUS"); 10968 10969 var _isSameMonth2 = _interopRequireDefault(_isSameMonth); 10970 10971 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 10972 10973 function isPrevMonth(a, b) { 10974 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 10975 return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b); 10976 } 10977 10978 /***/ }), 10979 10980 /***/ "PrET": 10981 /***/ (function(module, exports, __webpack_require__) { 10982 10983 "use strict"; 10984 10985 10986 var bind = __webpack_require__("D3zA"); 10987 var GetIntrinsic = __webpack_require__("AM7I"); 10988 10989 var $apply = GetIntrinsic('%Function.prototype.apply%'); 10990 var $call = GetIntrinsic('%Function.prototype.call%'); 10991 var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); 10992 10993 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 10994 10995 if ($defineProperty) { 10996 try { 10997 $defineProperty({}, 'a', { value: 1 }); 10998 } catch (e) { 10999 // IE 8 has a broken defineProperty 11000 $defineProperty = null; 11001 } 11002 } 11003 11004 module.exports = function callBind() { 11005 return $reflectApply(bind, $call, arguments); 11006 }; 11007 11008 var applyBind = function applyBind() { 11009 return $reflectApply(bind, $apply, arguments); 11010 }; 11011 11012 if ($defineProperty) { 11013 $defineProperty(module.exports, 'apply', { value: applyBind }); 11014 } else { 11015 module.exports.apply = applyBind; 11016 } 11017 11018 11019 /***/ }), 11020 11021 /***/ "Ptb8": 11022 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11023 11024 "use strict"; 11025 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isObject; }); 11026 /** 11027 * Checks whether `arg` is an object or not. 11028 * 11029 * @returns {boolean} 11030 */ 11031 function isObject(arg) { 11032 return typeof arg === "object" && arg != null; 11033 } 11034 11035 11036 11037 11038 /***/ }), 11039 11040 /***/ "Q4Sy": 11041 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11042 11043 "use strict"; 11044 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 11045 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11046 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 11047 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 11048 11049 11050 /** 11051 * WordPress dependencies 11052 */ 11053 11054 const plus = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 11055 xmlns: "http://www.w3.org/2000/svg", 11056 viewBox: "0 0 24 24" 11057 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 11058 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" 11059 })); 11060 /* harmony default export */ __webpack_exports__["a"] = (plus); 11061 11062 11063 /***/ }), 11064 11065 /***/ "QEu6": 11066 /***/ (function(module, exports, __webpack_require__) { 11067 11068 "use strict"; 11069 11070 11071 Object.defineProperty(exports, "__esModule", { 11072 value: true 11073 }); 11074 var CHANNEL = exports.CHANNEL = '__direction__'; 11075 11076 var DIRECTIONS = exports.DIRECTIONS = { 11077 LTR: 'ltr', 11078 RTL: 'rtl' 11079 }; 11080 11081 /***/ }), 11082 11083 /***/ "QIyF": 11084 /***/ (function(module, exports, __webpack_require__) { 11085 11086 var root = __webpack_require__("Kz5y"); 11087 11088 /** 11089 * Gets the timestamp of the number of milliseconds that have elapsed since 11090 * the Unix epoch (1 January 1970 00:00:00 UTC). 11091 * 11092 * @static 11093 * @memberOf _ 11094 * @since 2.4.0 11095 * @category Date 11096 * @returns {number} Returns the timestamp. 11097 * @example 11098 * 11099 * _.defer(function(stamp) { 11100 * console.log(_.now() - stamp); 11101 * }, _.now()); 11102 * // => Logs the number of milliseconds it took for the deferred invocation. 11103 */ 11104 var now = function() { 11105 return root.Date.now(); 11106 }; 11107 11108 module.exports = now; 11109 11110 11111 /***/ }), 11112 11113 /***/ "Qmvf": 11114 /***/ (function(module, exports, __webpack_require__) { 11115 11116 "use strict"; 11117 11118 11119 var GetIntrinsic = __webpack_require__("rZ7t"); 11120 11121 var has = __webpack_require__("oNNP"); 11122 var $TypeError = GetIntrinsic('%TypeError%'); 11123 11124 module.exports = function IsPropertyDescriptor(ES, Desc) { 11125 if (ES.Type(Desc) !== 'Object') { 11126 return false; 11127 } 11128 var allowed = { 11129 '[[Configurable]]': true, 11130 '[[Enumerable]]': true, 11131 '[[Get]]': true, 11132 '[[Set]]': true, 11133 '[[Value]]': true, 11134 '[[Writable]]': true 11135 }; 11136 11137 for (var key in Desc) { // eslint-disable-line no-restricted-syntax 11138 if (has(Desc, key) && !allowed[key]) { 11139 return false; 11140 } 11141 } 11142 11143 if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { 11144 throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); 11145 } 11146 return true; 11147 }; 11148 11149 11150 /***/ }), 11151 11152 /***/ "R/b7": 11153 /***/ (function(module, exports, __webpack_require__) { 11154 11155 "use strict"; 11156 11157 11158 var abs = __webpack_require__("In1I"); 11159 var floor = __webpack_require__("4HRn"); 11160 11161 var $isNaN = __webpack_require__("HwJD"); 11162 var $isFinite = __webpack_require__("ald4"); 11163 11164 // https://ecma-international.org/ecma-262/6.0/#sec-isinteger 11165 11166 module.exports = function IsInteger(argument) { 11167 if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { 11168 return false; 11169 } 11170 var absValue = abs(argument); 11171 return floor(absValue) === absValue; 11172 }; 11173 11174 11175 /***/ }), 11176 11177 /***/ "RDTF": 11178 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11179 11180 "use strict"; 11181 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread2; }); 11182 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectWithoutPropertiesLoose; }); 11183 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; }); 11184 function _defineProperty(obj, key, value) { 11185 if (key in obj) { 11186 Object.defineProperty(obj, key, { 11187 value: value, 11188 enumerable: true, 11189 configurable: true, 11190 writable: true 11191 }); 11192 } else { 11193 obj[key] = value; 11194 } 11195 11196 return obj; 11197 } 11198 11199 function ownKeys(object, enumerableOnly) { 11200 var keys = Object.keys(object); 11201 11202 if (Object.getOwnPropertySymbols) { 11203 var symbols = Object.getOwnPropertySymbols(object); 11204 if (enumerableOnly) symbols = symbols.filter(function (sym) { 11205 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 11206 }); 11207 keys.push.apply(keys, symbols); 11208 } 11209 11210 return keys; 11211 } 11212 11213 function _objectSpread2(target) { 11214 for (var i = 1; i < arguments.length; i++) { 11215 var source = arguments[i] != null ? arguments[i] : {}; 11216 11217 if (i % 2) { 11218 ownKeys(Object(source), true).forEach(function (key) { 11219 _defineProperty(target, key, source[key]); 11220 }); 11221 } else if (Object.getOwnPropertyDescriptors) { 11222 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 11223 } else { 11224 ownKeys(Object(source)).forEach(function (key) { 11225 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 11226 }); 11227 } 11228 } 11229 11230 return target; 11231 } 11232 11233 function _objectWithoutPropertiesLoose(source, excluded) { 11234 if (source == null) return {}; 11235 var target = {}; 11236 var sourceKeys = Object.keys(source); 11237 var key, i; 11238 11239 for (i = 0; i < sourceKeys.length; i++) { 11240 key = sourceKeys[i]; 11241 if (excluded.indexOf(key) >= 0) continue; 11242 target[key] = source[key]; 11243 } 11244 11245 return target; 11246 } 11247 11248 function _unsupportedIterableToArray(o, minLen) { 11249 if (!o) return; 11250 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 11251 var n = Object.prototype.toString.call(o).slice(8, -1); 11252 if (n === "Object" && o.constructor) n = o.constructor.name; 11253 if (n === "Map" || n === "Set") return Array.from(o); 11254 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 11255 } 11256 11257 function _arrayLikeToArray(arr, len) { 11258 if (len == null || len > arr.length) len = arr.length; 11259 11260 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 11261 11262 return arr2; 11263 } 11264 11265 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 11266 var it; 11267 11268 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 11269 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 11270 if (it) o = it; 11271 var i = 0; 11272 return function () { 11273 if (i >= o.length) return { 11274 done: true 11275 }; 11276 return { 11277 done: false, 11278 value: o[i++] 11279 }; 11280 }; 11281 } 11282 11283 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 11284 } 11285 11286 it = o[Symbol.iterator](); 11287 return it.next.bind(it); 11288 } 11289 11290 11291 11292 11293 /***/ }), 11294 11295 /***/ "RMJe": 11296 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11297 11298 "use strict"; 11299 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 11300 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11301 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 11302 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 11303 11304 11305 /** 11306 * WordPress dependencies 11307 */ 11308 11309 const check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 11310 xmlns: "http://www.w3.org/2000/svg", 11311 viewBox: "0 0 24 24" 11312 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 11313 d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z" 11314 })); 11315 /* harmony default export */ __webpack_exports__["a"] = (check); 11316 11317 11318 /***/ }), 11319 11320 /***/ "RxS6": 11321 /***/ (function(module, exports) { 11322 11323 (function() { module.exports = window["wp"]["keycodes"]; }()); 11324 11325 /***/ }), 11326 11327 /***/ "S0jC": 11328 /***/ (function(module, exports, __webpack_require__) { 11329 11330 "use strict"; 11331 11332 11333 module.exports = __webpack_require__("laOf"); 11334 11335 11336 /***/ }), 11337 11338 /***/ "SB3u": 11339 /***/ (function(module, __webpack_exports__, __webpack_require__) { 11340 11341 "use strict"; 11342 // ESM COMPAT FLAG 11343 __webpack_require__.r(__webpack_exports__); 11344 11345 // EXPORTS 11346 __webpack_require__.d(__webpack_exports__, "SVG", function() { return /* reexport */ external_wp_primitives_["SVG"]; }); 11347 __webpack_require__.d(__webpack_exports__, "Path", function() { return /* reexport */ external_wp_primitives_["Path"]; }); 11348 __webpack_require__.d(__webpack_exports__, "Circle", function() { return /* reexport */ external_wp_primitives_["Circle"]; }); 11349 __webpack_require__.d(__webpack_exports__, "Polygon", function() { return /* reexport */ external_wp_primitives_["Polygon"]; }); 11350 __webpack_require__.d(__webpack_exports__, "Rect", function() { return /* reexport */ external_wp_primitives_["Rect"]; }); 11351 __webpack_require__.d(__webpack_exports__, "G", function() { return /* reexport */ external_wp_primitives_["G"]; }); 11352 __webpack_require__.d(__webpack_exports__, "HorizontalRule", function() { return /* reexport */ external_wp_primitives_["HorizontalRule"]; }); 11353 __webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return /* reexport */ external_wp_primitives_["BlockQuotation"]; }); 11354 __webpack_require__.d(__webpack_exports__, "__experimentalAlignmentMatrixControl", function() { return /* reexport */ AlignmentMatrixControl; }); 11355 __webpack_require__.d(__webpack_exports__, "Animate", function() { return /* reexport */ animate["a" /* default */]; }); 11356 __webpack_require__.d(__webpack_exports__, "__unstableGetAnimateClassName", function() { return /* reexport */ animate["b" /* getAnimateClassName */]; }); 11357 __webpack_require__.d(__webpack_exports__, "AnglePickerControl", function() { return /* reexport */ AnglePickerControl; }); 11358 __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return /* reexport */ Autocomplete; }); 11359 __webpack_require__.d(__webpack_exports__, "__unstableUseAutocompleteProps", function() { return /* reexport */ useAutocompleteProps; }); 11360 __webpack_require__.d(__webpack_exports__, "BaseControl", function() { return /* reexport */ base_control; }); 11361 __webpack_require__.d(__webpack_exports__, "__experimentalBoxControl", function() { return /* reexport */ BoxControl; }); 11362 __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ build_module_button["a" /* default */]; }); 11363 __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return /* reexport */ button_group; }); 11364 __webpack_require__.d(__webpack_exports__, "Card", function() { return /* reexport */ card; }); 11365 __webpack_require__.d(__webpack_exports__, "CardBody", function() { return /* reexport */ card_body; }); 11366 __webpack_require__.d(__webpack_exports__, "CardDivider", function() { return /* reexport */ divider; }); 11367 __webpack_require__.d(__webpack_exports__, "CardFooter", function() { return /* reexport */ footer; }); 11368 __webpack_require__.d(__webpack_exports__, "CardHeader", function() { return /* reexport */ card_header; }); 11369 __webpack_require__.d(__webpack_exports__, "CardMedia", function() { return /* reexport */ media; }); 11370 __webpack_require__.d(__webpack_exports__, "CheckboxControl", function() { return /* reexport */ CheckboxControl; }); 11371 __webpack_require__.d(__webpack_exports__, "ClipboardButton", function() { return /* reexport */ ClipboardButton; }); 11372 __webpack_require__.d(__webpack_exports__, "__experimentalColorEdit", function() { return /* reexport */ ColorEdit; }); 11373 __webpack_require__.d(__webpack_exports__, "ColorIndicator", function() { return /* reexport */ color_indicator; }); 11374 __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ ColorPalette; }); 11375 __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return /* reexport */ color_picker_ColorPicker; }); 11376 __webpack_require__.d(__webpack_exports__, "ComboboxControl", function() { return /* reexport */ combobox_control; }); 11377 __webpack_require__.d(__webpack_exports__, "__unstableComposite", function() { return /* reexport */ Composite; }); 11378 __webpack_require__.d(__webpack_exports__, "__unstableCompositeGroup", function() { return /* reexport */ CompositeGroup; }); 11379 __webpack_require__.d(__webpack_exports__, "__unstableCompositeItem", function() { return /* reexport */ CompositeItem["a" /* CompositeItem */]; }); 11380 __webpack_require__.d(__webpack_exports__, "__unstableUseCompositeState", function() { return /* reexport */ useCompositeState; }); 11381 __webpack_require__.d(__webpack_exports__, "CustomSelectControl", function() { return /* reexport */ CustomSelectControl; }); 11382 __webpack_require__.d(__webpack_exports__, "Dashicon", function() { return /* reexport */ dashicon["a" /* default */]; }); 11383 __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return /* reexport */ date_time; }); 11384 __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return /* reexport */ date_time_date; }); 11385 __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return /* reexport */ time; }); 11386 __webpack_require__.d(__webpack_exports__, "__experimentalDimensionControl", function() { return /* reexport */ dimension_control; }); 11387 __webpack_require__.d(__webpack_exports__, "Disabled", function() { return /* reexport */ build_module_disabled; }); 11388 __webpack_require__.d(__webpack_exports__, "__unstableDisclosureContent", function() { return /* reexport */ DisclosureContent; }); 11389 __webpack_require__.d(__webpack_exports__, "__experimentalDivider", function() { return /* reexport */ divider_component; }); 11390 __webpack_require__.d(__webpack_exports__, "Draggable", function() { return /* reexport */ Draggable; }); 11391 __webpack_require__.d(__webpack_exports__, "DropZone", function() { return /* reexport */ DropZoneComponent; }); 11392 __webpack_require__.d(__webpack_exports__, "DropZoneProvider", function() { return /* reexport */ DropZoneProvider; }); 11393 __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return /* reexport */ Dropdown; }); 11394 __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return /* reexport */ dropdown_menu; }); 11395 __webpack_require__.d(__webpack_exports__, "DuotoneSwatch", function() { return /* reexport */ duotone_swatch; }); 11396 __webpack_require__.d(__webpack_exports__, "DuotonePicker", function() { return /* reexport */ duotone_picker; }); 11397 __webpack_require__.d(__webpack_exports__, "ExternalLink", function() { return /* reexport */ external_link; }); 11398 __webpack_require__.d(__webpack_exports__, "Flex", function() { return /* reexport */ flex_component; }); 11399 __webpack_require__.d(__webpack_exports__, "FlexBlock", function() { return /* reexport */ flex_block_component; }); 11400 __webpack_require__.d(__webpack_exports__, "FlexItem", function() { return /* reexport */ flex_item_component; }); 11401 __webpack_require__.d(__webpack_exports__, "FocalPointPicker", function() { return /* reexport */ focal_point_picker; }); 11402 __webpack_require__.d(__webpack_exports__, "FocusableIframe", function() { return /* reexport */ FocusableIframe; }); 11403 __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return /* reexport */ font_size_picker; }); 11404 __webpack_require__.d(__webpack_exports__, "FormFileUpload", function() { return /* reexport */ form_file_upload; }); 11405 __webpack_require__.d(__webpack_exports__, "FormToggle", function() { return /* reexport */ form_toggle; }); 11406 __webpack_require__.d(__webpack_exports__, "FormTokenField", function() { return /* reexport */ form_token_field; }); 11407 __webpack_require__.d(__webpack_exports__, "__experimentalGradientPicker", function() { return /* reexport */ GradientPicker; }); 11408 __webpack_require__.d(__webpack_exports__, "__experimentalCustomGradientPicker", function() { return /* reexport */ CustomGradientPicker; }); 11409 __webpack_require__.d(__webpack_exports__, "__experimentalGrid", function() { return /* reexport */ grid_component; }); 11410 __webpack_require__.d(__webpack_exports__, "Guide", function() { return /* reexport */ Guide; }); 11411 __webpack_require__.d(__webpack_exports__, "GuidePage", function() { return /* reexport */ GuidePage; }); 11412 __webpack_require__.d(__webpack_exports__, "__experimentalHeading", function() { return /* reexport */ heading_component; }); 11413 __webpack_require__.d(__webpack_exports__, "__experimentalHStack", function() { return /* reexport */ h_stack_component; }); 11414 __webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ components_build_module_icon["a" /* default */]; }); 11415 __webpack_require__.d(__webpack_exports__, "IconButton", function() { return /* reexport */ deprecated; }); 11416 __webpack_require__.d(__webpack_exports__, "__experimentalInputControl", function() { return /* reexport */ input_control; }); 11417 __webpack_require__.d(__webpack_exports__, "KeyboardShortcuts", function() { return /* reexport */ keyboard_shortcuts; }); 11418 __webpack_require__.d(__webpack_exports__, "MenuGroup", function() { return /* reexport */ menu_group; }); 11419 __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return /* reexport */ menu_item; }); 11420 __webpack_require__.d(__webpack_exports__, "MenuItemsChoice", function() { return /* reexport */ MenuItemsChoice; }); 11421 __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ modal; }); 11422 __webpack_require__.d(__webpack_exports__, "ScrollLock", function() { return /* reexport */ scroll_lock["a" /* default */]; }); 11423 __webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return /* reexport */ navigable_container_menu; }); 11424 __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return /* reexport */ tabbable; }); 11425 __webpack_require__.d(__webpack_exports__, "__experimentalNavigation", function() { return /* reexport */ Navigation; }); 11426 __webpack_require__.d(__webpack_exports__, "__experimentalNavigationBackButton", function() { return /* reexport */ back_button; }); 11427 __webpack_require__.d(__webpack_exports__, "__experimentalNavigationGroup", function() { return /* reexport */ NavigationGroup; }); 11428 __webpack_require__.d(__webpack_exports__, "__experimentalNavigationItem", function() { return /* reexport */ NavigationItem; }); 11429 __webpack_require__.d(__webpack_exports__, "__experimentalNavigationMenu", function() { return /* reexport */ NavigationMenu; }); 11430 __webpack_require__.d(__webpack_exports__, "Notice", function() { return /* reexport */ build_module_notice; }); 11431 __webpack_require__.d(__webpack_exports__, "__experimentalNumberControl", function() { return /* reexport */ number_control; }); 11432 __webpack_require__.d(__webpack_exports__, "NoticeList", function() { return /* reexport */ list; }); 11433 __webpack_require__.d(__webpack_exports__, "Panel", function() { return /* reexport */ panel; }); 11434 __webpack_require__.d(__webpack_exports__, "PanelBody", function() { return /* reexport */ panel_body; }); 11435 __webpack_require__.d(__webpack_exports__, "PanelHeader", function() { return /* reexport */ panel_header; }); 11436 __webpack_require__.d(__webpack_exports__, "PanelRow", function() { return /* reexport */ panel_row; }); 11437 __webpack_require__.d(__webpack_exports__, "Placeholder", function() { return /* reexport */ build_module_placeholder; }); 11438 __webpack_require__.d(__webpack_exports__, "Popover", function() { return /* reexport */ build_module_popover["a" /* default */]; }); 11439 __webpack_require__.d(__webpack_exports__, "QueryControls", function() { return /* reexport */ QueryControls; }); 11440 __webpack_require__.d(__webpack_exports__, "__experimentalRadio", function() { return /* reexport */ build_module_radio; }); 11441 __webpack_require__.d(__webpack_exports__, "__experimentalRadioGroup", function() { return /* reexport */ radio_group; }); 11442 __webpack_require__.d(__webpack_exports__, "RadioControl", function() { return /* reexport */ RadioControl; }); 11443 __webpack_require__.d(__webpack_exports__, "RangeControl", function() { return /* reexport */ range_control; }); 11444 __webpack_require__.d(__webpack_exports__, "ResizableBox", function() { return /* reexport */ resizable_box; }); 11445 __webpack_require__.d(__webpack_exports__, "ResponsiveWrapper", function() { return /* reexport */ responsive_wrapper; }); 11446 __webpack_require__.d(__webpack_exports__, "SandBox", function() { return /* reexport */ Sandbox; }); 11447 __webpack_require__.d(__webpack_exports__, "SelectControl", function() { return /* reexport */ select_control; }); 11448 __webpack_require__.d(__webpack_exports__, "Snackbar", function() { return /* reexport */ snackbar["a" /* default */]; }); 11449 __webpack_require__.d(__webpack_exports__, "SnackbarList", function() { return /* reexport */ snackbar_list; }); 11450 __webpack_require__.d(__webpack_exports__, "__experimentalSpacer", function() { return /* reexport */ spacer_component; }); 11451 __webpack_require__.d(__webpack_exports__, "Spinner", function() { return /* reexport */ Spinner; }); 11452 __webpack_require__.d(__webpack_exports__, "TabPanel", function() { return /* reexport */ TabPanel; }); 11453 __webpack_require__.d(__webpack_exports__, "__experimentalText", function() { return /* reexport */ text_component; }); 11454 __webpack_require__.d(__webpack_exports__, "TextControl", function() { return /* reexport */ text_control; }); 11455 __webpack_require__.d(__webpack_exports__, "TextareaControl", function() { return /* reexport */ TextareaControl; }); 11456 __webpack_require__.d(__webpack_exports__, "TextHighlight", function() { return /* reexport */ text_highlight; }); 11457 __webpack_require__.d(__webpack_exports__, "Tip", function() { return /* reexport */ tip; }); 11458 __webpack_require__.d(__webpack_exports__, "ToggleControl", function() { return /* reexport */ ToggleControl; }); 11459 __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ toolbar; }); 11460 __webpack_require__.d(__webpack_exports__, "ToolbarButton", function() { return /* reexport */ toolbar_button; }); 11461 __webpack_require__.d(__webpack_exports__, "ToolbarDropdownMenu", function() { return /* reexport */ toolbar_dropdown_menu; }); 11462 __webpack_require__.d(__webpack_exports__, "__experimentalToolbarContext", function() { return /* reexport */ toolbar_context["a" /* default */]; }); 11463 __webpack_require__.d(__webpack_exports__, "ToolbarGroup", function() { return /* reexport */ toolbar_group; }); 11464 __webpack_require__.d(__webpack_exports__, "ToolbarItem", function() { return /* reexport */ toolbar_item["a" /* default */]; }); 11465 __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ build_module_tooltip["a" /* default */]; }); 11466 __webpack_require__.d(__webpack_exports__, "__experimentalTreeGrid", function() { return /* reexport */ tree_grid; }); 11467 __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridRow", function() { return /* reexport */ tree_grid_row; }); 11468 __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridCell", function() { return /* reexport */ tree_grid_cell; }); 11469 __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridItem", function() { return /* reexport */ tree_grid_item; }); 11470 __webpack_require__.d(__webpack_exports__, "TreeSelect", function() { return /* reexport */ TreeSelect; }); 11471 __webpack_require__.d(__webpack_exports__, "__experimentalTruncate", function() { return /* reexport */ truncate_component; }); 11472 __webpack_require__.d(__webpack_exports__, "__experimentalUnitControl", function() { return /* reexport */ unit_control; }); 11473 __webpack_require__.d(__webpack_exports__, "__experimentalUseCustomUnits", function() { return /* reexport */ useCustomUnits; }); 11474 __webpack_require__.d(__webpack_exports__, "VisuallyHidden", function() { return /* reexport */ visually_hidden["a" /* default */]; }); 11475 __webpack_require__.d(__webpack_exports__, "__experimentalVStack", function() { return /* reexport */ v_stack_component; }); 11476 __webpack_require__.d(__webpack_exports__, "IsolatedEventContainer", function() { return /* reexport */ isolated_event_container; }); 11477 __webpack_require__.d(__webpack_exports__, "createSlotFill", function() { return /* reexport */ slot_fill["d" /* createSlotFill */]; }); 11478 __webpack_require__.d(__webpack_exports__, "Slot", function() { return /* reexport */ slot_fill["c" /* Slot */]; }); 11479 __webpack_require__.d(__webpack_exports__, "Fill", function() { return /* reexport */ slot_fill["a" /* Fill */]; }); 11480 __webpack_require__.d(__webpack_exports__, "SlotFillProvider", function() { return /* reexport */ slot_fill["b" /* Provider */]; }); 11481 __webpack_require__.d(__webpack_exports__, "__experimentalUseSlot", function() { return /* reexport */ use_slot["a" /* default */]; }); 11482 __webpack_require__.d(__webpack_exports__, "__experimentalStyleProvider", function() { return /* reexport */ StyleProvider; }); 11483 __webpack_require__.d(__webpack_exports__, "navigateRegions", function() { return /* reexport */ navigate_regions; }); 11484 __webpack_require__.d(__webpack_exports__, "__unstableUseNavigateRegions", function() { return /* reexport */ useNavigateRegions; }); 11485 __webpack_require__.d(__webpack_exports__, "withConstrainedTabbing", function() { return /* reexport */ with_constrained_tabbing; }); 11486 __webpack_require__.d(__webpack_exports__, "withFallbackStyles", function() { return /* reexport */ with_fallback_styles; }); 11487 __webpack_require__.d(__webpack_exports__, "withFilters", function() { return /* reexport */ withFilters; }); 11488 __webpack_require__.d(__webpack_exports__, "withFocusOutside", function() { return /* reexport */ with_focus_outside; }); 11489 __webpack_require__.d(__webpack_exports__, "withFocusReturn", function() { return /* reexport */ with_focus_return; }); 11490 __webpack_require__.d(__webpack_exports__, "FocusReturnProvider", function() { return /* reexport */ with_focus_return_Provider; }); 11491 __webpack_require__.d(__webpack_exports__, "withNotices", function() { return /* reexport */ with_notices; }); 11492 __webpack_require__.d(__webpack_exports__, "withSpokenMessages", function() { return /* reexport */ with_spoken_messages; }); 11493 __webpack_require__.d(__webpack_exports__, "__unstableWithNext", function() { return /* reexport */ with_next["a" /* withNext */]; }); 11494 __webpack_require__.d(__webpack_exports__, "__unstableComponentSystemProvider", function() { return /* reexport */ ComponentSystemProvider; }); 11495 11496 // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js 11497 var text_styles_namespaceObject = {}; 11498 __webpack_require__.r(text_styles_namespaceObject); 11499 __webpack_require__.d(text_styles_namespaceObject, "Text", function() { return Text; }); 11500 __webpack_require__.d(text_styles_namespaceObject, "block", function() { return styles_block; }); 11501 __webpack_require__.d(text_styles_namespaceObject, "positive", function() { return positive; }); 11502 __webpack_require__.d(text_styles_namespaceObject, "destructive", function() { return destructive; }); 11503 __webpack_require__.d(text_styles_namespaceObject, "muted", function() { return styles_muted; }); 11504 __webpack_require__.d(text_styles_namespaceObject, "highlighterText", function() { return highlighterText; }); 11505 __webpack_require__.d(text_styles_namespaceObject, "upperCase", function() { return styles_upperCase; }); 11506 11507 // EXTERNAL MODULE: external ["wp","primitives"] 11508 var external_wp_primitives_ = __webpack_require__("Tqx9"); 11509 11510 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 11511 var esm_extends = __webpack_require__("wx14"); 11512 11513 // EXTERNAL MODULE: external ["wp","element"] 11514 var external_wp_element_ = __webpack_require__("GRId"); 11515 11516 // EXTERNAL MODULE: external "lodash" 11517 var external_lodash_ = __webpack_require__("YLtl"); 11518 11519 // EXTERNAL MODULE: ./node_modules/classnames/index.js 11520 var classnames = __webpack_require__("TSYQ"); 11521 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 11522 11523 // EXTERNAL MODULE: external ["wp","i18n"] 11524 var external_wp_i18n_ = __webpack_require__("l3Sj"); 11525 11526 // EXTERNAL MODULE: external ["wp","compose"] 11527 var external_wp_compose_ = __webpack_require__("K9lf"); 11528 11529 // EXTERNAL MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js 11530 var CompositeItem = __webpack_require__("kTC8"); 11531 11532 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js + 1 modules 11533 var build_module_tooltip = __webpack_require__("W/NR"); 11534 11535 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js + 2 modules 11536 var visually_hidden = __webpack_require__("ldlY"); 11537 11538 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js 11539 /** 11540 * External dependencies 11541 */ 11542 11543 /** 11544 * WordPress dependencies 11545 */ 11546 11547 11548 const GRID = [['top left', 'top center', 'top right'], ['center left', 'center center', 'center right'], ['bottom left', 'bottom center', 'bottom right']]; // Stored as map as i18n __() only accepts strings (not variables) 11549 11550 const ALIGNMENT_LABEL = { 11551 'top left': Object(external_wp_i18n_["__"])('Top Left'), 11552 'top center': Object(external_wp_i18n_["__"])('Top Center'), 11553 'top right': Object(external_wp_i18n_["__"])('Top Right'), 11554 'center left': Object(external_wp_i18n_["__"])('Center Left'), 11555 'center center': Object(external_wp_i18n_["__"])('Center Center'), 11556 'center right': Object(external_wp_i18n_["__"])('Center Right'), 11557 'bottom left': Object(external_wp_i18n_["__"])('Bottom Left'), 11558 'bottom center': Object(external_wp_i18n_["__"])('Bottom Center'), 11559 'bottom right': Object(external_wp_i18n_["__"])('Bottom Right') 11560 }; // Transforms GRID into a flat Array of values 11561 11562 const ALIGNMENTS = Object(external_lodash_["flattenDeep"])(GRID); 11563 /** 11564 * Parses and transforms an incoming value to better match the alignment values 11565 * 11566 * @param {string} value An alignment value to parse. 11567 * 11568 * @return {string} The parsed value. 11569 */ 11570 11571 function transformValue(value) { 11572 const nextValue = value === 'center' ? 'center center' : value; 11573 return nextValue.replace('-', ' '); 11574 } 11575 /** 11576 * Creates an item ID based on a prefix ID and an alignment value. 11577 * 11578 * @param {string} prefixId An ID to prefix. 11579 * @param {string} value An alignment value. 11580 * 11581 * @return {string} The item id. 11582 */ 11583 11584 function utils_getItemId(prefixId, value) { 11585 const valueId = transformValue(value).replace(' ', '-'); 11586 return `${prefixId}-${valueId}`; 11587 } 11588 /** 11589 * Retrieves the alignment index from a value. 11590 * 11591 * @param {string} alignment Value to check. 11592 * 11593 * @return {number} The index of a matching alignment. 11594 */ 11595 11596 function getAlignmentIndex(alignment = 'center') { 11597 const item = transformValue(alignment).replace('-', ' '); 11598 const index = ALIGNMENTS.indexOf(item); 11599 return index > -1 ? index : undefined; 11600 } 11601 11602 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js 11603 var defineProperty = __webpack_require__("lSNA"); 11604 var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); 11605 11606 // EXTERNAL MODULE: external "React" 11607 var external_React_ = __webpack_require__("cDcd"); 11608 var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); 11609 11610 // EXTERNAL MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js 11611 var is_prop_valid_browser_esm = __webpack_require__("9uj6"); 11612 11613 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js 11614 function _setPrototypeOf(o, p) { 11615 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 11616 o.__proto__ = p; 11617 return o; 11618 }; 11619 11620 return _setPrototypeOf(o, p); 11621 } 11622 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js 11623 11624 function _inheritsLoose(subClass, superClass) { 11625 subClass.prototype = Object.create(superClass.prototype); 11626 subClass.prototype.constructor = subClass; 11627 _setPrototypeOf(subClass, superClass); 11628 } 11629 // EXTERNAL MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js + 2 modules 11630 var cache_browser_esm = __webpack_require__("TqVZ"); 11631 11632 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inheritsLoose.js 11633 var inheritsLoose = __webpack_require__("VbXa"); 11634 11635 // EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js 11636 var utils_browser_esm = __webpack_require__("SIPS"); 11637 11638 // EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules 11639 var serialize_browser_esm = __webpack_require__("MiSq"); 11640 11641 // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js 11642 11643 11644 11645 11646 11647 11648 var emotion_element_57a3a7a3_browser_esm_hasOwnProperty = Object.prototype.hasOwnProperty; 11649 11650 var EmotionCacheContext = /*#__PURE__*/Object(external_React_["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case 11651 // because this module is primarily intended for the browser and node 11652 // but it's also required in react native and similar environments sometimes 11653 // and we could have a special build just for that 11654 // but this is much easier and the native packages 11655 // might use a different theme context in the future anyway 11656 typeof HTMLElement !== 'undefined' ? Object(cache_browser_esm["a" /* default */])() : null); 11657 var ThemeContext = /*#__PURE__*/Object(external_React_["createContext"])({}); 11658 var CacheProvider = EmotionCacheContext.Provider; 11659 11660 var emotion_element_57a3a7a3_browser_esm_withEmotionCache = function withEmotionCache(func) { 11661 var render = function render(props, ref) { 11662 return /*#__PURE__*/Object(external_React_["createElement"])(EmotionCacheContext.Consumer, null, function (cache) { 11663 return func(props, cache, ref); 11664 }); 11665 }; // $FlowFixMe 11666 11667 11668 return /*#__PURE__*/Object(external_React_["forwardRef"])(render); 11669 }; 11670 11671 // thus we only need to replace what is a valid character for JS, but not for CSS 11672 11673 var sanitizeIdentifier = function sanitizeIdentifier(identifier) { 11674 return identifier.replace(/\$/g, '-'); 11675 }; 11676 11677 var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; 11678 var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; 11679 var createEmotionProps = function createEmotionProps(type, props) { 11680 if (false) {} 11681 11682 var newProps = {}; 11683 11684 for (var key in props) { 11685 if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key)) { 11686 newProps[key] = props[key]; 11687 } 11688 } 11689 11690 newProps[typePropName] = type; // TODO: check if this still works with all of those different JSX functions 11691 11692 if (false) { var match, error; } 11693 11694 return newProps; 11695 }; 11696 11697 var emotion_element_57a3a7a3_browser_esm_render = function render(cache, props, theme, ref) { 11698 var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works 11699 // not passing the registered cache to serializeStyles because it would 11700 // make certain babel optimisations not possible 11701 11702 if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { 11703 cssProp = cache.registered[cssProp]; 11704 } 11705 11706 var type = props[typePropName]; 11707 var registeredStyles = [cssProp]; 11708 var className = ''; 11709 11710 if (typeof props.className === 'string') { 11711 className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(cache.registered, registeredStyles, props.className); 11712 } else if (props.className != null) { 11713 className = props.className + " "; 11714 } 11715 11716 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(registeredStyles); 11717 11718 if (false) { var labelFromStack; } 11719 11720 var rules = Object(utils_browser_esm["b" /* insertStyles */])(cache, serialized, typeof type === 'string'); 11721 className += cache.key + "-" + serialized.name; 11722 var newProps = {}; 11723 11724 for (var key in props) { 11725 if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || false)) { 11726 newProps[key] = props[key]; 11727 } 11728 } 11729 11730 newProps.ref = ref; 11731 newProps.className = className; 11732 var ele = /*#__PURE__*/Object(external_React_["createElement"])(type, newProps); 11733 11734 return ele; 11735 }; // eslint-disable-next-line no-undef 11736 11737 11738 var Emotion = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache, ref) { 11739 if (typeof props.css === 'function') { 11740 return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 11741 return emotion_element_57a3a7a3_browser_esm_render(cache, props, theme, ref); 11742 }); 11743 } 11744 11745 return emotion_element_57a3a7a3_browser_esm_render(cache, props, null, ref); 11746 }); 11747 11748 if (false) {} 11749 11750 11751 11752 // EXTERNAL MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js 11753 var sheet_browser_esm = __webpack_require__("z9I/"); 11754 11755 // CONCATENATED MODULE: ./node_modules/@emotion/css/dist/css.browser.esm.js 11756 11757 11758 function css_browser_esm_css() { 11759 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 11760 args[_key] = arguments[_key]; 11761 } 11762 11763 return Object(serialize_browser_esm["a" /* serializeStyles */])(args); 11764 } 11765 11766 /* harmony default export */ var css_browser_esm = (css_browser_esm_css); 11767 11768 // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 var core_browser_esm_jsx = function jsx(type, props) { 11781 var args = arguments; 11782 11783 if (props == null || !emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, 'css')) { 11784 // $FlowFixMe 11785 return external_React_["createElement"].apply(undefined, args); 11786 } 11787 11788 var argsLength = args.length; 11789 var createElementArgArray = new Array(argsLength); 11790 createElementArgArray[0] = Emotion; 11791 createElementArgArray[1] = createEmotionProps(type, props); 11792 11793 for (var i = 2; i < argsLength; i++) { 11794 createElementArgArray[i] = args[i]; 11795 } // $FlowFixMe 11796 11797 11798 return external_React_["createElement"].apply(null, createElementArgArray); 11799 }; 11800 11801 var warnedAboutCssPropForGlobal = false; 11802 var Global = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache) { 11803 if (false) {} 11804 11805 var styles = props.styles; 11806 11807 if (typeof styles === 'function') { 11808 return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 11809 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles(theme)]); 11810 return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, { 11811 serialized: serialized, 11812 cache: cache 11813 }); 11814 }); 11815 } 11816 11817 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles]); 11818 return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, { 11819 serialized: serialized, 11820 cache: cache 11821 }); 11822 }); 11823 11824 // maintain place over rerenders. 11825 // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild 11826 // initial client-side render from SSR, use place of hydrating tag 11827 var core_browser_esm_InnerGlobal = /*#__PURE__*/function (_React$Component) { 11828 _inheritsLoose(InnerGlobal, _React$Component); 11829 11830 function InnerGlobal(props, context, updater) { 11831 return _React$Component.call(this, props, context, updater) || this; 11832 } 11833 11834 var _proto = InnerGlobal.prototype; 11835 11836 _proto.componentDidMount = function componentDidMount() { 11837 this.sheet = new sheet_browser_esm["a" /* StyleSheet */]({ 11838 key: this.props.cache.key + "-global", 11839 nonce: this.props.cache.sheet.nonce, 11840 container: this.props.cache.sheet.container 11841 }); // $FlowFixMe 11842 11843 var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]"); 11844 11845 if (node !== null) { 11846 this.sheet.tags.push(node); 11847 } 11848 11849 if (this.props.cache.sheet.tags.length) { 11850 this.sheet.before = this.props.cache.sheet.tags[0]; 11851 } 11852 11853 this.insertStyles(); 11854 }; 11855 11856 _proto.componentDidUpdate = function componentDidUpdate(prevProps) { 11857 if (prevProps.serialized.name !== this.props.serialized.name) { 11858 this.insertStyles(); 11859 } 11860 }; 11861 11862 _proto.insertStyles = function insertStyles$1() { 11863 if (this.props.serialized.next !== undefined) { 11864 // insert keyframes 11865 Object(utils_browser_esm["b" /* insertStyles */])(this.props.cache, this.props.serialized.next, true); 11866 } 11867 11868 if (this.sheet.tags.length) { 11869 // if this doesn't exist then it will be null so the style element will be appended 11870 var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling; 11871 this.sheet.before = element; 11872 this.sheet.flush(); 11873 } 11874 11875 this.props.cache.insert("", this.props.serialized, this.sheet, false); 11876 }; 11877 11878 _proto.componentWillUnmount = function componentWillUnmount() { 11879 this.sheet.flush(); 11880 }; 11881 11882 _proto.render = function render() { 11883 11884 return null; 11885 }; 11886 11887 return InnerGlobal; 11888 }(external_React_["Component"]); 11889 11890 var core_browser_esm_keyframes = function keyframes() { 11891 var insertable = css_browser_esm.apply(void 0, arguments); 11892 var name = "animation-" + insertable.name; // $FlowFixMe 11893 11894 return { 11895 name: name, 11896 styles: "@keyframes " + name + "{" + insertable.styles + "}", 11897 anim: 1, 11898 toString: function toString() { 11899 return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; 11900 } 11901 }; 11902 }; 11903 11904 var core_browser_esm_classnames = function classnames(args) { 11905 var len = args.length; 11906 var i = 0; 11907 var cls = ''; 11908 11909 for (; i < len; i++) { 11910 var arg = args[i]; 11911 if (arg == null) continue; 11912 var toAdd = void 0; 11913 11914 switch (typeof arg) { 11915 case 'boolean': 11916 break; 11917 11918 case 'object': 11919 { 11920 if (Array.isArray(arg)) { 11921 toAdd = classnames(arg); 11922 } else { 11923 toAdd = ''; 11924 11925 for (var k in arg) { 11926 if (arg[k] && k) { 11927 toAdd && (toAdd += ' '); 11928 toAdd += k; 11929 } 11930 } 11931 } 11932 11933 break; 11934 } 11935 11936 default: 11937 { 11938 toAdd = arg; 11939 } 11940 } 11941 11942 if (toAdd) { 11943 cls && (cls += ' '); 11944 cls += toAdd; 11945 } 11946 } 11947 11948 return cls; 11949 }; 11950 11951 function merge(registered, css, className) { 11952 var registeredStyles = []; 11953 var rawClassName = Object(utils_browser_esm["a" /* getRegisteredStyles */])(registered, registeredStyles, className); 11954 11955 if (registeredStyles.length < 2) { 11956 return className; 11957 } 11958 11959 return rawClassName + css(registeredStyles); 11960 } 11961 11962 var ClassNames = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context) { 11963 return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 11964 var hasRendered = false; 11965 11966 var css = function css() { 11967 if (hasRendered && "production" !== 'production') { 11968 throw new Error('css can only be used during render'); 11969 } 11970 11971 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 11972 args[_key] = arguments[_key]; 11973 } 11974 11975 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, context.registered); 11976 11977 { 11978 Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, false); 11979 } 11980 11981 return context.key + "-" + serialized.name; 11982 }; 11983 11984 var cx = function cx() { 11985 if (hasRendered && "production" !== 'production') { 11986 throw new Error('cx can only be used during render'); 11987 } 11988 11989 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 11990 args[_key2] = arguments[_key2]; 11991 } 11992 11993 return merge(context.registered, css, core_browser_esm_classnames(args)); 11994 }; 11995 11996 var content = { 11997 css: css, 11998 cx: cx, 11999 theme: theme 12000 }; 12001 var ele = props.children(content); 12002 hasRendered = true; 12003 12004 return ele; 12005 }); 12006 }); 12007 12008 12009 12010 // CONCATENATED MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js 12011 12012 12013 12014 12015 12016 12017 12018 var testOmitPropsOnStringTag = is_prop_valid_browser_esm["default"]; 12019 12020 var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { 12021 return key !== 'theme' && key !== 'innerRef'; 12022 }; 12023 12024 var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) { 12025 return typeof tag === 'string' && // 96 is one less than the char code 12026 // for "a" so this is checking that 12027 // it's a lowercase character 12028 tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent; 12029 }; 12030 12031 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; } 12032 12033 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_default()(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; } 12034 var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; 12035 12036 var styled_base_browser_esm_createStyled = function createStyled(tag, options) { 12037 if (false) {} 12038 12039 var identifierName; 12040 var shouldForwardProp; 12041 var targetClassName; 12042 12043 if (options !== undefined) { 12044 identifierName = options.label; 12045 targetClassName = options.target; 12046 shouldForwardProp = tag.__emotion_forwardProp && options.shouldForwardProp ? function (propName) { 12047 return tag.__emotion_forwardProp(propName) && // $FlowFixMe 12048 options.shouldForwardProp(propName); 12049 } : options.shouldForwardProp; 12050 } 12051 12052 var isReal = tag.__emotion_real === tag; 12053 var baseTag = isReal && tag.__emotion_base || tag; 12054 12055 if (typeof shouldForwardProp !== 'function' && isReal) { 12056 shouldForwardProp = tag.__emotion_forwardProp; 12057 } 12058 12059 var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); 12060 var shouldUseAs = !defaultShouldForwardProp('as'); 12061 return function () { 12062 var args = arguments; 12063 var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; 12064 12065 if (identifierName !== undefined) { 12066 styles.push("label:" + identifierName + ";"); 12067 } 12068 12069 if (args[0] == null || args[0].raw === undefined) { 12070 styles.push.apply(styles, args); 12071 } else { 12072 if (false) {} 12073 12074 styles.push(args[0][0]); 12075 var len = args.length; 12076 var i = 1; 12077 12078 for (; i < len; i++) { 12079 if (false) {} 12080 12081 styles.push(args[i], args[0][i]); 12082 } 12083 } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class 12084 12085 12086 var Styled = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context, ref) { 12087 return Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 12088 var finalTag = shouldUseAs && props.as || baseTag; 12089 var className = ''; 12090 var classInterpolations = []; 12091 var mergedProps = props; 12092 12093 if (props.theme == null) { 12094 mergedProps = {}; 12095 12096 for (var key in props) { 12097 mergedProps[key] = props[key]; 12098 } 12099 12100 mergedProps.theme = theme; 12101 } 12102 12103 if (typeof props.className === 'string') { 12104 className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(context.registered, classInterpolations, props.className); 12105 } else if (props.className != null) { 12106 className = props.className + " "; 12107 } 12108 12109 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(styles.concat(classInterpolations), context.registered, mergedProps); 12110 var rules = Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, typeof finalTag === 'string'); 12111 className += context.key + "-" + serialized.name; 12112 12113 if (targetClassName !== undefined) { 12114 className += " " + targetClassName; 12115 } 12116 12117 var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp; 12118 var newProps = {}; 12119 12120 for (var _key in props) { 12121 if (shouldUseAs && _key === 'as') continue; 12122 12123 if ( // $FlowFixMe 12124 finalShouldForwardProp(_key)) { 12125 newProps[_key] = props[_key]; 12126 } 12127 } 12128 12129 newProps.className = className; 12130 newProps.ref = ref || props.innerRef; 12131 12132 if (false) {} 12133 12134 var ele = Object(external_React_["createElement"])(finalTag, newProps); 12135 12136 return ele; 12137 }); 12138 }); 12139 Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; 12140 Styled.defaultProps = tag.defaultProps; 12141 Styled.__emotion_real = Styled; 12142 Styled.__emotion_base = baseTag; 12143 Styled.__emotion_styles = styles; 12144 Styled.__emotion_forwardProp = shouldForwardProp; 12145 Object.defineProperty(Styled, 'toString', { 12146 value: function value() { 12147 if (targetClassName === undefined && "production" !== 'production') { 12148 return 'NO_COMPONENT_SELECTOR'; 12149 } // $FlowFixMe: coerce undefined to string 12150 12151 12152 return "." + targetClassName; 12153 } 12154 }); 12155 12156 Styled.withComponent = function (nextTag, nextOptions) { 12157 return createStyled(nextTag, nextOptions !== undefined ? _objectSpread({}, options || {}, {}, nextOptions) : options).apply(void 0, styles); 12158 }; 12159 12160 return Styled; 12161 }; 12162 }; 12163 12164 /* harmony default export */ var styled_base_browser_esm = (styled_base_browser_esm_createStyled); 12165 12166 // EXTERNAL MODULE: ./node_modules/tinycolor2/tinycolor.js 12167 var tinycolor = __webpack_require__("Zss7"); 12168 var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor); 12169 12170 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js 12171 /** 12172 * External dependencies 12173 */ 12174 12175 /** 12176 * Generating a CSS compliant rgba() color value. 12177 * 12178 * @param {string} hexValue The hex value to convert to rgba(). 12179 * @param {number} alpha The alpha value for opacity. 12180 * @return {string} The converted rgba() color value. 12181 * 12182 * @example 12183 * rgba( '#000000', 0.5 ) 12184 * // rgba(0, 0, 0, 0.5) 12185 */ 12186 12187 function rgba(hexValue = '', alpha = 1) { 12188 const { 12189 r, 12190 g, 12191 b 12192 } = tinycolor_default()(hexValue).toRgb(); 12193 return `rgba(${r}, ${g}, ${b}, ${alpha})`; 12194 } 12195 12196 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js 12197 /** 12198 * External dependencies 12199 */ 12200 12201 /** 12202 * Internal dependencies 12203 */ 12204 12205 12206 const BASE = { 12207 black: '#000', 12208 white: '#fff' 12209 }; 12210 /** 12211 * TODO: Continue to update values as "G2" design evolves. 12212 * 12213 * "G2" refers to the movement to advance the interface of the block editor. 12214 * https://github.com/WordPress/gutenberg/issues/18667 12215 */ 12216 12217 const G2 = { 12218 blue: { 12219 medium: { 12220 focus: '#007cba', 12221 focusDark: '#fff' 12222 } 12223 }, 12224 gray: { 12225 900: '#1e1e1e', 12226 700: '#757575', 12227 // Meets 4.6:1 text contrast against white. 12228 600: '#949494', 12229 // Meets 3:1 UI or large text contrast against white. 12230 400: '#ccc', 12231 200: '#ddd', 12232 // Used for most borders. 12233 100: '#f0f0f0' 12234 }, 12235 darkGray: { 12236 primary: '#1e1e1e', 12237 heading: '#050505' 12238 }, 12239 mediumGray: { 12240 text: '#757575' 12241 }, 12242 lightGray: { 12243 ui: '#949494', 12244 secondary: '#ccc', 12245 tertiary: '#e7e8e9' 12246 } 12247 }; 12248 const DARK_GRAY = { 12249 900: '#191e23', 12250 800: '#23282d', 12251 700: '#32373c', 12252 600: '#40464d', 12253 500: '#555d66', 12254 // Use this most of the time for dark items. 12255 400: '#606a73', 12256 300: '#6c7781', 12257 // Lightest gray that can be used for AA text contrast. 12258 200: '#7e8993', 12259 150: '#8d96a0', 12260 // Lightest gray that can be used for AA non-text contrast. 12261 100: '#8f98a1', 12262 placeholder: rgba(G2.gray[900], 0.62) 12263 }; 12264 const DARK_OPACITY = { 12265 900: rgba('#000510', 0.9), 12266 800: rgba('#00000a', 0.85), 12267 700: rgba('#06060b', 0.8), 12268 600: rgba('#000913', 0.75), 12269 500: rgba('#0a1829', 0.7), 12270 400: rgba('#0a1829', 0.65), 12271 300: rgba('#0e1c2e', 0.62), 12272 200: rgba('#162435', 0.55), 12273 100: rgba('#223443', 0.5), 12274 backgroundFill: rgba(DARK_GRAY[700], 0.7) 12275 }; 12276 const DARK_OPACITY_LIGHT = { 12277 900: rgba('#304455', 0.45), 12278 800: rgba('#425863', 0.4), 12279 700: rgba('#667886', 0.35), 12280 600: rgba('#7b86a2', 0.3), 12281 500: rgba('#9197a2', 0.25), 12282 400: rgba('#95959c', 0.2), 12283 300: rgba('#829493', 0.15), 12284 200: rgba('#8b8b96', 0.1), 12285 100: rgba('#747474', 0.05) 12286 }; 12287 const LIGHT_GRAY = { 12288 900: '#a2aab2', 12289 800: '#b5bcc2', 12290 700: '#ccd0d4', 12291 600: '#d7dade', 12292 500: '#e2e4e7', 12293 // Good for "grayed" items and borders. 12294 400: '#e8eaeb', 12295 // Good for "readonly" input fields and special text selection. 12296 300: '#edeff0', 12297 200: '#f3f4f5', 12298 100: '#f8f9f9', 12299 placeholder: rgba(BASE.white, 0.65) 12300 }; 12301 const LIGHT_OPACITY_LIGHT = { 12302 900: rgba(BASE.white, 0.5), 12303 800: rgba(BASE.white, 0.45), 12304 700: rgba(BASE.white, 0.4), 12305 600: rgba(BASE.white, 0.35), 12306 500: rgba(BASE.white, 0.3), 12307 400: rgba(BASE.white, 0.25), 12308 300: rgba(BASE.white, 0.2), 12309 200: rgba(BASE.white, 0.15), 12310 100: rgba(BASE.white, 0.1), 12311 backgroundFill: rgba(LIGHT_GRAY[300], 0.8) 12312 }; // Additional colors. 12313 // Some are from https://make.wordpress.org/design/handbook/foundations/colors/. 12314 12315 const BLUE = { 12316 wordpress: { 12317 700: '#00669b' 12318 }, 12319 dark: { 12320 900: '#0071a1' 12321 }, 12322 medium: { 12323 900: '#006589', 12324 800: '#00739c', 12325 700: '#007fac', 12326 600: '#008dbe', 12327 500: '#00a0d2', 12328 400: '#33b3db', 12329 300: '#66c6e4', 12330 200: '#bfe7f3', 12331 100: '#e5f5fa', 12332 highlight: '#b3e7fe', 12333 focus: '#007cba' 12334 } 12335 }; 12336 const ALERT = { 12337 yellow: '#f0b849', 12338 red: '#d94f4f', 12339 green: '#4ab866' 12340 }; 12341 const ADMIN = { 12342 theme: `var( --wp-admin-theme-color, ${BLUE.wordpress[700]})`, 12343 themeDark10: `var( --wp-admin-theme-color-darker-10, ${BLUE.medium.focus})` 12344 }; // Namespaced values for raw colors hex codes 12345 12346 const UI = { 12347 theme: ADMIN.theme, 12348 background: BASE.white, 12349 backgroundDisabled: LIGHT_GRAY[200], 12350 border: G2.gray[700], 12351 borderFocus: ADMIN.themeDark10, 12352 borderDisabled: G2.gray[400], 12353 borderLight: G2.gray[200], 12354 label: DARK_GRAY[500], 12355 textDisabled: DARK_GRAY[150], 12356 textDark: BASE.white, 12357 textLight: BASE.black 12358 }; 12359 const COLORS = { ...BASE, 12360 darkGray: Object(external_lodash_["merge"])({}, DARK_GRAY, G2.darkGray), 12361 darkOpacity: DARK_OPACITY, 12362 darkOpacityLight: DARK_OPACITY_LIGHT, 12363 mediumGray: G2.mediumGray, 12364 gray: G2.gray, 12365 lightGray: Object(external_lodash_["merge"])({}, LIGHT_GRAY, G2.lightGray), 12366 lightGrayLight: LIGHT_OPACITY_LIGHT, 12367 blue: Object(external_lodash_["merge"])({}, BLUE, G2.blue), 12368 alert: ALERT, 12369 admin: ADMIN, 12370 ui: UI 12371 }; 12372 /* harmony default export */ var colors_values = (COLORS); 12373 12374 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js 12375 /** 12376 * Allows users to opt-out of animations via OS-level preferences. 12377 * 12378 * @param {'transition' | 'animation' | string} [prop='transition'] CSS Property name 12379 * @return {string} Generated CSS code for the reduced style 12380 */ 12381 function reduceMotion(prop = 'transition') { 12382 let style; 12383 12384 switch (prop) { 12385 case 'transition': 12386 style = 'transition-duration: 0ms;'; 12387 break; 12388 12389 case 'animation': 12390 style = 'animation-duration: 1ms;'; 12391 break; 12392 12393 default: 12394 style = ` 12395 animation-duration: 1ms; 12396 transition-duration: 0ms; 12397 `; 12398 } 12399 12400 return ` 12401 @media ( prefers-reduced-motion: reduce ) { 12402 ${style}; 12403 } 12404 `; 12405 } 12406 12407 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js 12408 12409 12410 function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 12411 12412 12413 /** 12414 * Internal dependencies 12415 */ 12416 12417 12418 12419 var alignment_matrix_control_styles_ref = true ? { 12420 name: "1xiracb", 12421 styles: "border-radius:2px;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3,1fr );outline:none;" 12422 } : undefined; 12423 12424 const rootBase = () => { 12425 return alignment_matrix_control_styles_ref; 12426 }; 12427 12428 const rootSize = ({ 12429 size = 92 12430 }) => { 12431 return /*#__PURE__*/css_browser_esm("grid-template-rows:repeat( 3,calc( ", size, "px / 3 ) );width:", size, "px;" + ( true ? "" : undefined)); 12432 }; 12433 12434 const Root = styled_base_browser_esm("div", { 12435 target: "e1od1u4s0", 12436 label: "Root" 12437 })(rootBase, ";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;", rootSize, ";" + ( true ? "" : undefined)); 12438 const Row = styled_base_browser_esm("div", { 12439 target: "e1od1u4s1", 12440 label: "Row" 12441 })( true ? { 12442 name: "1177s8r", 12443 styles: "box-sizing:border-box;display:grid;grid-template-columns:repeat( 3,1fr );" 12444 } : undefined); 12445 12446 const pointActive = ({ 12447 isActive 12448 }) => { 12449 const boxShadow = isActive ? `0 0 0 2px ${COLORS.black}` : null; 12450 const pointColor = isActive ? COLORS.black : COLORS.lightGray[800]; 12451 const pointColorHover = isActive ? COLORS.black : COLORS.blue.medium.focus; 12452 return /*#__PURE__*/css_browser_esm("box-shadow:", boxShadow, ";color:", pointColor, ";*:hover > &{color:", pointColorHover, ";}" + ( true ? "" : undefined)); 12453 }; 12454 12455 const pointBase = props => { 12456 return /*#__PURE__*/css_browser_esm("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;", reduceMotion('transition'), " ", pointActive(props), true ? "" : undefined); 12457 }; 12458 const Point = styled_base_browser_esm("span", { 12459 target: "e1od1u4s2", 12460 label: "Point" 12461 })("height:6px;width:6px;", pointBase, true ? "" : undefined); 12462 const Cell = styled_base_browser_esm("span", { 12463 target: "e1od1u4s3", 12464 label: "Cell" 12465 })( true ? { 12466 name: "10ro24i", 12467 styles: "appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0;" 12468 } : undefined); 12469 12470 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js 12471 12472 12473 12474 /** 12475 * Internal dependencies 12476 */ 12477 12478 12479 12480 /** 12481 * Internal dependencies 12482 */ 12483 12484 12485 12486 function cell_Cell({ 12487 isActive = false, 12488 value, 12489 ...props 12490 }) { 12491 const tooltipText = ALIGNMENT_LABEL[value]; 12492 return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], { 12493 text: tooltipText 12494 }, Object(external_wp_element_["createElement"])(CompositeItem["a" /* CompositeItem */], Object(esm_extends["a" /* default */])({ 12495 as: Cell, 12496 role: "gridcell" 12497 }, props), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], null, value), Object(external_wp_element_["createElement"])(Point, { 12498 isActive: isActive, 12499 role: "presentation" 12500 }))); 12501 } 12502 12503 // EXTERNAL MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js 12504 var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("BZp5"); 12505 12506 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js 12507 var useIsomorphicEffect = __webpack_require__("AXvK"); 12508 12509 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/useSealedState.js 12510 12511 12512 /** 12513 * React custom hook that returns the very first value passed to `initialState`, 12514 * even if it changes between re-renders. 12515 */ 12516 function useSealedState(initialState) { 12517 var _React$useState = Object(external_React_["useState"])(initialState), 12518 sealed = _React$useState[0]; 12519 12520 return sealed; 12521 } 12522 12523 12524 12525 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getDocument.js 12526 var getDocument = __webpack_require__("ouKs"); 12527 12528 // CONCATENATED MODULE: ./node_modules/reakit/es/reverse-30eaa122.js 12529 12530 12531 function groupItems(items) { 12532 var groups = [[]]; 12533 12534 var _loop = function _loop() { 12535 var item = _step.value; 12536 var group = groups.find(function (g) { 12537 return !g[0] || g[0].groupId === item.groupId; 12538 }); 12539 12540 if (group) { 12541 group.push(item); 12542 } else { 12543 groups.push([item]); 12544 } 12545 }; 12546 12547 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) { 12548 _loop(); 12549 } 12550 12551 return groups; 12552 } 12553 12554 function flatten(grid) { 12555 var flattened = []; 12556 12557 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(grid), _step; !(_step = _iterator()).done;) { 12558 var row = _step.value; 12559 flattened.push.apply(flattened, row); 12560 } 12561 12562 return flattened; 12563 } 12564 12565 function reverse(array) { 12566 return array.slice().reverse(); 12567 } 12568 12569 12570 12571 // EXTERNAL MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js 12572 var getCurrentId_5aa9849e = __webpack_require__("iYXd"); 12573 12574 // CONCATENATED MODULE: ./node_modules/reakit/es/findEnabledItemById-8ddca752.js 12575 function findEnabledItemById(items, id) { 12576 if (!id) return undefined; 12577 return items === null || items === void 0 ? void 0 : items.find(function (item) { 12578 return item.id === id && !item.disabled; 12579 }); 12580 } 12581 12582 12583 12584 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/applyState.js 12585 function isUpdater(argument) { 12586 return typeof argument === "function"; 12587 } 12588 /** 12589 * Receives a `setState` argument and calls it with `currentValue` if it's a 12590 * function. Otherwise return the argument as the new value. 12591 * 12592 * @example 12593 * import { applyState } from "reakit-utils"; 12594 * 12595 * applyState((value) => value + 1, 1); // 2 12596 * applyState(2, 1); // 2 12597 */ 12598 12599 12600 function applyState(argument, currentValue) { 12601 if (isUpdater(argument)) { 12602 return argument(currentValue); 12603 } 12604 12605 return argument; 12606 } 12607 12608 12609 12610 // EXTERNAL MODULE: ./node_modules/reakit/es/Id/IdProvider.js 12611 var IdProvider = __webpack_require__("KCH1"); 12612 12613 // CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdState.js 12614 12615 12616 12617 12618 function unstable_useIdState(initialState) { 12619 if (initialState === void 0) { 12620 initialState = {}; 12621 } 12622 12623 var _useSealedState = useSealedState(initialState), 12624 initialBaseId = _useSealedState.baseId; 12625 12626 var generateId = Object(external_React_["useContext"])(IdProvider["a" /* unstable_IdContext */]); 12627 var idCountRef = Object(external_React_["useRef"])(0); 12628 12629 var _React$useState = Object(external_React_["useState"])(function () { 12630 return initialBaseId || generateId(); 12631 }), 12632 baseId = _React$useState[0], 12633 setBaseId = _React$useState[1]; 12634 12635 return { 12636 baseId: baseId, 12637 setBaseId: setBaseId, 12638 unstable_idCountRef: idCountRef 12639 }; 12640 } 12641 12642 12643 12644 // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeState.js 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 function isElementPreceding(element1, element2) { 12658 return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING); 12659 } 12660 12661 function findDOMIndex(items, item) { 12662 return items.findIndex(function (currentItem) { 12663 if (!currentItem.ref.current || !item.ref.current) { 12664 return false; 12665 } 12666 12667 return isElementPreceding(item.ref.current, currentItem.ref.current); 12668 }); 12669 } 12670 12671 function getMaxLength(rows) { 12672 var maxLength = 0; 12673 12674 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(rows), _step; !(_step = _iterator()).done;) { 12675 var length = _step.value.length; 12676 12677 if (length > maxLength) { 12678 maxLength = length; 12679 } 12680 } 12681 12682 return maxLength; 12683 } 12684 12685 /** 12686 * Turns [row1, row1, row2, row2] into [row1, row2, row1, row2] 12687 */ 12688 12689 function verticalizeItems(items) { 12690 var groups = groupItems(items); 12691 var maxLength = getMaxLength(groups); 12692 var verticalized = []; 12693 12694 for (var i = 0; i < maxLength; i += 1) { 12695 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) { 12696 var group = _step.value; 12697 12698 if (group[i]) { 12699 verticalized.push(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, group[i]), {}, { 12700 // If there's no groupId, it means that it's not a grid composite, 12701 // but a single row instead. So, instead of verticalizing it, that 12702 // is, assigning a different groupId based on the column index, we 12703 // keep it undefined so they will be part of the same group. 12704 // It's useful when using up/down on one-dimensional composites. 12705 groupId: group[i].groupId ? "" + i : undefined 12706 })); 12707 } 12708 } 12709 } 12710 12711 return verticalized; 12712 } 12713 12714 function createEmptyItem(groupId) { 12715 return { 12716 id: "__EMPTY_ITEM__", 12717 disabled: true, 12718 ref: { 12719 current: null 12720 }, 12721 groupId: groupId 12722 }; 12723 } 12724 /** 12725 * Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]] 12726 */ 12727 12728 12729 function fillGroups(groups, currentId, shift) { 12730 var maxLength = getMaxLength(groups); 12731 12732 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) { 12733 var group = _step.value; 12734 12735 for (var i = 0; i < maxLength; i += 1) { 12736 var item = group[i]; 12737 12738 if (!item || shift && item.disabled) { 12739 var isFrist = i === 0; 12740 var previousItem = isFrist && shift ? Object(getCurrentId_5aa9849e["a" /* f */])(group) : group[i - 1]; 12741 group[i] = previousItem && currentId !== (previousItem === null || previousItem === void 0 ? void 0 : previousItem.id) && shift ? previousItem : createEmptyItem(previousItem === null || previousItem === void 0 ? void 0 : previousItem.groupId); 12742 } 12743 } 12744 } 12745 12746 return groups; 12747 } 12748 12749 var nullItem = { 12750 id: null, 12751 ref: { 12752 current: null 12753 } 12754 }; 12755 function placeItemsAfter(items, id, shouldInsertNullItem) { 12756 var index = items.findIndex(function (item) { 12757 return item.id === id; 12758 }); 12759 return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index)); 12760 } 12761 12762 function getItemsInGroup(items, groupId) { 12763 return items.filter(function (item) { 12764 return item.groupId === groupId; 12765 }); 12766 } 12767 12768 var map = { 12769 horizontal: "vertical", 12770 vertical: "horizontal" 12771 }; 12772 function getOppositeOrientation(orientation) { 12773 return orientation && map[orientation]; 12774 } 12775 12776 function addItemAtIndex(array, item, index) { 12777 if (!(index in array)) { 12778 return [].concat(array, [item]); 12779 } 12780 12781 return [].concat(array.slice(0, index), [item], array.slice(index)); 12782 } 12783 12784 function sortBasedOnDOMPosition(items) { 12785 var pairs = items.map(function (item, index) { 12786 return [index, item]; 12787 }); 12788 var isOrderDifferent = false; 12789 pairs.sort(function (_ref, _ref2) { 12790 var indexA = _ref[0], 12791 a = _ref[1]; 12792 var indexB = _ref2[0], 12793 b = _ref2[1]; 12794 var elementA = a.ref.current; 12795 var elementB = b.ref.current; 12796 if (!elementA || !elementB) return 0; // a before b 12797 12798 if (isElementPreceding(elementA, elementB)) { 12799 if (indexA > indexB) { 12800 isOrderDifferent = true; 12801 } 12802 12803 return -1; 12804 } // a after b 12805 12806 12807 if (indexA < indexB) { 12808 isOrderDifferent = true; 12809 } 12810 12811 return 1; 12812 }); 12813 12814 if (isOrderDifferent) { 12815 return pairs.map(function (_ref3) { 12816 var _ = _ref3[0], 12817 item = _ref3[1]; 12818 return item; 12819 }); 12820 } 12821 12822 return items; 12823 } 12824 12825 function setItemsBasedOnDOMPosition(items, setItems) { 12826 var sortedItems = sortBasedOnDOMPosition(items); 12827 12828 if (items !== sortedItems) { 12829 setItems(sortedItems); 12830 } 12831 } 12832 12833 function getCommonParent(items) { 12834 var _firstItem$ref$curren; 12835 12836 var firstItem = items[0], 12837 nextItems = items.slice(1); 12838 var parentElement = firstItem === null || firstItem === void 0 ? void 0 : (_firstItem$ref$curren = firstItem.ref.current) === null || _firstItem$ref$curren === void 0 ? void 0 : _firstItem$ref$curren.parentElement; 12839 12840 var _loop = function _loop() { 12841 var parent = parentElement; 12842 12843 if (nextItems.every(function (item) { 12844 return parent.contains(item.ref.current); 12845 })) { 12846 return { 12847 v: parentElement 12848 }; 12849 } 12850 12851 parentElement = parentElement.parentElement; 12852 }; 12853 12854 while (parentElement) { 12855 var _ret = _loop(); 12856 12857 if (typeof _ret === "object") return _ret.v; 12858 } 12859 12860 return Object(getDocument["a" /* getDocument */])(parentElement).body; 12861 } // istanbul ignore next: JSDOM doesn't support IntersectionObverser 12862 // See https://github.com/jsdom/jsdom/issues/2032 12863 12864 12865 function useIntersectionObserver(items, setItems) { 12866 var previousItems = Object(external_React_["useRef"])([]); 12867 Object(external_React_["useEffect"])(function () { 12868 var callback = function callback() { 12869 var hasPreviousItems = !!previousItems.current.length; // We don't want to sort items if items have been just registered. 12870 12871 if (hasPreviousItems) { 12872 setItemsBasedOnDOMPosition(items, setItems); 12873 } 12874 12875 previousItems.current = items; 12876 }; 12877 12878 var root = getCommonParent(items); 12879 var observer = new IntersectionObserver(callback, { 12880 root: root 12881 }); 12882 12883 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) { 12884 var item = _step.value; 12885 12886 if (item.ref.current) { 12887 observer.observe(item.ref.current); 12888 } 12889 } 12890 12891 return function () { 12892 observer.disconnect(); 12893 }; 12894 }, [items]); 12895 } 12896 12897 function useTimeoutObserver(items, setItems) { 12898 Object(external_React_["useEffect"])(function () { 12899 var callback = function callback() { 12900 return setItemsBasedOnDOMPosition(items, setItems); 12901 }; 12902 12903 var timeout = setTimeout(callback, 250); 12904 return function () { 12905 return clearTimeout(timeout); 12906 }; 12907 }); 12908 } 12909 12910 function useSortBasedOnDOMPosition(items, setItems) { 12911 if (typeof IntersectionObserver === "function") { 12912 useIntersectionObserver(items, setItems); 12913 } else { 12914 useTimeoutObserver(items, setItems); 12915 } 12916 } 12917 12918 function CompositeState_reducer(state, action) { 12919 var virtual = state.unstable_virtual, 12920 rtl = state.rtl, 12921 orientation = state.orientation, 12922 items = state.items, 12923 groups = state.groups, 12924 currentId = state.currentId, 12925 loop = state.loop, 12926 wrap = state.wrap, 12927 pastIds = state.pastIds, 12928 shift = state.shift, 12929 moves = state.unstable_moves, 12930 includesBaseElement = state.unstable_includesBaseElement, 12931 initialVirtual = state.initialVirtual, 12932 initialRTL = state.initialRTL, 12933 initialOrientation = state.initialOrientation, 12934 initialCurrentId = state.initialCurrentId, 12935 initialLoop = state.initialLoop, 12936 initialWrap = state.initialWrap, 12937 initialShift = state.initialShift, 12938 hasSetCurrentId = state.hasSetCurrentId; 12939 12940 switch (action.type) { 12941 case "registerGroup": 12942 { 12943 var _group = action.group; // If there are no groups yet, just add it as the first one 12944 12945 if (groups.length === 0) { 12946 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 12947 groups: [_group] 12948 }); 12949 } // Finds the group index based on DOM position 12950 12951 12952 var index = findDOMIndex(groups, _group); 12953 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 12954 groups: addItemAtIndex(groups, _group, index) 12955 }); 12956 } 12957 12958 case "unregisterGroup": 12959 { 12960 var _id = action.id; 12961 var nextGroups = groups.filter(function (group) { 12962 return group.id !== _id; 12963 }); // The group isn't registered, so do nothing 12964 12965 if (nextGroups.length === groups.length) { 12966 return state; 12967 } 12968 12969 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 12970 groups: nextGroups 12971 }); 12972 } 12973 12974 case "registerItem": 12975 { 12976 var _item = action.item; // Finds the item group based on the DOM hierarchy 12977 12978 var _group2 = groups.find(function (r) { 12979 var _r$ref$current; 12980 12981 return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current); 12982 }); // Group will be null if it's a one-dimensional composite 12983 12984 12985 var nextItem = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 12986 groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id 12987 }, _item); 12988 12989 var _index = findDOMIndex(items, nextItem); 12990 12991 var nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 12992 items: addItemAtIndex(items, nextItem, _index) 12993 }); 12994 12995 if (!hasSetCurrentId && !moves && initialCurrentId === undefined) { 12996 var _findFirstEnabledItem; 12997 12998 // Sets currentId to the first enabled item. This runs whenever an item 12999 // is registered because the first enabled item may be registered 13000 // asynchronously. 13001 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, nextState), {}, { 13002 currentId: (_findFirstEnabledItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id 13003 }); 13004 } 13005 13006 return nextState; 13007 } 13008 13009 case "unregisterItem": 13010 { 13011 var _id2 = action.id; 13012 var nextItems = items.filter(function (item) { 13013 return item.id !== _id2; 13014 }); // The item isn't registered, so do nothing 13015 13016 if (nextItems.length === items.length) { 13017 return state; 13018 } // Filters out the item that is being removed from the pastIds list 13019 13020 13021 var nextPastIds = pastIds.filter(function (pastId) { 13022 return pastId !== _id2; 13023 }); 13024 13025 var _nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13026 pastIds: nextPastIds, 13027 items: nextItems 13028 }); // If the current item is the item that is being removed, focus pastId 13029 13030 13031 if (currentId && currentId === _id2) { 13032 var nextId = includesBaseElement ? null : Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, { 13033 currentId: nextPastIds[0] 13034 })); 13035 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, { 13036 currentId: nextId 13037 }); 13038 } 13039 13040 return _nextState; 13041 } 13042 13043 case "move": 13044 { 13045 var _id3 = action.id; // move() does nothing 13046 13047 if (_id3 === undefined) { 13048 return state; 13049 } // Removes the current item and the item that is receiving focus from the 13050 // pastIds list 13051 13052 13053 var filteredPastIds = pastIds.filter(function (pastId) { 13054 return pastId !== currentId && pastId !== _id3; 13055 }); // If there's a currentId, add it to the pastIds list so it can be focused 13056 // if the new item gets removed or disabled 13057 13058 var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds; 13059 13060 var _nextState2 = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13061 pastIds: _nextPastIds 13062 }); // move(null) will focus the composite element itself, not an item 13063 13064 13065 if (_id3 === null) { 13066 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, { 13067 unstable_moves: moves + 1, 13068 currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _id3) 13069 }); 13070 } 13071 13072 var _item2 = findEnabledItemById(items, _id3); 13073 13074 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, { 13075 unstable_moves: _item2 ? moves + 1 : moves, 13076 currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id) 13077 }); 13078 } 13079 13080 case "next": 13081 { 13082 // If there's no item focused, we just move the first one 13083 if (currentId == null) { 13084 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13085 type: "first" 13086 })); 13087 } // RTL doesn't make sense on vertical navigation 13088 13089 13090 var isHorizontal = orientation !== "vertical"; 13091 var isRTL = rtl && isHorizontal; 13092 var allItems = isRTL ? reverse(items) : items; 13093 var currentItem = allItems.find(function (item) { 13094 return item.id === currentId; 13095 }); // If there's no item focused, we just move the first one 13096 13097 if (!currentItem) { 13098 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13099 type: "first" 13100 })); 13101 } 13102 13103 var isGrid = !!currentItem.groupId; 13104 var currentIndex = allItems.indexOf(currentItem); 13105 13106 var _nextItems = allItems.slice(currentIndex + 1); 13107 13108 var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End 13109 13110 if (action.allTheWay) { 13111 // We reverse so we can get the last enabled item in the group. If it's 13112 // RTL, nextItems and nextItemsInGroup are already reversed and don't 13113 // have the items before the current one anymore. So we have to get 13114 // items in group again with allItems. 13115 var _nextItem2 = Object(getCurrentId_5aa9849e["a" /* f */])(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup)); 13116 13117 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13118 type: "move", 13119 id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id 13120 })); 13121 } 13122 13123 var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous 13124 // call, which is inherently horizontal. up/down will call next with 13125 // orientation set to vertical by default (see below on up/down cases). 13126 isGrid ? orientation || "horizontal" : orientation); 13127 var canLoop = loop && loop !== oppositeOrientation; 13128 var canWrap = isGrid && wrap && wrap !== oppositeOrientation; 13129 var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling 13130 // next directly, hasNullItem will only be true if it's not a grid and 13131 // loop is set to true, which means that pressing right or down keys on 13132 // grids will never focus the composite element. On one-dimensional 13133 // composites that don't loop, pressing right or down keys also doesn't 13134 // focus the composite element. 13135 action.hasNullItem || !isGrid && canLoop && includesBaseElement; 13136 13137 if (canLoop) { 13138 var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1] 13139 13140 var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem); 13141 13142 var _nextItem3 = Object(getCurrentId_5aa9849e["a" /* f */])(sortedItems, currentId); 13143 13144 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13145 type: "move", 13146 id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id 13147 })); 13148 } 13149 13150 if (canWrap) { 13151 var _nextItem4 = Object(getCurrentId_5aa9849e["a" /* f */])( // We can use nextItems, which contains all the next items, including 13152 // items from other groups, to wrap between groups. However, if there 13153 // is a null item (the composite element), we'll only use the next 13154 // items in the group. So moving next from the last item will focus 13155 // the composite element (null). On grid composites, horizontal 13156 // navigation never focuses the composite element, only vertical. 13157 hasNullItem ? nextItemsInGroup : _nextItems, currentId); 13158 13159 var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id; 13160 13161 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13162 type: "move", 13163 id: _nextId 13164 })); 13165 } 13166 13167 var _nextItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextItemsInGroup, currentId); 13168 13169 if (!_nextItem && hasNullItem) { 13170 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13171 type: "move", 13172 id: null 13173 })); 13174 } 13175 13176 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13177 type: "move", 13178 id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id 13179 })); 13180 } 13181 13182 case "previous": 13183 { 13184 // If currentId is initially set to null, the composite element will be 13185 // focusable while navigating with arrow keys. But, if it's a grid, we 13186 // don't want to focus the composite element with horizontal navigation. 13187 var _isGrid = !!groups.length; 13188 13189 var _hasNullItem = !_isGrid && includesBaseElement; 13190 13191 var _nextState3 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13192 items: reverse(items) 13193 }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13194 type: "next", 13195 hasNullItem: _hasNullItem 13196 })); 13197 13198 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState3), {}, { 13199 items: items 13200 }); 13201 } 13202 13203 case "down": 13204 { 13205 var shouldShift = shift && !action.allTheWay; // First, we make sure groups have the same number of items by filling it 13206 // with disabled fake items. Then, we reorganize the items list so 13207 // [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2]. 13208 13209 var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items), currentId, shouldShift))); 13210 13211 var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop 13212 // is true or vertical. 13213 13214 13215 var _hasNullItem2 = _canLoop && includesBaseElement; 13216 13217 var _nextState4 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13218 orientation: "vertical", 13219 items: verticalItems 13220 }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13221 type: "next", 13222 hasNullItem: _hasNullItem2 13223 })); 13224 13225 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState4), {}, { 13226 orientation: orientation, 13227 items: items 13228 }); 13229 } 13230 13231 case "up": 13232 { 13233 var _shouldShift = shift && !action.allTheWay; 13234 13235 var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items), currentId, _shouldShift)))); // If currentId is initially set to null, we'll always focus the 13236 // composite element when the up arrow key is pressed in the first row. 13237 13238 13239 var _hasNullItem3 = includesBaseElement; 13240 13241 var _nextState5 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13242 orientation: "vertical", 13243 items: _verticalItems 13244 }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13245 type: "next", 13246 hasNullItem: _hasNullItem3 13247 })); 13248 13249 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState5), {}, { 13250 orientation: orientation, 13251 items: items 13252 }); 13253 } 13254 13255 case "first": 13256 { 13257 var firstItem = Object(getCurrentId_5aa9849e["a" /* f */])(items); 13258 return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13259 type: "move", 13260 id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id 13261 })); 13262 } 13263 13264 case "last": 13265 { 13266 var _nextState6 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13267 items: reverse(items) 13268 }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, { 13269 type: "first" 13270 })); 13271 13272 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState6), {}, { 13273 items: items 13274 }); 13275 } 13276 13277 case "sort": 13278 { 13279 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13280 items: sortBasedOnDOMPosition(items), 13281 groups: sortBasedOnDOMPosition(groups) 13282 }); 13283 } 13284 13285 case "setVirtual": 13286 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13287 unstable_virtual: applyState(action.virtual, virtual) 13288 }); 13289 13290 case "setRTL": 13291 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13292 rtl: applyState(action.rtl, rtl) 13293 }); 13294 13295 case "setOrientation": 13296 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13297 orientation: applyState(action.orientation, orientation) 13298 }); 13299 13300 case "setCurrentId": 13301 { 13302 var nextCurrentId = Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13303 currentId: applyState(action.currentId, currentId) 13304 })); 13305 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13306 currentId: nextCurrentId, 13307 hasSetCurrentId: true 13308 }); 13309 } 13310 13311 case "setLoop": 13312 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13313 loop: applyState(action.loop, loop) 13314 }); 13315 13316 case "setWrap": 13317 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13318 wrap: applyState(action.wrap, wrap) 13319 }); 13320 13321 case "setShift": 13322 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13323 shift: applyState(action.shift, shift) 13324 }); 13325 13326 case "setIncludesBaseElement": 13327 { 13328 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13329 unstable_includesBaseElement: applyState(action.includesBaseElement, includesBaseElement) 13330 }); 13331 } 13332 13333 case "reset": 13334 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13335 unstable_virtual: initialVirtual, 13336 rtl: initialRTL, 13337 orientation: initialOrientation, 13338 currentId: Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13339 currentId: initialCurrentId 13340 })), 13341 loop: initialLoop, 13342 wrap: initialWrap, 13343 shift: initialShift, 13344 unstable_moves: 0, 13345 pastIds: [] 13346 }); 13347 13348 case "setItems": 13349 { 13350 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, { 13351 items: action.items 13352 }); 13353 } 13354 13355 default: 13356 throw new Error(); 13357 } 13358 } 13359 13360 function useAction(fn) { 13361 return Object(external_React_["useCallback"])(fn, []); 13362 } 13363 13364 function useIsUnmountedRef() { 13365 var isUnmountedRef = Object(external_React_["useRef"])(false); 13366 Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () { 13367 return function () { 13368 isUnmountedRef.current = true; 13369 }; 13370 }, []); 13371 return isUnmountedRef; 13372 } 13373 13374 function useCompositeState(initialState) { 13375 if (initialState === void 0) { 13376 initialState = {}; 13377 } 13378 13379 var _useSealedState = useSealedState(initialState), 13380 _useSealedState$unsta = _useSealedState.unstable_virtual, 13381 virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta, 13382 _useSealedState$rtl = _useSealedState.rtl, 13383 rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl, 13384 orientation = _useSealedState.orientation, 13385 currentId = _useSealedState.currentId, 13386 _useSealedState$loop = _useSealedState.loop, 13387 loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop, 13388 _useSealedState$wrap = _useSealedState.wrap, 13389 wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap, 13390 _useSealedState$shift = _useSealedState.shift, 13391 shift = _useSealedState$shift === void 0 ? false : _useSealedState$shift, 13392 unstable_includesBaseElement = _useSealedState.unstable_includesBaseElement, 13393 sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap", "shift", "unstable_includesBaseElement"]); 13394 13395 var idState = unstable_useIdState(sealed); 13396 13397 var _React$useReducer = Object(external_React_["useReducer"])(CompositeState_reducer, { 13398 unstable_virtual: virtual, 13399 rtl: rtl, 13400 orientation: orientation, 13401 items: [], 13402 groups: [], 13403 currentId: currentId, 13404 loop: loop, 13405 wrap: wrap, 13406 shift: shift, 13407 unstable_moves: 0, 13408 pastIds: [], 13409 unstable_includesBaseElement: unstable_includesBaseElement != null ? unstable_includesBaseElement : currentId === null, 13410 initialVirtual: virtual, 13411 initialRTL: rtl, 13412 initialOrientation: orientation, 13413 initialCurrentId: currentId, 13414 initialLoop: loop, 13415 initialWrap: wrap, 13416 initialShift: shift 13417 }), 13418 _React$useReducer$ = _React$useReducer[0], 13419 pastIds = _React$useReducer$.pastIds, 13420 initialVirtual = _React$useReducer$.initialVirtual, 13421 initialRTL = _React$useReducer$.initialRTL, 13422 initialOrientation = _React$useReducer$.initialOrientation, 13423 initialCurrentId = _React$useReducer$.initialCurrentId, 13424 initialLoop = _React$useReducer$.initialLoop, 13425 initialWrap = _React$useReducer$.initialWrap, 13426 initialShift = _React$useReducer$.initialShift, 13427 hasSetCurrentId = _React$useReducer$.hasSetCurrentId, 13428 state = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "initialShift", "hasSetCurrentId"]), 13429 dispatch = _React$useReducer[1]; 13430 13431 var _React$useState = Object(external_React_["useState"])(false), 13432 hasActiveWidget = _React$useState[0], 13433 setHasActiveWidget = _React$useState[1]; // register/unregister may be called when this component is unmounted. We 13434 // store the unmounted state here so we don't update the state if it's true. 13435 // This only happens in a very specific situation. 13436 // See https://github.com/reakit/reakit/issues/650 13437 13438 13439 var isUnmountedRef = useIsUnmountedRef(); 13440 var setItems = Object(external_React_["useCallback"])(function (items) { 13441 return dispatch({ 13442 type: "setItems", 13443 items: items 13444 }); 13445 }, []); 13446 useSortBasedOnDOMPosition(state.items, setItems); 13447 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, idState), state), {}, { 13448 unstable_hasActiveWidget: hasActiveWidget, 13449 unstable_setHasActiveWidget: setHasActiveWidget, 13450 registerItem: useAction(function (item) { 13451 if (isUnmountedRef.current) return; 13452 dispatch({ 13453 type: "registerItem", 13454 item: item 13455 }); 13456 }), 13457 unregisterItem: useAction(function (id) { 13458 if (isUnmountedRef.current) return; 13459 dispatch({ 13460 type: "unregisterItem", 13461 id: id 13462 }); 13463 }), 13464 registerGroup: useAction(function (group) { 13465 if (isUnmountedRef.current) return; 13466 dispatch({ 13467 type: "registerGroup", 13468 group: group 13469 }); 13470 }), 13471 unregisterGroup: useAction(function (id) { 13472 if (isUnmountedRef.current) return; 13473 dispatch({ 13474 type: "unregisterGroup", 13475 id: id 13476 }); 13477 }), 13478 move: useAction(function (id) { 13479 return dispatch({ 13480 type: "move", 13481 id: id 13482 }); 13483 }), 13484 next: useAction(function (allTheWay) { 13485 return dispatch({ 13486 type: "next", 13487 allTheWay: allTheWay 13488 }); 13489 }), 13490 previous: useAction(function (allTheWay) { 13491 return dispatch({ 13492 type: "previous", 13493 allTheWay: allTheWay 13494 }); 13495 }), 13496 up: useAction(function (allTheWay) { 13497 return dispatch({ 13498 type: "up", 13499 allTheWay: allTheWay 13500 }); 13501 }), 13502 down: useAction(function (allTheWay) { 13503 return dispatch({ 13504 type: "down", 13505 allTheWay: allTheWay 13506 }); 13507 }), 13508 first: useAction(function () { 13509 return dispatch({ 13510 type: "first" 13511 }); 13512 }), 13513 last: useAction(function () { 13514 return dispatch({ 13515 type: "last" 13516 }); 13517 }), 13518 sort: useAction(function () { 13519 return dispatch({ 13520 type: "sort" 13521 }); 13522 }), 13523 unstable_setVirtual: useAction(function (value) { 13524 return dispatch({ 13525 type: "setVirtual", 13526 virtual: value 13527 }); 13528 }), 13529 setRTL: useAction(function (value) { 13530 return dispatch({ 13531 type: "setRTL", 13532 rtl: value 13533 }); 13534 }), 13535 setOrientation: useAction(function (value) { 13536 return dispatch({ 13537 type: "setOrientation", 13538 orientation: value 13539 }); 13540 }), 13541 setCurrentId: useAction(function (value) { 13542 return dispatch({ 13543 type: "setCurrentId", 13544 currentId: value 13545 }); 13546 }), 13547 setLoop: useAction(function (value) { 13548 return dispatch({ 13549 type: "setLoop", 13550 loop: value 13551 }); 13552 }), 13553 setWrap: useAction(function (value) { 13554 return dispatch({ 13555 type: "setWrap", 13556 wrap: value 13557 }); 13558 }), 13559 setShift: useAction(function (value) { 13560 return dispatch({ 13561 type: "setShift", 13562 shift: value 13563 }); 13564 }), 13565 unstable_setIncludesBaseElement: useAction(function (value) { 13566 return dispatch({ 13567 type: "setIncludesBaseElement", 13568 includesBaseElement: value 13569 }); 13570 }), 13571 reset: useAction(function () { 13572 return dispatch({ 13573 type: "reset" 13574 }); 13575 }) 13576 }); 13577 } 13578 13579 13580 13581 // EXTERNAL MODULE: ./node_modules/reakit-system/es/createComponent.js + 3 modules 13582 var createComponent = __webpack_require__("hE48"); 13583 13584 // EXTERNAL MODULE: ./node_modules/reakit-system/es/createHook.js + 4 modules 13585 var createHook = __webpack_require__("qdes"); 13586 13587 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useForkRef.js 13588 var useForkRef = __webpack_require__("aU41"); 13589 13590 // EXTERNAL MODULE: ./node_modules/reakit-warning/es/index.js + 1 modules 13591 var es = __webpack_require__("KA1K"); 13592 13593 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useLiveRef.js 13594 var useLiveRef = __webpack_require__("eNtd"); 13595 13596 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isSelfTarget.js 13597 var isSelfTarget = __webpack_require__("k2cL"); 13598 13599 // EXTERNAL MODULE: ./node_modules/reakit/es/Role/Role.js 13600 var Role = __webpack_require__("zGFp"); 13601 13602 // EXTERNAL MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js 13603 var Tabbable = __webpack_require__("G3V0"); 13604 13605 // EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js 13606 var useCreateElement = __webpack_require__("IVEb"); 13607 13608 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js 13609 var es_rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("I/A+"); 13610 13611 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/createEvent.js 13612 var createEvent = __webpack_require__("khzz"); 13613 13614 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireBlurEvent.js 13615 13616 13617 13618 13619 function createFocusEvent(element, type, eventInit) { 13620 if (eventInit === void 0) { 13621 eventInit = {}; 13622 } 13623 13624 if (typeof FocusEvent === "function") { 13625 return new FocusEvent(type, eventInit); 13626 } 13627 13628 return Object(createEvent["a" /* createEvent */])(element, type, eventInit); 13629 } 13630 /** 13631 * Creates and dispatches a blur event in a way that also works on IE 11. 13632 * 13633 * @example 13634 * import { fireBlurEvent } from "reakit-utils"; 13635 * 13636 * fireBlurEvent(document.getElementById("id")); 13637 */ 13638 13639 13640 function fireBlurEvent(element, eventInit) { 13641 var event = createFocusEvent(element, "blur", eventInit); 13642 var defaultAllowed = element.dispatchEvent(event); 13643 13644 var bubbleInit = Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, eventInit), {}, { 13645 bubbles: true 13646 }); 13647 13648 element.dispatchEvent(createFocusEvent(element, "focusout", bubbleInit)); 13649 return defaultAllowed; 13650 } 13651 13652 13653 13654 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getWindow.js 13655 var getWindow = __webpack_require__("SyVe"); 13656 13657 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireKeyboardEvent.js 13658 13659 13660 13661 function createKeyboardEvent(element, type, eventInit) { 13662 if (eventInit === void 0) { 13663 eventInit = {}; 13664 } 13665 13666 if (typeof KeyboardEvent === "function") { 13667 return new KeyboardEvent(type, eventInit); 13668 } // IE 11 doesn't support Event constructors 13669 13670 13671 var event = Object(getDocument["a" /* getDocument */])(element).createEvent("KeyboardEvent"); 13672 event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, Object(getWindow["a" /* getWindow */])(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey); 13673 return event; 13674 } 13675 /** 13676 * Creates and dispatches `KeyboardEvent` in a way that also works on IE 11. 13677 * 13678 * @example 13679 * import { fireKeyboardEvent } from "reakit-utils"; 13680 * 13681 * fireKeyboardEvent(document.getElementById("id"), "keydown", { 13682 * key: "ArrowDown", 13683 * shiftKey: true, 13684 * }); 13685 */ 13686 13687 13688 function fireKeyboardEvent(element, type, eventInit) { 13689 return element.dispatchEvent(createKeyboardEvent(element, type, eventInit)); 13690 } 13691 13692 13693 13694 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/canUseDOM.js 13695 var canUseDOM = __webpack_require__("+ipW"); 13696 13697 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js 13698 var getActiveElement = __webpack_require__("Nym8"); 13699 13700 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/getNextActiveElementOnBlur.js 13701 13702 13703 13704 13705 13706 var isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window; 13707 /** 13708 * Cross-browser method that returns the next active element (the element that 13709 * is receiving focus) after a blur event is dispatched. It receives the blur 13710 * event object as the argument. 13711 * 13712 * @example 13713 * import { getNextActiveElementOnBlur } from "reakit-utils"; 13714 * 13715 * const element = document.getElementById("id"); 13716 * element.addEventListener("blur", (event) => { 13717 * const nextActiveElement = getNextActiveElementOnBlur(event); 13718 * }); 13719 */ 13720 13721 function getNextActiveElementOnBlur(event) { 13722 // IE 11 doesn't support event.relatedTarget on blur. 13723 // document.activeElement points the the next active element. 13724 // On modern browsers, document.activeElement points to the current target. 13725 if (isIE11) { 13726 var activeElement = Object(getActiveElement["a" /* getActiveElement */])(event.currentTarget); 13727 return activeElement; 13728 } 13729 13730 return event.relatedTarget; 13731 } 13732 13733 13734 13735 // EXTERNAL MODULE: ./node_modules/reakit/es/__keys-6742f591.js 13736 var _keys_6742f591 = __webpack_require__("TFuP"); 13737 13738 // EXTERNAL MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js 13739 var userFocus_e16425e3 = __webpack_require__("Mih7"); 13740 13741 // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/Composite.js 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 var Composite_isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window; 13772 13773 function canProxyKeyboardEvent(event) { 13774 if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return false; 13775 if (event.metaKey) return false; 13776 if (event.key === "Tab") return false; 13777 return true; 13778 } 13779 13780 function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) { 13781 var eventHandlerRef = Object(useLiveRef["a" /* useLiveRef */])(htmlEventHandler); 13782 return Object(external_React_["useCallback"])(function (event) { 13783 var _eventHandlerRef$curr; 13784 13785 (_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event); 13786 if (event.defaultPrevented) return; 13787 13788 if (virtual && canProxyKeyboardEvent(event)) { 13789 var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current; 13790 13791 if (currentElement) { 13792 if (!fireKeyboardEvent(currentElement, event.type, event)) { 13793 event.preventDefault(); 13794 } // The event will be triggered on the composite item and then 13795 // propagated up to this composite element again, so we can pretend 13796 // that it wasn't called on this component in the first place. 13797 13798 13799 if (event.currentTarget.contains(currentElement)) { 13800 event.stopPropagation(); 13801 } 13802 } 13803 } 13804 }, [virtual, currentItem]); 13805 } // istanbul ignore next 13806 13807 13808 function useActiveElementRef(elementRef) { 13809 var activeElementRef = Object(external_React_["useRef"])(null); 13810 Object(external_React_["useEffect"])(function () { 13811 var document = Object(getDocument["a" /* getDocument */])(elementRef.current); 13812 13813 var onFocus = function onFocus(event) { 13814 var target = event.target; 13815 activeElementRef.current = target; 13816 }; 13817 13818 document.addEventListener("focus", onFocus, true); 13819 return function () { 13820 document.removeEventListener("focus", onFocus, true); 13821 }; 13822 }, []); 13823 return activeElementRef; 13824 } 13825 13826 function findFirstEnabledItemInTheLastRow(items) { 13827 return Object(getCurrentId_5aa9849e["a" /* f */])(flatten(reverse(groupItems(items)))); 13828 } 13829 13830 function isItem(items, element) { 13831 return items === null || items === void 0 ? void 0 : items.some(function (item) { 13832 return !!element && item.ref.current === element; 13833 }); 13834 } 13835 13836 function useScheduleUserFocus(currentItem) { 13837 var currentItemRef = Object(useLiveRef["a" /* useLiveRef */])(currentItem); 13838 13839 var _React$useReducer = Object(external_React_["useReducer"])(function (n) { 13840 return n + 1; 13841 }, 0), 13842 scheduled = _React$useReducer[0], 13843 schedule = _React$useReducer[1]; 13844 13845 Object(external_React_["useEffect"])(function () { 13846 var _currentItemRef$curre; 13847 13848 var currentElement = (_currentItemRef$curre = currentItemRef.current) === null || _currentItemRef$curre === void 0 ? void 0 : _currentItemRef$curre.ref.current; 13849 13850 if (scheduled && currentElement) { 13851 Object(userFocus_e16425e3["c" /* u */])(currentElement); 13852 } 13853 }, [scheduled]); 13854 return schedule; 13855 } 13856 13857 var useComposite = Object(createHook["a" /* createHook */])({ 13858 name: "Composite", 13859 compose: [Tabbable["a" /* useTabbable */]], 13860 keys: _keys_6742f591["a" /* C */], 13861 useOptions: function useOptions(options) { 13862 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, options), {}, { 13863 currentId: Object(getCurrentId_5aa9849e["b" /* g */])(options) 13864 }); 13865 }, 13866 useProps: function useProps(options, _ref) { 13867 var htmlRef = _ref.ref, 13868 htmlOnFocusCapture = _ref.onFocusCapture, 13869 htmlOnFocus = _ref.onFocus, 13870 htmlOnBlurCapture = _ref.onBlurCapture, 13871 htmlOnKeyDown = _ref.onKeyDown, 13872 htmlOnKeyDownCapture = _ref.onKeyDownCapture, 13873 htmlOnKeyUpCapture = _ref.onKeyUpCapture, 13874 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref", "onFocusCapture", "onFocus", "onBlurCapture", "onKeyDown", "onKeyDownCapture", "onKeyUpCapture"]); 13875 13876 var ref = Object(external_React_["useRef"])(null); 13877 var currentItem = findEnabledItemById(options.items, options.currentId); 13878 var previousElementRef = Object(external_React_["useRef"])(null); 13879 var onFocusCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocusCapture); 13880 var onFocusRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocus); 13881 var onBlurCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnBlurCapture); 13882 var onKeyDownRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnKeyDown); 13883 var scheduleUserFocus = useScheduleUserFocus(currentItem); // IE 11 doesn't support event.relatedTarget, so we use the active element 13884 // ref instead. 13885 13886 var activeElementRef = Composite_isIE11 ? useActiveElementRef(ref) : undefined; 13887 Object(external_React_["useEffect"])(function () { 13888 var element = ref.current; 13889 13890 if (options.unstable_moves && !currentItem) { 13891 false ? undefined : void 0; // If composite.move(null) has been called, the composite container 13892 // will receive focus. 13893 13894 element === null || element === void 0 ? void 0 : element.focus(); 13895 } 13896 }, [options.unstable_moves, currentItem]); 13897 var onKeyDownCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDownCapture); 13898 var onKeyUpCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUpCapture); 13899 var onFocusCapture = Object(external_React_["useCallback"])(function (event) { 13900 var _onFocusCaptureRef$cu; 13901 13902 (_onFocusCaptureRef$cu = onFocusCaptureRef.current) === null || _onFocusCaptureRef$cu === void 0 ? void 0 : _onFocusCaptureRef$cu.call(onFocusCaptureRef, event); 13903 if (event.defaultPrevented) return; 13904 if (!options.unstable_virtual) return; // IE11 doesn't support event.relatedTarget, so we use the active 13905 // element ref instead. 13906 13907 var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget; 13908 var previousActiveElementWasItem = isItem(options.items, previousActiveElement); 13909 13910 if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && previousActiveElementWasItem) { 13911 // Composite has been focused as a result of an item receiving focus. 13912 // The composite item will move focus back to the composite 13913 // container. In this case, we don't want to propagate this 13914 // additional event nor call the onFocus handler passed to 13915 // <Composite onFocus={...} />. 13916 event.stopPropagation(); // We keep track of the previous active item element so we can 13917 // manually fire a blur event on it later when the focus is moved to 13918 // another item on the onBlurCapture event below. 13919 13920 previousElementRef.current = previousActiveElement; 13921 } 13922 }, [options.unstable_virtual, options.items]); 13923 var onFocus = Object(external_React_["useCallback"])(function (event) { 13924 var _onFocusRef$current; 13925 13926 (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); 13927 if (event.defaultPrevented) return; 13928 13929 if (options.unstable_virtual) { 13930 if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) { 13931 // This means that the composite element has been focused while the 13932 // composite item has not. For example, by clicking on the 13933 // composite element without touching any item, or by tabbing into 13934 // the composite element. In this case, we want to trigger focus on 13935 // the item, just like it would happen with roving tabindex. 13936 // When it receives focus, the composite item will put focus back 13937 // on the composite element, in which case hasItemWithFocus will be 13938 // true. 13939 scheduleUserFocus(); 13940 } 13941 } else if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) { 13942 var _options$setCurrentId; 13943 13944 // When the roving tabindex composite gets intentionally focused (for 13945 // example, by clicking directly on it, and not on an item), we make 13946 // sure to set the current id to null (which means the composite 13947 // itself is focused). 13948 (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null); 13949 } 13950 }, [options.unstable_virtual, options.setCurrentId]); 13951 var onBlurCapture = Object(external_React_["useCallback"])(function (event) { 13952 var _onBlurCaptureRef$cur; 13953 13954 (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event); 13955 if (event.defaultPrevented) return; 13956 if (!options.unstable_virtual) return; // When virtual is set to true, we move focus from the composite 13957 // container (this component) to the composite item that is being 13958 // selected. Then we move focus back to the composite container. This 13959 // is so we can provide the same API as the roving tabindex method, 13960 // which means people can attach onFocus/onBlur handlers on the 13961 // CompositeItem component regardless of whether it's virtual or not. 13962 // This sequence of blurring and focusing items and composite may be 13963 // confusing, so we ignore intermediate focus and blurs by stopping its 13964 // propagation and not calling the passed onBlur handler (htmlOnBlur). 13965 13966 var currentElement = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) || null; 13967 var nextActiveElement = getNextActiveElementOnBlur(event); 13968 var nextActiveElementIsItem = isItem(options.items, nextActiveElement); 13969 13970 if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && nextActiveElementIsItem) { 13971 // This is an intermediate blur event: blurring the composite 13972 // container to focus an item (nextActiveElement). 13973 if (nextActiveElement === currentElement) { 13974 // The next active element will be the same as the current item in 13975 // the state in two scenarios: 13976 // - Moving focus with keyboard: the state is updated before the 13977 // blur event is triggered, so here the current item is already 13978 // pointing to the next active element. 13979 // - Clicking on the current active item with a pointer: this 13980 // will trigger blur on the composite element and then the next 13981 // active element will be the same as the current item. Clicking on 13982 // an item other than the current one doesn't end up here as the 13983 // currentItem state will be updated only after it. 13984 if (previousElementRef.current && previousElementRef.current !== nextActiveElement) { 13985 // If there's a previous active item and it's not a click action, 13986 // then we fire a blur event on it so it will work just like if 13987 // it had DOM focus before (like when using roving tabindex). 13988 fireBlurEvent(previousElementRef.current, event); 13989 } 13990 } else if (currentElement) { 13991 // This will be true when the next active element is not the 13992 // current element, but there's a current item. This will only 13993 // happen when clicking with a pointer on a different item, when 13994 // there's already an item selected, in which case currentElement 13995 // is the item that is getting blurred, and nextActiveElement is 13996 // the item that is being clicked. 13997 fireBlurEvent(currentElement, event); 13998 } // We want to ignore intermediate blur events, so we stop its 13999 // propagation and return early so onFocus will not be called. 14000 14001 14002 event.stopPropagation(); 14003 } else { 14004 var targetIsItem = isItem(options.items, event.target); 14005 14006 if (!targetIsItem && currentElement) { 14007 // If target is not a composite item, it may be the composite 14008 // element itself (isSelfTarget) or a tabbable element inside the 14009 // composite widget. This may be triggered by clicking outside the 14010 // composite widget or by tabbing out of it. In either cases we 14011 // want to fire a blur event on the current item. 14012 fireBlurEvent(currentElement, event); 14013 } 14014 } 14015 }, [options.unstable_virtual, options.items, currentItem]); 14016 var onKeyDown = Object(external_React_["useCallback"])(function (event) { 14017 var _onKeyDownRef$current, _options$groups; 14018 14019 (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); 14020 if (event.defaultPrevented) return; 14021 if (options.currentId !== null) return; 14022 if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return; 14023 var isVertical = options.orientation !== "horizontal"; 14024 var isHorizontal = options.orientation !== "vertical"; 14025 var isGrid = !!((_options$groups = options.groups) !== null && _options$groups !== void 0 && _options$groups.length); 14026 14027 var up = function up() { 14028 if (isGrid) { 14029 var item = findFirstEnabledItemInTheLastRow(options.items); 14030 14031 if (item !== null && item !== void 0 && item.id) { 14032 var _options$move; 14033 14034 (_options$move = options.move) === null || _options$move === void 0 ? void 0 : _options$move.call(options, item.id); 14035 } 14036 } else { 14037 var _options$last; 14038 14039 (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); 14040 } 14041 }; 14042 14043 var keyMap = { 14044 ArrowUp: (isGrid || isVertical) && up, 14045 ArrowRight: (isGrid || isHorizontal) && options.first, 14046 ArrowDown: (isGrid || isVertical) && options.first, 14047 ArrowLeft: (isGrid || isHorizontal) && options.last, 14048 Home: options.first, 14049 End: options.last, 14050 PageUp: options.first, 14051 PageDown: options.last 14052 }; 14053 var action = keyMap[event.key]; 14054 14055 if (action) { 14056 event.preventDefault(); 14057 action(); 14058 } 14059 }, [options.currentId, options.orientation, options.groups, options.items, options.move, options.last, options.first]); 14060 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 14061 ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef), 14062 id: options.baseId, 14063 onFocus: onFocus, 14064 onFocusCapture: onFocusCapture, 14065 onBlurCapture: onBlurCapture, 14066 onKeyDownCapture: onKeyDownCapture, 14067 onKeyDown: onKeyDown, 14068 onKeyUpCapture: onKeyUpCapture, 14069 "aria-activedescendant": options.unstable_virtual ? (currentItem === null || currentItem === void 0 ? void 0 : currentItem.id) || undefined : undefined 14070 }, htmlProps); 14071 }, 14072 useComposeProps: function useComposeProps(options, htmlProps) { 14073 htmlProps = Object(Role["a" /* useRole */])(options, htmlProps, true); 14074 var tabbableHTMLProps = Object(Tabbable["a" /* useTabbable */])(options, htmlProps, true); 14075 14076 if (options.unstable_virtual || options.currentId === null) { 14077 // Composite will only be tabbable by default if the focus is managed 14078 // using aria-activedescendant, which requires DOM focus on the container 14079 // element (the composite) 14080 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 14081 tabIndex: 0 14082 }, tabbableHTMLProps); 14083 } 14084 14085 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, htmlProps), {}, { 14086 ref: tabbableHTMLProps.ref 14087 }); 14088 } 14089 }); 14090 var Composite = Object(createComponent["a" /* createComponent */])({ 14091 as: "div", 14092 useHook: useComposite, 14093 useCreateElement: function useCreateElement$1(type, props, children) { 14094 false ? undefined : void 0; 14095 return Object(useCreateElement["a" /* useCreateElement */])(type, props, children); 14096 } 14097 }); 14098 14099 14100 14101 // EXTERNAL MODULE: ./node_modules/reakit/es/Id/Id.js 14102 var Id = __webpack_require__("ym77"); 14103 14104 // CONCATENATED MODULE: ./node_modules/reakit/es/Group/Group.js 14105 14106 14107 14108 14109 14110 14111 // Automatically generated 14112 var GROUP_KEYS = []; 14113 14114 var useGroup = Object(createHook["a" /* createHook */])({ 14115 name: "Group", 14116 compose: Role["a" /* useRole */], 14117 keys: GROUP_KEYS, 14118 useProps: function useProps(_, htmlProps) { 14119 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 14120 role: "group" 14121 }, htmlProps); 14122 } 14123 }); 14124 var Group = Object(createComponent["a" /* createComponent */])({ 14125 as: "div", 14126 useHook: useGroup 14127 }); 14128 14129 14130 14131 // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeGroup.js 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 var useCompositeGroup = Object(createHook["a" /* createHook */])({ 14147 name: "CompositeGroup", 14148 compose: [useGroup, Id["a" /* unstable_useId */]], 14149 keys: _keys_6742f591["b" /* a */], 14150 propsAreEqual: function propsAreEqual(prev, next) { 14151 if (!next.id || prev.id !== next.id) { 14152 return useGroup.unstable_propsAreEqual(prev, next); 14153 } 14154 14155 var prevCurrentId = prev.currentId, 14156 prevMoves = prev.unstable_moves, 14157 prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(prev, ["currentId", "unstable_moves"]); 14158 14159 var nextCurrentId = next.currentId, 14160 nextMoves = next.unstable_moves, 14161 nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(next, ["currentId", "unstable_moves"]); 14162 14163 if (prev.items && next.items) { 14164 var prevCurrentItem = findEnabledItemById(prev.items, prevCurrentId); 14165 var nextCurrentItem = findEnabledItemById(next.items, nextCurrentId); 14166 var prevGroupId = prevCurrentItem === null || prevCurrentItem === void 0 ? void 0 : prevCurrentItem.groupId; 14167 var nextGroupId = nextCurrentItem === null || nextCurrentItem === void 0 ? void 0 : nextCurrentItem.groupId; 14168 14169 if (next.id === nextGroupId || next.id === prevGroupId) { 14170 return false; 14171 } 14172 } 14173 14174 return useGroup.unstable_propsAreEqual(prevProps, nextProps); 14175 }, 14176 useProps: function useProps(options, _ref) { 14177 var htmlRef = _ref.ref, 14178 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref"]); 14179 14180 var ref = Object(external_React_["useRef"])(null); 14181 var id = options.id; // We need this to be called before CompositeItems' register 14182 14183 Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () { 14184 var _options$registerGrou; 14185 14186 if (!id) return undefined; 14187 (_options$registerGrou = options.registerGroup) === null || _options$registerGrou === void 0 ? void 0 : _options$registerGrou.call(options, { 14188 id: id, 14189 ref: ref 14190 }); 14191 return function () { 14192 var _options$unregisterGr; 14193 14194 (_options$unregisterGr = options.unregisterGroup) === null || _options$unregisterGr === void 0 ? void 0 : _options$unregisterGr.call(options, id); 14195 }; 14196 }, [id, options.registerGroup, options.unregisterGroup]); 14197 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 14198 ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef) 14199 }, htmlProps); 14200 } 14201 }); 14202 var CompositeGroup = Object(createComponent["a" /* createComponent */])({ 14203 as: "div", 14204 useHook: useCompositeGroup 14205 }); 14206 14207 14208 14209 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js 14210 14211 14212 function alignment_matrix_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 14213 14214 14215 /** 14216 * Internal dependencies 14217 */ 14218 14219 14220 14221 const alignment_matrix_control_icon_styles_rootSize = () => { 14222 const padding = 1.5; 14223 const size = 24; 14224 return /*#__PURE__*/css_browser_esm({ 14225 gridTemplateRows: `repeat( 3, calc( ${size - padding * 2}px / 3))`, 14226 padding, 14227 maxHeight: size, 14228 maxWidth: size 14229 }, true ? "" : undefined); 14230 }; 14231 14232 const rootPointerEvents = ({ 14233 disablePointerEvents 14234 }) => { 14235 return /*#__PURE__*/css_browser_esm({ 14236 pointerEvents: disablePointerEvents ? 'none' : null 14237 }, true ? "" : undefined); 14238 }; 14239 14240 const alignment_matrix_control_icon_styles_Wrapper = styled_base_browser_esm("div", { 14241 target: "elqsdmc0", 14242 label: "Wrapper" 14243 })( true ? { 14244 name: "co61ta", 14245 styles: "box-sizing:border-box;padding:2px;" 14246 } : undefined); 14247 const alignment_matrix_control_icon_styles_Root = styled_base_browser_esm("div", { 14248 target: "elqsdmc1", 14249 label: "Root" 14250 })("transform-origin:top left;height:100%;width:100%;", rootBase, ";", alignment_matrix_control_icon_styles_rootSize, ";", rootPointerEvents, ";" + ( true ? "" : undefined)); 14251 14252 const alignment_matrix_control_icon_styles_pointActive = ({ 14253 isActive 14254 }) => { 14255 const boxShadow = isActive ? `0 0 0 1px currentColor` : null; 14256 return /*#__PURE__*/css_browser_esm("box-shadow:", boxShadow, ";color:currentColor;*:hover > &{color:currentColor;}" + ( true ? "" : undefined)); 14257 }; 14258 14259 const alignment_matrix_control_icon_styles_Point = styled_base_browser_esm("span", { 14260 target: "elqsdmc2", 14261 label: "Point" 14262 })("height:2px;width:2px;", pointBase, ";", alignment_matrix_control_icon_styles_pointActive, ";" + ( true ? "" : undefined)); 14263 const alignment_matrix_control_icon_styles_Cell = Cell; 14264 14265 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js 14266 14267 14268 14269 /** 14270 * External dependencies 14271 */ 14272 14273 /** 14274 * Internal dependencies 14275 */ 14276 14277 14278 14279 const BASE_SIZE = 24; 14280 function AlignmentMatrixControlIcon({ 14281 className, 14282 disablePointerEvents = true, 14283 size = BASE_SIZE, 14284 style = {}, 14285 value = 'center', 14286 ...props 14287 }) { 14288 const alignIndex = getAlignmentIndex(value); 14289 const scale = (size / BASE_SIZE).toFixed(2); 14290 const classes = classnames_default()('component-alignment-matrix-control-icon', className); 14291 const styles = { ...style, 14292 transform: `scale(${scale})` 14293 }; 14294 return Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Root, Object(esm_extends["a" /* default */])({}, props, { 14295 className: classes, 14296 disablePointerEvents: disablePointerEvents, 14297 role: "presentation", 14298 size: size, 14299 style: styles 14300 }), ALIGNMENTS.map((align, index) => { 14301 const isActive = alignIndex === index; 14302 return Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Cell, { 14303 key: align 14304 }, Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Point, { 14305 isActive: isActive 14306 })); 14307 })); 14308 } 14309 14310 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js 14311 14312 14313 14314 /** 14315 * External dependencies 14316 */ 14317 14318 14319 /** 14320 * WordPress dependencies 14321 */ 14322 14323 14324 14325 14326 /** 14327 * Internal dependencies 14328 */ 14329 14330 14331 14332 14333 14334 14335 14336 function useBaseId(id) { 14337 const instanceId = Object(external_wp_compose_["useInstanceId"])(AlignmentMatrixControl, 'alignment-matrix-control'); 14338 return id || instanceId; 14339 } 14340 14341 function AlignmentMatrixControl({ 14342 className, 14343 id, 14344 label = Object(external_wp_i18n_["__"])('Alignment Matrix Control'), 14345 defaultValue = 'center center', 14346 value, 14347 onChange = external_lodash_["noop"], 14348 width = 92, 14349 ...props 14350 }) { 14351 const [immutableDefaultValue] = Object(external_wp_element_["useState"])(value !== null && value !== void 0 ? value : defaultValue); 14352 const baseId = useBaseId(id); 14353 const initialCurrentId = utils_getItemId(baseId, immutableDefaultValue); 14354 const composite = useCompositeState({ 14355 baseId, 14356 currentId: initialCurrentId, 14357 rtl: Object(external_wp_i18n_["isRTL"])() 14358 }); 14359 14360 const handleOnChange = nextValue => { 14361 onChange(nextValue); 14362 }; 14363 14364 Object(external_wp_element_["useEffect"])(() => { 14365 if (typeof value !== 'undefined') { 14366 composite.setCurrentId(utils_getItemId(baseId, value)); 14367 } 14368 }, [value, composite.setCurrentId]); 14369 const classes = classnames_default()('component-alignment-matrix-control', className); 14370 return Object(external_wp_element_["createElement"])(Composite, Object(esm_extends["a" /* default */])({}, props, composite, { 14371 "aria-label": label, 14372 as: Root, 14373 className: classes, 14374 role: "grid", 14375 width: width 14376 }), GRID.map((cells, index) => Object(external_wp_element_["createElement"])(CompositeGroup, Object(esm_extends["a" /* default */])({}, composite, { 14377 as: Row, 14378 role: "row", 14379 key: index 14380 }), cells.map(cell => { 14381 const cellId = utils_getItemId(baseId, cell); 14382 const isActive = composite.currentId === cellId; 14383 return Object(external_wp_element_["createElement"])(cell_Cell, Object(esm_extends["a" /* default */])({}, composite, { 14384 id: cellId, 14385 isActive: isActive, 14386 key: cell, 14387 value: cell, 14388 onFocus: () => handleOnChange(cell), 14389 tabIndex: isActive ? 0 : -1 14390 })); 14391 })))); 14392 } 14393 AlignmentMatrixControl.Icon = AlignmentMatrixControlIcon; 14394 14395 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js 14396 var animate = __webpack_require__("L8Kx"); 14397 14398 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font-values.js 14399 /* harmony default export */ var font_values = ({ 14400 'default.fontFamily': "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", 14401 'default.fontSize': '13px', 14402 'helpText.fontSize': '12px', 14403 mobileTextMinFontSize: '16px' 14404 }); 14405 14406 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font.js 14407 /** 14408 * External dependencies 14409 */ 14410 14411 /** 14412 * Internal dependencies 14413 */ 14414 14415 14416 /** 14417 * 14418 * @param {keyof FONT} value Path of value from `FONT` 14419 * @return {string} Font rule value 14420 */ 14421 14422 function font(value) { 14423 return Object(external_lodash_["get"])(font_values, value, ''); 14424 } 14425 14426 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/space.js 14427 const SPACE_GRID_BASE = 8; 14428 /** 14429 * Creates a spacing CSS value (px) based on grid system values. 14430 * 14431 * @param {number} [value=1] Multiplier against the grid base value (8) 14432 * @return {string} The spacing value (px). 14433 */ 14434 14435 function space(value = 1) { 14436 if (isNaN(value)) return `${SPACE_GRID_BASE}px`; 14437 return `${SPACE_GRID_BASE * value}px`; 14438 } 14439 14440 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/styles/base-control-styles.js 14441 14442 14443 /** 14444 * Internal dependencies 14445 */ 14446 14447 const base_control_styles_Wrapper = styled_base_browser_esm("div", { 14448 target: "e1puf3u0", 14449 label: "Wrapper" 14450 })("font-family:", font('default.fontFamily'), ";font-size:", font('default.fontSize'), ";" + ( true ? "" : undefined)); 14451 const StyledField = styled_base_browser_esm("div", { 14452 target: "e1puf3u1", 14453 label: "StyledField" 14454 })("margin-bottom:", space(1), ";.components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : undefined)); 14455 const StyledLabel = styled_base_browser_esm("label", { 14456 target: "e1puf3u2", 14457 label: "StyledLabel" 14458 })("display:inline-block;margin-bottom:", space(1), ";" + ( true ? "" : undefined)); 14459 const StyledHelp = styled_base_browser_esm("p", { 14460 target: "e1puf3u3", 14461 label: "StyledHelp" 14462 })("font-size:", font('helpText.fontSize'), ";font-style:normal;color:", COLORS.mediumGray.text, ";" + ( true ? "" : undefined)); 14463 14464 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/index.js 14465 14466 14467 /** 14468 * External dependencies 14469 */ 14470 14471 /** 14472 * Internal dependencies 14473 */ 14474 14475 14476 14477 /** 14478 * @typedef Props 14479 * @property {string} id The id of the element to which labels and help text are being generated. 14480 * That element should be passed as a child. 14481 * @property {import('react').ReactNode} help If this property is added, a help text will be 14482 * generated using help property as the content. 14483 * @property {import('react').ReactNode} label If this property is added, a label will be generated 14484 * using label property as the content. 14485 * @property {boolean} [hideLabelFromVision] If true, the label will only be visible to screen readers. 14486 * @property {string} [className] The class that will be added with "components-base-control" to the 14487 * classes of the wrapper div. If no className is passed only 14488 * components-base-control is used. 14489 * @property {import('react').ReactNode} [children] The content to be displayed within 14490 * the BaseControl. 14491 */ 14492 14493 /** 14494 * @param {Props} props 14495 * @return {JSX.Element} Element 14496 */ 14497 14498 function BaseControl({ 14499 id, 14500 label, 14501 hideLabelFromVision, 14502 help, 14503 className, 14504 children 14505 }) { 14506 return Object(external_wp_element_["createElement"])(base_control_styles_Wrapper, { 14507 className: classnames_default()('components-base-control', className) 14508 }, Object(external_wp_element_["createElement"])(StyledField, { 14509 className: "components-base-control__field" 14510 }, label && id && (hideLabelFromVision ? Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 14511 as: "label", 14512 htmlFor: id 14513 }, label) : Object(external_wp_element_["createElement"])(StyledLabel, { 14514 className: "components-base-control__label", 14515 htmlFor: id 14516 }, label)), label && !id && (hideLabelFromVision ? Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 14517 as: "label" 14518 }, label) : Object(external_wp_element_["createElement"])(BaseControl.VisualLabel, null, label)), children), !!help && Object(external_wp_element_["createElement"])(StyledHelp, { 14519 id: id + '__help', 14520 className: "components-base-control__help" 14521 }, help)); 14522 } 14523 /** 14524 * @typedef VisualLabelProps 14525 * @property {string} [className] Class name 14526 * @property {import('react').ReactNode} [children] Children 14527 */ 14528 14529 /** 14530 * @param {VisualLabelProps} Props 14531 * @return {JSX.Element} Element 14532 */ 14533 14534 14535 BaseControl.VisualLabel = ({ 14536 className, 14537 children 14538 }) => { 14539 className = classnames_default()('components-base-control__label', className); 14540 return Object(external_wp_element_["createElement"])("span", { 14541 className: className 14542 }, children); 14543 }; 14544 14545 /* harmony default export */ var base_control = (BaseControl); 14546 14547 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-connect.js 14548 var context_connect = __webpack_require__("7Jlx"); 14549 14550 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/view/component.js 14551 14552 14553 /** 14554 * `View` is a core component that renders everything in the library. 14555 * It is the principle component in the entire library. 14556 * 14557 * @example 14558 * ```jsx 14559 * import { View } from `@wordpress/components`; 14560 * 14561 * function Example() { 14562 * return ( 14563 * <View> 14564 * Code is Poetry 14565 * </View> 14566 * ); 14567 * } 14568 * ``` 14569 */ 14570 const View = styled_base_browser_esm("div", { 14571 target: "em57xhy0", 14572 label: "View" 14573 })( true ? "" : undefined); 14574 14575 View.displayName = 'View'; 14576 /* harmony default export */ var component = (View); 14577 14578 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/create-component.js 14579 14580 14581 14582 /** 14583 * External dependencies 14584 */ 14585 // eslint-disable-next-line no-restricted-imports 14586 14587 /** 14588 * Internal dependencies 14589 */ 14590 // eslint-disable-next-line no-duplicate-imports 14591 14592 14593 14594 /** 14595 * Factory that creates a React component from a hook 14596 * 14597 * @param options 14598 * @param options.as The element to render for the component. 14599 * @param options.name The name of the component. 14600 * @param options.useHook The hook to use for the component 14601 * @param options.memo Whether to memo the component. 14602 * @return A polymorphic component that uses the hook to process props. 14603 */ 14604 const create_component_createComponent = ({ 14605 as, 14606 name, 14607 useHook, 14608 memo = false 14609 }) => { 14610 function Component(props, forwardedRef) { 14611 const otherProps = useHook(props); 14612 return Object(external_wp_element_["createElement"])(component, Object(esm_extends["a" /* default */])({ 14613 as: as || 'div' 14614 }, otherProps, { 14615 ref: forwardedRef 14616 })); 14617 } 14618 14619 Component.displayName = name; 14620 return Object(context_connect["a" /* contextConnect */])(Component, name, { 14621 memo 14622 }); 14623 }; 14624 14625 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/use-context-system.js 14626 var use_context_system = __webpack_require__("C6yU"); 14627 14628 // EXTERNAL MODULE: ./node_modules/emotion/dist/emotion.esm.js + 1 modules 14629 var emotion_esm = __webpack_require__("kDDq"); 14630 14631 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/context.js 14632 /** 14633 * WordPress dependencies 14634 */ 14635 14636 const FlexContext = Object(external_wp_element_["createContext"])({ 14637 flexItemDisplay: undefined 14638 }); 14639 const useFlexContext = () => Object(external_wp_element_["useContext"])(FlexContext); 14640 14641 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/styles.js 14642 14643 14644 function styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 14645 14646 const Flex = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 14647 name: "142v397-Flex", 14648 styles: "display:flex;;label:Flex;" 14649 } : undefined); 14650 const Item = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 14651 name: "1636tkh-Item", 14652 styles: "display:block;max-height:100%;max-width:100%;min-height:0;min-width:0;;label:Item;" 14653 } : undefined); 14654 const block = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 14655 name: "jhhyjf-block", 14656 styles: "flex:1;;label:block;" 14657 } : undefined); 14658 /** 14659 * Workaround to optimize DOM rendering. 14660 * We'll enhance alignment with naive parent flex assumptions. 14661 * 14662 * Trade-off: 14663 * Far less DOM less. However, UI rendering is not as reliable. 14664 */ 14665 14666 /** 14667 * Improves stability of width/height rendering. 14668 * https://github.com/ItsJonQ/g2/pull/149 14669 */ 14670 14671 const ItemsColumn = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 14672 name: "1u16kd2-ItemsColumn", 14673 styles: "> *{min-height:0;};label:ItemsColumn;" 14674 } : undefined); 14675 const ItemsRow = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 14676 name: "1yewyqa-ItemsRow", 14677 styles: "> *{min-width:0;};label:ItemsRow;" 14678 } : undefined); 14679 14680 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js 14681 14682 14683 14684 /** 14685 * Internal dependencies 14686 */ 14687 14688 14689 14690 /** 14691 * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexItemProps, 'div'>} props 14692 */ 14693 14694 function useFlexItem(props) { 14695 const { 14696 className, 14697 display: displayProp, 14698 isBlock = false, 14699 ...otherProps 14700 } = Object(use_context_system["a" /* useContextSystem */])(props, 'FlexItem'); 14701 const sx = {}; 14702 const contextDisplay = useFlexContext().flexItemDisplay; 14703 sx.Base = /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 14704 display: displayProp || contextDisplay 14705 }, true ? "" : undefined); 14706 14707 const classes = Object(emotion_esm["b" /* cx */])(Item, sx.Base, isBlock && block, className); 14708 14709 return { ...otherProps, 14710 className: classes 14711 }; 14712 } 14713 14714 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/hook.js 14715 /** 14716 * Internal dependencies 14717 */ 14718 14719 14720 /** 14721 * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexBlockProps, 'div'>} props 14722 */ 14723 14724 function useFlexBlock(props) { 14725 const otherProps = Object(use_context_system["a" /* useContextSystem */])(props, 'FlexBlock'); 14726 const flexItemProps = useFlexItem({ 14727 isBlock: true, 14728 ...otherProps 14729 }); 14730 return flexItemProps; 14731 } 14732 14733 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/component.js 14734 /** 14735 * Internal dependencies 14736 */ 14737 14738 14739 /** 14740 * `FlexBlock` is a primitive layout component that adaptively resizes content within layout containers like `Flex`. 14741 * 14742 * @example 14743 * ```jsx 14744 * <Flex> 14745 * <FlexBlock>...</FlexBlock> 14746 * </Flex> 14747 * ``` 14748 */ 14749 14750 const FlexBlock = create_component_createComponent({ 14751 as: 'div', 14752 useHook: useFlexBlock, 14753 name: 'FlexBlock' 14754 }); 14755 /* harmony default export */ var flex_block_component = (FlexBlock); 14756 14757 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js 14758 /** 14759 * Internal dependencies 14760 */ 14761 14762 14763 /** 14764 * `FlexItem` is a primitive layout component that aligns content within layout containers like `Flex`. 14765 * 14766 * @example 14767 * ```jsx 14768 * <Flex> 14769 * <FlexItem>...</FlexItem> 14770 * </Flex> 14771 * ``` 14772 */ 14773 14774 const FlexItem = create_component_createComponent({ 14775 as: 'div', 14776 useHook: useFlexItem, 14777 name: 'FlexItem' 14778 }); 14779 /* harmony default export */ var flex_item_component = (FlexItem); 14780 14781 // EXTERNAL MODULE: external ["wp","deprecated"] 14782 var external_wp_deprecated_ = __webpack_require__("NMb1"); 14783 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); 14784 14785 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/use-responsive-value.js 14786 /** 14787 * WordPress dependencies 14788 */ 14789 14790 const breakpoints = ['40em', '52em', '64em']; 14791 const useBreakpointIndex = (options = {}) => { 14792 const { 14793 defaultIndex = 0 14794 } = options; 14795 14796 if (typeof defaultIndex !== 'number') { 14797 throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`); 14798 } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) { 14799 throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`); 14800 } 14801 14802 const [value, setValue] = Object(external_wp_element_["useState"])(defaultIndex); 14803 Object(external_wp_element_["useEffect"])(() => { 14804 const getIndex = () => breakpoints.filter(bp => { 14805 return typeof window !== 'undefined' ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false; 14806 }).length; 14807 14808 const onResize = () => { 14809 const newValue = getIndex(); 14810 14811 if (value !== newValue) { 14812 setValue(newValue); 14813 } 14814 }; 14815 14816 onResize(); 14817 14818 if (typeof document !== 'undefined') { 14819 // Disable reason: We don't really care about what document we listen to, we just want to know that we're resizing. 14820 14821 /* eslint-disable @wordpress/no-global-event-listener */ 14822 document.addEventListener('resize', onResize); 14823 } 14824 14825 return () => { 14826 if (typeof document !== 'undefined') { 14827 document.removeEventListener('resize', onResize); 14828 /* eslint-enable @wordpress/no-global-event-listener */ 14829 } 14830 }; 14831 }, [value]); 14832 return value; 14833 }; 14834 function useResponsiveValue(values, options = {}) { 14835 const index = useBreakpointIndex(options); // Allow calling the function with a "normal" value without having to check on the outside. 14836 14837 if (!Array.isArray(values) && typeof values !== 'function') return values; 14838 const array = values || []; 14839 /* eslint-disable jsdoc/no-undefined-types */ 14840 14841 return ( 14842 /** @type {T[]} */ 14843 array[ 14844 /* eslint-enable jsdoc/no-undefined-types */ 14845 index >= array.length ? array.length - 1 : index] 14846 ); 14847 } 14848 14849 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/space.js 14850 /** 14851 * External dependencies 14852 */ 14853 // eslint-disable-next-line no-restricted-imports 14854 14855 /** 14856 * Internal dependencies 14857 */ 14858 const GRID_BASE = '4px'; 14859 function space_space(value) { 14860 return typeof value === 'number' ? `calc(${GRID_BASE} * ${value})` : value; 14861 } 14862 14863 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/hook.js 14864 14865 14866 14867 /** 14868 * WordPress dependencies 14869 */ 14870 14871 14872 /** 14873 * Internal dependencies 14874 */ 14875 14876 14877 14878 14879 14880 /** 14881 * 14882 * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} props 14883 * @return {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} Props with the deprecated props removed. 14884 */ 14885 14886 function useDeprecatedProps({ 14887 isReversed, 14888 ...otherProps 14889 }) { 14890 if (typeof isReversed !== 'undefined') { 14891 external_wp_deprecated_default()('Flex isReversed', { 14892 alternative: 'Flex direction="row-reverse" or "column-reverse"', 14893 since: '5.9' 14894 }); 14895 return { ...otherProps, 14896 direction: isReversed ? 'row-reverse' : 'row' 14897 }; 14898 } 14899 14900 return otherProps; 14901 } 14902 /** 14903 * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} props 14904 */ 14905 14906 14907 function useFlex(props) { 14908 const { 14909 align = 'center', 14910 className, 14911 direction: directionProp = 'row', 14912 expanded = true, 14913 gap = 2, 14914 justify = 'space-between', 14915 wrap = false, 14916 ...otherProps 14917 } = Object(use_context_system["a" /* useContextSystem */])(useDeprecatedProps(props), 'Flex'); 14918 const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp]; 14919 const direction = useResponsiveValue(directionAsArray); 14920 const isColumn = typeof direction === 'string' && !!direction.includes('column'); 14921 const isReverse = typeof direction === 'string' && direction.includes('reverse'); 14922 const classes = Object(external_wp_element_["useMemo"])(() => { 14923 const sx = {}; 14924 sx.Base = /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 14925 alignItems: isColumn ? 'normal' : align, 14926 flexDirection: direction, 14927 flexWrap: wrap ? 'wrap' : undefined, 14928 justifyContent: justify, 14929 height: isColumn && expanded ? '100%' : undefined, 14930 width: !isColumn && expanded ? '100%' : undefined, 14931 marginBottom: wrap ? `calc(${space_space(gap)} * -1)` : undefined 14932 }, true ? "" : undefined); 14933 sx.Items = /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 14934 /** 14935 * Workaround to optimize DOM rendering. 14936 * We'll enhance alignment with naive parent flex assumptions. 14937 * 14938 * Trade-off: 14939 * Far less DOM less. However, UI rendering is not as reliable. 14940 */ 14941 '> * + *:not(marquee)': { 14942 marginTop: isColumn ? space_space(gap) : undefined, 14943 marginRight: !isColumn && isReverse ? space_space(gap) : undefined, 14944 marginLeft: !isColumn && !isReverse ? space_space(gap) : undefined 14945 } 14946 }, true ? "" : undefined); 14947 sx.WrapItems = /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 14948 '> *:not(marquee)': { 14949 marginBottom: space_space(gap), 14950 marginLeft: !isColumn && isReverse ? space_space(gap) : undefined, 14951 marginRight: !isColumn && !isReverse ? space_space(gap) : undefined 14952 }, 14953 '> *:last-child:not(marquee)': { 14954 marginLeft: !isColumn && isReverse ? 0 : undefined, 14955 marginRight: !isColumn && !isReverse ? 0 : undefined 14956 } 14957 }, true ? "" : undefined); 14958 return Object(emotion_esm["b" /* cx */])(Flex, sx.Base, wrap ? sx.WrapItems : sx.Items, isColumn ? ItemsColumn : ItemsRow, className); 14959 }, [align, className, direction, expanded, gap, isColumn, isReverse, justify, wrap]); 14960 return { ...otherProps, 14961 className: classes, 14962 isColumn 14963 }; 14964 } 14965 14966 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/component.js 14967 14968 14969 14970 /** 14971 * Internal dependencies 14972 */ 14973 14974 14975 14976 14977 /** 14978 * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} props 14979 * @param {import('react').Ref<any>} forwardedRef 14980 */ 14981 14982 function component_Flex(props, forwardedRef) { 14983 const { 14984 children, 14985 isColumn, 14986 ...otherProps 14987 } = useFlex(props); 14988 return Object(external_wp_element_["createElement"])(FlexContext.Provider, { 14989 value: { 14990 flexItemDisplay: isColumn ? 'block' : undefined 14991 } 14992 }, Object(external_wp_element_["createElement"])(component, Object(esm_extends["a" /* default */])({}, otherProps, { 14993 ref: forwardedRef 14994 }), children)); 14995 } 14996 /** 14997 * `Flex` is a primitive layout component that adaptively aligns child content 14998 * horizontally or vertically. `Flex` powers components like `HStack` and 14999 * `VStack`. 15000 * 15001 * `Flex` is used with any of it's two sub-components, `FlexItem` and `FlexBlock`. 15002 * 15003 * @example 15004 * ```jsx 15005 * import { 15006 * __experimentalFlex as Flex, 15007 * __experimentalFlexBlock as FlexBlock, 15008 * __experimentalFlexItem as FlexItem, 15009 * __experimentalText as Text 15010 * } from `@wordpress/components`; 15011 * 15012 * function Example() { 15013 * return ( 15014 * <Flex> 15015 * <FlexItem> 15016 * <Text>Code</Text> 15017 * </FlexItem> 15018 * <FlexBlock> 15019 * <Text>Poetry</Text> 15020 * </FlexBlock> 15021 * </Flex> 15022 * ); 15023 * } 15024 * ``` 15025 * 15026 */ 15027 15028 15029 const ConnectedFlex = Object(context_connect["a" /* contextConnect */])(component_Flex, 'Flex'); 15030 /* harmony default export */ var flex_component = (ConnectedFlex); 15031 15032 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/styles.js 15033 15034 15035 function truncate_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 15036 15037 const Truncate = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 15038 name: "w4wjp3-Truncate", 15039 styles: "display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;;label:Truncate;" 15040 } : undefined); 15041 15042 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/utils.js 15043 /** 15044 * External dependencies 15045 */ 15046 15047 const TRUNCATE_ELLIPSIS = '…'; 15048 const TRUNCATE_TYPE = { 15049 auto: 'auto', 15050 head: 'head', 15051 middle: 'middle', 15052 tail: 'tail', 15053 none: 'none' 15054 }; 15055 const TRUNCATE_DEFAULT_PROPS = { 15056 ellipsis: TRUNCATE_ELLIPSIS, 15057 ellipsizeMode: TRUNCATE_TYPE.auto, 15058 limit: 0, 15059 numberOfLines: 0 15060 }; // Source 15061 // https://github.com/kahwee/truncate-middle 15062 15063 /** 15064 * @param {string} word 15065 * @param {number} headLength 15066 * @param {number} tailLength 15067 * @param {string} ellipsis 15068 */ 15069 15070 function truncateMiddle(word, headLength, tailLength, ellipsis) { 15071 if (typeof word !== 'string') { 15072 return ''; 15073 } 15074 15075 const wordLength = word.length; // Setting default values 15076 // eslint-disable-next-line no-bitwise 15077 15078 const frontLength = ~~headLength; // will cast to integer 15079 // eslint-disable-next-line no-bitwise 15080 15081 const backLength = ~~tailLength; 15082 /* istanbul ignore next */ 15083 15084 const truncateStr = !Object(external_lodash_["isNil"])(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS; 15085 15086 if (frontLength === 0 && backLength === 0 || frontLength >= wordLength || backLength >= wordLength || frontLength + backLength >= wordLength) { 15087 return word; 15088 } else if (backLength === 0) { 15089 return word.slice(0, frontLength) + truncateStr; 15090 } 15091 15092 return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength); 15093 } 15094 /** 15095 * 15096 * @param {string} words 15097 * @param {typeof TRUNCATE_DEFAULT_PROPS} props 15098 */ 15099 15100 function truncateContent(words = '', props) { 15101 const mergedProps = { ...TRUNCATE_DEFAULT_PROPS, 15102 ...props 15103 }; 15104 const { 15105 ellipsis, 15106 ellipsizeMode, 15107 limit 15108 } = mergedProps; 15109 15110 if (ellipsizeMode === TRUNCATE_TYPE.none) { 15111 return words; 15112 } 15113 15114 let truncateHead; 15115 let truncateTail; 15116 15117 switch (ellipsizeMode) { 15118 case TRUNCATE_TYPE.head: 15119 truncateHead = 0; 15120 truncateTail = limit; 15121 break; 15122 15123 case TRUNCATE_TYPE.middle: 15124 truncateHead = Math.floor(limit / 2); 15125 truncateTail = Math.floor(limit / 2); 15126 break; 15127 15128 default: 15129 truncateHead = limit; 15130 truncateTail = 0; 15131 } 15132 15133 const truncatedContent = ellipsizeMode !== TRUNCATE_TYPE.auto ? truncateMiddle(words, truncateHead, truncateTail, ellipsis) : words; 15134 return truncatedContent; 15135 } 15136 15137 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/hook.js 15138 15139 15140 15141 /** 15142 * WordPress dependencies 15143 */ 15144 15145 /** 15146 * Internal dependencies 15147 */ 15148 15149 15150 15151 15152 /** 15153 * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'span'>} props 15154 */ 15155 15156 function useTruncate(props) { 15157 const { 15158 className, 15159 children, 15160 ellipsis = TRUNCATE_ELLIPSIS, 15161 ellipsizeMode = TRUNCATE_TYPE.auto, 15162 limit = 0, 15163 numberOfLines = 0, 15164 ...otherProps 15165 } = Object(use_context_system["a" /* useContextSystem */])(props, 'Truncate'); 15166 const truncatedContent = truncateContent(typeof children === 'string' ? 15167 /** @type {string} */ 15168 children : '', { 15169 ellipsis, 15170 ellipsizeMode, 15171 limit, 15172 numberOfLines 15173 }); 15174 const shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto; 15175 const classes = Object(external_wp_element_["useMemo"])(() => { 15176 const sx = {}; 15177 sx.numberOfLines = /*#__PURE__*/Object(emotion_esm["a" /* css */])("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + ( true ? "" : undefined)); 15178 return Object(emotion_esm["b" /* cx */])(shouldTruncate && !numberOfLines && Truncate, shouldTruncate && !!numberOfLines && sx.numberOfLines, className); 15179 }, [className, numberOfLines, shouldTruncate]); 15180 return { ...otherProps, 15181 className: classes, 15182 children: truncatedContent 15183 }; 15184 } 15185 15186 // EXTERNAL MODULE: ./node_modules/memize/index.js 15187 var memize = __webpack_require__("4eJC"); 15188 var memize_default = /*#__PURE__*/__webpack_require__.n(memize); 15189 15190 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/colors.js 15191 /** 15192 * External dependencies 15193 */ 15194 15195 15196 /** @type {HTMLDivElement} */ 15197 15198 let colorComputationNode; 15199 /** 15200 * @return {HTMLDivElement | undefined} The HTML element for color computation. 15201 */ 15202 15203 function getColorComputationNode() { 15204 if (typeof document === 'undefined') return; 15205 15206 if (!colorComputationNode) { 15207 // Create a temporary element for style computation. 15208 const el = document.createElement('div'); 15209 el.setAttribute('data-g2-color-computation-node', ''); // Inject for window computed style. 15210 15211 document.body.appendChild(el); 15212 colorComputationNode = el; 15213 } 15214 15215 return colorComputationNode; 15216 } 15217 /** 15218 * @param {string | unknown} value 15219 * 15220 * @return {boolean} Whether the value is a valid color. 15221 */ 15222 15223 15224 function isColor(value) { 15225 if (typeof value !== 'string') return false; 15226 const test = tinycolor_default()(value); 15227 return test.isValid(); 15228 } 15229 /** 15230 * Retrieves the computed background color. This is useful for getting the 15231 * value of a CSS variable color. 15232 * 15233 * @param {string | unknown} backgroundColor The background color to compute. 15234 * 15235 * @return {string} The computed background color. 15236 */ 15237 15238 15239 function _getComputedBackgroundColor(backgroundColor) { 15240 var _window; 15241 15242 if (typeof backgroundColor !== 'string') return ''; 15243 if (isColor(backgroundColor)) return backgroundColor; 15244 if (!backgroundColor.includes('var(')) return ''; 15245 if (typeof document === 'undefined') return ''; // Attempts to gracefully handle CSS variables color values. 15246 15247 const el = getColorComputationNode(); 15248 if (!el) return ''; 15249 el.style.background = backgroundColor; // Grab the style 15250 15251 const computedColor = (_window = window) === null || _window === void 0 ? void 0 : _window.getComputedStyle(el).background; // Reset 15252 15253 el.style.background = ''; 15254 return computedColor || ''; 15255 } 15256 15257 const getComputedBackgroundColor = memize_default()(_getComputedBackgroundColor); 15258 /** 15259 * Get the text shade optimized for readability, based on a background color. 15260 * 15261 * @param {string | unknown} backgroundColor The background color. 15262 * 15263 * @return {string} The optimized text color (black or white). 15264 */ 15265 15266 function getOptimalTextColor(backgroundColor) { 15267 const background = getComputedBackgroundColor(backgroundColor); 15268 const isReadableWithBlackText = tinycolor_default.a.isReadable(background, '#000000'); 15269 return isReadableWithBlackText ? '#000000' : '#ffffff'; 15270 } 15271 /** 15272 * Get the text shade optimized for readability, based on a background color. 15273 * 15274 * @param {string | unknown} backgroundColor The background color. 15275 * 15276 * @return {string} The optimized text shade (dark or light). 15277 */ 15278 15279 function getOptimalTextShade(backgroundColor) { 15280 const result = getOptimalTextColor(backgroundColor); 15281 return result === '#000000' ? 'dark' : 'light'; 15282 } 15283 15284 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/config-values.js 15285 /** 15286 * Internal dependencies 15287 */ 15288 15289 15290 const CONTROL_HEIGHT = '30px'; 15291 const CARD_PADDING_X = space_space(3); 15292 const CARD_PADDING_Y = space_space(3); 15293 /* harmony default export */ var config_values = ({ 15294 colorDivider: 'rgba(0, 0, 0, 0.1)', 15295 colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)', 15296 colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)', 15297 colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)', 15298 elevationIntensity: 1, 15299 radiusBlockUi: '2px', 15300 borderWidth: '1px', 15301 borderWidthFocus: '1.5px', 15302 borderWidthTab: '4px', 15303 spinnerSize: '18px', 15304 fontSize: '13px', 15305 fontSizeH1: 'calc(2.44 * 13px)', 15306 fontSizeH2: 'calc(1.95 * 13px)', 15307 fontSizeH3: 'calc(1.56 * 13px)', 15308 fontSizeH4: 'calc(1.25 * 13px)', 15309 fontSizeH5: '13px', 15310 fontSizeH6: 'calc(0.8 * 13px)', 15311 fontSizeInputMobile: '16px', 15312 fontSizeMobile: '15px', 15313 fontSizeSmall: 'calc(0.92 * 13px)', 15314 fontSizeXSmall: 'calc(0.75 * 13px)', 15315 fontLineHeightBase: '1.2', 15316 fontWeight: 'normal', 15317 fontWeightHeading: '600', 15318 gridBase: '4px', 15319 controlHeight: CONTROL_HEIGHT, 15320 controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`, 15321 controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`, 15322 controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`, 15323 cardBorderRadius: '2px', 15324 cardPaddingX: CARD_PADDING_X, 15325 cardPaddingY: CARD_PADDING_Y, 15326 cardPadding: `${CARD_PADDING_X} ${CARD_PADDING_Y}`, 15327 cardHeaderFooterPaddingY: space_space(1), 15328 cardHeaderHeight: '44px', 15329 surfaceBackgroundColor: COLORS.white, 15330 surfaceBackgroundSubtleColor: '#F3F3F3', 15331 surfaceBackgroundTintColor: '#F5F5F5', 15332 surfaceBorderColor: 'rgba(0, 0, 0, 0.1)', 15333 surfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)', 15334 surfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)', 15335 surfaceBackgroundTertiaryColor: COLORS.white, 15336 surfaceColor: COLORS.white, 15337 transitionDuration: '200ms', 15338 transitionDurationFast: '160ms', 15339 transitionDurationFaster: '120ms', 15340 transitionDurationFastest: '100ms', 15341 transitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)', 15342 transitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)' 15343 }); 15344 15345 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles.js 15346 15347 15348 function text_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 15349 15350 /** 15351 * Internal dependencies 15352 */ 15353 15354 const Text = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.black, ";line-height:", config_values.fontLineHeightBase, ";margin:0;;label:Text;" + ( true ? "" : undefined)); 15355 const styles_block = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 15356 name: "w2ur5d-block", 15357 styles: "display:block;;label:block;" 15358 } : undefined); 15359 const positive = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.alert.green, ";;label:positive;" + ( true ? "" : undefined)); 15360 const destructive = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.alert.red, ";;label:destructive;" + ( true ? "" : undefined)); 15361 const styles_muted = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.mediumGray.text, ";;label:muted;" + ( true ? "" : undefined)); 15362 const highlighterText = /*#__PURE__*/Object(emotion_esm["a" /* css */])("mark{background:", COLORS.alert.yellow, ";border-radius:2px;box-shadow:0 0 0 1px rgba( 0,0,0,0.05 ) inset,0 -1px 0 rgba( 0,0,0,0.1 ) inset;};label:highlighterText;" + ( true ? "" : undefined)); 15363 const styles_upperCase = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 15364 name: "a0nhhd-upperCase", 15365 styles: "text-transform:uppercase;;label:upperCase;" 15366 } : undefined); 15367 15368 // EXTERNAL MODULE: ./node_modules/highlight-words-core/dist/index.js 15369 var dist = __webpack_require__("5V/u"); 15370 15371 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/utils.js 15372 /** 15373 * External dependencies 15374 */ 15375 15376 15377 /** 15378 * WordPress dependencies 15379 */ 15380 15381 15382 /** 15383 * Source: 15384 * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js 15385 */ 15386 15387 /* eslint-disable jsdoc/valid-types */ 15388 15389 /** 15390 * @typedef Options 15391 * @property {string} [activeClassName=''] Classname for active highlighted areas. 15392 * @property {number} [activeIndex=-1] The index of the active highlighted area. 15393 * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area. 15394 * @property {boolean} [autoEscape] Whether to automatically escape text. 15395 * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner. 15396 * @property {string} children Children to highlight. 15397 * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`. 15398 * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key). 15399 * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text. 15400 * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text. 15401 * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`. 15402 * @property {string[]} [searchWords=[]] Words to search for and highlight. 15403 * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text. 15404 * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text. 15405 */ 15406 15407 /** 15408 * Maps props to lowercase names. 15409 * 15410 * @template {Record<string, unknown>} T 15411 * @param {T} object Props to map. 15412 * @return {{[K in keyof T as Lowercase<string & K>]: T[K]}} The mapped props. 15413 */ 15414 15415 /* eslint-enable jsdoc/valid-types */ 15416 15417 const lowercaseProps = object => { 15418 /** @type {any} */ 15419 const mapped = {}; 15420 15421 for (const key in object) { 15422 mapped[key.toLowerCase()] = object[key]; 15423 } 15424 15425 return mapped; 15426 }; 15427 15428 const memoizedLowercaseProps = memize_default()(lowercaseProps); 15429 /** 15430 * 15431 * @param {Options} options 15432 */ 15433 15434 function createHighlighterText({ 15435 activeClassName = '', 15436 activeIndex = -1, 15437 activeStyle, 15438 autoEscape, 15439 caseSensitive = false, 15440 children, 15441 findChunks, 15442 highlightClassName = '', 15443 highlightStyle = {}, 15444 highlightTag = 'mark', 15445 sanitize, 15446 searchWords = [], 15447 unhighlightClassName = '', 15448 unhighlightStyle 15449 }) { 15450 if (!children) return null; 15451 if (typeof children !== 'string') return children; 15452 const textToHighlight = children; 15453 const chunks = Object(dist["findAll"])({ 15454 autoEscape, 15455 caseSensitive, 15456 findChunks, 15457 sanitize, 15458 searchWords, 15459 textToHighlight 15460 }); 15461 const HighlightTag = highlightTag; 15462 let highlightIndex = -1; 15463 let highlightClassNames = ''; 15464 let highlightStyles; 15465 const textContent = chunks.map((chunk, index) => { 15466 const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start); 15467 15468 if (chunk.highlight) { 15469 highlightIndex++; 15470 let highlightClass; 15471 15472 if (typeof highlightClassName === 'object') { 15473 if (!caseSensitive) { 15474 highlightClassName = memoizedLowercaseProps(highlightClassName); 15475 highlightClass = highlightClassName[text.toLowerCase()]; 15476 } else { 15477 highlightClass = highlightClassName[text]; 15478 } 15479 } else { 15480 highlightClass = highlightClassName; 15481 } 15482 15483 const isActive = highlightIndex === +activeIndex; 15484 highlightClassNames = `${highlightClass} ${isActive ? activeClassName : ''}`; 15485 highlightStyles = isActive === true && activeStyle !== null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle; 15486 /** @type {Record<string, any>} */ 15487 15488 const props = { 15489 children: text, 15490 className: highlightClassNames, 15491 key: index, 15492 style: highlightStyles 15493 }; // Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop) 15494 // Only pass through the highlightIndex attribute for custom components. 15495 15496 if (typeof HighlightTag !== 'string') { 15497 props.highlightIndex = highlightIndex; 15498 } 15499 15500 return Object(external_wp_element_["createElement"])(HighlightTag, props); 15501 } 15502 15503 return Object(external_wp_element_["createElement"])('span', { 15504 children: text, 15505 className: unhighlightClassName, 15506 key: index, 15507 style: unhighlightStyle 15508 }); 15509 }); 15510 return textContent; 15511 } 15512 15513 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/font-size.js 15514 /** 15515 * External dependencies 15516 */ 15517 // eslint-disable-next-line no-restricted-imports 15518 15519 /** 15520 * Internal dependencies 15521 */ 15522 15523 const BASE_FONT_SIZE = 13; 15524 const PRESET_FONT_SIZES = { 15525 body: BASE_FONT_SIZE, 15526 caption: 10, 15527 footnote: 11, 15528 largeTitle: 28, 15529 subheadline: 12, 15530 title: 20 15531 }; 15532 const HEADING_FONT_SIZES = [1, 2, 3, 4, 5, 6].flatMap(n => [n, n.toString()]); 15533 function getFontSize(size = BASE_FONT_SIZE) { 15534 if (size in PRESET_FONT_SIZES) { 15535 return getFontSize(PRESET_FONT_SIZES[size]); 15536 } 15537 15538 if (typeof size !== 'number') { 15539 const parsed = parseFloat(size); 15540 if (Number.isNaN(parsed)) return size; 15541 size = parsed; 15542 } 15543 15544 const ratio = `(${size} / ${BASE_FONT_SIZE})`; 15545 return `calc(${ratio} * ${config_values.fontSize})`; 15546 } 15547 function getHeadingFontSize(size = 3) { 15548 if (!HEADING_FONT_SIZES.includes(size)) { 15549 return getFontSize(size); 15550 } 15551 15552 const headingSize = `fontSizeH${size}`; 15553 return config_values[headingSize]; 15554 } 15555 15556 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/get-line-height.js 15557 /** 15558 * External dependencies 15559 */ 15560 // eslint-disable-next-line no-restricted-imports 15561 15562 /** 15563 * Internal dependencies 15564 */ 15565 15566 15567 function getLineHeight(adjustLineHeightForInnerControls, lineHeight) { 15568 if (lineHeight) return lineHeight; 15569 if (!adjustLineHeightForInnerControls) return; 15570 let value = `calc(${config_values.controlHeight} + ${space_space(2)})`; 15571 15572 switch (adjustLineHeightForInnerControls) { 15573 case 'large': 15574 value = `calc(${config_values.controlHeightLarge} + ${space_space(2)})`; 15575 break; 15576 15577 case 'small': 15578 value = `calc(${config_values.controlHeightSmall} + ${space_space(2)})`; 15579 break; 15580 15581 case 'xSmall': 15582 value = `calc(${config_values.controlHeightXSmall} + ${space_space(2)})`; 15583 break; 15584 15585 default: 15586 break; 15587 } 15588 15589 return value; 15590 } 15591 15592 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/hook.js 15593 15594 15595 15596 function hook_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 15597 15598 15599 /** 15600 * WordPress dependencies 15601 */ 15602 15603 15604 /** 15605 * Internal dependencies 15606 */ 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 /** 15617 * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'span'>} props 15618 */ 15619 15620 function useText(props) { 15621 const { 15622 adjustLineHeightForInnerControls, 15623 align, 15624 children, 15625 className, 15626 color, 15627 ellipsizeMode, 15628 isDestructive = false, 15629 display, 15630 highlightEscape = false, 15631 highlightCaseSensitive = false, 15632 highlightWords, 15633 highlightSanitize, 15634 isBlock = false, 15635 letterSpacing, 15636 lineHeight: lineHeightProp, 15637 optimizeReadabilityFor, 15638 size, 15639 truncate = false, 15640 upperCase = false, 15641 variant, 15642 weight = config_values.fontWeight, 15643 ...otherProps 15644 } = Object(use_context_system["a" /* useContextSystem */])(props, 'Text'); 15645 /** @type {import('react').ReactNode} */ 15646 15647 let content = children; 15648 const isHighlighter = Array.isArray(highlightWords); 15649 const isCaption = size === 'caption'; 15650 15651 if (isHighlighter) { 15652 if (typeof children !== 'string') { 15653 throw new TypeError('`children` of `Text` must only be `string` types when `highlightWords` is defined'); 15654 } 15655 15656 content = createHighlighterText({ 15657 autoEscape: highlightEscape, 15658 // Disable reason: We need to disable this otherwise it erases the cast 15659 // eslint-disable-next-line object-shorthand 15660 children: 15661 /** @type {string} */ 15662 children, 15663 caseSensitive: highlightCaseSensitive, 15664 searchWords: highlightWords, 15665 sanitize: highlightSanitize 15666 }); 15667 } 15668 15669 const classes = Object(external_wp_element_["useMemo"])(() => { 15670 const sx = {}; 15671 const lineHeight = getLineHeight(adjustLineHeightForInnerControls, lineHeightProp); 15672 sx.Base = /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 15673 color, 15674 display, 15675 fontSize: getFontSize(size), 15676 15677 /* eslint-disable jsdoc/valid-types */ 15678 fontWeight: 15679 /** @type {import('react').CSSProperties['fontWeight']} */ 15680 weight, 15681 15682 /* eslint-enable jsdoc/valid-types */ 15683 lineHeight, 15684 letterSpacing, 15685 textAlign: align 15686 }, true ? "" : undefined); 15687 sx.upperCase = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? { 15688 name: "1lejymi", 15689 styles: "text-transform:uppercase;" 15690 } : undefined); 15691 sx.optimalTextColor = null; 15692 15693 if (optimizeReadabilityFor) { 15694 const isOptimalTextColorDark = getOptimalTextShade(optimizeReadabilityFor) === 'dark'; 15695 sx.optimalTextColor = isOptimalTextColorDark ? /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 15696 color: COLORS.black 15697 }, true ? "" : undefined) : /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 15698 color: COLORS.white 15699 }, true ? "" : undefined); 15700 } 15701 15702 return Object(emotion_esm["b" /* cx */])(Text, sx.Base, sx.optimalTextColor, isDestructive && destructive, !!isHighlighter && highlighterText, isBlock && styles_block, isCaption && styles_muted, variant && text_styles_namespaceObject[variant], upperCase && sx.upperCase, className); 15703 }, [adjustLineHeightForInnerControls, align, className, color, display, isBlock, isCaption, isDestructive, isHighlighter, letterSpacing, lineHeightProp, optimizeReadabilityFor, size, upperCase, variant, weight]); 15704 /** @type {undefined | 'auto' | 'none'} */ 15705 15706 let finalEllipsizeMode; 15707 15708 if (truncate === true) { 15709 finalEllipsizeMode = 'auto'; 15710 } 15711 15712 if (truncate === false) { 15713 finalEllipsizeMode = 'none'; 15714 } 15715 15716 const finalComponentProps = { ...otherProps, 15717 className: classes, 15718 children, 15719 ellipsizeMode: ellipsizeMode || finalEllipsizeMode 15720 }; 15721 const truncateProps = useTruncate(finalComponentProps); 15722 /** 15723 * Enhance child `<Link />` components to inherit font size. 15724 */ 15725 15726 if (!truncate && Array.isArray(children)) { 15727 content = external_wp_element_["Children"].map(children, child => { 15728 // @ts-ignore 15729 if (!Object(external_lodash_["isPlainObject"])(child) || !('props' in child)) { 15730 return child; 15731 } 15732 15733 const isLink = Object(context_connect["b" /* hasConnectNamespace */])(child, ['Link']); 15734 15735 if (isLink) { 15736 return Object(external_wp_element_["cloneElement"])(child, { 15737 size: child.props.size || 'inherit' 15738 }); 15739 } 15740 15741 return child; 15742 }); 15743 } 15744 15745 return { ...truncateProps, 15746 children: truncate ? truncateProps.children : content 15747 }; 15748 } 15749 15750 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/component.js 15751 /** 15752 * Internal dependencies 15753 */ 15754 15755 15756 /** 15757 * `Text` is a core component that renders text in the library, using the 15758 * library's typography system. 15759 * 15760 * `Text` can be used to render any text-content, like an HTML `p` or `span`. 15761 * 15762 * @example 15763 * 15764 * ```jsx 15765 * import { __experimentalText as Text } from `@wordpress/components`; 15766 * 15767 * function Example() { 15768 * return <Text>Code is Poetry</Text>; 15769 * } 15770 * ``` 15771 */ 15772 15773 const component_Text = create_component_createComponent({ 15774 as: 'span', 15775 useHook: useText, 15776 name: 'Text' 15777 }); 15778 /* harmony default export */ var text_component = (component_Text); 15779 15780 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/rtl.js 15781 /** 15782 * External dependencies 15783 */ 15784 15785 15786 /** 15787 * WordPress dependencies 15788 */ 15789 15790 15791 const LOWER_LEFT_REGEXP = new RegExp(/-left/g); 15792 const LOWER_RIGHT_REGEXP = new RegExp(/-right/g); 15793 const UPPER_LEFT_REGEXP = new RegExp(/Left/g); 15794 const UPPER_RIGHT_REGEXP = new RegExp(/Right/g); 15795 /** 15796 * Flips a CSS property from left <-> right. 15797 * 15798 * @param {string} key The CSS property name. 15799 * 15800 * @return {string} The flipped CSS property name, if applicable. 15801 */ 15802 15803 function getConvertedKey(key) { 15804 if (key === 'left') { 15805 return 'right'; 15806 } 15807 15808 if (key === 'right') { 15809 return 'left'; 15810 } 15811 15812 if (LOWER_LEFT_REGEXP.test(key)) { 15813 return key.replace(LOWER_LEFT_REGEXP, '-right'); 15814 } 15815 15816 if (LOWER_RIGHT_REGEXP.test(key)) { 15817 return key.replace(LOWER_RIGHT_REGEXP, '-left'); 15818 } 15819 15820 if (UPPER_LEFT_REGEXP.test(key)) { 15821 return key.replace(UPPER_LEFT_REGEXP, 'Right'); 15822 } 15823 15824 if (UPPER_RIGHT_REGEXP.test(key)) { 15825 return key.replace(UPPER_RIGHT_REGEXP, 'Left'); 15826 } 15827 15828 return key; 15829 } 15830 /** 15831 * An incredibly basic ltr -> rtl converter for style properties 15832 * 15833 * @param {import('react').CSSProperties} ltrStyles 15834 * 15835 * @return {import('react').CSSProperties} Converted ltr -> rtl styles 15836 */ 15837 15838 15839 const convertLTRToRTL = (ltrStyles = {}) => { 15840 return Object(external_lodash_["mapKeys"])(ltrStyles, (_value, key) => getConvertedKey(key)); 15841 }; 15842 /** 15843 * A higher-order function that create an incredibly basic ltr -> rtl style converter for CSS objects. 15844 * 15845 * @param {import('react').CSSProperties} ltrStyles Ltr styles. Converts and renders from ltr -> rtl styles, if applicable. 15846 * @param {import('react').CSSProperties} [rtlStyles] Rtl styles. Renders if provided. 15847 * 15848 * @return {Function} A function to output CSS styles for Emotion's renderer 15849 */ 15850 15851 function rtl_rtl(ltrStyles = {}, rtlStyles) { 15852 return () => { 15853 if (rtlStyles) { 15854 // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css 15855 return Object(external_wp_i18n_["isRTL"])() ? /*#__PURE__*/css_browser_esm(rtlStyles, true ? "" : undefined) : /*#__PURE__*/css_browser_esm(ltrStyles, true ? "" : undefined); 15856 } // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css 15857 15858 15859 return Object(external_wp_i18n_["isRTL"])() ? /*#__PURE__*/css_browser_esm(convertLTRToRTL(ltrStyles), true ? "" : undefined) : /*#__PURE__*/css_browser_esm(ltrStyles, true ? "" : undefined); 15860 }; 15861 } 15862 15863 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/styles/input-control-styles.js 15864 15865 15866 15867 15868 function input_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 15869 15870 /** 15871 * External dependencies 15872 */ 15873 15874 15875 /** 15876 * Internal dependencies 15877 */ 15878 15879 15880 15881 15882 var input_control_styles_ref = true ? { 15883 name: "1dacand", 15884 styles: "padding-top:0;" 15885 } : undefined; 15886 15887 const rootFloatLabelStyles = () => { 15888 return input_control_styles_ref; 15889 }; 15890 15891 var input_control_styles_ref2 = true ? { 15892 name: "r6z5ec", 15893 styles: "z-index:1;" 15894 } : undefined; 15895 15896 const rootFocusedStyles = ({ 15897 isFocused 15898 }) => { 15899 if (!isFocused) return ''; 15900 return input_control_styles_ref2; 15901 }; 15902 15903 var input_control_styles_ref3 = true ? { 15904 name: "uz6002", 15905 styles: "align-items:flex-start;flex-direction:column;" 15906 } : undefined; 15907 15908 var input_control_styles_ref4 = true ? { 15909 name: "53hdd7", 15910 styles: "align-items:flex-start;flex-direction:column-reverse;" 15911 } : undefined; 15912 15913 var input_control_styles_ref5 = true ? { 15914 name: "x4dmss", 15915 styles: "justify-content:space-between;" 15916 } : undefined; 15917 15918 const rootLabelPositionStyles = ({ 15919 labelPosition 15920 }) => { 15921 switch (labelPosition) { 15922 case 'top': 15923 return input_control_styles_ref3; 15924 15925 case 'bottom': 15926 return input_control_styles_ref4; 15927 15928 case 'edge': 15929 return input_control_styles_ref5; 15930 15931 default: 15932 return ''; 15933 } 15934 }; 15935 15936 const input_control_styles_Root = /*#__PURE__*/styled_base_browser_esm(flex_component, { 15937 target: "e1cr7zh10", 15938 label: "Root" 15939 })("position:relative;border-radius:2px;", rootFloatLabelStyles, " ", rootFocusedStyles, " ", rootLabelPositionStyles, true ? "" : undefined); 15940 15941 const containerDisabledStyles = ({ 15942 disabled 15943 }) => { 15944 const backgroundColor = disabled ? COLORS.ui.backgroundDisabled : COLORS.ui.background; 15945 return /*#__PURE__*/css_browser_esm({ 15946 backgroundColor 15947 }, true ? "" : undefined); 15948 }; // Normalizes the margins from the <Flex /> (components/ui/flex/) container. 15949 15950 15951 var input_control_styles_ref6 = true ? { 15952 name: "1ibawvu", 15953 styles: "margin:0 !important;" 15954 } : undefined; 15955 15956 const containerMarginStyles = ({ 15957 hideLabel 15958 }) => { 15959 return hideLabel ? input_control_styles_ref6 : null; 15960 }; 15961 15962 var input_control_styles_ref7 = true ? { 15963 name: "8atqhb", 15964 styles: "width:100%;" 15965 } : undefined; 15966 15967 const containerWidthStyles = ({ 15968 __unstableInputWidth, 15969 labelPosition 15970 }) => { 15971 if (!__unstableInputWidth) return input_control_styles_ref7; 15972 if (labelPosition === 'side') return ''; 15973 15974 if (labelPosition === 'edge') { 15975 return /*#__PURE__*/css_browser_esm({ 15976 flex: `0 0 ${__unstableInputWidth}` 15977 }, true ? "" : undefined); 15978 } 15979 15980 return /*#__PURE__*/css_browser_esm({ 15981 width: __unstableInputWidth 15982 }, true ? "" : undefined); 15983 }; 15984 15985 const Container = styled_base_browser_esm("div", { 15986 target: "e1cr7zh11", 15987 label: "Container" 15988 })("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", containerDisabledStyles, " ", containerMarginStyles, " ", containerWidthStyles, true ? "" : undefined); 15989 15990 const disabledStyles = ({ 15991 disabled 15992 }) => { 15993 if (!disabled) return ''; 15994 return /*#__PURE__*/css_browser_esm({ 15995 color: COLORS.ui.textDisabled 15996 }, true ? "" : undefined); 15997 }; 15998 15999 const fontSizeStyles = ({ 16000 size 16001 }) => { 16002 const sizes = { 16003 default: '13px', 16004 small: '11px' 16005 }; 16006 const fontSize = sizes[size]; 16007 const fontSizeMobile = '16px'; 16008 if (!fontSize) return ''; 16009 return /*#__PURE__*/css_browser_esm("font-size:", fontSizeMobile, ";@media ( min-width:600px ){font-size:", fontSize, ";}" + ( true ? "" : undefined)); 16010 }; 16011 16012 const sizeStyles = ({ 16013 size 16014 }) => { 16015 const sizes = { 16016 default: { 16017 height: 30, 16018 lineHeight: 1, 16019 minHeight: 30 16020 }, 16021 small: { 16022 height: 24, 16023 lineHeight: 1, 16024 minHeight: 24 16025 } 16026 }; 16027 const style = sizes[size] || sizes.default; 16028 return /*#__PURE__*/css_browser_esm(style, true ? "" : undefined); 16029 }; 16030 16031 var input_control_styles_ref8 = true ? { 16032 name: "103r1kr", 16033 styles: "&::-webkit-input-placeholder{line-height:normal;}" 16034 } : undefined; 16035 16036 const placeholderStyles = () => { 16037 return input_control_styles_ref8; 16038 }; 16039 16040 const dragStyles = ({ 16041 isDragging, 16042 dragCursor 16043 }) => { 16044 let defaultArrowStyles = ''; 16045 let activeDragCursorStyles = ''; 16046 16047 if (isDragging) { 16048 defaultArrowStyles = /*#__PURE__*/css_browser_esm("cursor:", dragCursor, ";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}" + ( true ? "" : undefined)); 16049 } 16050 16051 if (isDragging && dragCursor) { 16052 activeDragCursorStyles = /*#__PURE__*/css_browser_esm("&:active{cursor:", dragCursor, ";}" + ( true ? "" : undefined)); 16053 } 16054 16055 return /*#__PURE__*/css_browser_esm(defaultArrowStyles, " ", activeDragCursorStyles, true ? "" : undefined); 16056 }; // TODO: Resolve need to use &&& to increase specificity 16057 // https://github.com/WordPress/gutenberg/issues/18483 16058 16059 16060 const input_control_styles_Input = styled_base_browser_esm("input", { 16061 target: "e1cr7zh12", 16062 label: "Input" 16063 })("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:", COLORS.black, ";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", placeholderStyles, "}" + ( true ? "" : undefined)); 16064 16065 var input_control_styles_ref9 = true ? { 16066 name: "8uhtka", 16067 styles: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" 16068 } : undefined; 16069 16070 const labelTruncation = () => { 16071 return input_control_styles_ref9; 16072 }; 16073 16074 const labelPadding = ({ 16075 labelPosition 16076 }) => { 16077 let paddingBottom = 4; 16078 16079 if (labelPosition === 'edge' || labelPosition === 'side') { 16080 paddingBottom = 0; 16081 } 16082 16083 return /*#__PURE__*/css_browser_esm({ 16084 paddingTop: 0, 16085 paddingBottom 16086 }, true ? "" : undefined); 16087 }; 16088 16089 const BaseLabel = /*#__PURE__*/styled_base_browser_esm(text_component, { 16090 target: "e1cr7zh13", 16091 label: "BaseLabel" 16092 })("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;", labelPadding, " ", labelTruncation, "}" + ( true ? "" : undefined)); 16093 16094 const Label = props => Object(external_wp_element_["createElement"])(BaseLabel, Object(esm_extends["a" /* default */])({}, props, { 16095 as: "label" 16096 })); 16097 const LabelWrapper = /*#__PURE__*/styled_base_browser_esm(flex_item_component, { 16098 target: "e1cr7zh14", 16099 label: "LabelWrapper" 16100 })( true ? { 16101 name: "120o8im", 16102 styles: "max-width:calc( 100% - 10px );" 16103 } : undefined); 16104 16105 const backdropFocusedStyles = ({ 16106 disabled, 16107 isFocused 16108 }) => { 16109 let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border; 16110 let boxShadow = null; 16111 16112 if (isFocused) { 16113 boxShadow = `0 0 0 1px ${COLORS.ui.borderFocus} inset`; 16114 } 16115 16116 if (disabled) { 16117 borderColor = COLORS.ui.borderDisabled; 16118 } 16119 16120 return /*#__PURE__*/css_browser_esm({ 16121 boxShadow, 16122 borderColor, 16123 borderStyle: 'solid', 16124 borderWidth: 1 16125 }, true ? "" : undefined); 16126 }; 16127 16128 const BackdropUI = styled_base_browser_esm("div", { 16129 target: "e1cr7zh15", 16130 label: "BackdropUI" 16131 })("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", backdropFocusedStyles, " ", rtl_rtl({ 16132 paddingLeft: 2 16133 }), "}" + ( true ? "" : undefined)); 16134 const Prefix = styled_base_browser_esm("span", { 16135 target: "e1cr7zh16", 16136 label: "Prefix" 16137 })( true ? { 16138 name: "1pxuk39", 16139 styles: "box-sizing:border-box;display:block;" 16140 } : undefined); 16141 const Suffix = styled_base_browser_esm("span", { 16142 target: "e1cr7zh17", 16143 label: "Suffix" 16144 })( true ? { 16145 name: "1pxuk39", 16146 styles: "box-sizing:border-box;display:block;" 16147 } : undefined); 16148 16149 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/backdrop.js 16150 16151 16152 /** 16153 * WordPress dependencies 16154 */ 16155 16156 /** 16157 * Internal dependencies 16158 */ 16159 16160 16161 16162 function Backdrop({ 16163 disabled = false, 16164 isFocused = false 16165 }) { 16166 return Object(external_wp_element_["createElement"])(BackdropUI, { 16167 "aria-hidden": "true", 16168 className: "components-input-control__backdrop", 16169 disabled: disabled, 16170 isFocused: isFocused 16171 }); 16172 } 16173 16174 const MemoizedBackdrop = Object(external_wp_element_["memo"])(Backdrop); 16175 /* harmony default export */ var backdrop = (MemoizedBackdrop); 16176 16177 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/label.js 16178 16179 16180 16181 /** 16182 * Internal dependencies 16183 */ 16184 16185 16186 function label_Label({ 16187 children, 16188 hideLabelFromVision, 16189 htmlFor, 16190 ...props 16191 }) { 16192 if (!children) return null; 16193 16194 if (hideLabelFromVision) { 16195 return Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 16196 as: "label", 16197 htmlFor: htmlFor 16198 }, children); 16199 } 16200 16201 return Object(external_wp_element_["createElement"])(Label, Object(esm_extends["a" /* default */])({ 16202 htmlFor: htmlFor 16203 }, props), children); 16204 } 16205 16206 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-base.js 16207 16208 16209 16210 /** 16211 * WordPress dependencies 16212 */ 16213 16214 16215 /** 16216 * Internal dependencies 16217 */ 16218 16219 16220 16221 16222 16223 function useUniqueId(idProp) { 16224 const instanceId = Object(external_wp_compose_["useInstanceId"])(InputBase); 16225 const id = `input-base-control-${instanceId}`; 16226 return idProp || id; 16227 } // Adapter to map props for the new ui/flex compopnent. 16228 16229 16230 function getUIFlexProps({ 16231 labelPosition 16232 }) { 16233 const props = {}; 16234 16235 switch (labelPosition) { 16236 case 'top': 16237 props.direction = 'column'; 16238 props.gap = 0; 16239 break; 16240 16241 case 'bottom': 16242 props.direction = 'column-reverse'; 16243 props.gap = 0; 16244 break; 16245 16246 case 'edge': 16247 props.justify = 'space-between'; 16248 break; 16249 } 16250 16251 return props; 16252 } 16253 16254 function InputBase({ 16255 __unstableInputWidth, 16256 children, 16257 className, 16258 disabled = false, 16259 hideLabelFromVision = false, 16260 labelPosition, 16261 id: idProp, 16262 isFocused = false, 16263 label, 16264 prefix, 16265 size = 'default', 16266 suffix, 16267 ...props 16268 }, ref) { 16269 const id = useUniqueId(idProp); 16270 const hideLabel = hideLabelFromVision || !label; 16271 return Object(external_wp_element_["createElement"])(input_control_styles_Root, Object(esm_extends["a" /* default */])({}, props, getUIFlexProps({ 16272 labelPosition 16273 }), { 16274 className: className, 16275 isFocused: isFocused, 16276 labelPosition: labelPosition, 16277 ref: ref, 16278 __unstableVersion: "next" 16279 }), Object(external_wp_element_["createElement"])(LabelWrapper, null, Object(external_wp_element_["createElement"])(label_Label, { 16280 className: "components-input-control__label", 16281 hideLabelFromVision: hideLabelFromVision, 16282 labelPosition: labelPosition, 16283 htmlFor: id, 16284 size: size 16285 }, label)), Object(external_wp_element_["createElement"])(Container, { 16286 __unstableInputWidth: __unstableInputWidth, 16287 className: "components-input-control__container", 16288 disabled: disabled, 16289 hideLabel: hideLabel, 16290 isFocused: isFocused, 16291 labelPosition: labelPosition 16292 }, prefix && Object(external_wp_element_["createElement"])(Prefix, { 16293 className: "components-input-control__prefix" 16294 }, prefix), children, suffix && Object(external_wp_element_["createElement"])(Suffix, { 16295 className: "components-input-control__suffix" 16296 }, suffix), Object(external_wp_element_["createElement"])(backdrop, { 16297 "aria-hidden": "true", 16298 disabled: disabled, 16299 isFocused: isFocused, 16300 label: label, 16301 size: size 16302 }))); 16303 } 16304 /* harmony default export */ var input_base = (Object(external_wp_element_["forwardRef"])(InputBase)); 16305 16306 // CONCATENATED MODULE: ./node_modules/react-use-gesture/dist/reactusegesture.esm.js 16307 16308 16309 // vector add 16310 function addV(v1, v2) { 16311 return v1.map(function (v, i) { 16312 return v + v2[i]; 16313 }); 16314 } // vector substract 16315 16316 function subV(v1, v2) { 16317 return v1.map(function (v, i) { 16318 return v - v2[i]; 16319 }); 16320 } 16321 /** 16322 * Calculates distance 16323 * @param movement the difference between current and initial vectors 16324 * @returns distance 16325 */ 16326 16327 function calculateDistance(movement) { 16328 return Math.hypot.apply(Math, movement); 16329 } 16330 function calculateAllGeometry(movement, delta) { 16331 if (delta === void 0) { 16332 delta = movement; 16333 } 16334 16335 var dl = calculateDistance(delta); 16336 var alpha = dl === 0 ? 0 : 1 / dl; 16337 var direction = delta.map(function (v) { 16338 return alpha * v; 16339 }); 16340 var distance = calculateDistance(movement); 16341 return { 16342 distance: distance, 16343 direction: direction 16344 }; 16345 } 16346 /** 16347 * Calculates all kinematics 16348 * @template T the expected vector type 16349 * @param movement the difference between current and initial vectors 16350 * @param delta the difference between current and previous vectors 16351 * @param delta_t the time difference between current and previous timestamps 16352 * @returns all kinematics 16353 */ 16354 16355 function calculateAllKinematics(movement, delta, dt) { 16356 var dl = calculateDistance(delta); 16357 var alpha = dl === 0 ? 0 : 1 / dl; 16358 var beta = dt === 0 ? 0 : 1 / dt; 16359 var velocity = beta * dl; 16360 var velocities = delta.map(function (v) { 16361 return beta * v; 16362 }); 16363 var direction = delta.map(function (v) { 16364 return alpha * v; 16365 }); 16366 var distance = calculateDistance(movement); 16367 return { 16368 velocities: velocities, 16369 velocity: velocity, 16370 distance: distance, 16371 direction: direction 16372 }; 16373 } 16374 /** 16375 * Because IE doesn't support `Math.sign` function, so we use the polyfill version of the function. 16376 * This polyfill function is suggested by Mozilla: 16377 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign#Polyfill 16378 * @param x target number 16379 */ 16380 16381 function sign(x) { 16382 if (Math.sign) return Math.sign(x); 16383 return Number(x > 0) - Number(x < 0) || +x; 16384 } 16385 16386 function minMax(value, min, max) { 16387 return Math.max(min, Math.min(value, max)); 16388 } // Based on @aholachek ;) 16389 // https://twitter.com/chpwn/status/285540192096497664 16390 // iOS constant = 0.55 16391 // https://medium.com/@nathangitter/building-fluid-interfaces-ios-swift-9732bb934bf5 16392 16393 16394 function rubberband2(distance, constant) { 16395 // default constant from the article is 0.7 16396 return Math.pow(distance, constant * 5); 16397 } 16398 16399 function rubberband(distance, dimension, constant) { 16400 if (dimension === 0 || Math.abs(dimension) === Infinity) return rubberband2(distance, constant); 16401 return distance * dimension * constant / (dimension + constant * distance); 16402 } 16403 16404 function rubberbandIfOutOfBounds(position, min, max, constant) { 16405 if (constant === void 0) { 16406 constant = 0.15; 16407 } 16408 16409 if (constant === 0) return minMax(position, min, max); 16410 if (position < min) return -rubberband(min - position, max - min, constant) + min; 16411 if (position > max) return +rubberband(position - max, max - min, constant) + max; 16412 return position; 16413 } 16414 16415 function _defineProperties(target, props) { 16416 for (var i = 0; i < props.length; i++) { 16417 var descriptor = props[i]; 16418 descriptor.enumerable = descriptor.enumerable || false; 16419 descriptor.configurable = true; 16420 if ("value" in descriptor) descriptor.writable = true; 16421 Object.defineProperty(target, descriptor.key, descriptor); 16422 } 16423 } 16424 16425 function _createClass(Constructor, protoProps, staticProps) { 16426 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 16427 if (staticProps) _defineProperties(Constructor, staticProps); 16428 return Constructor; 16429 } 16430 16431 function _extends() { 16432 _extends = Object.assign || function (target) { 16433 for (var i = 1; i < arguments.length; i++) { 16434 var source = arguments[i]; 16435 16436 for (var key in source) { 16437 if (Object.prototype.hasOwnProperty.call(source, key)) { 16438 target[key] = source[key]; 16439 } 16440 } 16441 } 16442 16443 return target; 16444 }; 16445 16446 return _extends.apply(this, arguments); 16447 } 16448 16449 function reactusegesture_esm_inheritsLoose(subClass, superClass) { 16450 subClass.prototype = Object.create(superClass.prototype); 16451 subClass.prototype.constructor = subClass; 16452 subClass.__proto__ = superClass; 16453 } 16454 16455 function _objectWithoutPropertiesLoose(source, excluded) { 16456 if (source == null) return {}; 16457 var target = {}; 16458 var sourceKeys = Object.keys(source); 16459 var key, i; 16460 16461 for (i = 0; i < sourceKeys.length; i++) { 16462 key = sourceKeys[i]; 16463 if (excluded.indexOf(key) >= 0) continue; 16464 target[key] = source[key]; 16465 } 16466 16467 return target; 16468 } 16469 16470 function _assertThisInitialized(self) { 16471 if (self === void 0) { 16472 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 16473 } 16474 16475 return self; 16476 } 16477 16478 function _unsupportedIterableToArray(o, minLen) { 16479 if (!o) return; 16480 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 16481 var n = Object.prototype.toString.call(o).slice(8, -1); 16482 if (n === "Object" && o.constructor) n = o.constructor.name; 16483 if (n === "Map" || n === "Set") return Array.from(o); 16484 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 16485 } 16486 16487 function _arrayLikeToArray(arr, len) { 16488 if (len == null || len > arr.length) len = arr.length; 16489 16490 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 16491 16492 return arr2; 16493 } 16494 16495 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 16496 var it; 16497 16498 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 16499 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 16500 if (it) o = it; 16501 var i = 0; 16502 return function () { 16503 if (i >= o.length) return { 16504 done: true 16505 }; 16506 return { 16507 done: false, 16508 value: o[i++] 16509 }; 16510 }; 16511 } 16512 16513 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 16514 } 16515 16516 it = o[Symbol.iterator](); 16517 return it.next.bind(it); 16518 } 16519 16520 function noop() {} 16521 /** 16522 * TODO Beware that only optimized cases are covered in tests =) 16523 * TODO Need to cover general case as well 16524 * 16525 * @param fns 16526 */ 16527 16528 function chainFns() { 16529 for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { 16530 fns[_key] = arguments[_key]; 16531 } 16532 16533 if (fns.length === 0) return noop; 16534 if (fns.length === 1) return fns[0]; 16535 return function () { 16536 var result; 16537 16538 for (var _iterator = _createForOfIteratorHelperLoose(fns), _step; !(_step = _iterator()).done;) { 16539 var fn = _step.value; 16540 result = fn.apply(this, arguments) || result; 16541 } 16542 16543 return result; 16544 }; 16545 } 16546 /** 16547 * Expects a simple value or 2D vector (an array with 2 elements) and 16548 * always returns 2D vector. If simple value is passed, returns a 16549 * vector with this value as both coordinates. 16550 * 16551 * @param value 16552 */ 16553 16554 function ensureVector(value, fallback) { 16555 if (value === undefined) { 16556 if (fallback === undefined) { 16557 throw new Error('Must define fallback value if undefined is expected'); 16558 } 16559 16560 value = fallback; 16561 } 16562 16563 if (Array.isArray(value)) return value; 16564 return [value, value]; 16565 } 16566 /** 16567 * Helper for defining a default value 16568 * 16569 * @param value 16570 * @param fallback 16571 */ 16572 16573 function assignDefault(value, fallback) { 16574 return Object.assign({}, fallback, value || {}); 16575 } 16576 /** 16577 * Resolves getters (functions) by calling them 16578 * If simple value is given it just passes through 16579 * 16580 * @param v 16581 */ 16582 16583 function valueFn(v) { 16584 if (typeof v === 'function') { 16585 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 16586 args[_key2 - 1] = arguments[_key2]; 16587 } 16588 16589 // @ts-ignore 16590 return v.apply(void 0, args); 16591 } else { 16592 return v; 16593 } 16594 } 16595 16596 function resolveWith(config, resolvers) { 16597 if (config === void 0) { 16598 config = {}; 16599 } 16600 16601 var result = {}; 16602 16603 for (var _i = 0, _Object$entries = Object.entries(resolvers); _i < _Object$entries.length; _i++) { 16604 var _Object$entries$_i = _Object$entries[_i], 16605 key = _Object$entries$_i[0], 16606 resolver = _Object$entries$_i[1]; 16607 16608 switch (typeof resolver) { 16609 case 'function': 16610 result[key] = resolver.call(result, config[key], key, config); 16611 break; 16612 16613 case 'object': 16614 result[key] = resolveWith(config[key], resolver); 16615 break; 16616 16617 case 'boolean': 16618 if (resolver) result[key] = config[key]; 16619 break; 16620 } 16621 } 16622 16623 return result; 16624 } 16625 16626 /** 16627 * Whether the browser supports GestureEvent (ie Safari) 16628 * @returns true if the browser supports gesture event 16629 */ 16630 function supportsGestureEvents() { 16631 try { 16632 // TODO [TS] possibly find GestureEvent definitions? 16633 // @ts-ignore: no type definitions for webkit GestureEvents 16634 return 'constructor' in GestureEvent; 16635 } catch (e) { 16636 return false; 16637 } 16638 } 16639 function supportsTouchEvents() { 16640 return typeof window !== 'undefined' && 'ontouchstart' in window; 16641 } 16642 function supportsPointerEvents() { 16643 return typeof window !== 'undefined' && 'onpointerdown' in window; 16644 } 16645 16646 function getEventTouches(event) { 16647 if ('pointerId' in event) return null; 16648 return event.type === 'touchend' ? event.changedTouches : event.targetTouches; 16649 } 16650 16651 function getTouchIds(event) { 16652 return Array.from(getEventTouches(event)).map(function (t) { 16653 return t.identifier; 16654 }); 16655 } 16656 function getGenericEventData(event) { 16657 var buttons = 'buttons' in event ? event.buttons : 0; 16658 var shiftKey = event.shiftKey, 16659 altKey = event.altKey, 16660 metaKey = event.metaKey, 16661 ctrlKey = event.ctrlKey; // TODO check if this might create some overrides? 16662 16663 return { 16664 buttons: buttons, 16665 shiftKey: shiftKey, 16666 altKey: altKey, 16667 metaKey: metaKey, 16668 ctrlKey: ctrlKey 16669 }; 16670 } 16671 16672 var identity = function identity(xy) { 16673 return xy; 16674 }; 16675 /** 16676 * Gets pointer event values. 16677 * @param event 16678 * @returns pointer event values 16679 */ 16680 16681 16682 function getPointerEventValues(event, transform) { 16683 if (transform === void 0) { 16684 transform = identity; 16685 } 16686 16687 var touchEvents = getEventTouches(event); 16688 16689 var _ref = touchEvents ? touchEvents[0] : event, 16690 clientX = _ref.clientX, 16691 clientY = _ref.clientY; 16692 16693 return transform([clientX, clientY]); 16694 } 16695 /** 16696 * Gets two touches event data 16697 * @param event 16698 * @returns two touches event data 16699 */ 16700 16701 function getTwoTouchesEventValues(event, pointerIds, transform) { 16702 if (transform === void 0) { 16703 transform = identity; 16704 } 16705 16706 var _Array$from$filter = Array.from(event.touches).filter(function (t) { 16707 return pointerIds.includes(t.identifier); 16708 }), 16709 A = _Array$from$filter[0], 16710 B = _Array$from$filter[1]; 16711 16712 if (!A || !B) throw Error("The event doesn't have two pointers matching the pointerIds"); 16713 var dx = B.clientX - A.clientX; 16714 var dy = B.clientY - A.clientY; 16715 var cx = (B.clientX + A.clientX) / 2; 16716 var cy = (B.clientY + A.clientY) / 2; // const e: any = 'nativeEvent' in event ? event.nativeEvent : event 16717 16718 var distance = Math.hypot(dx, dy); // FIXME rotation has inconsistant values so we're not using it atm 16719 // const angle = (e.rotation as number) ?? -(Math.atan2(dx, dy) * 180) / Math.PI 16720 16721 var angle = -(Math.atan2(dx, dy) * 180) / Math.PI; 16722 var values = transform([distance, angle]); 16723 var origin = transform([cx, cy]); 16724 return { 16725 values: values, 16726 origin: origin 16727 }; 16728 } 16729 /** 16730 * Gets scroll event values 16731 * @param event 16732 * @returns scroll event values 16733 */ 16734 16735 function getScrollEventValues(event, transform) { 16736 if (transform === void 0) { 16737 transform = identity; 16738 } 16739 16740 // If the currentTarget is the window then we return the scrollX/Y position. 16741 // If not (ie the currentTarget is a DOM element), then we return scrollLeft/Top 16742 var _event$currentTarget = event.currentTarget, 16743 scrollX = _event$currentTarget.scrollX, 16744 scrollY = _event$currentTarget.scrollY, 16745 scrollLeft = _event$currentTarget.scrollLeft, 16746 scrollTop = _event$currentTarget.scrollTop; 16747 return transform([scrollX || scrollLeft || 0, scrollY || scrollTop || 0]); 16748 } // wheel delta defaults from https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js 16749 16750 var LINE_HEIGHT = 40; 16751 var PAGE_HEIGHT = 800; 16752 /** 16753 * Gets wheel event values. 16754 * @param event 16755 * @returns wheel event values 16756 */ 16757 16758 function getWheelEventValues(event, transform) { 16759 if (transform === void 0) { 16760 transform = identity; 16761 } 16762 16763 var deltaX = event.deltaX, 16764 deltaY = event.deltaY, 16765 deltaMode = event.deltaMode; // normalize wheel values, especially for Firefox 16766 16767 if (deltaMode === 1) { 16768 deltaX *= LINE_HEIGHT; 16769 deltaY *= LINE_HEIGHT; 16770 } else if (deltaMode === 2) { 16771 deltaX *= PAGE_HEIGHT; 16772 deltaY *= PAGE_HEIGHT; 16773 } 16774 16775 return transform([deltaX, deltaY]); 16776 } 16777 /** 16778 * Gets webkit gesture event values. 16779 * @param event 16780 * @returns webkit gesture event values 16781 */ 16782 16783 function getWebkitGestureEventValues(event, transform) { 16784 if (transform === void 0) { 16785 transform = identity; 16786 } 16787 16788 return transform([event.scale, event.rotation]); 16789 } 16790 16791 var DEFAULT_DRAG_DELAY = 180; 16792 var DEFAULT_RUBBERBAND = 0.15; 16793 var DEFAULT_SWIPE_VELOCITY = 0.5; 16794 var DEFAULT_SWIPE_DISTANCE = 50; 16795 var DEFAULT_SWIPE_DURATION = 250; 16796 var InternalGestureOptionsNormalizers = { 16797 threshold: function threshold(value) { 16798 if (value === void 0) { 16799 value = 0; 16800 } 16801 16802 return ensureVector(value); 16803 }, 16804 rubberband: function rubberband(value) { 16805 if (value === void 0) { 16806 value = 0; 16807 } 16808 16809 switch (value) { 16810 case true: 16811 return ensureVector(DEFAULT_RUBBERBAND); 16812 16813 case false: 16814 return ensureVector(0); 16815 16816 default: 16817 return ensureVector(value); 16818 } 16819 }, 16820 enabled: function enabled(value) { 16821 if (value === void 0) { 16822 value = true; 16823 } 16824 16825 return value; 16826 }, 16827 triggerAllEvents: function triggerAllEvents(value) { 16828 if (value === void 0) { 16829 value = false; 16830 } 16831 16832 return value; 16833 }, 16834 initial: function initial(value) { 16835 if (value === void 0) { 16836 value = 0; 16837 } 16838 16839 if (typeof value === 'function') return value; 16840 return ensureVector(value); 16841 }, 16842 transform: true 16843 }; 16844 16845 var InternalCoordinatesOptionsNormalizers = /*#__PURE__*/_extends({}, InternalGestureOptionsNormalizers, { 16846 axis: true, 16847 lockDirection: function lockDirection(value) { 16848 if (value === void 0) { 16849 value = false; 16850 } 16851 16852 return value; 16853 }, 16854 bounds: function bounds(value) { 16855 if (value === void 0) { 16856 value = {}; 16857 } 16858 16859 if (typeof value === 'function') return function (state) { 16860 return InternalCoordinatesOptionsNormalizers.bounds(value(state)); 16861 }; 16862 var _value2 = value, 16863 _value2$left = _value2.left, 16864 left = _value2$left === void 0 ? -Infinity : _value2$left, 16865 _value2$right = _value2.right, 16866 right = _value2$right === void 0 ? Infinity : _value2$right, 16867 _value2$top = _value2.top, 16868 top = _value2$top === void 0 ? -Infinity : _value2$top, 16869 _value2$bottom = _value2.bottom, 16870 bottom = _value2$bottom === void 0 ? Infinity : _value2$bottom; 16871 return [[left, right], [top, bottom]]; 16872 } 16873 }); 16874 16875 var isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement; 16876 var InternalGenericOptionsNormalizers = { 16877 enabled: function enabled(value) { 16878 if (value === void 0) { 16879 value = true; 16880 } 16881 16882 return value; 16883 }, 16884 domTarget: true, 16885 window: /*#__PURE__*/function (_window) { 16886 function window(_x) { 16887 return _window.apply(this, arguments); 16888 } 16889 16890 window.toString = function () { 16891 return _window.toString(); 16892 }; 16893 16894 return window; 16895 }(function (value) { 16896 if (value === void 0) { 16897 value = isBrowser ? window : undefined; 16898 } 16899 16900 return value; 16901 }), 16902 eventOptions: function eventOptions(_temp) { 16903 var _ref = _temp === void 0 ? {} : _temp, 16904 _ref$passive = _ref.passive, 16905 passive = _ref$passive === void 0 ? true : _ref$passive, 16906 _ref$capture = _ref.capture, 16907 capture = _ref$capture === void 0 ? false : _ref$capture; 16908 16909 return { 16910 passive: passive, 16911 capture: capture 16912 }; 16913 }, 16914 transform: true 16915 }; 16916 16917 var InternalDistanceAngleOptionsNormalizers = /*#__PURE__*/_extends({}, InternalGestureOptionsNormalizers, { 16918 bounds: function bounds(_value, _key, _ref2) { 16919 var _ref2$distanceBounds = _ref2.distanceBounds, 16920 distanceBounds = _ref2$distanceBounds === void 0 ? {} : _ref2$distanceBounds, 16921 _ref2$angleBounds = _ref2.angleBounds, 16922 angleBounds = _ref2$angleBounds === void 0 ? {} : _ref2$angleBounds; 16923 16924 var _distanceBounds = function _distanceBounds(state) { 16925 var D = assignDefault(valueFn(distanceBounds, state), { 16926 min: -Infinity, 16927 max: Infinity 16928 }); 16929 return [D.min, D.max]; 16930 }; 16931 16932 var _angleBounds = function _angleBounds(state) { 16933 var A = assignDefault(valueFn(angleBounds, state), { 16934 min: -Infinity, 16935 max: Infinity 16936 }); 16937 return [A.min, A.max]; 16938 }; 16939 16940 if (typeof distanceBounds !== 'function' && typeof angleBounds !== 'function') return [_distanceBounds(), _angleBounds()]; 16941 return function (state) { 16942 return [_distanceBounds(state), _angleBounds(state)]; 16943 }; 16944 } 16945 }); 16946 16947 var InternalDragOptionsNormalizers = /*#__PURE__*/_extends({}, InternalCoordinatesOptionsNormalizers, { 16948 useTouch: function useTouch(value) { 16949 if (value === void 0) { 16950 value = false; 16951 } 16952 16953 var supportsTouch = supportsTouchEvents(); 16954 var supportsPointer = supportsPointerEvents(); 16955 if (value && supportsTouch) return true; 16956 if (supportsTouch && !supportsPointer) return true; 16957 return false; 16958 }, 16959 experimental_preventWindowScrollY: function experimental_preventWindowScrollY(value) { 16960 if (value === void 0) { 16961 value = false; 16962 } 16963 16964 return value; 16965 }, 16966 threshold: function threshold(v, _k, _ref3) { 16967 var _ref3$filterTaps = _ref3.filterTaps, 16968 filterTaps = _ref3$filterTaps === void 0 ? false : _ref3$filterTaps, 16969 _ref3$lockDirection = _ref3.lockDirection, 16970 lockDirection = _ref3$lockDirection === void 0 ? false : _ref3$lockDirection, 16971 _ref3$axis = _ref3.axis, 16972 axis = _ref3$axis === void 0 ? undefined : _ref3$axis; 16973 var A = ensureVector(v, filterTaps ? 3 : lockDirection ? 1 : axis ? 1 : 0); 16974 this.filterTaps = filterTaps; 16975 return A; 16976 }, 16977 swipeVelocity: function swipeVelocity(v) { 16978 if (v === void 0) { 16979 v = DEFAULT_SWIPE_VELOCITY; 16980 } 16981 16982 return ensureVector(v); 16983 }, 16984 swipeDistance: function swipeDistance(v) { 16985 if (v === void 0) { 16986 v = DEFAULT_SWIPE_DISTANCE; 16987 } 16988 16989 return ensureVector(v); 16990 }, 16991 swipeDuration: function swipeDuration(value) { 16992 if (value === void 0) { 16993 value = DEFAULT_SWIPE_DURATION; 16994 } 16995 16996 return value; 16997 }, 16998 delay: function delay(value) { 16999 if (value === void 0) { 17000 value = 0; 17001 } 17002 17003 switch (value) { 17004 case true: 17005 return DEFAULT_DRAG_DELAY; 17006 17007 case false: 17008 return 0; 17009 17010 default: 17011 return value; 17012 } 17013 } 17014 }); 17015 17016 function getInternalGenericOptions(config) { 17017 if (config === void 0) { 17018 config = {}; 17019 } 17020 17021 // TODO warn when passive is set to true and domTarget is undefined 17022 return resolveWith(config, InternalGenericOptionsNormalizers); 17023 } 17024 function getInternalCoordinatesOptions(config) { 17025 if (config === void 0) { 17026 config = {}; 17027 } 17028 17029 return resolveWith(config, InternalCoordinatesOptionsNormalizers); 17030 } 17031 function getInternalDistanceAngleOptions(config) { 17032 if (config === void 0) { 17033 config = {}; 17034 } 17035 17036 return resolveWith(config, InternalDistanceAngleOptionsNormalizers); 17037 } 17038 function getInternalDragOptions(config) { 17039 if (config === void 0) { 17040 config = {}; 17041 } 17042 17043 return resolveWith(config, InternalDragOptionsNormalizers); 17044 } 17045 17046 function _buildMoveConfig(_ref) { 17047 var domTarget = _ref.domTarget, 17048 eventOptions = _ref.eventOptions, 17049 window = _ref.window, 17050 enabled = _ref.enabled, 17051 rest = _objectWithoutPropertiesLoose(_ref, ["domTarget", "eventOptions", "window", "enabled"]); 17052 17053 var opts = getInternalGenericOptions({ 17054 domTarget: domTarget, 17055 eventOptions: eventOptions, 17056 window: window, 17057 enabled: enabled 17058 }); 17059 opts.move = getInternalCoordinatesOptions(rest); 17060 return opts; 17061 } 17062 function _buildHoverConfig(_ref2) { 17063 var domTarget = _ref2.domTarget, 17064 eventOptions = _ref2.eventOptions, 17065 window = _ref2.window, 17066 enabled = _ref2.enabled, 17067 rest = _objectWithoutPropertiesLoose(_ref2, ["domTarget", "eventOptions", "window", "enabled"]); 17068 17069 var opts = getInternalGenericOptions({ 17070 domTarget: domTarget, 17071 eventOptions: eventOptions, 17072 window: window, 17073 enabled: enabled 17074 }); 17075 opts.hover = _extends({ 17076 enabled: true 17077 }, rest); 17078 return opts; 17079 } 17080 function _buildDragConfig(_ref3) { 17081 var domTarget = _ref3.domTarget, 17082 eventOptions = _ref3.eventOptions, 17083 window = _ref3.window, 17084 enabled = _ref3.enabled, 17085 rest = _objectWithoutPropertiesLoose(_ref3, ["domTarget", "eventOptions", "window", "enabled"]); 17086 17087 var opts = getInternalGenericOptions({ 17088 domTarget: domTarget, 17089 eventOptions: eventOptions, 17090 window: window, 17091 enabled: enabled 17092 }); 17093 opts.drag = getInternalDragOptions(rest); 17094 return opts; 17095 } 17096 function _buildPinchConfig(_ref4) { 17097 var domTarget = _ref4.domTarget, 17098 eventOptions = _ref4.eventOptions, 17099 window = _ref4.window, 17100 enabled = _ref4.enabled, 17101 rest = _objectWithoutPropertiesLoose(_ref4, ["domTarget", "eventOptions", "window", "enabled"]); 17102 17103 var opts = getInternalGenericOptions({ 17104 domTarget: domTarget, 17105 eventOptions: eventOptions, 17106 window: window, 17107 enabled: enabled 17108 }); 17109 opts.pinch = getInternalDistanceAngleOptions(rest); 17110 return opts; 17111 } 17112 function _buildScrollConfig(_ref5) { 17113 var domTarget = _ref5.domTarget, 17114 eventOptions = _ref5.eventOptions, 17115 window = _ref5.window, 17116 enabled = _ref5.enabled, 17117 rest = _objectWithoutPropertiesLoose(_ref5, ["domTarget", "eventOptions", "window", "enabled"]); 17118 17119 var opts = getInternalGenericOptions({ 17120 domTarget: domTarget, 17121 eventOptions: eventOptions, 17122 window: window, 17123 enabled: enabled 17124 }); 17125 opts.scroll = getInternalCoordinatesOptions(rest); 17126 return opts; 17127 } 17128 function _buildWheelConfig(_ref6) { 17129 var domTarget = _ref6.domTarget, 17130 eventOptions = _ref6.eventOptions, 17131 window = _ref6.window, 17132 enabled = _ref6.enabled, 17133 rest = _objectWithoutPropertiesLoose(_ref6, ["domTarget", "eventOptions", "window", "enabled"]); 17134 17135 var opts = getInternalGenericOptions({ 17136 domTarget: domTarget, 17137 eventOptions: eventOptions, 17138 window: window, 17139 enabled: enabled 17140 }); 17141 opts.wheel = getInternalCoordinatesOptions(rest); 17142 return opts; 17143 } 17144 function buildComplexConfig(config, actions) { 17145 if (config === void 0) { 17146 config = {}; 17147 } 17148 17149 if (actions === void 0) { 17150 actions = new Set(); 17151 } 17152 17153 var _config = config, 17154 drag = _config.drag, 17155 wheel = _config.wheel, 17156 move = _config.move, 17157 scroll = _config.scroll, 17158 pinch = _config.pinch, 17159 hover = _config.hover, 17160 eventOptions = _config.eventOptions, 17161 window = _config.window, 17162 transform = _config.transform, 17163 domTarget = _config.domTarget, 17164 enabled = _config.enabled; 17165 var mergedConfig = getInternalGenericOptions({ 17166 domTarget: domTarget, 17167 eventOptions: eventOptions, 17168 transform: transform, 17169 window: window, 17170 enabled: enabled 17171 }); 17172 if (actions.has('onDrag')) mergedConfig.drag = getInternalDragOptions(drag); 17173 if (actions.has('onWheel')) mergedConfig.wheel = getInternalCoordinatesOptions(wheel); 17174 if (actions.has('onScroll')) mergedConfig.scroll = getInternalCoordinatesOptions(scroll); 17175 if (actions.has('onMove')) mergedConfig.move = getInternalCoordinatesOptions(move); 17176 if (actions.has('onPinch')) mergedConfig.pinch = getInternalDistanceAngleOptions(pinch); 17177 if (actions.has('onHover')) mergedConfig.hover = _extends({ 17178 enabled: true 17179 }, hover); 17180 return mergedConfig; 17181 } 17182 17183 function getInitial(mixed) { 17184 return _extends({ 17185 _active: false, 17186 _blocked: false, 17187 _intentional: [false, false], 17188 _movement: [0, 0], 17189 _initial: [0, 0], 17190 _bounds: [[-Infinity, Infinity], [-Infinity, Infinity]], 17191 _threshold: [0, 0], 17192 _lastEventType: undefined, 17193 _dragStarted: false, 17194 _dragPreventScroll: false, 17195 _dragIsTap: true, 17196 _dragDelayed: false, 17197 event: undefined, 17198 intentional: false, 17199 values: [0, 0], 17200 velocities: [0, 0], 17201 delta: [0, 0], 17202 movement: [0, 0], 17203 offset: [0, 0], 17204 lastOffset: [0, 0], 17205 direction: [0, 0], 17206 initial: [0, 0], 17207 previous: [0, 0], 17208 first: false, 17209 last: false, 17210 active: false, 17211 timeStamp: 0, 17212 startTime: 0, 17213 elapsedTime: 0, 17214 cancel: noop, 17215 canceled: false, 17216 memo: undefined, 17217 args: undefined 17218 }, mixed); 17219 } 17220 17221 function getInitialState() { 17222 var shared = { 17223 hovering: false, 17224 scrolling: false, 17225 wheeling: false, 17226 dragging: false, 17227 moving: false, 17228 pinching: false, 17229 touches: 0, 17230 buttons: 0, 17231 down: false, 17232 shiftKey: false, 17233 altKey: false, 17234 metaKey: false, 17235 ctrlKey: false, 17236 locked: false 17237 }; 17238 var drag = getInitial({ 17239 _pointerId: undefined, 17240 axis: undefined, 17241 xy: [0, 0], 17242 vxvy: [0, 0], 17243 velocity: 0, 17244 distance: 0, 17245 tap: false, 17246 swipe: [0, 0] 17247 }); 17248 var pinch = getInitial({ 17249 // @ts-expect-error when used _pointerIds we can assert its type will be [number, number] 17250 _pointerIds: [], 17251 da: [0, 0], 17252 vdva: [0, 0], 17253 // @ts-expect-error origin can never be passed as undefined in userland 17254 origin: undefined, 17255 turns: 0 17256 }); 17257 var wheel = getInitial({ 17258 axis: undefined, 17259 xy: [0, 0], 17260 vxvy: [0, 0], 17261 velocity: 0, 17262 distance: 0 17263 }); 17264 var move = getInitial({ 17265 axis: undefined, 17266 xy: [0, 0], 17267 vxvy: [0, 0], 17268 velocity: 0, 17269 distance: 0 17270 }); 17271 var scroll = getInitial({ 17272 axis: undefined, 17273 xy: [0, 0], 17274 vxvy: [0, 0], 17275 velocity: 0, 17276 distance: 0 17277 }); 17278 return { 17279 shared: shared, 17280 drag: drag, 17281 pinch: pinch, 17282 wheel: wheel, 17283 move: move, 17284 scroll: scroll 17285 }; 17286 } 17287 17288 var RecognizersMap = /*#__PURE__*/new Map(); 17289 17290 var identity$1 = function identity(xy) { 17291 return xy; 17292 }; 17293 /** 17294 * @private 17295 * Recognizer abstract class. 17296 */ 17297 17298 17299 var Recognizer = /*#__PURE__*/function () { 17300 /** 17301 * Creates an instance of a gesture recognizer. 17302 * @param stateKey drag, move, pinch, etc. 17303 * @param controller the controller attached to the gesture 17304 * @param [args] the args that should be passed to the gesture handler 17305 */ 17306 function Recognizer(controller, args) { 17307 var _this = this; 17308 17309 if (args === void 0) { 17310 args = []; 17311 } 17312 17313 this.controller = controller; 17314 this.args = args; 17315 this.debounced = true; // Convenience method to set a timeout for a given gesture 17316 17317 this.setTimeout = function (callback, ms) { 17318 var _window; 17319 17320 if (ms === void 0) { 17321 ms = 140; 17322 } 17323 17324 clearTimeout(_this.controller.timeouts[_this.stateKey]); 17325 17326 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 17327 args[_key - 2] = arguments[_key]; 17328 } 17329 17330 _this.controller.timeouts[_this.stateKey] = (_window = window).setTimeout.apply(_window, [callback, ms].concat(args)); 17331 }; // Convenience method to clear a timeout for a given gesture 17332 17333 17334 this.clearTimeout = function () { 17335 clearTimeout(_this.controller.timeouts[_this.stateKey]); 17336 }; 17337 /** 17338 * Fires the gesture handler 17339 */ 17340 17341 17342 this.fireGestureHandler = function (forceFlag) { 17343 if (forceFlag === void 0) { 17344 forceFlag = false; 17345 } 17346 17347 /** 17348 * If the gesture has been blocked (this can happen when the gesture has started in an unwanted direction), 17349 * clean everything and don't do anything. 17350 */ 17351 if (_this.state._blocked) { 17352 // we need debounced gestures to end by themselves 17353 if (!_this.debounced) { 17354 _this.state._active = false; 17355 17356 _this.clean(); 17357 } 17358 17359 return null; 17360 } // If the gesture has no intentional dimension, don't fire the handler. 17361 17362 17363 if (!forceFlag && !_this.state.intentional && !_this.config.triggerAllEvents) return null; 17364 17365 if (_this.state.intentional) { 17366 var prev_active = _this.state.active; 17367 var next_active = _this.state._active; 17368 _this.state.active = next_active; 17369 _this.state.first = next_active && !prev_active; 17370 _this.state.last = prev_active && !next_active; 17371 _this.controller.state.shared[_this.ingKey] = next_active; // Sets dragging, pinching, etc. to the gesture active state 17372 } 17373 17374 var touches = _this.controller.pointerIds.size || _this.controller.touchIds.size; 17375 var down = _this.controller.state.shared.buttons > 0 || touches > 0; 17376 17377 var state = _extends({}, _this.controller.state.shared, _this.state, _this.mapStateValues(_this.state), { 17378 locked: !!document.pointerLockElement, 17379 touches: touches, 17380 down: down 17381 }); // @ts-expect-error 17382 17383 17384 var newMemo = _this.handler(state); // Sets memo to the returned value of the handler (unless it's not undefined) 17385 17386 17387 _this.state.memo = newMemo !== void 0 ? newMemo : _this.state.memo; 17388 return state; 17389 }; 17390 17391 this.controller = controller; 17392 this.args = args; 17393 } // Returns the gesture config 17394 17395 17396 var _proto = Recognizer.prototype; 17397 17398 // Convenience method to update the shared state 17399 _proto.updateSharedState = function updateSharedState(sharedState) { 17400 Object.assign(this.controller.state.shared, sharedState); 17401 } // Convenience method to update the gesture state 17402 ; 17403 17404 _proto.updateGestureState = function updateGestureState(gestureState) { 17405 Object.assign(this.state, gestureState); 17406 } 17407 /** 17408 * Returns state properties depending on the movement and state. 17409 * 17410 * Should be overriden for custom behavior, doesn't do anything in the implementation 17411 * below. 17412 */ 17413 ; 17414 17415 _proto.checkIntentionality = function checkIntentionality(_intentional, _movement) { 17416 return { 17417 _intentional: _intentional, 17418 _blocked: false 17419 }; 17420 } 17421 /** 17422 * Returns basic movement properties for the gesture based on the next values and current state. 17423 */ 17424 ; 17425 17426 _proto.getMovement = function getMovement(values) { 17427 var rubberband = this.config.rubberband; 17428 var _this$state = this.state, 17429 _bounds = _this$state._bounds, 17430 _initial = _this$state._initial, 17431 _active = _this$state._active, 17432 wasIntentional = _this$state._intentional, 17433 lastOffset = _this$state.lastOffset, 17434 prevMovement = _this$state.movement, 17435 _T = _this$state._threshold; 17436 var M = this.getInternalMovement(values, this.state); 17437 var i0 = wasIntentional[0] === false ? getIntentionalDisplacement(M[0], _T[0]) : wasIntentional[0]; 17438 var i1 = wasIntentional[1] === false ? getIntentionalDisplacement(M[1], _T[1]) : wasIntentional[1]; // Get gesture specific state properties based on intentionality and movement. 17439 17440 var intentionalityCheck = this.checkIntentionality([i0, i1], M); 17441 17442 if (intentionalityCheck._blocked) { 17443 return _extends({}, intentionalityCheck, { 17444 _movement: M, 17445 delta: [0, 0] 17446 }); 17447 } 17448 17449 var _intentional = intentionalityCheck._intentional; 17450 var _movement = M; 17451 /** 17452 * The movement sent to the handler has 0 in its dimensions when intentionality is false. 17453 * It is calculated from the actual movement minus the threshold. 17454 */ 17455 17456 var movement = [_intentional[0] !== false ? M[0] - _intentional[0] : 0, _intentional[1] !== false ? M[1] - _intentional[1] : 0]; 17457 var offset = addV(movement, lastOffset); 17458 /** 17459 * Rubberband should be 0 when the gesture is no longer active, so that movement 17460 * and offset can return within their bounds. 17461 */ 17462 17463 var _rubberband = _active ? rubberband : [0, 0]; 17464 17465 movement = computeRubberband(_bounds, addV(movement, _initial), _rubberband); 17466 return _extends({}, intentionalityCheck, { 17467 intentional: _intentional[0] !== false || _intentional[1] !== false, 17468 _initial: _initial, 17469 _movement: _movement, 17470 movement: movement, 17471 values: values, 17472 offset: computeRubberband(_bounds, offset, _rubberband), 17473 delta: subV(movement, prevMovement) 17474 }); 17475 } // Cleans the gesture. Can be overriden by gestures. 17476 ; 17477 17478 _proto.clean = function clean() { 17479 this.clearTimeout(); 17480 }; 17481 17482 _createClass(Recognizer, [{ 17483 key: "config", 17484 get: function get() { 17485 return this.controller.config[this.stateKey]; 17486 } // Is the gesture enabled 17487 17488 }, { 17489 key: "enabled", 17490 get: function get() { 17491 return this.controller.config.enabled && this.config.enabled; 17492 } // Returns the controller state for a given gesture 17493 17494 }, { 17495 key: "state", 17496 get: function get() { 17497 return this.controller.state[this.stateKey]; 17498 } // Returns the gesture handler 17499 17500 }, { 17501 key: "handler", 17502 get: function get() { 17503 return this.controller.handlers[this.stateKey]; 17504 } 17505 }, { 17506 key: "transform", 17507 get: function get() { 17508 return this.config.transform || this.controller.config.transform || identity$1; 17509 } 17510 }]); 17511 17512 return Recognizer; 17513 }(); //-------------------------------------------- 17514 17515 function getIntentionalDisplacement(movement, threshold) { 17516 if (Math.abs(movement) >= threshold) { 17517 return sign(movement) * threshold; 17518 } else { 17519 return false; 17520 } 17521 } 17522 17523 function computeRubberband(bounds, _ref, _ref2) { 17524 var Vx = _ref[0], 17525 Vy = _ref[1]; 17526 var Rx = _ref2[0], 17527 Ry = _ref2[1]; 17528 var _bounds$ = bounds[0], 17529 X1 = _bounds$[0], 17530 X2 = _bounds$[1], 17531 _bounds$2 = bounds[1], 17532 Y1 = _bounds$2[0], 17533 Y2 = _bounds$2[1]; 17534 return [rubberbandIfOutOfBounds(Vx, X1, X2, Rx), rubberbandIfOutOfBounds(Vy, Y1, Y2, Ry)]; 17535 } 17536 /** 17537 * Returns a generic, common payload for all gestures from an event. 17538 */ 17539 17540 17541 function getGenericPayload(_ref3, event, isStartEvent) { 17542 var state = _ref3.state; 17543 var timeStamp = event.timeStamp, 17544 _lastEventType = event.type; 17545 var previous = state.values; 17546 var elapsedTime = isStartEvent ? 0 : timeStamp - state.startTime; 17547 return { 17548 _lastEventType: _lastEventType, 17549 event: event, 17550 timeStamp: timeStamp, 17551 elapsedTime: elapsedTime, 17552 previous: previous 17553 }; 17554 } 17555 /** 17556 * Returns the reinitialized start state for the gesture. 17557 * Should be common to all gestures. 17558 */ 17559 17560 function getStartGestureState(_ref4, values, event, initial) { 17561 var state = _ref4.state, 17562 config = _ref4.config, 17563 stateKey = _ref4.stateKey, 17564 args = _ref4.args, 17565 transform = _ref4.transform; 17566 var offset = state.offset; 17567 var startTime = event.timeStamp; 17568 var initialFn = config.initial, 17569 bounds = config.bounds, 17570 threshold = config.threshold; // the _threshold is the difference between a [0,0] offset converted to 17571 // its new space coordinates 17572 17573 var _threshold = subV(transform(threshold), transform([0, 0])).map(Math.abs); 17574 17575 var _state = _extends({}, getInitialState()[stateKey], { 17576 _active: true, 17577 args: args, 17578 values: values, 17579 initial: initial != null ? initial : values, 17580 _threshold: _threshold, 17581 offset: offset, 17582 lastOffset: offset, 17583 startTime: startTime 17584 }); 17585 17586 return _extends({}, _state, { 17587 _initial: valueFn(initialFn, _state), 17588 _bounds: valueFn(bounds, _state) 17589 }); 17590 } 17591 17592 /** 17593 * The controller will keep track of the state for all gestures and also keep 17594 * track of timeouts, and window listeners. 17595 */ 17596 17597 var Controller = function Controller(classes) { 17598 var _this = this; 17599 17600 this.classes = classes; 17601 this.pointerIds = new Set(); // register Pointer Events pointerIds 17602 17603 this.touchIds = new Set(); // register Touch Events identifiers 17604 17605 this.supportsTouchEvents = supportsTouchEvents(); 17606 this.supportsGestureEvents = supportsGestureEvents(); 17607 17608 this.bind = function () { 17609 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 17610 args[_key] = arguments[_key]; 17611 } 17612 17613 var bindings = {}; 17614 17615 for (var _iterator = _createForOfIteratorHelperLoose(_this.classes), _step; !(_step = _iterator()).done;) { 17616 var RecognizerClass = _step.value; 17617 new RecognizerClass(_this, args).addBindings(bindings); 17618 } // // we also add event bindings for native handlers 17619 17620 17621 var _loop = function _loop(eventKey) { 17622 addBindings(bindings, eventKey, function (event) { 17623 return _this.nativeRefs[eventKey](_extends({}, _this.state.shared, { 17624 event: event, 17625 args: args 17626 })); 17627 }); 17628 }; 17629 17630 for (var eventKey in _this.nativeRefs) { 17631 _loop(eventKey); 17632 } 17633 17634 if (_this.config.domTarget) { 17635 // If config.domTarget is set we add event listeners to it and return the clean function. 17636 return updateDomListeners(_this, bindings); 17637 } else { 17638 // If not, we return an object that contains gesture handlers mapped to react handler event keys. 17639 return getPropsListener(_this, bindings); 17640 } 17641 }; 17642 17643 this.effect = function () { 17644 if (_this.config.domTarget) _this.bind(); 17645 return _this.clean; 17646 }; 17647 /** 17648 * Function ran on component unmount: cleans timeouts and removes dom listeners set by the bind function. 17649 */ 17650 17651 17652 this.clean = function () { 17653 var domTarget = getDomTargetFromConfig(_this.config); 17654 var eventOptions = _this.config.eventOptions; 17655 if (domTarget) removeListeners(domTarget, takeAll(_this.domListeners), eventOptions); 17656 Object.values(_this.timeouts).forEach(clearTimeout); 17657 clearAllWindowListeners(_this); 17658 }; 17659 17660 this.classes = classes; 17661 this.state = getInitialState(); 17662 this.timeouts = {}; 17663 this.domListeners = []; 17664 this.windowListeners = {}; 17665 }; 17666 function addEventIds(controller, event) { 17667 if ('pointerId' in event) { 17668 controller.pointerIds.add(event.pointerId); 17669 } else { 17670 controller.touchIds = new Set(getTouchIds(event)); 17671 } 17672 } 17673 function removeEventIds(controller, event) { 17674 if ('pointerId' in event) { 17675 controller.pointerIds["delete"](event.pointerId); 17676 } else { 17677 getTouchIds(event).forEach(function (id) { 17678 return controller.touchIds["delete"](id); 17679 }); 17680 } 17681 } 17682 function clearAllWindowListeners(controller) { 17683 var _controller$config = controller.config, 17684 el = _controller$config.window, 17685 eventOptions = _controller$config.eventOptions, 17686 windowListeners = controller.windowListeners; 17687 if (!el) return; 17688 17689 for (var stateKey in windowListeners) { 17690 var handlers = windowListeners[stateKey]; 17691 removeListeners(el, handlers, eventOptions); 17692 } 17693 17694 controller.windowListeners = {}; 17695 } 17696 function clearWindowListeners(_ref, stateKey, options) { 17697 var config = _ref.config, 17698 windowListeners = _ref.windowListeners; 17699 17700 if (options === void 0) { 17701 options = config.eventOptions; 17702 } 17703 17704 if (!config.window) return; 17705 removeListeners(config.window, windowListeners[stateKey], options); 17706 delete windowListeners[stateKey]; 17707 } 17708 function updateWindowListeners(_ref2, stateKey, listeners, options) { 17709 var config = _ref2.config, 17710 windowListeners = _ref2.windowListeners; 17711 17712 if (listeners === void 0) { 17713 listeners = []; 17714 } 17715 17716 if (options === void 0) { 17717 options = config.eventOptions; 17718 } 17719 17720 if (!config.window) return; 17721 removeListeners(config.window, windowListeners[stateKey], options); 17722 addListeners(config.window, windowListeners[stateKey] = listeners, options); 17723 } 17724 17725 function updateDomListeners(_ref3, bindings) { 17726 var config = _ref3.config, 17727 domListeners = _ref3.domListeners; 17728 var domTarget = getDomTargetFromConfig(config); 17729 if (!domTarget) throw new Error('domTarget must be defined'); 17730 var eventOptions = config.eventOptions; 17731 removeListeners(domTarget, takeAll(domListeners), eventOptions); 17732 17733 for (var _i = 0, _Object$entries = Object.entries(bindings); _i < _Object$entries.length; _i++) { 17734 var _Object$entries$_i = _Object$entries[_i], 17735 key = _Object$entries$_i[0], 17736 fns = _Object$entries$_i[1]; 17737 var name = key.slice(2).toLowerCase(); 17738 domListeners.push([name, chainFns.apply(void 0, fns)]); 17739 } 17740 17741 addListeners(domTarget, domListeners, eventOptions); 17742 } 17743 17744 function getPropsListener(_ref4, bindings) { 17745 var config = _ref4.config; 17746 var props = {}; 17747 var captureString = config.eventOptions.capture ? 'Capture' : ''; 17748 17749 for (var _i2 = 0, _Object$entries2 = Object.entries(bindings); _i2 < _Object$entries2.length; _i2++) { 17750 var _Object$entries2$_i = _Object$entries2[_i2], 17751 event = _Object$entries2$_i[0], 17752 fns = _Object$entries2$_i[1]; 17753 var fnsArray = Array.isArray(fns) ? fns : [fns]; 17754 var key = event + captureString; 17755 props[key] = chainFns.apply(void 0, fnsArray); 17756 } 17757 17758 return props; 17759 } 17760 17761 function takeAll(array) { 17762 if (array === void 0) { 17763 array = []; 17764 } 17765 17766 return array.splice(0, array.length); 17767 } 17768 17769 function getDomTargetFromConfig(_ref5) { 17770 var domTarget = _ref5.domTarget; 17771 return domTarget && 'current' in domTarget ? domTarget.current : domTarget; 17772 } 17773 /** 17774 * bindings is an object which keys match ReactEventHandlerKeys. 17775 * Since a recognizer might want to bind a handler function to an event key already used by a previously 17776 * added recognizer, we need to make sure that each event key is an array of all the functions mapped for 17777 * that key. 17778 */ 17779 17780 17781 function addBindings(bindings, name, fn) { 17782 if (!bindings[name]) bindings[name] = []; 17783 bindings[name].push(fn); 17784 } 17785 17786 function addListeners(el, listeners, options) { 17787 if (listeners === void 0) { 17788 listeners = []; 17789 } 17790 17791 if (options === void 0) { 17792 options = {}; 17793 } 17794 17795 for (var _iterator2 = _createForOfIteratorHelperLoose(listeners), _step2; !(_step2 = _iterator2()).done;) { 17796 var _step2$value = _step2.value, 17797 eventName = _step2$value[0], 17798 eventHandler = _step2$value[1]; 17799 el.addEventListener(eventName, eventHandler, options); 17800 } 17801 } 17802 17803 function removeListeners(el, listeners, options) { 17804 if (listeners === void 0) { 17805 listeners = []; 17806 } 17807 17808 if (options === void 0) { 17809 options = {}; 17810 } 17811 17812 for (var _iterator3 = _createForOfIteratorHelperLoose(listeners), _step3; !(_step3 = _iterator3()).done;) { 17813 var _step3$value = _step3.value, 17814 eventName = _step3$value[0], 17815 eventHandler = _step3$value[1]; 17816 el.removeEventListener(eventName, eventHandler, options); 17817 } 17818 } 17819 17820 /* eslint-disable react-hooks/exhaustive-deps */ 17821 /** 17822 * Utility hook called by all gesture hooks and that will be responsible for the internals. 17823 * 17824 * @param handlers 17825 * @param classes 17826 * @param config 17827 * @param nativeHandlers - native handlers such as onClick, onMouseDown, etc. 17828 */ 17829 17830 function useRecognizers(handlers, config, nativeHandlers) { 17831 if (nativeHandlers === void 0) { 17832 nativeHandlers = {}; 17833 } 17834 17835 var classes = resolveClasses(handlers); 17836 var controller = external_React_default.a.useMemo(function () { 17837 return new Controller(classes); 17838 }, []); 17839 controller.config = config; 17840 controller.handlers = handlers; 17841 controller.nativeRefs = nativeHandlers; 17842 external_React_default.a.useEffect(controller.effect, []); // @ts-ignore 17843 17844 if (controller.config.domTarget) return deprecationNoticeForDomTarget; // @ts-ignore 17845 17846 return controller.bind; 17847 } 17848 17849 function deprecationNoticeForDomTarget() { 17850 if (false) {} 17851 } 17852 17853 function resolveClasses(internalHandlers) { 17854 var classes = new Set(); 17855 if (internalHandlers.drag) classes.add(RecognizersMap.get('drag')); 17856 if (internalHandlers.wheel) classes.add(RecognizersMap.get('wheel')); 17857 if (internalHandlers.scroll) classes.add(RecognizersMap.get('scroll')); 17858 if (internalHandlers.move) classes.add(RecognizersMap.get('move')); 17859 if (internalHandlers.pinch) classes.add(RecognizersMap.get('pinch')); 17860 if (internalHandlers.hover) classes.add(RecognizersMap.get('hover')); 17861 return classes; 17862 } 17863 17864 /** 17865 * @private 17866 * Abstract class for coordinates-based gesture recongizers 17867 */ 17868 17869 var CoordinatesRecognizer = /*#__PURE__*/function (_Recognizer) { 17870 reactusegesture_esm_inheritsLoose(CoordinatesRecognizer, _Recognizer); 17871 17872 function CoordinatesRecognizer() { 17873 return _Recognizer.apply(this, arguments) || this; 17874 } 17875 17876 var _proto = CoordinatesRecognizer.prototype; 17877 17878 /** 17879 * Returns the real movement (without taking intentionality into account) 17880 */ 17881 _proto.getInternalMovement = function getInternalMovement(values, state) { 17882 return subV(values, state.initial); 17883 } 17884 /** 17885 * In coordinates-based gesture, this function will detect the first intentional axis, 17886 * lock the gesture axis if lockDirection is specified in the config, block the gesture 17887 * if the first intentional axis doesn't match the specified axis in config. 17888 */ 17889 ; 17890 17891 _proto.checkIntentionality = function checkIntentionality(_intentional, _movement) { 17892 if (_intentional[0] === false && _intentional[1] === false) { 17893 return { 17894 _intentional: _intentional, 17895 axis: this.state.axis 17896 }; 17897 } 17898 17899 var _movement$map = _movement.map(Math.abs), 17900 absX = _movement$map[0], 17901 absY = _movement$map[1]; 17902 17903 var axis = this.state.axis || (absX > absY ? 'x' : absX < absY ? 'y' : undefined); 17904 if (!this.config.axis && !this.config.lockDirection) return { 17905 _intentional: _intentional, 17906 _blocked: false, 17907 axis: axis 17908 }; 17909 if (!axis) return { 17910 _intentional: [false, false], 17911 _blocked: false, 17912 axis: axis 17913 }; 17914 if (!!this.config.axis && axis !== this.config.axis) return { 17915 _intentional: _intentional, 17916 _blocked: true, 17917 axis: axis 17918 }; 17919 _intentional[axis === 'x' ? 1 : 0] = false; 17920 return { 17921 _intentional: _intentional, 17922 _blocked: false, 17923 axis: axis 17924 }; 17925 }; 17926 17927 _proto.getKinematics = function getKinematics(values, event) { 17928 var state = this.getMovement(values); 17929 17930 if (!state._blocked) { 17931 var dt = event.timeStamp - this.state.timeStamp; 17932 Object.assign(state, calculateAllKinematics(state.movement, state.delta, dt)); 17933 } 17934 17935 return state; 17936 }; 17937 17938 _proto.mapStateValues = function mapStateValues(state) { 17939 return { 17940 xy: state.values, 17941 vxvy: state.velocities 17942 }; 17943 }; 17944 17945 return CoordinatesRecognizer; 17946 }(Recognizer); 17947 17948 var TAP_DISTANCE_THRESHOLD = 3; 17949 17950 function persistEvent(event) { 17951 'persist' in event && typeof event.persist === 'function' && event.persist(); 17952 } 17953 17954 var DragRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { 17955 reactusegesture_esm_inheritsLoose(DragRecognizer, _CoordinatesRecognize); 17956 17957 function DragRecognizer() { 17958 var _this; 17959 17960 _this = _CoordinatesRecognize.apply(this, arguments) || this; 17961 _this.ingKey = 'dragging'; 17962 _this.stateKey = 'drag'; // TODO add back when setPointerCapture is widely wupported 17963 // https://caniuse.com/#search=setPointerCapture 17964 17965 _this.setPointerCapture = function (event) { 17966 // don't perform pointere capture when user wants to use touch events or 17967 // when a pointerLockElement exists as this would throw an error 17968 if (_this.config.useTouch || document.pointerLockElement) return; 17969 var target = event.target, 17970 pointerId = event.pointerId; 17971 17972 if (target && 'setPointerCapture' in target) { 17973 // this would work in the DOM but doesn't with react three fiber 17974 // target.addEventListener('pointermove', this.onDragChange, this.controller.config.eventOptions) 17975 // @ts-expect-error 17976 target.setPointerCapture(pointerId); 17977 } 17978 17979 _this.updateGestureState({ 17980 _dragTarget: target, 17981 _dragPointerId: pointerId 17982 }); 17983 }; 17984 17985 _this.releasePointerCapture = function () { 17986 if (_this.config.useTouch || document.pointerLockElement) return; 17987 var _this$state = _this.state, 17988 _dragTarget = _this$state._dragTarget, 17989 _dragPointerId = _this$state._dragPointerId; 17990 17991 if (_dragPointerId && _dragTarget && 'releasePointerCapture' in _dragTarget) { 17992 // this would work in the DOM but doesn't with react three fiber 17993 // target.removeEventListener('pointermove', this.onDragChange, this.controller.config.eventOptions) 17994 if (!('hasPointerCapture' in _dragTarget) || _dragTarget.hasPointerCapture(_dragPointerId)) try { 17995 _dragTarget.releasePointerCapture(_dragPointerId); 17996 } catch (e) {} 17997 } 17998 }; 17999 18000 _this.preventScroll = function (event) { 18001 if (_this.state._dragPreventScroll && event.cancelable) { 18002 event.preventDefault(); 18003 } 18004 }; 18005 18006 _this.getEventId = function (event) { 18007 if (_this.config.useTouch) return event.changedTouches[0].identifier; 18008 return event.pointerId; 18009 }; 18010 18011 _this.isValidEvent = function (event) { 18012 // if we were using pointer events only event.isPrimary === 1 would suffice 18013 return _this.state._pointerId === _this.getEventId(event); 18014 }; 18015 18016 _this.shouldPreventWindowScrollY = _this.config.experimental_preventWindowScrollY && _this.controller.supportsTouchEvents; 18017 18018 _this.setUpWindowScrollDetection = function (event) { 18019 persistEvent(event); // we add window listeners that will prevent the scroll when the user has started dragging 18020 18021 updateWindowListeners(_this.controller, _this.stateKey, [['touchmove', _this.preventScroll], ['touchend', _this.clean.bind(_assertThisInitialized(_this))], ['touchcancel', _this.clean.bind(_assertThisInitialized(_this))]], { 18022 passive: false 18023 }); 18024 18025 _this.setTimeout(_this.startDrag.bind(_assertThisInitialized(_this)), 250, event); 18026 }; 18027 18028 _this.setUpDelayedDragTrigger = function (event) { 18029 _this.state._dragDelayed = true; 18030 persistEvent(event); 18031 18032 _this.setTimeout(_this.startDrag.bind(_assertThisInitialized(_this)), _this.config.delay, event); 18033 }; 18034 18035 _this.setStartState = function (event) { 18036 var values = getPointerEventValues(event, _this.transform); 18037 18038 _this.updateSharedState(getGenericEventData(event)); 18039 18040 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), { 18041 _pointerId: _this.getEventId(event) 18042 })); 18043 18044 _this.updateGestureState(_this.getMovement(values)); 18045 }; 18046 18047 _this.onDragStart = function (event) { 18048 addEventIds(_this.controller, event); 18049 if (!_this.enabled || _this.state._active) return; 18050 18051 _this.setStartState(event); 18052 18053 _this.setPointerCapture(event); 18054 18055 if (_this.shouldPreventWindowScrollY) _this.setUpWindowScrollDetection(event);else if (_this.config.delay > 0) _this.setUpDelayedDragTrigger(event);else _this.startDrag(event, true); // we pass the values to the startDrag event 18056 }; 18057 18058 _this.onDragChange = function (event) { 18059 if ( // if the gesture was canceled or 18060 _this.state.canceled || // if onDragStart wasn't fired or 18061 !_this.state._active || // if the event pointerId doesn't match the one that initiated the drag 18062 !_this.isValidEvent(event) || // if the event has the same timestamp as the previous event 18063 // note that checking type equality is ONLY for tests ¯\_(ツ)_/¯ 18064 _this.state._lastEventType === event.type && event.timeStamp === _this.state.timeStamp) return; 18065 var values; 18066 18067 if (document.pointerLockElement) { 18068 var movementX = event.movementX, 18069 movementY = event.movementY; 18070 values = addV(_this.transform([movementX, movementY]), _this.state.values); 18071 } else values = getPointerEventValues(event, _this.transform); 18072 18073 var kinematics = _this.getKinematics(values, event); // if startDrag hasn't fired 18074 18075 18076 if (!_this.state._dragStarted) { 18077 // If the gesture isn't active then respond to the event only if 18078 // it's been delayed via the `delay` option, in which case start 18079 // the gesture immediately. 18080 if (_this.state._dragDelayed) { 18081 _this.startDrag(event); 18082 18083 return; 18084 } // if the user wants to prevent vertical window scroll when user starts dragging 18085 18086 18087 if (_this.shouldPreventWindowScrollY) { 18088 if (!_this.state._dragPreventScroll && kinematics.axis) { 18089 // if the user is dragging horizontally then we should allow the drag 18090 if (kinematics.axis === 'x') { 18091 _this.startDrag(event); 18092 } else { 18093 _this.state._active = false; 18094 return; 18095 } 18096 } else return; 18097 } else return; 18098 } 18099 18100 var genericEventData = getGenericEventData(event); 18101 18102 _this.updateSharedState(genericEventData); 18103 18104 var genericPayload = getGenericPayload(_assertThisInitialized(_this), event); // This verifies if the drag can be assimilated to a tap by checking 18105 // if the real distance of the drag (ie not accounting for the threshold) is 18106 // greater than the TAP_DISTANCE_THRESHOLD. 18107 18108 var realDistance = calculateDistance(kinematics._movement); 18109 var _dragIsTap = _this.state._dragIsTap; 18110 if (_dragIsTap && realDistance >= TAP_DISTANCE_THRESHOLD) _dragIsTap = false; 18111 18112 _this.updateGestureState(_extends({}, genericPayload, kinematics, { 18113 _dragIsTap: _dragIsTap 18114 })); 18115 18116 _this.fireGestureHandler(); 18117 }; 18118 18119 _this.onDragEnd = function (event) { 18120 removeEventIds(_this.controller, event); // if the event pointerId doesn't match the one that initiated the drag 18121 // we don't want to end the drag 18122 18123 if (!_this.isValidEvent(event)) return; 18124 18125 _this.clean(); // if the gesture is no longer active (ie canceled) 18126 // don't do anything 18127 18128 18129 if (!_this.state._active) return; 18130 _this.state._active = false; 18131 var tap = _this.state._dragIsTap; 18132 var _this$state$velocitie = _this.state.velocities, 18133 vx = _this$state$velocitie[0], 18134 vy = _this$state$velocitie[1]; 18135 var _this$state$movement = _this.state.movement, 18136 mx = _this$state$movement[0], 18137 my = _this$state$movement[1]; 18138 var _this$state$_intentio = _this.state._intentional, 18139 ix = _this$state$_intentio[0], 18140 iy = _this$state$_intentio[1]; 18141 var _this$config$swipeVel = _this.config.swipeVelocity, 18142 svx = _this$config$swipeVel[0], 18143 svy = _this$config$swipeVel[1]; 18144 var _this$config$swipeDis = _this.config.swipeDistance, 18145 sx = _this$config$swipeDis[0], 18146 sy = _this$config$swipeDis[1]; 18147 var sd = _this.config.swipeDuration; 18148 18149 var endState = _extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values)); 18150 18151 var swipe = [0, 0]; 18152 18153 if (endState.elapsedTime < sd) { 18154 if (ix !== false && Math.abs(vx) > svx && Math.abs(mx) > sx) swipe[0] = sign(vx); 18155 if (iy !== false && Math.abs(vy) > svy && Math.abs(my) > sy) swipe[1] = sign(vy); 18156 } 18157 18158 _this.updateSharedState({ 18159 buttons: 0 18160 }); 18161 18162 _this.updateGestureState(_extends({}, endState, { 18163 tap: tap, 18164 swipe: swipe 18165 })); 18166 18167 _this.fireGestureHandler(_this.config.filterTaps && tap === true); 18168 }; 18169 18170 _this.clean = function () { 18171 _CoordinatesRecognize.prototype.clean.call(_assertThisInitialized(_this)); 18172 18173 _this.state._dragStarted = false; 18174 18175 _this.releasePointerCapture(); 18176 18177 clearWindowListeners(_this.controller, _this.stateKey); 18178 }; 18179 18180 _this.onCancel = function () { 18181 if (_this.state.canceled) return; 18182 18183 _this.updateGestureState({ 18184 canceled: true, 18185 _active: false 18186 }); 18187 18188 _this.updateSharedState({ 18189 buttons: 0 18190 }); 18191 18192 setTimeout(function () { 18193 return _this.fireGestureHandler(); 18194 }, 0); 18195 }; 18196 18197 _this.onClick = function (event) { 18198 if (!_this.state._dragIsTap) event.stopPropagation(); 18199 }; 18200 18201 return _this; 18202 } 18203 18204 var _proto = DragRecognizer.prototype; 18205 18206 _proto.startDrag = function startDrag(event, onDragIsStart) { 18207 if (onDragIsStart === void 0) { 18208 onDragIsStart = false; 18209 } 18210 18211 // startDrag can happen after a timeout, so we need to check if the gesture is still active 18212 // as the user might have lift up the pointer in between. 18213 if ( // if the gesture isn't active (probably means) 18214 !this.state._active || // if the drag has already started we should ignore subsequent attempts 18215 this.state._dragStarted) return; 18216 if (!onDragIsStart) this.setStartState(event); 18217 this.updateGestureState({ 18218 _dragStarted: true, 18219 _dragPreventScroll: true, 18220 cancel: this.onCancel 18221 }); 18222 this.clearTimeout(); 18223 this.fireGestureHandler(); 18224 }; 18225 18226 _proto.addBindings = function addBindings$1(bindings) { 18227 if (this.config.useTouch) { 18228 addBindings(bindings, 'onTouchStart', this.onDragStart); 18229 18230 addBindings(bindings, 'onTouchMove', this.onDragChange); // this is needed for react-three-fiber 18231 18232 18233 addBindings(bindings, 'onTouchEnd', this.onDragEnd); 18234 18235 addBindings(bindings, 'onTouchCancel', this.onDragEnd); 18236 } else { 18237 addBindings(bindings, 'onPointerDown', this.onDragStart); 18238 18239 addBindings(bindings, 'onPointerMove', this.onDragChange); // this is needed for react-three-fiber 18240 18241 18242 addBindings(bindings, 'onPointerUp', this.onDragEnd); 18243 18244 addBindings(bindings, 'onPointerCancel', this.onDragEnd); 18245 } 18246 18247 if (this.config.filterTaps) { 18248 var handler = this.controller.config.eventOptions.capture ? 'onClick' : 'onClickCapture'; 18249 18250 addBindings(bindings, handler, this.onClick); 18251 } 18252 }; 18253 18254 return DragRecognizer; 18255 }(CoordinatesRecognizer); 18256 18257 /** 18258 * Inlined from https://github.com/alexreardon/memoize-one 18259 */ 18260 function memoizeOne(resultFn, isEqual) { 18261 var lastThis; 18262 var lastArgs = []; 18263 var lastResult; 18264 var calledOnce = false; 18265 18266 function memoized() { 18267 for (var _len = arguments.length, newArgs = new Array(_len), _key = 0; _key < _len; _key++) { 18268 newArgs[_key] = arguments[_key]; 18269 } 18270 18271 if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) { 18272 return lastResult; 18273 } 18274 18275 lastResult = resultFn.apply(this, newArgs); 18276 calledOnce = true; 18277 lastThis = this; 18278 lastArgs = newArgs; 18279 return lastResult; 18280 } 18281 18282 return memoized; 18283 } 18284 18285 /** 18286 * Taken from https://github.com/FormidableLabs/react-fast-compare 18287 * 18288 * Dropped comments and ArrayBuffer handling 18289 */ 18290 function equal(a, b) { 18291 if (a === b) return true; 18292 18293 if (a && b && typeof a == 'object' && typeof b == 'object') { 18294 if (a.constructor !== b.constructor) return false; 18295 var length, i, keys; 18296 18297 if (Array.isArray(a)) { 18298 length = a.length; 18299 if (length !== b.length) return false; 18300 18301 for (i = length; i-- !== 0;) { 18302 if (!equal(a[i], b[i])) return false; 18303 } 18304 18305 return true; 18306 } 18307 18308 var it; 18309 18310 if (typeof Map === 'function' && a instanceof Map && b instanceof Map) { 18311 if (a.size !== b.size) return false; 18312 it = a.entries(); 18313 18314 while (!(i = it.next()).done) { 18315 if (!b.has(i.value[0])) return false; 18316 } 18317 18318 it = a.entries(); 18319 18320 while (!(i = it.next()).done) { 18321 if (!equal(i.value[1], b.get(i.value[0]))) return false; 18322 } 18323 18324 return true; 18325 } 18326 18327 if (typeof Set === 'function' && a instanceof Set && b instanceof Set) { 18328 if (a.size !== b.size) return false; 18329 it = a.entries(); 18330 18331 while (!(i = it.next()).done) { 18332 if (!b.has(i.value[0])) return false; 18333 } 18334 18335 return true; 18336 } 18337 18338 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 18339 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 18340 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 18341 keys = Object.keys(a); 18342 length = keys.length; 18343 if (length !== Object.keys(b).length) return false; 18344 18345 for (i = length; i-- !== 0;) { 18346 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 18347 } 18348 18349 if (typeof Element !== 'undefined' && a instanceof Element) return false; 18350 18351 for (i = length; i-- !== 0;) { 18352 if (keys[i] === '_owner' && a.$$typeof) continue; 18353 if (!equal(a[keys[i]], b[keys[i]])) return false; 18354 } 18355 18356 return true; 18357 } // true if both NaN, false otherwise — NaN !== NaN → true 18358 // eslint-disable-next-line no-self-compare 18359 18360 18361 return a !== a && b !== b; 18362 } 18363 18364 function isEqual(a, b) { 18365 try { 18366 return equal(a, b); 18367 } catch (error) { 18368 if ((error.message || '').match(/stack|recursion/i)) { 18369 // eslint-disable-next-line no-console 18370 console.warn('react-fast-compare cannot handle circular refs'); 18371 return false; 18372 } 18373 18374 throw error; 18375 } 18376 } 18377 18378 /** 18379 * Drag hook. 18380 * 18381 * @param handler - the function fired every time the drag gesture updates 18382 * @param [config={}] - the config object including generic options and drag options 18383 */ 18384 18385 function useDrag(handler, config) { 18386 if (config === void 0) { 18387 config = {}; 18388 } 18389 18390 RecognizersMap.set('drag', DragRecognizer); 18391 var buildDragConfig = Object(external_React_["useRef"])(); 18392 18393 if (!buildDragConfig.current) { 18394 buildDragConfig.current = memoizeOne(_buildDragConfig, isEqual); 18395 } 18396 18397 return useRecognizers({ 18398 drag: handler 18399 }, buildDragConfig.current(config)); 18400 } 18401 18402 /** 18403 * @private 18404 * Abstract class for distance/angle-based gesture recongizers 18405 */ 18406 18407 var DistanceAngleRecognizer = /*#__PURE__*/function (_Recognizer) { 18408 reactusegesture_esm_inheritsLoose(DistanceAngleRecognizer, _Recognizer); 18409 18410 function DistanceAngleRecognizer() { 18411 return _Recognizer.apply(this, arguments) || this; 18412 } 18413 18414 var _proto = DistanceAngleRecognizer.prototype; 18415 18416 _proto.getInternalMovement = function getInternalMovement(values, state) { 18417 var prev_a = state.values[1]; // not be defined if ctrl+wheel is used for zoom only 18418 18419 var d = values[0], 18420 _values$ = values[1], 18421 a = _values$ === void 0 ? prev_a : _values$; 18422 var delta_a = a - prev_a; 18423 var next_turns = state.turns; 18424 if (Math.abs(delta_a) > 270) next_turns += sign(delta_a); 18425 return subV([d, a - 360 * next_turns], state.initial); 18426 }; 18427 18428 _proto.getKinematics = function getKinematics(values, event) { 18429 var state = this.getMovement(values); 18430 var turns = (values[1] - state._movement[1] - this.state.initial[1]) / 360; 18431 var dt = event.timeStamp - this.state.timeStamp; 18432 18433 var _calculateAllKinemati = calculateAllKinematics(state.movement, state.delta, dt), 18434 kinematics = _objectWithoutPropertiesLoose(_calculateAllKinemati, ["distance", "velocity"]); 18435 18436 return _extends({ 18437 turns: turns 18438 }, state, kinematics); 18439 }; 18440 18441 _proto.mapStateValues = function mapStateValues(state) { 18442 return { 18443 da: state.values, 18444 vdva: state.velocities 18445 }; 18446 }; 18447 18448 return DistanceAngleRecognizer; 18449 }(Recognizer); 18450 18451 var ZOOM_CONSTANT = 7; 18452 var WEBKIT_DISTANCE_SCALE_FACTOR = 260; 18453 var PinchRecognizer = /*#__PURE__*/function (_DistanceAngleRecogni) { 18454 reactusegesture_esm_inheritsLoose(PinchRecognizer, _DistanceAngleRecogni); 18455 18456 function PinchRecognizer() { 18457 var _this; 18458 18459 _this = _DistanceAngleRecogni.apply(this, arguments) || this; 18460 _this.ingKey = 'pinching'; 18461 _this.stateKey = 'pinch'; 18462 18463 _this.onPinchStart = function (event) { 18464 addEventIds(_this.controller, event); 18465 var touchIds = _this.controller.touchIds; 18466 if (!_this.enabled) return; 18467 18468 if (_this.state._active) { 18469 // check that the pointerIds that initiated the gesture 18470 // are still enabled. This is useful for when the page 18471 // loses track of the pointers (minifying gesture on iPad). 18472 if (_this.state._pointerIds.every(function (id) { 18473 return touchIds.has(id); 18474 })) return; // something was wrong with the pointers but we let it go. 18475 } // until we reach two fingers on the target don't react 18476 18477 18478 if (touchIds.size < 2) return; 18479 18480 var _pointerIds = Array.from(touchIds).slice(0, 2); 18481 18482 var _getTwoTouchesEventVa = getTwoTouchesEventValues(event, _pointerIds, _this.transform), 18483 values = _getTwoTouchesEventVa.values, 18484 origin = _getTwoTouchesEventVa.origin; 18485 18486 _this.updateSharedState(getGenericEventData(event)); 18487 18488 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), { 18489 _pointerIds: _pointerIds, 18490 cancel: _this.onCancel, 18491 origin: origin 18492 })); 18493 18494 _this.updateGestureState(_this.getMovement(values)); 18495 18496 _this.fireGestureHandler(); 18497 }; 18498 18499 _this.onPinchChange = function (event) { 18500 var _this$state = _this.state, 18501 canceled = _this$state.canceled, 18502 _active = _this$state._active; 18503 if (canceled || !_active || // if the event has the same timestamp as the previous event 18504 event.timeStamp === _this.state.timeStamp) return; 18505 var genericEventData = getGenericEventData(event); 18506 18507 _this.updateSharedState(genericEventData); 18508 18509 try { 18510 var _getTwoTouchesEventVa2 = getTwoTouchesEventValues(event, _this.state._pointerIds, _this.transform), 18511 values = _getTwoTouchesEventVa2.values, 18512 origin = _getTwoTouchesEventVa2.origin; 18513 18514 var kinematics = _this.getKinematics(values, event); 18515 18516 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), kinematics, { 18517 origin: origin 18518 })); 18519 18520 _this.fireGestureHandler(); 18521 } catch (e) { 18522 _this.onPinchEnd(event); 18523 } 18524 }; 18525 18526 _this.onPinchEnd = function (event) { 18527 removeEventIds(_this.controller, event); 18528 var pointerIds = getTouchIds(event); // if none of the lifted pointerIds is in the state pointerIds don't do anything 18529 18530 if (_this.state._pointerIds.every(function (id) { 18531 return !pointerIds.includes(id); 18532 })) return; 18533 18534 _this.clean(); 18535 18536 if (!_this.state._active) return; 18537 18538 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values), { 18539 _active: false 18540 })); 18541 18542 _this.fireGestureHandler(); 18543 }; 18544 18545 _this.onCancel = function () { 18546 if (_this.state.canceled) return; 18547 18548 _this.updateGestureState({ 18549 _active: false, 18550 canceled: true 18551 }); 18552 18553 setTimeout(function () { 18554 return _this.fireGestureHandler(); 18555 }, 0); 18556 }; 18557 /** 18558 * PINCH WITH WEBKIT GESTURES 18559 */ 18560 18561 18562 _this.onGestureStart = function (event) { 18563 if (!_this.enabled) return; 18564 event.preventDefault(); 18565 var values = getWebkitGestureEventValues(event, _this.transform); 18566 18567 _this.updateSharedState(getGenericEventData(event)); 18568 18569 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), { 18570 origin: [event.clientX, event.clientY], 18571 cancel: _this.onCancel 18572 })); 18573 18574 _this.updateGestureState(_this.getMovement(values)); 18575 18576 _this.fireGestureHandler(); 18577 }; 18578 18579 _this.onGestureChange = function (event) { 18580 var _this$state2 = _this.state, 18581 canceled = _this$state2.canceled, 18582 _active = _this$state2._active; 18583 if (canceled || !_active) return; 18584 event.preventDefault(); 18585 var genericEventData = getGenericEventData(event); 18586 18587 _this.updateSharedState(genericEventData); // this normalizes the values of the Safari's WebKitEvent by calculating 18588 // the delta and then multiplying it by a constant. 18589 18590 18591 var values = getWebkitGestureEventValues(event, _this.transform); 18592 values[0] = (values[0] - _this.state.event.scale) * WEBKIT_DISTANCE_SCALE_FACTOR + _this.state.values[0]; 18593 18594 var kinematics = _this.getKinematics(values, event); 18595 18596 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), kinematics, { 18597 origin: [event.clientX, event.clientY] 18598 })); 18599 18600 _this.fireGestureHandler(); 18601 }; 18602 18603 _this.onGestureEnd = function (event) { 18604 _this.clean(); 18605 18606 if (!_this.state._active) return; 18607 18608 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values), { 18609 _active: false, 18610 origin: [event.clientX, event.clientY] 18611 })); 18612 18613 _this.fireGestureHandler(); 18614 }; 18615 /** 18616 * PINCH WITH WHEEL 18617 */ 18618 18619 18620 _this.wheelShouldRun = function (event) { 18621 return _this.enabled && event.ctrlKey; 18622 }; 18623 18624 _this.getWheelValuesFromEvent = function (event) { 18625 var _getWheelEventValues = getWheelEventValues(event, _this.transform), 18626 delta_d = _getWheelEventValues[1]; 18627 18628 var _this$state$values = _this.state.values, 18629 prev_d = _this$state$values[0], 18630 prev_a = _this$state$values[1]; // ZOOM_CONSTANT is based on Safari trackpad natural zooming 18631 18632 var _delta_d = -delta_d * ZOOM_CONSTANT; // new distance is the previous state distance added to the delta 18633 18634 18635 var d = prev_d + _delta_d; 18636 var a = prev_a !== void 0 ? prev_a : 0; 18637 return { 18638 values: [d, a], 18639 origin: [event.clientX, event.clientY], 18640 delta: [_delta_d, a] 18641 }; 18642 }; 18643 18644 _this.onWheel = function (event) { 18645 if (!_this.wheelShouldRun(event)) return; 18646 18647 _this.setTimeout(_this.onWheelEnd); 18648 18649 if (!_this.state._active) _this.onWheelStart(event);else _this.onWheelChange(event); 18650 }; 18651 18652 _this.onWheelStart = function (event) { 18653 var _this$getWheelValuesF = _this.getWheelValuesFromEvent(event), 18654 values = _this$getWheelValuesF.values, 18655 delta = _this$getWheelValuesF.delta, 18656 origin = _this$getWheelValuesF.origin; 18657 18658 if (event.cancelable) event.preventDefault();else if (false) {} 18659 18660 _this.updateSharedState(getGenericEventData(event)); 18661 18662 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true), { 18663 offset: values, 18664 delta: delta, 18665 origin: origin 18666 })); 18667 18668 _this.updateGestureState(_this.getMovement(values)); 18669 18670 _this.fireGestureHandler(); 18671 }; 18672 18673 _this.onWheelChange = function (event) { 18674 if (event.cancelable) event.preventDefault(); 18675 18676 _this.updateSharedState(getGenericEventData(event)); 18677 18678 var _this$getWheelValuesF2 = _this.getWheelValuesFromEvent(event), 18679 values = _this$getWheelValuesF2.values, 18680 origin = _this$getWheelValuesF2.origin, 18681 delta = _this$getWheelValuesF2.delta; 18682 18683 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event), { 18684 origin: origin, 18685 delta: delta 18686 })); 18687 18688 _this.fireGestureHandler(); 18689 }; 18690 18691 _this.onWheelEnd = function () { 18692 _this.clean(); 18693 18694 if (!_this.state._active) return; 18695 _this.state._active = false; 18696 18697 _this.updateGestureState(_this.getMovement(_this.state.values)); 18698 18699 _this.fireGestureHandler(); 18700 }; 18701 18702 return _this; 18703 } 18704 18705 var _proto = PinchRecognizer.prototype; 18706 18707 _proto.addBindings = function addBindings$1(bindings) { 18708 // Only try to use gesture events when they are supported and domTarget is set 18709 // as React doesn't support gesture handlers. 18710 if (this.controller.config.domTarget && !this.controller.supportsTouchEvents && this.controller.supportsGestureEvents) { 18711 addBindings(bindings, 'onGestureStart', this.onGestureStart); 18712 18713 addBindings(bindings, 'onGestureChange', this.onGestureChange); 18714 18715 addBindings(bindings, 'onGestureEnd', this.onGestureEnd); 18716 } else { 18717 addBindings(bindings, 'onTouchStart', this.onPinchStart); 18718 18719 addBindings(bindings, 'onTouchMove', this.onPinchChange); 18720 18721 addBindings(bindings, 'onTouchEnd', this.onPinchEnd); 18722 18723 addBindings(bindings, 'onTouchCancel', this.onPinchEnd); 18724 18725 addBindings(bindings, 'onWheel', this.onWheel); 18726 } 18727 }; 18728 18729 return PinchRecognizer; 18730 }(DistanceAngleRecognizer); 18731 18732 /** 18733 * Pinch hook. 18734 * 18735 * @param handler - the function fired every time the pinch gesture updates 18736 * @param [config={}] - the config object including generic options and pinch options 18737 */ 18738 18739 function usePinch(handler, config) { 18740 if (config === void 0) { 18741 config = {}; 18742 } 18743 18744 RecognizersMap.set('pinch', PinchRecognizer); 18745 var buildPinchConfig = Object(external_React_["useRef"])(); 18746 18747 if (!buildPinchConfig.current) { 18748 buildPinchConfig.current = memoizeOne(_buildPinchConfig, isEqual); 18749 } 18750 18751 return useRecognizers({ 18752 pinch: handler 18753 }, buildPinchConfig.current(config)); 18754 } 18755 18756 var WheelRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { 18757 reactusegesture_esm_inheritsLoose(WheelRecognizer, _CoordinatesRecognize); 18758 18759 function WheelRecognizer() { 18760 var _this; 18761 18762 _this = _CoordinatesRecognize.apply(this, arguments) || this; 18763 _this.ingKey = 'wheeling'; 18764 _this.stateKey = 'wheel'; 18765 _this.debounced = true; 18766 18767 _this.handleEvent = function (event) { 18768 if (event.ctrlKey && 'pinch' in _this.controller.handlers) return; 18769 if (!_this.enabled) return; 18770 18771 _this.setTimeout(_this.onEnd); 18772 18773 _this.updateSharedState(getGenericEventData(event)); 18774 18775 var values = addV(getWheelEventValues(event, _this.transform), _this.state.values); 18776 18777 if (!_this.state._active) { 18778 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true))); 18779 18780 var movement = _this.getMovement(values); 18781 18782 var geometry = calculateAllGeometry(movement.delta); 18783 18784 _this.updateGestureState(movement); 18785 18786 _this.updateGestureState(geometry); 18787 } else { 18788 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event))); 18789 } 18790 18791 _this.fireGestureHandler(); 18792 }; 18793 18794 _this.onEnd = function () { 18795 _this.clean(); 18796 18797 if (!_this.state._active) return; 18798 18799 var movement = _this.getMovement(_this.state.values); 18800 18801 _this.updateGestureState(movement); 18802 18803 _this.updateGestureState({ 18804 _active: false, 18805 velocities: [0, 0], 18806 velocity: 0 18807 }); 18808 18809 _this.fireGestureHandler(); 18810 }; 18811 18812 return _this; 18813 } 18814 18815 var _proto = WheelRecognizer.prototype; 18816 18817 _proto.addBindings = function addBindings$1(bindings) { 18818 addBindings(bindings, 'onWheel', this.handleEvent); 18819 }; 18820 18821 return WheelRecognizer; 18822 }(CoordinatesRecognizer); 18823 18824 /** 18825 * Wheel hook. 18826 * 18827 * @param handler - the function fired every time the wheel gesture updates 18828 * @param the config object including generic options and wheel options 18829 */ 18830 18831 function useWheel(handler, config) { 18832 if (config === void 0) { 18833 config = {}; 18834 } 18835 18836 RecognizersMap.set('wheel', WheelRecognizer); 18837 var buildWheelConfig = Object(external_React_["useRef"])(); 18838 18839 if (!buildWheelConfig.current) { 18840 buildWheelConfig.current = memoizeOne(_buildWheelConfig, isEqual); 18841 } 18842 18843 return useRecognizers({ 18844 wheel: handler 18845 }, buildWheelConfig.current(config)); 18846 } 18847 18848 var MoveRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { 18849 reactusegesture_esm_inheritsLoose(MoveRecognizer, _CoordinatesRecognize); 18850 18851 function MoveRecognizer() { 18852 var _this; 18853 18854 _this = _CoordinatesRecognize.apply(this, arguments) || this; 18855 _this.ingKey = 'moving'; 18856 _this.stateKey = 'move'; 18857 _this.debounced = true; 18858 18859 _this.onMove = function (event) { 18860 if (!_this.enabled) return; 18861 18862 _this.setTimeout(_this.onMoveEnd); 18863 18864 if (!_this.state._active) _this.onMoveStart(event);else _this.onMoveChange(event); 18865 }; 18866 18867 _this.onMoveStart = function (event) { 18868 _this.updateSharedState(getGenericEventData(event)); 18869 18870 var values = getPointerEventValues(event, _this.transform); 18871 18872 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true))); 18873 18874 _this.updateGestureState(_this.getMovement(values)); 18875 18876 _this.fireGestureHandler(); 18877 }; 18878 18879 _this.onMoveChange = function (event) { 18880 _this.updateSharedState(getGenericEventData(event)); 18881 18882 var values = getPointerEventValues(event, _this.transform); 18883 18884 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event))); 18885 18886 _this.fireGestureHandler(); 18887 }; 18888 18889 _this.onMoveEnd = function () { 18890 _this.clean(); 18891 18892 if (!_this.state._active) return; 18893 var values = _this.state.values; 18894 18895 _this.updateGestureState(_this.getMovement(values)); 18896 18897 _this.updateGestureState({ 18898 velocities: [0, 0], 18899 velocity: 0, 18900 _active: false 18901 }); 18902 18903 _this.fireGestureHandler(); 18904 }; 18905 18906 _this.hoverTransform = function () { 18907 return _this.controller.config.hover.transform || _this.controller.config.transform; 18908 }; 18909 18910 _this.onPointerEnter = function (event) { 18911 _this.controller.state.shared.hovering = true; 18912 if (!_this.controller.config.enabled) return; 18913 18914 if (_this.controller.config.hover.enabled) { 18915 var values = getPointerEventValues(event, _this.hoverTransform()); 18916 18917 var state = _extends({}, _this.controller.state.shared, _this.state, getGenericPayload(_assertThisInitialized(_this), event, true), { 18918 args: _this.args, 18919 values: values, 18920 active: true, 18921 hovering: true 18922 }); 18923 18924 _this.controller.handlers.hover(_extends({}, state, _this.mapStateValues(state))); 18925 } 18926 18927 if ('move' in _this.controller.handlers) _this.onMoveStart(event); 18928 }; 18929 18930 _this.onPointerLeave = function (event) { 18931 _this.controller.state.shared.hovering = false; 18932 if ('move' in _this.controller.handlers) _this.onMoveEnd(); 18933 if (!_this.controller.config.hover.enabled) return; 18934 var values = getPointerEventValues(event, _this.hoverTransform()); 18935 18936 var state = _extends({}, _this.controller.state.shared, _this.state, getGenericPayload(_assertThisInitialized(_this), event), { 18937 args: _this.args, 18938 values: values, 18939 active: false 18940 }); 18941 18942 _this.controller.handlers.hover(_extends({}, state, _this.mapStateValues(state))); 18943 }; 18944 18945 return _this; 18946 } 18947 18948 var _proto = MoveRecognizer.prototype; 18949 18950 _proto.addBindings = function addBindings$1(bindings) { 18951 if ('move' in this.controller.handlers) { 18952 addBindings(bindings, 'onPointerMove', this.onMove); 18953 } 18954 18955 if ('hover' in this.controller.handlers) { 18956 addBindings(bindings, 'onPointerEnter', this.onPointerEnter); 18957 18958 addBindings(bindings, 'onPointerLeave', this.onPointerLeave); 18959 } 18960 }; 18961 18962 return MoveRecognizer; 18963 }(CoordinatesRecognizer); 18964 18965 /** 18966 * Move hook. 18967 * 18968 * @param handler - the function fired every time the move gesture updates 18969 * @param [config={}] - the config object including generic options and move options 18970 */ 18971 18972 function useMove(handler, config) { 18973 if (config === void 0) { 18974 config = {}; 18975 } 18976 18977 RecognizersMap.set('move', MoveRecognizer); 18978 var buildMoveConfig = Object(external_React_["useRef"])(); 18979 18980 if (!buildMoveConfig.current) { 18981 buildMoveConfig.current = memoizeOne(_buildMoveConfig, isEqual); 18982 } 18983 18984 return useRecognizers({ 18985 move: handler 18986 }, buildMoveConfig.current(config)); 18987 } 18988 18989 /** 18990 * Hover hook. 18991 * 18992 * @param handler - the function fired every time the hover gesture updates 18993 * @param [config={}] - the config object including generic options and hover options 18994 */ 18995 18996 function useHover(handler, config) { 18997 if (config === void 0) { 18998 config = {}; 18999 } 19000 19001 RecognizersMap.set('hover', MoveRecognizer); 19002 var buildHoverConfig = Object(external_React_["useRef"])(); 19003 19004 if (!buildHoverConfig.current) { 19005 buildHoverConfig.current = memoizeOne(_buildHoverConfig, isEqual); 19006 } 19007 19008 return useRecognizers({ 19009 hover: handler 19010 }, buildHoverConfig.current(config)); 19011 } 19012 19013 var ScrollRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { 19014 reactusegesture_esm_inheritsLoose(ScrollRecognizer, _CoordinatesRecognize); 19015 19016 function ScrollRecognizer() { 19017 var _this; 19018 19019 _this = _CoordinatesRecognize.apply(this, arguments) || this; 19020 _this.ingKey = 'scrolling'; 19021 _this.stateKey = 'scroll'; 19022 _this.debounced = true; 19023 19024 _this.handleEvent = function (event) { 19025 if (!_this.enabled) return; 19026 19027 _this.clearTimeout(); 19028 19029 _this.setTimeout(_this.onEnd); 19030 19031 var values = getScrollEventValues(event, _this.transform); 19032 19033 _this.updateSharedState(getGenericEventData(event)); 19034 19035 if (!_this.state._active) { 19036 _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true))); 19037 19038 var movementDetection = _this.getMovement(values); 19039 19040 var geometry = calculateAllGeometry(movementDetection.delta); 19041 19042 _this.updateGestureState(movementDetection); 19043 19044 _this.updateGestureState(geometry); 19045 } else { 19046 _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event))); 19047 } 19048 19049 _this.fireGestureHandler(); 19050 }; 19051 19052 _this.onEnd = function () { 19053 _this.clean(); 19054 19055 if (!_this.state._active) return; 19056 19057 _this.updateGestureState(_extends({}, _this.getMovement(_this.state.values), { 19058 _active: false, 19059 velocities: [0, 0], 19060 velocity: 0 19061 })); 19062 19063 _this.fireGestureHandler(); 19064 }; 19065 19066 return _this; 19067 } 19068 19069 var _proto = ScrollRecognizer.prototype; 19070 19071 _proto.addBindings = function addBindings$1(bindings) { 19072 addBindings(bindings, 'onScroll', this.handleEvent); 19073 }; 19074 19075 return ScrollRecognizer; 19076 }(CoordinatesRecognizer); 19077 19078 /** 19079 * Scroll hook. 19080 * 19081 * @param handler - the function fired every time the scroll gesture updates 19082 * @param [config={}] - the config object including generic options and scroll options 19083 */ 19084 19085 function useScroll(handler, config) { 19086 if (config === void 0) { 19087 config = {}; 19088 } 19089 19090 RecognizersMap.set('scroll', ScrollRecognizer); 19091 var buildScrollConfig = Object(external_React_["useRef"])(); 19092 19093 if (!buildScrollConfig.current) { 19094 buildScrollConfig.current = memoizeOne(_buildScrollConfig, isEqual); 19095 } 19096 19097 return useRecognizers({ 19098 scroll: handler 19099 }, buildScrollConfig.current(config)); 19100 } 19101 19102 var RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/; 19103 19104 function sortHandlers(handlers) { 19105 var _native = {}; 19106 var handle = {}; 19107 var actions = new Set(); 19108 19109 for (var key in handlers) { 19110 if (RE_NOT_NATIVE.test(key)) { 19111 actions.add(RegExp.lastMatch); 19112 handle[key] = handlers[key]; 19113 } else { 19114 _native[key] = handlers[key]; 19115 } 19116 } 19117 19118 return [handle, _native, actions]; 19119 } 19120 /** 19121 * @public 19122 * 19123 * The most complete gesture hook, allowing support for multiple gestures. 19124 * 19125 * @param {Handlers} handlers - an object with on[Gesture] keys containg gesture handlers 19126 * @param {UseGestureConfig} [config={}] - the full config object 19127 * @returns {(...args: any[]) => HookReturnType<Config>} 19128 */ 19129 19130 19131 function useGesture(_handlers, config) { 19132 if (config === void 0) { 19133 config = {}; 19134 } 19135 19136 var _sortHandlers = sortHandlers(_handlers), 19137 handlers = _sortHandlers[0], 19138 nativeHandlers = _sortHandlers[1], 19139 actions = _sortHandlers[2]; 19140 19141 RecognizersMap.set('drag', DragRecognizer); 19142 RecognizersMap.set('hover', MoveRecognizer); 19143 RecognizersMap.set('move', MoveRecognizer); 19144 RecognizersMap.set('pinch', PinchRecognizer); 19145 RecognizersMap.set('scroll', ScrollRecognizer); 19146 RecognizersMap.set('wheel', WheelRecognizer); 19147 var mergedConfig = buildComplexConfig(config, actions); 19148 var internalHandlers = {}; 19149 if (actions.has('onDrag')) internalHandlers.drag = includeStartEndHandlers(handlers, 'onDrag'); 19150 if (actions.has('onWheel')) internalHandlers.wheel = includeStartEndHandlers(handlers, 'onWheel'); 19151 if (actions.has('onScroll')) internalHandlers.scroll = includeStartEndHandlers(handlers, 'onScroll'); 19152 if (actions.has('onMove')) internalHandlers.move = includeStartEndHandlers(handlers, 'onMove'); 19153 if (actions.has('onPinch')) internalHandlers.pinch = includeStartEndHandlers(handlers, 'onPinch'); 19154 if (actions.has('onHover')) internalHandlers.hover = handlers.onHover; 19155 return useRecognizers(internalHandlers, mergedConfig, nativeHandlers); 19156 } 19157 19158 function includeStartEndHandlers(handlers, handlerKey) { 19159 var startKey = handlerKey + 'Start'; 19160 var endKey = handlerKey + 'End'; 19161 19162 var fn = function fn(state) { 19163 var memo = undefined; 19164 if (state.first && startKey in handlers) handlers[startKey](state); 19165 if (handlerKey in handlers) memo = handlers[handlerKey](state); 19166 if (state.last && endKey in handlers) handlers[endKey](state); 19167 return memo; 19168 }; 19169 19170 return fn; 19171 } 19172 19173 19174 19175 // EXTERNAL MODULE: external ["wp","keycodes"] 19176 var external_wp_keycodes_ = __webpack_require__("RxS6"); 19177 19178 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/utils.js 19179 /** 19180 * WordPress dependencies 19181 */ 19182 19183 /** 19184 * Gets a CSS cursor value based on a drag direction. 19185 * 19186 * @param {string} dragDirection The drag direction. 19187 * @return {string} The CSS cursor value. 19188 */ 19189 19190 function getDragCursor(dragDirection) { 19191 let dragCursor = 'ns-resize'; 19192 19193 switch (dragDirection) { 19194 case 'n': 19195 case 's': 19196 dragCursor = 'ns-resize'; 19197 break; 19198 19199 case 'e': 19200 case 'w': 19201 dragCursor = 'ew-resize'; 19202 break; 19203 } 19204 19205 return dragCursor; 19206 } 19207 /** 19208 * Custom hook that renders a drag cursor when dragging. 19209 * 19210 * @param {boolean} isDragging The dragging state. 19211 * @param {string} dragDirection The drag direction. 19212 * 19213 * @return {string} The CSS cursor value. 19214 */ 19215 19216 function useDragCursor(isDragging, dragDirection) { 19217 const dragCursor = getDragCursor(dragDirection); 19218 Object(external_wp_element_["useEffect"])(() => { 19219 if (isDragging) { 19220 document.documentElement.style.cursor = dragCursor; 19221 } else { 19222 document.documentElement.style.cursor = null; 19223 } 19224 }, [isDragging]); 19225 return dragCursor; 19226 } 19227 19228 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/state.js 19229 /** 19230 * External dependencies 19231 */ 19232 19233 /** 19234 * WordPress dependencies 19235 */ 19236 19237 19238 19239 const initialStateReducer = state => state; 19240 19241 const initialInputControlState = { 19242 _event: {}, 19243 error: null, 19244 initialValue: '', 19245 isDirty: false, 19246 isDragEnabled: false, 19247 isDragging: false, 19248 isPressEnterToChange: false, 19249 value: '' 19250 }; 19251 const actionTypes = { 19252 CHANGE: 'CHANGE', 19253 COMMIT: 'COMMIT', 19254 DRAG_END: 'DRAG_END', 19255 DRAG_START: 'DRAG_START', 19256 DRAG: 'DRAG', 19257 INVALIDATE: 'INVALIDATE', 19258 PRESS_DOWN: 'PRESS_DOWN', 19259 PRESS_ENTER: 'PRESS_ENTER', 19260 PRESS_UP: 'PRESS_UP', 19261 RESET: 'RESET', 19262 UPDATE: 'UPDATE' 19263 }; 19264 const inputControlActionTypes = actionTypes; 19265 /** 19266 * Prepares initialState for the reducer. 19267 * 19268 * @param {Object} initialState The initial state. 19269 * @return {Object} Prepared initialState for the reducer 19270 */ 19271 19272 function mergeInitialState(initialState = initialInputControlState) { 19273 const { 19274 value 19275 } = initialState; 19276 return { ...initialInputControlState, 19277 ...initialState, 19278 initialValue: value 19279 }; 19280 } 19281 /** 19282 * Composes multiple stateReducers into a single stateReducer, building 19283 * the pipeline to control the flow for state and actions. 19284 * 19285 * @param {...Function} fns State reducers. 19286 * @return {Function} The single composed stateReducer. 19287 */ 19288 19289 19290 const composeStateReducers = (...fns) => { 19291 return (...args) => { 19292 return fns.reduceRight((state, fn) => { 19293 const fnState = fn(...args); 19294 return Object(external_lodash_["isEmpty"])(fnState) ? state : { ...state, 19295 ...fnState 19296 }; 19297 }, {}); 19298 }; 19299 }; 19300 /** 19301 * Creates a reducer that opens the channel for external state subscription 19302 * and modification. 19303 * 19304 * This technique uses the "stateReducer" design pattern: 19305 * https://kentcdodds.com/blog/the-state-reducer-pattern/ 19306 * 19307 * @param {Function} composedStateReducers A custom reducer that can subscribe and modify state. 19308 * @return {Function} The reducer. 19309 */ 19310 19311 function inputControlStateReducer(composedStateReducers) { 19312 return (state, action) => { 19313 const nextState = { ...state 19314 }; 19315 const { 19316 type, 19317 payload 19318 } = action; 19319 19320 switch (type) { 19321 /** 19322 * Keyboard events 19323 */ 19324 case actionTypes.PRESS_UP: 19325 nextState.isDirty = false; 19326 break; 19327 19328 case actionTypes.PRESS_DOWN: 19329 nextState.isDirty = false; 19330 break; 19331 19332 /** 19333 * Drag events 19334 */ 19335 19336 case actionTypes.DRAG_START: 19337 nextState.isDragging = true; 19338 break; 19339 19340 case actionTypes.DRAG_END: 19341 nextState.isDragging = false; 19342 break; 19343 19344 /** 19345 * Input events 19346 */ 19347 19348 case actionTypes.CHANGE: 19349 nextState.error = null; 19350 nextState.value = payload.value; 19351 19352 if (state.isPressEnterToChange) { 19353 nextState.isDirty = true; 19354 } 19355 19356 break; 19357 19358 case actionTypes.COMMIT: 19359 nextState.value = payload.value; 19360 nextState.isDirty = false; 19361 break; 19362 19363 case actionTypes.RESET: 19364 nextState.error = null; 19365 nextState.isDirty = false; 19366 nextState.value = payload.value || state.initialValue; 19367 break; 19368 19369 case actionTypes.UPDATE: 19370 nextState.value = payload.value; 19371 nextState.isDirty = false; 19372 break; 19373 19374 /** 19375 * Validation 19376 */ 19377 19378 case actionTypes.INVALIDATE: 19379 nextState.error = payload.error; 19380 break; 19381 } 19382 19383 if (payload.event) { 19384 nextState._event = payload.event; 19385 } 19386 /** 19387 * Send the nextState + action to the composedReducers via 19388 * this "bridge" mechanism. This allows external stateReducers 19389 * to hook into actions, and modify state if needed. 19390 */ 19391 19392 19393 return composedStateReducers(nextState, action); 19394 }; 19395 } 19396 /** 19397 * A custom hook that connects and external stateReducer with an internal 19398 * reducer. This hook manages the internal state of InputControl. 19399 * However, by connecting an external stateReducer function, other 19400 * components can react to actions as well as modify state before it is 19401 * applied. 19402 * 19403 * This technique uses the "stateReducer" design pattern: 19404 * https://kentcdodds.com/blog/the-state-reducer-pattern/ 19405 * 19406 * @param {Function} stateReducer An external state reducer. 19407 * @param {Object} initialState The initial state for the reducer. 19408 * @return {Object} State, dispatch, and a collection of actions. 19409 */ 19410 19411 19412 function useInputControlStateReducer(stateReducer = initialStateReducer, initialState = initialInputControlState) { 19413 const [state, dispatch] = Object(external_wp_element_["useReducer"])(inputControlStateReducer(stateReducer), mergeInitialState(initialState)); 19414 19415 const createChangeEvent = type => (nextValue, event) => { 19416 /** 19417 * Persist allows for the (Synthetic) event to be used outside of 19418 * this function call. 19419 * https://reactjs.org/docs/events.html#event-pooling 19420 */ 19421 if (event && event.persist) { 19422 event.persist(); 19423 } 19424 19425 dispatch({ 19426 type, 19427 payload: { 19428 value: nextValue, 19429 event 19430 } 19431 }); 19432 }; 19433 19434 const createKeyEvent = type => event => { 19435 /** 19436 * Persist allows for the (Synthetic) event to be used outside of 19437 * this function call. 19438 * https://reactjs.org/docs/events.html#event-pooling 19439 */ 19440 if (event && event.persist) { 19441 event.persist(); 19442 } 19443 19444 dispatch({ 19445 type, 19446 payload: { 19447 event 19448 } 19449 }); 19450 }; 19451 19452 const createDragEvent = type => dragProps => { 19453 dispatch({ 19454 type, 19455 payload: dragProps 19456 }); 19457 }; 19458 /** 19459 * Actions for the reducer 19460 */ 19461 19462 19463 const change = createChangeEvent(actionTypes.CHANGE); 19464 const invalidate = createChangeEvent(actionTypes.INVALIDATE); 19465 const reset = createChangeEvent(actionTypes.RESET); 19466 const commit = createChangeEvent(actionTypes.COMMIT); 19467 const update = createChangeEvent(actionTypes.UPDATE); 19468 const dragStart = createDragEvent(actionTypes.DRAG_START); 19469 const drag = createDragEvent(actionTypes.DRAG); 19470 const dragEnd = createDragEvent(actionTypes.DRAG_END); 19471 const pressUp = createKeyEvent(actionTypes.PRESS_UP); 19472 const pressDown = createKeyEvent(actionTypes.PRESS_DOWN); 19473 const pressEnter = createKeyEvent(actionTypes.PRESS_ENTER); 19474 return { 19475 change, 19476 commit, 19477 dispatch, 19478 drag, 19479 dragEnd, 19480 dragStart, 19481 invalidate, 19482 pressDown, 19483 pressEnter, 19484 pressUp, 19485 reset, 19486 state, 19487 update 19488 }; 19489 } 19490 19491 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/values.js 19492 /* eslint-disable jsdoc/valid-types */ 19493 19494 /** 19495 * Determines if a value is null or undefined. 19496 * 19497 * @template T 19498 * 19499 * @param {T | null | undefined} value The value to check. 19500 * @return {value is T} Whether value is not null or undefined. 19501 */ 19502 function isValueDefined(value) { 19503 return value !== undefined && value !== null; 19504 } 19505 /* eslint-enable jsdoc/valid-types */ 19506 19507 /* eslint-disable jsdoc/valid-types */ 19508 19509 /** 19510 * Determines if a value is empty, null, or undefined. 19511 * 19512 * @template T 19513 * 19514 * @param {T | "" | null | undefined} value The value to check. 19515 * @return {value is T} Whether value is empty. 19516 */ 19517 19518 function isValueEmpty(value) { 19519 const isEmptyString = value === ''; 19520 return !isValueDefined(value) || isEmptyString; 19521 } 19522 /* eslint-enable jsdoc/valid-types */ 19523 19524 /** 19525 * Get the first defined/non-null value from an array. 19526 * 19527 * @template T 19528 * 19529 * @param {Array<T | null | undefined>} values Values to derive from. 19530 * @param {T} fallbackValue Fallback value if there are no defined values. 19531 * @return {T} A defined value or the fallback value. 19532 */ 19533 19534 function getDefinedValue(values = [], fallbackValue) { 19535 var _values$find; 19536 19537 return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue; 19538 } 19539 19540 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.js 19541 /** 19542 * WordPress dependencies 19543 */ 19544 19545 /** 19546 * A `React.useEffect` that will not run on the first render. 19547 * Source: 19548 * https://github.com/reakit/reakit/blob/HEAD/packages/reakit-utils/src/useUpdateEffect.ts 19549 * 19550 * @param {import('react').EffectCallback} effect 19551 * @param {import('react').DependencyList} deps 19552 */ 19553 19554 function useUpdateEffect(effect, deps) { 19555 const mounted = Object(external_wp_element_["useRef"])(false); 19556 Object(external_wp_element_["useEffect"])(() => { 19557 if (mounted.current) { 19558 return effect(); 19559 } 19560 19561 mounted.current = true; 19562 return undefined; 19563 }, deps); 19564 } 19565 19566 /* harmony default export */ var use_update_effect = (useUpdateEffect); 19567 19568 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-field.js 19569 19570 19571 19572 /** 19573 * External dependencies 19574 */ 19575 19576 19577 /** 19578 * WordPress dependencies 19579 */ 19580 19581 19582 19583 /** 19584 * Internal dependencies 19585 */ 19586 19587 19588 19589 19590 19591 19592 19593 function InputField({ 19594 disabled = false, 19595 dragDirection = 'n', 19596 dragThreshold = 10, 19597 id, 19598 isDragEnabled = false, 19599 isFocused, 19600 isPressEnterToChange = false, 19601 onBlur = external_lodash_["noop"], 19602 onChange = external_lodash_["noop"], 19603 onDrag = external_lodash_["noop"], 19604 onDragEnd = external_lodash_["noop"], 19605 onDragStart = external_lodash_["noop"], 19606 onFocus = external_lodash_["noop"], 19607 onKeyDown = external_lodash_["noop"], 19608 onValidate = external_lodash_["noop"], 19609 size = 'default', 19610 setIsFocused, 19611 stateReducer = state => state, 19612 value: valueProp, 19613 type, 19614 ...props 19615 }, ref) { 19616 const { 19617 // State 19618 state, 19619 // Actions 19620 change, 19621 commit, 19622 drag, 19623 dragEnd, 19624 dragStart, 19625 invalidate, 19626 pressDown, 19627 pressEnter, 19628 pressUp, 19629 reset, 19630 update 19631 } = useInputControlStateReducer(stateReducer, { 19632 isDragEnabled, 19633 value: valueProp, 19634 isPressEnterToChange 19635 }); 19636 const { 19637 _event, 19638 value, 19639 isDragging, 19640 isDirty 19641 } = state; 19642 const wasDirtyOnBlur = Object(external_wp_element_["useRef"])(false); 19643 const dragCursor = useDragCursor(isDragging, dragDirection); 19644 /* 19645 * Handles synchronization of external and internal value state. 19646 * If not focused and did not hold a dirty value[1] on blur 19647 * updates the value from the props. Otherwise if not holding 19648 * a dirty value[1] propagates the value and event through onChange. 19649 * [1] value is only made dirty if isPressEnterToChange is true 19650 */ 19651 19652 use_update_effect(() => { 19653 if (valueProp === value) { 19654 return; 19655 } 19656 19657 if (!isFocused && !wasDirtyOnBlur.current) { 19658 update(valueProp); 19659 } else if (!isDirty) { 19660 onChange(value, { 19661 event: _event 19662 }); 19663 wasDirtyOnBlur.current = false; 19664 } 19665 }, [value, isDirty, isFocused, valueProp]); 19666 19667 const handleOnBlur = event => { 19668 onBlur(event); 19669 setIsFocused(false); 19670 /** 19671 * If isPressEnterToChange is set, this commits the value to 19672 * the onChange callback. 19673 */ 19674 19675 if (isPressEnterToChange && isDirty) { 19676 wasDirtyOnBlur.current = true; 19677 19678 if (!isValueEmpty(value)) { 19679 handleOnCommit(event); 19680 } else { 19681 reset(valueProp); 19682 } 19683 } 19684 }; 19685 19686 const handleOnFocus = event => { 19687 onFocus(event); 19688 setIsFocused(true); 19689 }; 19690 19691 const handleOnChange = event => { 19692 const nextValue = event.target.value; 19693 change(nextValue, event); 19694 }; 19695 19696 const handleOnCommit = event => { 19697 const nextValue = event.target.value; 19698 19699 try { 19700 onValidate(nextValue, event); 19701 commit(nextValue, event); 19702 } catch (err) { 19703 invalidate(err, event); 19704 } 19705 }; 19706 19707 const handleOnKeyDown = event => { 19708 const { 19709 keyCode 19710 } = event; 19711 onKeyDown(event); 19712 19713 switch (keyCode) { 19714 case external_wp_keycodes_["UP"]: 19715 pressUp(event); 19716 break; 19717 19718 case external_wp_keycodes_["DOWN"]: 19719 pressDown(event); 19720 break; 19721 19722 case external_wp_keycodes_["ENTER"]: 19723 pressEnter(event); 19724 19725 if (isPressEnterToChange) { 19726 event.preventDefault(); 19727 handleOnCommit(event); 19728 } 19729 19730 break; 19731 } 19732 }; 19733 19734 const dragGestureProps = useDrag(dragProps => { 19735 const { 19736 distance, 19737 dragging, 19738 event 19739 } = dragProps; // The event is persisted to prevent errors in components using this 19740 // to check if a modifier key was held while dragging. 19741 19742 event.persist(); 19743 if (!distance) return; 19744 event.stopPropagation(); 19745 /** 19746 * Quick return if no longer dragging. 19747 * This prevents unnecessary value calculations. 19748 */ 19749 19750 if (!dragging) { 19751 onDragEnd(dragProps); 19752 dragEnd(dragProps); 19753 return; 19754 } 19755 19756 onDrag(dragProps); 19757 drag(dragProps); 19758 19759 if (!isDragging) { 19760 onDragStart(dragProps); 19761 dragStart(dragProps); 19762 } 19763 }, { 19764 threshold: dragThreshold, 19765 enabled: isDragEnabled 19766 }); 19767 const dragProps = isDragEnabled ? dragGestureProps() : {}; 19768 /* 19769 * Works around the odd UA (e.g. Firefox) that does not focus inputs of 19770 * type=number when their spinner arrows are pressed. 19771 */ 19772 19773 let handleOnMouseDown; 19774 19775 if (type === 'number') { 19776 handleOnMouseDown = event => { 19777 var _props$onMouseDown; 19778 19779 (_props$onMouseDown = props.onMouseDown) === null || _props$onMouseDown === void 0 ? void 0 : _props$onMouseDown.call(props, event); 19780 19781 if (event.target !== event.target.ownerDocument.activeElement) { 19782 event.target.focus(); 19783 } 19784 }; 19785 } 19786 19787 return Object(external_wp_element_["createElement"])(input_control_styles_Input, Object(esm_extends["a" /* default */])({}, props, dragProps, { 19788 className: "components-input-control__input", 19789 disabled: disabled, 19790 dragCursor: dragCursor, 19791 isDragging: isDragging, 19792 id: id, 19793 onBlur: handleOnBlur, 19794 onChange: handleOnChange, 19795 onFocus: handleOnFocus, 19796 onKeyDown: handleOnKeyDown, 19797 onMouseDown: handleOnMouseDown, 19798 ref: ref, 19799 size: size, 19800 value: value, 19801 type: type 19802 })); 19803 } 19804 19805 const ForwardedComponent = Object(external_wp_element_["forwardRef"])(InputField); 19806 /* harmony default export */ var input_field = (ForwardedComponent); 19807 19808 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js 19809 19810 19811 19812 /** 19813 * External dependencies 19814 */ 19815 19816 19817 /** 19818 * WordPress dependencies 19819 */ 19820 19821 19822 19823 /** 19824 * Internal dependencies 19825 */ 19826 19827 19828 19829 19830 function input_control_useUniqueId(idProp) { 19831 const instanceId = Object(external_wp_compose_["useInstanceId"])(InputControl); 19832 const id = `inspector-input-control-${instanceId}`; 19833 return idProp || id; 19834 } 19835 19836 function InputControl({ 19837 __unstableStateReducer: stateReducer = state => state, 19838 __unstableInputWidth, 19839 className, 19840 disabled = false, 19841 hideLabelFromVision = false, 19842 id: idProp, 19843 isPressEnterToChange = false, 19844 label, 19845 labelPosition = 'top', 19846 onChange = external_lodash_["noop"], 19847 onValidate = external_lodash_["noop"], 19848 onKeyDown = external_lodash_["noop"], 19849 prefix, 19850 size = 'default', 19851 suffix, 19852 value, 19853 ...props 19854 }, ref) { 19855 const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false); 19856 const id = input_control_useUniqueId(idProp); 19857 const classes = classnames_default()('components-input-control', className); 19858 return Object(external_wp_element_["createElement"])(input_base, { 19859 __unstableInputWidth: __unstableInputWidth, 19860 className: classes, 19861 disabled: disabled, 19862 gap: 3, 19863 hideLabelFromVision: hideLabelFromVision, 19864 id: id, 19865 isFocused: isFocused, 19866 justify: "left", 19867 label: label, 19868 labelPosition: labelPosition, 19869 prefix: prefix, 19870 size: size, 19871 suffix: suffix 19872 }, Object(external_wp_element_["createElement"])(input_field, Object(esm_extends["a" /* default */])({}, props, { 19873 className: "components-input-control__input", 19874 disabled: disabled, 19875 id: id, 19876 isFocused: isFocused, 19877 isPressEnterToChange: isPressEnterToChange, 19878 onChange: onChange, 19879 onKeyDown: onKeyDown, 19880 onValidate: onValidate, 19881 ref: ref, 19882 setIsFocused: setIsFocused, 19883 size: size, 19884 stateReducer: stateReducer, 19885 value: value 19886 }))); 19887 } 19888 const input_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(InputControl); 19889 /* harmony default export */ var input_control = (input_control_ForwardedComponent); 19890 19891 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js 19892 19893 19894 function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 19895 19896 /** 19897 * External dependencies 19898 */ 19899 19900 19901 /** 19902 * Internal dependencies 19903 */ 19904 19905 19906 var number_control_styles_ref = true ? { 19907 name: "1b9wwt5", 19908 styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}" 19909 } : undefined; 19910 19911 const htmlArrowStyles = ({ 19912 hideHTMLArrows 19913 }) => { 19914 if (!hideHTMLArrows) return ``; 19915 return number_control_styles_ref; 19916 }; 19917 19918 const number_control_styles_Input = /*#__PURE__*/styled_base_browser_esm(input_control, { 19919 target: "ep48uk90", 19920 label: "Input" 19921 })(htmlArrowStyles, ";" + ( true ? "" : undefined)); 19922 19923 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/math.js 19924 /** 19925 * External dependencies 19926 */ 19927 19928 /** 19929 * Parses and retrieves a number value. 19930 * 19931 * @param {unknown} value The incoming value. 19932 * 19933 * @return {number} The parsed number value. 19934 */ 19935 19936 function getNumber(value) { 19937 const number = Number(value); 19938 return isNaN(number) ? 0 : number; 19939 } 19940 /** 19941 * Safely adds 2 values. 19942 * 19943 * @param {Array<number|string>} args Values to add together. 19944 * 19945 * @return {number} The sum of values. 19946 */ 19947 19948 function add(...args) { 19949 return args.reduce( 19950 /** @type {(sum:number, arg: number|string) => number} */ 19951 (sum, arg) => sum + getNumber(arg), 0); 19952 } 19953 /** 19954 * Safely subtracts 2 values. 19955 * 19956 * @param {Array<number|string>} args Values to subtract together. 19957 * 19958 * @return {number} The difference of the values. 19959 */ 19960 19961 function subtract(...args) { 19962 return args.reduce( 19963 /** @type {(diff:number, arg: number|string, index:number) => number} */ 19964 (diff, arg, index) => { 19965 const value = getNumber(arg); 19966 return index === 0 ? value : diff - value; 19967 }, 0); 19968 } 19969 /** 19970 * Determines the decimal position of a number value. 19971 * 19972 * @param {number} value The number to evaluate. 19973 * 19974 * @return {number} The number of decimal places. 19975 */ 19976 19977 function getPrecision(value) { 19978 const split = (value + '').split('.'); 19979 return split[1] !== undefined ? split[1].length : 0; 19980 } 19981 /** 19982 * Clamps a value based on a min/max range with rounding 19983 * 19984 * @param {number} value The value. 19985 * @param {number} min The minimum range. 19986 * @param {number} max The maximum range. 19987 * @param {number} step A multiplier for the value. 19988 * 19989 * @return {number} The rounded and clamped value. 19990 */ 19991 19992 19993 function roundClamp(value = 0, min = Infinity, max = Infinity, step = 1) { 19994 const baseValue = getNumber(value); 19995 const stepValue = getNumber(step); 19996 const precision = getPrecision(step); 19997 const rounded = Math.round(baseValue / stepValue) * stepValue; 19998 const clampedValue = Object(external_lodash_["clamp"])(rounded, min, max); 19999 return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue; 20000 } 20001 /** 20002 * Clamps a value based on a min/max range with rounding. 20003 * Returns a string. 20004 * 20005 * @param {Parameters<typeof roundClamp>} args Arguments for roundClamp(). 20006 * @return {string} The rounded and clamped value. 20007 */ 20008 20009 function roundClampString(...args) { 20010 return roundClamp(...args).toString(); 20011 } 20012 20013 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-jump-step.js 20014 /** 20015 * WordPress dependencies 20016 */ 20017 20018 /** 20019 * A custom hook that calculates a step value (used by elements like input 20020 * [type="number"]). This value can be modified based on whether the Shift 20021 * key is being held down. 20022 * 20023 * For example, a shiftStep of 10, and a step of 1... 20024 * Starting from 10, the next incremented value will be 11. 20025 * 20026 * Holding down shift... 20027 * Starting from 10, the next incremented value will be 20. 20028 * 20029 * @param {Object} props Properties for the hook. 20030 * @param {boolean} [props.isShiftStepEnabled=true] Determines if jumping values with shift is enabled 20031 * @param {number} [props.shiftStep=10] Multiplier to jump by, when holding shift key. 20032 * @param {number} [props.step=1] Multiplier to jump by, when not-holding shift key. 20033 * 20034 * @return {number} The jump step value. 20035 */ 20036 20037 function useJumpStep({ 20038 isShiftStepEnabled = true, 20039 shiftStep = 10, 20040 step = 1 20041 }) { 20042 const [isShiftKey, setIsShiftKey] = Object(external_wp_element_["useState"])(false); 20043 Object(external_wp_element_["useEffect"])(() => { 20044 /** @type {(event: KeyboardEvent)=>void} */ 20045 const handleShiftKeyToggle = event => { 20046 setIsShiftKey(event.shiftKey); 20047 }; 20048 20049 window.addEventListener('keydown', handleShiftKeyToggle); 20050 window.addEventListener('keyup', handleShiftKeyToggle); 20051 return () => { 20052 window.removeEventListener('keydown', handleShiftKeyToggle); 20053 window.removeEventListener('keyup', handleShiftKeyToggle); 20054 }; 20055 }, []); 20056 const isEnabled = isShiftStepEnabled && isShiftKey; 20057 return isEnabled ? shiftStep * step : step; 20058 } 20059 20060 /* harmony default export */ var use_jump_step = (useJumpStep); 20061 20062 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js 20063 20064 20065 20066 /** 20067 * External dependencies 20068 */ 20069 20070 /** 20071 * WordPress dependencies 20072 */ 20073 20074 20075 20076 /** 20077 * Internal dependencies 20078 */ 20079 20080 20081 20082 20083 20084 20085 function NumberControl({ 20086 __unstableStateReducer: stateReducer = state => state, 20087 className, 20088 dragDirection = 'n', 20089 hideHTMLArrows = false, 20090 isDragEnabled = true, 20091 isShiftStepEnabled = true, 20092 label, 20093 max = Infinity, 20094 min = -Infinity, 20095 shiftStep = 10, 20096 step = 1, 20097 type: typeProp = 'number', 20098 value: valueProp, 20099 ...props 20100 }, ref) { 20101 const baseValue = roundClamp(0, min, max, step); 20102 const jumpStep = use_jump_step({ 20103 step, 20104 shiftStep, 20105 isShiftStepEnabled 20106 }); 20107 const autoComplete = typeProp === 'number' ? 'off' : null; 20108 const classes = classnames_default()('components-number-control', className); 20109 /** 20110 * "Middleware" function that intercepts updates from InputControl. 20111 * This allows us to tap into actions to transform the (next) state for 20112 * InputControl. 20113 * 20114 * @param {Object} state State from InputControl 20115 * @param {Object} action Action triggering state change 20116 * @return {Object} The updated state to apply to InputControl 20117 */ 20118 20119 const numberControlStateReducer = (state, action) => { 20120 const { 20121 type, 20122 payload 20123 } = action; 20124 const event = payload === null || payload === void 0 ? void 0 : payload.event; 20125 const currentValue = state.value; 20126 /** 20127 * Handles custom UP and DOWN Keyboard events 20128 */ 20129 20130 if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) { 20131 const enableShift = event.shiftKey && isShiftStepEnabled; 20132 const incrementalValue = enableShift ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step); 20133 let nextValue = isValueEmpty(currentValue) ? baseValue : currentValue; 20134 20135 if (event !== null && event !== void 0 && event.preventDefault) { 20136 event.preventDefault(); 20137 } 20138 20139 if (type === inputControlActionTypes.PRESS_UP) { 20140 nextValue = add(nextValue, incrementalValue); 20141 } 20142 20143 if (type === inputControlActionTypes.PRESS_DOWN) { 20144 nextValue = subtract(nextValue, incrementalValue); 20145 } 20146 20147 nextValue = roundClamp(nextValue, min, max, incrementalValue); 20148 state.value = nextValue; 20149 } 20150 /** 20151 * Handles drag to update events 20152 */ 20153 20154 20155 if (type === inputControlActionTypes.DRAG && isDragEnabled) { 20156 const { 20157 delta, 20158 shiftKey 20159 } = payload; 20160 const [x, y] = delta; 20161 const modifier = shiftKey ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step); 20162 let directionModifier; 20163 let directionBaseValue; 20164 20165 switch (dragDirection) { 20166 case 'n': 20167 directionBaseValue = y; 20168 directionModifier = -1; 20169 break; 20170 20171 case 'e': 20172 directionBaseValue = x; 20173 directionModifier = Object(external_wp_i18n_["isRTL"])() ? -1 : 1; 20174 break; 20175 20176 case 's': 20177 directionBaseValue = y; 20178 directionModifier = 1; 20179 break; 20180 20181 case 'w': 20182 directionBaseValue = x; 20183 directionModifier = Object(external_wp_i18n_["isRTL"])() ? 1 : -1; 20184 break; 20185 } 20186 20187 const distance = directionBaseValue * modifier * directionModifier; 20188 let nextValue; 20189 20190 if (distance !== 0) { 20191 nextValue = roundClamp(add(currentValue, distance), min, max, modifier); 20192 state.value = nextValue; 20193 } 20194 } 20195 /** 20196 * Handles commit (ENTER key press or on blur if isPressEnterToChange) 20197 */ 20198 20199 20200 if (type === inputControlActionTypes.PRESS_ENTER || type === inputControlActionTypes.COMMIT) { 20201 state.value = roundClamp(currentValue, min, max); 20202 } 20203 20204 return state; 20205 }; 20206 20207 return Object(external_wp_element_["createElement"])(number_control_styles_Input, Object(esm_extends["a" /* default */])({ 20208 autoComplete: autoComplete, 20209 inputMode: "numeric" 20210 }, props, { 20211 className: classes, 20212 dragDirection: dragDirection, 20213 hideHTMLArrows: hideHTMLArrows, 20214 isDragEnabled: isDragEnabled, 20215 label: label, 20216 max: max, 20217 min: min, 20218 ref: ref, 20219 step: jumpStep, 20220 type: typeProp, 20221 value: valueProp, 20222 __unstableStateReducer: composeStateReducers(numberControlStateReducer, stateReducer) 20223 })); 20224 } 20225 /* harmony default export */ var number_control = (Object(external_wp_element_["forwardRef"])(NumberControl)); 20226 20227 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js 20228 20229 20230 function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 20231 20232 /** 20233 * Internal dependencies 20234 */ 20235 20236 20237 const CIRCLE_SIZE = 30; 20238 const angle_picker_control_styles_Root = /*#__PURE__*/styled_base_browser_esm(flex_component, { 20239 target: "e65ony40", 20240 label: "Root" 20241 })( true ? { 20242 name: "tn9ygg", 20243 styles: "max-width:200px;" 20244 } : undefined); 20245 const CircleRoot = styled_base_browser_esm("div", { 20246 target: "e65ony41", 20247 label: "CircleRoot" 20248 })("border-radius:50%;border:1px solid ", COLORS.ui.borderLight, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;" + ( true ? "" : undefined)); 20249 const CircleIndicatorWrapper = styled_base_browser_esm("div", { 20250 target: "e65ony42", 20251 label: "CircleIndicatorWrapper" 20252 })( true ? { 20253 name: "11t5m37", 20254 styles: "box-sizing:border-box;position:relative;width:100%;height:100%;" 20255 } : undefined); 20256 const CircleIndicator = styled_base_browser_esm("div", { 20257 target: "e65ony43", 20258 label: "CircleIndicator" 20259 })("background:", COLORS.ui.border, ";border-radius:50%;border:3px solid ", COLORS.ui.border, ";bottom:0;box-sizing:border-box;display:block;height:1px;left:0;margin:auto;position:absolute;right:0;top:-", CIRCLE_SIZE / 2, "px;width:1px;" + ( true ? "" : undefined)); 20260 20261 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js 20262 20263 20264 20265 /** 20266 * WordPress dependencies 20267 */ 20268 20269 20270 /** 20271 * Internal dependencies 20272 */ 20273 20274 20275 20276 function AngleCircle({ 20277 value, 20278 onChange, 20279 ...props 20280 }) { 20281 const angleCircleRef = Object(external_wp_element_["useRef"])(); 20282 const angleCircleCenter = Object(external_wp_element_["useRef"])(); 20283 const previousCursorValue = Object(external_wp_element_["useRef"])(); 20284 20285 const setAngleCircleCenter = () => { 20286 const rect = angleCircleRef.current.getBoundingClientRect(); 20287 angleCircleCenter.current = { 20288 x: rect.x + rect.width / 2, 20289 y: rect.y + rect.height / 2 20290 }; 20291 }; 20292 20293 const changeAngleToPosition = event => { 20294 const { 20295 x: centerX, 20296 y: centerY 20297 } = angleCircleCenter.current; 20298 const { 20299 ownerDocument 20300 } = angleCircleRef.current; // Prevent (drag) mouse events from selecting and accidentally 20301 // triggering actions from other elements. 20302 20303 event.preventDefault(); // Ensure the input isn't focused as preventDefault would leave it 20304 20305 ownerDocument.activeElement.blur(); 20306 onChange(getAngle(centerX, centerY, event.clientX, event.clientY)); 20307 }; 20308 20309 const { 20310 startDrag, 20311 isDragging 20312 } = Object(external_wp_compose_["__experimentalUseDragging"])({ 20313 onDragStart: event => { 20314 setAngleCircleCenter(); 20315 changeAngleToPosition(event); 20316 }, 20317 onDragMove: changeAngleToPosition, 20318 onDragEnd: changeAngleToPosition 20319 }); 20320 Object(external_wp_element_["useEffect"])(() => { 20321 if (isDragging) { 20322 if (previousCursorValue.current === undefined) { 20323 previousCursorValue.current = document.body.style.cursor; 20324 } 20325 20326 document.body.style.cursor = 'grabbing'; 20327 } else { 20328 document.body.style.cursor = previousCursorValue.current || null; 20329 previousCursorValue.current = undefined; 20330 } 20331 }, [isDragging]); 20332 return ( 20333 /* eslint-disable jsx-a11y/no-static-element-interactions */ 20334 Object(external_wp_element_["createElement"])(CircleRoot, Object(esm_extends["a" /* default */])({ 20335 ref: angleCircleRef, 20336 onMouseDown: startDrag, 20337 className: "components-angle-picker-control__angle-circle", 20338 style: isDragging ? { 20339 cursor: 'grabbing' 20340 } : undefined 20341 }, props), Object(external_wp_element_["createElement"])(CircleIndicatorWrapper, { 20342 style: value ? { 20343 transform: `rotate(${value}deg)` 20344 } : undefined, 20345 className: "components-angle-picker-control__angle-circle-indicator-wrapper" 20346 }, Object(external_wp_element_["createElement"])(CircleIndicator, { 20347 className: "components-angle-picker-control__angle-circle-indicator" 20348 }))) 20349 /* eslint-enable jsx-a11y/no-static-element-interactions */ 20350 20351 ); 20352 } 20353 20354 function getAngle(centerX, centerY, pointX, pointY) { 20355 const y = pointY - centerY; 20356 const x = pointX - centerX; 20357 const angleInRadians = Math.atan2(y, x); 20358 const angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90; 20359 20360 if (angleInDeg < 0) { 20361 return 360 + angleInDeg; 20362 } 20363 20364 return angleInDeg; 20365 } 20366 20367 /* harmony default export */ var angle_circle = (AngleCircle); 20368 20369 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js 20370 20371 20372 20373 /** 20374 * External dependencies 20375 */ 20376 20377 /** 20378 * WordPress dependencies 20379 */ 20380 20381 20382 20383 /** 20384 * Internal dependencies 20385 */ 20386 20387 20388 20389 20390 20391 20392 function AnglePickerControl({ 20393 className, 20394 hideLabelFromVision, 20395 id: idProp, 20396 label = Object(external_wp_i18n_["__"])('Angle'), 20397 onChange, 20398 value, 20399 ...props 20400 }) { 20401 const instanceId = Object(external_wp_compose_["useInstanceId"])(AnglePickerControl, 'components-angle-picker-control__input'); 20402 const id = idProp || instanceId; 20403 20404 const handleOnNumberChange = unprocessedValue => { 20405 const inputValue = unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0; 20406 onChange(inputValue); 20407 }; 20408 20409 const classes = classnames_default()('components-angle-picker-control', className); 20410 return Object(external_wp_element_["createElement"])(base_control, Object(esm_extends["a" /* default */])({ 20411 className: classes, 20412 hideLabelFromVision: hideLabelFromVision, 20413 id: id, 20414 label: label 20415 }, props), Object(external_wp_element_["createElement"])(angle_picker_control_styles_Root, null, Object(external_wp_element_["createElement"])(flex_block_component, null, Object(external_wp_element_["createElement"])(number_control, { 20416 className: "components-angle-picker-control__input-field", 20417 id: id, 20418 max: 360, 20419 min: 0, 20420 onChange: handleOnNumberChange, 20421 step: "1", 20422 value: value 20423 })), Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(angle_circle, { 20424 "aria-hidden": "true", 20425 value: value, 20426 onChange: onChange 20427 })))); 20428 } 20429 20430 // EXTERNAL MODULE: external ["wp","richText"] 20431 var external_wp_richText_ = __webpack_require__("qRz9"); 20432 20433 // EXTERNAL MODULE: external ["wp","a11y"] 20434 var external_wp_a11y_ = __webpack_require__("gdqT"); 20435 20436 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js 20437 var build_module_button = __webpack_require__("kA6J"); 20438 20439 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js + 1 modules 20440 var build_module_popover = __webpack_require__("oXO/"); 20441 20442 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/index.js 20443 20444 20445 /** 20446 * External dependencies 20447 */ 20448 20449 20450 /** 20451 * WordPress dependencies 20452 */ 20453 20454 20455 20456 20457 20458 20459 20460 /** 20461 * Internal dependencies 20462 */ 20463 20464 20465 20466 /** 20467 * A raw completer option. 20468 * 20469 * @typedef {*} CompleterOption 20470 */ 20471 20472 /** 20473 * @callback FnGetOptions 20474 * 20475 * @return {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them. 20476 */ 20477 20478 /** 20479 * @callback FnGetOptionKeywords 20480 * @param {CompleterOption} option a completer option. 20481 * 20482 * @return {string[]} list of key words to search. 20483 */ 20484 20485 /** 20486 * @callback FnIsOptionDisabled 20487 * @param {CompleterOption} option a completer option. 20488 * 20489 * @return {string[]} whether or not the given option is disabled. 20490 */ 20491 20492 /** 20493 * @callback FnGetOptionLabel 20494 * @param {CompleterOption} option a completer option. 20495 * 20496 * @return {(string|Array.<(string|WPElement)>)} list of react components to render. 20497 */ 20498 20499 /** 20500 * @callback FnAllowContext 20501 * @param {string} before the string before the auto complete trigger and query. 20502 * @param {string} after the string after the autocomplete trigger and query. 20503 * 20504 * @return {boolean} true if the completer can handle. 20505 */ 20506 20507 /** 20508 * @typedef {Object} OptionCompletion 20509 * @property {'insert-at-caret'|'replace'} action the intended placement of the completion. 20510 * @property {OptionCompletionValue} value the completion value. 20511 */ 20512 20513 /** 20514 * A completion value. 20515 * 20516 * @typedef {(string|WPElement|Object)} OptionCompletionValue 20517 */ 20518 20519 /** 20520 * @callback FnGetOptionCompletion 20521 * @param {CompleterOption} value the value of the completer option. 20522 * @param {string} query the text value of the autocomplete query. 20523 * 20524 * @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an 20525 * OptionCompletionValue is returned, the 20526 * completion action defaults to `insert-at-caret`. 20527 */ 20528 20529 /** 20530 * @typedef {Object} WPCompleter 20531 * @property {string} name a way to identify a completer, useful for selective overriding. 20532 * @property {?string} className A class to apply to the popup menu. 20533 * @property {string} triggerPrefix the prefix that will display the menu. 20534 * @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them. 20535 * @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option. 20536 * @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled. 20537 * @property {FnGetOptionLabel} getOptionLabel get the label for a given option. 20538 * @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates. 20539 * @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option. 20540 */ 20541 20542 function filterOptions(search, options = [], maxResults = 10) { 20543 const filtered = []; 20544 20545 for (let i = 0; i < options.length; i++) { 20546 const option = options[i]; // Merge label into keywords 20547 20548 let { 20549 keywords = [] 20550 } = option; 20551 20552 if ('string' === typeof option.label) { 20553 keywords = [...keywords, option.label]; 20554 } 20555 20556 const isMatch = keywords.some(keyword => search.test(Object(external_lodash_["deburr"])(keyword))); 20557 20558 if (!isMatch) { 20559 continue; 20560 } 20561 20562 filtered.push(option); // Abort early if max reached 20563 20564 if (filtered.length === maxResults) { 20565 break; 20566 } 20567 } 20568 20569 return filtered; 20570 } 20571 20572 const getAutoCompleterUI = autocompleter => { 20573 const useItems = autocompleter.useItems ? autocompleter.useItems : filterValue => { 20574 const [items, setItems] = Object(external_wp_element_["useState"])([]); 20575 /* 20576 * We support both synchronous and asynchronous retrieval of completer options 20577 * but internally treat all as async so we maintain a single, consistent code path. 20578 * 20579 * Because networks can be slow, and the internet is wonderfully unpredictable, 20580 * we don't want two promises updating the state at once. This ensures that only 20581 * the most recent promise will act on `optionsData`. This doesn't use the state 20582 * because `setState` is batched, and so there's no guarantee that setting 20583 * `activePromise` in the state would result in it actually being in `this.state` 20584 * before the promise resolves and we check to see if this is the active promise or not. 20585 */ 20586 20587 Object(external_wp_element_["useLayoutEffect"])(() => { 20588 const { 20589 options, 20590 isDebounced 20591 } = autocompleter; 20592 const loadOptions = Object(external_lodash_["debounce"])(() => { 20593 const promise = Promise.resolve(typeof options === 'function' ? options(filterValue) : options).then(optionsData => { 20594 if (promise.canceled) { 20595 return; 20596 } 20597 20598 const keyedOptions = optionsData.map((optionData, optionIndex) => ({ 20599 key: `${autocompleter.name}-${optionIndex}`, 20600 value: optionData, 20601 label: autocompleter.getOptionLabel(optionData), 20602 keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [], 20603 isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false 20604 })); // create a regular expression to filter the options 20605 20606 const search = new RegExp('(?:\\b|\\s|^)' + Object(external_lodash_["escapeRegExp"])(filterValue), 'i'); 20607 setItems(filterOptions(search, keyedOptions)); 20608 }); 20609 return promise; 20610 }, isDebounced ? 250 : 0); 20611 const promise = loadOptions(); 20612 return () => { 20613 loadOptions.cancel(); 20614 20615 if (promise) { 20616 promise.canceled = true; 20617 } 20618 }; 20619 }, [filterValue]); 20620 return [items]; 20621 }; 20622 20623 function AutocompleterUI({ 20624 filterValue, 20625 instanceId, 20626 listBoxId, 20627 className, 20628 selectedIndex, 20629 onChangeOptions, 20630 onSelect, 20631 onReset, 20632 value, 20633 contentRef 20634 }) { 20635 const [items] = useItems(filterValue); 20636 const anchorRef = Object(external_wp_richText_["useAnchorRef"])({ 20637 ref: contentRef, 20638 value 20639 }); 20640 Object(external_wp_element_["useLayoutEffect"])(() => { 20641 onChangeOptions(items); 20642 }, [items]); 20643 20644 if (!items.length > 0) { 20645 return null; 20646 } 20647 20648 return Object(external_wp_element_["createElement"])(build_module_popover["a" /* default */], { 20649 focusOnMount: false, 20650 onClose: onReset, 20651 position: "top right", 20652 className: "components-autocomplete__popover", 20653 anchorRef: anchorRef 20654 }, Object(external_wp_element_["createElement"])("div", { 20655 id: listBoxId, 20656 role: "listbox", 20657 className: "components-autocomplete__results" 20658 }, Object(external_lodash_["map"])(items, (option, index) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 20659 key: option.key, 20660 id: `components-autocomplete-item-${instanceId}-${option.key}`, 20661 role: "option", 20662 "aria-selected": index === selectedIndex, 20663 disabled: option.isDisabled, 20664 className: classnames_default()('components-autocomplete__result', className, { 20665 'is-selected': index === selectedIndex 20666 }), 20667 onClick: () => onSelect(option) 20668 }, option.label)))); 20669 } 20670 20671 return AutocompleterUI; 20672 }; 20673 20674 function useAutocomplete({ 20675 record, 20676 onChange, 20677 onReplace, 20678 completers, 20679 contentRef 20680 }) { 20681 const debouncedSpeak = Object(external_wp_compose_["useDebounce"])(external_wp_a11y_["speak"], 500); 20682 const instanceId = Object(external_wp_compose_["useInstanceId"])(useAutocomplete); 20683 const [selectedIndex, setSelectedIndex] = Object(external_wp_element_["useState"])(0); 20684 const [filteredOptions, setFilteredOptions] = Object(external_wp_element_["useState"])([]); 20685 const [filterValue, setFilterValue] = Object(external_wp_element_["useState"])(''); 20686 const [autocompleter, setAutocompleter] = Object(external_wp_element_["useState"])(null); 20687 const [AutocompleterUI, setAutocompleterUI] = Object(external_wp_element_["useState"])(null); 20688 const [backspacing, setBackspacing] = Object(external_wp_element_["useState"])(false); 20689 20690 function insertCompletion(replacement) { 20691 const end = record.start; 20692 const start = end - autocompleter.triggerPrefix.length - filterValue.length; 20693 const toInsert = Object(external_wp_richText_["create"])({ 20694 html: Object(external_wp_element_["renderToString"])(replacement) 20695 }); 20696 onChange(Object(external_wp_richText_["insert"])(record, toInsert, start, end)); 20697 } 20698 20699 function select(option) { 20700 const { 20701 getOptionCompletion 20702 } = autocompleter || {}; 20703 20704 if (option.isDisabled) { 20705 return; 20706 } 20707 20708 if (getOptionCompletion) { 20709 const completion = getOptionCompletion(option.value, filterValue); 20710 const { 20711 action, 20712 value 20713 } = undefined === completion.action || undefined === completion.value ? { 20714 action: 'insert-at-caret', 20715 value: completion 20716 } : completion; 20717 20718 if ('replace' === action) { 20719 onReplace([value]); 20720 } else if ('insert-at-caret' === action) { 20721 insertCompletion(value); 20722 } 20723 } // Reset autocomplete state after insertion rather than before 20724 // so insertion events don't cause the completion menu to redisplay. 20725 20726 20727 reset(); 20728 } 20729 20730 function reset() { 20731 setSelectedIndex(0); 20732 setFilteredOptions([]); 20733 setFilterValue(''); 20734 setAutocompleter(null); 20735 setAutocompleterUI(null); 20736 } 20737 20738 function announce(options) { 20739 if (!debouncedSpeak) { 20740 return; 20741 } 20742 20743 if (!!options.length) { 20744 debouncedSpeak(Object(external_wp_i18n_["sprintf"])( 20745 /* translators: %d: number of results. */ 20746 Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', options.length), options.length), 'assertive'); 20747 } else { 20748 debouncedSpeak(Object(external_wp_i18n_["__"])('No results.'), 'assertive'); 20749 } 20750 } 20751 /** 20752 * Load options for an autocompleter. 20753 * 20754 * @param {Array} options 20755 */ 20756 20757 20758 function onChangeOptions(options) { 20759 setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0); 20760 setFilteredOptions(options); 20761 announce(options); 20762 } 20763 20764 function handleKeyDown(event) { 20765 setBackspacing(event.keyCode === external_wp_keycodes_["BACKSPACE"]); 20766 20767 if (!autocompleter) { 20768 return; 20769 } 20770 20771 if (filteredOptions.length === 0) { 20772 return; 20773 } 20774 20775 switch (event.keyCode) { 20776 case external_wp_keycodes_["UP"]: 20777 setSelectedIndex((selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1); 20778 break; 20779 20780 case external_wp_keycodes_["DOWN"]: 20781 setSelectedIndex((selectedIndex + 1) % filteredOptions.length); 20782 break; 20783 20784 case external_wp_keycodes_["ESCAPE"]: 20785 setAutocompleter(null); 20786 setAutocompleterUI(null); 20787 break; 20788 20789 case external_wp_keycodes_["ENTER"]: 20790 select(filteredOptions[selectedIndex]); 20791 break; 20792 20793 case external_wp_keycodes_["LEFT"]: 20794 case external_wp_keycodes_["RIGHT"]: 20795 reset(); 20796 return; 20797 20798 default: 20799 return; 20800 } // Any handled keycode should prevent original behavior. This relies on 20801 // the early return in the default case. 20802 20803 20804 event.preventDefault(); 20805 event.stopPropagation(); 20806 } 20807 20808 let textContent; 20809 20810 if (Object(external_wp_richText_["isCollapsed"])(record)) { 20811 textContent = Object(external_wp_richText_["getTextContent"])(Object(external_wp_richText_["slice"])(record, 0)); 20812 } 20813 20814 Object(external_wp_element_["useEffect"])(() => { 20815 if (!textContent) { 20816 reset(); 20817 return; 20818 } 20819 20820 const text = Object(external_lodash_["deburr"])(textContent); 20821 const textAfterSelection = Object(external_wp_richText_["getTextContent"])(Object(external_wp_richText_["slice"])(record, undefined, Object(external_wp_richText_["getTextContent"])(record).length)); 20822 const completer = Object(external_lodash_["find"])(completers, ({ 20823 triggerPrefix, 20824 allowContext 20825 }) => { 20826 const index = text.lastIndexOf(triggerPrefix); 20827 20828 if (index === -1) { 20829 return false; 20830 } 20831 20832 const textWithoutTrigger = text.slice(index + triggerPrefix.length); 20833 const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit. 20834 // This is a final barrier to prevent the effect from completing with 20835 // an extremely long string, which causes the editor to slow-down 20836 // significantly. This could happen, for example, if `matchingWhileBackspacing` 20837 // is true and one of the "words" end up being too long. If that's the case, 20838 // it will be caught by this guard. 20839 20840 if (tooDistantFromTrigger) return false; 20841 const mismatch = filteredOptions.length === 0; 20842 const wordsFromTrigger = textWithoutTrigger.split(/\s/); // We need to allow the effect to run when not backspacing and if there 20843 // was a mismatch. i.e when typing a trigger + the match string or when 20844 // clicking in an existing trigger word on the page. We do that if we 20845 // detect that we have one word from trigger in the current textual context. 20846 // 20847 // Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and 20848 // allow the effect to run. It will run until there's a mismatch. 20849 20850 const hasOneTriggerWord = wordsFromTrigger.length === 1; // This is used to allow the effect to run when backspacing and if 20851 // "touching" a word that "belongs" to a trigger. We consider a "trigger 20852 // word" any word up to the limit of 3 from the trigger character. 20853 // Anything beyond that is ignored if there's a mismatch. This allows 20854 // us to "escape" a mismatch when backspacing, but still imposing some 20855 // sane limits. 20856 // 20857 // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but 20858 // if the user presses backspace here, it will show the completion popup again. 20859 20860 const matchingWhileBackspacing = backspacing && textWithoutTrigger.split(/\s/).length <= 3; 20861 20862 if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) { 20863 return false; 20864 } 20865 20866 if (allowContext && !allowContext(text.slice(0, index), textAfterSelection)) { 20867 return false; 20868 } 20869 20870 if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) { 20871 return false; 20872 } 20873 20874 return /[\u0000-\uFFFF]*$/.test(textWithoutTrigger); 20875 }); 20876 20877 if (!completer) { 20878 reset(); 20879 return; 20880 } 20881 20882 const safeTrigger = Object(external_lodash_["escapeRegExp"])(completer.triggerPrefix); 20883 const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\u0000-\uFFFF]*)$`)); 20884 const query = match && match[1]; 20885 setAutocompleter(completer); 20886 setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI); 20887 setFilterValue(query); 20888 }, [textContent]); 20889 const { 20890 key: selectedKey = '' 20891 } = filteredOptions[selectedIndex] || {}; 20892 const { 20893 className 20894 } = autocompleter || {}; 20895 const isExpanded = !!autocompleter && filteredOptions.length > 0; 20896 const listBoxId = isExpanded ? `components-autocomplete-listbox-${instanceId}` : null; 20897 const activeId = isExpanded ? `components-autocomplete-item-${instanceId}-${selectedKey}` : null; 20898 const hasSelection = record.start !== undefined; 20899 return { 20900 listBoxId, 20901 activeId, 20902 onKeyDown: handleKeyDown, 20903 popover: hasSelection && AutocompleterUI && Object(external_wp_element_["createElement"])(AutocompleterUI, { 20904 className: className, 20905 filterValue: filterValue, 20906 instanceId: instanceId, 20907 listBoxId: listBoxId, 20908 selectedIndex: selectedIndex, 20909 onChangeOptions: onChangeOptions, 20910 onSelect: select, 20911 value: record, 20912 contentRef: contentRef 20913 }) 20914 }; 20915 } 20916 20917 function useAutocompleteProps(options) { 20918 const ref = Object(external_wp_element_["useRef"])(); 20919 const onKeyDownRef = Object(external_wp_element_["useRef"])(); 20920 const { 20921 popover, 20922 listBoxId, 20923 activeId, 20924 onKeyDown 20925 } = useAutocomplete({ ...options, 20926 contentRef: ref 20927 }); 20928 onKeyDownRef.current = onKeyDown; 20929 return { 20930 ref: Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_compose_["useRefEffect"])(element => { 20931 function _onKeyDown(event) { 20932 onKeyDownRef.current(event); 20933 } 20934 20935 element.addEventListener('keydown', _onKeyDown); 20936 return () => { 20937 element.removeEventListener('keydown', _onKeyDown); 20938 }; 20939 }, [])]), 20940 children: popover, 20941 'aria-autocomplete': listBoxId ? 'list' : undefined, 20942 'aria-owns': listBoxId, 20943 'aria-activedescendant': activeId 20944 }; 20945 } 20946 function Autocomplete({ 20947 children, 20948 isSelected, 20949 ...options 20950 }) { 20951 const { 20952 popover, 20953 ...props 20954 } = useAutocomplete(options); 20955 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, children(props), isSelected && popover); 20956 } 20957 20958 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js 20959 20960 20961 function unit_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 20962 20963 /** 20964 * External dependencies 20965 */ 20966 20967 20968 /** 20969 * Internal dependencies 20970 */ 20971 20972 20973 const unit_control_styles_Root = styled_base_browser_esm("div", { 20974 target: "e1agakv00", 20975 label: "Root" 20976 })( true ? { 20977 name: "1bt0omd", 20978 styles: "box-sizing:border-box;position:relative;" 20979 } : undefined); 20980 20981 const paddingStyles = ({ 20982 disableUnits 20983 }) => { 20984 const value = disableUnits ? 3 : 24; 20985 return /*#__PURE__*/css_browser_esm(rtl_rtl({ 20986 paddingRight: value 20987 })(), ";" + ( true ? "" : undefined)); 20988 }; 20989 20990 var unit_control_styles_ref = true ? { 20991 name: "1y65o8", 20992 styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}" 20993 } : undefined; 20994 20995 const arrowStyles = ({ 20996 disableUnits 20997 }) => { 20998 if (disableUnits) return ''; 20999 return unit_control_styles_ref; 21000 }; // TODO: Resolve need to use &&& to increase specificity 21001 // https://github.com/WordPress/gutenberg/issues/18483 21002 21003 21004 const ValueInput = /*#__PURE__*/styled_base_browser_esm(number_control, { 21005 target: "e1agakv01", 21006 label: "ValueInput" 21007 })("&&&{input{appearance:none;-moz-appearance:textfield;display:block;width:100%;", arrowStyles, ";", paddingStyles, ";}}" + ( true ? "" : undefined)); 21008 21009 const unitSizeStyles = ({ 21010 size 21011 }) => { 21012 const sizes = { 21013 default: { 21014 height: 28, 21015 lineHeight: '24px', 21016 minHeight: 28, 21017 top: 1 21018 }, 21019 small: { 21020 height: 22, 21021 lineHeight: '18px', 21022 minHeight: 22, 21023 top: 1 21024 } 21025 }; 21026 return /*#__PURE__*/css_browser_esm(sizes[size], true ? "" : undefined); 21027 }; 21028 21029 const baseUnitLabelStyles = props => { 21030 return /*#__PURE__*/css_browser_esm("appearance:none;background:transparent;border-radius:2px;border:none;box-sizing:border-box;color:", COLORS.darkGray[500], ";display:block;font-size:8px;line-height:1;letter-spacing:-0.5px;outline:none;padding:2px 1px;position:absolute;text-align-last:center;text-transform:uppercase;width:20px;", rtl_rtl({ 21031 borderTopLeftRadius: 0, 21032 borderBottomLeftRadius: 0 21033 })(), " ", rtl_rtl({ 21034 right: 0 21035 })(), " ", unitSizeStyles(props), true ? "" : undefined); 21036 }; 21037 21038 const UnitLabel = styled_base_browser_esm("div", { 21039 target: "e1agakv02", 21040 label: "UnitLabel" 21041 })("&&&{pointer-events:none;", baseUnitLabelStyles, ";}" + ( true ? "" : undefined)); 21042 const UnitSelect = styled_base_browser_esm("select", { 21043 target: "e1agakv03", 21044 label: "UnitSelect" 21045 })("&&&{", baseUnitLabelStyles, ";cursor:pointer;border:1px solid transparent;&:hover{background-color:", COLORS.lightGray[300], ";}&:focus{border-color:", COLORS.ui.borderFocus, ";outline:2px solid transparent;outline-offset:0;}&:disabled{cursor:initial;&:hover{background-color:transparent;}}}" + ( true ? "" : undefined)); 21046 21047 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/utils.js 21048 /** 21049 * External dependencies 21050 */ 21051 21052 /** 21053 * WordPress dependencies 21054 */ 21055 21056 21057 21058 const isWeb = external_wp_element_["Platform"].OS === 'web'; 21059 /** 21060 * An array of all available CSS length units. 21061 */ 21062 21063 const ALL_CSS_UNITS = [{ 21064 value: 'px', 21065 label: isWeb ? 'px' : Object(external_wp_i18n_["__"])('Pixels (px)'), 21066 default: '', 21067 a11yLabel: Object(external_wp_i18n_["__"])('Pixels (px)') 21068 }, { 21069 value: '%', 21070 label: isWeb ? '%' : Object(external_wp_i18n_["__"])('Percentage (%)'), 21071 default: '', 21072 a11yLabel: Object(external_wp_i18n_["__"])('Percent (%)') 21073 }, { 21074 value: 'em', 21075 label: isWeb ? 'em' : Object(external_wp_i18n_["__"])('Relative to parent font size (em)'), 21076 default: '', 21077 a11yLabel: Object(external_wp_i18n_["__"])('Relative to parent font size (em)') 21078 }, { 21079 value: 'rem', 21080 label: isWeb ? 'rem' : Object(external_wp_i18n_["__"])('Relative to root font size (rem)'), 21081 default: '', 21082 a11yLabel: Object(external_wp_i18n_["__"])('Relative to root font size (rem)') 21083 }, { 21084 value: 'vw', 21085 label: isWeb ? 'vw' : Object(external_wp_i18n_["__"])('Viewport width (vw)'), 21086 default: '', 21087 a11yLabel: Object(external_wp_i18n_["__"])('Viewport width (vw)') 21088 }, { 21089 value: 'vh', 21090 label: isWeb ? 'vh' : Object(external_wp_i18n_["__"])('Viewport height (vh)'), 21091 default: '', 21092 a11yLabel: Object(external_wp_i18n_["__"])('Viewport height (vh)') 21093 }, { 21094 value: 'vmin', 21095 label: isWeb ? 'vmin' : Object(external_wp_i18n_["__"])('Viewport smallest dimension (vmin)'), 21096 default: '', 21097 a11yLabel: Object(external_wp_i18n_["__"])('Viewport smallest dimension (vmin)') 21098 }, { 21099 value: 'vmax', 21100 label: isWeb ? 'vmax' : Object(external_wp_i18n_["__"])('Viewport largest dimension (vmax)'), 21101 default: '', 21102 a11yLabel: Object(external_wp_i18n_["__"])('Viewport largest dimension (vmax)') 21103 }, { 21104 value: 'ch', 21105 label: isWeb ? 'ch' : Object(external_wp_i18n_["__"])('Width of the zero (0) character (ch)'), 21106 default: '', 21107 a11yLabel: Object(external_wp_i18n_["__"])('Width of the zero (0) character (ch)') 21108 }, { 21109 value: 'ex', 21110 label: isWeb ? 'ex' : Object(external_wp_i18n_["__"])('x-height of the font (ex)'), 21111 default: '', 21112 a11yLabel: Object(external_wp_i18n_["__"])('x-height of the font (ex)') 21113 }, { 21114 value: 'cm', 21115 label: isWeb ? 'cm' : Object(external_wp_i18n_["__"])('Centimeters (cm)'), 21116 default: '', 21117 a11yLabel: Object(external_wp_i18n_["__"])('Centimeters (cm)') 21118 }, { 21119 value: 'mm', 21120 label: isWeb ? 'mm' : Object(external_wp_i18n_["__"])('Millimeters (mm)'), 21121 default: '', 21122 a11yLabel: Object(external_wp_i18n_["__"])('Millimeters (mm)') 21123 }, { 21124 value: 'in', 21125 label: isWeb ? 'in' : Object(external_wp_i18n_["__"])('Inches (in)'), 21126 default: '', 21127 a11yLabel: Object(external_wp_i18n_["__"])('Inches (in)') 21128 }, { 21129 value: 'pc', 21130 label: isWeb ? 'pc' : Object(external_wp_i18n_["__"])('Picas (pc)'), 21131 default: '', 21132 a11yLabel: Object(external_wp_i18n_["__"])('Picas (pc)') 21133 }, { 21134 value: 'pt', 21135 label: isWeb ? 'pt' : Object(external_wp_i18n_["__"])('Points (pt)'), 21136 default: '', 21137 a11yLabel: Object(external_wp_i18n_["__"])('Points (pt)') 21138 }]; 21139 /** 21140 * Units of measurements. `a11yLabel` is used by screenreaders. 21141 */ 21142 21143 const CSS_UNITS = [{ 21144 value: 'px', 21145 label: 'px', 21146 default: 0, 21147 a11yLabel: Object(external_wp_i18n_["__"])('pixels') 21148 }, { 21149 value: '%', 21150 label: '%', 21151 default: 10, 21152 a11yLabel: Object(external_wp_i18n_["__"])('percent') 21153 }, { 21154 value: 'em', 21155 label: 'em', 21156 default: 0, 21157 a11yLabel: Object(external_wp_i18n_["_x"])('ems', 'Relative to parent font size (em)') 21158 }, { 21159 value: 'rem', 21160 label: 'rem', 21161 default: 0, 21162 a11yLabel: Object(external_wp_i18n_["_x"])('rems', 'Relative to root font size (rem)') 21163 }, { 21164 value: 'vw', 21165 label: 'vw', 21166 default: 10, 21167 a11yLabel: Object(external_wp_i18n_["__"])('viewport widths') 21168 }, { 21169 value: 'vh', 21170 label: 'vh', 21171 default: 10, 21172 a11yLabel: Object(external_wp_i18n_["__"])('viewport heights') 21173 }]; 21174 const DEFAULT_UNIT = CSS_UNITS[0]; 21175 /** 21176 * Handles legacy value + unit handling. 21177 * This component use to manage both incoming value and units separately. 21178 * 21179 * Moving forward, ideally the value should be a string that contains both 21180 * the value and unit, example: '10px' 21181 * 21182 * @param {number|string} value Value 21183 * @param {string} unit Unit value 21184 * @param {Array<Object>} units Units to derive from. 21185 * @return {Array<number, string>} The extracted number and unit. 21186 */ 21187 21188 function getParsedValue(value, unit, units) { 21189 const initialValue = unit ? `${value}${unit}` : value; 21190 return parseUnit(initialValue, units); 21191 } 21192 /** 21193 * Checks if units are defined. 21194 * 21195 * @param {any} units Units to check. 21196 * @return {boolean} Whether units are defined. 21197 */ 21198 21199 function utils_hasUnits(units) { 21200 return !Object(external_lodash_["isEmpty"])(units) && units.length > 1 && units !== false; 21201 } 21202 /** 21203 * Parses a number and unit from a value. 21204 * 21205 * @param {string} initialValue Value to parse 21206 * @param {Array<Object>} units Units to derive from. 21207 * @return {Array<number, string>} The extracted number and unit. 21208 */ 21209 21210 function parseUnit(initialValue, units = ALL_CSS_UNITS) { 21211 const value = String(initialValue).trim(); 21212 let num = parseFloat(value, 10); 21213 num = isNaN(num) ? '' : num; 21214 const unitMatch = value.match(/[\d.\-\+]*\s*(.*)/)[1]; 21215 let unit = unitMatch !== undefined ? unitMatch : ''; 21216 unit = unit.toLowerCase(); 21217 21218 if (utils_hasUnits(units)) { 21219 const match = units.find(item => item.value === unit); 21220 unit = match === null || match === void 0 ? void 0 : match.value; 21221 } else { 21222 unit = DEFAULT_UNIT.value; 21223 } 21224 21225 return [num, unit]; 21226 } 21227 /** 21228 * Parses a number and unit from a value. Validates parsed value, using fallback 21229 * value if invalid. 21230 * 21231 * @param {number|string} next The next value. 21232 * @param {Array<Object>} units Units to derive from. 21233 * @param {number|string} fallbackValue The fallback value. 21234 * @param {string} fallbackUnit The fallback value. 21235 * @return {Array<number, string>} The extracted number and unit. 21236 */ 21237 21238 function getValidParsedUnit(next, units, fallbackValue, fallbackUnit) { 21239 const [parsedValue, parsedUnit] = parseUnit(next, units); 21240 let baseValue = parsedValue; 21241 let baseUnit; 21242 21243 if (isNaN(parsedValue) || parsedValue === '') { 21244 baseValue = fallbackValue; 21245 } 21246 21247 baseUnit = parsedUnit || fallbackUnit; 21248 /** 21249 * If no unit is found, attempt to use the first value from the collection 21250 * of units as a default fallback. 21251 */ 21252 21253 if (utils_hasUnits(units) && !baseUnit) { 21254 var _units$; 21255 21256 baseUnit = (_units$ = units[0]) === null || _units$ === void 0 ? void 0 : _units$.value; 21257 } 21258 21259 return [baseValue, baseUnit]; 21260 } 21261 /** 21262 * Takes a unit value and finds the matching accessibility label for the 21263 * unit abbreviation. 21264 * 21265 * @param {string} unit Unit value (example: px) 21266 * @return {string} a11y label for the unit abbreviation 21267 */ 21268 21269 function parseA11yLabelForUnit(unit) { 21270 const match = ALL_CSS_UNITS.find(item => item.value === unit); 21271 return match !== null && match !== void 0 && match.a11yLabel ? match === null || match === void 0 ? void 0 : match.a11yLabel : match === null || match === void 0 ? void 0 : match.value; 21272 } 21273 /** 21274 * Filters available units based on values defined by settings. 21275 * 21276 * @param {Array} settings Collection of preferred units. 21277 * @param {Array} units Collection of available units. 21278 * 21279 * @return {Array} Filtered units based on settings. 21280 */ 21281 21282 function filterUnitsWithSettings(settings = [], units = []) { 21283 return units.filter(unit => { 21284 return settings.includes(unit.value); 21285 }); 21286 } 21287 /** 21288 * Custom hook to retrieve and consolidate units setting from add_theme_support(). 21289 * TODO: ideally this hook shouldn't be needed 21290 * https://github.com/WordPress/gutenberg/pull/31822#discussion_r633280823 21291 * 21292 * @param {Object} args An object containing units, settingPath & defaultUnits. 21293 * @param {Object} args.units Collection of available units. 21294 * @param {string} args.availableUnits The setting path. Defaults to 'spacing.units'. 21295 * @param {Object} args.defaultValues Collection of default values for defined units. Example: { px: '350', em: '15' }. 21296 * 21297 * @return {Array} Filtered units based on settings. 21298 */ 21299 21300 21301 const useCustomUnits = ({ 21302 units, 21303 availableUnits, 21304 defaultValues 21305 }) => { 21306 units = units || ALL_CSS_UNITS; 21307 const usedUnits = filterUnitsWithSettings(!availableUnits ? [] : availableUnits, units); 21308 21309 if (defaultValues) { 21310 usedUnits.forEach((unit, i) => { 21311 if (defaultValues[unit.value]) { 21312 usedUnits[i].default = defaultValues[unit.value]; 21313 } 21314 }); 21315 } 21316 21317 return usedUnits.length === 0 ? false : usedUnits; 21318 }; 21319 21320 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/unit-select-control.js 21321 21322 21323 21324 /** 21325 * External dependencies 21326 */ 21327 21328 21329 /** 21330 * Internal dependencies 21331 */ 21332 21333 21334 21335 /** 21336 * Renders a `select` if there are multiple units. 21337 * Otherwise, renders a non-selectable label. 21338 * 21339 * @param {Object} props Component props. 21340 * @param {string} [props.className] Class to set on the `select` element. 21341 * @param {boolean} [props.isTabbable=true] Whether the control can be focused via keyboard navigation. 21342 * @param {Array} [props.options=CSS_UNITS] Available units to select from. 21343 * @param {Function} [props.onChange=noop] A callback function invoked when the value is changed. 21344 * @param {string} [props.size="default"] Size of the control option. Supports "default" and "small". 21345 * @param {string} [props.value="px"] Current unit. 21346 */ 21347 21348 function UnitSelectControl({ 21349 className, 21350 isTabbable = true, 21351 options = CSS_UNITS, 21352 onChange = external_lodash_["noop"], 21353 size = 'default', 21354 value = 'px', 21355 ...props 21356 }) { 21357 if (!utils_hasUnits(options)) { 21358 return Object(external_wp_element_["createElement"])(UnitLabel, { 21359 className: "components-unit-control__unit-label", 21360 size: size 21361 }, value); 21362 } 21363 21364 const handleOnChange = event => { 21365 const { 21366 value: unitValue 21367 } = event.target; 21368 const data = options.find(option => option.value === unitValue); 21369 onChange(unitValue, { 21370 event, 21371 data 21372 }); 21373 }; 21374 21375 const classes = classnames_default()('components-unit-control__select', className); 21376 return Object(external_wp_element_["createElement"])(UnitSelect, Object(esm_extends["a" /* default */])({ 21377 className: classes, 21378 onChange: handleOnChange, 21379 size: size, 21380 tabIndex: isTabbable ? null : '-1', 21381 value: value 21382 }, props), options.map(option => Object(external_wp_element_["createElement"])("option", { 21383 value: option.value, 21384 key: option.value 21385 }, option.label))); 21386 } 21387 21388 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-state.js 21389 /** 21390 * WordPress dependencies 21391 */ 21392 21393 /** 21394 * Internal dependencies 21395 */ 21396 21397 21398 /** 21399 * @template T 21400 * @typedef Options 21401 * @property {T | undefined} initial Initial value 21402 * @property {T | ""} fallback Fallback value 21403 */ 21404 21405 /** @type {Readonly<{ initial: undefined, fallback: '' }>} */ 21406 21407 const defaultOptions = { 21408 initial: undefined, 21409 21410 /** 21411 * Defaults to empty string, as that is preferred for usage with 21412 * <input />, <textarea />, and <select /> form elements. 21413 */ 21414 fallback: '' 21415 }; 21416 /** 21417 * Custom hooks for "controlled" components to track and consolidate internal 21418 * state and incoming values. This is useful for components that render 21419 * `input`, `textarea`, or `select` HTML elements. 21420 * 21421 * https://reactjs.org/docs/forms.html#controlled-components 21422 * 21423 * At first, a component using useControlledState receives an initial prop 21424 * value, which is used as initial internal state. 21425 * 21426 * This internal state can be maintained and updated without 21427 * relying on new incoming prop values. 21428 * 21429 * Unlike the basic useState hook, useControlledState's state can 21430 * be updated if a new incoming prop value is changed. 21431 * 21432 * @template T 21433 * 21434 * @param {T | undefined} currentState The current value. 21435 * @param {Options<T>} [options=defaultOptions] Additional options for the hook. 21436 * 21437 * @return {[T | "", (nextState: T) => void]} The controlled value and the value setter. 21438 */ 21439 21440 function useControlledState(currentState, options = defaultOptions) { 21441 const { 21442 initial, 21443 fallback 21444 } = { ...defaultOptions, 21445 ...options 21446 }; 21447 const [internalState, setInternalState] = Object(external_wp_element_["useState"])(currentState); 21448 const hasCurrentState = isValueDefined(currentState); 21449 /* 21450 * Resets internal state if value every changes from uncontrolled <-> controlled. 21451 */ 21452 21453 Object(external_wp_element_["useEffect"])(() => { 21454 if (hasCurrentState && internalState) { 21455 setInternalState(undefined); 21456 } 21457 }, [hasCurrentState, internalState]); 21458 const state = getDefinedValue([currentState, internalState, initial], fallback); 21459 /* eslint-disable jsdoc/no-undefined-types */ 21460 21461 /** @type {(nextState: T) => void} */ 21462 21463 const setState = nextState => { 21464 if (!hasCurrentState) { 21465 setInternalState(nextState); 21466 } 21467 }; 21468 /* eslint-enable jsdoc/no-undefined-types */ 21469 21470 21471 return [state, setState]; 21472 } 21473 21474 /* harmony default export */ var use_controlled_state = (useControlledState); 21475 21476 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/index.js 21477 21478 21479 21480 /** 21481 * External dependencies 21482 */ 21483 21484 21485 /** 21486 * WordPress dependencies 21487 */ 21488 21489 21490 21491 21492 /** 21493 * Internal dependencies 21494 */ 21495 21496 21497 21498 21499 21500 21501 21502 function UnitControl({ 21503 __unstableStateReducer: stateReducer = state => state, 21504 autoComplete = 'off', 21505 className, 21506 disabled = false, 21507 disableUnits = false, 21508 isPressEnterToChange = false, 21509 isResetValueOnUnitChange = false, 21510 isUnitSelectTabbable = true, 21511 label, 21512 onChange = external_lodash_["noop"], 21513 onUnitChange = external_lodash_["noop"], 21514 size = 'default', 21515 style, 21516 unit: unitProp, 21517 units = CSS_UNITS, 21518 value: valueProp, 21519 ...props 21520 }, ref) { 21521 const [value, initialUnit] = getParsedValue(valueProp, unitProp, units); 21522 const [unit, setUnit] = use_controlled_state(unitProp, { 21523 initial: initialUnit 21524 }); // Stores parsed value for hand-off in state reducer 21525 21526 const refParsedValue = Object(external_wp_element_["useRef"])(null); 21527 const classes = classnames_default()('components-unit-control', className); 21528 21529 const handleOnChange = (next, changeProps) => { 21530 if (next === '') { 21531 onChange('', changeProps); 21532 return; 21533 } 21534 /* 21535 * Customizing the onChange callback. 21536 * This allows as to broadcast a combined value+unit to onChange. 21537 */ 21538 21539 21540 next = getValidParsedUnit(next, units, value, unit).join(''); 21541 onChange(next, changeProps); 21542 }; 21543 21544 const handleOnUnitChange = (next, changeProps) => { 21545 const { 21546 data 21547 } = changeProps; 21548 let nextValue = `${value}${next}`; 21549 21550 if (isResetValueOnUnitChange && (data === null || data === void 0 ? void 0 : data.default) !== undefined) { 21551 nextValue = `${data.default}${next}`; 21552 } 21553 21554 onChange(nextValue, changeProps); 21555 onUnitChange(next, changeProps); 21556 setUnit(next); 21557 }; 21558 21559 const mayUpdateUnit = event => { 21560 if (!isNaN(event.target.value)) { 21561 refParsedValue.current = null; 21562 return; 21563 } 21564 21565 const [parsedValue, parsedUnit] = getValidParsedUnit(event.target.value, units, value, unit); 21566 refParsedValue.current = parsedValue; 21567 21568 if (isPressEnterToChange && parsedUnit !== unit) { 21569 const data = units.find(option => option.value === parsedUnit); 21570 const changeProps = { 21571 event, 21572 data 21573 }; 21574 onChange(`${parsedValue}${parsedUnit}`, changeProps); 21575 onUnitChange(parsedUnit, changeProps); 21576 setUnit(parsedUnit); 21577 } 21578 }; 21579 21580 const handleOnBlur = mayUpdateUnit; 21581 21582 const handleOnKeyDown = event => { 21583 const { 21584 keyCode 21585 } = event; 21586 21587 if (keyCode === external_wp_keycodes_["ENTER"]) { 21588 mayUpdateUnit(event); 21589 } 21590 }; 21591 /** 21592 * "Middleware" function that intercepts updates from InputControl. 21593 * This allows us to tap into actions to transform the (next) state for 21594 * InputControl. 21595 * 21596 * @param {Object} state State from InputControl 21597 * @param {Object} action Action triggering state change 21598 * @return {Object} The updated state to apply to InputControl 21599 */ 21600 21601 21602 const unitControlStateReducer = (state, action) => { 21603 /* 21604 * On commits (when pressing ENTER and on blur if 21605 * isPressEnterToChange is true), if a parse has been performed 21606 * then use that result to update the state. 21607 */ 21608 if (action.type === inputControlActionTypes.COMMIT) { 21609 if (refParsedValue.current !== null) { 21610 state.value = refParsedValue.current; 21611 refParsedValue.current = null; 21612 } 21613 } 21614 21615 return state; 21616 }; 21617 21618 const inputSuffix = !disableUnits ? Object(external_wp_element_["createElement"])(UnitSelectControl, { 21619 "aria-label": Object(external_wp_i18n_["__"])('Select unit'), 21620 disabled: disabled, 21621 isTabbable: isUnitSelectTabbable, 21622 options: units, 21623 onChange: handleOnUnitChange, 21624 size: size, 21625 value: unit 21626 }) : null; 21627 let step = props.step; 21628 /* 21629 * If no step prop has been passed, lookup the active unit and 21630 * try to get step from `units`, or default to a value of `1` 21631 */ 21632 21633 if (!step && units) { 21634 var _activeUnit$step; 21635 21636 const activeUnit = units.find(option => option.value === unit); 21637 step = (_activeUnit$step = activeUnit === null || activeUnit === void 0 ? void 0 : activeUnit.step) !== null && _activeUnit$step !== void 0 ? _activeUnit$step : 1; 21638 } 21639 21640 return Object(external_wp_element_["createElement"])(unit_control_styles_Root, { 21641 className: "components-unit-control-wrapper", 21642 style: style 21643 }, Object(external_wp_element_["createElement"])(ValueInput, Object(esm_extends["a" /* default */])({ 21644 "aria-label": label, 21645 type: isPressEnterToChange ? 'text' : 'number' 21646 }, Object(external_lodash_["omit"])(props, ['children']), { 21647 autoComplete: autoComplete, 21648 className: classes, 21649 disabled: disabled, 21650 disableUnits: disableUnits, 21651 isPressEnterToChange: isPressEnterToChange, 21652 label: label, 21653 onBlur: handleOnBlur, 21654 onKeyDown: handleOnKeyDown, 21655 onChange: handleOnChange, 21656 ref: ref, 21657 size: size, 21658 suffix: inputSuffix, 21659 value: value, 21660 step: step, 21661 __unstableStateReducer: composeStateReducers(unitControlStateReducer, stateReducer) 21662 }))); 21663 } 21664 21665 const ForwardedUnitControl = Object(external_wp_element_["forwardRef"])(UnitControl); 21666 21667 /* harmony default export */ var unit_control = (ForwardedUnitControl); 21668 21669 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js 21670 21671 21672 function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 21673 21674 /** 21675 * External dependencies 21676 */ 21677 21678 21679 /** 21680 * Internal dependencies 21681 */ 21682 21683 21684 21685 const box_control_styles_Root = styled_base_browser_esm("div", { 21686 target: "e7pk0lh0", 21687 label: "Root" 21688 })( true ? { 21689 name: "vho1ao", 21690 styles: "box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%;" 21691 } : undefined); 21692 const Header = /*#__PURE__*/styled_base_browser_esm(flex_component, { 21693 target: "e7pk0lh1", 21694 label: "Header" 21695 })("color:", COLORS.ui.label, ";padding-bottom:8px;" + ( true ? "" : undefined)); 21696 const HeaderControlWrapper = /*#__PURE__*/styled_base_browser_esm(flex_component, { 21697 target: "e7pk0lh2", 21698 label: "HeaderControlWrapper" 21699 })( true ? { 21700 name: "19de7qh", 21701 styles: "min-height:30px;" 21702 } : undefined); 21703 const UnitControlWrapper = styled_base_browser_esm("div", { 21704 target: "e7pk0lh3", 21705 label: "UnitControlWrapper" 21706 })( true ? { 21707 name: "zypm0w", 21708 styles: "box-sizing:border-box;max-width:80px;" 21709 } : undefined); 21710 const LayoutContainer = /*#__PURE__*/styled_base_browser_esm(flex_component, { 21711 target: "e7pk0lh4", 21712 label: "LayoutContainer" 21713 })( true ? { 21714 name: "39f89t", 21715 styles: "justify-content:center;padding-top:8px;" 21716 } : undefined); 21717 const Layout = /*#__PURE__*/styled_base_browser_esm(flex_component, { 21718 target: "e7pk0lh5", 21719 label: "Layout" 21720 })( true ? { 21721 name: "qpveuy", 21722 styles: "position:relative;height:100%;width:100%;justify-content:flex-start;" 21723 } : undefined); 21724 21725 var box_control_styles_ref = true ? { 21726 name: "icip60", 21727 styles: "border-radius:2px;" 21728 } : undefined; 21729 21730 var box_control_styles_ref2 = true ? { 21731 name: "1k07npk", 21732 styles: "border-radius:0;" 21733 } : undefined; 21734 21735 const unitControlBorderRadiusStyles = ({ 21736 isFirst, 21737 isLast, 21738 isOnly 21739 }) => { 21740 if (isFirst) { 21741 return rtl_rtl({ 21742 borderTopRightRadius: 0, 21743 borderBottomRightRadius: 0 21744 })(); 21745 } 21746 21747 if (isLast) { 21748 return rtl_rtl({ 21749 borderTopLeftRadius: 0, 21750 borderBottomLeftRadius: 0 21751 })(); 21752 } 21753 21754 if (isOnly) { 21755 return box_control_styles_ref; 21756 } 21757 21758 return box_control_styles_ref2; 21759 }; 21760 21761 const unitControlMarginStyles = ({ 21762 isFirst 21763 }) => { 21764 const marginLeft = isFirst ? 0 : -1; 21765 return rtl_rtl({ 21766 marginLeft 21767 })(); 21768 }; 21769 21770 const box_control_styles_UnitControl = /*#__PURE__*/styled_base_browser_esm(unit_control, { 21771 target: "e7pk0lh6", 21772 label: "UnitControl" 21773 })("max-width:60px;", unitControlBorderRadiusStyles, ";", unitControlMarginStyles, ";" + ( true ? "" : undefined)); 21774 21775 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/unit-control.js 21776 21777 21778 21779 /** 21780 * External dependencies 21781 */ 21782 21783 21784 /** 21785 * Internal dependencies 21786 */ 21787 21788 21789 21790 function BoxUnitControl({ 21791 isFirst, 21792 isLast, 21793 isOnly, 21794 onHoverOn = external_lodash_["noop"], 21795 onHoverOff = external_lodash_["noop"], 21796 label, 21797 value, 21798 ...props 21799 }) { 21800 const bindHoverGesture = useHover(({ 21801 event, 21802 ...state 21803 }) => { 21804 if (state.hovering) { 21805 onHoverOn(event, state); 21806 } else { 21807 onHoverOff(event, state); 21808 } 21809 }); 21810 return Object(external_wp_element_["createElement"])(UnitControlWrapper, bindHoverGesture(), Object(external_wp_element_["createElement"])(Tooltip, { 21811 text: label 21812 }, Object(external_wp_element_["createElement"])(box_control_styles_UnitControl, Object(esm_extends["a" /* default */])({ 21813 "aria-label": label, 21814 className: "component-box-control__unit-control", 21815 hideHTMLArrows: true, 21816 isFirst: isFirst, 21817 isLast: isLast, 21818 isOnly: isOnly, 21819 isPressEnterToChange: true, 21820 isResetValueOnUnitChange: false, 21821 value: value 21822 }, props)))); 21823 } 21824 21825 function Tooltip({ 21826 children, 21827 text 21828 }) { 21829 if (!text) return children; 21830 /** 21831 * Wrapping the children in a `<div />` as Tooltip as it attempts 21832 * to render the <UnitControl />. Using a plain `<div />` appears to 21833 * resolve this issue. 21834 * 21835 * Originally discovered and referenced here: 21836 * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026 21837 */ 21838 21839 return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], { 21840 text: text, 21841 position: "top" 21842 }, Object(external_wp_element_["createElement"])("div", null, children)); 21843 } 21844 21845 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/utils.js 21846 /** 21847 * External dependencies 21848 */ 21849 21850 /** 21851 * WordPress dependencies 21852 */ 21853 21854 21855 /** 21856 * Internal dependencies 21857 */ 21858 21859 21860 const LABELS = { 21861 all: Object(external_wp_i18n_["__"])('All'), 21862 top: Object(external_wp_i18n_["__"])('Top'), 21863 bottom: Object(external_wp_i18n_["__"])('Bottom'), 21864 left: Object(external_wp_i18n_["__"])('Left'), 21865 right: Object(external_wp_i18n_["__"])('Right'), 21866 mixed: Object(external_wp_i18n_["__"])('Mixed') 21867 }; 21868 const DEFAULT_VALUES = { 21869 top: null, 21870 right: null, 21871 bottom: null, 21872 left: null 21873 }; 21874 const DEFAULT_VISUALIZER_VALUES = { 21875 top: false, 21876 right: false, 21877 bottom: false, 21878 left: false 21879 }; 21880 /** 21881 * Gets an items with the most occurance within an array 21882 * https://stackoverflow.com/a/20762713 21883 * 21884 * @param {Array<any>} arr Array of items to check. 21885 * @return {any} The item with the most occurances. 21886 */ 21887 21888 function mode(arr) { 21889 return arr.sort((a, b) => arr.filter(v => v === a).length - arr.filter(v => v === b).length).pop(); 21890 } 21891 /** 21892 * Gets the 'all' input value and unit from values data. 21893 * 21894 * @param {Object} values Box values. 21895 * @return {string} A value + unit for the 'all' input. 21896 */ 21897 21898 21899 function getAllValue(values = {}) { 21900 const parsedValues = Object.values(values).map(value => parseUnit(value)); 21901 const allValues = parsedValues.map(value => value[0]); 21902 const allUnits = parsedValues.map(value => value[1]); 21903 const value = allValues.every(v => v === allValues[0]) ? allValues[0] : ''; 21904 const unit = mode(allUnits); 21905 /** 21906 * The isNumber check is important. On reset actions, the incoming value 21907 * may be null or an empty string. 21908 * 21909 * Also, the value may also be zero (0), which is considered a valid unit value. 21910 * 21911 * isNumber() is more specific for these cases, rather than relying on a 21912 * simple truthy check. 21913 */ 21914 21915 const allValue = Object(external_lodash_["isNumber"])(value) ? `${value}${unit}` : null; 21916 return allValue; 21917 } 21918 /** 21919 * Checks to determine if values are mixed. 21920 * 21921 * @param {Object} values Box values. 21922 * @return {boolean} Whether values are mixed. 21923 */ 21924 21925 function isValuesMixed(values = {}) { 21926 const allValue = getAllValue(values); 21927 const isMixed = isNaN(parseFloat(allValue)); 21928 return isMixed; 21929 } 21930 /** 21931 * Checks to determine if values are defined. 21932 * 21933 * @param {Object} values Box values. 21934 * 21935 * @return {boolean} Whether values are mixed. 21936 */ 21937 21938 function isValuesDefined(values) { 21939 return values !== undefined && !Object(external_lodash_["isEmpty"])(Object.values(values).filter( // Switching units when input is empty causes values only 21940 // containing units. This gives false positive on mixed values 21941 // unless filtered. 21942 value => !!value && /\d/.test(value))); 21943 } 21944 21945 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/all-input-control.js 21946 21947 21948 21949 /** 21950 * External dependencies 21951 */ 21952 21953 /** 21954 * Internal dependencies 21955 */ 21956 21957 21958 21959 function AllInputControl({ 21960 onChange = external_lodash_["noop"], 21961 onFocus = external_lodash_["noop"], 21962 onHoverOn = external_lodash_["noop"], 21963 onHoverOff = external_lodash_["noop"], 21964 values, 21965 sides, 21966 ...props 21967 }) { 21968 const allValue = getAllValue(values); 21969 const hasValues = isValuesDefined(values); 21970 const isMixed = hasValues && isValuesMixed(values); 21971 const allPlaceholder = isMixed ? LABELS.mixed : null; 21972 21973 const handleOnFocus = event => { 21974 onFocus(event, { 21975 side: 'all' 21976 }); 21977 }; 21978 21979 const handleOnChange = next => { 21980 const nextValues = { ...values 21981 }; 21982 const selectedSides = sides !== null && sides !== void 0 && sides.length ? sides : ['top', 'right', 'bottom', 'left']; 21983 selectedSides.forEach(side => nextValues[side] = next); 21984 onChange(nextValues); 21985 }; 21986 21987 const handleOnHoverOn = () => { 21988 onHoverOn({ 21989 top: true, 21990 bottom: true, 21991 left: true, 21992 right: true 21993 }); 21994 }; 21995 21996 const handleOnHoverOff = () => { 21997 onHoverOff({ 21998 top: false, 21999 bottom: false, 22000 left: false, 22001 right: false 22002 }); 22003 }; 22004 22005 return Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, { 22006 disableUnits: isMixed, 22007 isOnly: true, 22008 value: allValue, 22009 onChange: handleOnChange, 22010 onFocus: handleOnFocus, 22011 onHoverOn: handleOnHoverOn, 22012 onHoverOff: handleOnHoverOff, 22013 placeholder: allPlaceholder 22014 })); 22015 } 22016 22017 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/input-controls.js 22018 22019 22020 22021 /** 22022 * External dependencies 22023 */ 22024 22025 /** 22026 * Internal dependencies 22027 */ 22028 22029 22030 22031 22032 const allSides = ['top', 'right', 'bottom', 'left']; 22033 function BoxInputControls({ 22034 onChange = external_lodash_["noop"], 22035 onFocus = external_lodash_["noop"], 22036 onHoverOn = external_lodash_["noop"], 22037 onHoverOff = external_lodash_["noop"], 22038 values, 22039 sides, 22040 ...props 22041 }) { 22042 const createHandleOnFocus = side => event => { 22043 onFocus(event, { 22044 side 22045 }); 22046 }; 22047 22048 const createHandleOnHoverOn = side => () => { 22049 onHoverOn({ 22050 [side]: true 22051 }); 22052 }; 22053 22054 const createHandleOnHoverOff = side => () => { 22055 onHoverOff({ 22056 [side]: false 22057 }); 22058 }; 22059 22060 const handleOnChange = nextValues => { 22061 onChange(nextValues); 22062 }; 22063 22064 const createHandleOnChange = side => (next, { 22065 event 22066 }) => { 22067 const { 22068 altKey 22069 } = event; 22070 const nextValues = { ...values 22071 }; 22072 nextValues[side] = next; 22073 /** 22074 * Supports changing pair sides. For example, holding the ALT key 22075 * when changing the TOP will also update BOTTOM. 22076 */ 22077 22078 if (altKey) { 22079 switch (side) { 22080 case 'top': 22081 nextValues.bottom = next; 22082 break; 22083 22084 case 'bottom': 22085 nextValues.top = next; 22086 break; 22087 22088 case 'left': 22089 nextValues.right = next; 22090 break; 22091 22092 case 'right': 22093 nextValues.left = next; 22094 break; 22095 } 22096 } 22097 22098 handleOnChange(nextValues); 22099 }; // Filter sides if custom configuration provided, maintaining default order. 22100 22101 22102 const filteredSides = sides !== null && sides !== void 0 && sides.length ? allSides.filter(side => sides.includes(side)) : allSides; 22103 const first = filteredSides[0]; 22104 const last = filteredSides[filteredSides.length - 1]; 22105 const only = first === last && first; 22106 return Object(external_wp_element_["createElement"])(LayoutContainer, { 22107 className: "component-box-control__input-controls-wrapper" 22108 }, Object(external_wp_element_["createElement"])(Layout, { 22109 gap: 0, 22110 align: "top", 22111 className: "component-box-control__input-controls" 22112 }, filteredSides.map(side => Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, { 22113 isFirst: first === side, 22114 isLast: last === side, 22115 isOnly: only === side, 22116 value: values[side], 22117 onChange: createHandleOnChange(side), 22118 onFocus: createHandleOnFocus(side), 22119 onHoverOn: createHandleOnHoverOn(side), 22120 onHoverOff: createHandleOnHoverOff(side), 22121 label: LABELS[side], 22122 key: `box-control-${side}` 22123 }))))); 22124 } 22125 22126 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js 22127 22128 22129 function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 22130 22131 /** 22132 * External dependencies 22133 */ 22134 22135 const box_control_icon_styles_Root = styled_base_browser_esm("span", { 22136 target: "eaw9yqk0", 22137 label: "Root" 22138 })( true ? { 22139 name: "1qtciqq", 22140 styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px;" 22141 } : undefined); 22142 const Viewbox = styled_base_browser_esm("span", { 22143 target: "eaw9yqk1", 22144 label: "Viewbox" 22145 })( true ? { 22146 name: "be7uli", 22147 styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%;" 22148 } : undefined); 22149 22150 const strokeFocus = ({ 22151 isFocused 22152 }) => { 22153 return /*#__PURE__*/css_browser_esm({ 22154 backgroundColor: 'currentColor', 22155 opacity: isFocused ? 1 : 0.3 22156 }, true ? "" : undefined); 22157 }; 22158 22159 const Stroke = styled_base_browser_esm("span", { 22160 target: "eaw9yqk2", 22161 label: "Stroke" 22162 })("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : undefined)); 22163 22164 const VerticalStroke = /*#__PURE__*/styled_base_browser_esm(Stroke, { 22165 target: "eaw9yqk3", 22166 label: "VerticalStroke" 22167 })( true ? { 22168 name: "r820ty", 22169 styles: "bottom:3px;top:3px;width:2px;" 22170 } : undefined); 22171 22172 const HorizontalStroke = /*#__PURE__*/styled_base_browser_esm(Stroke, { 22173 target: "eaw9yqk4", 22174 label: "HorizontalStroke" 22175 })( true ? { 22176 name: "1gteeqa", 22177 styles: "height:2px;left:3px;right:3px;" 22178 } : undefined); 22179 22180 const TopStroke = /*#__PURE__*/styled_base_browser_esm(HorizontalStroke, { 22181 target: "eaw9yqk5", 22182 label: "TopStroke" 22183 })( true ? { 22184 name: "1etxbbi", 22185 styles: "top:0;" 22186 } : undefined); 22187 const RightStroke = /*#__PURE__*/styled_base_browser_esm(VerticalStroke, { 22188 target: "eaw9yqk6", 22189 label: "RightStroke" 22190 })( true ? { 22191 name: "19zs6va", 22192 styles: "right:0;" 22193 } : undefined); 22194 const BottomStroke = /*#__PURE__*/styled_base_browser_esm(HorizontalStroke, { 22195 target: "eaw9yqk7", 22196 label: "BottomStroke" 22197 })( true ? { 22198 name: "lh0t43", 22199 styles: "bottom:0;" 22200 } : undefined); 22201 const LeftStroke = /*#__PURE__*/styled_base_browser_esm(VerticalStroke, { 22202 target: "eaw9yqk8", 22203 label: "LeftStroke" 22204 })( true ? { 22205 name: "260zpl", 22206 styles: "left:0;" 22207 } : undefined); 22208 22209 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/icon.js 22210 22211 22212 22213 /** 22214 * Internal dependencies 22215 */ 22216 22217 const BASE_ICON_SIZE = 24; 22218 function BoxControlIcon({ 22219 size = 24, 22220 side = 'all', 22221 sides, 22222 ...props 22223 }) { 22224 const isSideDisabled = value => (sides === null || sides === void 0 ? void 0 : sides.length) && !sides.includes(value); 22225 22226 const getSide = value => { 22227 if (isSideDisabled(value)) { 22228 return false; 22229 } 22230 22231 return side === 'all' || side === value; 22232 }; 22233 22234 const top = getSide('top'); 22235 const right = getSide('right'); 22236 const bottom = getSide('bottom'); 22237 const left = getSide('left'); // Simulates SVG Icon scaling 22238 22239 const scale = size / BASE_ICON_SIZE; 22240 return Object(external_wp_element_["createElement"])(box_control_icon_styles_Root, Object(esm_extends["a" /* default */])({ 22241 style: { 22242 transform: `scale(${scale})` 22243 } 22244 }, props), Object(external_wp_element_["createElement"])(Viewbox, null, Object(external_wp_element_["createElement"])(TopStroke, { 22245 isFocused: top 22246 }), Object(external_wp_element_["createElement"])(RightStroke, { 22247 isFocused: right 22248 }), Object(external_wp_element_["createElement"])(BottomStroke, { 22249 isFocused: bottom 22250 }), Object(external_wp_element_["createElement"])(LeftStroke, { 22251 isFocused: left 22252 }))); 22253 } 22254 22255 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js 22256 var library_link = __webpack_require__("Bpkj"); 22257 22258 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js 22259 var link_off = __webpack_require__("Mp0b"); 22260 22261 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/linked-button.js 22262 22263 22264 22265 /** 22266 * WordPress dependencies 22267 */ 22268 22269 22270 /** 22271 * Internal dependencies 22272 */ 22273 22274 22275 22276 function LinkedButton({ 22277 isLinked, 22278 ...props 22279 }) { 22280 const label = isLinked ? Object(external_wp_i18n_["__"])('Unlink Sides') : Object(external_wp_i18n_["__"])('Link Sides'); 22281 return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], { 22282 text: label 22283 }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, { 22284 className: "component-box-control__linked-button", 22285 isPrimary: isLinked, 22286 isSecondary: !isLinked, 22287 isSmall: true, 22288 icon: isLinked ? library_link["a" /* default */] : link_off["a" /* default */], 22289 iconSize: 16, 22290 "aria-label": label 22291 })))); 22292 } 22293 22294 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-visualizer-styles.js 22295 22296 22297 function box_control_visualizer_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 22298 22299 /** 22300 * External dependencies 22301 */ 22302 22303 22304 /** 22305 * Internal dependencies 22306 */ 22307 22308 22309 var box_control_visualizer_styles_ref = true ? { 22310 name: "tbck19", 22311 styles: "bottom:0;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1;" 22312 } : undefined; 22313 22314 const containerPositionStyles = ({ 22315 isPositionAbsolute 22316 }) => { 22317 if (!isPositionAbsolute) return ''; 22318 return box_control_visualizer_styles_ref; 22319 }; 22320 22321 const box_control_visualizer_styles_Container = styled_base_browser_esm("div", { 22322 target: "e1df9b4q0", 22323 label: "Container" 22324 })("box-sizing:border-box;position:relative;", containerPositionStyles, ";" + ( true ? "" : undefined)); 22325 const Side = styled_base_browser_esm("div", { 22326 target: "e1df9b4q1", 22327 label: "Side" 22328 })("box-sizing:border-box;background:", COLORS.blue.wordpress[700], ";background:", COLORS.ui.theme, ";filter:brightness( 1 );opacity:0;position:absolute;pointer-events:none;transition:opacity 120ms linear;z-index:1;", ({ 22329 isActive 22330 }) => isActive && ` 22331 opacity: 0.3; 22332 `, true ? "" : undefined); 22333 const TopView = /*#__PURE__*/styled_base_browser_esm(Side, { 22334 target: "e1df9b4q2", 22335 label: "TopView" 22336 })( true ? { 22337 name: "1pb21am", 22338 styles: "top:0;left:0;right:0;" 22339 } : undefined); 22340 const RightView = /*#__PURE__*/styled_base_browser_esm(Side, { 22341 target: "e1df9b4q3", 22342 label: "RightView" 22343 })("top:0;bottom:0;", rtl_rtl({ 22344 right: 0 22345 }), ";" + ( true ? "" : undefined)); 22346 const BottomView = /*#__PURE__*/styled_base_browser_esm(Side, { 22347 target: "e1df9b4q4", 22348 label: "BottomView" 22349 })( true ? { 22350 name: "w87m56", 22351 styles: "bottom:0;left:0;right:0;" 22352 } : undefined); 22353 const LeftView = /*#__PURE__*/styled_base_browser_esm(Side, { 22354 target: "e1df9b4q5", 22355 label: "LeftView" 22356 })("top:0;bottom:0;", rtl_rtl({ 22357 left: 0 22358 }), ";" + ( true ? "" : undefined)); 22359 22360 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/visualizer.js 22361 22362 22363 22364 /** 22365 * WordPress dependencies 22366 */ 22367 22368 /** 22369 * Internal dependencies 22370 */ 22371 22372 22373 22374 function BoxControlVisualizer({ 22375 children, 22376 showValues = DEFAULT_VISUALIZER_VALUES, 22377 values: valuesProp = DEFAULT_VALUES, 22378 ...props 22379 }) { 22380 const isPositionAbsolute = !children; 22381 return Object(external_wp_element_["createElement"])(box_control_visualizer_styles_Container, Object(esm_extends["a" /* default */])({}, props, { 22382 isPositionAbsolute: isPositionAbsolute, 22383 "aria-hidden": "true" 22384 }), Object(external_wp_element_["createElement"])(Sides, { 22385 showValues: showValues, 22386 values: valuesProp 22387 }), children); 22388 } 22389 22390 function Sides({ 22391 showValues = DEFAULT_VISUALIZER_VALUES, 22392 values 22393 }) { 22394 const { 22395 top, 22396 right, 22397 bottom, 22398 left 22399 } = values; 22400 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(Top, { 22401 isVisible: showValues.top, 22402 value: top 22403 }), Object(external_wp_element_["createElement"])(Right, { 22404 isVisible: showValues.right, 22405 value: right 22406 }), Object(external_wp_element_["createElement"])(Bottom, { 22407 isVisible: showValues.bottom, 22408 value: bottom 22409 }), Object(external_wp_element_["createElement"])(Left, { 22410 isVisible: showValues.left, 22411 value: left 22412 })); 22413 } 22414 22415 function Top({ 22416 isVisible = false, 22417 value 22418 }) { 22419 const height = value; 22420 const animationProps = useSideAnimation(height); 22421 const isActive = animationProps.isActive || isVisible; 22422 return Object(external_wp_element_["createElement"])(TopView, { 22423 isActive: isActive, 22424 style: { 22425 height 22426 } 22427 }); 22428 } 22429 22430 function Right({ 22431 isVisible = false, 22432 value 22433 }) { 22434 const width = value; 22435 const animationProps = useSideAnimation(width); 22436 const isActive = animationProps.isActive || isVisible; 22437 return Object(external_wp_element_["createElement"])(RightView, { 22438 isActive: isActive, 22439 style: { 22440 width 22441 } 22442 }); 22443 } 22444 22445 function Bottom({ 22446 isVisible = false, 22447 value 22448 }) { 22449 const height = value; 22450 const animationProps = useSideAnimation(height); 22451 const isActive = animationProps.isActive || isVisible; 22452 return Object(external_wp_element_["createElement"])(BottomView, { 22453 isActive: isActive, 22454 style: { 22455 height 22456 } 22457 }); 22458 } 22459 22460 function Left({ 22461 isVisible = false, 22462 value 22463 }) { 22464 const width = value; 22465 const animationProps = useSideAnimation(width); 22466 const isActive = animationProps.isActive || isVisible; 22467 return Object(external_wp_element_["createElement"])(LeftView, { 22468 isActive: isActive, 22469 style: { 22470 width 22471 } 22472 }); 22473 } 22474 /** 22475 * Custom hook that renders the "flash" animation whenever the value changes. 22476 * 22477 * @param {string} value Value of (box) side. 22478 */ 22479 22480 22481 function useSideAnimation(value) { 22482 const [isActive, setIsActive] = Object(external_wp_element_["useState"])(false); 22483 const valueRef = Object(external_wp_element_["useRef"])(value); 22484 const timeoutRef = Object(external_wp_element_["useRef"])(); 22485 22486 const clearTimer = () => { 22487 if (timeoutRef.current) { 22488 window.clearTimeout(timeoutRef.current); 22489 } 22490 }; 22491 22492 Object(external_wp_element_["useEffect"])(() => { 22493 if (value !== valueRef.current) { 22494 setIsActive(true); 22495 valueRef.current = value; 22496 clearTimer(); 22497 timeoutRef.current = setTimeout(() => { 22498 setIsActive(false); 22499 }, 400); 22500 } 22501 22502 return () => clearTimer(); 22503 }, [value]); 22504 return { 22505 isActive 22506 }; 22507 } 22508 22509 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/index.js 22510 22511 22512 22513 /** 22514 * External dependencies 22515 */ 22516 22517 /** 22518 * WordPress dependencies 22519 */ 22520 22521 22522 22523 22524 /** 22525 * Internal dependencies 22526 */ 22527 22528 22529 22530 22531 22532 22533 22534 22535 22536 22537 22538 22539 const defaultInputProps = { 22540 min: 0 22541 }; 22542 22543 function box_control_useUniqueId(idProp) { 22544 const instanceId = Object(external_wp_compose_["useInstanceId"])(BoxControl, 'inspector-box-control'); 22545 return idProp || instanceId; 22546 } 22547 22548 function BoxControl({ 22549 id: idProp, 22550 inputProps = defaultInputProps, 22551 onChange = external_lodash_["noop"], 22552 onChangeShowVisualizer = external_lodash_["noop"], 22553 label = Object(external_wp_i18n_["__"])('Box Control'), 22554 values: valuesProp, 22555 units, 22556 sides, 22557 resetValues = DEFAULT_VALUES 22558 }) { 22559 const [values, setValues] = use_controlled_state(valuesProp, { 22560 fallback: DEFAULT_VALUES 22561 }); 22562 const inputValues = values || DEFAULT_VALUES; 22563 const hasInitialValue = isValuesDefined(valuesProp); 22564 const hasOneSide = (sides === null || sides === void 0 ? void 0 : sides.length) === 1; 22565 const [isDirty, setIsDirty] = Object(external_wp_element_["useState"])(hasInitialValue); 22566 const [isLinked, setIsLinked] = Object(external_wp_element_["useState"])(!hasInitialValue || !isValuesMixed(inputValues) || hasOneSide); 22567 const [side, setSide] = Object(external_wp_element_["useState"])(isLinked ? 'all' : 'top'); 22568 const id = box_control_useUniqueId(idProp); 22569 const headingId = `${id}-heading`; 22570 22571 const toggleLinked = () => { 22572 setIsLinked(!isLinked); 22573 setSide(!isLinked ? 'all' : 'top'); 22574 }; 22575 22576 const handleOnFocus = (event, { 22577 side: nextSide 22578 }) => { 22579 setSide(nextSide); 22580 }; 22581 22582 const handleOnChange = nextValues => { 22583 onChange(nextValues); 22584 setValues(nextValues); 22585 setIsDirty(true); 22586 }; 22587 22588 const handleOnHoverOn = (next = {}) => { 22589 onChangeShowVisualizer({ ...DEFAULT_VISUALIZER_VALUES, 22590 ...next 22591 }); 22592 }; 22593 22594 const handleOnHoverOff = (next = {}) => { 22595 onChangeShowVisualizer({ ...DEFAULT_VISUALIZER_VALUES, 22596 ...next 22597 }); 22598 }; 22599 22600 const handleOnReset = () => { 22601 onChange(resetValues); 22602 setValues(resetValues); 22603 setIsDirty(false); 22604 }; 22605 22606 const inputControlProps = { ...inputProps, 22607 onChange: handleOnChange, 22608 onFocus: handleOnFocus, 22609 onHoverOn: handleOnHoverOn, 22610 onHoverOff: handleOnHoverOff, 22611 isLinked, 22612 units, 22613 sides, 22614 values: inputValues 22615 }; 22616 return Object(external_wp_element_["createElement"])(box_control_styles_Root, { 22617 id: id, 22618 role: "region", 22619 "aria-labelledby": headingId 22620 }, Object(external_wp_element_["createElement"])(Header, { 22621 className: "component-box-control__header" 22622 }, Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(text_component, { 22623 id: headingId, 22624 className: "component-box-control__label" 22625 }, label)), Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 22626 className: "component-box-control__reset-button", 22627 isSecondary: true, 22628 isSmall: true, 22629 onClick: handleOnReset, 22630 disabled: !isDirty 22631 }, Object(external_wp_i18n_["__"])('Reset')))), Object(external_wp_element_["createElement"])(HeaderControlWrapper, { 22632 className: "component-box-control__header-control-wrapper" 22633 }, Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(BoxControlIcon, { 22634 side: side, 22635 sides: sides 22636 })), isLinked && Object(external_wp_element_["createElement"])(flex_block_component, null, Object(external_wp_element_["createElement"])(AllInputControl, Object(esm_extends["a" /* default */])({ 22637 "aria-label": label 22638 }, inputControlProps))), !hasOneSide && Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(LinkedButton, { 22639 onClick: toggleLinked, 22640 isLinked: isLinked 22641 }))), !isLinked && Object(external_wp_element_["createElement"])(BoxInputControls, inputControlProps)); 22642 } 22643 BoxControl.__Visualizer = BoxControlVisualizer; 22644 22645 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button-group/index.js 22646 22647 22648 22649 /** 22650 * External dependencies 22651 */ 22652 22653 /** 22654 * WordPress dependencies 22655 */ 22656 22657 22658 22659 function ButtonGroup({ 22660 className, 22661 ...props 22662 }, ref) { 22663 const classes = classnames_default()('components-button-group', className); 22664 return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ 22665 ref: ref, 22666 role: "group", 22667 className: classes 22668 }, props)); 22669 } 22670 22671 /* harmony default export */ var button_group = (Object(external_wp_element_["forwardRef"])(ButtonGroup)); 22672 22673 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/context.js 22674 /** 22675 * WordPress dependencies 22676 */ 22677 22678 const CardContext = Object(external_wp_element_["createContext"])({}); 22679 const useCardContext = () => Object(external_wp_element_["useContext"])(CardContext); 22680 22681 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/styles/card-styles.js 22682 22683 22684 /** 22685 * WordPress dependencies 22686 */ 22687 22688 /** 22689 * Internal dependencies 22690 */ 22691 22692 22693 22694 const styleProps = { 22695 borderColor: COLORS.lightGray[500], 22696 borderRadius: '3px', 22697 backgroundShady: COLORS.lightGray[200] 22698 }; 22699 const { 22700 borderColor: card_styles_borderColor, 22701 borderRadius, 22702 backgroundShady 22703 } = styleProps; 22704 const CardUI = styled_base_browser_esm("div", { 22705 target: "e1q7k77g0", 22706 label: "CardUI" 22707 })("background:", COLORS.white, ";box-sizing:border-box;border-radius:", borderRadius, ";border:1px solid ", card_styles_borderColor, ";", handleBorderless, ";&.is-elevated{box-shadow:0px 1px 3px 0px rgba( 0,0,0,0.2 ),0px 1px 1px 0px rgba( 0,0,0,0.14 ),0px 2px 1px -1px rgba( 0,0,0,0.12 );}" + ( true ? "" : undefined)); 22708 const HeaderUI = /*#__PURE__*/styled_base_browser_esm(flex_component, { 22709 target: "e1q7k77g1", 22710 label: "HeaderUI" 22711 })("border-bottom:1px solid ", card_styles_borderColor, ";border-top-left-radius:", borderRadius, ";border-top-right-radius:", borderRadius, ";box-sizing:border-box;&:last-child{border-bottom:none;}", headerFooterSizes, ";", handleBorderless, ";", handleShady, ";" + ( true ? "" : undefined)); 22712 const MediaUI = styled_base_browser_esm("div", { 22713 target: "e1q7k77g2", 22714 label: "MediaUI" 22715 })("box-sizing:border-box;overflow:hidden;& > img,& > iframe{display:block;height:auto;max-width:100%;width:100%;}&:first-of-type{border-top-left-radius:", borderRadius, ";border-top-right-radius:", borderRadius, ";}&:last-of-type{border-bottom-left-radius:", borderRadius, ";border-bottom-right-radius:", borderRadius, ";}" + ( true ? "" : undefined)); 22716 const BodyUI = styled_base_browser_esm("div", { 22717 target: "e1q7k77g3", 22718 label: "BodyUI" 22719 })("box-sizing:border-box;", bodySize, ";", handleShady, ";" + ( true ? "" : undefined)); 22720 const FooterUI = /*#__PURE__*/styled_base_browser_esm(flex_component, { 22721 target: "e1q7k77g4", 22722 label: "FooterUI" 22723 })("border-top:1px solid ", card_styles_borderColor, ";border-bottom-left-radius:", borderRadius, ";border-bottom-right-radius:", borderRadius, ";box-sizing:border-box;&:first-of-type{border-top:none;}", headerFooterSizes, ";", handleBorderless, ";", handleShady, ";" + ( true ? "" : undefined)); 22724 const DividerUI = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["HorizontalRule"], { 22725 target: "e1q7k77g5", 22726 label: "DividerUI" 22727 })("all:unset;border-top:1px solid ", card_styles_borderColor, ";box-sizing:border-box;display:block;height:0;width:100%;" + ( true ? "" : undefined)); 22728 function bodySize() { 22729 return ` 22730 &.is-size { 22731 &-large { 22732 padding: ${space(3)} ${space(4)}; 22733 } 22734 &-medium { 22735 padding: ${space(2)} ${space(3)}; 22736 } 22737 &-small { 22738 padding: ${space(2)}; 22739 } 22740 &-extraSmall { 22741 padding: ${space(1)}; 22742 } 22743 } 22744 `; 22745 } 22746 function headerFooterSizes() { 22747 return ` 22748 &.is-size { 22749 &-large { 22750 padding: ${space(3)} ${space(4)}; 22751 } 22752 &-medium { 22753 padding: ${space(2)} ${space(3)}; 22754 } 22755 &-small { 22756 padding: ${space(2)}; 22757 } 22758 &-extraSmall { 22759 padding: ${space(1)}; 22760 } 22761 } 22762 `; 22763 } 22764 function handleBorderless() { 22765 return ` 22766 &.is-borderless { 22767 border: none; 22768 } 22769 `; 22770 } 22771 function handleShady() { 22772 return ` 22773 &.is-shady { 22774 background: ${backgroundShady}; 22775 } 22776 `; 22777 } 22778 22779 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/index.js 22780 22781 22782 22783 /** 22784 * External dependencies 22785 */ 22786 22787 /** 22788 * Internal dependencies 22789 */ 22790 22791 22792 22793 const card_defaultProps = { 22794 isBorderless: false, 22795 isElevated: false, 22796 size: 'medium' 22797 }; 22798 function Card(props) { 22799 const { 22800 className, 22801 isBorderless, 22802 isElevated, 22803 size, 22804 ...additionalProps 22805 } = props; 22806 const { 22807 Provider 22808 } = CardContext; 22809 const contextProps = { 22810 isBorderless, 22811 isElevated, 22812 size 22813 }; 22814 const classes = classnames_default()('components-card', isBorderless && 'is-borderless', isElevated && 'is-elevated', size && `is-size-${size}`, className); 22815 return Object(external_wp_element_["createElement"])(Provider, { 22816 value: contextProps 22817 }, Object(external_wp_element_["createElement"])(CardUI, Object(esm_extends["a" /* default */])({}, additionalProps, { 22818 className: classes 22819 }))); 22820 } 22821 Card.defaultProps = card_defaultProps; 22822 /* harmony default export */ var card = (Card); 22823 22824 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/body.js 22825 22826 22827 22828 /** 22829 * External dependencies 22830 */ 22831 22832 /** 22833 * Internal dependencies 22834 */ 22835 22836 22837 22838 const body_defaultProps = { 22839 isShady: false, 22840 size: 'medium' 22841 }; 22842 function CardBody(props) { 22843 const { 22844 className, 22845 isShady, 22846 ...additionalProps 22847 } = props; 22848 const mergedProps = { ...body_defaultProps, 22849 ...useCardContext(), 22850 ...props 22851 }; 22852 const { 22853 size 22854 } = mergedProps; 22855 const classes = classnames_default()('components-card__body', isShady && 'is-shady', size && `is-size-${size}`, className); 22856 return Object(external_wp_element_["createElement"])(BodyUI, Object(esm_extends["a" /* default */])({}, additionalProps, { 22857 className: classes 22858 })); 22859 } 22860 /* harmony default export */ var card_body = (CardBody); 22861 22862 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/divider.js 22863 22864 22865 22866 /** 22867 * External dependencies 22868 */ 22869 22870 /** 22871 * Internal dependencies 22872 */ 22873 22874 22875 function CardDivider(props) { 22876 const { 22877 className, 22878 ...additionalProps 22879 } = props; 22880 const classes = classnames_default()('components-card__divider', className); 22881 return Object(external_wp_element_["createElement"])(DividerUI, Object(esm_extends["a" /* default */])({}, additionalProps, { 22882 children: null, 22883 className: classes, 22884 role: "separator" 22885 })); 22886 } 22887 /* harmony default export */ var divider = (CardDivider); 22888 22889 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/footer.js 22890 22891 22892 22893 /** 22894 * External dependencies 22895 */ 22896 22897 /** 22898 * Internal dependencies 22899 */ 22900 22901 22902 22903 const footer_defaultProps = { 22904 isBorderless: false, 22905 isShady: false, 22906 size: 'medium' 22907 }; 22908 function CardFooter(props) { 22909 const { 22910 className, 22911 isShady, 22912 ...additionalProps 22913 } = props; 22914 const mergedProps = { ...footer_defaultProps, 22915 ...useCardContext(), 22916 ...props 22917 }; 22918 const { 22919 isBorderless, 22920 size 22921 } = mergedProps; 22922 const classes = classnames_default()('components-card__footer', isBorderless && 'is-borderless', isShady && 'is-shady', size && `is-size-${size}`, className); 22923 return Object(external_wp_element_["createElement"])(FooterUI, Object(esm_extends["a" /* default */])({}, additionalProps, { 22924 className: classes 22925 })); 22926 } 22927 /* harmony default export */ var footer = (CardFooter); 22928 22929 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/header.js 22930 22931 22932 22933 /** 22934 * External dependencies 22935 */ 22936 22937 /** 22938 * Internal dependencies 22939 */ 22940 22941 22942 22943 const header_defaultProps = { 22944 isBorderless: false, 22945 isShady: false, 22946 size: 'medium' 22947 }; 22948 function CardHeader(props) { 22949 const { 22950 className, 22951 isShady, 22952 ...additionalProps 22953 } = props; 22954 const mergedProps = { ...header_defaultProps, 22955 ...useCardContext(), 22956 ...props 22957 }; 22958 const { 22959 isBorderless, 22960 size 22961 } = mergedProps; 22962 const classes = classnames_default()('components-card__header', isBorderless && 'is-borderless', isShady && 'is-shady', size && `is-size-${size}`, className); 22963 return Object(external_wp_element_["createElement"])(HeaderUI, Object(esm_extends["a" /* default */])({}, additionalProps, { 22964 className: classes 22965 })); 22966 } 22967 /* harmony default export */ var card_header = (CardHeader); 22968 22969 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/media.js 22970 22971 22972 22973 /** 22974 * External dependencies 22975 */ 22976 22977 /** 22978 * Internal dependencies 22979 */ 22980 22981 22982 function CardMedia(props) { 22983 const { 22984 className, 22985 ...additionalProps 22986 } = props; 22987 const classes = classnames_default()('components-card__media', className); 22988 return Object(external_wp_element_["createElement"])(MediaUI, Object(esm_extends["a" /* default */])({}, additionalProps, { 22989 className: classes 22990 })); 22991 } 22992 /* harmony default export */ var media = (CardMedia); 22993 22994 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js 22995 var build_module_icon = __webpack_require__("iClF"); 22996 22997 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js 22998 var check = __webpack_require__("RMJe"); 22999 23000 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/checkbox-control/index.js 23001 23002 23003 23004 /** 23005 * External dependencies 23006 */ 23007 23008 /** 23009 * WordPress dependencies 23010 */ 23011 23012 23013 23014 23015 /** 23016 * Internal dependencies 23017 */ 23018 23019 23020 function CheckboxControl({ 23021 label, 23022 className, 23023 heading, 23024 checked, 23025 help, 23026 onChange, 23027 ...props 23028 }) { 23029 if (heading) { 23030 external_wp_deprecated_default()('`heading` prop in `CheckboxControl`', { 23031 alternative: 'a separate element to implement a heading', 23032 plugin: 'Gutenberg' 23033 }); 23034 } 23035 23036 const instanceId = Object(external_wp_compose_["useInstanceId"])(CheckboxControl); 23037 const id = `inspector-checkbox-control-${instanceId}`; 23038 23039 const onChangeValue = event => onChange(event.target.checked); 23040 23041 return Object(external_wp_element_["createElement"])(base_control, { 23042 label: heading, 23043 id: id, 23044 help: help, 23045 className: classnames_default()('components-checkbox-control', className) 23046 }, Object(external_wp_element_["createElement"])("span", { 23047 className: "components-checkbox-control__input-container" 23048 }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({ 23049 id: id, 23050 className: "components-checkbox-control__input", 23051 type: "checkbox", 23052 value: "1", 23053 onChange: onChangeValue, 23054 checked: checked, 23055 "aria-describedby": !!help ? id + '__help' : undefined 23056 }, props)), checked ? Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 23057 icon: check["a" /* default */], 23058 className: "components-checkbox-control__checked", 23059 role: "presentation" 23060 }) : null), Object(external_wp_element_["createElement"])("label", { 23061 className: "components-checkbox-control__label", 23062 htmlFor: id 23063 }, label)); 23064 } 23065 23066 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/clipboard-button/index.js 23067 23068 23069 23070 /** 23071 * External dependencies 23072 */ 23073 23074 /** 23075 * WordPress dependencies 23076 */ 23077 23078 23079 23080 23081 /** 23082 * Internal dependencies 23083 */ 23084 23085 23086 const TIMEOUT = 4000; 23087 function ClipboardButton({ 23088 className, 23089 children, 23090 onCopy, 23091 onFinishCopy, 23092 text, 23093 ...buttonProps 23094 }) { 23095 external_wp_deprecated_default()('wp.components.ClipboardButton', { 23096 since: '10.3', 23097 plugin: 'Gutenberg', 23098 alternative: 'wp.compose.useCopyToClipboard' 23099 }); 23100 const timeoutId = Object(external_wp_element_["useRef"])(); 23101 const ref = Object(external_wp_compose_["useCopyToClipboard"])(text, () => { 23102 onCopy(); 23103 clearTimeout(timeoutId.current); 23104 23105 if (onFinishCopy) { 23106 timeoutId.current = setTimeout(() => onFinishCopy(), TIMEOUT); 23107 } 23108 }); 23109 Object(external_wp_element_["useEffect"])(() => { 23110 clearTimeout(timeoutId.current); 23111 }, []); 23112 const classes = classnames_default()('components-clipboard-button', className); // Workaround for inconsistent behavior in Safari, where <textarea> is not 23113 // the document.activeElement at the moment when the copy event fires. 23114 // This causes documentHasSelection() in the copy-handler component to 23115 // mistakenly override the ClipboardButton, and copy a serialized string 23116 // of the current block instead. 23117 23118 const focusOnCopyEventTarget = event => { 23119 event.target.focus(); 23120 }; 23121 23122 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, buttonProps, { 23123 className: classes, 23124 ref: ref, 23125 onCopy: focusOnCopyEventTarget 23126 }), children); 23127 } 23128 23129 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js + 1 modules 23130 var edit = __webpack_require__("B9Az"); 23131 23132 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js 23133 var library_close = __webpack_require__("w95h"); 23134 23135 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js 23136 var chevron_up = __webpack_require__("XgzB"); 23137 23138 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js 23139 var chevron_down = __webpack_require__("NWDH"); 23140 23141 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js 23142 var plus = __webpack_require__("Q4Sy"); 23143 23144 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown/index.js 23145 23146 23147 23148 /** 23149 * External dependencies 23150 */ 23151 23152 /** 23153 * WordPress dependencies 23154 */ 23155 23156 23157 /** 23158 * Internal dependencies 23159 */ 23160 23161 23162 23163 function useObservableState(initialState, onStateChange) { 23164 const [state, setState] = Object(external_wp_element_["useState"])(initialState); 23165 return [state, value => { 23166 setState(value); 23167 23168 if (onStateChange) { 23169 onStateChange(value); 23170 } 23171 }]; 23172 } 23173 23174 function Dropdown({ 23175 renderContent, 23176 renderToggle, 23177 position = 'bottom right', 23178 className, 23179 contentClassName, 23180 expandOnMobile, 23181 headerTitle, 23182 focusOnMount, 23183 popoverProps, 23184 onClose, 23185 onToggle 23186 }) { 23187 var _popoverProps$anchorR; 23188 23189 const containerRef = Object(external_wp_element_["useRef"])(); 23190 const [isOpen, setIsOpen] = useObservableState(false, onToggle); 23191 Object(external_wp_element_["useEffect"])(() => () => { 23192 if (onToggle) { 23193 onToggle(false); 23194 } 23195 }, []); 23196 23197 function toggle() { 23198 setIsOpen(!isOpen); 23199 } 23200 /** 23201 * Closes the dropdown if a focus leaves the dropdown wrapper. This is 23202 * intentionally distinct from `onClose` since focus loss from the popover 23203 * is expected to occur when using the Dropdown's toggle button, in which 23204 * case the correct behavior is to keep the dropdown closed. The same applies 23205 * in case when focus is moved to the modal dialog. 23206 */ 23207 23208 23209 function closeIfFocusOutside() { 23210 const { 23211 ownerDocument 23212 } = containerRef.current; 23213 23214 if (!containerRef.current.contains(ownerDocument.activeElement) && !ownerDocument.activeElement.closest('[role="dialog"]')) { 23215 close(); 23216 } 23217 } 23218 23219 function close() { 23220 if (onClose) { 23221 onClose(); 23222 } 23223 23224 setIsOpen(false); 23225 } 23226 23227 const args = { 23228 isOpen, 23229 onToggle: toggle, 23230 onClose: close 23231 }; 23232 return Object(external_wp_element_["createElement"])("div", { 23233 className: classnames_default()('components-dropdown', className), 23234 ref: containerRef 23235 }, renderToggle(args), isOpen && Object(external_wp_element_["createElement"])(build_module_popover["a" /* default */], Object(esm_extends["a" /* default */])({ 23236 position: position, 23237 onClose: close, 23238 onFocusOutside: closeIfFocusOutside, 23239 expandOnMobile: expandOnMobile, 23240 headerTitle: headerTitle, 23241 focusOnMount: focusOnMount 23242 }, popoverProps, { 23243 anchorRef: (_popoverProps$anchorR = popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.anchorRef) !== null && _popoverProps$anchorR !== void 0 ? _popoverProps$anchorR : containerRef.current, 23244 className: classnames_default()('components-dropdown__content', popoverProps ? popoverProps.className : undefined, contentClassName) 23245 }), renderContent(args))); 23246 } 23247 23248 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/circular-option-picker/index.js 23249 23250 23251 23252 /** 23253 * External dependencies 23254 */ 23255 23256 /** 23257 * WordPress dependencies 23258 */ 23259 23260 23261 /** 23262 * Internal dependencies 23263 */ 23264 23265 23266 23267 23268 23269 function Option({ 23270 className, 23271 isSelected, 23272 selectedIconProps, 23273 tooltipText, 23274 ...additionalProps 23275 }) { 23276 const optionButton = Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 23277 isPressed: isSelected, 23278 className: classnames_default()(className, 'components-circular-option-picker__option') 23279 }, additionalProps)); 23280 return Object(external_wp_element_["createElement"])("div", { 23281 className: "components-circular-option-picker__option-wrapper" 23282 }, tooltipText ? Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], { 23283 text: tooltipText 23284 }, optionButton) : optionButton, isSelected && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], Object(esm_extends["a" /* default */])({ 23285 icon: check["a" /* default */] 23286 }, selectedIconProps ? selectedIconProps : {}))); 23287 } 23288 23289 function DropdownLinkAction({ 23290 buttonProps, 23291 className, 23292 dropdownProps, 23293 linkText 23294 }) { 23295 return Object(external_wp_element_["createElement"])(Dropdown, Object(esm_extends["a" /* default */])({ 23296 className: classnames_default()('components-circular-option-picker__dropdown-link-action', className), 23297 renderToggle: ({ 23298 isOpen, 23299 onToggle 23300 }) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 23301 "aria-expanded": isOpen, 23302 "aria-haspopup": "true", 23303 onClick: onToggle, 23304 isLink: true 23305 }, buttonProps), linkText) 23306 }, dropdownProps)); 23307 } 23308 23309 function ButtonAction({ 23310 className, 23311 children, 23312 ...additionalProps 23313 }) { 23314 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 23315 className: classnames_default()('components-circular-option-picker__clear', className), 23316 isSmall: true, 23317 isSecondary: true 23318 }, additionalProps), children); 23319 } 23320 23321 function CircularOptionPicker({ 23322 actions, 23323 className, 23324 options, 23325 children 23326 }) { 23327 return Object(external_wp_element_["createElement"])("div", { 23328 className: classnames_default()('components-circular-option-picker', className) 23329 }, Object(external_wp_element_["createElement"])("div", { 23330 className: "components-circular-option-picker__swatches" 23331 }, options), children, actions && Object(external_wp_element_["createElement"])("div", { 23332 className: "components-circular-option-picker__custom-clear-wrapper" 23333 }, actions)); 23334 } 23335 CircularOptionPicker.Option = Option; 23336 CircularOptionPicker.ButtonAction = ButtonAction; 23337 CircularOptionPicker.DropdownLinkAction = DropdownLinkAction; 23338 23339 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/utils.js 23340 /** 23341 * Parts of this source were derived and modified from react-color, 23342 * released under the MIT license. 23343 * 23344 * https://github.com/casesandberg/react-color/ 23345 * 23346 * Copyright (c) 2015 Case Sandberg 23347 * 23348 * Permission is hereby granted, free of charge, to any person obtaining a copy 23349 * of this software and associated documentation files (the "Software"), to deal 23350 * in the Software without restriction, including without limitation the rights 23351 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23352 * copies of the Software, and to permit persons to whom the Software is 23353 * furnished to do so, subject to the following conditions: 23354 * 23355 * The above copyright notice and this permission notice shall be included in 23356 * all copies or substantial portions of the Software. 23357 * 23358 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23359 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23360 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23361 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23362 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23363 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23364 * THE SOFTWARE. 23365 */ 23366 23367 /** 23368 * External dependencies 23369 */ 23370 23371 23372 /** 23373 * Given a hex color, get all other color properties (rgb, alpha, etc). 23374 * 23375 * @param {Object|string} data A hex color string or an object with a hex property 23376 * @param {string} oldHue A reference to the hue of the previous color, otherwise dragging the saturation to zero will reset the current hue to zero as well. See https://github.com/casesandberg/react-color/issues/29#issuecomment-132686909. 23377 * @return {Object} An object of different color representations. 23378 */ 23379 23380 function colorToState(data = {}, oldHue = false) { 23381 const color = data.hex ? tinycolor_default()(data.hex) : tinycolor_default()(data); 23382 const hsl = color.toHsl(); 23383 hsl.h = Math.round(hsl.h); 23384 hsl.s = Math.round(hsl.s * 100); 23385 hsl.l = Math.round(hsl.l * 100); 23386 const hsv = color.toHsv(); 23387 hsv.h = Math.round(hsv.h); 23388 hsv.s = Math.round(hsv.s * 100); 23389 hsv.v = Math.round(hsv.v * 100); 23390 const rgb = color.toRgb(); 23391 const hex = color.toHex(); 23392 23393 if (hsl.s === 0) { 23394 hsl.h = oldHue || 0; 23395 hsv.h = oldHue || 0; 23396 } 23397 23398 const transparent = hex === '000000' && rgb.a === 0; 23399 return { 23400 color, 23401 hex: transparent ? 'transparent' : `#${hex}`, 23402 hsl, 23403 hsv, 23404 oldHue: data.h || oldHue || hsl.h, 23405 rgb, 23406 source: data.source 23407 }; 23408 } 23409 /** 23410 * Get the top/left offsets of a point in a container, also returns the container width/height. 23411 * 23412 * @param {Event} e Mouse or touch event with a location coordinate. 23413 * @param {HTMLElement} container The container div, returned point is relative to this container. 23414 * @return {Object} An object of the offset positions & container size. 23415 */ 23416 23417 function getPointOffset(e, container) { 23418 e.preventDefault(); 23419 const { 23420 left: containerLeft, 23421 top: containerTop, 23422 width, 23423 height 23424 } = container.getBoundingClientRect(); 23425 const x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX; 23426 const y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY; 23427 let left = x - (containerLeft + window.pageXOffset); 23428 let top = y - (containerTop + window.pageYOffset); 23429 23430 if (left < 0) { 23431 left = 0; 23432 } else if (left > width) { 23433 left = width; 23434 } else if (top < 0) { 23435 top = 0; 23436 } else if (top > height) { 23437 top = height; 23438 } 23439 23440 return { 23441 top, 23442 left, 23443 width, 23444 height 23445 }; 23446 } 23447 /** 23448 * Check if a string is a valid hex color code. 23449 * 23450 * @param {string} hex A possible hex color. 23451 * @return {boolean} True if the color is a valid hex color. 23452 */ 23453 23454 23455 function isValidHex(hex) { 23456 // disable hex4 and hex8 23457 const lh = String(hex).charAt(0) === '#' ? 1 : 0; 23458 return hex.length !== 4 + lh && hex.length < 7 + lh && tinycolor_default()(hex).isValid(); 23459 } 23460 /** 23461 * Check an object for any valid color properties. 23462 * 23463 * @param {Object} data A possible object representing a color. 23464 * @return {Object|boolean} If a valid representation of color, returns the data object. Otherwise returns false. 23465 */ 23466 23467 function simpleCheckForValidColor(data) { 23468 const keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v']; 23469 let checked = 0; 23470 let passed = 0; 23471 Object(external_lodash_["each"])(keysToCheck, letter => { 23472 if (data[letter]) { 23473 checked += 1; 23474 23475 if (!isNaN(data[letter])) { 23476 passed += 1; 23477 } 23478 } 23479 }); 23480 return checked === passed ? data : false; 23481 } 23482 /** 23483 * Calculate the current alpha based on a mouse or touch event 23484 * 23485 * @param {Event} e A mouse or touch event on the alpha bar. 23486 * @param {Object} props The current component props 23487 * @param {HTMLElement} container The container div for the alpha bar graph. 23488 * @return {Object|null} If the alpha value has changed, returns a new color object. 23489 */ 23490 23491 function calculateAlphaChange(e, props, container) { 23492 const { 23493 left, 23494 width 23495 } = getPointOffset(e, container); 23496 const a = left < 0 ? 0 : Math.round(left * 100 / width) / 100; 23497 23498 if (props.hsl.a !== a) { 23499 return { 23500 h: props.hsl.h, 23501 s: props.hsl.s, 23502 l: props.hsl.l, 23503 a, 23504 source: 'rgb' 23505 }; 23506 } 23507 23508 return null; 23509 } 23510 /** 23511 * Calculate the current hue based on a mouse or touch event 23512 * 23513 * @param {Event} e A mouse or touch event on the hue bar. 23514 * @param {Object} props The current component props 23515 * @param {HTMLElement} container The container div for the hue bar graph. 23516 * @return {Object|null} If the hue value has changed, returns a new color object. 23517 */ 23518 23519 function calculateHueChange(e, props, container) { 23520 const { 23521 left, 23522 width 23523 } = getPointOffset(e, container); 23524 const percent = left * 100 / width; 23525 const h = left >= width ? 359 : 360 * percent / 100; 23526 23527 if (props.hsl.h !== h) { 23528 return { 23529 h, 23530 s: props.hsl.s, 23531 l: props.hsl.l, 23532 a: props.hsl.a, 23533 source: 'rgb' 23534 }; 23535 } 23536 23537 return null; 23538 } 23539 /** 23540 * Calculate the current saturation & brightness based on a mouse or touch event 23541 * 23542 * @param {Event} e A mouse or touch event on the saturation graph. 23543 * @param {Object} props The current component props 23544 * @param {HTMLElement} container The container div for the 2D saturation graph. 23545 * @return {Object} Returns a new color object. 23546 */ 23547 23548 function calculateSaturationChange(e, props, container) { 23549 const { 23550 top, 23551 left, 23552 width, 23553 height 23554 } = getPointOffset(e, container); 23555 const saturation = left < 0 ? 0 : left * 100 / width; 23556 let bright = top >= height ? 0 : -(top * 100 / height) + 100; // `v` values less than 1 are considered in the [0,1] range, causing unexpected behavior at the bottom 23557 // of the chart. To fix this, we assume any value less than 1 should be 0 brightness. 23558 23559 if (bright < 1) { 23560 bright = 0; 23561 } 23562 23563 return { 23564 h: props.hsl.h, 23565 s: saturation, 23566 v: bright, 23567 a: props.hsl.a, 23568 source: 'rgb' 23569 }; 23570 } 23571 23572 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js 23573 23574 23575 /** 23576 * External dependencies 23577 */ 23578 23579 /** 23580 * WordPress dependencies 23581 */ 23582 23583 23584 23585 23586 function KeyboardShortcut({ 23587 target, 23588 callback, 23589 shortcut, 23590 bindGlobal, 23591 eventName 23592 }) { 23593 Object(external_wp_compose_["useKeyboardShortcut"])(shortcut, callback, { 23594 bindGlobal, 23595 target, 23596 eventName 23597 }); 23598 return null; 23599 } 23600 23601 function KeyboardShortcuts({ 23602 children, 23603 shortcuts, 23604 bindGlobal, 23605 eventName 23606 }) { 23607 const target = Object(external_wp_element_["useRef"])(); 23608 const element = Object(external_lodash_["map"])(shortcuts, (callback, shortcut) => Object(external_wp_element_["createElement"])(KeyboardShortcut, { 23609 key: shortcut, 23610 shortcut: shortcut, 23611 callback: callback, 23612 bindGlobal: bindGlobal, 23613 eventName: eventName, 23614 target: target 23615 })); // Render as non-visual if there are no children pressed. Keyboard 23616 // events will be bound to the document instead. 23617 23618 if (!external_wp_element_["Children"].count(children)) { 23619 return element; 23620 } 23621 23622 return Object(external_wp_element_["createElement"])("div", { 23623 ref: target 23624 }, element, children); 23625 } 23626 23627 /* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts); 23628 23629 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/alpha.js 23630 23631 23632 /** 23633 * Parts of this source were derived and modified from react-color, 23634 * released under the MIT license. 23635 * 23636 * https://github.com/casesandberg/react-color/ 23637 * 23638 * Copyright (c) 2015 Case Sandberg 23639 * 23640 * Permission is hereby granted, free of charge, to any person obtaining a copy 23641 * of this software and associated documentation files (the "Software"), to deal 23642 * in the Software without restriction, including without limitation the rights 23643 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23644 * copies of the Software, and to permit persons to whom the Software is 23645 * furnished to do so, subject to the following conditions: 23646 * 23647 * The above copyright notice and this permission notice shall be included in 23648 * all copies or substantial portions of the Software. 23649 * 23650 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23651 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23652 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23653 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23654 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23655 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23656 * THE SOFTWARE. 23657 */ 23658 23659 /** 23660 * External dependencies 23661 */ 23662 23663 /** 23664 * WordPress dependencies 23665 */ 23666 23667 23668 23669 23670 23671 /** 23672 * Internal dependencies 23673 */ 23674 23675 23676 23677 class alpha_Alpha extends external_wp_element_["Component"] { 23678 constructor() { 23679 super(...arguments); 23680 this.container = Object(external_wp_element_["createRef"])(); 23681 this.increase = this.increase.bind(this); 23682 this.decrease = this.decrease.bind(this); 23683 this.handleChange = this.handleChange.bind(this); 23684 this.handleMouseDown = this.handleMouseDown.bind(this); 23685 this.handleMouseUp = this.handleMouseUp.bind(this); 23686 } 23687 23688 componentWillUnmount() { 23689 this.unbindEventListeners(); 23690 } 23691 23692 increase(amount = 0.01) { 23693 const { 23694 hsl, 23695 onChange = external_lodash_["noop"] 23696 } = this.props; 23697 amount = parseInt(amount * 100, 10); 23698 const change = { 23699 h: hsl.h, 23700 s: hsl.s, 23701 l: hsl.l, 23702 a: (parseInt(hsl.a * 100, 10) + amount) / 100, 23703 source: 'rgb' 23704 }; 23705 onChange(change); 23706 } 23707 23708 decrease(amount = 0.01) { 23709 const { 23710 hsl, 23711 onChange = external_lodash_["noop"] 23712 } = this.props; 23713 const intValue = parseInt(hsl.a * 100, 10) - parseInt(amount * 100, 10); 23714 const change = { 23715 h: hsl.h, 23716 s: hsl.s, 23717 l: hsl.l, 23718 a: hsl.a <= amount ? 0 : intValue / 100, 23719 source: 'rgb' 23720 }; 23721 onChange(change); 23722 } 23723 23724 handleChange(e) { 23725 const { 23726 onChange = external_lodash_["noop"] 23727 } = this.props; 23728 const change = calculateAlphaChange(e, this.props, this.container.current); 23729 23730 if (change) { 23731 onChange(change, e); 23732 } 23733 } 23734 23735 handleMouseDown(e) { 23736 this.handleChange(e); 23737 window.addEventListener('mousemove', this.handleChange); 23738 window.addEventListener('mouseup', this.handleMouseUp); 23739 } 23740 23741 handleMouseUp() { 23742 this.unbindEventListeners(); 23743 } 23744 23745 preventKeyEvents(event) { 23746 if (event.keyCode === external_wp_keycodes_["TAB"]) { 23747 return; 23748 } 23749 23750 event.preventDefault(); 23751 } 23752 23753 unbindEventListeners() { 23754 window.removeEventListener('mousemove', this.handleChange); 23755 window.removeEventListener('mouseup', this.handleMouseUp); 23756 } 23757 23758 render() { 23759 const { 23760 rgb 23761 } = this.props; 23762 const rgbString = `${rgb.r},${rgb.g},${rgb.b}`; 23763 const gradient = { 23764 background: `linear-gradient(to right, rgba(${rgbString}, 0) 0%, rgba(${rgbString}, 1) 100%)` 23765 }; 23766 const pointerLocation = { 23767 left: `${rgb.a * 100}%` 23768 }; 23769 const shortcuts = { 23770 up: () => this.increase(), 23771 right: () => this.increase(), 23772 'shift+up': () => this.increase(0.1), 23773 'shift+right': () => this.increase(0.1), 23774 pageup: () => this.increase(0.1), 23775 end: () => this.increase(1), 23776 down: () => this.decrease(), 23777 left: () => this.decrease(), 23778 'shift+down': () => this.decrease(0.1), 23779 'shift+left': () => this.decrease(0.1), 23780 pagedown: () => this.decrease(0.1), 23781 home: () => this.decrease(1) 23782 }; 23783 return Object(external_wp_element_["createElement"])(keyboard_shortcuts, { 23784 shortcuts: shortcuts 23785 }, Object(external_wp_element_["createElement"])("div", { 23786 className: "components-color-picker__alpha" 23787 }, Object(external_wp_element_["createElement"])("div", { 23788 className: "components-color-picker__alpha-gradient", 23789 style: gradient 23790 }), Object(external_wp_element_["createElement"])("div", { 23791 className: "components-color-picker__alpha-bar", 23792 ref: this.container, 23793 onMouseDown: this.handleMouseDown, 23794 onTouchMove: this.handleChange, 23795 onTouchStart: this.handleChange 23796 }, Object(external_wp_element_["createElement"])("div", { 23797 tabIndex: "0", 23798 role: "slider", 23799 "aria-valuemax": "1", 23800 "aria-valuemin": "0", 23801 "aria-valuenow": rgb.a, 23802 "aria-orientation": "horizontal", 23803 "aria-label": Object(external_wp_i18n_["__"])('Alpha value, from 0 (transparent) to 1 (fully opaque).'), 23804 className: "components-color-picker__alpha-pointer", 23805 style: pointerLocation, 23806 onKeyDown: this.preventKeyEvents 23807 })))); 23808 } 23809 23810 } 23811 /* harmony default export */ var color_picker_alpha = (Object(external_wp_compose_["pure"])(alpha_Alpha)); 23812 23813 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/hue.js 23814 23815 23816 /** 23817 * Parts of this source were derived and modified from react-color, 23818 * released under the MIT license. 23819 * 23820 * https://github.com/casesandberg/react-color/ 23821 * 23822 * Copyright (c) 2015 Case Sandberg 23823 * 23824 * Permission is hereby granted, free of charge, to any person obtaining a copy 23825 * of this software and associated documentation files (the "Software"), to deal 23826 * in the Software without restriction, including without limitation the rights 23827 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23828 * copies of the Software, and to permit persons to whom the Software is 23829 * furnished to do so, subject to the following conditions: 23830 * 23831 * The above copyright notice and this permission notice shall be included in 23832 * all copies or substantial portions of the Software. 23833 * 23834 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23835 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23836 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23837 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23838 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23839 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23840 * THE SOFTWARE. 23841 */ 23842 23843 /** 23844 * External dependencies 23845 */ 23846 23847 /** 23848 * WordPress dependencies 23849 */ 23850 23851 23852 23853 23854 23855 /** 23856 * Internal dependencies 23857 */ 23858 23859 23860 23861 23862 class hue_Hue extends external_wp_element_["Component"] { 23863 constructor() { 23864 super(...arguments); 23865 this.container = Object(external_wp_element_["createRef"])(); 23866 this.increase = this.increase.bind(this); 23867 this.decrease = this.decrease.bind(this); 23868 this.handleChange = this.handleChange.bind(this); 23869 this.handleMouseDown = this.handleMouseDown.bind(this); 23870 this.handleMouseUp = this.handleMouseUp.bind(this); 23871 } 23872 23873 componentWillUnmount() { 23874 this.unbindEventListeners(); 23875 } 23876 23877 increase(amount = 1) { 23878 const { 23879 hsl, 23880 onChange = external_lodash_["noop"] 23881 } = this.props; 23882 const change = { 23883 h: hsl.h + amount >= 359 ? 359 : hsl.h + amount, 23884 s: hsl.s, 23885 l: hsl.l, 23886 a: hsl.a, 23887 source: 'rgb' 23888 }; 23889 onChange(change); 23890 } 23891 23892 decrease(amount = 1) { 23893 const { 23894 hsl, 23895 onChange = external_lodash_["noop"] 23896 } = this.props; 23897 const change = { 23898 h: hsl.h <= amount ? 0 : hsl.h - amount, 23899 s: hsl.s, 23900 l: hsl.l, 23901 a: hsl.a, 23902 source: 'rgb' 23903 }; 23904 onChange(change); 23905 } 23906 23907 handleChange(e) { 23908 const { 23909 onChange = external_lodash_["noop"] 23910 } = this.props; 23911 const change = calculateHueChange(e, this.props, this.container.current); 23912 23913 if (change) { 23914 onChange(change, e); 23915 } 23916 } 23917 23918 handleMouseDown(e) { 23919 this.handleChange(e); 23920 window.addEventListener('mousemove', this.handleChange); 23921 window.addEventListener('mouseup', this.handleMouseUp); 23922 } 23923 23924 handleMouseUp() { 23925 this.unbindEventListeners(); 23926 } 23927 23928 preventKeyEvents(event) { 23929 if (event.keyCode === external_wp_keycodes_["TAB"]) { 23930 return; 23931 } 23932 23933 event.preventDefault(); 23934 } 23935 23936 unbindEventListeners() { 23937 window.removeEventListener('mousemove', this.handleChange); 23938 window.removeEventListener('mouseup', this.handleMouseUp); 23939 } 23940 23941 render() { 23942 const { 23943 hsl = {}, 23944 instanceId 23945 } = this.props; 23946 const pointerLocation = { 23947 left: `${hsl.h * 100 / 360}%` 23948 }; 23949 const shortcuts = { 23950 up: () => this.increase(), 23951 right: () => this.increase(), 23952 'shift+up': () => this.increase(10), 23953 'shift+right': () => this.increase(10), 23954 pageup: () => this.increase(10), 23955 end: () => this.increase(359), 23956 down: () => this.decrease(), 23957 left: () => this.decrease(), 23958 'shift+down': () => this.decrease(10), 23959 'shift+left': () => this.decrease(10), 23960 pagedown: () => this.decrease(10), 23961 home: () => this.decrease(359) 23962 }; 23963 return Object(external_wp_element_["createElement"])(keyboard_shortcuts, { 23964 shortcuts: shortcuts 23965 }, Object(external_wp_element_["createElement"])("div", { 23966 className: "components-color-picker__hue" 23967 }, Object(external_wp_element_["createElement"])("div", { 23968 className: "components-color-picker__hue-gradient" 23969 }), Object(external_wp_element_["createElement"])("div", { 23970 className: "components-color-picker__hue-bar", 23971 ref: this.container, 23972 onMouseDown: this.handleMouseDown, 23973 onTouchMove: this.handleChange, 23974 onTouchStart: this.handleChange 23975 }, Object(external_wp_element_["createElement"])("div", { 23976 tabIndex: "0", 23977 role: "slider", 23978 "aria-valuemax": "1", 23979 "aria-valuemin": "359", 23980 "aria-valuenow": hsl.h, 23981 "aria-orientation": "horizontal", 23982 "aria-label": Object(external_wp_i18n_["__"])('Hue value in degrees, from 0 to 359.'), 23983 "aria-describedby": `components-color-picker__hue-description-${instanceId}`, 23984 className: "components-color-picker__hue-pointer", 23985 style: pointerLocation, 23986 onKeyDown: this.preventKeyEvents 23987 }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 23988 as: "p", 23989 id: `components-color-picker__hue-description-${instanceId}` 23990 }, Object(external_wp_i18n_["__"])('Move the arrow left or right to change hue.'))))); 23991 } 23992 23993 } 23994 /* harmony default export */ var hue = (Object(external_wp_compose_["compose"])(external_wp_compose_["pure"], external_wp_compose_["withInstanceId"])(hue_Hue)); 23995 23996 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-control/index.js 23997 23998 23999 24000 /** 24001 * WordPress dependencies 24002 */ 24003 24004 24005 /** 24006 * Internal dependencies 24007 */ 24008 24009 24010 /** 24011 * @typedef OwnProps 24012 * @property {string} label Label for the control. 24013 * @property {boolean} [hideLabelFromVision] Whether to accessibly hide the label. 24014 * @property {string} value Value of the input. 24015 * @property {string} [help] Optional help text for the control. 24016 * @property {string} [className] Classname passed to BaseControl wrapper 24017 * @property {(value: string) => void} onChange Handle changes. 24018 * @property {string} [type='text'] Type of the input. 24019 */ 24020 24021 /** @typedef {OwnProps & import('react').ComponentProps<'input'>} Props */ 24022 24023 /** 24024 * 24025 * @param {Props} props Props 24026 * @param {import('react').Ref<HTMLInputElement>} [ref] 24027 */ 24028 24029 function TextControl({ 24030 label, 24031 hideLabelFromVision, 24032 value, 24033 help, 24034 className, 24035 onChange, 24036 type = 'text', 24037 ...props 24038 }, ref) { 24039 const instanceId = Object(external_wp_compose_["useInstanceId"])(TextControl); 24040 const id = `inspector-text-control-${instanceId}`; 24041 24042 const onChangeValue = 24043 /** @type {import('react').ChangeEvent<HTMLInputElement>} */ 24044 event => onChange(event.target.value); 24045 24046 return Object(external_wp_element_["createElement"])(base_control, { 24047 label: label, 24048 hideLabelFromVision: hideLabelFromVision, 24049 id: id, 24050 help: help, 24051 className: className 24052 }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({ 24053 className: "components-text-control__input", 24054 type: type, 24055 id: id, 24056 value: value, 24057 onChange: onChangeValue, 24058 "aria-describedby": !!help ? id + '__help' : undefined, 24059 ref: ref 24060 }, props))); 24061 } 24062 24063 /* harmony default export */ var text_control = (Object(external_wp_element_["forwardRef"])(TextControl)); 24064 24065 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/inputs.js 24066 24067 24068 24069 /** 24070 * External dependencies 24071 */ 24072 24073 /** 24074 * WordPress dependencies 24075 */ 24076 24077 24078 24079 24080 24081 24082 24083 /** 24084 * Internal dependencies 24085 */ 24086 24087 24088 24089 24090 24091 /* Wrapper for TextControl, only used to handle intermediate state while typing. */ 24092 24093 class inputs_Input extends external_wp_element_["Component"] { 24094 constructor() { 24095 super(...arguments); 24096 this.handleBlur = this.handleBlur.bind(this); 24097 this.handleChange = this.handleChange.bind(this); 24098 this.handleKeyDown = this.handleKeyDown.bind(this); 24099 } 24100 24101 handleBlur() { 24102 const { 24103 value, 24104 valueKey, 24105 onChange, 24106 source 24107 } = this.props; 24108 onChange({ 24109 source, 24110 state: 'commit', 24111 value, 24112 valueKey 24113 }); 24114 } 24115 24116 handleChange(value) { 24117 const { 24118 valueKey, 24119 onChange, 24120 source 24121 } = this.props; 24122 24123 if (value.length > 4 && isValidHex(value)) { 24124 onChange({ 24125 source, 24126 state: 'commit', 24127 value, 24128 valueKey 24129 }); 24130 } else { 24131 onChange({ 24132 source, 24133 state: 'draft', 24134 value, 24135 valueKey 24136 }); 24137 } 24138 } 24139 24140 handleKeyDown({ 24141 keyCode 24142 }) { 24143 if (keyCode !== external_wp_keycodes_["ENTER"] && keyCode !== external_wp_keycodes_["UP"] && keyCode !== external_wp_keycodes_["DOWN"]) { 24144 return; 24145 } 24146 24147 const { 24148 value, 24149 valueKey, 24150 onChange, 24151 source 24152 } = this.props; 24153 onChange({ 24154 source, 24155 state: 'commit', 24156 value, 24157 valueKey 24158 }); 24159 } 24160 24161 render() { 24162 const { 24163 label, 24164 value, 24165 ...props 24166 } = this.props; 24167 return Object(external_wp_element_["createElement"])(text_control, Object(esm_extends["a" /* default */])({ 24168 className: "components-color-picker__inputs-field", 24169 label: label, 24170 value: value, 24171 onChange: newValue => this.handleChange(newValue), 24172 onBlur: this.handleBlur, 24173 onKeyDown: this.handleKeyDown 24174 }, Object(external_lodash_["omit"])(props, ['onChange', 'valueKey', 'source']))); 24175 } 24176 24177 } 24178 const PureButton = Object(external_wp_compose_["pure"])(build_module_button["a" /* default */]); 24179 class inputs_Inputs extends external_wp_element_["Component"] { 24180 constructor({ 24181 hsl 24182 }) { 24183 super(...arguments); 24184 const view = hsl.a === 1 ? 'hex' : 'rgb'; 24185 this.state = { 24186 view 24187 }; 24188 this.toggleViews = this.toggleViews.bind(this); 24189 this.resetDraftValues = this.resetDraftValues.bind(this); 24190 this.handleChange = this.handleChange.bind(this); 24191 this.normalizeValue = this.normalizeValue.bind(this); 24192 } 24193 24194 static getDerivedStateFromProps(props, state) { 24195 if (props.hsl.a !== 1 && state.view === 'hex') { 24196 return { 24197 view: 'rgb' 24198 }; 24199 } 24200 24201 return null; 24202 } 24203 24204 toggleViews() { 24205 if (this.state.view === 'hex') { 24206 this.setState({ 24207 view: 'rgb' 24208 }, this.resetDraftValues); 24209 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('RGB mode active')); 24210 } else if (this.state.view === 'rgb') { 24211 this.setState({ 24212 view: 'hsl' 24213 }, this.resetDraftValues); 24214 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Hue/saturation/lightness mode active')); 24215 } else if (this.state.view === 'hsl') { 24216 if (this.props.hsl.a === 1) { 24217 this.setState({ 24218 view: 'hex' 24219 }, this.resetDraftValues); 24220 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Hex color mode active')); 24221 } else { 24222 this.setState({ 24223 view: 'rgb' 24224 }, this.resetDraftValues); 24225 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('RGB mode active')); 24226 } 24227 } 24228 } 24229 24230 resetDraftValues() { 24231 return this.props.onChange({ 24232 state: 'reset' 24233 }); 24234 } 24235 24236 normalizeValue(valueKey, value) { 24237 if (valueKey !== 'a') { 24238 return value; 24239 } 24240 24241 if (value < 0) { 24242 return 0; 24243 } else if (value > 1) { 24244 return 1; 24245 } 24246 24247 return Math.round(value * 100) / 100; 24248 } 24249 24250 handleChange({ 24251 source, 24252 state, 24253 value, 24254 valueKey 24255 }) { 24256 this.props.onChange({ 24257 source, 24258 state, 24259 valueKey, 24260 value: this.normalizeValue(valueKey, value) 24261 }); 24262 } 24263 24264 renderFields() { 24265 const { 24266 disableAlpha = false 24267 } = this.props; 24268 24269 if (this.state.view === 'hex') { 24270 return Object(external_wp_element_["createElement"])("div", { 24271 className: "components-color-picker__inputs-fields" 24272 }, Object(external_wp_element_["createElement"])(inputs_Input, { 24273 source: this.state.view, 24274 label: Object(external_wp_i18n_["__"])('Color value in hexadecimal'), 24275 valueKey: "hex", 24276 value: this.props.hex, 24277 onChange: this.handleChange 24278 })); 24279 } else if (this.state.view === 'rgb') { 24280 const legend = disableAlpha ? Object(external_wp_i18n_["__"])('Color value in RGB') : Object(external_wp_i18n_["__"])('Color value in RGBA'); 24281 return Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 24282 as: "legend" 24283 }, legend), Object(external_wp_element_["createElement"])("div", { 24284 className: "components-color-picker__inputs-fields" 24285 }, Object(external_wp_element_["createElement"])(inputs_Input, { 24286 source: this.state.view, 24287 label: "r", 24288 valueKey: "r", 24289 value: this.props.rgb.r, 24290 onChange: this.handleChange, 24291 type: "number", 24292 min: "0", 24293 max: "255" 24294 }), Object(external_wp_element_["createElement"])(inputs_Input, { 24295 source: this.state.view, 24296 label: "g", 24297 valueKey: "g", 24298 value: this.props.rgb.g, 24299 onChange: this.handleChange, 24300 type: "number", 24301 min: "0", 24302 max: "255" 24303 }), Object(external_wp_element_["createElement"])(inputs_Input, { 24304 source: this.state.view, 24305 label: "b", 24306 valueKey: "b", 24307 value: this.props.rgb.b, 24308 onChange: this.handleChange, 24309 type: "number", 24310 min: "0", 24311 max: "255" 24312 }), disableAlpha ? null : Object(external_wp_element_["createElement"])(inputs_Input, { 24313 source: this.state.view, 24314 label: "a", 24315 valueKey: "a", 24316 value: this.props.rgb.a, 24317 onChange: this.handleChange, 24318 type: "number", 24319 min: "0", 24320 max: "1", 24321 step: "0.01" 24322 }))); 24323 } else if (this.state.view === 'hsl') { 24324 const legend = disableAlpha ? Object(external_wp_i18n_["__"])('Color value in HSL') : Object(external_wp_i18n_["__"])('Color value in HSLA'); 24325 return Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 24326 as: "legend" 24327 }, legend), Object(external_wp_element_["createElement"])("div", { 24328 className: "components-color-picker__inputs-fields" 24329 }, Object(external_wp_element_["createElement"])(inputs_Input, { 24330 source: this.state.view, 24331 label: "h", 24332 valueKey: "h", 24333 value: this.props.hsl.h, 24334 onChange: this.handleChange, 24335 type: "number", 24336 min: "0", 24337 max: "359" 24338 }), Object(external_wp_element_["createElement"])(inputs_Input, { 24339 source: this.state.view, 24340 label: "s", 24341 valueKey: "s", 24342 value: this.props.hsl.s, 24343 onChange: this.handleChange, 24344 type: "number", 24345 min: "0", 24346 max: "100" 24347 }), Object(external_wp_element_["createElement"])(inputs_Input, { 24348 source: this.state.view, 24349 label: "l", 24350 valueKey: "l", 24351 value: this.props.hsl.l, 24352 onChange: this.handleChange, 24353 type: "number", 24354 min: "0", 24355 max: "100" 24356 }), disableAlpha ? null : Object(external_wp_element_["createElement"])(inputs_Input, { 24357 source: this.state.view, 24358 label: "a", 24359 valueKey: "a", 24360 value: this.props.hsl.a, 24361 onChange: this.handleChange, 24362 type: "number", 24363 min: "0", 24364 max: "1", 24365 step: "0.05" 24366 }))); 24367 } 24368 } 24369 24370 render() { 24371 return Object(external_wp_element_["createElement"])("div", { 24372 className: "components-color-picker__inputs-wrapper" 24373 }, this.renderFields(), Object(external_wp_element_["createElement"])("div", { 24374 className: "components-color-picker__inputs-toggle-wrapper" 24375 }, Object(external_wp_element_["createElement"])(PureButton, { 24376 className: "components-color-picker__inputs-toggle", 24377 icon: chevron_down["a" /* default */], 24378 label: Object(external_wp_i18n_["__"])('Change color format'), 24379 onClick: this.toggleViews 24380 }))); 24381 } 24382 24383 } 24384 /* harmony default export */ var inputs = (inputs_Inputs); 24385 24386 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/saturation.js 24387 24388 24389 /** 24390 * Parts of this source were derived and modified from react-color, 24391 * released under the MIT license. 24392 * 24393 * https://github.com/casesandberg/react-color/ 24394 * 24395 * Copyright (c) 2015 Case Sandberg 24396 * 24397 * Permission is hereby granted, free of charge, to any person obtaining a copy 24398 * of this software and associated documentation files (the "Software"), to deal 24399 * in the Software without restriction, including without limitation the rights 24400 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 24401 * copies of the Software, and to permit persons to whom the Software is 24402 * furnished to do so, subject to the following conditions: 24403 * 24404 * The above copyright notice and this permission notice shall be included in 24405 * all copies or substantial portions of the Software. 24406 * 24407 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24408 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24409 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24410 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24411 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24412 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24413 * THE SOFTWARE. 24414 */ 24415 24416 /** 24417 * External dependencies 24418 */ 24419 24420 /** 24421 * WordPress dependencies 24422 */ 24423 24424 24425 24426 24427 24428 /** 24429 * Internal dependencies 24430 */ 24431 24432 24433 24434 24435 24436 class saturation_Saturation extends external_wp_element_["Component"] { 24437 constructor(props) { 24438 super(props); 24439 this.throttle = Object(external_lodash_["throttle"])((fn, data, e) => { 24440 fn(data, e); 24441 }, 50); 24442 this.container = Object(external_wp_element_["createRef"])(); 24443 this.saturate = this.saturate.bind(this); 24444 this.brighten = this.brighten.bind(this); 24445 this.handleChange = this.handleChange.bind(this); 24446 this.handleMouseDown = this.handleMouseDown.bind(this); 24447 this.handleMouseUp = this.handleMouseUp.bind(this); 24448 } 24449 24450 componentWillUnmount() { 24451 this.throttle.cancel(); 24452 this.unbindEventListeners(); 24453 } 24454 24455 saturate(amount = 0.01) { 24456 const { 24457 hsv, 24458 onChange = external_lodash_["noop"] 24459 } = this.props; 24460 const intSaturation = Object(external_lodash_["clamp"])(hsv.s + Math.round(amount * 100), 0, 100); 24461 const change = { 24462 h: hsv.h, 24463 s: intSaturation, 24464 v: hsv.v, 24465 a: hsv.a, 24466 source: 'rgb' 24467 }; 24468 onChange(change); 24469 } 24470 24471 brighten(amount = 0.01) { 24472 const { 24473 hsv, 24474 onChange = external_lodash_["noop"] 24475 } = this.props; 24476 const intValue = Object(external_lodash_["clamp"])(hsv.v + Math.round(amount * 100), 0, 100); 24477 const change = { 24478 h: hsv.h, 24479 s: hsv.s, 24480 v: intValue, 24481 a: hsv.a, 24482 source: 'rgb' 24483 }; 24484 onChange(change); 24485 } 24486 24487 handleChange(e) { 24488 const { 24489 onChange = external_lodash_["noop"] 24490 } = this.props; 24491 const change = calculateSaturationChange(e, this.props, this.container.current); 24492 this.throttle(onChange, change, e); 24493 } 24494 24495 handleMouseDown(e) { 24496 this.handleChange(e); 24497 window.addEventListener('mousemove', this.handleChange); 24498 window.addEventListener('mouseup', this.handleMouseUp); 24499 } 24500 24501 handleMouseUp() { 24502 this.unbindEventListeners(); 24503 } 24504 24505 preventKeyEvents(event) { 24506 if (event.keyCode === external_wp_keycodes_["TAB"]) { 24507 return; 24508 } 24509 24510 event.preventDefault(); 24511 } 24512 24513 unbindEventListeners() { 24514 window.removeEventListener('mousemove', this.handleChange); 24515 window.removeEventListener('mouseup', this.handleMouseUp); 24516 } 24517 24518 render() { 24519 const { 24520 hsv, 24521 hsl, 24522 instanceId 24523 } = this.props; 24524 const pointerLocation = { 24525 top: `${-hsv.v + 100}%`, 24526 left: `${hsv.s}%` 24527 }; 24528 const shortcuts = { 24529 up: () => this.brighten(), 24530 'shift+up': () => this.brighten(0.1), 24531 pageup: () => this.brighten(1), 24532 down: () => this.brighten(-0.01), 24533 'shift+down': () => this.brighten(-0.1), 24534 pagedown: () => this.brighten(-1), 24535 right: () => this.saturate(), 24536 'shift+right': () => this.saturate(0.1), 24537 end: () => this.saturate(1), 24538 left: () => this.saturate(-0.01), 24539 'shift+left': () => this.saturate(-0.1), 24540 home: () => this.saturate(-1) 24541 }; 24542 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ 24543 24544 return Object(external_wp_element_["createElement"])(keyboard_shortcuts, { 24545 shortcuts: shortcuts 24546 }, Object(external_wp_element_["createElement"])("div", { 24547 style: { 24548 background: `hsl(${hsl.h},100%, 50%)` 24549 }, 24550 className: "components-color-picker__saturation-color", 24551 ref: this.container, 24552 onMouseDown: this.handleMouseDown, 24553 onTouchMove: this.handleChange, 24554 onTouchStart: this.handleChange, 24555 role: "application" 24556 }, Object(external_wp_element_["createElement"])("div", { 24557 className: "components-color-picker__saturation-white" 24558 }), Object(external_wp_element_["createElement"])("div", { 24559 className: "components-color-picker__saturation-black" 24560 }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 24561 "aria-label": Object(external_wp_i18n_["__"])('Choose a shade'), 24562 "aria-describedby": `color-picker-saturation-${instanceId}`, 24563 className: "components-color-picker__saturation-pointer", 24564 style: pointerLocation, 24565 onKeyDown: this.preventKeyEvents 24566 }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 24567 id: `color-picker-saturation-${instanceId}` 24568 }, Object(external_wp_i18n_["__"])('Use your arrow keys to change the base color. Move up to lighten the color, down to darken, left to decrease saturation, and right to increase saturation.')))); 24569 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */ 24570 } 24571 24572 } 24573 /* harmony default export */ var saturation = (Object(external_wp_compose_["compose"])(external_wp_compose_["pure"], external_wp_compose_["withInstanceId"])(saturation_Saturation)); 24574 24575 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/index.js 24576 24577 24578 /** 24579 * Parts of this source were derived and modified from react-color, 24580 * released under the MIT license. 24581 * 24582 * https://github.com/casesandberg/react-color/ 24583 * 24584 * Copyright (c) 2015 Case Sandberg 24585 * 24586 * Permission is hereby granted, free of charge, to any person obtaining a copy 24587 * of this software and associated documentation files (the "Software"), to deal 24588 * in the Software without restriction, including without limitation the rights 24589 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 24590 * copies of the Software, and to permit persons to whom the Software is 24591 * furnished to do so, subject to the following conditions: 24592 * 24593 * The above copyright notice and this permission notice shall be included in 24594 * all copies or substantial portions of the Software. 24595 * 24596 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24597 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24598 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24599 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24600 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24601 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24602 * THE SOFTWARE. 24603 */ 24604 24605 /** 24606 * External dependencies 24607 */ 24608 24609 24610 /** 24611 * WordPress dependencies 24612 */ 24613 24614 24615 /** 24616 * Internal dependencies 24617 */ 24618 24619 24620 24621 24622 24623 24624 24625 const toLowerCase = value => String(value).toLowerCase(); 24626 24627 const color_picker_isValueEmpty = data => { 24628 if (data.source === 'hex' && data.hex === undefined) { 24629 return true; 24630 } 24631 24632 if (data.source === 'hsl' && (data.h === undefined || data.s === undefined || data.l === undefined)) { 24633 return true; 24634 } 24635 /** 24636 * Check that if source is `rgb`: 24637 * `r`, `g` or `b` properties are not undefined 24638 * OR (||) `h`, `s`, `v` or `a` properties are not undefined 24639 * OR (||) `h`, `s`, `l` or `a` properties are not undefined 24640 * 24641 * before it was checking with NOT(!) statement witch for `0` (bool|int) values returns `true` 24642 * this is a typecasting issue only visible for hex values that derive from #000000 24643 */ 24644 24645 24646 return data.source === 'rgb' && (data.r === undefined || data.g === undefined || data.b === undefined) && (data.h === undefined || data.s === undefined || data.v === undefined || data.a === undefined) && (data.h === undefined || data.s === undefined || data.l === undefined || data.a === undefined); 24647 }; 24648 24649 const isValidColor = colors => colors.hex ? isValidHex(colors.hex) : simpleCheckForValidColor(colors); 24650 /** 24651 * Function that creates the new color object 24652 * from old data and the new value. 24653 * 24654 * @param {Object} oldColors The old color object. 24655 * @param {string} oldColors.hex 24656 * @param {Object} oldColors.rgb 24657 * @param {number} oldColors.rgb.r 24658 * @param {number} oldColors.rgb.g 24659 * @param {number} oldColors.rgb.b 24660 * @param {number} oldColors.rgb.a 24661 * @param {Object} oldColors.hsl 24662 * @param {number} oldColors.hsl.h 24663 * @param {number} oldColors.hsl.s 24664 * @param {number} oldColors.hsl.l 24665 * @param {number} oldColors.hsl.a 24666 * @param {string} oldColors.draftHex Same format as oldColors.hex 24667 * @param {Object} oldColors.draftRgb Same format as oldColors.rgb 24668 * @param {Object} oldColors.draftHsl Same format as oldColors.hsl 24669 * @param {Object} data Data containing the new value to update. 24670 * @param {Object} data.source One of `hex`, `rgb`, `hsl`. 24671 * @param {string|number} data.value Value to update. 24672 * @param {string} data.valueKey Depends on `data.source` values: 24673 * - when source = `rgb`, valuKey can be `r`, `g`, `b`, or `a`. 24674 * - when source = `hsl`, valuKey can be `h`, `s`, `l`, or `a`. 24675 * @return {Object} A new color object for a specific source. For example: 24676 * { source: 'rgb', r: 1, g: 2, b:3, a:0 } 24677 */ 24678 24679 24680 const dataToColors = (oldColors, { 24681 source, 24682 valueKey, 24683 value 24684 }) => { 24685 if (source === 'hex') { 24686 return { 24687 source, 24688 [source]: value 24689 }; 24690 } 24691 24692 return { 24693 source, 24694 ...{ ...oldColors[source], 24695 ...{ 24696 [valueKey]: value 24697 } 24698 } 24699 }; 24700 }; 24701 24702 class color_picker_ColorPicker extends external_wp_element_["Component"] { 24703 constructor({ 24704 color = '0071a1' 24705 }) { 24706 super(...arguments); 24707 const colors = colorToState(color); 24708 this.state = { ...colors, 24709 draftHex: toLowerCase(colors.hex), 24710 draftRgb: colors.rgb, 24711 draftHsl: colors.hsl 24712 }; 24713 this.commitValues = this.commitValues.bind(this); 24714 this.setDraftValues = this.setDraftValues.bind(this); 24715 this.resetDraftValues = this.resetDraftValues.bind(this); 24716 this.handleInputChange = this.handleInputChange.bind(this); 24717 } 24718 24719 commitValues(data) { 24720 const { 24721 oldHue, 24722 onChangeComplete = external_lodash_["noop"] 24723 } = this.props; 24724 24725 if (isValidColor(data)) { 24726 const colors = colorToState(data, data.h || oldHue); 24727 this.setState({ ...colors, 24728 draftHex: toLowerCase(colors.hex), 24729 draftHsl: colors.hsl, 24730 draftRgb: colors.rgb 24731 }, Object(external_lodash_["debounce"])(Object(external_lodash_["partial"])(onChangeComplete, colors), 100)); 24732 } 24733 } 24734 24735 resetDraftValues() { 24736 this.setState({ 24737 draftHex: this.state.hex, 24738 draftHsl: this.state.hsl, 24739 draftRgb: this.state.rgb 24740 }); 24741 } 24742 24743 setDraftValues(data) { 24744 switch (data.source) { 24745 case 'hex': 24746 this.setState({ 24747 draftHex: toLowerCase(data.hex) 24748 }); 24749 break; 24750 24751 case 'rgb': 24752 this.setState({ 24753 draftRgb: data 24754 }); 24755 break; 24756 24757 case 'hsl': 24758 this.setState({ 24759 draftHsl: data 24760 }); 24761 break; 24762 } 24763 } 24764 24765 handleInputChange(data) { 24766 switch (data.state) { 24767 case 'reset': 24768 this.resetDraftValues(); 24769 break; 24770 24771 case 'commit': 24772 const colors = dataToColors(this.state, data); 24773 24774 if (!color_picker_isValueEmpty(colors)) { 24775 this.commitValues(colors); 24776 } 24777 24778 break; 24779 24780 case 'draft': 24781 this.setDraftValues(dataToColors(this.state, data)); 24782 break; 24783 } 24784 } 24785 24786 render() { 24787 const { 24788 className, 24789 disableAlpha 24790 } = this.props; 24791 const { 24792 color, 24793 hsl, 24794 hsv, 24795 rgb, 24796 draftHex, 24797 draftHsl, 24798 draftRgb 24799 } = this.state; 24800 const classes = classnames_default()(className, { 24801 'components-color-picker': true, 24802 'is-alpha-disabled': disableAlpha, 24803 'is-alpha-enabled': !disableAlpha 24804 }); 24805 return Object(external_wp_element_["createElement"])("div", { 24806 className: classes 24807 }, Object(external_wp_element_["createElement"])("div", { 24808 className: "components-color-picker__saturation" 24809 }, Object(external_wp_element_["createElement"])(saturation, { 24810 hsl: hsl, 24811 hsv: hsv, 24812 onChange: this.commitValues 24813 })), Object(external_wp_element_["createElement"])("div", { 24814 className: "components-color-picker__body" 24815 }, Object(external_wp_element_["createElement"])("div", { 24816 className: "components-color-picker__controls" 24817 }, Object(external_wp_element_["createElement"])("div", { 24818 className: "components-color-picker__swatch" 24819 }, Object(external_wp_element_["createElement"])("div", { 24820 className: "components-color-picker__active", 24821 style: { 24822 backgroundColor: color && color.toRgbString() 24823 } 24824 })), Object(external_wp_element_["createElement"])("div", { 24825 className: "components-color-picker__toggles" 24826 }, Object(external_wp_element_["createElement"])(hue, { 24827 hsl: hsl, 24828 onChange: this.commitValues 24829 }), disableAlpha ? null : Object(external_wp_element_["createElement"])(color_picker_alpha, { 24830 rgb: rgb, 24831 hsl: hsl, 24832 onChange: this.commitValues 24833 }))), Object(external_wp_element_["createElement"])(inputs, { 24834 rgb: draftRgb, 24835 hsl: draftHsl, 24836 hex: draftHex, 24837 onChange: this.handleInputChange, 24838 disableAlpha: disableAlpha 24839 }))); 24840 } 24841 24842 } 24843 24844 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-edit/index.js 24845 24846 24847 /** 24848 * External dependencies 24849 */ 24850 24851 24852 /** 24853 * WordPress dependencies 24854 */ 24855 24856 24857 24858 24859 /** 24860 * Internal dependencies 24861 */ 24862 24863 24864 24865 24866 24867 24868 24869 24870 function DropdownOpenOnMount({ 24871 shouldOpen, 24872 isOpen, 24873 onToggle 24874 }) { 24875 Object(external_wp_element_["useEffect"])(() => { 24876 if (shouldOpen && !isOpen) { 24877 onToggle(); 24878 } 24879 }, []); 24880 return null; 24881 } 24882 24883 function ColorOption({ 24884 color, 24885 name, 24886 slug, 24887 onChange, 24888 onRemove, 24889 onConfirm, 24890 confirmLabel = Object(external_wp_i18n_["__"])('OK'), 24891 isEditingNameOnMount = false, 24892 isEditingColorOnMount = false, 24893 onCancel, 24894 immutableColorSlugs = [] 24895 }) { 24896 const [isHover, setIsHover] = Object(external_wp_element_["useState"])(false); 24897 const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false); 24898 const [isEditingName, setIsEditingName] = Object(external_wp_element_["useState"])(isEditingNameOnMount); 24899 const [isShowingAdvancedPanel, setIsShowingAdvancedPanel] = Object(external_wp_element_["useState"])(false); 24900 const isShowingControls = (isHover || isFocused || isEditingName || isShowingAdvancedPanel) && !immutableColorSlugs.includes(slug); 24901 return Object(external_wp_element_["createElement"])("div", { 24902 tabIndex: 0, 24903 className: classnames_default()('components-color-edit__color-option', { 24904 'is-hover': isHover && !isEditingName && !isShowingAdvancedPanel 24905 }), 24906 onMouseEnter: () => setIsHover(true), 24907 onMouseLeave: () => setIsHover(false), 24908 onFocus: () => setIsFocused(true), 24909 onBlur: () => setIsFocused(false), 24910 "aria-label": name ? // translators: %s: The name of the color e.g: "vivid red". 24911 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00". 24912 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color) 24913 }, Object(external_wp_element_["createElement"])("div", { 24914 className: "components-color-edit__color-option-main-area" 24915 }, Object(external_wp_element_["createElement"])(Dropdown, { 24916 renderToggle: ({ 24917 isOpen, 24918 onToggle 24919 }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(DropdownOpenOnMount, { 24920 shouldOpen: isEditingColorOnMount, 24921 isOpen: isOpen, 24922 onToggle: onToggle 24923 }), Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, { 24924 style: { 24925 backgroundColor: color, 24926 color 24927 }, 24928 "aria-expanded": isOpen, 24929 "aria-haspopup": "true", 24930 onClick: onToggle, 24931 "aria-label": Object(external_wp_i18n_["__"])('Edit color value') 24932 })), 24933 renderContent: () => Object(external_wp_element_["createElement"])(color_picker_ColorPicker, { 24934 color: color, 24935 onChangeComplete: newColor => onChange({ 24936 color: newColor.hex, 24937 slug, 24938 name 24939 }), 24940 disableAlpha: true 24941 }) 24942 }), !isEditingName && Object(external_wp_element_["createElement"])("div", { 24943 className: "components-color-edit__color-option-color-name" 24944 }, name), isEditingName && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(text_control, { 24945 className: "components-color-edit__color-option-color-name-input", 24946 hideLabelFromVision: true, 24947 onChange: newColorName => onChange({ 24948 color, 24949 slug: Object(external_lodash_["kebabCase"])(newColorName), 24950 name: newColorName 24951 }), 24952 label: Object(external_wp_i18n_["__"])('Color name'), 24953 placeholder: Object(external_wp_i18n_["__"])('Name'), 24954 value: name 24955 }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 24956 onClick: () => { 24957 setIsEditingName(false); 24958 setIsFocused(false); 24959 24960 if (onConfirm) { 24961 onConfirm(); 24962 } 24963 }, 24964 isPrimary: true 24965 }, confirmLabel)), !isEditingName && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 24966 className: classnames_default()({ 24967 'components-color-edit__hidden-control': !isShowingControls 24968 }), 24969 icon: edit["a" /* default */], 24970 label: Object(external_wp_i18n_["__"])('Edit color name'), 24971 onClick: () => setIsEditingName(true) 24972 }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 24973 className: classnames_default()({ 24974 'components-color-edit__hidden-control': !isShowingControls 24975 }), 24976 icon: library_close["a" /* default */], 24977 label: Object(external_wp_i18n_["__"])('Remove color'), 24978 onClick: onRemove 24979 })), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 24980 className: classnames_default()({ 24981 'components-color-edit__hidden-control': !isShowingControls 24982 }), 24983 icon: isShowingAdvancedPanel ? chevron_up["a" /* default */] : chevron_down["a" /* default */], 24984 label: Object(external_wp_i18n_["__"])('Additional color settings'), 24985 onClick: () => { 24986 if (isShowingAdvancedPanel) { 24987 setIsFocused(false); 24988 } 24989 24990 setIsShowingAdvancedPanel(!isShowingAdvancedPanel); 24991 }, 24992 "aria-expanded": isShowingAdvancedPanel 24993 })), onCancel && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 24994 className: "components-color-edit__cancel-button", 24995 onClick: onCancel 24996 }, Object(external_wp_i18n_["__"])('Cancel')), isShowingAdvancedPanel && Object(external_wp_element_["createElement"])(text_control, { 24997 className: "components-color-edit__slug-input", 24998 onChange: newSlug => onChange({ 24999 color, 25000 slug: newSlug, 25001 name 25002 }), 25003 label: Object(external_wp_i18n_["__"])('Slug'), 25004 value: slug 25005 })); 25006 } 25007 25008 function ColorInserter({ 25009 onInsert, 25010 onCancel 25011 }) { 25012 const [color, setColor] = Object(external_wp_element_["useState"])({ 25013 color: '#fff', 25014 name: '', 25015 slug: '' 25016 }); 25017 return Object(external_wp_element_["createElement"])(ColorOption, { 25018 color: color.color, 25019 name: color.name, 25020 slug: color.slug, 25021 onChange: setColor, 25022 confirmLabel: Object(external_wp_i18n_["__"])('Save'), 25023 onConfirm: () => onInsert(color), 25024 isEditingNameOnMount: true, 25025 isEditingColorOnMount: true, 25026 onCancel: onCancel 25027 }); 25028 } 25029 25030 function ColorEdit({ 25031 colors, 25032 onChange, 25033 emptyUI, 25034 immutableColorSlugs, 25035 canReset = true 25036 }) { 25037 const [isInsertingColor, setIsInsertingColor] = Object(external_wp_element_["useState"])(false); 25038 return Object(external_wp_element_["createElement"])(base_control, null, Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("div", { 25039 className: "components-color-edit__label-and-insert-container" 25040 }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(base_control.VisualLabel, null, Object(external_wp_i18n_["__"])('Color palette')))), !isInsertingColor && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 25041 onClick: () => { 25042 setIsInsertingColor(true); 25043 }, 25044 className: "components-color-edit__insert-button", 25045 icon: plus["a" /* default */] 25046 })), Object(external_wp_element_["createElement"])("div", null, !Object(external_lodash_["isEmpty"])(colors) && colors.map((color, index) => { 25047 return Object(external_wp_element_["createElement"])(ColorOption, { 25048 key: index, 25049 color: color.color, 25050 name: color.name, 25051 slug: color.slug, 25052 immutableColorSlugs: immutableColorSlugs, 25053 onChange: newColor => { 25054 onChange(colors.map((currentColor, currentIndex) => { 25055 if (currentIndex === index) { 25056 return newColor; 25057 } 25058 25059 return currentColor; 25060 })); 25061 }, 25062 onRemove: () => { 25063 onChange(colors.filter((_currentColor, currentIndex) => { 25064 if (currentIndex === index) { 25065 return false; 25066 } 25067 25068 return true; 25069 })); 25070 } 25071 }); 25072 }), isInsertingColor && Object(external_wp_element_["createElement"])(ColorInserter, { 25073 onInsert: newColor => { 25074 setIsInsertingColor(false); 25075 onChange([...(colors || []), newColor]); 25076 }, 25077 onCancel: () => setIsInsertingColor(false) 25078 }), !isInsertingColor && Object(external_lodash_["isEmpty"])(colors) && emptyUI), !!canReset && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 25079 isSmall: true, 25080 isSecondary: true, 25081 className: "components-color-edit__reset-button", 25082 onClick: () => onChange() 25083 }, Object(external_wp_i18n_["__"])('Reset')))); 25084 } 25085 25086 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js 25087 25088 25089 25090 /** 25091 * External dependencies 25092 */ 25093 25094 25095 const ColorIndicator = ({ 25096 className, 25097 colorValue, 25098 ...props 25099 }) => Object(external_wp_element_["createElement"])("span", Object(esm_extends["a" /* default */])({ 25100 className: classnames_default()('component-color-indicator', className), 25101 style: { 25102 background: colorValue 25103 } 25104 }, props)); 25105 25106 /* harmony default export */ var color_indicator = (ColorIndicator); 25107 25108 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-palette/index.js 25109 25110 25111 /** 25112 * External dependencies 25113 */ 25114 25115 25116 /** 25117 * WordPress dependencies 25118 */ 25119 25120 25121 25122 /** 25123 * Internal dependencies 25124 */ 25125 25126 25127 25128 function ColorPalette({ 25129 clearable = true, 25130 className, 25131 colors, 25132 disableCustomColors = false, 25133 onChange, 25134 value 25135 }) { 25136 const clearColor = Object(external_wp_element_["useCallback"])(() => onChange(undefined), [onChange]); 25137 const colorOptions = Object(external_wp_element_["useMemo"])(() => { 25138 return Object(external_lodash_["map"])(colors, ({ 25139 color, 25140 name 25141 }) => Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, { 25142 key: color, 25143 isSelected: value === color, 25144 selectedIconProps: value === color ? { 25145 fill: tinycolor_default.a.mostReadable(color, ['#000', '#fff']).toHexString() 25146 } : {}, 25147 tooltipText: name || // translators: %s: color hex code e.g: "#f00". 25148 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color), 25149 style: { 25150 backgroundColor: color, 25151 color 25152 }, 25153 onClick: value === color ? clearColor : () => onChange(color), 25154 "aria-label": name ? // translators: %s: The name of the color e.g: "vivid red". 25155 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00". 25156 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color) 25157 })); 25158 }, [colors, value, onChange, clearColor]); 25159 25160 const renderCustomColorPicker = () => Object(external_wp_element_["createElement"])(color_picker_ColorPicker, { 25161 color: value, 25162 onChangeComplete: color => onChange(color.hex), 25163 disableAlpha: true 25164 }); 25165 25166 return Object(external_wp_element_["createElement"])(CircularOptionPicker, { 25167 className: className, 25168 options: colorOptions, 25169 actions: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !disableCustomColors && Object(external_wp_element_["createElement"])(CircularOptionPicker.DropdownLinkAction, { 25170 dropdownProps: { 25171 renderContent: renderCustomColorPicker, 25172 contentClassName: 'components-color-palette__picker' 25173 }, 25174 buttonProps: { 25175 'aria-label': Object(external_wp_i18n_["__"])('Custom color picker') 25176 }, 25177 linkText: Object(external_wp_i18n_["__"])('Custom color') 25178 }), !!clearable && Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, { 25179 onClick: clearColor 25180 }, Object(external_wp_i18n_["__"])('Clear'))) 25181 }); 25182 } 25183 25184 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js 25185 var close_small = __webpack_require__("bWcr"); 25186 25187 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js 25188 25189 25190 25191 /** 25192 * External dependencies 25193 */ 25194 25195 /** 25196 * WordPress dependencies 25197 */ 25198 25199 25200 25201 class token_input_TokenInput extends external_wp_element_["Component"] { 25202 constructor() { 25203 super(...arguments); 25204 this.onChange = this.onChange.bind(this); 25205 this.bindInput = this.bindInput.bind(this); 25206 } 25207 25208 focus() { 25209 this.input.focus(); 25210 } 25211 25212 hasFocus() { 25213 return this.input === this.input.ownerDocument.activeElement; 25214 } 25215 25216 bindInput(ref) { 25217 this.input = ref; 25218 } 25219 25220 onChange(event) { 25221 this.props.onChange({ 25222 value: event.target.value 25223 }); 25224 } 25225 25226 render() { 25227 const { 25228 value, 25229 isExpanded, 25230 instanceId, 25231 selectedSuggestionIndex, 25232 className, 25233 ...props 25234 } = this.props; 25235 const size = value ? value.length + 1 : 0; 25236 return Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({ 25237 ref: this.bindInput, 25238 id: `components-form-token-input-${instanceId}`, 25239 type: "text" 25240 }, props, { 25241 value: value || '', 25242 onChange: this.onChange, 25243 size: size, 25244 className: classnames_default()(className, 'components-form-token-field__input'), 25245 autoComplete: "off", 25246 role: "combobox", 25247 "aria-expanded": isExpanded, 25248 "aria-autocomplete": "list", 25249 "aria-owns": isExpanded ? `components-form-token-suggestions-${instanceId}` : undefined, 25250 "aria-activedescendant": selectedSuggestionIndex !== -1 ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : undefined, 25251 "aria-describedby": `components-form-token-suggestions-howto-${instanceId}` 25252 })); 25253 } 25254 25255 } 25256 25257 /* harmony default export */ var token_input = (token_input_TokenInput); 25258 25259 // EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js 25260 var lib = __webpack_require__("9Do8"); 25261 var lib_default = /*#__PURE__*/__webpack_require__.n(lib); 25262 25263 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js 25264 25265 25266 /** 25267 * External dependencies 25268 */ 25269 25270 25271 25272 /** 25273 * WordPress dependencies 25274 */ 25275 25276 25277 25278 25279 class suggestions_list_SuggestionsList extends external_wp_element_["Component"] { 25280 constructor() { 25281 super(...arguments); 25282 this.handleMouseDown = this.handleMouseDown.bind(this); 25283 this.bindList = this.bindList.bind(this); 25284 } 25285 25286 componentDidUpdate() { 25287 // only have to worry about scrolling selected suggestion into view 25288 // when already expanded 25289 if (this.props.selectedIndex > -1 && this.props.scrollIntoView && this.list.children[this.props.selectedIndex]) { 25290 this.scrollingIntoView = true; 25291 lib_default()(this.list.children[this.props.selectedIndex], this.list, { 25292 onlyScrollIfNeeded: true 25293 }); 25294 this.props.setTimeout(() => { 25295 this.scrollingIntoView = false; 25296 }, 100); 25297 } 25298 } 25299 25300 bindList(ref) { 25301 this.list = ref; 25302 } 25303 25304 handleHover(suggestion) { 25305 return () => { 25306 if (!this.scrollingIntoView) { 25307 this.props.onHover(suggestion); 25308 } 25309 }; 25310 } 25311 25312 handleClick(suggestion) { 25313 return () => { 25314 this.props.onSelect(suggestion); 25315 }; 25316 } 25317 25318 handleMouseDown(e) { 25319 // By preventing default here, we will not lose focus of <input> when clicking a suggestion 25320 e.preventDefault(); 25321 } 25322 25323 computeSuggestionMatch(suggestion) { 25324 const match = this.props.displayTransform(this.props.match || '').toLocaleLowerCase(); 25325 25326 if (match.length === 0) { 25327 return null; 25328 } 25329 25330 suggestion = this.props.displayTransform(suggestion); 25331 const indexOfMatch = suggestion.toLocaleLowerCase().indexOf(match); 25332 return { 25333 suggestionBeforeMatch: suggestion.substring(0, indexOfMatch), 25334 suggestionMatch: suggestion.substring(indexOfMatch, indexOfMatch + match.length), 25335 suggestionAfterMatch: suggestion.substring(indexOfMatch + match.length) 25336 }; 25337 } 25338 25339 render() { 25340 // We set `tabIndex` here because otherwise Firefox sets focus on this 25341 // div when tabbing off of the input in `TokenField` -- not really sure 25342 // why, since usually a div isn't focusable by default 25343 // TODO does this still apply now that it's a <ul> and not a <div>? 25344 return Object(external_wp_element_["createElement"])("ul", { 25345 ref: this.bindList, 25346 className: "components-form-token-field__suggestions-list", 25347 id: `components-form-token-suggestions-${this.props.instanceId}`, 25348 role: "listbox" 25349 }, Object(external_lodash_["map"])(this.props.suggestions, (suggestion, index) => { 25350 const match = this.computeSuggestionMatch(suggestion); 25351 const classeName = classnames_default()('components-form-token-field__suggestion', { 25352 'is-selected': index === this.props.selectedIndex 25353 }); 25354 /* eslint-disable jsx-a11y/click-events-have-key-events */ 25355 25356 return Object(external_wp_element_["createElement"])("li", { 25357 id: `components-form-token-suggestions-${this.props.instanceId}-${index}`, 25358 role: "option", 25359 className: classeName, 25360 key: suggestion !== null && suggestion !== void 0 && suggestion.value ? suggestion.value : this.props.displayTransform(suggestion), 25361 onMouseDown: this.handleMouseDown, 25362 onClick: this.handleClick(suggestion), 25363 onMouseEnter: this.handleHover(suggestion), 25364 "aria-selected": index === this.props.selectedIndex 25365 }, match ? Object(external_wp_element_["createElement"])("span", { 25366 "aria-label": this.props.displayTransform(suggestion) 25367 }, match.suggestionBeforeMatch, Object(external_wp_element_["createElement"])("strong", { 25368 className: "components-form-token-field__suggestion-match" 25369 }, match.suggestionMatch), match.suggestionAfterMatch) : this.props.displayTransform(suggestion)); 25370 /* eslint-enable jsx-a11y/click-events-have-key-events */ 25371 })); 25372 } 25373 25374 } 25375 25376 suggestions_list_SuggestionsList.defaultProps = { 25377 match: '', 25378 onHover: () => {}, 25379 onSelect: () => {}, 25380 suggestions: Object.freeze([]) 25381 }; 25382 /* harmony default export */ var suggestions_list = (Object(external_wp_compose_["withSafeTimeout"])(suggestions_list_SuggestionsList)); 25383 25384 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js 25385 25386 25387 25388 /** 25389 * WordPress dependencies 25390 */ 25391 25392 25393 /* harmony default export */ var with_focus_outside = (Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => props => { 25394 const [handleFocusOutside, setHandleFocusOutside] = Object(external_wp_element_["useState"])(); 25395 const bindFocusOutsideHandler = Object(external_wp_element_["useCallback"])(node => setHandleFocusOutside(() => node !== null && node !== void 0 && node.handleFocusOutside ? node.handleFocusOutside.bind(node) : undefined), []); 25396 return Object(external_wp_element_["createElement"])("div", Object(external_wp_compose_["__experimentalUseFocusOutside"])(handleFocusOutside), Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({ 25397 ref: bindFocusOutsideHandler 25398 }, props))); 25399 }, 'withFocusOutside')); 25400 25401 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/combobox-control/index.js 25402 25403 25404 /** 25405 * External dependencies 25406 */ 25407 25408 25409 /** 25410 * WordPress dependencies 25411 */ 25412 25413 25414 25415 25416 25417 25418 25419 /** 25420 * Internal dependencies 25421 */ 25422 25423 25424 25425 25426 25427 25428 25429 const DetectOutside = with_focus_outside(class extends external_wp_element_["Component"] { 25430 handleFocusOutside(event) { 25431 this.props.onFocusOutside(event); 25432 } 25433 25434 render() { 25435 return this.props.children; 25436 } 25437 25438 }); 25439 25440 function ComboboxControl({ 25441 value, 25442 label, 25443 options, 25444 onChange, 25445 onFilterValueChange = external_lodash_["noop"], 25446 hideLabelFromVision, 25447 help, 25448 allowReset = true, 25449 className, 25450 messages = { 25451 selected: Object(external_wp_i18n_["__"])('Item selected.') 25452 } 25453 }) { 25454 var _currentOption$label; 25455 25456 const instanceId = Object(external_wp_compose_["useInstanceId"])(ComboboxControl); 25457 const [selectedSuggestion, setSelectedSuggestion] = Object(external_wp_element_["useState"])(null); 25458 const [isExpanded, setIsExpanded] = Object(external_wp_element_["useState"])(false); 25459 const [inputValue, setInputValue] = Object(external_wp_element_["useState"])(''); 25460 const inputContainer = Object(external_wp_element_["useRef"])(); 25461 const currentOption = options.find(option => option.value === value); 25462 const currentLabel = (_currentOption$label = currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : ''; 25463 const matchingSuggestions = Object(external_wp_element_["useMemo"])(() => { 25464 const startsWithMatch = []; 25465 const containsMatch = []; 25466 const match = Object(external_lodash_["deburr"])(inputValue.toLocaleLowerCase()); 25467 options.forEach(option => { 25468 const index = Object(external_lodash_["deburr"])(option.label).toLocaleLowerCase().indexOf(match); 25469 25470 if (index === 0) { 25471 startsWithMatch.push(option); 25472 } else if (index > 0) { 25473 containsMatch.push(option); 25474 } 25475 }); 25476 return startsWithMatch.concat(containsMatch); 25477 }, [inputValue, options, value]); 25478 25479 const onSuggestionSelected = newSelectedSuggestion => { 25480 onChange(newSelectedSuggestion.value); 25481 Object(external_wp_a11y_["speak"])(messages.selected, 'assertive'); 25482 setSelectedSuggestion(newSelectedSuggestion); 25483 setInputValue(''); 25484 setIsExpanded(false); 25485 }; 25486 25487 const handleArrowNavigation = (offset = 1) => { 25488 const index = matchingSuggestions.indexOf(selectedSuggestion); 25489 let nextIndex = index + offset; 25490 25491 if (nextIndex < 0) { 25492 nextIndex = matchingSuggestions.length - 1; 25493 } else if (nextIndex >= matchingSuggestions.length) { 25494 nextIndex = 0; 25495 } 25496 25497 setSelectedSuggestion(matchingSuggestions[nextIndex]); 25498 setIsExpanded(true); 25499 }; 25500 25501 const onKeyDown = event => { 25502 let preventDefault = false; 25503 25504 switch (event.keyCode) { 25505 case external_wp_keycodes_["ENTER"]: 25506 if (selectedSuggestion) { 25507 onSuggestionSelected(selectedSuggestion); 25508 preventDefault = true; 25509 } 25510 25511 break; 25512 25513 case external_wp_keycodes_["UP"]: 25514 handleArrowNavigation(-1); 25515 preventDefault = true; 25516 break; 25517 25518 case external_wp_keycodes_["DOWN"]: 25519 handleArrowNavigation(1); 25520 preventDefault = true; 25521 break; 25522 25523 case external_wp_keycodes_["ESCAPE"]: 25524 setIsExpanded(false); 25525 setSelectedSuggestion(null); 25526 preventDefault = true; 25527 event.stopPropagation(); 25528 break; 25529 25530 default: 25531 break; 25532 } 25533 25534 if (preventDefault) { 25535 event.preventDefault(); 25536 } 25537 }; 25538 25539 const onFocus = () => { 25540 setIsExpanded(true); 25541 onFilterValueChange(''); 25542 setInputValue(''); 25543 }; 25544 25545 const onFocusOutside = () => { 25546 setIsExpanded(false); 25547 }; 25548 25549 const onInputChange = event => { 25550 const text = event.value; 25551 setInputValue(text); 25552 onFilterValueChange(text); 25553 setIsExpanded(true); 25554 }; 25555 25556 const handleOnReset = () => { 25557 onChange(null); 25558 inputContainer.current.input.focus(); 25559 }; // Announcements 25560 25561 25562 Object(external_wp_element_["useEffect"])(() => { 25563 const hasMatchingSuggestions = matchingSuggestions.length > 0; 25564 25565 if (isExpanded) { 25566 const message = hasMatchingSuggestions ? Object(external_wp_i18n_["sprintf"])( 25567 /* translators: %d: number of results. */ 25568 Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_wp_i18n_["__"])('No results.'); 25569 Object(external_wp_a11y_["speak"])(message, 'polite'); 25570 } 25571 }, [matchingSuggestions, isExpanded]); // Disable reason: There is no appropriate role which describes the 25572 // input container intended accessible usability. 25573 // TODO: Refactor click detection to use blur to stop propagation. 25574 25575 /* eslint-disable jsx-a11y/no-static-element-interactions */ 25576 25577 return Object(external_wp_element_["createElement"])(DetectOutside, { 25578 onFocusOutside: onFocusOutside 25579 }, Object(external_wp_element_["createElement"])(base_control, { 25580 className: classnames_default()(className, 'components-combobox-control'), 25581 tabIndex: "-1", 25582 label: label, 25583 id: `components-form-token-input-${instanceId}`, 25584 hideLabelFromVision: hideLabelFromVision, 25585 help: help 25586 }, Object(external_wp_element_["createElement"])("div", { 25587 className: "components-combobox-control__suggestions-container", 25588 tabIndex: "-1", 25589 onKeyDown: onKeyDown 25590 }, Object(external_wp_element_["createElement"])(flex_component, null, Object(external_wp_element_["createElement"])(flex_block_component, null, Object(external_wp_element_["createElement"])(token_input, { 25591 className: "components-combobox-control__input", 25592 instanceId: instanceId, 25593 ref: inputContainer, 25594 value: isExpanded ? inputValue : currentLabel, 25595 "aria-label": currentLabel ? `${currentLabel}, ${label}` : null, 25596 onFocus: onFocus, 25597 isExpanded: isExpanded, 25598 selectedSuggestionIndex: matchingSuggestions.indexOf(selectedSuggestion), 25599 onChange: onInputChange 25600 })), allowReset && Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 25601 className: "components-combobox-control__reset", 25602 icon: close_small["a" /* default */], 25603 disabled: !value, 25604 onClick: handleOnReset, 25605 label: Object(external_wp_i18n_["__"])('Reset') 25606 }))), isExpanded && Object(external_wp_element_["createElement"])(suggestions_list, { 25607 instanceId: instanceId, 25608 match: { 25609 label: inputValue 25610 }, 25611 displayTransform: suggestion => suggestion.label, 25612 suggestions: matchingSuggestions, 25613 selectedIndex: matchingSuggestions.indexOf(selectedSuggestion), 25614 onHover: setSelectedSuggestion, 25615 onSelect: onSuggestionSelected, 25616 scrollIntoView: true 25617 })))); 25618 /* eslint-enable jsx-a11y/no-static-element-interactions */ 25619 } 25620 25621 /* harmony default export */ var combobox_control = (ComboboxControl); 25622 25623 // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js 25624 function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) { 25625 if (source == null) return {}; 25626 var target = {}; 25627 var sourceKeys = Object.keys(source); 25628 var key, i; 25629 25630 for (i = 0; i < sourceKeys.length; i++) { 25631 key = sourceKeys[i]; 25632 if (excluded.indexOf(key) >= 0) continue; 25633 target[key] = source[key]; 25634 } 25635 25636 return target; 25637 } 25638 // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/extends.js 25639 function extends_extends() { 25640 extends_extends = Object.assign || function (target) { 25641 for (var i = 1; i < arguments.length; i++) { 25642 var source = arguments[i]; 25643 25644 for (var key in source) { 25645 if (Object.prototype.hasOwnProperty.call(source, key)) { 25646 target[key] = source[key]; 25647 } 25648 } 25649 } 25650 25651 return target; 25652 }; 25653 25654 return extends_extends.apply(this, arguments); 25655 } 25656 // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js 25657 function assertThisInitialized_assertThisInitialized(self) { 25658 if (self === void 0) { 25659 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 25660 } 25661 25662 return self; 25663 } 25664 // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js 25665 function setPrototypeOf_setPrototypeOf(o, p) { 25666 setPrototypeOf_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 25667 o.__proto__ = p; 25668 return o; 25669 }; 25670 25671 return setPrototypeOf_setPrototypeOf(o, p); 25672 } 25673 // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js 25674 25675 function inheritsLoose_inheritsLoose(subClass, superClass) { 25676 subClass.prototype = Object.create(superClass.prototype); 25677 subClass.prototype.constructor = subClass; 25678 setPrototypeOf_setPrototypeOf(subClass, superClass); 25679 } 25680 // EXTERNAL MODULE: ./node_modules/prop-types/index.js 25681 var prop_types = __webpack_require__("17x9"); 25682 var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); 25683 25684 // EXTERNAL MODULE: ./node_modules/downshift/node_modules/react-is/index.js 25685 var react_is = __webpack_require__("cD2C"); 25686 25687 // CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.module.js 25688 function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function index_module_e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return index_module_e(r.overflowY,n)||index_module_e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function index_module_r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}/* harmony default export */ var index_module = (function(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?index_module_r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:index_module_r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?index_module_r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:index_module_r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}); 25689 25690 // CONCATENATED MODULE: ./node_modules/downshift/node_modules/tslib/tslib.es6.js 25691 /*! ***************************************************************************** 25692 Copyright (c) Microsoft Corporation. 25693 25694 Permission to use, copy, modify, and/or distribute this software for any 25695 purpose with or without fee is hereby granted. 25696 25697 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 25698 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 25699 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 25700 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 25701 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 25702 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 25703 PERFORMANCE OF THIS SOFTWARE. 25704 ***************************************************************************** */ 25705 /* global Reflect, Promise */ 25706 25707 var extendStatics = function(d, b) { 25708 extendStatics = Object.setPrototypeOf || 25709 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 25710 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 25711 return extendStatics(d, b); 25712 }; 25713 25714 function __extends(d, b) { 25715 if (typeof b !== "function" && b !== null) 25716 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 25717 extendStatics(d, b); 25718 function __() { this.constructor = d; } 25719 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 25720 } 25721 25722 var __assign = function() { 25723 __assign = Object.assign || function __assign(t) { 25724 for (var s, i = 1, n = arguments.length; i < n; i++) { 25725 s = arguments[i]; 25726 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 25727 } 25728 return t; 25729 } 25730 return __assign.apply(this, arguments); 25731 } 25732 25733 function __rest(s, e) { 25734 var t = {}; 25735 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 25736 t[p] = s[p]; 25737 if (s != null && typeof Object.getOwnPropertySymbols === "function") 25738 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 25739 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 25740 t[p[i]] = s[p[i]]; 25741 } 25742 return t; 25743 } 25744 25745 function __decorate(decorators, target, key, desc) { 25746 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 25747 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 25748 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 25749 return c > 3 && r && Object.defineProperty(target, key, r), r; 25750 } 25751 25752 function __param(paramIndex, decorator) { 25753 return function (target, key) { decorator(target, key, paramIndex); } 25754 } 25755 25756 function __metadata(metadataKey, metadataValue) { 25757 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 25758 } 25759 25760 function __awaiter(thisArg, _arguments, P, generator) { 25761 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 25762 return new (P || (P = Promise))(function (resolve, reject) { 25763 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 25764 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 25765 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 25766 step((generator = generator.apply(thisArg, _arguments || [])).next()); 25767 }); 25768 } 25769 25770 function __generator(thisArg, body) { 25771 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 25772 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 25773 function verb(n) { return function (v) { return step([n, v]); }; } 25774 function step(op) { 25775 if (f) throw new TypeError("Generator is already executing."); 25776 while (_) try { 25777 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 25778 if (y = 0, t) op = [op[0] & 2, t.value]; 25779 switch (op[0]) { 25780 case 0: case 1: t = op; break; 25781 case 4: _.label++; return { value: op[1], done: false }; 25782 case 5: _.label++; y = op[1]; op = [0]; continue; 25783 case 7: op = _.ops.pop(); _.trys.pop(); continue; 25784 default: 25785 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 25786 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 25787 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 25788 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 25789 if (t[2]) _.ops.pop(); 25790 _.trys.pop(); continue; 25791 } 25792 op = body.call(thisArg, _); 25793 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 25794 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 25795 } 25796 } 25797 25798 var __createBinding = Object.create ? (function(o, m, k, k2) { 25799 if (k2 === undefined) k2 = k; 25800 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 25801 }) : (function(o, m, k, k2) { 25802 if (k2 === undefined) k2 = k; 25803 o[k2] = m[k]; 25804 }); 25805 25806 function __exportStar(m, o) { 25807 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 25808 } 25809 25810 function __values(o) { 25811 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 25812 if (m) return m.call(o); 25813 if (o && typeof o.length === "number") return { 25814 next: function () { 25815 if (o && i >= o.length) o = void 0; 25816 return { value: o && o[i++], done: !o }; 25817 } 25818 }; 25819 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 25820 } 25821 25822 function __read(o, n) { 25823 var m = typeof Symbol === "function" && o[Symbol.iterator]; 25824 if (!m) return o; 25825 var i = m.call(o), r, ar = [], e; 25826 try { 25827 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 25828 } 25829 catch (error) { e = { error: error }; } 25830 finally { 25831 try { 25832 if (r && !r.done && (m = i["return"])) m.call(i); 25833 } 25834 finally { if (e) throw e.error; } 25835 } 25836 return ar; 25837 } 25838 25839 /** @deprecated */ 25840 function __spread() { 25841 for (var ar = [], i = 0; i < arguments.length; i++) 25842 ar = ar.concat(__read(arguments[i])); 25843 return ar; 25844 } 25845 25846 /** @deprecated */ 25847 function __spreadArrays() { 25848 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 25849 for (var r = Array(s), k = 0, i = 0; i < il; i++) 25850 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 25851 r[k] = a[j]; 25852 return r; 25853 } 25854 25855 function __spreadArray(to, from, pack) { 25856 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 25857 if (ar || !(i in from)) { 25858 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 25859 ar[i] = from[i]; 25860 } 25861 } 25862 return to.concat(ar || Array.prototype.slice.call(from)); 25863 } 25864 25865 function __await(v) { 25866 return this instanceof __await ? (this.v = v, this) : new __await(v); 25867 } 25868 25869 function __asyncGenerator(thisArg, _arguments, generator) { 25870 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 25871 var g = generator.apply(thisArg, _arguments || []), i, q = []; 25872 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 25873 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 25874 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 25875 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 25876 function fulfill(value) { resume("next", value); } 25877 function reject(value) { resume("throw", value); } 25878 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 25879 } 25880 25881 function __asyncDelegator(o) { 25882 var i, p; 25883 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 25884 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 25885 } 25886 25887 function __asyncValues(o) { 25888 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 25889 var m = o[Symbol.asyncIterator], i; 25890 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 25891 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 25892 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 25893 } 25894 25895 function __makeTemplateObject(cooked, raw) { 25896 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 25897 return cooked; 25898 }; 25899 25900 var __setModuleDefault = Object.create ? (function(o, v) { 25901 Object.defineProperty(o, "default", { enumerable: true, value: v }); 25902 }) : function(o, v) { 25903 o["default"] = v; 25904 }; 25905 25906 function __importStar(mod) { 25907 if (mod && mod.__esModule) return mod; 25908 var result = {}; 25909 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 25910 __setModuleDefault(result, mod); 25911 return result; 25912 } 25913 25914 function __importDefault(mod) { 25915 return (mod && mod.__esModule) ? mod : { default: mod }; 25916 } 25917 25918 function __classPrivateFieldGet(receiver, state, kind, f) { 25919 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 25920 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 25921 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 25922 } 25923 25924 function __classPrivateFieldSet(receiver, state, value, kind, f) { 25925 if (kind === "m") throw new TypeError("Private method is not writable"); 25926 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 25927 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 25928 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 25929 } 25930 25931 // CONCATENATED MODULE: ./node_modules/downshift/dist/downshift.esm.js 25932 25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 var idCounter = 0; 25943 /** 25944 * Accepts a parameter and returns it if it's a function 25945 * or a noop function if it's not. This allows us to 25946 * accept a callback, but not worry about it if it's not 25947 * passed. 25948 * @param {Function} cb the callback 25949 * @return {Function} a function 25950 */ 25951 25952 function cbToCb(cb) { 25953 return typeof cb === 'function' ? cb : downshift_esm_noop; 25954 } 25955 25956 function downshift_esm_noop() {} 25957 /** 25958 * Scroll node into view if necessary 25959 * @param {HTMLElement} node the element that should scroll into view 25960 * @param {HTMLElement} menuNode the menu element of the component 25961 */ 25962 25963 25964 function downshift_esm_scrollIntoView(node, menuNode) { 25965 if (!node) { 25966 return; 25967 } 25968 25969 var actions = index_module(node, { 25970 boundary: menuNode, 25971 block: 'nearest', 25972 scrollMode: 'if-needed' 25973 }); 25974 actions.forEach(function (_ref) { 25975 var el = _ref.el, 25976 top = _ref.top, 25977 left = _ref.left; 25978 el.scrollTop = top; 25979 el.scrollLeft = left; 25980 }); 25981 } 25982 /** 25983 * @param {HTMLElement} parent the parent node 25984 * @param {HTMLElement} child the child node 25985 * @param {Window} environment The window context where downshift renders. 25986 * @return {Boolean} whether the parent is the child or the child is in the parent 25987 */ 25988 25989 25990 function isOrContainsNode(parent, child, environment) { 25991 var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child); 25992 return result; 25993 } 25994 /** 25995 * Simple debounce implementation. Will call the given 25996 * function once after the time given has passed since 25997 * it was last called. 25998 * @param {Function} fn the function to call after the time 25999 * @param {Number} time the time to wait 26000 * @return {Function} the debounced function 26001 */ 26002 26003 26004 function debounce(fn, time) { 26005 var timeoutId; 26006 26007 function cancel() { 26008 if (timeoutId) { 26009 clearTimeout(timeoutId); 26010 } 26011 } 26012 26013 function wrapper() { 26014 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 26015 args[_key] = arguments[_key]; 26016 } 26017 26018 cancel(); 26019 timeoutId = setTimeout(function () { 26020 timeoutId = null; 26021 fn.apply(void 0, args); 26022 }, time); 26023 } 26024 26025 wrapper.cancel = cancel; 26026 return wrapper; 26027 } 26028 /** 26029 * This is intended to be used to compose event handlers. 26030 * They are executed in order until one of them sets 26031 * `event.preventDownshiftDefault = true`. 26032 * @param {...Function} fns the event handler functions 26033 * @return {Function} the event handler to add to an element 26034 */ 26035 26036 26037 function callAllEventHandlers() { 26038 for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 26039 fns[_key2] = arguments[_key2]; 26040 } 26041 26042 return function (event) { 26043 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 26044 args[_key3 - 1] = arguments[_key3]; 26045 } 26046 26047 return fns.some(function (fn) { 26048 if (fn) { 26049 fn.apply(void 0, [event].concat(args)); 26050 } 26051 26052 return event.preventDownshiftDefault || event.hasOwnProperty('nativeEvent') && event.nativeEvent.preventDownshiftDefault; 26053 }); 26054 }; 26055 } 26056 26057 function handleRefs() { 26058 for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 26059 refs[_key4] = arguments[_key4]; 26060 } 26061 26062 return function (node) { 26063 refs.forEach(function (ref) { 26064 if (typeof ref === 'function') { 26065 ref(node); 26066 } else if (ref) { 26067 ref.current = node; 26068 } 26069 }); 26070 }; 26071 } 26072 /** 26073 * This generates a unique ID for an instance of Downshift 26074 * @return {String} the unique ID 26075 */ 26076 26077 26078 function downshift_esm_generateId() { 26079 return String(idCounter++); 26080 } 26081 /** 26082 * Resets idCounter to 0. Used for SSR. 26083 */ 26084 26085 26086 function resetIdCounter() { 26087 idCounter = 0; 26088 } 26089 /** 26090 * Default implementation for status message. Only added when menu is open. 26091 * Will specify if there are results in the list, and if so, how many, 26092 * and what keys are relevant. 26093 * 26094 * @param {Object} param the downshift state and other relevant properties 26095 * @return {String} the a11y status message 26096 */ 26097 26098 26099 function getA11yStatusMessage$1(_ref2) { 26100 var isOpen = _ref2.isOpen, 26101 resultCount = _ref2.resultCount, 26102 previousResultCount = _ref2.previousResultCount; 26103 26104 if (!isOpen) { 26105 return ''; 26106 } 26107 26108 if (!resultCount) { 26109 return 'No results are available.'; 26110 } 26111 26112 if (resultCount !== previousResultCount) { 26113 return resultCount + " result" + (resultCount === 1 ? ' is' : 's are') + " available, use up and down arrow keys to navigate. Press Enter key to select."; 26114 } 26115 26116 return ''; 26117 } 26118 /** 26119 * Takes an argument and if it's an array, returns the first item in the array 26120 * otherwise returns the argument 26121 * @param {*} arg the maybe-array 26122 * @param {*} defaultValue the value if arg is falsey not defined 26123 * @return {*} the arg or it's first item 26124 */ 26125 26126 26127 function unwrapArray(arg, defaultValue) { 26128 arg = Array.isArray(arg) ? 26129 /* istanbul ignore next (preact) */ 26130 arg[0] : arg; 26131 26132 if (!arg && defaultValue) { 26133 return defaultValue; 26134 } else { 26135 return arg; 26136 } 26137 } 26138 /** 26139 * @param {Object} element (P)react element 26140 * @return {Boolean} whether it's a DOM element 26141 */ 26142 26143 26144 function isDOMElement(element) { 26145 26146 26147 return typeof element.type === 'string'; 26148 } 26149 /** 26150 * @param {Object} element (P)react element 26151 * @return {Object} the props 26152 */ 26153 26154 26155 function getElementProps(element) { 26156 26157 return element.props; 26158 } 26159 /** 26160 * Throws a helpful error message for required properties. Useful 26161 * to be used as a default in destructuring or object params. 26162 * @param {String} fnName the function name 26163 * @param {String} propName the prop name 26164 */ 26165 26166 26167 function requiredProp(fnName, propName) { 26168 // eslint-disable-next-line no-console 26169 console.error("The property \"" + propName + "\" is required in \"" + fnName + "\""); 26170 } 26171 26172 var stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type']; 26173 /** 26174 * @param {Object} state the state object 26175 * @return {Object} state that is relevant to downshift 26176 */ 26177 26178 function pickState(state) { 26179 if (state === void 0) { 26180 state = {}; 26181 } 26182 26183 var result = {}; 26184 stateKeys.forEach(function (k) { 26185 if (state.hasOwnProperty(k)) { 26186 result[k] = state[k]; 26187 } 26188 }); 26189 return result; 26190 } 26191 /** 26192 * This will perform a shallow merge of the given state object 26193 * with the state coming from props 26194 * (for the controlled component scenario) 26195 * This is used in state updater functions so they're referencing 26196 * the right state regardless of where it comes from. 26197 * 26198 * @param {Object} state The state of the component/hook. 26199 * @param {Object} props The props that may contain controlled values. 26200 * @returns {Object} The merged controlled state. 26201 */ 26202 26203 26204 function getState(state, props) { 26205 return Object.keys(state).reduce(function (prevState, key) { 26206 prevState[key] = isControlledProp(props, key) ? props[key] : state[key]; 26207 return prevState; 26208 }, {}); 26209 } 26210 /** 26211 * This determines whether a prop is a "controlled prop" meaning it is 26212 * state which is controlled by the outside of this component rather 26213 * than within this component. 26214 * 26215 * @param {Object} props The props that may contain controlled values. 26216 * @param {String} key the key to check 26217 * @return {Boolean} whether it is a controlled controlled prop 26218 */ 26219 26220 26221 function isControlledProp(props, key) { 26222 return props[key] !== undefined; 26223 } 26224 /** 26225 * Normalizes the 'key' property of a KeyboardEvent in IE/Edge 26226 * @param {Object} event a keyboardEvent object 26227 * @return {String} keyboard key 26228 */ 26229 26230 26231 function normalizeArrowKey(event) { 26232 var key = event.key, 26233 keyCode = event.keyCode; 26234 /* istanbul ignore next (ie) */ 26235 26236 if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) { 26237 return "Arrow" + key; 26238 } 26239 26240 return key; 26241 } 26242 /** 26243 * Simple check if the value passed is object literal 26244 * @param {*} obj any things 26245 * @return {Boolean} whether it's object literal 26246 */ 26247 26248 26249 function isPlainObject(obj) { 26250 return Object.prototype.toString.call(obj) === '[object Object]'; 26251 } 26252 /** 26253 * Returns the new index in the list, in a circular way. If next value is out of bonds from the total, 26254 * it will wrap to either 0 or itemCount - 1. 26255 * 26256 * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards. 26257 * @param {number} baseIndex The initial position to move from. 26258 * @param {number} itemCount The total number of items. 26259 * @param {Function} getItemNodeFromIndex Used to check if item is disabled. 26260 * @param {boolean} circular Specify if navigation is circular. Default is true. 26261 * @returns {number} The new index after the move. 26262 */ 26263 26264 26265 function getNextWrappingIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) { 26266 if (circular === void 0) { 26267 circular = true; 26268 } 26269 26270 if (itemCount === 0) { 26271 return -1; 26272 } 26273 26274 var itemsLastIndex = itemCount - 1; 26275 26276 if (typeof baseIndex !== 'number' || baseIndex < 0 || baseIndex >= itemCount) { 26277 baseIndex = moveAmount > 0 ? -1 : itemsLastIndex + 1; 26278 } 26279 26280 var newIndex = baseIndex + moveAmount; 26281 26282 if (newIndex < 0) { 26283 newIndex = circular ? itemsLastIndex : 0; 26284 } else if (newIndex > itemsLastIndex) { 26285 newIndex = circular ? 0 : itemsLastIndex; 26286 } 26287 26288 var nonDisabledNewIndex = getNextNonDisabledIndex(moveAmount, newIndex, itemCount, getItemNodeFromIndex, circular); 26289 26290 if (nonDisabledNewIndex === -1) { 26291 return baseIndex >= itemCount ? -1 : baseIndex; 26292 } 26293 26294 return nonDisabledNewIndex; 26295 } 26296 /** 26297 * Returns the next index in the list of an item that is not disabled. 26298 * 26299 * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards. 26300 * @param {number} baseIndex The initial position to move from. 26301 * @param {number} itemCount The total number of items. 26302 * @param {Function} getItemNodeFromIndex Used to check if item is disabled. 26303 * @param {boolean} circular Specify if navigation is circular. Default is true. 26304 * @returns {number} The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1. 26305 */ 26306 26307 26308 function getNextNonDisabledIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) { 26309 var currentElementNode = getItemNodeFromIndex(baseIndex); 26310 26311 if (!currentElementNode || !currentElementNode.hasAttribute('disabled')) { 26312 return baseIndex; 26313 } 26314 26315 if (moveAmount > 0) { 26316 for (var index = baseIndex + 1; index < itemCount; index++) { 26317 if (!getItemNodeFromIndex(index).hasAttribute('disabled')) { 26318 return index; 26319 } 26320 } 26321 } else { 26322 for (var _index = baseIndex - 1; _index >= 0; _index--) { 26323 if (!getItemNodeFromIndex(_index).hasAttribute('disabled')) { 26324 return _index; 26325 } 26326 } 26327 } 26328 26329 if (circular) { 26330 return moveAmount > 0 ? getNextNonDisabledIndex(1, 0, itemCount, getItemNodeFromIndex, false) : getNextNonDisabledIndex(-1, itemCount - 1, itemCount, getItemNodeFromIndex, false); 26331 } 26332 26333 return -1; 26334 } 26335 /** 26336 * Checks if event target is within the downshift elements. 26337 * 26338 * @param {EventTarget} target Target to check. 26339 * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc). 26340 * @param {Window} environment The window context where downshift renders. 26341 * @param {boolean} checkActiveElement Whether to also check activeElement. 26342 * 26343 * @returns {boolean} Whether or not the target is within downshift elements. 26344 */ 26345 26346 26347 function targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) { 26348 if (checkActiveElement === void 0) { 26349 checkActiveElement = true; 26350 } 26351 26352 return downshiftElements.some(function (contextNode) { 26353 return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment)); 26354 }); 26355 } // eslint-disable-next-line import/no-mutable-exports 26356 26357 26358 var validateControlledUnchanged = downshift_esm_noop; 26359 /* istanbul ignore next */ 26360 26361 if (false) {} 26362 26363 var cleanupStatus = debounce(function (documentProp) { 26364 getStatusDiv(documentProp).textContent = ''; 26365 }, 500); 26366 /** 26367 * @param {String} status the status message 26368 * @param {Object} documentProp document passed by the user. 26369 */ 26370 26371 function setStatus(status, documentProp) { 26372 var div = getStatusDiv(documentProp); 26373 26374 if (!status) { 26375 return; 26376 } 26377 26378 div.textContent = status; 26379 cleanupStatus(documentProp); 26380 } 26381 /** 26382 * Get the status node or create it if it does not already exist. 26383 * @param {Object} documentProp document passed by the user. 26384 * @return {HTMLElement} the status node. 26385 */ 26386 26387 26388 function getStatusDiv(documentProp) { 26389 if (documentProp === void 0) { 26390 documentProp = document; 26391 } 26392 26393 var statusDiv = documentProp.getElementById('a11y-status-message'); 26394 26395 if (statusDiv) { 26396 return statusDiv; 26397 } 26398 26399 statusDiv = documentProp.createElement('div'); 26400 statusDiv.setAttribute('id', 'a11y-status-message'); 26401 statusDiv.setAttribute('role', 'status'); 26402 statusDiv.setAttribute('aria-live', 'polite'); 26403 statusDiv.setAttribute('aria-relevant', 'additions text'); 26404 Object.assign(statusDiv.style, { 26405 border: '0', 26406 clip: 'rect(0 0 0 0)', 26407 height: '1px', 26408 margin: '-1px', 26409 overflow: 'hidden', 26410 padding: '0', 26411 position: 'absolute', 26412 width: '1px' 26413 }); 26414 documentProp.body.appendChild(statusDiv); 26415 return statusDiv; 26416 } 26417 26418 var unknown = false ? undefined : 0; 26419 var mouseUp = false ? undefined : 1; 26420 var itemMouseEnter = false ? undefined : 2; 26421 var keyDownArrowUp = false ? undefined : 3; 26422 var keyDownArrowDown = false ? undefined : 4; 26423 var keyDownEscape = false ? undefined : 5; 26424 var keyDownEnter = false ? undefined : 6; 26425 var keyDownHome = false ? undefined : 7; 26426 var keyDownEnd = false ? undefined : 8; 26427 var clickItem = false ? undefined : 9; 26428 var blurInput = false ? undefined : 10; 26429 var changeInput = false ? undefined : 11; 26430 var keyDownSpaceButton = false ? undefined : 12; 26431 var clickButton = false ? undefined : 13; 26432 var blurButton = false ? undefined : 14; 26433 var controlledPropUpdatedSelectedItem = false ? undefined : 15; 26434 var touchEnd = false ? undefined : 16; 26435 26436 var stateChangeTypes$3 = /*#__PURE__*/Object.freeze({ 26437 __proto__: null, 26438 unknown: unknown, 26439 mouseUp: mouseUp, 26440 itemMouseEnter: itemMouseEnter, 26441 keyDownArrowUp: keyDownArrowUp, 26442 keyDownArrowDown: keyDownArrowDown, 26443 keyDownEscape: keyDownEscape, 26444 keyDownEnter: keyDownEnter, 26445 keyDownHome: keyDownHome, 26446 keyDownEnd: keyDownEnd, 26447 clickItem: clickItem, 26448 blurInput: blurInput, 26449 changeInput: changeInput, 26450 keyDownSpaceButton: keyDownSpaceButton, 26451 clickButton: clickButton, 26452 blurButton: blurButton, 26453 controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem, 26454 touchEnd: touchEnd 26455 }); 26456 26457 var _excluded$4 = ["refKey", "ref"], 26458 _excluded2$3 = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"], 26459 _excluded3$2 = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"], 26460 _excluded4$1 = ["refKey", "ref"], 26461 _excluded5$1 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"]; 26462 26463 var downshift_esm_Downshift = /*#__PURE__*/function () { 26464 var Downshift = /*#__PURE__*/function (_Component) { 26465 inheritsLoose_inheritsLoose(Downshift, _Component); 26466 26467 function Downshift(_props) { 26468 var _this; 26469 26470 _this = _Component.call(this, _props) || this; // fancy destructuring + defaults + aliases 26471 // this basically says each value of state should either be set to 26472 // the initial value or the default value if the initial value is not provided 26473 26474 _this.id = _this.props.id || "downshift-" + downshift_esm_generateId(); 26475 _this.menuId = _this.props.menuId || _this.id + "-menu"; 26476 _this.labelId = _this.props.labelId || _this.id + "-label"; 26477 _this.inputId = _this.props.inputId || _this.id + "-input"; 26478 26479 _this.getItemId = _this.props.getItemId || function (index) { 26480 return _this.id + "-item-" + index; 26481 }; 26482 26483 _this.input = null; 26484 _this.items = []; 26485 _this.itemCount = null; 26486 _this.previousResultCount = 0; 26487 _this.timeoutIds = []; 26488 26489 _this.internalSetTimeout = function (fn, time) { 26490 var id = setTimeout(function () { 26491 _this.timeoutIds = _this.timeoutIds.filter(function (i) { 26492 return i !== id; 26493 }); 26494 fn(); 26495 }, time); 26496 26497 _this.timeoutIds.push(id); 26498 }; 26499 26500 _this.setItemCount = function (count) { 26501 _this.itemCount = count; 26502 }; 26503 26504 _this.unsetItemCount = function () { 26505 _this.itemCount = null; 26506 }; 26507 26508 _this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) { 26509 if (highlightedIndex === void 0) { 26510 highlightedIndex = _this.props.defaultHighlightedIndex; 26511 } 26512 26513 if (otherStateToSet === void 0) { 26514 otherStateToSet = {}; 26515 } 26516 26517 otherStateToSet = pickState(otherStateToSet); 26518 26519 _this.internalSetState(extends_extends({ 26520 highlightedIndex: highlightedIndex 26521 }, otherStateToSet)); 26522 }; 26523 26524 _this.clearSelection = function (cb) { 26525 _this.internalSetState({ 26526 selectedItem: null, 26527 inputValue: '', 26528 highlightedIndex: _this.props.defaultHighlightedIndex, 26529 isOpen: _this.props.defaultIsOpen 26530 }, cb); 26531 }; 26532 26533 _this.selectItem = function (item, otherStateToSet, cb) { 26534 otherStateToSet = pickState(otherStateToSet); 26535 26536 _this.internalSetState(extends_extends({ 26537 isOpen: _this.props.defaultIsOpen, 26538 highlightedIndex: _this.props.defaultHighlightedIndex, 26539 selectedItem: item, 26540 inputValue: _this.props.itemToString(item) 26541 }, otherStateToSet), cb); 26542 }; 26543 26544 _this.selectItemAtIndex = function (itemIndex, otherStateToSet, cb) { 26545 var item = _this.items[itemIndex]; 26546 26547 if (item == null) { 26548 return; 26549 } 26550 26551 _this.selectItem(item, otherStateToSet, cb); 26552 }; 26553 26554 _this.selectHighlightedItem = function (otherStateToSet, cb) { 26555 return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb); 26556 }; 26557 26558 _this.internalSetState = function (stateToSet, cb) { 26559 var isItemSelected, onChangeArg; 26560 var onStateChangeArg = {}; 26561 var isStateToSetFunction = typeof stateToSet === 'function'; // we want to call `onInputValueChange` before the `setState` call 26562 // so someone controlling the `inputValue` state gets notified of 26563 // the input change as soon as possible. This avoids issues with 26564 // preserving the cursor position. 26565 // See https://github.com/downshift-js/downshift/issues/217 for more info. 26566 26567 if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) { 26568 _this.props.onInputValueChange(stateToSet.inputValue, extends_extends({}, _this.getStateAndHelpers(), stateToSet)); 26569 } 26570 26571 return _this.setState(function (state) { 26572 state = _this.getState(state); 26573 var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet; // Your own function that could modify the state that will be set. 26574 26575 newStateToSet = _this.props.stateReducer(state, newStateToSet); // checks if an item is selected, regardless of if it's different from 26576 // what was selected before 26577 // used to determine if onSelect and onChange callbacks should be called 26578 26579 isItemSelected = newStateToSet.hasOwnProperty('selectedItem'); // this keeps track of the object we want to call with setState 26580 26581 var nextState = {}; // this is just used to tell whether the state changed 26582 26583 var nextFullState = {}; // we need to call on change if the outside world is controlling any of our state 26584 // and we're trying to update that state. OR if the selection has changed and we're 26585 // trying to update the selection 26586 26587 if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) { 26588 onChangeArg = newStateToSet.selectedItem; 26589 } 26590 26591 newStateToSet.type = newStateToSet.type || unknown; 26592 Object.keys(newStateToSet).forEach(function (key) { 26593 // onStateChangeArg should only have the state that is 26594 // actually changing 26595 if (state[key] !== newStateToSet[key]) { 26596 onStateChangeArg[key] = newStateToSet[key]; 26597 } // the type is useful for the onStateChangeArg 26598 // but we don't actually want to set it in internal state. 26599 // this is an undocumented feature for now... Not all internalSetState 26600 // calls support it and I'm not certain we want them to yet. 26601 // But it enables users controlling the isOpen state to know when 26602 // the isOpen state changes due to mouseup events which is quite handy. 26603 26604 26605 if (key === 'type') { 26606 return; 26607 } 26608 26609 nextFullState[key] = newStateToSet[key]; // if it's coming from props, then we don't care to set it internally 26610 26611 if (!isControlledProp(_this.props, key)) { 26612 nextState[key] = newStateToSet[key]; 26613 } 26614 }); // if stateToSet is a function, then we weren't able to call onInputValueChange 26615 // earlier, so we'll call it now that we know what the inputValue state will be. 26616 26617 if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) { 26618 _this.props.onInputValueChange(newStateToSet.inputValue, extends_extends({}, _this.getStateAndHelpers(), newStateToSet)); 26619 } 26620 26621 return nextState; 26622 }, function () { 26623 // call the provided callback if it's a function 26624 cbToCb(cb)(); // only call the onStateChange and onChange callbacks if 26625 // we have relevant information to pass them. 26626 26627 var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1; 26628 26629 if (hasMoreStateThanType) { 26630 _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers()); 26631 } 26632 26633 if (isItemSelected) { 26634 _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers()); 26635 } 26636 26637 if (onChangeArg !== undefined) { 26638 _this.props.onChange(onChangeArg, _this.getStateAndHelpers()); 26639 } // this is currently undocumented and therefore subject to change 26640 // We'll try to not break it, but just be warned. 26641 26642 26643 _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers()); 26644 }); 26645 }; 26646 26647 _this.rootRef = function (node) { 26648 return _this._rootNode = node; 26649 }; 26650 26651 _this.getRootProps = function (_temp, _temp2) { 26652 var _extends2; 26653 26654 var _ref = _temp === void 0 ? {} : _temp, 26655 _ref$refKey = _ref.refKey, 26656 refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey, 26657 ref = _ref.ref, 26658 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$4); 26659 26660 var _ref2 = _temp2 === void 0 ? {} : _temp2, 26661 _ref2$suppressRefErro = _ref2.suppressRefError, 26662 suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro; 26663 26664 // this is used in the render to know whether the user has called getRootProps. 26665 // It uses that to know whether to apply the props automatically 26666 _this.getRootProps.called = true; 26667 _this.getRootProps.refKey = refKey; 26668 _this.getRootProps.suppressRefError = suppressRefError; 26669 26670 var _this$getState = _this.getState(), 26671 isOpen = _this$getState.isOpen; 26672 26673 return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : null, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest); 26674 }; 26675 26676 _this.keyDownHandlers = { 26677 ArrowDown: function ArrowDown(event) { 26678 var _this2 = this; 26679 26680 event.preventDefault(); 26681 26682 if (this.getState().isOpen) { 26683 var amount = event.shiftKey ? 5 : 1; 26684 this.moveHighlightedIndex(amount, { 26685 type: keyDownArrowDown 26686 }); 26687 } else { 26688 this.internalSetState({ 26689 isOpen: true, 26690 type: keyDownArrowDown 26691 }, function () { 26692 var itemCount = _this2.getItemCount(); 26693 26694 if (itemCount > 0) { 26695 var _this2$getState = _this2.getState(), 26696 highlightedIndex = _this2$getState.highlightedIndex; 26697 26698 var nextHighlightedIndex = getNextWrappingIndex(1, highlightedIndex, itemCount, function (index) { 26699 return _this2.getItemNodeFromIndex(index); 26700 }); 26701 26702 _this2.setHighlightedIndex(nextHighlightedIndex, { 26703 type: keyDownArrowDown 26704 }); 26705 } 26706 }); 26707 } 26708 }, 26709 ArrowUp: function ArrowUp(event) { 26710 var _this3 = this; 26711 26712 event.preventDefault(); 26713 26714 if (this.getState().isOpen) { 26715 var amount = event.shiftKey ? -5 : -1; 26716 this.moveHighlightedIndex(amount, { 26717 type: keyDownArrowUp 26718 }); 26719 } else { 26720 this.internalSetState({ 26721 isOpen: true, 26722 type: keyDownArrowUp 26723 }, function () { 26724 var itemCount = _this3.getItemCount(); 26725 26726 if (itemCount > 0) { 26727 var _this3$getState = _this3.getState(), 26728 highlightedIndex = _this3$getState.highlightedIndex; 26729 26730 var nextHighlightedIndex = getNextWrappingIndex(-1, highlightedIndex, itemCount, function (index) { 26731 return _this3.getItemNodeFromIndex(index); 26732 }); 26733 26734 _this3.setHighlightedIndex(nextHighlightedIndex, { 26735 type: keyDownArrowUp 26736 }); 26737 } 26738 }); 26739 } 26740 }, 26741 Enter: function Enter(event) { 26742 if (event.which === 229) { 26743 return; 26744 } 26745 26746 var _this$getState2 = this.getState(), 26747 isOpen = _this$getState2.isOpen, 26748 highlightedIndex = _this$getState2.highlightedIndex; 26749 26750 if (isOpen && highlightedIndex != null) { 26751 event.preventDefault(); 26752 var item = this.items[highlightedIndex]; 26753 var itemNode = this.getItemNodeFromIndex(highlightedIndex); 26754 26755 if (item == null || itemNode && itemNode.hasAttribute('disabled')) { 26756 return; 26757 } 26758 26759 this.selectHighlightedItem({ 26760 type: keyDownEnter 26761 }); 26762 } 26763 }, 26764 Escape: function Escape(event) { 26765 event.preventDefault(); 26766 this.reset(extends_extends({ 26767 type: keyDownEscape 26768 }, !this.state.isOpen && { 26769 selectedItem: null, 26770 inputValue: '' 26771 })); 26772 } 26773 }; 26774 _this.buttonKeyDownHandlers = extends_extends({}, _this.keyDownHandlers, { 26775 ' ': function _(event) { 26776 event.preventDefault(); 26777 this.toggleMenu({ 26778 type: keyDownSpaceButton 26779 }); 26780 } 26781 }); 26782 _this.inputKeyDownHandlers = extends_extends({}, _this.keyDownHandlers, { 26783 Home: function Home(event) { 26784 var _this4 = this; 26785 26786 var _this$getState3 = this.getState(), 26787 isOpen = _this$getState3.isOpen; 26788 26789 if (!isOpen) { 26790 return; 26791 } 26792 26793 event.preventDefault(); 26794 var itemCount = this.getItemCount(); 26795 26796 if (itemCount <= 0 || !isOpen) { 26797 return; 26798 } // get next non-disabled starting downwards from 0 if that's disabled. 26799 26800 26801 var newHighlightedIndex = getNextNonDisabledIndex(1, 0, itemCount, function (index) { 26802 return _this4.getItemNodeFromIndex(index); 26803 }, false); 26804 this.setHighlightedIndex(newHighlightedIndex, { 26805 type: keyDownHome 26806 }); 26807 }, 26808 End: function End(event) { 26809 var _this5 = this; 26810 26811 var _this$getState4 = this.getState(), 26812 isOpen = _this$getState4.isOpen; 26813 26814 if (!isOpen) { 26815 return; 26816 } 26817 26818 event.preventDefault(); 26819 var itemCount = this.getItemCount(); 26820 26821 if (itemCount <= 0 || !isOpen) { 26822 return; 26823 } // get next non-disabled starting upwards from last index if that's disabled. 26824 26825 26826 var newHighlightedIndex = getNextNonDisabledIndex(-1, itemCount - 1, itemCount, function (index) { 26827 return _this5.getItemNodeFromIndex(index); 26828 }, false); 26829 this.setHighlightedIndex(newHighlightedIndex, { 26830 type: keyDownEnd 26831 }); 26832 } 26833 }); 26834 26835 _this.getToggleButtonProps = function (_temp3) { 26836 var _ref3 = _temp3 === void 0 ? {} : _temp3, 26837 onClick = _ref3.onClick; 26838 _ref3.onPress; 26839 var onKeyDown = _ref3.onKeyDown, 26840 onKeyUp = _ref3.onKeyUp, 26841 onBlur = _ref3.onBlur, 26842 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$3); 26843 26844 var _this$getState5 = _this.getState(), 26845 isOpen = _this$getState5.isOpen; 26846 26847 var enabledEventHandlers = { 26848 onClick: callAllEventHandlers(onClick, _this.buttonHandleClick), 26849 onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown), 26850 onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp), 26851 onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur) 26852 }; 26853 var eventHandlers = rest.disabled ? {} : enabledEventHandlers; 26854 return extends_extends({ 26855 type: 'button', 26856 role: 'button', 26857 'aria-label': isOpen ? 'close menu' : 'open menu', 26858 'aria-haspopup': true, 26859 'data-toggle': true 26860 }, eventHandlers, rest); 26861 }; 26862 26863 _this.buttonHandleKeyUp = function (event) { 26864 // Prevent click event from emitting in Firefox 26865 event.preventDefault(); 26866 }; 26867 26868 _this.buttonHandleKeyDown = function (event) { 26869 var key = normalizeArrowKey(event); 26870 26871 if (_this.buttonKeyDownHandlers[key]) { 26872 _this.buttonKeyDownHandlers[key].call(assertThisInitialized_assertThisInitialized(_this), event); 26873 } 26874 }; 26875 26876 _this.buttonHandleClick = function (event) { 26877 event.preventDefault(); // handle odd case for Safari and Firefox which 26878 // don't give the button the focus properly. 26879 26880 /* istanbul ignore if (can't reasonably test this) */ 26881 26882 if (_this.props.environment.document.activeElement === _this.props.environment.document.body) { 26883 event.target.focus(); 26884 } // to simplify testing components that use downshift, we'll not wrap this in a setTimeout 26885 // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated 26886 // when building for production and should therefore have no impact on production code. 26887 26888 26889 if (false) {} else { 26890 // Ensure that toggle of menu occurs after the potential blur event in iOS 26891 _this.internalSetTimeout(function () { 26892 return _this.toggleMenu({ 26893 type: clickButton 26894 }); 26895 }); 26896 } 26897 }; 26898 26899 _this.buttonHandleBlur = function (event) { 26900 var blurTarget = event.target; // Save blur target for comparison with activeElement later 26901 // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element 26902 26903 _this.internalSetTimeout(function () { 26904 if (!_this.isMouseDown && (_this.props.environment.document.activeElement == null || _this.props.environment.document.activeElement.id !== _this.inputId) && _this.props.environment.document.activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS) 26905 ) { 26906 _this.reset({ 26907 type: blurButton 26908 }); 26909 } 26910 }); 26911 }; 26912 26913 _this.getLabelProps = function (props) { 26914 return extends_extends({ 26915 htmlFor: _this.inputId, 26916 id: _this.labelId 26917 }, props); 26918 }; 26919 26920 _this.getInputProps = function (_temp4) { 26921 var _ref4 = _temp4 === void 0 ? {} : _temp4, 26922 onKeyDown = _ref4.onKeyDown, 26923 onBlur = _ref4.onBlur, 26924 onChange = _ref4.onChange, 26925 onInput = _ref4.onInput; 26926 _ref4.onChangeText; 26927 var rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref4, _excluded3$2); 26928 26929 var onChangeKey; 26930 var eventHandlers = {}; 26931 /* istanbul ignore next (preact) */ 26932 26933 { 26934 onChangeKey = 'onChange'; 26935 } 26936 26937 var _this$getState6 = _this.getState(), 26938 inputValue = _this$getState6.inputValue, 26939 isOpen = _this$getState6.isOpen, 26940 highlightedIndex = _this$getState6.highlightedIndex; 26941 26942 if (!rest.disabled) { 26943 var _eventHandlers; 26944 26945 eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers); 26946 } 26947 26948 return extends_extends({ 26949 'aria-autocomplete': 'list', 26950 'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : null, 26951 'aria-controls': isOpen ? _this.menuId : null, 26952 'aria-labelledby': _this.labelId, 26953 // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion 26954 // revert back since autocomplete="nope" is ignored on latest Chrome and Opera 26955 autoComplete: 'off', 26956 value: inputValue, 26957 id: _this.inputId 26958 }, eventHandlers, rest); 26959 }; 26960 26961 _this.inputHandleKeyDown = function (event) { 26962 var key = normalizeArrowKey(event); 26963 26964 if (key && _this.inputKeyDownHandlers[key]) { 26965 _this.inputKeyDownHandlers[key].call(assertThisInitialized_assertThisInitialized(_this), event); 26966 } 26967 }; 26968 26969 _this.inputHandleChange = function (event) { 26970 _this.internalSetState({ 26971 type: changeInput, 26972 isOpen: true, 26973 inputValue: event.target.value, 26974 highlightedIndex: _this.props.defaultHighlightedIndex 26975 }); 26976 }; 26977 26978 _this.inputHandleBlur = function () { 26979 // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element 26980 _this.internalSetTimeout(function () { 26981 var downshiftButtonIsActive = _this.props.environment.document && !!_this.props.environment.document.activeElement && !!_this.props.environment.document.activeElement.dataset && _this.props.environment.document.activeElement.dataset.toggle && _this._rootNode && _this._rootNode.contains(_this.props.environment.document.activeElement); 26982 26983 if (!_this.isMouseDown && !downshiftButtonIsActive) { 26984 _this.reset({ 26985 type: blurInput 26986 }); 26987 } 26988 }); 26989 }; 26990 26991 _this.menuRef = function (node) { 26992 _this._menuNode = node; 26993 }; 26994 26995 _this.getMenuProps = function (_temp5, _temp6) { 26996 var _extends3; 26997 26998 var _ref5 = _temp5 === void 0 ? {} : _temp5, 26999 _ref5$refKey = _ref5.refKey, 27000 refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey, 27001 ref = _ref5.ref, 27002 props = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded4$1); 27003 27004 var _ref6 = _temp6 === void 0 ? {} : _temp6, 27005 _ref6$suppressRefErro = _ref6.suppressRefError, 27006 suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro; 27007 27008 _this.getMenuProps.called = true; 27009 _this.getMenuProps.refKey = refKey; 27010 _this.getMenuProps.suppressRefError = suppressRefError; 27011 return extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = 'listbox', _extends3['aria-labelledby'] = props && props['aria-label'] ? null : _this.labelId, _extends3.id = _this.menuId, _extends3), props); 27012 }; 27013 27014 _this.getItemProps = function (_temp7) { 27015 var _enabledEventHandlers; 27016 27017 var _ref7 = _temp7 === void 0 ? {} : _temp7, 27018 onMouseMove = _ref7.onMouseMove, 27019 onMouseDown = _ref7.onMouseDown, 27020 onClick = _ref7.onClick; 27021 _ref7.onPress; 27022 var index = _ref7.index, 27023 _ref7$item = _ref7.item, 27024 item = _ref7$item === void 0 ? true ? 27025 /* istanbul ignore next */ 27026 undefined : undefined : _ref7$item, 27027 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref7, _excluded5$1); 27028 27029 if (index === undefined) { 27030 _this.items.push(item); 27031 27032 index = _this.items.indexOf(item); 27033 } else { 27034 _this.items[index] = item; 27035 } 27036 27037 var onSelectKey = 'onClick'; 27038 var customClickHandler = onClick; 27039 var enabledEventHandlers = (_enabledEventHandlers = { 27040 // onMouseMove is used over onMouseEnter here. onMouseMove 27041 // is only triggered on actual mouse movement while onMouseEnter 27042 // can fire on DOM changes, interrupting keyboard navigation 27043 onMouseMove: callAllEventHandlers(onMouseMove, function () { 27044 if (index === _this.getState().highlightedIndex) { 27045 return; 27046 } 27047 27048 _this.setHighlightedIndex(index, { 27049 type: itemMouseEnter 27050 }); // We never want to manually scroll when changing state based 27051 // on `onMouseMove` because we will be moving the element out 27052 // from under the user which is currently scrolling/moving the 27053 // cursor 27054 27055 27056 _this.avoidScrolling = true; 27057 27058 _this.internalSetTimeout(function () { 27059 return _this.avoidScrolling = false; 27060 }, 250); 27061 }), 27062 onMouseDown: callAllEventHandlers(onMouseDown, function (event) { 27063 // This prevents the activeElement from being changed 27064 // to the item so it can remain with the current activeElement 27065 // which is a more common use case. 27066 event.preventDefault(); 27067 }) 27068 }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function () { 27069 _this.selectItemAtIndex(index, { 27070 type: clickItem 27071 }); 27072 }), _enabledEventHandlers); // Passing down the onMouseDown handler to prevent redirect 27073 // of the activeElement if clicking on disabled items 27074 27075 var eventHandlers = rest.disabled ? { 27076 onMouseDown: enabledEventHandlers.onMouseDown 27077 } : enabledEventHandlers; 27078 return extends_extends({ 27079 id: _this.getItemId(index), 27080 role: 'option', 27081 'aria-selected': _this.getState().highlightedIndex === index 27082 }, eventHandlers, rest); 27083 }; 27084 27085 _this.clearItems = function () { 27086 _this.items = []; 27087 }; 27088 27089 _this.reset = function (otherStateToSet, cb) { 27090 if (otherStateToSet === void 0) { 27091 otherStateToSet = {}; 27092 } 27093 27094 otherStateToSet = pickState(otherStateToSet); 27095 27096 _this.internalSetState(function (_ref8) { 27097 var selectedItem = _ref8.selectedItem; 27098 return extends_extends({ 27099 isOpen: _this.props.defaultIsOpen, 27100 highlightedIndex: _this.props.defaultHighlightedIndex, 27101 inputValue: _this.props.itemToString(selectedItem) 27102 }, otherStateToSet); 27103 }, cb); 27104 }; 27105 27106 _this.toggleMenu = function (otherStateToSet, cb) { 27107 if (otherStateToSet === void 0) { 27108 otherStateToSet = {}; 27109 } 27110 27111 otherStateToSet = pickState(otherStateToSet); 27112 27113 _this.internalSetState(function (_ref9) { 27114 var isOpen = _ref9.isOpen; 27115 return extends_extends({ 27116 isOpen: !isOpen 27117 }, isOpen && { 27118 highlightedIndex: _this.props.defaultHighlightedIndex 27119 }, otherStateToSet); 27120 }, function () { 27121 var _this$getState7 = _this.getState(), 27122 isOpen = _this$getState7.isOpen, 27123 highlightedIndex = _this$getState7.highlightedIndex; 27124 27125 if (isOpen) { 27126 if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') { 27127 _this.setHighlightedIndex(highlightedIndex, otherStateToSet); 27128 } 27129 } 27130 27131 cbToCb(cb)(); 27132 }); 27133 }; 27134 27135 _this.openMenu = function (cb) { 27136 _this.internalSetState({ 27137 isOpen: true 27138 }, cb); 27139 }; 27140 27141 _this.closeMenu = function (cb) { 27142 _this.internalSetState({ 27143 isOpen: false 27144 }, cb); 27145 }; 27146 27147 _this.updateStatus = debounce(function () { 27148 var state = _this.getState(); 27149 27150 var item = _this.items[state.highlightedIndex]; 27151 27152 var resultCount = _this.getItemCount(); 27153 27154 var status = _this.props.getA11yStatusMessage(extends_extends({ 27155 itemToString: _this.props.itemToString, 27156 previousResultCount: _this.previousResultCount, 27157 resultCount: resultCount, 27158 highlightedItem: item 27159 }, state)); 27160 27161 _this.previousResultCount = resultCount; 27162 setStatus(status, _this.props.environment.document); 27163 }, 200); 27164 27165 var _this$props = _this.props, 27166 defaultHighlightedIndex = _this$props.defaultHighlightedIndex, 27167 _this$props$initialHi = _this$props.initialHighlightedIndex, 27168 _highlightedIndex = _this$props$initialHi === void 0 ? defaultHighlightedIndex : _this$props$initialHi, 27169 defaultIsOpen = _this$props.defaultIsOpen, 27170 _this$props$initialIs = _this$props.initialIsOpen, 27171 _isOpen = _this$props$initialIs === void 0 ? defaultIsOpen : _this$props$initialIs, 27172 _this$props$initialIn = _this$props.initialInputValue, 27173 _inputValue = _this$props$initialIn === void 0 ? '' : _this$props$initialIn, 27174 _this$props$initialSe = _this$props.initialSelectedItem, 27175 _selectedItem = _this$props$initialSe === void 0 ? null : _this$props$initialSe; 27176 27177 var _state = _this.getState({ 27178 highlightedIndex: _highlightedIndex, 27179 isOpen: _isOpen, 27180 inputValue: _inputValue, 27181 selectedItem: _selectedItem 27182 }); 27183 27184 if (_state.selectedItem != null && _this.props.initialInputValue === undefined) { 27185 _state.inputValue = _this.props.itemToString(_state.selectedItem); 27186 } 27187 27188 _this.state = _state; 27189 return _this; 27190 } 27191 27192 var _proto = Downshift.prototype; 27193 27194 /** 27195 * Clear all running timeouts 27196 */ 27197 _proto.internalClearTimeouts = function internalClearTimeouts() { 27198 this.timeoutIds.forEach(function (id) { 27199 clearTimeout(id); 27200 }); 27201 this.timeoutIds = []; 27202 } 27203 /** 27204 * Gets the state based on internal state or props 27205 * If a state value is passed via props, then that 27206 * is the value given, otherwise it's retrieved from 27207 * stateToMerge 27208 * 27209 * @param {Object} stateToMerge defaults to this.state 27210 * @return {Object} the state 27211 */ 27212 ; 27213 27214 _proto.getState = function getState$1(stateToMerge) { 27215 if (stateToMerge === void 0) { 27216 stateToMerge = this.state; 27217 } 27218 27219 return getState(stateToMerge, this.props); 27220 }; 27221 27222 _proto.getItemCount = function getItemCount() { 27223 // things read better this way. They're in priority order: 27224 // 1. `this.itemCount` 27225 // 2. `this.props.itemCount` 27226 // 3. `this.items.length` 27227 var itemCount = this.items.length; 27228 27229 if (this.itemCount != null) { 27230 itemCount = this.itemCount; 27231 } else if (this.props.itemCount !== undefined) { 27232 itemCount = this.props.itemCount; 27233 } 27234 27235 return itemCount; 27236 }; 27237 27238 _proto.getItemNodeFromIndex = function getItemNodeFromIndex(index) { 27239 return this.props.environment.document.getElementById(this.getItemId(index)); 27240 }; 27241 27242 _proto.scrollHighlightedItemIntoView = function scrollHighlightedItemIntoView() { 27243 /* istanbul ignore else (react-native) */ 27244 { 27245 var node = this.getItemNodeFromIndex(this.getState().highlightedIndex); 27246 this.props.scrollIntoView(node, this._menuNode); 27247 } 27248 }; 27249 27250 _proto.moveHighlightedIndex = function moveHighlightedIndex(amount, otherStateToSet) { 27251 var _this6 = this; 27252 27253 var itemCount = this.getItemCount(); 27254 27255 var _this$getState8 = this.getState(), 27256 highlightedIndex = _this$getState8.highlightedIndex; 27257 27258 if (itemCount > 0) { 27259 var nextHighlightedIndex = getNextWrappingIndex(amount, highlightedIndex, itemCount, function (index) { 27260 return _this6.getItemNodeFromIndex(index); 27261 }); 27262 this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet); 27263 } 27264 }; 27265 27266 _proto.getStateAndHelpers = function getStateAndHelpers() { 27267 var _this$getState9 = this.getState(), 27268 highlightedIndex = _this$getState9.highlightedIndex, 27269 inputValue = _this$getState9.inputValue, 27270 selectedItem = _this$getState9.selectedItem, 27271 isOpen = _this$getState9.isOpen; 27272 27273 var itemToString = this.props.itemToString; 27274 var id = this.id; 27275 var getRootProps = this.getRootProps, 27276 getToggleButtonProps = this.getToggleButtonProps, 27277 getLabelProps = this.getLabelProps, 27278 getMenuProps = this.getMenuProps, 27279 getInputProps = this.getInputProps, 27280 getItemProps = this.getItemProps, 27281 openMenu = this.openMenu, 27282 closeMenu = this.closeMenu, 27283 toggleMenu = this.toggleMenu, 27284 selectItem = this.selectItem, 27285 selectItemAtIndex = this.selectItemAtIndex, 27286 selectHighlightedItem = this.selectHighlightedItem, 27287 setHighlightedIndex = this.setHighlightedIndex, 27288 clearSelection = this.clearSelection, 27289 clearItems = this.clearItems, 27290 reset = this.reset, 27291 setItemCount = this.setItemCount, 27292 unsetItemCount = this.unsetItemCount, 27293 setState = this.internalSetState; 27294 return { 27295 // prop getters 27296 getRootProps: getRootProps, 27297 getToggleButtonProps: getToggleButtonProps, 27298 getLabelProps: getLabelProps, 27299 getMenuProps: getMenuProps, 27300 getInputProps: getInputProps, 27301 getItemProps: getItemProps, 27302 // actions 27303 reset: reset, 27304 openMenu: openMenu, 27305 closeMenu: closeMenu, 27306 toggleMenu: toggleMenu, 27307 selectItem: selectItem, 27308 selectItemAtIndex: selectItemAtIndex, 27309 selectHighlightedItem: selectHighlightedItem, 27310 setHighlightedIndex: setHighlightedIndex, 27311 clearSelection: clearSelection, 27312 clearItems: clearItems, 27313 setItemCount: setItemCount, 27314 unsetItemCount: unsetItemCount, 27315 setState: setState, 27316 // props 27317 itemToString: itemToString, 27318 // derived 27319 id: id, 27320 // state 27321 highlightedIndex: highlightedIndex, 27322 inputValue: inputValue, 27323 isOpen: isOpen, 27324 selectedItem: selectedItem 27325 }; 27326 } //////////////////////////// ROOT 27327 ; 27328 27329 _proto.componentDidMount = function componentDidMount() { 27330 var _this7 = this; 27331 27332 /* istanbul ignore if (react-native) */ 27333 if (false) {} 27334 /* istanbul ignore if (react-native) */ 27335 27336 27337 { 27338 // this.isMouseDown helps us track whether the mouse is currently held down. 27339 // This is useful when the user clicks on an item in the list, but holds the mouse 27340 // down long enough for the list to disappear (because the blur event fires on the input) 27341 // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should 27342 // trigger hiding the menu. 27343 var onMouseDown = function onMouseDown() { 27344 _this7.isMouseDown = true; 27345 }; 27346 27347 var onMouseUp = function onMouseUp(event) { 27348 _this7.isMouseDown = false; // if the target element or the activeElement is within a downshift node 27349 // then we don't want to reset downshift 27350 27351 var contextWithinDownshift = targetWithinDownshift(event.target, [_this7._rootNode, _this7._menuNode], _this7.props.environment); 27352 27353 if (!contextWithinDownshift && _this7.getState().isOpen) { 27354 _this7.reset({ 27355 type: mouseUp 27356 }, function () { 27357 return _this7.props.onOuterClick(_this7.getStateAndHelpers()); 27358 }); 27359 } 27360 }; // Touching an element in iOS gives focus and hover states, but touching out of 27361 // the element will remove hover, and persist the focus state, resulting in the 27362 // blur event not being triggered. 27363 // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen. 27364 // If the user taps outside of Downshift, the component should be reset, 27365 // but not if the user is swiping 27366 27367 27368 var onTouchStart = function onTouchStart() { 27369 _this7.isTouchMove = false; 27370 }; 27371 27372 var onTouchMove = function onTouchMove() { 27373 _this7.isTouchMove = true; 27374 }; 27375 27376 var onTouchEnd = function onTouchEnd(event) { 27377 var contextWithinDownshift = targetWithinDownshift(event.target, [_this7._rootNode, _this7._menuNode], _this7.props.environment, false); 27378 27379 if (!_this7.isTouchMove && !contextWithinDownshift && _this7.getState().isOpen) { 27380 _this7.reset({ 27381 type: touchEnd 27382 }, function () { 27383 return _this7.props.onOuterClick(_this7.getStateAndHelpers()); 27384 }); 27385 } 27386 }; 27387 27388 var environment = this.props.environment; 27389 environment.addEventListener('mousedown', onMouseDown); 27390 environment.addEventListener('mouseup', onMouseUp); 27391 environment.addEventListener('touchstart', onTouchStart); 27392 environment.addEventListener('touchmove', onTouchMove); 27393 environment.addEventListener('touchend', onTouchEnd); 27394 27395 this.cleanup = function () { 27396 _this7.internalClearTimeouts(); 27397 27398 _this7.updateStatus.cancel(); 27399 27400 environment.removeEventListener('mousedown', onMouseDown); 27401 environment.removeEventListener('mouseup', onMouseUp); 27402 environment.removeEventListener('touchstart', onTouchStart); 27403 environment.removeEventListener('touchmove', onTouchMove); 27404 environment.removeEventListener('touchend', onTouchEnd); 27405 }; 27406 } 27407 }; 27408 27409 _proto.shouldScroll = function shouldScroll(prevState, prevProps) { 27410 var _ref10 = this.props.highlightedIndex === undefined ? this.getState() : this.props, 27411 currentHighlightedIndex = _ref10.highlightedIndex; 27412 27413 var _ref11 = prevProps.highlightedIndex === undefined ? prevState : prevProps, 27414 prevHighlightedIndex = _ref11.highlightedIndex; 27415 27416 var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen; 27417 var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex; 27418 return scrollWhenOpen || scrollWhenNavigating; 27419 }; 27420 27421 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { 27422 if (false) {} 27423 27424 if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) { 27425 this.internalSetState({ 27426 type: controlledPropUpdatedSelectedItem, 27427 inputValue: this.props.itemToString(this.props.selectedItem) 27428 }); 27429 } 27430 27431 if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) { 27432 this.scrollHighlightedItemIntoView(); 27433 } 27434 /* istanbul ignore else (react-native) */ 27435 27436 27437 { 27438 this.updateStatus(); 27439 } 27440 }; 27441 27442 _proto.componentWillUnmount = function componentWillUnmount() { 27443 this.cleanup(); // avoids memory leak 27444 }; 27445 27446 _proto.render = function render() { 27447 var children = unwrapArray(this.props.children, downshift_esm_noop); // because the items are rerendered every time we call the children 27448 // we clear this out each render and it will be populated again as 27449 // getItemProps is called. 27450 27451 this.clearItems(); // we reset this so we know whether the user calls getRootProps during 27452 // this render. If they do then we don't need to do anything, 27453 // if they don't then we need to clone the element they return and 27454 // apply the props for them. 27455 27456 this.getRootProps.called = false; 27457 this.getRootProps.refKey = undefined; 27458 this.getRootProps.suppressRefError = undefined; // we do something similar for getMenuProps 27459 27460 this.getMenuProps.called = false; 27461 this.getMenuProps.refKey = undefined; 27462 this.getMenuProps.suppressRefError = undefined; // we do something similar for getLabelProps 27463 27464 this.getLabelProps.called = false; // and something similar for getInputProps 27465 27466 this.getInputProps.called = false; 27467 var element = unwrapArray(children(this.getStateAndHelpers())); 27468 27469 if (!element) { 27470 return null; 27471 } 27472 27473 if (this.getRootProps.called || this.props.suppressRefError) { 27474 if (false) {} 27475 27476 return element; 27477 } else if (isDOMElement(element)) { 27478 // they didn't apply the root props, but we can clone 27479 // this and apply the props ourselves 27480 return /*#__PURE__*/Object(external_React_["cloneElement"])(element, this.getRootProps(getElementProps(element))); 27481 } 27482 /* istanbul ignore else */ 27483 27484 27485 if (false) {} 27486 /* istanbul ignore next */ 27487 27488 27489 return undefined; 27490 }; 27491 27492 return Downshift; 27493 }(external_React_["Component"]); 27494 27495 Downshift.defaultProps = { 27496 defaultHighlightedIndex: null, 27497 defaultIsOpen: false, 27498 getA11yStatusMessage: getA11yStatusMessage$1, 27499 itemToString: function itemToString(i) { 27500 if (i == null) { 27501 return ''; 27502 } 27503 27504 if (false) {} 27505 27506 return String(i); 27507 }, 27508 onStateChange: downshift_esm_noop, 27509 onInputValueChange: downshift_esm_noop, 27510 onUserAction: downshift_esm_noop, 27511 onChange: downshift_esm_noop, 27512 onSelect: downshift_esm_noop, 27513 onOuterClick: downshift_esm_noop, 27514 selectedItemChanged: function selectedItemChanged(prevItem, item) { 27515 return prevItem !== item; 27516 }, 27517 environment: 27518 /* istanbul ignore next (ssr) */ 27519 typeof window === 'undefined' ? {} : window, 27520 stateReducer: function stateReducer(state, stateToSet) { 27521 return stateToSet; 27522 }, 27523 suppressRefError: false, 27524 scrollIntoView: downshift_esm_scrollIntoView 27525 }; 27526 Downshift.stateChangeTypes = stateChangeTypes$3; 27527 return Downshift; 27528 }(); 27529 27530 false ? undefined : void 0; 27531 var Downshift$1 = downshift_esm_Downshift; 27532 27533 function validateGetMenuPropsCalledCorrectly(node, _ref12) { 27534 var refKey = _ref12.refKey; 27535 27536 if (!node) { 27537 // eslint-disable-next-line no-console 27538 console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element."); 27539 } 27540 } 27541 27542 function validateGetRootPropsCalledCorrectly(element, _ref13) { 27543 var refKey = _ref13.refKey; 27544 var refKeySpecified = refKey !== 'ref'; 27545 var isComposite = !isDOMElement(element); 27546 27547 if (isComposite && !refKeySpecified && !Object(react_is["isForwardRef"])(element)) { 27548 // eslint-disable-next-line no-console 27549 console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps'); 27550 } else if (!isComposite && refKeySpecified) { 27551 // eslint-disable-next-line no-console 27552 console.error("downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \"" + refKey + "\""); 27553 } 27554 27555 if (!Object(react_is["isForwardRef"])(element) && !getElementProps(element)[refKey]) { 27556 // eslint-disable-next-line no-console 27557 console.error("downshift: You must apply the ref prop \"" + refKey + "\" from getRootProps onto your root element."); 27558 } 27559 } 27560 27561 var _excluded$3 = ["isInitialMount", "highlightedIndex", "items", "environment"]; 27562 var dropdownDefaultStateValues = { 27563 highlightedIndex: -1, 27564 isOpen: false, 27565 selectedItem: null, 27566 inputValue: '' 27567 }; 27568 27569 function callOnChangeProps(action, state, newState) { 27570 var props = action.props, 27571 type = action.type; 27572 var changes = {}; 27573 Object.keys(state).forEach(function (key) { 27574 invokeOnChangeHandler(key, action, state, newState); 27575 27576 if (newState[key] !== state[key]) { 27577 changes[key] = newState[key]; 27578 } 27579 }); 27580 27581 if (props.onStateChange && Object.keys(changes).length) { 27582 props.onStateChange(extends_extends({ 27583 type: type 27584 }, changes)); 27585 } 27586 } 27587 27588 function invokeOnChangeHandler(key, action, state, newState) { 27589 var props = action.props, 27590 type = action.type; 27591 var handler = "on" + capitalizeString(key) + "Change"; 27592 27593 if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) { 27594 props[handler](extends_extends({ 27595 type: type 27596 }, newState)); 27597 } 27598 } 27599 /** 27600 * Default state reducer that returns the changes. 27601 * 27602 * @param {Object} s state. 27603 * @param {Object} a action with changes. 27604 * @returns {Object} changes. 27605 */ 27606 27607 27608 function downshift_esm_stateReducer(s, a) { 27609 return a.changes; 27610 } 27611 /** 27612 * Returns a message to be added to aria-live region when item is selected. 27613 * 27614 * @param {Object} selectionParameters Parameters required to build the message. 27615 * @returns {string} The a11y message. 27616 */ 27617 27618 27619 function downshift_esm_getA11ySelectionMessage(selectionParameters) { 27620 var selectedItem = selectionParameters.selectedItem, 27621 itemToStringLocal = selectionParameters.itemToString; 27622 return selectedItem ? itemToStringLocal(selectedItem) + " has been selected." : ''; 27623 } 27624 /** 27625 * Debounced call for updating the a11y message. 27626 */ 27627 27628 27629 var updateA11yStatus = debounce(function (getA11yMessage, document) { 27630 setStatus(getA11yMessage(), document); 27631 }, 200); // istanbul ignore next 27632 27633 var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? external_React_["useLayoutEffect"] : external_React_["useEffect"]; 27634 27635 function useElementIds(_ref) { 27636 var _ref$id = _ref.id, 27637 id = _ref$id === void 0 ? "downshift-" + downshift_esm_generateId() : _ref$id, 27638 labelId = _ref.labelId, 27639 menuId = _ref.menuId, 27640 getItemId = _ref.getItemId, 27641 toggleButtonId = _ref.toggleButtonId, 27642 inputId = _ref.inputId; 27643 var elementIdsRef = Object(external_React_["useRef"])({ 27644 labelId: labelId || id + "-label", 27645 menuId: menuId || id + "-menu", 27646 getItemId: getItemId || function (index) { 27647 return id + "-item-" + index; 27648 }, 27649 toggleButtonId: toggleButtonId || id + "-toggle-button", 27650 inputId: inputId || id + "-input" 27651 }); 27652 return elementIdsRef.current; 27653 } 27654 27655 function getItemIndex(index, item, items) { 27656 if (index !== undefined) { 27657 return index; 27658 } 27659 27660 if (items.length === 0) { 27661 return -1; 27662 } 27663 27664 return items.indexOf(item); 27665 } 27666 27667 function downshift_esm_itemToString(item) { 27668 return item ? String(item) : ''; 27669 } 27670 27671 function isAcceptedCharacterKey(key) { 27672 return /^\S{1}$/.test(key); 27673 } 27674 27675 function capitalizeString(string) { 27676 return "" + string.slice(0, 1).toUpperCase() + string.slice(1); 27677 } 27678 27679 function useLatestRef(val) { 27680 var ref = Object(external_React_["useRef"])(val); // technically this is not "concurrent mode safe" because we're manipulating 27681 // the value during render (so it's not idempotent). However, the places this 27682 // hook is used is to support memoizing callbacks which will be called 27683 // *during* render, so we need the latest values *during* render. 27684 // If not for this, then we'd probably want to use useLayoutEffect instead. 27685 27686 ref.current = val; 27687 return ref; 27688 } 27689 /** 27690 * Computes the controlled state using a the previous state, props, 27691 * two reducers, one from downshift and an optional one from the user. 27692 * Also calls the onChange handlers for state values that have changed. 27693 * 27694 * @param {Function} reducer Reducer function from downshift. 27695 * @param {Object} initialState Initial state of the hook. 27696 * @param {Object} props The hook props. 27697 * @returns {Array} An array with the state and an action dispatcher. 27698 */ 27699 27700 27701 function useEnhancedReducer(reducer, initialState, props) { 27702 var prevStateRef = Object(external_React_["useRef"])(); 27703 var actionRef = Object(external_React_["useRef"])(); 27704 var enhancedReducer = Object(external_React_["useCallback"])(function (state, action) { 27705 actionRef.current = action; 27706 state = getState(state, action.props); 27707 var changes = reducer(state, action); 27708 var newState = action.props.stateReducer(state, extends_extends({}, action, { 27709 changes: changes 27710 })); 27711 return newState; 27712 }, [reducer]); 27713 27714 var _useReducer = Object(external_React_["useReducer"])(enhancedReducer, initialState), 27715 state = _useReducer[0], 27716 dispatch = _useReducer[1]; 27717 27718 var propsRef = useLatestRef(props); 27719 var dispatchWithProps = Object(external_React_["useCallback"])(function (action) { 27720 return dispatch(extends_extends({ 27721 props: propsRef.current 27722 }, action)); 27723 }, [propsRef]); 27724 var action = actionRef.current; 27725 Object(external_React_["useEffect"])(function () { 27726 if (action && prevStateRef.current && prevStateRef.current !== state) { 27727 callOnChangeProps(action, getState(prevStateRef.current, action.props), state); 27728 } 27729 27730 prevStateRef.current = state; 27731 }, [state, props, action]); 27732 return [state, dispatchWithProps]; 27733 } 27734 /** 27735 * Wraps the useEnhancedReducer and applies the controlled prop values before 27736 * returning the new state. 27737 * 27738 * @param {Function} reducer Reducer function from downshift. 27739 * @param {Object} initialState Initial state of the hook. 27740 * @param {Object} props The hook props. 27741 * @returns {Array} An array with the state and an action dispatcher. 27742 */ 27743 27744 27745 function useControlledReducer$1(reducer, initialState, props) { 27746 var _useEnhancedReducer = useEnhancedReducer(reducer, initialState, props), 27747 state = _useEnhancedReducer[0], 27748 dispatch = _useEnhancedReducer[1]; 27749 27750 return [getState(state, props), dispatch]; 27751 } 27752 27753 var defaultProps$3 = { 27754 itemToString: downshift_esm_itemToString, 27755 stateReducer: downshift_esm_stateReducer, 27756 getA11ySelectionMessage: downshift_esm_getA11ySelectionMessage, 27757 scrollIntoView: downshift_esm_scrollIntoView, 27758 circularNavigation: false, 27759 environment: 27760 /* istanbul ignore next (ssr) */ 27761 typeof window === 'undefined' ? {} : window 27762 }; 27763 27764 function getDefaultValue$1(props, propKey, defaultStateValues) { 27765 if (defaultStateValues === void 0) { 27766 defaultStateValues = dropdownDefaultStateValues; 27767 } 27768 27769 var defaultPropKey = "default" + capitalizeString(propKey); 27770 27771 if (defaultPropKey in props) { 27772 return props[defaultPropKey]; 27773 } 27774 27775 return defaultStateValues[propKey]; 27776 } 27777 27778 function getInitialValue$1(props, propKey, defaultStateValues) { 27779 if (defaultStateValues === void 0) { 27780 defaultStateValues = dropdownDefaultStateValues; 27781 } 27782 27783 if (propKey in props) { 27784 return props[propKey]; 27785 } 27786 27787 var initialPropKey = "initial" + capitalizeString(propKey); 27788 27789 if (initialPropKey in props) { 27790 return props[initialPropKey]; 27791 } 27792 27793 return getDefaultValue$1(props, propKey, defaultStateValues); 27794 } 27795 27796 function getInitialState$2(props) { 27797 var selectedItem = getInitialValue$1(props, 'selectedItem'); 27798 var isOpen = getInitialValue$1(props, 'isOpen'); 27799 var highlightedIndex = getInitialValue$1(props, 'highlightedIndex'); 27800 var inputValue = getInitialValue$1(props, 'inputValue'); 27801 return { 27802 highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex, 27803 isOpen: isOpen, 27804 selectedItem: selectedItem, 27805 inputValue: inputValue 27806 }; 27807 } 27808 27809 function getHighlightedIndexOnOpen(props, state, offset, getItemNodeFromIndex) { 27810 var items = props.items, 27811 initialHighlightedIndex = props.initialHighlightedIndex, 27812 defaultHighlightedIndex = props.defaultHighlightedIndex; 27813 var selectedItem = state.selectedItem, 27814 highlightedIndex = state.highlightedIndex; 27815 27816 if (items.length === 0) { 27817 return -1; 27818 } // initialHighlightedIndex will give value to highlightedIndex on initial state only. 27819 27820 27821 if (initialHighlightedIndex !== undefined && highlightedIndex === initialHighlightedIndex) { 27822 return initialHighlightedIndex; 27823 } 27824 27825 if (defaultHighlightedIndex !== undefined) { 27826 return defaultHighlightedIndex; 27827 } 27828 27829 if (selectedItem) { 27830 if (offset === 0) { 27831 return items.indexOf(selectedItem); 27832 } 27833 27834 return getNextWrappingIndex(offset, items.indexOf(selectedItem), items.length, getItemNodeFromIndex, false); 27835 } 27836 27837 if (offset === 0) { 27838 return -1; 27839 } 27840 27841 return offset < 0 ? items.length - 1 : 0; 27842 } 27843 /** 27844 * Reuse the movement tracking of mouse and touch events. 27845 * 27846 * @param {boolean} isOpen Whether the dropdown is open or not. 27847 * @param {Array<Object>} downshiftElementRefs Downshift element refs to track movement (toggleButton, menu etc.) 27848 * @param {Object} environment Environment where component/hook exists. 27849 * @param {Function} handleBlur Handler on blur from mouse or touch. 27850 * @returns {Object} Ref containing whether mouseDown or touchMove event is happening 27851 */ 27852 27853 27854 function useMouseAndTouchTracker(isOpen, downshiftElementRefs, environment, handleBlur) { 27855 var mouseAndTouchTrackersRef = Object(external_React_["useRef"])({ 27856 isMouseDown: false, 27857 isTouchMove: false 27858 }); 27859 Object(external_React_["useEffect"])(function () { 27860 // The same strategy for checking if a click occurred inside or outside downsift 27861 // as in downshift.js. 27862 var onMouseDown = function onMouseDown() { 27863 mouseAndTouchTrackersRef.current.isMouseDown = true; 27864 }; 27865 27866 var onMouseUp = function onMouseUp(event) { 27867 mouseAndTouchTrackersRef.current.isMouseDown = false; 27868 27869 if (isOpen && !targetWithinDownshift(event.target, downshiftElementRefs.map(function (ref) { 27870 return ref.current; 27871 }), environment)) { 27872 handleBlur(); 27873 } 27874 }; 27875 27876 var onTouchStart = function onTouchStart() { 27877 mouseAndTouchTrackersRef.current.isTouchMove = false; 27878 }; 27879 27880 var onTouchMove = function onTouchMove() { 27881 mouseAndTouchTrackersRef.current.isTouchMove = true; 27882 }; 27883 27884 var onTouchEnd = function onTouchEnd(event) { 27885 if (isOpen && !mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElementRefs.map(function (ref) { 27886 return ref.current; 27887 }), environment, false)) { 27888 handleBlur(); 27889 } 27890 }; 27891 27892 environment.addEventListener('mousedown', onMouseDown); 27893 environment.addEventListener('mouseup', onMouseUp); 27894 environment.addEventListener('touchstart', onTouchStart); 27895 environment.addEventListener('touchmove', onTouchMove); 27896 environment.addEventListener('touchend', onTouchEnd); 27897 return function cleanup() { 27898 environment.removeEventListener('mousedown', onMouseDown); 27899 environment.removeEventListener('mouseup', onMouseUp); 27900 environment.removeEventListener('touchstart', onTouchStart); 27901 environment.removeEventListener('touchmove', onTouchMove); 27902 environment.removeEventListener('touchend', onTouchEnd); 27903 }; // eslint-disable-next-line react-hooks/exhaustive-deps 27904 }, [isOpen, environment]); 27905 return mouseAndTouchTrackersRef; 27906 } 27907 /* istanbul ignore next */ 27908 // eslint-disable-next-line import/no-mutable-exports 27909 27910 27911 var useGetterPropsCalledChecker = function useGetterPropsCalledChecker() { 27912 return downshift_esm_noop; 27913 }; 27914 /** 27915 * Custom hook that checks if getter props are called correctly. 27916 * 27917 * @param {...any} propKeys Getter prop names to be handled. 27918 * @returns {Function} Setter function called inside getter props to set call information. 27919 */ 27920 27921 /* istanbul ignore next */ 27922 27923 27924 if (false) {} 27925 27926 function useA11yMessageSetter(getA11yMessage, dependencyArray, _ref2) { 27927 var isInitialMount = _ref2.isInitialMount, 27928 highlightedIndex = _ref2.highlightedIndex, 27929 items = _ref2.items, 27930 environment = _ref2.environment, 27931 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref2, _excluded$3); 27932 27933 // Sets a11y status message on changes in state. 27934 Object(external_React_["useEffect"])(function () { 27935 if (isInitialMount || false) { 27936 return; 27937 } 27938 27939 updateA11yStatus(function () { 27940 return getA11yMessage(extends_extends({ 27941 highlightedIndex: highlightedIndex, 27942 highlightedItem: items[highlightedIndex], 27943 resultCount: items.length 27944 }, rest)); 27945 }, environment.document); // eslint-disable-next-line react-hooks/exhaustive-deps 27946 }, dependencyArray); 27947 } 27948 27949 function useScrollIntoView(_ref3) { 27950 var highlightedIndex = _ref3.highlightedIndex, 27951 isOpen = _ref3.isOpen, 27952 itemRefs = _ref3.itemRefs, 27953 getItemNodeFromIndex = _ref3.getItemNodeFromIndex, 27954 menuElement = _ref3.menuElement, 27955 scrollIntoViewProp = _ref3.scrollIntoView; 27956 // used not to scroll on highlight by mouse. 27957 var shouldScrollRef = Object(external_React_["useRef"])(true); // Scroll on highlighted item if change comes from keyboard. 27958 27959 useIsomorphicLayoutEffect(function () { 27960 if (highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length) { 27961 return; 27962 } 27963 27964 if (shouldScrollRef.current === false) { 27965 shouldScrollRef.current = true; 27966 } else { 27967 scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement); 27968 } // eslint-disable-next-line react-hooks/exhaustive-deps 27969 27970 }, [highlightedIndex]); 27971 return shouldScrollRef; 27972 } // eslint-disable-next-line import/no-mutable-exports 27973 27974 27975 var useControlPropsValidator = downshift_esm_noop; 27976 /* istanbul ignore next */ 27977 27978 if (false) {} 27979 27980 /* eslint-disable complexity */ 27981 27982 function downshiftCommonReducer(state, action, stateChangeTypes) { 27983 var type = action.type, 27984 props = action.props; 27985 var changes; 27986 27987 switch (type) { 27988 case stateChangeTypes.ItemMouseMove: 27989 changes = { 27990 highlightedIndex: action.index 27991 }; 27992 break; 27993 27994 case stateChangeTypes.MenuMouseLeave: 27995 changes = { 27996 highlightedIndex: -1 27997 }; 27998 break; 27999 28000 case stateChangeTypes.ToggleButtonClick: 28001 case stateChangeTypes.FunctionToggleMenu: 28002 changes = { 28003 isOpen: !state.isOpen, 28004 highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0) 28005 }; 28006 break; 28007 28008 case stateChangeTypes.FunctionOpenMenu: 28009 changes = { 28010 isOpen: true, 28011 highlightedIndex: getHighlightedIndexOnOpen(props, state, 0) 28012 }; 28013 break; 28014 28015 case stateChangeTypes.FunctionCloseMenu: 28016 changes = { 28017 isOpen: false 28018 }; 28019 break; 28020 28021 case stateChangeTypes.FunctionSetHighlightedIndex: 28022 changes = { 28023 highlightedIndex: action.highlightedIndex 28024 }; 28025 break; 28026 28027 case stateChangeTypes.FunctionSetInputValue: 28028 changes = { 28029 inputValue: action.inputValue 28030 }; 28031 break; 28032 28033 case stateChangeTypes.FunctionReset: 28034 changes = { 28035 highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'), 28036 isOpen: getDefaultValue$1(props, 'isOpen'), 28037 selectedItem: getDefaultValue$1(props, 'selectedItem'), 28038 inputValue: getDefaultValue$1(props, 'inputValue') 28039 }; 28040 break; 28041 28042 default: 28043 throw new Error('Reducer called without proper action type.'); 28044 } 28045 28046 return extends_extends({}, state, changes); 28047 } 28048 /* eslint-enable complexity */ 28049 28050 function getItemIndexByCharacterKey(_a) { 28051 var keysSoFar = _a.keysSoFar, highlightedIndex = _a.highlightedIndex, items = _a.items, itemToString = _a.itemToString, getItemNodeFromIndex = _a.getItemNodeFromIndex; 28052 var lowerCasedKeysSoFar = keysSoFar.toLowerCase(); 28053 for (var index = 0; index < items.length; index++) { 28054 var offsetIndex = (index + highlightedIndex + 1) % items.length; 28055 var item = items[offsetIndex]; 28056 if (item !== undefined && 28057 itemToString(item) 28058 .toLowerCase() 28059 .startsWith(lowerCasedKeysSoFar)) { 28060 var element = getItemNodeFromIndex(offsetIndex); 28061 if (!(element === null || element === void 0 ? void 0 : element.hasAttribute('disabled'))) { 28062 return offsetIndex; 28063 } 28064 } 28065 } 28066 return highlightedIndex; 28067 } 28068 var propTypes$2 = { 28069 items: prop_types_default.a.array.isRequired, 28070 itemToString: prop_types_default.a.func, 28071 getA11yStatusMessage: prop_types_default.a.func, 28072 getA11ySelectionMessage: prop_types_default.a.func, 28073 circularNavigation: prop_types_default.a.bool, 28074 highlightedIndex: prop_types_default.a.number, 28075 defaultHighlightedIndex: prop_types_default.a.number, 28076 initialHighlightedIndex: prop_types_default.a.number, 28077 isOpen: prop_types_default.a.bool, 28078 defaultIsOpen: prop_types_default.a.bool, 28079 initialIsOpen: prop_types_default.a.bool, 28080 selectedItem: prop_types_default.a.any, 28081 initialSelectedItem: prop_types_default.a.any, 28082 defaultSelectedItem: prop_types_default.a.any, 28083 id: prop_types_default.a.string, 28084 labelId: prop_types_default.a.string, 28085 menuId: prop_types_default.a.string, 28086 getItemId: prop_types_default.a.func, 28087 toggleButtonId: prop_types_default.a.string, 28088 stateReducer: prop_types_default.a.func, 28089 onSelectedItemChange: prop_types_default.a.func, 28090 onHighlightedIndexChange: prop_types_default.a.func, 28091 onStateChange: prop_types_default.a.func, 28092 onIsOpenChange: prop_types_default.a.func, 28093 environment: prop_types_default.a.shape({ 28094 addEventListener: prop_types_default.a.func, 28095 removeEventListener: prop_types_default.a.func, 28096 document: prop_types_default.a.shape({ 28097 getElementById: prop_types_default.a.func, 28098 activeElement: prop_types_default.a.any, 28099 body: prop_types_default.a.any 28100 }) 28101 }) 28102 }; 28103 /** 28104 * Default implementation for status message. Only added when menu is open. 28105 * Will specift if there are results in the list, and if so, how many, 28106 * and what keys are relevant. 28107 * 28108 * @param {Object} param the downshift state and other relevant properties 28109 * @return {String} the a11y status message 28110 */ 28111 function downshift_esm_getA11yStatusMessage(_a) { 28112 var isOpen = _a.isOpen, resultCount = _a.resultCount, previousResultCount = _a.previousResultCount; 28113 if (!isOpen) { 28114 return ''; 28115 } 28116 if (!resultCount) { 28117 return 'No results are available.'; 28118 } 28119 if (resultCount !== previousResultCount) { 28120 return resultCount + " result" + (resultCount === 1 ? ' is' : 's are') + " available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."; 28121 } 28122 return ''; 28123 } 28124 var defaultProps$2 = __assign(__assign({}, defaultProps$3), { getA11yStatusMessage: downshift_esm_getA11yStatusMessage }); 28125 // eslint-disable-next-line import/no-mutable-exports 28126 var validatePropTypes$2 = downshift_esm_noop; 28127 /* istanbul ignore next */ 28128 if (false) {} 28129 28130 var MenuKeyDownArrowDown = false ? undefined : 0; 28131 var MenuKeyDownArrowUp = false ? undefined : 1; 28132 var MenuKeyDownEscape = false ? undefined : 2; 28133 var MenuKeyDownHome = false ? undefined : 3; 28134 var MenuKeyDownEnd = false ? undefined : 4; 28135 var MenuKeyDownEnter = false ? undefined : 5; 28136 var MenuKeyDownSpaceButton = false ? undefined : 6; 28137 var MenuKeyDownCharacter = false ? undefined : 7; 28138 var MenuBlur = false ? undefined : 8; 28139 var MenuMouseLeave$1 = false ? undefined : 9; 28140 var ItemMouseMove$1 = false ? undefined : 10; 28141 var ItemClick$1 = false ? undefined : 11; 28142 var ToggleButtonClick$1 = false ? undefined : 12; 28143 var ToggleButtonKeyDownArrowDown = false ? undefined : 13; 28144 var ToggleButtonKeyDownArrowUp = false ? undefined : 14; 28145 var ToggleButtonKeyDownCharacter = false ? undefined : 15; 28146 var FunctionToggleMenu$1 = false ? undefined : 16; 28147 var FunctionOpenMenu$1 = false ? undefined : 17; 28148 var FunctionCloseMenu$1 = false ? undefined : 18; 28149 var FunctionSetHighlightedIndex$1 = false ? undefined : 19; 28150 var FunctionSelectItem$1 = false ? undefined : 20; 28151 var FunctionSetInputValue$1 = false ? undefined : 21; 28152 var FunctionReset$2 = false ? undefined : 22; 28153 28154 var stateChangeTypes$2 = /*#__PURE__*/Object.freeze({ 28155 __proto__: null, 28156 MenuKeyDownArrowDown: MenuKeyDownArrowDown, 28157 MenuKeyDownArrowUp: MenuKeyDownArrowUp, 28158 MenuKeyDownEscape: MenuKeyDownEscape, 28159 MenuKeyDownHome: MenuKeyDownHome, 28160 MenuKeyDownEnd: MenuKeyDownEnd, 28161 MenuKeyDownEnter: MenuKeyDownEnter, 28162 MenuKeyDownSpaceButton: MenuKeyDownSpaceButton, 28163 MenuKeyDownCharacter: MenuKeyDownCharacter, 28164 MenuBlur: MenuBlur, 28165 MenuMouseLeave: MenuMouseLeave$1, 28166 ItemMouseMove: ItemMouseMove$1, 28167 ItemClick: ItemClick$1, 28168 ToggleButtonClick: ToggleButtonClick$1, 28169 ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown, 28170 ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp, 28171 ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter, 28172 FunctionToggleMenu: FunctionToggleMenu$1, 28173 FunctionOpenMenu: FunctionOpenMenu$1, 28174 FunctionCloseMenu: FunctionCloseMenu$1, 28175 FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1, 28176 FunctionSelectItem: FunctionSelectItem$1, 28177 FunctionSetInputValue: FunctionSetInputValue$1, 28178 FunctionReset: FunctionReset$2 28179 }); 28180 28181 /* eslint-disable complexity */ 28182 28183 function downshiftSelectReducer(state, action) { 28184 var type = action.type, 28185 props = action.props, 28186 shiftKey = action.shiftKey; 28187 var changes; 28188 28189 switch (type) { 28190 case ItemClick$1: 28191 changes = { 28192 isOpen: getDefaultValue$1(props, 'isOpen'), 28193 highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'), 28194 selectedItem: props.items[action.index] 28195 }; 28196 break; 28197 28198 case ToggleButtonKeyDownCharacter: 28199 { 28200 var lowercasedKey = action.key; 28201 var inputValue = "" + state.inputValue + lowercasedKey; 28202 var itemIndex = getItemIndexByCharacterKey({ 28203 keysSoFar: inputValue, 28204 highlightedIndex: state.selectedItem ? props.items.indexOf(state.selectedItem) : -1, 28205 items: props.items, 28206 itemToString: props.itemToString, 28207 getItemNodeFromIndex: action.getItemNodeFromIndex 28208 }); 28209 changes = extends_extends({ 28210 inputValue: inputValue 28211 }, itemIndex >= 0 && { 28212 selectedItem: props.items[itemIndex] 28213 }); 28214 } 28215 break; 28216 28217 case ToggleButtonKeyDownArrowDown: 28218 changes = { 28219 highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex), 28220 isOpen: true 28221 }; 28222 break; 28223 28224 case ToggleButtonKeyDownArrowUp: 28225 changes = { 28226 highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex), 28227 isOpen: true 28228 }; 28229 break; 28230 28231 case MenuKeyDownEnter: 28232 case MenuKeyDownSpaceButton: 28233 changes = extends_extends({ 28234 isOpen: getDefaultValue$1(props, 'isOpen'), 28235 highlightedIndex: getDefaultValue$1(props, 'highlightedIndex') 28236 }, state.highlightedIndex >= 0 && { 28237 selectedItem: props.items[state.highlightedIndex] 28238 }); 28239 break; 28240 28241 case MenuKeyDownHome: 28242 changes = { 28243 highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false) 28244 }; 28245 break; 28246 28247 case MenuKeyDownEnd: 28248 changes = { 28249 highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false) 28250 }; 28251 break; 28252 28253 case MenuKeyDownEscape: 28254 changes = { 28255 isOpen: false, 28256 highlightedIndex: -1 28257 }; 28258 break; 28259 28260 case MenuBlur: 28261 changes = { 28262 isOpen: false, 28263 highlightedIndex: -1 28264 }; 28265 break; 28266 28267 case MenuKeyDownCharacter: 28268 { 28269 var _lowercasedKey = action.key; 28270 28271 var _inputValue = "" + state.inputValue + _lowercasedKey; 28272 28273 var highlightedIndex = getItemIndexByCharacterKey({ 28274 keysSoFar: _inputValue, 28275 highlightedIndex: state.highlightedIndex, 28276 items: props.items, 28277 itemToString: props.itemToString, 28278 getItemNodeFromIndex: action.getItemNodeFromIndex 28279 }); 28280 changes = extends_extends({ 28281 inputValue: _inputValue 28282 }, highlightedIndex >= 0 && { 28283 highlightedIndex: highlightedIndex 28284 }); 28285 } 28286 break; 28287 28288 case MenuKeyDownArrowDown: 28289 changes = { 28290 highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation) 28291 }; 28292 break; 28293 28294 case MenuKeyDownArrowUp: 28295 changes = { 28296 highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation) 28297 }; 28298 break; 28299 28300 case FunctionSelectItem$1: 28301 changes = { 28302 selectedItem: action.selectedItem 28303 }; 28304 break; 28305 28306 default: 28307 return downshiftCommonReducer(state, action, stateChangeTypes$2); 28308 } 28309 28310 return extends_extends({}, state, changes); 28311 } 28312 /* eslint-enable complexity */ 28313 28314 var _excluded$2 = ["onMouseLeave", "refKey", "onKeyDown", "onBlur", "ref"], 28315 _excluded2$2 = ["onClick", "onKeyDown", "refKey", "ref"], 28316 _excluded3$1 = ["item", "index", "onMouseMove", "onClick", "refKey", "ref"]; 28317 useSelect.stateChangeTypes = stateChangeTypes$2; 28318 28319 function useSelect(userProps) { 28320 if (userProps === void 0) { 28321 userProps = {}; 28322 } 28323 28324 validatePropTypes$2(userProps, useSelect); // Props defaults and destructuring. 28325 28326 var props = extends_extends({}, defaultProps$2, userProps); 28327 28328 var items = props.items, 28329 scrollIntoView = props.scrollIntoView, 28330 environment = props.environment, 28331 initialIsOpen = props.initialIsOpen, 28332 defaultIsOpen = props.defaultIsOpen, 28333 itemToString = props.itemToString, 28334 getA11ySelectionMessage = props.getA11ySelectionMessage, 28335 getA11yStatusMessage = props.getA11yStatusMessage; // Initial state depending on controlled props. 28336 28337 var initialState = getInitialState$2(props); 28338 28339 var _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, initialState, props), 28340 state = _useControlledReducer[0], 28341 dispatch = _useControlledReducer[1]; 28342 28343 var isOpen = state.isOpen, 28344 highlightedIndex = state.highlightedIndex, 28345 selectedItem = state.selectedItem, 28346 inputValue = state.inputValue; // Element efs. 28347 28348 var toggleButtonRef = Object(external_React_["useRef"])(null); 28349 var menuRef = Object(external_React_["useRef"])(null); 28350 var itemRefs = Object(external_React_["useRef"])({}); // used not to trigger menu blur action in some scenarios. 28351 28352 var shouldBlurRef = Object(external_React_["useRef"])(true); // used to keep the inputValue clearTimeout object between renders. 28353 28354 var clearTimeoutRef = Object(external_React_["useRef"])(null); // prevent id re-generation between renders. 28355 28356 var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle. 28357 28358 var previousResultCountRef = Object(external_React_["useRef"])(); 28359 var isInitialMountRef = Object(external_React_["useRef"])(true); // utility callback to get item element. 28360 28361 var latest = useLatestRef({ 28362 state: state, 28363 props: props 28364 }); // Some utils. 28365 28366 var getItemNodeFromIndex = Object(external_React_["useCallback"])(function (index) { 28367 return itemRefs.current[elementIds.getItemId(index)]; 28368 }, [elementIds]); // Effects. 28369 // Sets a11y status message on changes in state. 28370 28371 useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], extends_extends({ 28372 isInitialMount: isInitialMountRef.current, 28373 previousResultCount: previousResultCountRef.current, 28374 items: items, 28375 environment: environment, 28376 itemToString: itemToString 28377 }, state)); // Sets a11y status message on changes in selectedItem. 28378 28379 useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], extends_extends({ 28380 isInitialMount: isInitialMountRef.current, 28381 previousResultCount: previousResultCountRef.current, 28382 items: items, 28383 environment: environment, 28384 itemToString: itemToString 28385 }, state)); // Scroll on highlighted item if change comes from keyboard. 28386 28387 var shouldScrollRef = useScrollIntoView({ 28388 menuElement: menuRef.current, 28389 highlightedIndex: highlightedIndex, 28390 isOpen: isOpen, 28391 itemRefs: itemRefs, 28392 scrollIntoView: scrollIntoView, 28393 getItemNodeFromIndex: getItemNodeFromIndex 28394 }); // Sets cleanup for the keysSoFar callback, debounded after 500ms. 28395 28396 Object(external_React_["useEffect"])(function () { 28397 // init the clean function here as we need access to dispatch. 28398 clearTimeoutRef.current = debounce(function (outerDispatch) { 28399 outerDispatch({ 28400 type: FunctionSetInputValue$1, 28401 inputValue: '' 28402 }); 28403 }, 500); // Cancel any pending debounced calls on mount 28404 28405 return function () { 28406 clearTimeoutRef.current.cancel(); 28407 }; 28408 }, []); // Invokes the keysSoFar callback set up above. 28409 28410 Object(external_React_["useEffect"])(function () { 28411 if (!inputValue) { 28412 return; 28413 } 28414 28415 clearTimeoutRef.current(dispatch); 28416 }, [dispatch, inputValue]); 28417 useControlPropsValidator({ 28418 isInitialMount: isInitialMountRef.current, 28419 props: props, 28420 state: state 28421 }); 28422 /* Controls the focus on the menu or the toggle button. */ 28423 28424 Object(external_React_["useEffect"])(function () { 28425 // Don't focus menu on first render. 28426 if (isInitialMountRef.current) { 28427 // Unless it was initialised as open. 28428 if ((initialIsOpen || defaultIsOpen || isOpen) && menuRef.current) { 28429 menuRef.current.focus(); 28430 } 28431 28432 return; 28433 } // Focus menu on open. 28434 28435 28436 if (isOpen) { 28437 // istanbul ignore else 28438 if (menuRef.current) { 28439 menuRef.current.focus(); 28440 } 28441 28442 return; 28443 } // Focus toggleButton on close, but not if it was closed with (Shift+)Tab. 28444 28445 28446 if (environment.document.activeElement === menuRef.current) { 28447 // istanbul ignore else 28448 if (toggleButtonRef.current) { 28449 shouldBlurRef.current = false; 28450 toggleButtonRef.current.focus(); 28451 } 28452 } // eslint-disable-next-line react-hooks/exhaustive-deps 28453 28454 }, [isOpen]); 28455 Object(external_React_["useEffect"])(function () { 28456 if (isInitialMountRef.current) { 28457 return; 28458 } 28459 28460 previousResultCountRef.current = items.length; 28461 }); // Add mouse/touch events to document. 28462 28463 var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [menuRef, toggleButtonRef], environment, function () { 28464 dispatch({ 28465 type: MenuBlur 28466 }); 28467 }); 28468 var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps'); // Make initial ref false. 28469 28470 Object(external_React_["useEffect"])(function () { 28471 isInitialMountRef.current = false; 28472 }, []); // Reset itemRefs on close. 28473 28474 Object(external_React_["useEffect"])(function () { 28475 if (!isOpen) { 28476 itemRefs.current = {}; 28477 } 28478 }, [isOpen]); // Event handler functions. 28479 28480 var toggleButtonKeyDownHandlers = Object(external_React_["useMemo"])(function () { 28481 return { 28482 ArrowDown: function ArrowDown(event) { 28483 event.preventDefault(); 28484 dispatch({ 28485 type: ToggleButtonKeyDownArrowDown, 28486 getItemNodeFromIndex: getItemNodeFromIndex, 28487 shiftKey: event.shiftKey 28488 }); 28489 }, 28490 ArrowUp: function ArrowUp(event) { 28491 event.preventDefault(); 28492 dispatch({ 28493 type: ToggleButtonKeyDownArrowUp, 28494 getItemNodeFromIndex: getItemNodeFromIndex, 28495 shiftKey: event.shiftKey 28496 }); 28497 } 28498 }; 28499 }, [dispatch, getItemNodeFromIndex]); 28500 var menuKeyDownHandlers = Object(external_React_["useMemo"])(function () { 28501 return { 28502 ArrowDown: function ArrowDown(event) { 28503 event.preventDefault(); 28504 dispatch({ 28505 type: MenuKeyDownArrowDown, 28506 getItemNodeFromIndex: getItemNodeFromIndex, 28507 shiftKey: event.shiftKey 28508 }); 28509 }, 28510 ArrowUp: function ArrowUp(event) { 28511 event.preventDefault(); 28512 dispatch({ 28513 type: MenuKeyDownArrowUp, 28514 getItemNodeFromIndex: getItemNodeFromIndex, 28515 shiftKey: event.shiftKey 28516 }); 28517 }, 28518 Home: function Home(event) { 28519 event.preventDefault(); 28520 dispatch({ 28521 type: MenuKeyDownHome, 28522 getItemNodeFromIndex: getItemNodeFromIndex 28523 }); 28524 }, 28525 End: function End(event) { 28526 event.preventDefault(); 28527 dispatch({ 28528 type: MenuKeyDownEnd, 28529 getItemNodeFromIndex: getItemNodeFromIndex 28530 }); 28531 }, 28532 Escape: function Escape() { 28533 dispatch({ 28534 type: MenuKeyDownEscape 28535 }); 28536 }, 28537 Enter: function Enter(event) { 28538 event.preventDefault(); 28539 dispatch({ 28540 type: MenuKeyDownEnter 28541 }); 28542 }, 28543 ' ': function _(event) { 28544 event.preventDefault(); 28545 dispatch({ 28546 type: MenuKeyDownSpaceButton 28547 }); 28548 } 28549 }; 28550 }, [dispatch, getItemNodeFromIndex]); // Action functions. 28551 28552 var toggleMenu = Object(external_React_["useCallback"])(function () { 28553 dispatch({ 28554 type: FunctionToggleMenu$1 28555 }); 28556 }, [dispatch]); 28557 var closeMenu = Object(external_React_["useCallback"])(function () { 28558 dispatch({ 28559 type: FunctionCloseMenu$1 28560 }); 28561 }, [dispatch]); 28562 var openMenu = Object(external_React_["useCallback"])(function () { 28563 dispatch({ 28564 type: FunctionOpenMenu$1 28565 }); 28566 }, [dispatch]); 28567 var setHighlightedIndex = Object(external_React_["useCallback"])(function (newHighlightedIndex) { 28568 dispatch({ 28569 type: FunctionSetHighlightedIndex$1, 28570 highlightedIndex: newHighlightedIndex 28571 }); 28572 }, [dispatch]); 28573 var selectItem = Object(external_React_["useCallback"])(function (newSelectedItem) { 28574 dispatch({ 28575 type: FunctionSelectItem$1, 28576 selectedItem: newSelectedItem 28577 }); 28578 }, [dispatch]); 28579 var reset = Object(external_React_["useCallback"])(function () { 28580 dispatch({ 28581 type: FunctionReset$2 28582 }); 28583 }, [dispatch]); 28584 var setInputValue = Object(external_React_["useCallback"])(function (newInputValue) { 28585 dispatch({ 28586 type: FunctionSetInputValue$1, 28587 inputValue: newInputValue 28588 }); 28589 }, [dispatch]); // Getter functions. 28590 28591 var getLabelProps = Object(external_React_["useCallback"])(function (labelProps) { 28592 return extends_extends({ 28593 id: elementIds.labelId, 28594 htmlFor: elementIds.toggleButtonId 28595 }, labelProps); 28596 }, [elementIds]); 28597 var getMenuProps = Object(external_React_["useCallback"])(function (_temp, _temp2) { 28598 var _extends2; 28599 28600 var _ref = _temp === void 0 ? {} : _temp, 28601 onMouseLeave = _ref.onMouseLeave, 28602 _ref$refKey = _ref.refKey, 28603 refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey, 28604 onKeyDown = _ref.onKeyDown, 28605 onBlur = _ref.onBlur, 28606 ref = _ref.ref, 28607 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$2); 28608 28609 var _ref2 = _temp2 === void 0 ? {} : _temp2, 28610 _ref2$suppressRefErro = _ref2.suppressRefError, 28611 suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro; 28612 28613 var latestState = latest.current.state; 28614 28615 var menuHandleKeyDown = function menuHandleKeyDown(event) { 28616 var key = normalizeArrowKey(event); 28617 28618 if (key && menuKeyDownHandlers[key]) { 28619 menuKeyDownHandlers[key](event); 28620 } else if (isAcceptedCharacterKey(key)) { 28621 dispatch({ 28622 type: MenuKeyDownCharacter, 28623 key: key, 28624 getItemNodeFromIndex: getItemNodeFromIndex 28625 }); 28626 } 28627 }; 28628 28629 var menuHandleBlur = function menuHandleBlur() { 28630 // if the blur was a result of selection, we don't trigger this action. 28631 if (shouldBlurRef.current === false) { 28632 shouldBlurRef.current = true; 28633 return; 28634 } 28635 28636 var shouldBlur = !mouseAndTouchTrackersRef.current.isMouseDown; 28637 /* istanbul ignore else */ 28638 28639 if (shouldBlur) { 28640 dispatch({ 28641 type: MenuBlur 28642 }); 28643 } 28644 }; 28645 28646 var menuHandleMouseLeave = function menuHandleMouseLeave() { 28647 dispatch({ 28648 type: MenuMouseLeave$1 28649 }); 28650 }; 28651 28652 setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef); 28653 return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) { 28654 menuRef.current = menuNode; 28655 }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.tabIndex = -1, _extends2), latestState.isOpen && latestState.highlightedIndex > -1 && { 28656 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex) 28657 }, { 28658 onMouseLeave: callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), 28659 onKeyDown: callAllEventHandlers(onKeyDown, menuHandleKeyDown), 28660 onBlur: callAllEventHandlers(onBlur, menuHandleBlur) 28661 }, rest); 28662 }, [dispatch, latest, menuKeyDownHandlers, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]); 28663 var getToggleButtonProps = Object(external_React_["useCallback"])(function (_temp3, _temp4) { 28664 var _extends3; 28665 28666 var _ref3 = _temp3 === void 0 ? {} : _temp3, 28667 onClick = _ref3.onClick, 28668 onKeyDown = _ref3.onKeyDown, 28669 _ref3$refKey = _ref3.refKey, 28670 refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey, 28671 ref = _ref3.ref, 28672 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$2); 28673 28674 var _ref4 = _temp4 === void 0 ? {} : _temp4, 28675 _ref4$suppressRefErro = _ref4.suppressRefError, 28676 suppressRefError = _ref4$suppressRefErro === void 0 ? false : _ref4$suppressRefErro; 28677 28678 var toggleButtonHandleClick = function toggleButtonHandleClick() { 28679 dispatch({ 28680 type: ToggleButtonClick$1 28681 }); 28682 }; 28683 28684 var toggleButtonHandleKeyDown = function toggleButtonHandleKeyDown(event) { 28685 var key = normalizeArrowKey(event); 28686 28687 if (key && toggleButtonKeyDownHandlers[key]) { 28688 toggleButtonKeyDownHandlers[key](event); 28689 } else if (isAcceptedCharacterKey(key)) { 28690 dispatch({ 28691 type: ToggleButtonKeyDownCharacter, 28692 key: key, 28693 getItemNodeFromIndex: getItemNodeFromIndex 28694 }); 28695 } 28696 }; 28697 28698 var toggleProps = extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) { 28699 toggleButtonRef.current = toggleButtonNode; 28700 }), _extends3.id = elementIds.toggleButtonId, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-labelledby'] = elementIds.labelId + " " + elementIds.toggleButtonId, _extends3), rest); 28701 28702 if (!rest.disabled) { 28703 toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick); 28704 toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown); 28705 } 28706 28707 setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef); 28708 return toggleProps; 28709 }, [dispatch, latest, toggleButtonKeyDownHandlers, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]); 28710 var getItemProps = Object(external_React_["useCallback"])(function (_temp5) { 28711 var _extends4; 28712 28713 var _ref5 = _temp5 === void 0 ? {} : _temp5, 28714 item = _ref5.item, 28715 index = _ref5.index, 28716 onMouseMove = _ref5.onMouseMove, 28717 onClick = _ref5.onClick, 28718 _ref5$refKey = _ref5.refKey, 28719 refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey, 28720 ref = _ref5.ref, 28721 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded3$1); 28722 28723 var _latest$current = latest.current, 28724 latestState = _latest$current.state, 28725 latestProps = _latest$current.props; 28726 28727 var itemHandleMouseMove = function itemHandleMouseMove() { 28728 if (index === latestState.highlightedIndex) { 28729 return; 28730 } 28731 28732 shouldScrollRef.current = false; 28733 dispatch({ 28734 type: ItemMouseMove$1, 28735 index: index 28736 }); 28737 }; 28738 28739 var itemHandleClick = function itemHandleClick() { 28740 dispatch({ 28741 type: ItemClick$1, 28742 index: index 28743 }); 28744 }; 28745 28746 var itemIndex = getItemIndex(index, item, latestProps.items); 28747 28748 if (itemIndex < 0) { 28749 throw new Error('Pass either item or item index in getItemProps!'); 28750 } 28751 28752 var itemProps = extends_extends((_extends4 = { 28753 role: 'option', 28754 'aria-selected': "" + (itemIndex === latestState.highlightedIndex), 28755 id: elementIds.getItemId(itemIndex) 28756 }, _extends4[refKey] = handleRefs(ref, function (itemNode) { 28757 if (itemNode) { 28758 itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode; 28759 } 28760 }), _extends4), rest); 28761 28762 if (!rest.disabled) { 28763 itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove); 28764 itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick); 28765 } 28766 28767 return itemProps; 28768 }, [dispatch, latest, shouldScrollRef, elementIds]); 28769 return { 28770 // prop getters. 28771 getToggleButtonProps: getToggleButtonProps, 28772 getLabelProps: getLabelProps, 28773 getMenuProps: getMenuProps, 28774 getItemProps: getItemProps, 28775 // actions. 28776 toggleMenu: toggleMenu, 28777 openMenu: openMenu, 28778 closeMenu: closeMenu, 28779 setHighlightedIndex: setHighlightedIndex, 28780 selectItem: selectItem, 28781 reset: reset, 28782 setInputValue: setInputValue, 28783 // state. 28784 highlightedIndex: highlightedIndex, 28785 isOpen: isOpen, 28786 selectedItem: selectedItem, 28787 inputValue: inputValue 28788 }; 28789 } 28790 28791 var InputKeyDownArrowDown = false ? undefined : 0; 28792 var InputKeyDownArrowUp = false ? undefined : 1; 28793 var InputKeyDownEscape = false ? undefined : 2; 28794 var InputKeyDownHome = false ? undefined : 3; 28795 var InputKeyDownEnd = false ? undefined : 4; 28796 var InputKeyDownEnter = false ? undefined : 5; 28797 var InputChange = false ? undefined : 6; 28798 var InputBlur = false ? undefined : 7; 28799 var MenuMouseLeave = false ? undefined : 8; 28800 var ItemMouseMove = false ? undefined : 9; 28801 var ItemClick = false ? undefined : 10; 28802 var ToggleButtonClick = false ? undefined : 11; 28803 var FunctionToggleMenu = false ? undefined : 12; 28804 var FunctionOpenMenu = false ? undefined : 13; 28805 var FunctionCloseMenu = false ? undefined : 14; 28806 var FunctionSetHighlightedIndex = false ? undefined : 15; 28807 var FunctionSelectItem = false ? undefined : 16; 28808 var FunctionSetInputValue = false ? undefined : 17; 28809 var FunctionReset$1 = false ? undefined : 18; 28810 var ControlledPropUpdatedSelectedItem = false ? undefined : 19; 28811 28812 var stateChangeTypes$1 = /*#__PURE__*/Object.freeze({ 28813 __proto__: null, 28814 InputKeyDownArrowDown: InputKeyDownArrowDown, 28815 InputKeyDownArrowUp: InputKeyDownArrowUp, 28816 InputKeyDownEscape: InputKeyDownEscape, 28817 InputKeyDownHome: InputKeyDownHome, 28818 InputKeyDownEnd: InputKeyDownEnd, 28819 InputKeyDownEnter: InputKeyDownEnter, 28820 InputChange: InputChange, 28821 InputBlur: InputBlur, 28822 MenuMouseLeave: MenuMouseLeave, 28823 ItemMouseMove: ItemMouseMove, 28824 ItemClick: ItemClick, 28825 ToggleButtonClick: ToggleButtonClick, 28826 FunctionToggleMenu: FunctionToggleMenu, 28827 FunctionOpenMenu: FunctionOpenMenu, 28828 FunctionCloseMenu: FunctionCloseMenu, 28829 FunctionSetHighlightedIndex: FunctionSetHighlightedIndex, 28830 FunctionSelectItem: FunctionSelectItem, 28831 FunctionSetInputValue: FunctionSetInputValue, 28832 FunctionReset: FunctionReset$1, 28833 ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem 28834 }); 28835 28836 function getInitialState$1(props) { 28837 var initialState = getInitialState$2(props); 28838 var selectedItem = initialState.selectedItem; 28839 var inputValue = initialState.inputValue; 28840 28841 if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) { 28842 inputValue = props.itemToString(selectedItem); 28843 } 28844 28845 return extends_extends({}, initialState, { 28846 inputValue: inputValue 28847 }); 28848 } 28849 28850 var propTypes$1 = { 28851 items: prop_types_default.a.array.isRequired, 28852 itemToString: prop_types_default.a.func, 28853 getA11yStatusMessage: prop_types_default.a.func, 28854 getA11ySelectionMessage: prop_types_default.a.func, 28855 circularNavigation: prop_types_default.a.bool, 28856 highlightedIndex: prop_types_default.a.number, 28857 defaultHighlightedIndex: prop_types_default.a.number, 28858 initialHighlightedIndex: prop_types_default.a.number, 28859 isOpen: prop_types_default.a.bool, 28860 defaultIsOpen: prop_types_default.a.bool, 28861 initialIsOpen: prop_types_default.a.bool, 28862 selectedItem: prop_types_default.a.any, 28863 initialSelectedItem: prop_types_default.a.any, 28864 defaultSelectedItem: prop_types_default.a.any, 28865 inputValue: prop_types_default.a.string, 28866 defaultInputValue: prop_types_default.a.string, 28867 initialInputValue: prop_types_default.a.string, 28868 id: prop_types_default.a.string, 28869 labelId: prop_types_default.a.string, 28870 menuId: prop_types_default.a.string, 28871 getItemId: prop_types_default.a.func, 28872 inputId: prop_types_default.a.string, 28873 toggleButtonId: prop_types_default.a.string, 28874 stateReducer: prop_types_default.a.func, 28875 onSelectedItemChange: prop_types_default.a.func, 28876 onHighlightedIndexChange: prop_types_default.a.func, 28877 onStateChange: prop_types_default.a.func, 28878 onIsOpenChange: prop_types_default.a.func, 28879 onInputValueChange: prop_types_default.a.func, 28880 environment: prop_types_default.a.shape({ 28881 addEventListener: prop_types_default.a.func, 28882 removeEventListener: prop_types_default.a.func, 28883 document: prop_types_default.a.shape({ 28884 getElementById: prop_types_default.a.func, 28885 activeElement: prop_types_default.a.any, 28886 body: prop_types_default.a.any 28887 }) 28888 }) 28889 }; 28890 /** 28891 * The useCombobox version of useControlledReducer, which also 28892 * checks if the controlled prop selectedItem changed between 28893 * renders. If so, it will also update inputValue with its 28894 * string equivalent. It uses the common useEnhancedReducer to 28895 * compute the rest of the state. 28896 * 28897 * @param {Function} reducer Reducer function from downshift. 28898 * @param {Object} initialState Initial state of the hook. 28899 * @param {Object} props The hook props. 28900 * @returns {Array} An array with the state and an action dispatcher. 28901 */ 28902 28903 function useControlledReducer(reducer, initialState, props) { 28904 var previousSelectedItemRef = Object(external_React_["useRef"])(); 28905 28906 var _useEnhancedReducer = useEnhancedReducer(reducer, initialState, props), 28907 state = _useEnhancedReducer[0], 28908 dispatch = _useEnhancedReducer[1]; // ToDo: if needed, make same approach as selectedItemChanged from Downshift. 28909 28910 28911 Object(external_React_["useEffect"])(function () { 28912 if (isControlledProp(props, 'selectedItem')) { 28913 if (previousSelectedItemRef.current !== props.selectedItem) { 28914 dispatch({ 28915 type: ControlledPropUpdatedSelectedItem, 28916 inputValue: props.itemToString(props.selectedItem) 28917 }); 28918 } 28919 28920 previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem; 28921 } 28922 }); 28923 return [getState(state, props), dispatch]; 28924 } // eslint-disable-next-line import/no-mutable-exports 28925 28926 28927 var validatePropTypes$1 = downshift_esm_noop; 28928 /* istanbul ignore next */ 28929 28930 if (false) {} 28931 28932 var defaultProps$1 = extends_extends({}, defaultProps$3, { 28933 getA11yStatusMessage: getA11yStatusMessage$1, 28934 circularNavigation: true 28935 }); 28936 28937 /* eslint-disable complexity */ 28938 28939 function downshiftUseComboboxReducer(state, action) { 28940 var type = action.type, 28941 props = action.props, 28942 shiftKey = action.shiftKey; 28943 var changes; 28944 28945 switch (type) { 28946 case ItemClick: 28947 changes = { 28948 isOpen: getDefaultValue$1(props, 'isOpen'), 28949 highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'), 28950 selectedItem: props.items[action.index], 28951 inputValue: props.itemToString(props.items[action.index]) 28952 }; 28953 break; 28954 28955 case InputKeyDownArrowDown: 28956 if (state.isOpen) { 28957 changes = { 28958 highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation) 28959 }; 28960 } else { 28961 changes = { 28962 highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex), 28963 isOpen: props.items.length >= 0 28964 }; 28965 } 28966 28967 break; 28968 28969 case InputKeyDownArrowUp: 28970 if (state.isOpen) { 28971 changes = { 28972 highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation) 28973 }; 28974 } else { 28975 changes = { 28976 highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex), 28977 isOpen: props.items.length >= 0 28978 }; 28979 } 28980 28981 break; 28982 28983 case InputKeyDownEnter: 28984 changes = extends_extends({}, state.isOpen && state.highlightedIndex >= 0 && { 28985 selectedItem: props.items[state.highlightedIndex], 28986 isOpen: getDefaultValue$1(props, 'isOpen'), 28987 highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'), 28988 inputValue: props.itemToString(props.items[state.highlightedIndex]) 28989 }); 28990 break; 28991 28992 case InputKeyDownEscape: 28993 changes = extends_extends({ 28994 isOpen: false, 28995 highlightedIndex: -1 28996 }, !state.isOpen && { 28997 selectedItem: null, 28998 inputValue: '' 28999 }); 29000 break; 29001 29002 case InputKeyDownHome: 29003 changes = { 29004 highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false) 29005 }; 29006 break; 29007 29008 case InputKeyDownEnd: 29009 changes = { 29010 highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false) 29011 }; 29012 break; 29013 29014 case InputBlur: 29015 changes = extends_extends({ 29016 isOpen: false, 29017 highlightedIndex: -1 29018 }, state.highlightedIndex >= 0 && action.selectItem && { 29019 selectedItem: props.items[state.highlightedIndex], 29020 inputValue: props.itemToString(props.items[state.highlightedIndex]) 29021 }); 29022 break; 29023 29024 case InputChange: 29025 changes = { 29026 isOpen: true, 29027 highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'), 29028 inputValue: action.inputValue 29029 }; 29030 break; 29031 29032 case FunctionSelectItem: 29033 changes = { 29034 selectedItem: action.selectedItem, 29035 inputValue: props.itemToString(action.selectedItem) 29036 }; 29037 break; 29038 29039 case ControlledPropUpdatedSelectedItem: 29040 changes = { 29041 inputValue: action.inputValue 29042 }; 29043 break; 29044 29045 default: 29046 return downshiftCommonReducer(state, action, stateChangeTypes$1); 29047 } 29048 29049 return extends_extends({}, state, changes); 29050 } 29051 /* eslint-enable complexity */ 29052 29053 var _excluded$1 = ["onMouseLeave", "refKey", "ref"], 29054 _excluded2$1 = ["item", "index", "refKey", "ref", "onMouseMove", "onClick", "onPress"], 29055 _excluded3 = ["onClick", "onPress", "refKey", "ref"], 29056 _excluded4 = ["onKeyDown", "onChange", "onInput", "onBlur", "onChangeText", "refKey", "ref"], 29057 _excluded5 = ["refKey", "ref"]; 29058 useCombobox.stateChangeTypes = stateChangeTypes$1; 29059 29060 function useCombobox(userProps) { 29061 if (userProps === void 0) { 29062 userProps = {}; 29063 } 29064 29065 validatePropTypes$1(userProps, useCombobox); // Props defaults and destructuring. 29066 29067 var props = extends_extends({}, defaultProps$1, userProps); 29068 29069 var initialIsOpen = props.initialIsOpen, 29070 defaultIsOpen = props.defaultIsOpen, 29071 items = props.items, 29072 scrollIntoView = props.scrollIntoView, 29073 environment = props.environment, 29074 getA11yStatusMessage = props.getA11yStatusMessage, 29075 getA11ySelectionMessage = props.getA11ySelectionMessage, 29076 itemToString = props.itemToString; // Initial state depending on controlled props. 29077 29078 var initialState = getInitialState$1(props); 29079 29080 var _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, initialState, props), 29081 state = _useControlledReducer[0], 29082 dispatch = _useControlledReducer[1]; 29083 29084 var isOpen = state.isOpen, 29085 highlightedIndex = state.highlightedIndex, 29086 selectedItem = state.selectedItem, 29087 inputValue = state.inputValue; // Element refs. 29088 29089 var menuRef = Object(external_React_["useRef"])(null); 29090 var itemRefs = Object(external_React_["useRef"])({}); 29091 var inputRef = Object(external_React_["useRef"])(null); 29092 var toggleButtonRef = Object(external_React_["useRef"])(null); 29093 var comboboxRef = Object(external_React_["useRef"])(null); 29094 var isInitialMountRef = Object(external_React_["useRef"])(true); // prevent id re-generation between renders. 29095 29096 var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle. 29097 29098 var previousResultCountRef = Object(external_React_["useRef"])(); // utility callback to get item element. 29099 29100 var latest = useLatestRef({ 29101 state: state, 29102 props: props 29103 }); 29104 var getItemNodeFromIndex = Object(external_React_["useCallback"])(function (index) { 29105 return itemRefs.current[elementIds.getItemId(index)]; 29106 }, [elementIds]); // Effects. 29107 // Sets a11y status message on changes in state. 29108 29109 useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], extends_extends({ 29110 isInitialMount: isInitialMountRef.current, 29111 previousResultCount: previousResultCountRef.current, 29112 items: items, 29113 environment: environment, 29114 itemToString: itemToString 29115 }, state)); // Sets a11y status message on changes in selectedItem. 29116 29117 useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], extends_extends({ 29118 isInitialMount: isInitialMountRef.current, 29119 previousResultCount: previousResultCountRef.current, 29120 items: items, 29121 environment: environment, 29122 itemToString: itemToString 29123 }, state)); // Scroll on highlighted item if change comes from keyboard. 29124 29125 var shouldScrollRef = useScrollIntoView({ 29126 menuElement: menuRef.current, 29127 highlightedIndex: highlightedIndex, 29128 isOpen: isOpen, 29129 itemRefs: itemRefs, 29130 scrollIntoView: scrollIntoView, 29131 getItemNodeFromIndex: getItemNodeFromIndex 29132 }); 29133 useControlPropsValidator({ 29134 isInitialMount: isInitialMountRef.current, 29135 props: props, 29136 state: state 29137 }); // Focus the input on first render if required. 29138 29139 Object(external_React_["useEffect"])(function () { 29140 var focusOnOpen = initialIsOpen || defaultIsOpen || isOpen; 29141 29142 if (focusOnOpen && inputRef.current) { 29143 inputRef.current.focus(); 29144 } // eslint-disable-next-line react-hooks/exhaustive-deps 29145 29146 }, []); 29147 Object(external_React_["useEffect"])(function () { 29148 if (isInitialMountRef.current) { 29149 return; 29150 } 29151 29152 previousResultCountRef.current = items.length; 29153 }); // Add mouse/touch events to document. 29154 29155 var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [comboboxRef, menuRef, toggleButtonRef], environment, function () { 29156 dispatch({ 29157 type: InputBlur, 29158 selectItem: false 29159 }); 29160 }); 29161 var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getComboboxProps', 'getMenuProps'); // Make initial ref false. 29162 29163 Object(external_React_["useEffect"])(function () { 29164 isInitialMountRef.current = false; 29165 }, []); // Reset itemRefs on close. 29166 29167 Object(external_React_["useEffect"])(function () { 29168 if (!isOpen) { 29169 itemRefs.current = {}; 29170 } 29171 }, [isOpen]); 29172 /* Event handler functions */ 29173 29174 var inputKeyDownHandlers = Object(external_React_["useMemo"])(function () { 29175 return { 29176 ArrowDown: function ArrowDown(event) { 29177 event.preventDefault(); 29178 dispatch({ 29179 type: InputKeyDownArrowDown, 29180 shiftKey: event.shiftKey, 29181 getItemNodeFromIndex: getItemNodeFromIndex 29182 }); 29183 }, 29184 ArrowUp: function ArrowUp(event) { 29185 event.preventDefault(); 29186 dispatch({ 29187 type: InputKeyDownArrowUp, 29188 shiftKey: event.shiftKey, 29189 getItemNodeFromIndex: getItemNodeFromIndex 29190 }); 29191 }, 29192 Home: function Home(event) { 29193 if (!latest.current.state.isOpen) { 29194 return; 29195 } 29196 29197 event.preventDefault(); 29198 dispatch({ 29199 type: InputKeyDownHome, 29200 getItemNodeFromIndex: getItemNodeFromIndex 29201 }); 29202 }, 29203 End: function End(event) { 29204 if (!latest.current.state.isOpen) { 29205 return; 29206 } 29207 29208 event.preventDefault(); 29209 dispatch({ 29210 type: InputKeyDownEnd, 29211 getItemNodeFromIndex: getItemNodeFromIndex 29212 }); 29213 }, 29214 Escape: function Escape() { 29215 var latestState = latest.current.state; 29216 29217 if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) { 29218 dispatch({ 29219 type: InputKeyDownEscape 29220 }); 29221 } 29222 }, 29223 Enter: function Enter(event) { 29224 var latestState = latest.current.state; // if closed or no highlighted index, do nothing. 29225 29226 if (!latestState.isOpen || latestState.highlightedIndex < 0 || event.which === 229 // if IME composing, wait for next Enter keydown event. 29227 ) { 29228 return; 29229 } 29230 29231 event.preventDefault(); 29232 dispatch({ 29233 type: InputKeyDownEnter, 29234 getItemNodeFromIndex: getItemNodeFromIndex 29235 }); 29236 } 29237 }; 29238 }, [dispatch, latest, getItemNodeFromIndex]); // Getter props. 29239 29240 var getLabelProps = Object(external_React_["useCallback"])(function (labelProps) { 29241 return extends_extends({ 29242 id: elementIds.labelId, 29243 htmlFor: elementIds.inputId 29244 }, labelProps); 29245 }, [elementIds]); 29246 var getMenuProps = Object(external_React_["useCallback"])(function (_temp, _temp2) { 29247 var _extends2; 29248 29249 var _ref = _temp === void 0 ? {} : _temp, 29250 onMouseLeave = _ref.onMouseLeave, 29251 _ref$refKey = _ref.refKey, 29252 refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey, 29253 ref = _ref.ref, 29254 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$1); 29255 29256 var _ref2 = _temp2 === void 0 ? {} : _temp2, 29257 _ref2$suppressRefErro = _ref2.suppressRefError, 29258 suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro; 29259 29260 setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef); 29261 return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) { 29262 menuRef.current = menuNode; 29263 }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () { 29264 dispatch({ 29265 type: MenuMouseLeave 29266 }); 29267 }), _extends2), rest); 29268 }, [dispatch, setGetterPropCallInfo, elementIds]); 29269 var getItemProps = Object(external_React_["useCallback"])(function (_temp3) { 29270 var _extends3, _ref4; 29271 29272 var _ref3 = _temp3 === void 0 ? {} : _temp3, 29273 item = _ref3.item, 29274 index = _ref3.index, 29275 _ref3$refKey = _ref3.refKey, 29276 refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey, 29277 ref = _ref3.ref, 29278 onMouseMove = _ref3.onMouseMove, 29279 onClick = _ref3.onClick; 29280 _ref3.onPress; 29281 var rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$1); 29282 29283 var _latest$current = latest.current, 29284 latestProps = _latest$current.props, 29285 latestState = _latest$current.state; 29286 var itemIndex = getItemIndex(index, item, latestProps.items); 29287 29288 if (itemIndex < 0) { 29289 throw new Error('Pass either item or item index in getItemProps!'); 29290 } 29291 29292 var onSelectKey = 'onClick'; 29293 var customClickHandler = onClick; 29294 29295 var itemHandleMouseMove = function itemHandleMouseMove() { 29296 if (index === latestState.highlightedIndex) { 29297 return; 29298 } 29299 29300 shouldScrollRef.current = false; 29301 dispatch({ 29302 type: ItemMouseMove, 29303 index: index 29304 }); 29305 }; 29306 29307 var itemHandleClick = function itemHandleClick() { 29308 dispatch({ 29309 type: ItemClick, 29310 index: index 29311 }); 29312 29313 if (inputRef.current) { 29314 inputRef.current.focus(); 29315 } 29316 }; 29317 29318 return extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) { 29319 if (itemNode) { 29320 itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode; 29321 } 29322 }), _extends3.role = 'option', _extends3['aria-selected'] = "" + (itemIndex === latestState.highlightedIndex), _extends3.id = elementIds.getItemId(itemIndex), _extends3), !rest.disabled && (_ref4 = { 29323 onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove) 29324 }, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), rest); 29325 }, [dispatch, latest, shouldScrollRef, elementIds]); 29326 var getToggleButtonProps = Object(external_React_["useCallback"])(function (_temp4) { 29327 var _extends4; 29328 29329 var _ref5 = _temp4 === void 0 ? {} : _temp4, 29330 onClick = _ref5.onClick; 29331 _ref5.onPress; 29332 var _ref5$refKey = _ref5.refKey, 29333 refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey, 29334 ref = _ref5.ref, 29335 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded3); 29336 29337 var toggleButtonHandleClick = function toggleButtonHandleClick() { 29338 dispatch({ 29339 type: ToggleButtonClick 29340 }); 29341 29342 if (!latest.current.state.isOpen && inputRef.current) { 29343 inputRef.current.focus(); 29344 } 29345 }; 29346 29347 return extends_extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) { 29348 toggleButtonRef.current = toggleButtonNode; 29349 }), _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && extends_extends({}, { 29350 onClick: callAllEventHandlers(onClick, toggleButtonHandleClick) 29351 }), rest); 29352 }, [dispatch, latest, elementIds]); 29353 var getInputProps = Object(external_React_["useCallback"])(function (_temp5, _temp6) { 29354 var _extends5; 29355 29356 var _ref6 = _temp5 === void 0 ? {} : _temp5, 29357 onKeyDown = _ref6.onKeyDown, 29358 onChange = _ref6.onChange, 29359 onInput = _ref6.onInput, 29360 onBlur = _ref6.onBlur; 29361 _ref6.onChangeText; 29362 var _ref6$refKey = _ref6.refKey, 29363 refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey, 29364 ref = _ref6.ref, 29365 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref6, _excluded4); 29366 29367 var _ref7 = _temp6 === void 0 ? {} : _temp6, 29368 _ref7$suppressRefErro = _ref7.suppressRefError, 29369 suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro; 29370 29371 setGetterPropCallInfo('getInputProps', suppressRefError, refKey, inputRef); 29372 var latestState = latest.current.state; 29373 29374 var inputHandleKeyDown = function inputHandleKeyDown(event) { 29375 var key = normalizeArrowKey(event); 29376 29377 if (key && inputKeyDownHandlers[key]) { 29378 inputKeyDownHandlers[key](event); 29379 } 29380 }; 29381 29382 var inputHandleChange = function inputHandleChange(event) { 29383 dispatch({ 29384 type: InputChange, 29385 inputValue: event.target.value 29386 }); 29387 }; 29388 29389 var inputHandleBlur = function inputHandleBlur() { 29390 /* istanbul ignore else */ 29391 if (latestState.isOpen && !mouseAndTouchTrackersRef.current.isMouseDown) { 29392 dispatch({ 29393 type: InputBlur, 29394 selectItem: true 29395 }); 29396 } 29397 }; 29398 /* istanbul ignore next (preact) */ 29399 29400 29401 var onChangeKey = 'onChange'; 29402 var eventHandlers = {}; 29403 29404 if (!rest.disabled) { 29405 var _eventHandlers; 29406 29407 eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers); 29408 } 29409 29410 return extends_extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) { 29411 inputRef.current = inputNode; 29412 }), _extends5.id = elementIds.inputId, _extends5['aria-autocomplete'] = 'list', _extends5['aria-controls'] = elementIds.menuId, _extends5), latestState.isOpen && latestState.highlightedIndex > -1 && { 29413 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex) 29414 }, { 29415 'aria-labelledby': elementIds.labelId, 29416 // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion 29417 // revert back since autocomplete="nope" is ignored on latest Chrome and Opera 29418 autoComplete: 'off', 29419 value: latestState.inputValue 29420 }, eventHandlers, rest); 29421 }, [dispatch, inputKeyDownHandlers, latest, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds]); 29422 var getComboboxProps = Object(external_React_["useCallback"])(function (_temp7, _temp8) { 29423 var _extends6; 29424 29425 var _ref8 = _temp7 === void 0 ? {} : _temp7, 29426 _ref8$refKey = _ref8.refKey, 29427 refKey = _ref8$refKey === void 0 ? 'ref' : _ref8$refKey, 29428 ref = _ref8.ref, 29429 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref8, _excluded5); 29430 29431 var _ref9 = _temp8 === void 0 ? {} : _temp8, 29432 _ref9$suppressRefErro = _ref9.suppressRefError, 29433 suppressRefError = _ref9$suppressRefErro === void 0 ? false : _ref9$suppressRefErro; 29434 29435 setGetterPropCallInfo('getComboboxProps', suppressRefError, refKey, comboboxRef); 29436 return extends_extends((_extends6 = {}, _extends6[refKey] = handleRefs(ref, function (comboboxNode) { 29437 comboboxRef.current = comboboxNode; 29438 }), _extends6.role = 'combobox', _extends6['aria-haspopup'] = 'listbox', _extends6['aria-owns'] = elementIds.menuId, _extends6['aria-expanded'] = latest.current.state.isOpen, _extends6), rest); 29439 }, [latest, setGetterPropCallInfo, elementIds]); // returns 29440 29441 var toggleMenu = Object(external_React_["useCallback"])(function () { 29442 dispatch({ 29443 type: FunctionToggleMenu 29444 }); 29445 }, [dispatch]); 29446 var closeMenu = Object(external_React_["useCallback"])(function () { 29447 dispatch({ 29448 type: FunctionCloseMenu 29449 }); 29450 }, [dispatch]); 29451 var openMenu = Object(external_React_["useCallback"])(function () { 29452 dispatch({ 29453 type: FunctionOpenMenu 29454 }); 29455 }, [dispatch]); 29456 var setHighlightedIndex = Object(external_React_["useCallback"])(function (newHighlightedIndex) { 29457 dispatch({ 29458 type: FunctionSetHighlightedIndex, 29459 highlightedIndex: newHighlightedIndex 29460 }); 29461 }, [dispatch]); 29462 var selectItem = Object(external_React_["useCallback"])(function (newSelectedItem) { 29463 dispatch({ 29464 type: FunctionSelectItem, 29465 selectedItem: newSelectedItem 29466 }); 29467 }, [dispatch]); 29468 var setInputValue = Object(external_React_["useCallback"])(function (newInputValue) { 29469 dispatch({ 29470 type: FunctionSetInputValue, 29471 inputValue: newInputValue 29472 }); 29473 }, [dispatch]); 29474 var reset = Object(external_React_["useCallback"])(function () { 29475 dispatch({ 29476 type: FunctionReset$1 29477 }); 29478 }, [dispatch]); 29479 return { 29480 // prop getters. 29481 getItemProps: getItemProps, 29482 getLabelProps: getLabelProps, 29483 getMenuProps: getMenuProps, 29484 getInputProps: getInputProps, 29485 getComboboxProps: getComboboxProps, 29486 getToggleButtonProps: getToggleButtonProps, 29487 // actions. 29488 toggleMenu: toggleMenu, 29489 openMenu: openMenu, 29490 closeMenu: closeMenu, 29491 setHighlightedIndex: setHighlightedIndex, 29492 setInputValue: setInputValue, 29493 selectItem: selectItem, 29494 reset: reset, 29495 // state. 29496 highlightedIndex: highlightedIndex, 29497 isOpen: isOpen, 29498 selectedItem: selectedItem, 29499 inputValue: inputValue 29500 }; 29501 } 29502 29503 var defaultStateValues = { 29504 activeIndex: -1, 29505 selectedItems: [] 29506 }; 29507 /** 29508 * Returns the initial value for a state key in the following order: 29509 * 1. controlled prop, 2. initial prop, 3. default prop, 4. default 29510 * value from Downshift. 29511 * 29512 * @param {Object} props Props passed to the hook. 29513 * @param {string} propKey Props key to generate the value for. 29514 * @returns {any} The initial value for that prop. 29515 */ 29516 29517 function getInitialValue(props, propKey) { 29518 return getInitialValue$1(props, propKey, defaultStateValues); 29519 } 29520 /** 29521 * Returns the default value for a state key in the following order: 29522 * 1. controlled prop, 2. default prop, 3. default value from Downshift. 29523 * 29524 * @param {Object} props Props passed to the hook. 29525 * @param {string} propKey Props key to generate the value for. 29526 * @returns {any} The initial value for that prop. 29527 */ 29528 29529 29530 function getDefaultValue(props, propKey) { 29531 return getDefaultValue$1(props, propKey, defaultStateValues); 29532 } 29533 /** 29534 * Gets the initial state based on the provided props. It uses initial, default 29535 * and controlled props related to state in order to compute the initial value. 29536 * 29537 * @param {Object} props Props passed to the hook. 29538 * @returns {Object} The initial state. 29539 */ 29540 29541 29542 function downshift_esm_getInitialState(props) { 29543 var activeIndex = getInitialValue(props, 'activeIndex'); 29544 var selectedItems = getInitialValue(props, 'selectedItems'); 29545 return { 29546 activeIndex: activeIndex, 29547 selectedItems: selectedItems 29548 }; 29549 } 29550 /** 29551 * Returns true if dropdown keydown operation is permitted. Should not be 29552 * allowed on keydown with modifier keys (ctrl, alt, shift, meta), on 29553 * input element with text content that is either highlighted or selection 29554 * cursor is not at the starting position. 29555 * 29556 * @param {KeyboardEvent} event The event from keydown. 29557 * @returns {boolean} Whether the operation is allowed. 29558 */ 29559 29560 29561 function isKeyDownOperationPermitted(event) { 29562 if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) { 29563 return false; 29564 } 29565 29566 var element = event.target; 29567 29568 if (element instanceof HTMLInputElement && // if element is a text input 29569 element.value !== '' && (element.selectionStart !== 0 || element.selectionEnd !== 0)) { 29570 return false; 29571 } 29572 29573 return true; 29574 } 29575 /** 29576 * Returns a message to be added to aria-live region when item is removed. 29577 * 29578 * @param {Object} selectionParameters Parameters required to build the message. 29579 * @returns {string} The a11y message. 29580 */ 29581 29582 29583 function downshift_esm_getA11yRemovalMessage(selectionParameters) { 29584 var removedSelectedItem = selectionParameters.removedSelectedItem, 29585 itemToStringLocal = selectionParameters.itemToString; 29586 return itemToStringLocal(removedSelectedItem) + " has been removed."; 29587 } 29588 29589 var propTypes = { 29590 selectedItems: prop_types_default.a.array, 29591 initialSelectedItems: prop_types_default.a.array, 29592 defaultSelectedItems: prop_types_default.a.array, 29593 itemToString: prop_types_default.a.func, 29594 getA11yRemovalMessage: prop_types_default.a.func, 29595 stateReducer: prop_types_default.a.func, 29596 activeIndex: prop_types_default.a.number, 29597 initialActiveIndex: prop_types_default.a.number, 29598 defaultActiveIndex: prop_types_default.a.number, 29599 onActiveIndexChange: prop_types_default.a.func, 29600 onSelectedItemsChange: prop_types_default.a.func, 29601 keyNavigationNext: prop_types_default.a.string, 29602 keyNavigationPrevious: prop_types_default.a.string, 29603 environment: prop_types_default.a.shape({ 29604 addEventListener: prop_types_default.a.func, 29605 removeEventListener: prop_types_default.a.func, 29606 document: prop_types_default.a.shape({ 29607 getElementById: prop_types_default.a.func, 29608 activeElement: prop_types_default.a.any, 29609 body: prop_types_default.a.any 29610 }) 29611 }) 29612 }; 29613 var downshift_esm_defaultProps = { 29614 itemToString: defaultProps$3.itemToString, 29615 stateReducer: defaultProps$3.stateReducer, 29616 environment: defaultProps$3.environment, 29617 getA11yRemovalMessage: downshift_esm_getA11yRemovalMessage, 29618 keyNavigationNext: 'ArrowRight', 29619 keyNavigationPrevious: 'ArrowLeft' 29620 }; // eslint-disable-next-line import/no-mutable-exports 29621 29622 var validatePropTypes = downshift_esm_noop; 29623 /* istanbul ignore next */ 29624 29625 if (false) {} 29626 29627 var SelectedItemClick = false ? undefined : 0; 29628 var SelectedItemKeyDownDelete = false ? undefined : 1; 29629 var SelectedItemKeyDownBackspace = false ? undefined : 2; 29630 var SelectedItemKeyDownNavigationNext = false ? undefined : 3; 29631 var SelectedItemKeyDownNavigationPrevious = false ? undefined : 4; 29632 var DropdownKeyDownNavigationPrevious = false ? undefined : 5; 29633 var DropdownKeyDownBackspace = false ? undefined : 6; 29634 var DropdownClick = false ? undefined : 7; 29635 var FunctionAddSelectedItem = false ? undefined : 8; 29636 var FunctionRemoveSelectedItem = false ? undefined : 9; 29637 var FunctionSetSelectedItems = false ? undefined : 10; 29638 var FunctionSetActiveIndex = false ? undefined : 11; 29639 var FunctionReset = false ? undefined : 12; 29640 29641 var downshift_esm_stateChangeTypes = /*#__PURE__*/Object.freeze({ 29642 __proto__: null, 29643 SelectedItemClick: SelectedItemClick, 29644 SelectedItemKeyDownDelete: SelectedItemKeyDownDelete, 29645 SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace, 29646 SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext, 29647 SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious, 29648 DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious, 29649 DropdownKeyDownBackspace: DropdownKeyDownBackspace, 29650 DropdownClick: DropdownClick, 29651 FunctionAddSelectedItem: FunctionAddSelectedItem, 29652 FunctionRemoveSelectedItem: FunctionRemoveSelectedItem, 29653 FunctionSetSelectedItems: FunctionSetSelectedItems, 29654 FunctionSetActiveIndex: FunctionSetActiveIndex, 29655 FunctionReset: FunctionReset 29656 }); 29657 29658 /* eslint-disable complexity */ 29659 29660 function downshiftMultipleSelectionReducer(state, action) { 29661 var type = action.type, 29662 index = action.index, 29663 props = action.props, 29664 selectedItem = action.selectedItem; 29665 var activeIndex = state.activeIndex, 29666 selectedItems = state.selectedItems; 29667 var changes; 29668 29669 switch (type) { 29670 case SelectedItemClick: 29671 changes = { 29672 activeIndex: index 29673 }; 29674 break; 29675 29676 case SelectedItemKeyDownNavigationPrevious: 29677 changes = { 29678 activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1 29679 }; 29680 break; 29681 29682 case SelectedItemKeyDownNavigationNext: 29683 changes = { 29684 activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1 29685 }; 29686 break; 29687 29688 case SelectedItemKeyDownBackspace: 29689 case SelectedItemKeyDownDelete: 29690 { 29691 var newActiveIndex = activeIndex; 29692 29693 if (selectedItems.length === 1) { 29694 newActiveIndex = -1; 29695 } else if (activeIndex === selectedItems.length - 1) { 29696 newActiveIndex = selectedItems.length - 2; 29697 } 29698 29699 changes = extends_extends({ 29700 selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1)) 29701 }, { 29702 activeIndex: newActiveIndex 29703 }); 29704 break; 29705 } 29706 29707 case DropdownKeyDownNavigationPrevious: 29708 changes = { 29709 activeIndex: selectedItems.length - 1 29710 }; 29711 break; 29712 29713 case DropdownKeyDownBackspace: 29714 changes = { 29715 selectedItems: selectedItems.slice(0, selectedItems.length - 1) 29716 }; 29717 break; 29718 29719 case FunctionAddSelectedItem: 29720 changes = { 29721 selectedItems: [].concat(selectedItems, [selectedItem]) 29722 }; 29723 break; 29724 29725 case DropdownClick: 29726 changes = { 29727 activeIndex: -1 29728 }; 29729 break; 29730 29731 case FunctionRemoveSelectedItem: 29732 { 29733 var _newActiveIndex = activeIndex; 29734 var selectedItemIndex = selectedItems.indexOf(selectedItem); 29735 29736 if (selectedItems.length === 1) { 29737 _newActiveIndex = -1; 29738 } else if (selectedItemIndex === selectedItems.length - 1) { 29739 _newActiveIndex = selectedItems.length - 2; 29740 } 29741 29742 changes = extends_extends({ 29743 selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1)) 29744 }, { 29745 activeIndex: _newActiveIndex 29746 }); 29747 break; 29748 } 29749 29750 case FunctionSetSelectedItems: 29751 { 29752 var newSelectedItems = action.selectedItems; 29753 changes = { 29754 selectedItems: newSelectedItems 29755 }; 29756 break; 29757 } 29758 29759 case FunctionSetActiveIndex: 29760 { 29761 var _newActiveIndex2 = action.activeIndex; 29762 changes = { 29763 activeIndex: _newActiveIndex2 29764 }; 29765 break; 29766 } 29767 29768 case FunctionReset: 29769 changes = { 29770 activeIndex: getDefaultValue(props, 'activeIndex'), 29771 selectedItems: getDefaultValue(props, 'selectedItems') 29772 }; 29773 break; 29774 29775 default: 29776 throw new Error('Reducer called without proper action type.'); 29777 } 29778 29779 return extends_extends({}, state, changes); 29780 } 29781 29782 var _excluded = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"], 29783 _excluded2 = ["refKey", "ref", "onKeyDown", "onClick", "preventKeyAction"]; 29784 useMultipleSelection.stateChangeTypes = downshift_esm_stateChangeTypes; 29785 29786 function useMultipleSelection(userProps) { 29787 if (userProps === void 0) { 29788 userProps = {}; 29789 } 29790 29791 validatePropTypes(userProps, useMultipleSelection); // Props defaults and destructuring. 29792 29793 var props = extends_extends({}, downshift_esm_defaultProps, userProps); 29794 29795 var getA11yRemovalMessage = props.getA11yRemovalMessage, 29796 itemToString = props.itemToString, 29797 environment = props.environment, 29798 keyNavigationNext = props.keyNavigationNext, 29799 keyNavigationPrevious = props.keyNavigationPrevious; // Reducer init. 29800 29801 var _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, downshift_esm_getInitialState(props), props), 29802 state = _useControlledReducer[0], 29803 dispatch = _useControlledReducer[1]; 29804 29805 var activeIndex = state.activeIndex, 29806 selectedItems = state.selectedItems; // Refs. 29807 29808 var isInitialMountRef = Object(external_React_["useRef"])(true); 29809 var dropdownRef = Object(external_React_["useRef"])(null); 29810 var previousSelectedItemsRef = Object(external_React_["useRef"])(selectedItems); 29811 var selectedItemRefs = Object(external_React_["useRef"])(); 29812 selectedItemRefs.current = []; 29813 var latest = useLatestRef({ 29814 state: state, 29815 props: props 29816 }); // Effects. 29817 29818 /* Sets a11y status message on changes in selectedItem. */ 29819 29820 Object(external_React_["useEffect"])(function () { 29821 if (isInitialMountRef.current) { 29822 return; 29823 } 29824 29825 if (selectedItems.length < previousSelectedItemsRef.current.length) { 29826 var removedSelectedItem = previousSelectedItemsRef.current.find(function (item) { 29827 return selectedItems.indexOf(item) < 0; 29828 }); 29829 setStatus(getA11yRemovalMessage({ 29830 itemToString: itemToString, 29831 resultCount: selectedItems.length, 29832 removedSelectedItem: removedSelectedItem, 29833 activeIndex: activeIndex, 29834 activeSelectedItem: selectedItems[activeIndex] 29835 }), environment.document); 29836 } 29837 29838 previousSelectedItemsRef.current = selectedItems; // eslint-disable-next-line react-hooks/exhaustive-deps 29839 }, [selectedItems.length]); // Sets focus on active item. 29840 29841 Object(external_React_["useEffect"])(function () { 29842 if (isInitialMountRef.current) { 29843 return; 29844 } 29845 29846 if (activeIndex === -1 && dropdownRef.current) { 29847 dropdownRef.current.focus(); 29848 } else if (selectedItemRefs.current[activeIndex]) { 29849 selectedItemRefs.current[activeIndex].focus(); 29850 } 29851 }, [activeIndex]); 29852 useControlPropsValidator({ 29853 isInitialMount: isInitialMountRef.current, 29854 props: props, 29855 state: state 29856 }); 29857 var setGetterPropCallInfo = useGetterPropsCalledChecker('getDropdownProps'); // Make initial ref false. 29858 29859 Object(external_React_["useEffect"])(function () { 29860 isInitialMountRef.current = false; 29861 }, []); // Event handler functions. 29862 29863 var selectedItemKeyDownHandlers = Object(external_React_["useMemo"])(function () { 29864 var _ref; 29865 29866 return _ref = {}, _ref[keyNavigationPrevious] = function () { 29867 dispatch({ 29868 type: SelectedItemKeyDownNavigationPrevious 29869 }); 29870 }, _ref[keyNavigationNext] = function () { 29871 dispatch({ 29872 type: SelectedItemKeyDownNavigationNext 29873 }); 29874 }, _ref.Delete = function Delete() { 29875 dispatch({ 29876 type: SelectedItemKeyDownDelete 29877 }); 29878 }, _ref.Backspace = function Backspace() { 29879 dispatch({ 29880 type: SelectedItemKeyDownBackspace 29881 }); 29882 }, _ref; 29883 }, [dispatch, keyNavigationNext, keyNavigationPrevious]); 29884 var dropdownKeyDownHandlers = Object(external_React_["useMemo"])(function () { 29885 var _ref2; 29886 29887 return _ref2 = {}, _ref2[keyNavigationPrevious] = function (event) { 29888 if (isKeyDownOperationPermitted(event)) { 29889 dispatch({ 29890 type: DropdownKeyDownNavigationPrevious 29891 }); 29892 } 29893 }, _ref2.Backspace = function Backspace(event) { 29894 if (isKeyDownOperationPermitted(event)) { 29895 dispatch({ 29896 type: DropdownKeyDownBackspace 29897 }); 29898 } 29899 }, _ref2; 29900 }, [dispatch, keyNavigationPrevious]); // Getter props. 29901 29902 var getSelectedItemProps = Object(external_React_["useCallback"])(function (_temp) { 29903 var _extends2; 29904 29905 var _ref3 = _temp === void 0 ? {} : _temp, 29906 _ref3$refKey = _ref3.refKey, 29907 refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey, 29908 ref = _ref3.ref, 29909 onClick = _ref3.onClick, 29910 onKeyDown = _ref3.onKeyDown, 29911 selectedItem = _ref3.selectedItem, 29912 index = _ref3.index, 29913 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded); 29914 29915 var latestState = latest.current.state; 29916 var itemIndex = getItemIndex(index, selectedItem, latestState.selectedItems); 29917 29918 if (itemIndex < 0) { 29919 throw new Error('Pass either selectedItem or index in getSelectedItemProps!'); 29920 } 29921 29922 var selectedItemHandleClick = function selectedItemHandleClick() { 29923 dispatch({ 29924 type: SelectedItemClick, 29925 index: index 29926 }); 29927 }; 29928 29929 var selectedItemHandleKeyDown = function selectedItemHandleKeyDown(event) { 29930 var key = normalizeArrowKey(event); 29931 29932 if (key && selectedItemKeyDownHandlers[key]) { 29933 selectedItemKeyDownHandlers[key](event); 29934 } 29935 }; 29936 29937 return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) { 29938 if (selectedItemNode) { 29939 selectedItemRefs.current.push(selectedItemNode); 29940 } 29941 }), _extends2.tabIndex = index === latestState.activeIndex ? 0 : -1, _extends2.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends2.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends2), rest); 29942 }, [dispatch, latest, selectedItemKeyDownHandlers]); 29943 var getDropdownProps = Object(external_React_["useCallback"])(function (_temp2, _temp3) { 29944 var _extends3; 29945 29946 var _ref4 = _temp2 === void 0 ? {} : _temp2, 29947 _ref4$refKey = _ref4.refKey, 29948 refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey, 29949 ref = _ref4.ref, 29950 onKeyDown = _ref4.onKeyDown, 29951 onClick = _ref4.onClick, 29952 _ref4$preventKeyActio = _ref4.preventKeyAction, 29953 preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio, 29954 rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref4, _excluded2); 29955 29956 var _ref5 = _temp3 === void 0 ? {} : _temp3, 29957 _ref5$suppressRefErro = _ref5.suppressRefError, 29958 suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro; 29959 29960 setGetterPropCallInfo('getDropdownProps', suppressRefError, refKey, dropdownRef); 29961 29962 var dropdownHandleKeyDown = function dropdownHandleKeyDown(event) { 29963 var key = normalizeArrowKey(event); 29964 29965 if (key && dropdownKeyDownHandlers[key]) { 29966 dropdownKeyDownHandlers[key](event); 29967 } 29968 }; 29969 29970 var dropdownHandleClick = function dropdownHandleClick() { 29971 dispatch({ 29972 type: DropdownClick 29973 }); 29974 }; 29975 29976 return extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) { 29977 if (dropdownNode) { 29978 dropdownRef.current = dropdownNode; 29979 } 29980 }), _extends3), !preventKeyAction && { 29981 onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown), 29982 onClick: callAllEventHandlers(onClick, dropdownHandleClick) 29983 }, rest); 29984 }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]); // returns 29985 29986 var addSelectedItem = Object(external_React_["useCallback"])(function (selectedItem) { 29987 dispatch({ 29988 type: FunctionAddSelectedItem, 29989 selectedItem: selectedItem 29990 }); 29991 }, [dispatch]); 29992 var removeSelectedItem = Object(external_React_["useCallback"])(function (selectedItem) { 29993 dispatch({ 29994 type: FunctionRemoveSelectedItem, 29995 selectedItem: selectedItem 29996 }); 29997 }, [dispatch]); 29998 var setSelectedItems = Object(external_React_["useCallback"])(function (newSelectedItems) { 29999 dispatch({ 30000 type: FunctionSetSelectedItems, 30001 selectedItems: newSelectedItems 30002 }); 30003 }, [dispatch]); 30004 var setActiveIndex = Object(external_React_["useCallback"])(function (newActiveIndex) { 30005 dispatch({ 30006 type: FunctionSetActiveIndex, 30007 activeIndex: newActiveIndex 30008 }); 30009 }, [dispatch]); 30010 var reset = Object(external_React_["useCallback"])(function () { 30011 dispatch({ 30012 type: FunctionReset 30013 }); 30014 }, [dispatch]); 30015 return { 30016 getSelectedItemProps: getSelectedItemProps, 30017 getDropdownProps: getDropdownProps, 30018 addSelectedItem: addSelectedItem, 30019 removeSelectedItem: removeSelectedItem, 30020 setSelectedItems: setSelectedItems, 30021 setActiveIndex: setActiveIndex, 30022 reset: reset, 30023 selectedItems: selectedItems, 30024 activeIndex: activeIndex 30025 }; 30026 } 30027 30028 30029 30030 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-select-control/index.js 30031 30032 30033 30034 /** 30035 * External dependencies 30036 */ 30037 30038 30039 /** 30040 * WordPress dependencies 30041 */ 30042 30043 30044 /** 30045 * Internal dependencies 30046 */ 30047 30048 30049 30050 const custom_select_control_itemToString = item => item && item.name; // This is needed so that in Windows, where 30051 // the menu does not necessarily open on 30052 // key up/down, you can still switch between 30053 // options with the menu closed. 30054 30055 30056 const custom_select_control_stateReducer = ({ 30057 selectedItem 30058 }, { 30059 type, 30060 changes, 30061 props: { 30062 items 30063 } 30064 }) => { 30065 switch (type) { 30066 case useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown: 30067 // If we already have a selected item, try to select the next one, 30068 // without circular navigation. Otherwise, select the first item. 30069 return { 30070 selectedItem: items[selectedItem ? Math.min(items.indexOf(selectedItem) + 1, items.length - 1) : 0] 30071 }; 30072 30073 case useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp: 30074 // If we already have a selected item, try to select the previous one, 30075 // without circular navigation. Otherwise, select the last item. 30076 return { 30077 selectedItem: items[selectedItem ? Math.max(items.indexOf(selectedItem) - 1, 0) : items.length - 1] 30078 }; 30079 30080 default: 30081 return changes; 30082 } 30083 }; 30084 30085 function CustomSelectControl({ 30086 className, 30087 hideLabelFromVision, 30088 label, 30089 options: items, 30090 onChange: onSelectedItemChange, 30091 value: _selectedItem 30092 }) { 30093 const { 30094 getLabelProps, 30095 getToggleButtonProps, 30096 getMenuProps, 30097 getItemProps, 30098 isOpen, 30099 highlightedIndex, 30100 selectedItem 30101 } = useSelect({ 30102 initialSelectedItem: items[0], 30103 items, 30104 itemToString: custom_select_control_itemToString, 30105 onSelectedItemChange, 30106 selectedItem: _selectedItem, 30107 stateReducer: custom_select_control_stateReducer 30108 }); 30109 const menuProps = getMenuProps({ 30110 className: 'components-custom-select-control__menu', 30111 'aria-hidden': !isOpen 30112 }); // We need this here, because the null active descendant is not 30113 // fully ARIA compliant. 30114 30115 if (menuProps['aria-activedescendant'] && menuProps['aria-activedescendant'].slice(0, 'downshift-null'.length) === 'downshift-null') { 30116 delete menuProps['aria-activedescendant']; 30117 } 30118 30119 return Object(external_wp_element_["createElement"])("div", { 30120 className: classnames_default()('components-custom-select-control', className) 30121 }, hideLabelFromVision ? Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], Object(esm_extends["a" /* default */])({ 30122 as: "label" 30123 }, getLabelProps()), label) : 30124 /* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */ 30125 Object(external_wp_element_["createElement"])("label", getLabelProps({ 30126 className: 'components-custom-select-control__label' 30127 }), label), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], getToggleButtonProps({ 30128 // This is needed because some speech recognition software don't support `aria-labelledby`. 30129 'aria-label': label, 30130 'aria-labelledby': undefined, 30131 className: 'components-custom-select-control__button', 30132 isSmall: true 30133 }), custom_select_control_itemToString(selectedItem), Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 30134 icon: chevron_down["a" /* default */], 30135 className: "components-custom-select-control__button-icon" 30136 })), Object(external_wp_element_["createElement"])("ul", menuProps, isOpen && items.map((item, index) => // eslint-disable-next-line react/jsx-key 30137 Object(external_wp_element_["createElement"])("li", getItemProps({ 30138 item, 30139 index, 30140 key: item.key, 30141 className: classnames_default()(item.className, 'components-custom-select-control__item', { 30142 'is-highlighted': index === highlightedIndex 30143 }), 30144 style: item.style 30145 }), item.name, item === selectedItem && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 30146 icon: check["a" /* default */], 30147 className: "components-custom-select-control__item-icon" 30148 }))))); 30149 } 30150 30151 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/dashicon/index.js 30152 var dashicon = __webpack_require__("vUUf"); 30153 30154 // EXTERNAL MODULE: ./node_modules/react-dates/initialize.js 30155 var initialize = __webpack_require__("GG7f"); 30156 30157 // EXTERNAL MODULE: external "moment" 30158 var external_moment_ = __webpack_require__("wy2R"); 30159 var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_); 30160 30161 // EXTERNAL MODULE: ./node_modules/react-dates/lib/components/DayPickerSingleDateController.js 30162 var DayPickerSingleDateController = __webpack_require__("Xtko"); 30163 var DayPickerSingleDateController_default = /*#__PURE__*/__webpack_require__.n(DayPickerSingleDateController); 30164 30165 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/date.js 30166 30167 30168 /** 30169 * External dependencies 30170 */ 30171 30172 // react-dates doesn't tree-shake correctly, so we import from the individual 30173 // component here, to avoid including too much of the library 30174 30175 30176 /** 30177 * WordPress dependencies 30178 */ 30179 30180 30181 30182 /** 30183 * Module Constants 30184 */ 30185 30186 const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss'; 30187 const ARIAL_LABEL_TIME_FORMAT = 'dddd, LL'; 30188 30189 function DatePickerDay({ 30190 day, 30191 events = [] 30192 }) { 30193 const ref = Object(external_wp_element_["useRef"])(); 30194 /* 30195 * a11y hack to make the `There is/are n events` string 30196 * available speaking for readers, 30197 * re-defining the aria-label attribute. 30198 * This attribute is handled by the react-dates component. 30199 */ 30200 30201 Object(external_wp_element_["useEffect"])(() => { 30202 var _ref$current; 30203 30204 // Bail when no parent node. 30205 if (!(ref !== null && ref !== void 0 && (_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.parentNode)) { 30206 return; 30207 } 30208 30209 const { 30210 parentNode 30211 } = ref.current; 30212 const dayAriaLabel = external_moment_default()(day).format(ARIAL_LABEL_TIME_FORMAT); 30213 30214 if (!events.length) { 30215 // Set aria-label without event description. 30216 parentNode.setAttribute('aria-label', dayAriaLabel); 30217 return; 30218 } 30219 30220 const dayWithEventsDescription = Object(external_wp_i18n_["sprintf"])( // translators: 1: Calendar day format, 2: Calendar event number. 30221 Object(external_wp_i18n_["_n"])('%1$s. There is %2$d event.', '%1$s. There are %2$d events.', events.length), dayAriaLabel, events.length); 30222 parentNode.setAttribute('aria-label', dayWithEventsDescription); 30223 }, [events.length]); 30224 return Object(external_wp_element_["createElement"])("div", { 30225 ref: ref, 30226 className: classnames_default()('components-datetime__date__day', { 30227 'has-events': events === null || events === void 0 ? void 0 : events.length 30228 }) 30229 }, day.format('D')); 30230 } 30231 30232 class date_DatePicker extends external_wp_element_["Component"] { 30233 constructor() { 30234 super(...arguments); 30235 this.onChangeMoment = this.onChangeMoment.bind(this); 30236 this.nodeRef = Object(external_wp_element_["createRef"])(); 30237 this.onMonthPreviewedHandler = this.onMonthPreviewedHandler.bind(this); 30238 } 30239 30240 onMonthPreviewedHandler(newMonthDate) { 30241 var _this$props; 30242 30243 (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.onMonthPreviewed(newMonthDate.toISOString()); 30244 this.keepFocusInside(); 30245 } 30246 /* 30247 * Todo: We should remove this function ASAP. 30248 * It is kept because focus is lost when we click on the previous and next month buttons. 30249 * This focus loss closes the date picker popover. 30250 * Ideally we should add an upstream commit on react-dates to fix this issue. 30251 */ 30252 30253 30254 keepFocusInside() { 30255 if (!this.nodeRef.current) { 30256 return; 30257 } 30258 30259 const { 30260 ownerDocument 30261 } = this.nodeRef.current; 30262 const { 30263 activeElement 30264 } = ownerDocument; // If focus was lost. 30265 30266 if (!activeElement || !this.nodeRef.current.contains(ownerDocument.activeElement)) { 30267 // Retrieve the focus region div. 30268 const focusRegion = this.nodeRef.current.querySelector('.DayPicker_focusRegion'); 30269 30270 if (!focusRegion) { 30271 return; 30272 } // Keep the focus on focus region. 30273 30274 30275 focusRegion.focus(); 30276 } 30277 } 30278 30279 onChangeMoment(newDate) { 30280 const { 30281 currentDate, 30282 onChange 30283 } = this.props; // If currentDate is null, use now as momentTime to designate hours, minutes, seconds. 30284 30285 const momentDate = currentDate ? external_moment_default()(currentDate) : external_moment_default()(); 30286 const momentTime = { 30287 hours: momentDate.hours(), 30288 minutes: momentDate.minutes(), 30289 seconds: 0 30290 }; 30291 onChange(newDate.set(momentTime).format(TIMEZONELESS_FORMAT)); // Keep focus on the date picker. 30292 30293 this.keepFocusInside(); 30294 } 30295 /** 30296 * Create a Moment object from a date string. With no currentDate supplied, default to a Moment 30297 * object representing now. If a null value is passed, return a null value. 30298 * 30299 * @param {?string} currentDate Date representing the currently selected date or null to signify no selection. 30300 * @return {?moment.Moment} Moment object for selected date or null. 30301 */ 30302 30303 30304 getMomentDate(currentDate) { 30305 if (null === currentDate) { 30306 return null; 30307 } 30308 30309 return currentDate ? external_moment_default()(currentDate) : external_moment_default()(); 30310 } 30311 30312 getEventsPerDay(day) { 30313 var _this$props$events; 30314 30315 if (!((_this$props$events = this.props.events) !== null && _this$props$events !== void 0 && _this$props$events.length)) { 30316 return []; 30317 } 30318 30319 return this.props.events.filter(eventDay => day.isSame(eventDay.date, 'day')); 30320 } 30321 30322 render() { 30323 const { 30324 currentDate, 30325 isInvalidDate 30326 } = this.props; 30327 const momentDate = this.getMomentDate(currentDate); 30328 return Object(external_wp_element_["createElement"])("div", { 30329 className: "components-datetime__date", 30330 ref: this.nodeRef 30331 }, Object(external_wp_element_["createElement"])(DayPickerSingleDateController_default.a, { 30332 date: momentDate, 30333 daySize: 30, 30334 focused: true, 30335 hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change 30336 // https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665 30337 , 30338 key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`, 30339 noBorder: true, 30340 numberOfMonths: 1, 30341 onDateChange: this.onChangeMoment, 30342 transitionDuration: 0, 30343 weekDayFormat: "ddd", 30344 dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT, 30345 isRTL: Object(external_wp_i18n_["isRTL"])(), 30346 isOutsideRange: date => { 30347 return isInvalidDate && isInvalidDate(date.toDate()); 30348 }, 30349 onPrevMonthClick: this.onMonthPreviewedHandler, 30350 onNextMonthClick: this.onMonthPreviewedHandler, 30351 renderDayContents: day => Object(external_wp_element_["createElement"])(DatePickerDay, { 30352 day: day, 30353 events: this.getEventsPerDay(day) 30354 }) 30355 })); 30356 } 30357 30358 } 30359 30360 /* harmony default export */ var date_time_date = (date_DatePicker); 30361 30362 // EXTERNAL MODULE: external ["wp","date"] 30363 var external_wp_date_ = __webpack_require__("FqII"); 30364 30365 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/timezone.js 30366 30367 30368 /** 30369 * WordPress dependencies 30370 */ 30371 30372 30373 /** 30374 * Internal dependencies 30375 */ 30376 30377 30378 /** 30379 * Displays timezone information when user timezone is different from site timezone. 30380 */ 30381 30382 const TimeZone = () => { 30383 const { 30384 timezone 30385 } = Object(external_wp_date_["__experimentalGetSettings"])(); // Convert timezone offset to hours. 30386 30387 const userTimezoneOffset = -1 * (new Date().getTimezoneOffset() / 60); // System timezone and user timezone match, nothing needed. 30388 // Compare as numbers because it comes over as string. 30389 30390 if (Number(timezone.offset) === userTimezoneOffset) { 30391 return null; 30392 } 30393 30394 const offsetSymbol = timezone.offset >= 0 ? '+' : ''; 30395 const zoneAbbr = '' !== timezone.abbr && isNaN(timezone.abbr) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offset}`; 30396 const timezoneDetail = 'UTC' === timezone.string ? Object(external_wp_i18n_["__"])('Coordinated Universal Time') : `(${zoneAbbr}) ${timezone.string.replace('_', ' ')}`; 30397 return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], { 30398 position: "top center", 30399 text: timezoneDetail 30400 }, Object(external_wp_element_["createElement"])("div", { 30401 className: "components-datetime__timezone" 30402 }, zoneAbbr)); 30403 }; 30404 30405 /* harmony default export */ var date_time_timezone = (TimeZone); 30406 30407 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/time.js 30408 30409 30410 /** 30411 * External dependencies 30412 */ 30413 30414 30415 30416 /** 30417 * WordPress dependencies 30418 */ 30419 30420 30421 30422 /** 30423 * Internal dependencies 30424 */ 30425 30426 30427 30428 30429 /** 30430 * Module Constants 30431 */ 30432 30433 const time_TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss'; 30434 /** 30435 * <UpdateOnBlurAsIntegerField> 30436 * A shared component to parse, validate, and handle remounting of the underlying form field element like <input> and <select>. 30437 * 30438 * @param {Object} props Component props. 30439 * @param {string} props.as Render the component as specific element tag, defaults to "input". 30440 * @param {number|string} props.value The default value of the component which will be parsed to integer. 30441 * @param {Function} props.onUpdate Call back when blurred and validated. 30442 */ 30443 30444 function UpdateOnBlurAsIntegerField({ 30445 as, 30446 value, 30447 onUpdate, 30448 ...props 30449 }) { 30450 function handleBlur(event) { 30451 const { 30452 target 30453 } = event; 30454 30455 if (value === target.value) { 30456 return; 30457 } 30458 30459 const parsedValue = parseInt(target.value, 10); // Run basic number validation on the input. 30460 30461 if (!Object(external_lodash_["isInteger"])(parsedValue) || typeof props.max !== 'undefined' && parsedValue > props.max || typeof props.min !== 'undefined' && parsedValue < props.min) { 30462 // If validation failed, reset the value to the previous valid value. 30463 target.value = value; 30464 } else { 30465 // Otherwise, it's valid, call onUpdate. 30466 onUpdate(target.name, parsedValue); 30467 } 30468 } 30469 30470 return Object(external_wp_element_["createElement"])(as || 'input', { 30471 // Re-mount the input value to accept the latest value as the defaultValue. 30472 key: value, 30473 defaultValue: value, 30474 onBlur: handleBlur, 30475 ...props 30476 }); 30477 } 30478 /** 30479 * <TimePicker> 30480 * 30481 * @typedef {Date|string|number} WPValidDateTimeFormat 30482 * 30483 * @param {Object} props Component props. 30484 * @param {boolean} props.is12Hour Should the time picker showed in 12 hour format or 24 hour format. 30485 * @param {WPValidDateTimeFormat} props.currentTime The initial current time the time picker should render. 30486 * @param {Function} props.onChange Callback function when the date changed. 30487 */ 30488 30489 30490 function TimePicker({ 30491 is12Hour, 30492 currentTime, 30493 onChange 30494 }) { 30495 const [date, setDate] = Object(external_wp_element_["useState"])(() => // Truncate the date at the minutes, see: #15495. 30496 external_moment_default()(currentTime).startOf('minutes')); // Reset the state when currentTime changed. 30497 30498 Object(external_wp_element_["useEffect"])(() => { 30499 setDate(currentTime ? external_moment_default()(currentTime).startOf('minutes') : external_moment_default()()); 30500 }, [currentTime]); 30501 const { 30502 day, 30503 month, 30504 year, 30505 minutes, 30506 hours, 30507 am 30508 } = Object(external_wp_element_["useMemo"])(() => ({ 30509 day: date.format('DD'), 30510 month: date.format('MM'), 30511 year: date.format('YYYY'), 30512 minutes: date.format('mm'), 30513 hours: date.format(is12Hour ? 'hh' : 'HH'), 30514 am: date.format('H') <= 11 ? 'AM' : 'PM' 30515 }), [date, is12Hour]); 30516 /** 30517 * Function that sets the date state and calls the onChange with a new date. 30518 * The date is truncated at the minutes. 30519 * 30520 * @param {Object} newDate The date object. 30521 */ 30522 30523 function changeDate(newDate) { 30524 setDate(newDate); 30525 onChange(newDate.format(time_TIMEZONELESS_FORMAT)); 30526 } 30527 30528 function update(name, value) { 30529 // Clone the date and call the specific setter function according to `name`. 30530 const newDate = date.clone()[name](value); 30531 changeDate(newDate); 30532 } 30533 30534 function updateAmPm(value) { 30535 return () => { 30536 if (am === value) { 30537 return; 30538 } 30539 30540 const parsedHours = parseInt(hours, 10); 30541 const newDate = date.clone().hours(value === 'PM' ? (parsedHours % 12 + 12) % 24 : parsedHours % 12); 30542 changeDate(newDate); 30543 }; 30544 } 30545 30546 const dayFormat = Object(external_wp_element_["createElement"])("div", { 30547 className: "components-datetime__time-field components-datetime__time-field-day" 30548 }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, { 30549 "aria-label": Object(external_wp_i18n_["__"])('Day'), 30550 className: "components-datetime__time-field-day-input", 30551 type: "number" // The correct function to call in moment.js is "date" not "day". 30552 , 30553 name: "date", 30554 value: day, 30555 step: 1, 30556 min: 1, 30557 max: 31, 30558 onUpdate: update 30559 })); 30560 const monthFormat = Object(external_wp_element_["createElement"])("div", { 30561 className: "components-datetime__time-field components-datetime__time-field-month" 30562 }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, { 30563 as: "select", 30564 "aria-label": Object(external_wp_i18n_["__"])('Month'), 30565 className: "components-datetime__time-field-month-select", 30566 name: "month", 30567 value: month // The value starts from 0, so we have to -1 when setting month. 30568 , 30569 onUpdate: (key, value) => update(key, value - 1) 30570 }, Object(external_wp_element_["createElement"])("option", { 30571 value: "01" 30572 }, Object(external_wp_i18n_["__"])('January')), Object(external_wp_element_["createElement"])("option", { 30573 value: "02" 30574 }, Object(external_wp_i18n_["__"])('February')), Object(external_wp_element_["createElement"])("option", { 30575 value: "03" 30576 }, Object(external_wp_i18n_["__"])('March')), Object(external_wp_element_["createElement"])("option", { 30577 value: "04" 30578 }, Object(external_wp_i18n_["__"])('April')), Object(external_wp_element_["createElement"])("option", { 30579 value: "05" 30580 }, Object(external_wp_i18n_["__"])('May')), Object(external_wp_element_["createElement"])("option", { 30581 value: "06" 30582 }, Object(external_wp_i18n_["__"])('June')), Object(external_wp_element_["createElement"])("option", { 30583 value: "07" 30584 }, Object(external_wp_i18n_["__"])('July')), Object(external_wp_element_["createElement"])("option", { 30585 value: "08" 30586 }, Object(external_wp_i18n_["__"])('August')), Object(external_wp_element_["createElement"])("option", { 30587 value: "09" 30588 }, Object(external_wp_i18n_["__"])('September')), Object(external_wp_element_["createElement"])("option", { 30589 value: "10" 30590 }, Object(external_wp_i18n_["__"])('October')), Object(external_wp_element_["createElement"])("option", { 30591 value: "11" 30592 }, Object(external_wp_i18n_["__"])('November')), Object(external_wp_element_["createElement"])("option", { 30593 value: "12" 30594 }, Object(external_wp_i18n_["__"])('December')))); 30595 const dayMonthFormat = is12Hour ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, dayFormat, monthFormat) : Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, monthFormat, dayFormat); 30596 return Object(external_wp_element_["createElement"])("div", { 30597 className: classnames_default()('components-datetime__time') 30598 }, Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("legend", { 30599 className: "components-datetime__time-legend invisible" 30600 }, Object(external_wp_i18n_["__"])('Date')), Object(external_wp_element_["createElement"])("div", { 30601 className: "components-datetime__time-wrapper" 30602 }, dayMonthFormat, Object(external_wp_element_["createElement"])("div", { 30603 className: "components-datetime__time-field components-datetime__time-field-year" 30604 }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, { 30605 "aria-label": Object(external_wp_i18n_["__"])('Year'), 30606 className: "components-datetime__time-field-year-input", 30607 type: "number", 30608 name: "year", 30609 step: 1, 30610 min: 0, 30611 max: 9999, 30612 value: year, 30613 onUpdate: update 30614 })))), Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("legend", { 30615 className: "components-datetime__time-legend invisible" 30616 }, Object(external_wp_i18n_["__"])('Time')), Object(external_wp_element_["createElement"])("div", { 30617 className: "components-datetime__time-wrapper" 30618 }, Object(external_wp_element_["createElement"])("div", { 30619 className: "components-datetime__time-field components-datetime__time-field-time" 30620 }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, { 30621 "aria-label": Object(external_wp_i18n_["__"])('Hours'), 30622 className: "components-datetime__time-field-hours-input", 30623 type: "number", 30624 name: "hours", 30625 step: 1, 30626 min: is12Hour ? 1 : 0, 30627 max: is12Hour ? 12 : 23, 30628 value: hours, 30629 onUpdate: update 30630 }), Object(external_wp_element_["createElement"])("span", { 30631 className: "components-datetime__time-separator", 30632 "aria-hidden": "true" 30633 }, ":"), Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, { 30634 "aria-label": Object(external_wp_i18n_["__"])('Minutes'), 30635 className: "components-datetime__time-field-minutes-input", 30636 type: "number", 30637 name: "minutes", 30638 step: 1, 30639 min: 0, 30640 max: 59, 30641 value: minutes, 30642 onUpdate: update 30643 })), is12Hour && Object(external_wp_element_["createElement"])(button_group, { 30644 className: "components-datetime__time-field components-datetime__time-field-am-pm" 30645 }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 30646 isPrimary: am === 'AM', 30647 isSecondary: am !== 'AM', 30648 onClick: updateAmPm('AM'), 30649 className: "components-datetime__time-am-button" 30650 }, Object(external_wp_i18n_["__"])('AM')), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 30651 isPrimary: am === 'PM', 30652 isSecondary: am !== 'PM', 30653 onClick: updateAmPm('PM'), 30654 className: "components-datetime__time-pm-button" 30655 }, Object(external_wp_i18n_["__"])('PM'))), Object(external_wp_element_["createElement"])(date_time_timezone, null)))); 30656 } 30657 /* harmony default export */ var time = (TimePicker); 30658 30659 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/index.js 30660 30661 30662 /** 30663 * External dependencies 30664 */ 30665 // Needed to initialise the default datepicker styles. 30666 // See: https://github.com/airbnb/react-dates#initialize 30667 30668 30669 /** 30670 * WordPress dependencies 30671 */ 30672 30673 30674 30675 /** 30676 * Internal dependencies 30677 */ 30678 30679 30680 30681 30682 30683 30684 function DateTimePicker({ 30685 currentDate, 30686 is12Hour, 30687 isInvalidDate, 30688 onMonthPreviewed = external_lodash_["noop"], 30689 onChange, 30690 events 30691 }, ref) { 30692 const [calendarHelpIsVisible, setCalendarHelpIsVisible] = Object(external_wp_element_["useState"])(false); 30693 30694 function onClickDescriptionToggle() { 30695 setCalendarHelpIsVisible(!calendarHelpIsVisible); 30696 } 30697 30698 return Object(external_wp_element_["createElement"])("div", { 30699 ref: ref, 30700 className: "components-datetime" 30701 }, !calendarHelpIsVisible && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(time, { 30702 currentTime: currentDate, 30703 onChange: onChange, 30704 is12Hour: is12Hour 30705 }), Object(external_wp_element_["createElement"])(date_time_date, { 30706 currentDate: currentDate, 30707 onChange: onChange, 30708 isInvalidDate: isInvalidDate, 30709 events: events, 30710 onMonthPreviewed: onMonthPreviewed 30711 })), calendarHelpIsVisible && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { 30712 className: "components-datetime__calendar-help" 30713 }, Object(external_wp_element_["createElement"])("h4", null, Object(external_wp_i18n_["__"])('Click to Select')), Object(external_wp_element_["createElement"])("ul", null, Object(external_wp_element_["createElement"])("li", null, Object(external_wp_i18n_["__"])('Click the right or left arrows to select other months in the past or the future.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_i18n_["__"])('Click the desired day to select it.'))), Object(external_wp_element_["createElement"])("h4", null, Object(external_wp_i18n_["__"])('Navigating with a keyboard')), Object(external_wp_element_["createElement"])("ul", null, Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", { 30714 "aria-label": Object(external_wp_i18n_["_x"])('Enter', 'keyboard button') 30715 }, "\u21B5"), ' ' 30716 /* JSX removes whitespace, but a space is required for screen readers. */ 30717 , Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Select the date in focus.'))), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", { 30718 "aria-label": Object(external_wp_i18n_["__"])('Left and Right Arrows') 30719 }, "\u2190/\u2192"), ' ' 30720 /* JSX removes whitespace, but a space is required for screen readers. */ 30721 , Object(external_wp_i18n_["__"])('Move backward (left) or forward (right) by one day.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", { 30722 "aria-label": Object(external_wp_i18n_["__"])('Up and Down Arrows') 30723 }, "\u2191/\u2193"), ' ' 30724 /* JSX removes whitespace, but a space is required for screen readers. */ 30725 , Object(external_wp_i18n_["__"])('Move backward (up) or forward (down) by one week.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", { 30726 "aria-label": Object(external_wp_i18n_["__"])('Page Up and Page Down') 30727 }, Object(external_wp_i18n_["__"])('PgUp/PgDn')), ' ' 30728 /* JSX removes whitespace, but a space is required for screen readers. */ 30729 , Object(external_wp_i18n_["__"])('Move backward (PgUp) or forward (PgDn) by one month.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", { 30730 "aria-label": Object(external_wp_i18n_["__"])('Home and End') 30731 }, Object(external_wp_i18n_["__"])('Home/End')), ' ' 30732 /* JSX removes whitespace, but a space is required for screen readers. */ 30733 , Object(external_wp_i18n_["__"])('Go to the first (home) or last (end) day of a week.'))))), Object(external_wp_element_["createElement"])("div", { 30734 className: "components-datetime__buttons" 30735 }, !calendarHelpIsVisible && currentDate && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 30736 className: "components-datetime__date-reset-button", 30737 isLink: true, 30738 onClick: () => onChange(null) 30739 }, Object(external_wp_i18n_["__"])('Reset')), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 30740 className: "components-datetime__date-help-toggle", 30741 isLink: true, 30742 onClick: onClickDescriptionToggle 30743 }, calendarHelpIsVisible ? Object(external_wp_i18n_["__"])('Close') : Object(external_wp_i18n_["__"])('Calendar Help')))); 30744 } 30745 30746 /* harmony default export */ var date_time = (Object(external_wp_element_["forwardRef"])(DateTimePicker)); 30747 30748 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js 30749 var components_build_module_icon = __webpack_require__("9VDH"); 30750 30751 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js 30752 30753 30754 /** 30755 * External dependencies 30756 */ 30757 30758 30759 /** 30760 * Internal dependencies 30761 */ 30762 30763 30764 const select_control_styles_disabledStyles = ({ 30765 disabled 30766 }) => { 30767 if (!disabled) return ''; 30768 return /*#__PURE__*/css_browser_esm({ 30769 color: COLORS.ui.textDisabled 30770 }, true ? "" : undefined); 30771 }; 30772 30773 const select_control_styles_fontSizeStyles = ({ 30774 size 30775 }) => { 30776 const sizes = { 30777 default: '13px', 30778 small: '11px' 30779 }; 30780 const fontSize = sizes[size]; 30781 const fontSizeMobile = '16px'; 30782 if (!fontSize) return ''; 30783 return /*#__PURE__*/css_browser_esm("font-size:", fontSizeMobile, ";@media ( min-width:600px ){font-size:", fontSize, ";}" + ( true ? "" : undefined)); 30784 }; 30785 30786 const select_control_styles_sizeStyles = ({ 30787 size 30788 }) => { 30789 const sizes = { 30790 default: { 30791 height: 30, 30792 lineHeight: 1, 30793 minHeight: 30 30794 }, 30795 small: { 30796 height: 24, 30797 lineHeight: 1, 30798 minHeight: 24 30799 } 30800 }; 30801 const style = sizes[size] || sizes.default; 30802 return /*#__PURE__*/css_browser_esm(style, true ? "" : undefined); 30803 }; // TODO: Resolve need to use &&& to increase specificity 30804 // https://github.com/WordPress/gutenberg/issues/18483 30805 30806 30807 const Select = styled_base_browser_esm("select", { 30808 target: "e12x0a390", 30809 label: "Select" 30810 })("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:", COLORS.black, ";display:block;margin:0;width:100%;", select_control_styles_disabledStyles, ";", select_control_styles_fontSizeStyles, ";", select_control_styles_sizeStyles, ";", rtl_rtl({ 30811 paddingLeft: 8, 30812 paddingRight: 24 30813 })(), "}" + ( true ? "" : undefined)); 30814 const DownArrowWrapper = styled_base_browser_esm("div", { 30815 target: "e12x0a391", 30816 label: "DownArrowWrapper" 30817 })("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;", rtl_rtl({ 30818 right: 0 30819 })(), " svg{display:block;}" + ( true ? "" : undefined)); 30820 30821 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/index.js 30822 30823 30824 30825 /** 30826 * External dependencies 30827 */ 30828 30829 30830 /** 30831 * WordPress dependencies 30832 */ 30833 30834 30835 30836 30837 /** 30838 * Internal dependencies 30839 */ 30840 30841 30842 30843 30844 30845 function select_control_useUniqueId(idProp) { 30846 const instanceId = Object(external_wp_compose_["useInstanceId"])(SelectControl); 30847 const id = `inspector-select-control-${instanceId}`; 30848 return idProp || id; 30849 } 30850 30851 function SelectControl({ 30852 className, 30853 disabled = false, 30854 help, 30855 hideLabelFromVision, 30856 id: idProp, 30857 label, 30858 multiple = false, 30859 onBlur = external_lodash_["noop"], 30860 onChange = external_lodash_["noop"], 30861 onFocus = external_lodash_["noop"], 30862 options = [], 30863 size = 'default', 30864 value: valueProp, 30865 labelPosition = 'top', 30866 ...props 30867 }, ref) { 30868 const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false); 30869 const id = select_control_useUniqueId(idProp); 30870 const helpId = help ? `${id}__help` : undefined; // Disable reason: A select with an onchange throws a warning 30871 30872 if (Object(external_lodash_["isEmpty"])(options)) return null; 30873 30874 const handleOnBlur = event => { 30875 onBlur(event); 30876 setIsFocused(false); 30877 }; 30878 30879 const handleOnFocus = event => { 30880 onFocus(event); 30881 setIsFocused(true); 30882 }; 30883 30884 const handleOnChange = event => { 30885 if (multiple) { 30886 const selectedOptions = [...event.target.options].filter(({ 30887 selected 30888 }) => selected); 30889 const newValues = selectedOptions.map(({ 30890 value 30891 }) => value); 30892 onChange(newValues); 30893 return; 30894 } 30895 30896 onChange(event.target.value, { 30897 event 30898 }); 30899 }; 30900 30901 const classes = classnames_default()('components-select-control', className); 30902 /* eslint-disable jsx-a11y/no-onchange */ 30903 30904 return Object(external_wp_element_["createElement"])(base_control, { 30905 help: help 30906 }, Object(external_wp_element_["createElement"])(input_base, Object(esm_extends["a" /* default */])({ 30907 className: classes, 30908 disabled: disabled, 30909 hideLabelFromVision: hideLabelFromVision, 30910 id: id, 30911 isFocused: isFocused, 30912 label: label, 30913 size: size, 30914 suffix: Object(external_wp_element_["createElement"])(DownArrowWrapper, null, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 30915 icon: chevron_down["a" /* default */], 30916 size: 18 30917 })), 30918 labelPosition: labelPosition 30919 }, props), Object(external_wp_element_["createElement"])(Select, Object(esm_extends["a" /* default */])({}, props, { 30920 "aria-describedby": helpId, 30921 className: "components-select-control__input", 30922 disabled: disabled, 30923 id: id, 30924 multiple: multiple, 30925 onBlur: handleOnBlur, 30926 onChange: handleOnChange, 30927 onFocus: handleOnFocus, 30928 ref: ref, 30929 size: size, 30930 value: valueProp 30931 }), options.map((option, index) => { 30932 const key = option.id || `${option.label}-${option.value}-${index}`; 30933 return Object(external_wp_element_["createElement"])("option", { 30934 key: key, 30935 value: option.value, 30936 disabled: option.disabled 30937 }, option.label); 30938 })))); 30939 /* eslint-enable jsx-a11y/no-onchange */ 30940 } 30941 30942 const select_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(SelectControl); 30943 /* harmony default export */ var select_control = (select_control_ForwardedComponent); 30944 30945 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dimension-control/sizes.js 30946 /** 30947 * Sizes 30948 * 30949 * defines the sizes used in dimension controls 30950 * all hardcoded `size` values are based on the value of 30951 * the Sass variable `$block-padding` from 30952 * `packages/block-editor/src/components/dimension-control/sizes.js`. 30953 */ 30954 30955 /** 30956 * WordPress dependencies 30957 */ 30958 30959 /** 30960 * Finds the correct size object from the provided sizes 30961 * table by size slug (eg: `medium`) 30962 * 30963 * @param {Array} sizes containing objects for each size definition 30964 * @param {string} slug a string representation of the size (eg: `medium`) 30965 * @return {Object} the matching size definition 30966 */ 30967 30968 const findSizeBySlug = (sizes, slug) => sizes.find(size => slug === size.slug); 30969 /* harmony default export */ var dimension_control_sizes = ([{ 30970 name: Object(external_wp_i18n_["__"])('None'), 30971 slug: 'none' 30972 }, { 30973 name: Object(external_wp_i18n_["__"])('Small'), 30974 slug: 'small' 30975 }, { 30976 name: Object(external_wp_i18n_["__"])('Medium'), 30977 slug: 'medium' 30978 }, { 30979 name: Object(external_wp_i18n_["__"])('Large'), 30980 slug: 'large' 30981 }, { 30982 name: Object(external_wp_i18n_["__"])('Extra Large'), 30983 slug: 'xlarge' 30984 }]); 30985 30986 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dimension-control/index.js 30987 30988 30989 /** 30990 * External dependencies 30991 */ 30992 30993 30994 /** 30995 * WordPress dependencies 30996 */ 30997 30998 /** 30999 * Internal dependencies 31000 */ 31001 31002 31003 31004 31005 /** 31006 * Internal dependencies 31007 */ 31008 31009 31010 function DimensionControl(props) { 31011 const { 31012 label, 31013 value, 31014 sizes = dimension_control_sizes, 31015 icon, 31016 onChange, 31017 className = '' 31018 } = props; 31019 31020 const onChangeSpacingSize = val => { 31021 const theSize = findSizeBySlug(sizes, val); 31022 31023 if (!theSize || value === theSize.slug) { 31024 onChange(undefined); 31025 } else if (Object(external_lodash_["isFunction"])(onChange)) { 31026 onChange(theSize.slug); 31027 } 31028 }; 31029 31030 const formatSizesAsOptions = theSizes => { 31031 const options = theSizes.map(({ 31032 name, 31033 slug 31034 }) => ({ 31035 label: name, 31036 value: slug 31037 })); 31038 return [{ 31039 label: Object(external_wp_i18n_["__"])('Default'), 31040 value: '' 31041 }].concat(options); 31042 }; 31043 31044 const selectLabel = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 31045 icon: icon 31046 }), label); 31047 return Object(external_wp_element_["createElement"])(select_control, { 31048 className: classnames_default()(className, 'block-editor-dimension-control'), 31049 label: selectLabel, 31050 hideLabelFromVision: false, 31051 value: value, 31052 onChange: onChangeSpacingSize, 31053 options: formatSizesAsOptions(sizes) 31054 }); 31055 } 31056 /* harmony default export */ var dimension_control = (DimensionControl); 31057 31058 // EXTERNAL MODULE: external ["wp","dom"] 31059 var external_wp_dom_ = __webpack_require__("1CF3"); 31060 31061 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/disabled/styles/disabled-styles.js 31062 31063 31064 function disabled_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 31065 31066 const StyledWrapper = styled_base_browser_esm("div", { 31067 target: "e1ac3xxk0", 31068 label: "StyledWrapper" 31069 })( true ? { 31070 name: "u2jump", 31071 styles: "position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}" 31072 } : undefined); 31073 31074 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/disabled/index.js 31075 31076 31077 31078 /** 31079 * External dependencies 31080 */ 31081 31082 31083 /** 31084 * WordPress dependencies 31085 */ 31086 31087 31088 31089 /** 31090 * Internal dependencies 31091 */ 31092 31093 31094 const Context = Object(external_wp_element_["createContext"])(false); 31095 const { 31096 Consumer, 31097 Provider: disabled_Provider 31098 } = Context; 31099 /** 31100 * Names of control nodes which qualify for disabled behavior. 31101 * 31102 * See WHATWG HTML Standard: 4.10.18.5: "Enabling and disabling form controls: the disabled attribute". 31103 * 31104 * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute 31105 * 31106 * @type {string[]} 31107 */ 31108 31109 const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP', 'OPTION', 'SELECT', 'TEXTAREA']; 31110 31111 function Disabled({ 31112 className, 31113 children, 31114 isDisabled = true, 31115 ...props 31116 }) { 31117 const node = Object(external_wp_element_["useRef"])(); 31118 31119 const disable = () => { 31120 external_wp_dom_["focus"].focusable.find(node.current).forEach(focusable => { 31121 if (Object(external_lodash_["includes"])(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) { 31122 focusable.setAttribute('disabled', ''); 31123 } 31124 31125 if (focusable.nodeName === 'A') { 31126 focusable.setAttribute('tabindex', -1); 31127 } 31128 31129 const tabIndex = focusable.getAttribute('tabindex'); 31130 31131 if (tabIndex !== null && tabIndex !== '-1') { 31132 focusable.removeAttribute('tabindex'); 31133 } 31134 31135 if (focusable.hasAttribute('contenteditable')) { 31136 focusable.setAttribute('contenteditable', 'false'); 31137 } 31138 }); 31139 }; // Debounce re-disable since disabling process itself will incur 31140 // additional mutations which should be ignored. 31141 31142 31143 const debouncedDisable = Object(external_wp_element_["useCallback"])(Object(external_lodash_["debounce"])(disable, { 31144 leading: true 31145 }), []); 31146 Object(external_wp_element_["useLayoutEffect"])(() => { 31147 if (!isDisabled) { 31148 return; 31149 } 31150 31151 disable(); 31152 const observer = new window.MutationObserver(debouncedDisable); 31153 observer.observe(node.current, { 31154 childList: true, 31155 attributes: true, 31156 subtree: true 31157 }); 31158 return () => { 31159 observer.disconnect(); 31160 debouncedDisable.cancel(); 31161 }; 31162 }, []); 31163 31164 if (!isDisabled) { 31165 return Object(external_wp_element_["createElement"])(disabled_Provider, { 31166 value: false 31167 }, children); 31168 } 31169 31170 return Object(external_wp_element_["createElement"])(disabled_Provider, { 31171 value: true 31172 }, Object(external_wp_element_["createElement"])(StyledWrapper, Object(esm_extends["a" /* default */])({ 31173 ref: node, 31174 className: classnames_default()(className, 'components-disabled') 31175 }, props), children)); 31176 } 31177 31178 Disabled.Context = Context; 31179 Disabled.Consumer = Consumer; 31180 /* harmony default export */ var build_module_disabled = (Disabled); 31181 31182 // CONCATENATED MODULE: ./node_modules/reakit/es/__keys-e6a5cfbe.js 31183 // Automatically generated 31184 var DISCLOSURE_STATE_KEYS = ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation"]; 31185 var DISCLOSURE_KEYS = DISCLOSURE_STATE_KEYS; 31186 var DISCLOSURE_CONTENT_KEYS = DISCLOSURE_KEYS; 31187 31188 31189 31190 // CONCATENATED MODULE: ./node_modules/reakit/es/Disclosure/DisclosureContent.js 31191 31192 31193 31194 31195 31196 31197 31198 31199 31200 31201 var useDisclosureContent = Object(createHook["a" /* createHook */])({ 31202 name: "DisclosureContent", 31203 compose: Role["a" /* useRole */], 31204 keys: DISCLOSURE_CONTENT_KEYS, 31205 useProps: function useProps(options, _ref) { 31206 var htmlOnTransitionEnd = _ref.onTransitionEnd, 31207 htmlOnAnimationEnd = _ref.onAnimationEnd, 31208 htmlStyle = _ref.style, 31209 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["onTransitionEnd", "onAnimationEnd", "style"]); 31210 31211 var animating = options.animated && options.animating; 31212 31213 var _React$useState = Object(external_React_["useState"])(null), 31214 transition = _React$useState[0], 31215 setTransition = _React$useState[1]; 31216 31217 var hidden = !options.visible && !animating; 31218 var style = hidden ? Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 31219 display: "none" 31220 }, htmlStyle) : htmlStyle; 31221 var onTransitionEndRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnTransitionEnd); 31222 var onAnimationEndRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnAnimationEnd); 31223 var raf = Object(external_React_["useRef"])(0); 31224 Object(external_React_["useEffect"])(function () { 31225 if (!options.animated) return undefined; // Double RAF is needed so the browser has enough time to paint the 31226 // default styles before processing the `data-enter` attribute. Otherwise 31227 // it wouldn't be considered a transition. 31228 // See https://github.com/reakit/reakit/issues/643 31229 31230 raf.current = window.requestAnimationFrame(function () { 31231 raf.current = window.requestAnimationFrame(function () { 31232 if (options.visible) { 31233 setTransition("enter"); 31234 } else if (animating) { 31235 setTransition("leave"); 31236 } else { 31237 setTransition(null); 31238 } 31239 }); 31240 }); 31241 return function () { 31242 return window.cancelAnimationFrame(raf.current); 31243 }; 31244 }, [options.animated, options.visible, animating]); 31245 var onEnd = Object(external_React_["useCallback"])(function (event) { 31246 if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return; 31247 if (!animating) return; // Ignores number animated 31248 31249 if (options.animated === true) { 31250 var _options$stopAnimatio; 31251 31252 (_options$stopAnimatio = options.stopAnimation) === null || _options$stopAnimatio === void 0 ? void 0 : _options$stopAnimatio.call(options); 31253 } 31254 }, [options.animated, animating, options.stopAnimation]); 31255 var onTransitionEnd = Object(external_React_["useCallback"])(function (event) { 31256 var _onTransitionEndRef$c; 31257 31258 (_onTransitionEndRef$c = onTransitionEndRef.current) === null || _onTransitionEndRef$c === void 0 ? void 0 : _onTransitionEndRef$c.call(onTransitionEndRef, event); 31259 onEnd(event); 31260 }, [onEnd]); 31261 var onAnimationEnd = Object(external_React_["useCallback"])(function (event) { 31262 var _onAnimationEndRef$cu; 31263 31264 (_onAnimationEndRef$cu = onAnimationEndRef.current) === null || _onAnimationEndRef$cu === void 0 ? void 0 : _onAnimationEndRef$cu.call(onAnimationEndRef, event); 31265 onEnd(event); 31266 }, [onEnd]); 31267 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 31268 id: options.baseId, 31269 "data-enter": transition === "enter" ? "" : undefined, 31270 "data-leave": transition === "leave" ? "" : undefined, 31271 onTransitionEnd: onTransitionEnd, 31272 onAnimationEnd: onAnimationEnd, 31273 hidden: hidden, 31274 style: style 31275 }, htmlProps); 31276 } 31277 }); 31278 var DisclosureContent = Object(createComponent["a" /* createComponent */])({ 31279 as: "div", 31280 useHook: useDisclosureContent 31281 }); 31282 31283 31284 31285 // CONCATENATED MODULE: ./node_modules/reakit/es/Separator/Separator.js 31286 31287 31288 31289 31290 31291 31292 // Automatically generated 31293 var SEPARATOR_KEYS = ["orientation"]; 31294 31295 var useSeparator = Object(createHook["a" /* createHook */])({ 31296 name: "Separator", 31297 compose: Role["a" /* useRole */], 31298 keys: SEPARATOR_KEYS, 31299 useOptions: function useOptions(_ref) { 31300 var _ref$orientation = _ref.orientation, 31301 orientation = _ref$orientation === void 0 ? "horizontal" : _ref$orientation, 31302 options = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["orientation"]); 31303 31304 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 31305 orientation: orientation 31306 }, options); 31307 }, 31308 useProps: function useProps(options, htmlProps) { 31309 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 31310 role: "separator", 31311 "aria-orientation": options.orientation 31312 }, htmlProps); 31313 } 31314 }); 31315 var Separator = Object(createComponent["a" /* createComponent */])({ 31316 as: "hr", 31317 memo: true, 31318 useHook: useSeparator 31319 }); 31320 31321 31322 31323 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/divider/styles.js 31324 31325 31326 /** 31327 * Internal dependencies 31328 */ 31329 31330 const Divider = /*#__PURE__*/Object(emotion_esm["a" /* css */])("border-color:", config_values.colorDivider, ";border-width:0 0 1px 0;height:0;margin:0;width:auto;;label:Divider;" + ( true ? "" : undefined)); 31331 31332 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/divider/component.js 31333 31334 31335 31336 31337 // eslint-disable-next-line no-restricted-imports 31338 // eslint-disable-next-line no-restricted-imports, no-duplicate-imports 31339 31340 /** 31341 * WordPress dependencies 31342 */ 31343 31344 /** 31345 * Internal dependencies 31346 */ 31347 31348 // eslint-disable-next-line no-duplicate-imports 31349 31350 31351 31352 31353 function component_Divider(props, forwardedRef) { 31354 const { 31355 className, 31356 margin, 31357 marginBottom, 31358 marginTop, 31359 ...otherProps 31360 } = Object(use_context_system["a" /* useContextSystem */])(props, 'Divider'); 31361 const classes = Object(external_wp_element_["useMemo"])(() => { 31362 const sx = {}; 31363 31364 if (typeof margin !== 'undefined') { 31365 sx.margin = /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(margin), ";margin-top:", space_space(margin), ";" + ( true ? "" : undefined)); 31366 } else { 31367 if (typeof marginTop !== 'undefined') { 31368 sx.marginTop = /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-top:", space_space(marginTop), ";" + ( true ? "" : undefined)); 31369 } 31370 31371 if (typeof marginBottom !== 'undefined') { 31372 sx.marginBottom = /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(marginBottom), ";" + ( true ? "" : undefined)); 31373 } 31374 } 31375 31376 return Object(emotion_esm["b" /* cx */])(Divider, sx.marginBottom, sx.marginTop, sx.margin, className); 31377 }, [className, margin, marginBottom, marginTop]); 31378 return Object(external_wp_element_["createElement"])(Separator, Object(esm_extends["a" /* default */])({ 31379 as: "hr" 31380 }, otherProps, { 31381 className: classes, 31382 ref: forwardedRef 31383 })); 31384 } 31385 /** 31386 * `Divider` is a layout component that separates groups of related content. 31387 * 31388 * @example 31389 * ```js 31390 * import { 31391 * __experimentalDivider as Divider, 31392 * __experimentalText as Text } 31393 * from `@wordpress/components`; 31394 * 31395 * function Example() { 31396 * return ( 31397 * <ListGroup> 31398 * <FormGroup>...</FormGroup> 31399 * <Divider /> 31400 * <FormGroup>...</FormGroup> 31401 * </ListGroup> 31402 * ); 31403 * } 31404 * ``` 31405 */ 31406 31407 31408 const ConnectedDivider = Object(context_connect["a" /* contextConnect */])(component_Divider, 'Divider'); 31409 /* harmony default export */ var divider_component = (ConnectedDivider); 31410 31411 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/draggable/index.js 31412 31413 31414 /** 31415 * WordPress dependencies 31416 */ 31417 31418 const dragImageClass = 'components-draggable__invisible-drag-image'; 31419 const cloneWrapperClass = 'components-draggable__clone'; 31420 const cloneHeightTransformationBreakpoint = 700; 31421 const clonePadding = 0; 31422 const bodyClass = 'is-dragging-components-draggable'; 31423 /** 31424 * @typedef RenderProp 31425 * @property {(event: import('react').DragEvent) => void} onDraggableStart `onDragStart` handler. 31426 * @property {(event: import('react').DragEvent) => void} onDraggableEnd `onDragEnd` handler. 31427 */ 31428 31429 /** 31430 * @typedef Props 31431 * @property {(props: RenderProp) => JSX.Element | null} children Children. 31432 * @property {(event: import('react').DragEvent) => void} [onDragStart] Callback when dragging starts. 31433 * @property {(event: import('react').DragEvent) => void} [onDragOver] Callback when dragging happens over the document. 31434 * @property {(event: import('react').DragEvent) => void} [onDragEnd] Callback when dragging ends. 31435 * @property {string} [cloneClassname] Classname for the cloned element. 31436 * @property {string} [elementId] ID for the element. 31437 * @property {any} [transferData] Transfer data for the drag event. 31438 * @property {string} [__experimentalTransferDataType] The transfer data type to set. 31439 * @property {import('react').ReactNode} __experimentalDragComponent Component to show when dragging. 31440 */ 31441 31442 /** 31443 * @param {Props} props 31444 * @return {JSX.Element} A draggable component. 31445 */ 31446 31447 function Draggable({ 31448 children, 31449 onDragStart, 31450 onDragOver, 31451 onDragEnd, 31452 cloneClassname, 31453 elementId, 31454 transferData, 31455 __experimentalTransferDataType: transferDataType = 'text', 31456 __experimentalDragComponent: dragComponent 31457 }) { 31458 /** @type {import('react').MutableRefObject<HTMLDivElement | null>} */ 31459 const dragComponentRef = Object(external_wp_element_["useRef"])(null); 31460 const cleanup = Object(external_wp_element_["useRef"])(() => {}); 31461 /** 31462 * Removes the element clone, resets cursor, and removes drag listener. 31463 * 31464 * @param {import('react').DragEvent} event The non-custom DragEvent. 31465 */ 31466 31467 function end(event) { 31468 event.preventDefault(); 31469 cleanup.current(); 31470 31471 if (onDragEnd) { 31472 onDragEnd(event); 31473 } 31474 } 31475 /** 31476 * This method does a couple of things: 31477 * 31478 * - Clones the current element and spawns clone over original element. 31479 * - Adds a fake temporary drag image to avoid browser defaults. 31480 * - Sets transfer data. 31481 * - Adds dragover listener. 31482 * 31483 * @param {import('react').DragEvent} event The non-custom DragEvent. 31484 */ 31485 31486 31487 function start(event) { 31488 // @ts-ignore We know that ownerDocument does exist on an Element 31489 const { 31490 ownerDocument 31491 } = event.target; 31492 event.dataTransfer.setData(transferDataType, JSON.stringify(transferData)); 31493 const cloneWrapper = ownerDocument.createElement('div'); 31494 const dragImage = ownerDocument.createElement('div'); // Set a fake drag image to avoid browser defaults. Remove from DOM 31495 // right after. event.dataTransfer.setDragImage is not supported yet in 31496 // IE, we need to check for its existence first. 31497 31498 if ('function' === typeof event.dataTransfer.setDragImage) { 31499 dragImage.classList.add(dragImageClass); 31500 ownerDocument.body.appendChild(dragImage); 31501 event.dataTransfer.setDragImage(dragImage, 0, 0); 31502 } 31503 31504 cloneWrapper.classList.add(cloneWrapperClass); 31505 31506 if (cloneClassname) { 31507 cloneWrapper.classList.add(cloneClassname); 31508 } // If a dragComponent is defined, the following logic will clone the 31509 // HTML node and inject it into the cloneWrapper. 31510 31511 31512 if (dragComponentRef.current) { 31513 // Position dragComponent at the same position as the cursor. 31514 cloneWrapper.style.top = `${event.clientY}px`; 31515 cloneWrapper.style.left = `${event.clientX}px`; 31516 const clonedDragComponent = ownerDocument.createElement('div'); 31517 clonedDragComponent.innerHTML = dragComponentRef.current.innerHTML; 31518 cloneWrapper.appendChild(clonedDragComponent); // Inject the cloneWrapper into the DOM. 31519 31520 ownerDocument.body.appendChild(cloneWrapper); 31521 } else { 31522 const element = ownerDocument.getElementById(elementId); // Prepare element clone and append to element wrapper. 31523 31524 const elementRect = element.getBoundingClientRect(); 31525 const elementWrapper = element.parentNode; 31526 const elementTopOffset = parseInt(elementRect.top, 10); 31527 const elementLeftOffset = parseInt(elementRect.left, 10); 31528 cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`; 31529 const clone = element.cloneNode(true); 31530 clone.id = `clone-${elementId}`; 31531 31532 if (elementRect.height > cloneHeightTransformationBreakpoint) { 31533 // Scale down clone if original element is larger than 700px. 31534 cloneWrapper.style.transform = 'scale(0.5)'; 31535 cloneWrapper.style.transformOrigin = 'top left'; // Position clone near the cursor. 31536 31537 cloneWrapper.style.top = `${event.clientY - 100}px`; 31538 cloneWrapper.style.left = `${event.clientX}px`; 31539 } else { 31540 // Position clone right over the original element (20px padding). 31541 cloneWrapper.style.top = `${elementTopOffset - clonePadding}px`; 31542 cloneWrapper.style.left = `${elementLeftOffset - clonePadding}px`; 31543 } // Hack: Remove iFrames as it's causing the embeds drag clone to freeze 31544 31545 31546 Array.from(clone.querySelectorAll('iframe')).forEach(child => child.parentNode.removeChild(child)); 31547 cloneWrapper.appendChild(clone); // Inject the cloneWrapper into the DOM. 31548 31549 elementWrapper.appendChild(cloneWrapper); 31550 } // Mark the current cursor coordinates. 31551 31552 31553 let cursorLeft = event.clientX; 31554 let cursorTop = event.clientY; 31555 /** 31556 * @param {import('react').DragEvent} e 31557 */ 31558 31559 function over(e) { 31560 cloneWrapper.style.top = `${parseInt(cloneWrapper.style.top, 10) + e.clientY - cursorTop}px`; 31561 cloneWrapper.style.left = `${parseInt(cloneWrapper.style.left, 10) + e.clientX - cursorLeft}px`; // Update cursor coordinates. 31562 31563 cursorLeft = e.clientX; 31564 cursorTop = e.clientY; 31565 31566 if (onDragOver) { 31567 onDragOver(e); 31568 } 31569 } 31570 31571 ownerDocument.addEventListener('dragover', over); // Update cursor to 'grabbing', document wide. 31572 31573 ownerDocument.body.classList.add(bodyClass); // Allow the Synthetic Event to be accessed from asynchronous code. 31574 // https://reactjs.org/docs/events.html#event-pooling 31575 31576 event.persist(); 31577 /** @type {number | undefined} */ 31578 31579 let timerId; 31580 31581 if (onDragStart) { 31582 timerId = setTimeout(() => onDragStart(event)); 31583 } 31584 31585 cleanup.current = () => { 31586 // Remove drag clone 31587 if (cloneWrapper && cloneWrapper.parentNode) { 31588 cloneWrapper.parentNode.removeChild(cloneWrapper); 31589 } 31590 31591 if (dragImage && dragImage.parentNode) { 31592 dragImage.parentNode.removeChild(dragImage); 31593 } // Reset cursor. 31594 31595 31596 ownerDocument.body.classList.remove(bodyClass); 31597 ownerDocument.removeEventListener('dragover', over); 31598 clearTimeout(timerId); 31599 }; 31600 } 31601 31602 Object(external_wp_element_["useEffect"])(() => () => { 31603 cleanup.current(); 31604 }, []); 31605 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, children({ 31606 onDraggableStart: start, 31607 onDraggableEnd: end 31608 }), dragComponent && Object(external_wp_element_["createElement"])("div", { 31609 className: "components-draggable-drag-component-root", 31610 style: { 31611 display: 'none' 31612 }, 31613 ref: dragComponentRef 31614 }, dragComponent)); 31615 } 31616 31617 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js 31618 var upload = __webpack_require__("NTP4"); 31619 31620 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/drop-zone/index.js 31621 31622 31623 /** 31624 * External dependencies 31625 */ 31626 31627 31628 /** 31629 * WordPress dependencies 31630 */ 31631 31632 31633 31634 31635 31636 31637 function DropZoneComponent({ 31638 className, 31639 label, 31640 onFilesDrop, 31641 onHTMLDrop, 31642 onDrop 31643 }) { 31644 const [isDraggingOverDocument, setIsDraggingOverDocument] = Object(external_wp_element_["useState"])(); 31645 const [isDraggingOverElement, setIsDraggingOverElement] = Object(external_wp_element_["useState"])(); 31646 const [type, setType] = Object(external_wp_element_["useState"])(); 31647 const ref = Object(external_wp_compose_["__experimentalUseDropZone"])({ 31648 onDrop(event) { 31649 const files = Object(external_wp_dom_["getFilesFromDataTransfer"])(event.dataTransfer); 31650 const html = event.dataTransfer.getData('text/html'); 31651 31652 if (files.length && onFilesDrop) { 31653 onFilesDrop(files); 31654 } else if (html && onHTMLDrop) { 31655 onHTMLDrop(html); 31656 } else if (onDrop) { 31657 onDrop(event); 31658 } 31659 }, 31660 31661 onDragStart(event) { 31662 setIsDraggingOverDocument(true); 31663 let _type = 'default'; 31664 31665 if ( // Check for the types because sometimes the files themselves 31666 // are only available on drop. 31667 Object(external_lodash_["includes"])(event.dataTransfer.types, 'Files') || Object(external_wp_dom_["getFilesFromDataTransfer"])(event.dataTransfer).length > 0) { 31668 _type = 'file'; 31669 } else if (Object(external_lodash_["includes"])(event.dataTransfer.types, 'text/html')) { 31670 _type = 'html'; 31671 } 31672 31673 setType(_type); 31674 }, 31675 31676 onDragEnd() { 31677 setIsDraggingOverDocument(false); 31678 setType(); 31679 }, 31680 31681 onDragEnter() { 31682 setIsDraggingOverElement(true); 31683 }, 31684 31685 onDragLeave() { 31686 setIsDraggingOverElement(false); 31687 } 31688 31689 }); 31690 let children; 31691 31692 if (isDraggingOverElement) { 31693 children = Object(external_wp_element_["createElement"])("div", { 31694 className: "components-drop-zone__content" 31695 }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 31696 icon: upload["a" /* default */], 31697 className: "components-drop-zone__content-icon" 31698 }), Object(external_wp_element_["createElement"])("span", { 31699 className: "components-drop-zone__content-text" 31700 }, label ? label : Object(external_wp_i18n_["__"])('Drop files to upload'))); 31701 } 31702 31703 const classes = classnames_default()('components-drop-zone', className, { 31704 'is-active': (isDraggingOverDocument || isDraggingOverElement) && (type === 'file' && onFilesDrop || type === 'html' && onHTMLDrop || type === 'default' && onDrop), 31705 'is-dragging-over-document': isDraggingOverDocument, 31706 'is-dragging-over-element': isDraggingOverElement, 31707 [`is-dragging-${type}`]: !!type 31708 }); 31709 return Object(external_wp_element_["createElement"])("div", { 31710 ref: ref, 31711 className: classes 31712 }, children); 31713 } 31714 31715 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/drop-zone/provider.js 31716 /** 31717 * WordPress dependencies 31718 */ 31719 31720 function DropZoneProvider({ 31721 children 31722 }) { 31723 external_wp_deprecated_default()('wp.components.DropZoneProvider', { 31724 hint: 'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.' 31725 }); 31726 return children; 31727 } 31728 31729 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/menu.js 31730 31731 31732 /** 31733 * WordPress dependencies 31734 */ 31735 31736 const menu_menu = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 31737 xmlns: "http://www.w3.org/2000/svg", 31738 viewBox: "0 0 24 24" 31739 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 31740 d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" 31741 })); 31742 /* harmony default export */ var library_menu = (menu_menu); 31743 31744 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/container.js 31745 31746 31747 31748 /** 31749 * External dependencies 31750 */ 31751 31752 /** 31753 * WordPress dependencies 31754 */ 31755 31756 31757 31758 const MENU_ITEM_ROLES = ['menuitem', 'menuitemradio', 'menuitemcheckbox']; 31759 31760 function cycleValue(value, total, offset) { 31761 const nextValue = value + offset; 31762 31763 if (nextValue < 0) { 31764 return total + nextValue; 31765 } else if (nextValue >= total) { 31766 return nextValue - total; 31767 } 31768 31769 return nextValue; 31770 } 31771 31772 class container_NavigableContainer extends external_wp_element_["Component"] { 31773 constructor() { 31774 super(...arguments); 31775 this.onKeyDown = this.onKeyDown.bind(this); 31776 this.bindContainer = this.bindContainer.bind(this); 31777 this.getFocusableContext = this.getFocusableContext.bind(this); 31778 this.getFocusableIndex = this.getFocusableIndex.bind(this); 31779 } 31780 31781 componentDidMount() { 31782 // We use DOM event listeners instead of React event listeners 31783 // because we want to catch events from the underlying DOM tree 31784 // The React Tree can be different from the DOM tree when using 31785 // portals. Block Toolbars for instance are rendered in a separate 31786 // React Trees. 31787 this.container.addEventListener('keydown', this.onKeyDown); 31788 this.container.addEventListener('focus', this.onFocus); 31789 } 31790 31791 componentWillUnmount() { 31792 this.container.removeEventListener('keydown', this.onKeyDown); 31793 this.container.removeEventListener('focus', this.onFocus); 31794 } 31795 31796 bindContainer(ref) { 31797 const { 31798 forwardedRef 31799 } = this.props; 31800 this.container = ref; 31801 31802 if (Object(external_lodash_["isFunction"])(forwardedRef)) { 31803 forwardedRef(ref); 31804 } else if (forwardedRef && 'current' in forwardedRef) { 31805 forwardedRef.current = ref; 31806 } 31807 } 31808 31809 getFocusableContext(target) { 31810 const { 31811 onlyBrowserTabstops 31812 } = this.props; 31813 const finder = onlyBrowserTabstops ? external_wp_dom_["focus"].tabbable : external_wp_dom_["focus"].focusable; 31814 const focusables = finder.find(this.container); 31815 const index = this.getFocusableIndex(focusables, target); 31816 31817 if (index > -1 && target) { 31818 return { 31819 index, 31820 target, 31821 focusables 31822 }; 31823 } 31824 31825 return null; 31826 } 31827 31828 getFocusableIndex(focusables, target) { 31829 const directIndex = focusables.indexOf(target); 31830 31831 if (directIndex !== -1) { 31832 return directIndex; 31833 } 31834 } 31835 31836 onKeyDown(event) { 31837 if (this.props.onKeyDown) { 31838 this.props.onKeyDown(event); 31839 } 31840 31841 const { 31842 getFocusableContext 31843 } = this; 31844 const { 31845 cycle = true, 31846 eventToOffset, 31847 onNavigate = external_lodash_["noop"], 31848 stopNavigationEvents 31849 } = this.props; 31850 const offset = eventToOffset(event); // eventToOffset returns undefined if the event is not handled by the component 31851 31852 if (offset !== undefined && stopNavigationEvents) { 31853 // Prevents arrow key handlers bound to the document directly interfering 31854 event.stopImmediatePropagation(); // When navigating a collection of items, prevent scroll containers 31855 // from scrolling. The preventDefault also prevents Voiceover from 31856 // 'handling' the event, as voiceover will try to use arrow keys 31857 // for highlighting text. 31858 31859 const targetRole = event.target.getAttribute('role'); 31860 31861 if (MENU_ITEM_ROLES.includes(targetRole)) { 31862 event.preventDefault(); 31863 } 31864 } 31865 31866 if (!offset) { 31867 return; 31868 } 31869 31870 const context = getFocusableContext(event.target.ownerDocument.activeElement); 31871 31872 if (!context) { 31873 return; 31874 } 31875 31876 const { 31877 index, 31878 focusables 31879 } = context; 31880 const nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset; 31881 31882 if (nextIndex >= 0 && nextIndex < focusables.length) { 31883 focusables[nextIndex].focus(); 31884 onNavigate(nextIndex, focusables[nextIndex]); 31885 } 31886 } 31887 31888 render() { 31889 const { 31890 children, 31891 ...props 31892 } = this.props; 31893 return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ 31894 ref: this.bindContainer 31895 }, Object(external_lodash_["omit"])(props, ['stopNavigationEvents', 'eventToOffset', 'onNavigate', 'onKeyDown', 'cycle', 'onlyBrowserTabstops', 'forwardedRef'])), children); 31896 } 31897 31898 } 31899 31900 const forwardedNavigableContainer = (props, ref) => { 31901 return Object(external_wp_element_["createElement"])(container_NavigableContainer, Object(esm_extends["a" /* default */])({}, props, { 31902 forwardedRef: ref 31903 })); 31904 }; 31905 31906 forwardedNavigableContainer.displayName = 'NavigableContainer'; 31907 /* harmony default export */ var navigable_container_container = (Object(external_wp_element_["forwardRef"])(forwardedNavigableContainer)); 31908 31909 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js 31910 31911 31912 31913 /** 31914 * External dependencies 31915 */ 31916 31917 /** 31918 * WordPress dependencies 31919 */ 31920 31921 31922 31923 /** 31924 * Internal dependencies 31925 */ 31926 31927 31928 function NavigableMenu({ 31929 role = 'menu', 31930 orientation = 'vertical', 31931 ...rest 31932 }, ref) { 31933 const eventToOffset = evt => { 31934 const { 31935 keyCode 31936 } = evt; 31937 let next = [external_wp_keycodes_["DOWN"]]; 31938 let previous = [external_wp_keycodes_["UP"]]; 31939 31940 if (orientation === 'horizontal') { 31941 next = [external_wp_keycodes_["RIGHT"]]; 31942 previous = [external_wp_keycodes_["LEFT"]]; 31943 } 31944 31945 if (orientation === 'both') { 31946 next = [external_wp_keycodes_["RIGHT"], external_wp_keycodes_["DOWN"]]; 31947 previous = [external_wp_keycodes_["LEFT"], external_wp_keycodes_["UP"]]; 31948 } 31949 31950 if (Object(external_lodash_["includes"])(next, keyCode)) { 31951 return 1; 31952 } else if (Object(external_lodash_["includes"])(previous, keyCode)) { 31953 return -1; 31954 } else if (Object(external_lodash_["includes"])([external_wp_keycodes_["DOWN"], external_wp_keycodes_["UP"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) { 31955 // Key press should be handled, e.g. have event propagation and 31956 // default behavior handled by NavigableContainer but not result 31957 // in an offset. 31958 return 0; 31959 } 31960 }; 31961 31962 return Object(external_wp_element_["createElement"])(navigable_container_container, Object(esm_extends["a" /* default */])({ 31963 ref: ref, 31964 stopNavigationEvents: true, 31965 onlyBrowserTabstops: false, 31966 role: role, 31967 "aria-orientation": role === 'presentation' ? null : orientation, 31968 eventToOffset: eventToOffset 31969 }, rest)); 31970 } 31971 /* harmony default export */ var navigable_container_menu = (Object(external_wp_element_["forwardRef"])(NavigableMenu)); 31972 31973 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js 31974 31975 31976 31977 /** 31978 * External dependencies 31979 */ 31980 31981 31982 /** 31983 * WordPress dependencies 31984 */ 31985 31986 31987 31988 31989 /** 31990 * Internal dependencies 31991 */ 31992 31993 31994 31995 31996 31997 function mergeProps(defaultProps = {}, props = {}) { 31998 const mergedProps = { ...defaultProps, 31999 ...props 32000 }; 32001 32002 if (props.className && defaultProps.className) { 32003 mergedProps.className = classnames_default()(props.className, defaultProps.className); 32004 } 32005 32006 return mergedProps; 32007 } 32008 32009 function DropdownMenu({ 32010 children, 32011 className, 32012 controls, 32013 icon = library_menu, 32014 label, 32015 popoverProps, 32016 toggleProps, 32017 menuProps, 32018 disableOpenOnArrowDown = false, 32019 text, 32020 // The following props exist for backward compatibility. 32021 menuLabel, 32022 position, 32023 noIcons 32024 }) { 32025 if (menuLabel) { 32026 external_wp_deprecated_default()('`menuLabel` prop in `DropdownComponent`', { 32027 since: '5.3', 32028 alternative: '`menuProps` object and its `aria-label` property' 32029 }); 32030 } 32031 32032 if (position) { 32033 external_wp_deprecated_default()('`position` prop in `DropdownComponent`', { 32034 since: '5.3', 32035 alternative: '`popoverProps` object and its `position` property' 32036 }); 32037 } 32038 32039 if (Object(external_lodash_["isEmpty"])(controls) && !Object(external_lodash_["isFunction"])(children)) { 32040 return null; 32041 } // Normalize controls to nested array of objects (sets of controls) 32042 32043 32044 let controlSets; 32045 32046 if (!Object(external_lodash_["isEmpty"])(controls)) { 32047 controlSets = controls; 32048 32049 if (!Array.isArray(controlSets[0])) { 32050 controlSets = [controlSets]; 32051 } 32052 } 32053 32054 const mergedPopoverProps = mergeProps({ 32055 className: 'components-dropdown-menu__popover', 32056 position 32057 }, popoverProps); 32058 return Object(external_wp_element_["createElement"])(Dropdown, { 32059 className: classnames_default()('components-dropdown-menu', className), 32060 popoverProps: mergedPopoverProps, 32061 renderToggle: ({ 32062 isOpen, 32063 onToggle 32064 }) => { 32065 var _toggleProps$showTool; 32066 32067 const openOnArrowDown = event => { 32068 if (disableOpenOnArrowDown) { 32069 return; 32070 } 32071 32072 if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) { 32073 event.preventDefault(); 32074 event.stopPropagation(); 32075 onToggle(); 32076 } 32077 }; 32078 32079 const mergedToggleProps = mergeProps({ 32080 className: classnames_default()('components-dropdown-menu__toggle', { 32081 'is-opened': isOpen 32082 }) 32083 }, toggleProps); 32084 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedToggleProps, { 32085 icon: icon, 32086 onClick: event => { 32087 onToggle(event); 32088 32089 if (mergedToggleProps.onClick) { 32090 mergedToggleProps.onClick(event); 32091 } 32092 }, 32093 onKeyDown: event => { 32094 openOnArrowDown(event); 32095 32096 if (mergedToggleProps.onKeyDown) { 32097 mergedToggleProps.onKeyDown(event); 32098 } 32099 }, 32100 "aria-haspopup": "true", 32101 "aria-expanded": isOpen, 32102 label: label, 32103 text: text, 32104 showTooltip: (_toggleProps$showTool = toggleProps === null || toggleProps === void 0 ? void 0 : toggleProps.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true 32105 }), mergedToggleProps.children); 32106 }, 32107 renderContent: props => { 32108 const mergedMenuProps = mergeProps({ 32109 'aria-label': menuLabel || label, 32110 className: classnames_default()('components-dropdown-menu__menu', { 32111 'no-icons': noIcons 32112 }) 32113 }, menuProps); 32114 return Object(external_wp_element_["createElement"])(navigable_container_menu, Object(esm_extends["a" /* default */])({}, mergedMenuProps, { 32115 role: "menu" 32116 }), Object(external_lodash_["isFunction"])(children) ? children(props) : null, Object(external_lodash_["flatMap"])(controlSets, (controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 32117 key: [indexOfSet, indexOfControl].join(), 32118 onClick: event => { 32119 event.stopPropagation(); 32120 props.onClose(); 32121 32122 if (control.onClick) { 32123 control.onClick(); 32124 } 32125 }, 32126 className: classnames_default()('components-dropdown-menu__menu-item', { 32127 'has-separator': indexOfSet > 0 && indexOfControl === 0, 32128 'is-active': control.isActive 32129 }), 32130 icon: control.icon, 32131 "aria-checked": control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.isActive : undefined, 32132 role: control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.role : 'menuitem', 32133 disabled: control.isDisabled 32134 }, control.title)))); 32135 } 32136 }); 32137 } 32138 32139 /* harmony default export */ var dropdown_menu = (DropdownMenu); 32140 32141 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/swatch.js 32142 32143 32144 /** 32145 * WordPress dependencies 32146 */ 32147 32148 const swatch = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 32149 xmlns: "http://www.w3.org/2000/svg", 32150 viewBox: "0 0 24 24" 32151 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 32152 d: "M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z" 32153 })); 32154 /* harmony default export */ var library_swatch = (swatch); 32155 32156 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/swatch/index.js 32157 32158 32159 /** 32160 * WordPress dependencies 32161 */ 32162 32163 /** 32164 * Internal dependencies 32165 */ 32166 32167 32168 32169 function Swatch({ 32170 fill 32171 }) { 32172 return fill ? Object(external_wp_element_["createElement"])("span", { 32173 className: "components-swatch", 32174 style: { 32175 background: fill 32176 } 32177 }) : Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 32178 icon: library_swatch 32179 }); 32180 } 32181 32182 /* harmony default export */ var build_module_swatch = (Swatch); 32183 32184 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/utils.js 32185 /** 32186 * External dependencies 32187 */ 32188 32189 /** 32190 * Object representation for a color. 32191 * 32192 * @typedef {Object} RGBColor 32193 * @property {number} r Red component of the color in the range [0,1]. 32194 * @property {number} g Green component of the color in the range [0,1]. 32195 * @property {number} b Blue component of the color in the range [0,1]. 32196 */ 32197 32198 /** 32199 * Calculate the brightest and darkest values from a color palette. 32200 * 32201 * @param {Object[]} palette Color palette for the theme. 32202 * 32203 * @return {string[]} Tuple of the darkest color and brightest color. 32204 */ 32205 32206 function getDefaultColors(palette) { 32207 // A default dark and light color are required. 32208 if (!palette || palette.length < 2) return ['#000', '#fff']; 32209 return palette.map(({ 32210 color 32211 }) => ({ 32212 color, 32213 brightness: tinycolor_default()(color).getBrightness() / 255 32214 })).reduce(([min, max], current) => { 32215 return [current.brightness <= min.brightness ? current : min, current.brightness >= max.brightness ? current : max]; 32216 }, [{ 32217 brightness: 1 32218 }, { 32219 brightness: 0 32220 }]).map(({ 32221 color 32222 }) => color); 32223 } 32224 /** 32225 * Generate a duotone gradient from a list of colors. 32226 * 32227 * @param {string[]} colors CSS color strings. 32228 * @param {string} angle CSS gradient angle. 32229 * 32230 * @return {string} CSS gradient string for the duotone swatch. 32231 */ 32232 32233 function getGradientFromCSSColors(colors = [], angle = '90deg') { 32234 const l = 100 / colors.length; 32235 const stops = colors.map((c, i) => `${c} ${i * l}%, ${c} ${(i + 1) * l}%`).join(', '); 32236 return `linear-gradient( ${angle}, ${stops} )`; 32237 } 32238 /** 32239 * Convert a color array to an array of color stops. 32240 * 32241 * @param {string[]} colors CSS colors array 32242 * 32243 * @return {Object[]} Color stop information. 32244 */ 32245 32246 function getColorStopsFromColors(colors) { 32247 return colors.map((color, i) => ({ 32248 position: i * 100 / (colors.length - 1), 32249 color 32250 })); 32251 } 32252 /** 32253 * Convert a color stop array to an array colors. 32254 * 32255 * @param {Object[]} colorStops Color stop information. 32256 * 32257 * @return {string[]} CSS colors array. 32258 */ 32259 32260 function getColorsFromColorStops(colorStops = []) { 32261 return colorStops.map(({ 32262 color 32263 }) => color); 32264 } 32265 32266 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-swatch.js 32267 32268 32269 /** 32270 * Internal dependencies 32271 */ 32272 32273 32274 32275 function DuotoneSwatch({ 32276 values 32277 }) { 32278 return Object(external_wp_element_["createElement"])(build_module_swatch, { 32279 fill: values && getGradientFromCSSColors(values, '135deg') 32280 }); 32281 } 32282 32283 /* harmony default export */ var duotone_swatch = (DuotoneSwatch); 32284 32285 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-list-picker/index.js 32286 32287 32288 /** 32289 * WordPress dependencies 32290 */ 32291 32292 /** 32293 * Internal dependencies 32294 */ 32295 32296 32297 32298 32299 32300 function color_list_picker_ColorOption({ 32301 label, 32302 value, 32303 colors, 32304 disableCustomColors, 32305 onChange 32306 }) { 32307 const [isOpen, setIsOpen] = Object(external_wp_element_["useState"])(false); 32308 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 32309 className: "components-color-list-picker__swatch-button", 32310 icon: Object(external_wp_element_["createElement"])(build_module_swatch, { 32311 fill: value 32312 }), 32313 onClick: () => setIsOpen(prev => !prev) 32314 }, label), isOpen && Object(external_wp_element_["createElement"])(ColorPalette, { 32315 colors: colors, 32316 value: value, 32317 clearable: false, 32318 onChange: onChange, 32319 disableCustomColors: disableCustomColors 32320 })); 32321 } 32322 32323 function ColorListPicker({ 32324 colors, 32325 labels, 32326 value = [], 32327 disableCustomColors, 32328 onChange 32329 }) { 32330 return Object(external_wp_element_["createElement"])("div", { 32331 className: "components-color-list-picker" 32332 }, labels.map((label, index) => Object(external_wp_element_["createElement"])(color_list_picker_ColorOption, { 32333 key: index, 32334 label: label, 32335 value: value[index], 32336 colors: colors, 32337 disableCustomColors: disableCustomColors, 32338 onChange: newColor => { 32339 const newColors = value.slice(); 32340 newColors[index] = newColor; 32341 onChange(newColors); 32342 } 32343 }))); 32344 } 32345 32346 /* harmony default export */ var color_list_picker = (ColorListPicker); 32347 32348 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/constants.js 32349 const COLOR_POPOVER_PROPS = { 32350 className: 'components-custom-gradient-picker__color-picker-popover', 32351 position: 'top' 32352 }; 32353 const GRADIENT_MARKERS_WIDTH = 18; 32354 const INSERT_POINT_WIDTH = 23; 32355 const MINIMUM_ABSOLUTE_LEFT_POSITION = 5; 32356 const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT = 10; 32357 const MINIMUM_DISTANCE_BETWEEN_POINTS = 0; 32358 const MINIMUM_SIGNIFICANT_MOVE = 5; 32359 const KEYBOARD_CONTROL_POINT_VARIATION = MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT; 32360 const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER = (INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH) / 2; 32361 32362 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/utils.js 32363 /** 32364 * Internal dependencies 32365 */ 32366 32367 /** 32368 * Control point for the gradient bar. 32369 * 32370 * @typedef {Object} ControlPoint 32371 * @property {string} color Color of the control point. 32372 * @property {number} position Integer position of the control point as a percentage. 32373 */ 32374 32375 /** 32376 * Color as parsed from the gradient by gradient-parser. 32377 * 32378 * @typedef {Object} Color 32379 * @property {string} r Red component. 32380 * @property {string} g Green component. 32381 * @property {string} b Green component. 32382 * @property {string} [a] Optional alpha component. 32383 */ 32384 32385 /** 32386 * Clamps a number between 0 and 100. 32387 * 32388 * @param {number} value Value to clamp. 32389 * 32390 * @return {number} Value clamped between 0 and 100. 32391 */ 32392 32393 function clampPercent(value) { 32394 return Math.max(0, Math.min(100, value)); 32395 } 32396 /** 32397 * Check if a control point is overlapping with another. 32398 * 32399 * @param {ControlPoint[]} value Array of control points. 32400 * @param {number} initialIndex Index of the position to test. 32401 * @param {number} newPosition New position of the control point. 32402 * @param {number} minDistance Distance considered to be overlapping. 32403 * 32404 * @return {boolean} True if the point is overlapping. 32405 */ 32406 32407 function isOverlapping(value, initialIndex, newPosition, minDistance = MINIMUM_DISTANCE_BETWEEN_POINTS) { 32408 const initialPosition = value[initialIndex].position; 32409 const minPosition = Math.min(initialPosition, newPosition); 32410 const maxPosition = Math.max(initialPosition, newPosition); 32411 return value.some(({ 32412 position 32413 }, index) => { 32414 return index !== initialIndex && (Math.abs(position - newPosition) < minDistance || minPosition < position && position < maxPosition); 32415 }); 32416 } 32417 /** 32418 * Adds a control point from an array and returns the new array. 32419 * 32420 * @param {ControlPoint[]} points Array of control points. 32421 * @param {number} position Position to insert the new point. 32422 * @param {Color} color Color to update the control point at index. 32423 * 32424 * @return {ControlPoint[]} New array of control points. 32425 */ 32426 32427 function addControlPoint(points, position, color) { 32428 const nextIndex = points.findIndex(point => point.position > position); 32429 const newPoint = { 32430 color, 32431 position 32432 }; 32433 const newPoints = points.slice(); 32434 newPoints.splice(nextIndex - 1, 0, newPoint); 32435 return newPoints; 32436 } 32437 /** 32438 * Removes a control point from an array and returns the new array. 32439 * 32440 * @param {ControlPoint[]} points Array of control points. 32441 * @param {number} index Index to remove. 32442 * 32443 * @return {ControlPoint[]} New array of control points. 32444 */ 32445 32446 function removeControlPoint(points, index) { 32447 return points.filter((point, pointIndex) => { 32448 return pointIndex !== index; 32449 }); 32450 } 32451 /** 32452 * Updates a control point from an array and returns the new array. 32453 * 32454 * @param {ControlPoint[]} points Array of control points. 32455 * @param {number} index Index to update. 32456 * @param {ControlPoint[]} newPoint New control point to replace the index. 32457 * 32458 * @return {ControlPoint[]} New array of control points. 32459 */ 32460 32461 function updateControlPoint(points, index, newPoint) { 32462 const newValue = points.slice(); 32463 newValue[index] = newPoint; 32464 return newValue; 32465 } 32466 /** 32467 * Updates the position of a control point from an array and returns the new array. 32468 * 32469 * @param {ControlPoint[]} points Array of control points. 32470 * @param {number} index Index to update. 32471 * @param {number} newPosition Position to move the control point at index. 32472 * 32473 * @return {ControlPoint[]} New array of control points. 32474 */ 32475 32476 function updateControlPointPosition(points, index, newPosition) { 32477 if (isOverlapping(points, index, newPosition)) { 32478 return points; 32479 } 32480 32481 const newPoint = { ...points[index], 32482 position: newPosition 32483 }; 32484 return updateControlPoint(points, index, newPoint); 32485 } 32486 /** 32487 * Updates the position of a control point from an array and returns the new array. 32488 * 32489 * @param {ControlPoint[]} points Array of control points. 32490 * @param {number} index Index to update. 32491 * @param {Color} newColor Color to update the control point at index. 32492 * 32493 * @return {ControlPoint[]} New array of control points. 32494 */ 32495 32496 function updateControlPointColor(points, index, newColor) { 32497 const newPoint = { ...points[index], 32498 color: newColor 32499 }; 32500 return updateControlPoint(points, index, newPoint); 32501 } 32502 /** 32503 * Updates the position of a control point from an array and returns the new array. 32504 * 32505 * @param {ControlPoint[]} points Array of control points. 32506 * @param {number} position Position of the color stop. 32507 * @param {string} newColor Color to update the control point at index. 32508 * 32509 * @return {ControlPoint[]} New array of control points. 32510 */ 32511 32512 function updateControlPointColorByPosition(points, position, newColor) { 32513 const index = points.findIndex(point => point.position === position); 32514 return updateControlPointColor(points, index, newColor); 32515 } 32516 /** 32517 * Gets the horizontal coordinate when dragging a control point with the mouse. 32518 * 32519 * @param {number} mouseXCoordinate Horizontal coordinate of the mouse position. 32520 * @param {Element} containerElement Container for the gradient picker. 32521 * @param {number} positionedElementWidth Width of the positioned element. 32522 * 32523 * @return {number} Whole number percentage from the left. 32524 */ 32525 32526 function getHorizontalRelativeGradientPosition(mouseXCoordinate, containerElement, positionedElementWidth) { 32527 if (!containerElement) { 32528 return; 32529 } 32530 32531 const { 32532 x, 32533 width 32534 } = containerElement.getBoundingClientRect(); 32535 const absolutePositionValue = mouseXCoordinate - x - MINIMUM_ABSOLUTE_LEFT_POSITION - positionedElementWidth / 2; 32536 const availableWidth = width - MINIMUM_ABSOLUTE_LEFT_POSITION - INSERT_POINT_WIDTH; 32537 return Math.round(clampPercent(absolutePositionValue * 100 / availableWidth)); 32538 } 32539 32540 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/control-points.js 32541 32542 32543 32544 /** 32545 * External dependencies 32546 */ 32547 32548 /** 32549 * WordPress dependencies 32550 */ 32551 32552 32553 32554 32555 32556 /** 32557 * Internal dependencies 32558 */ 32559 32560 32561 32562 32563 32564 32565 32566 32567 32568 function ControlPointKeyboardMove({ 32569 value: position, 32570 onChange, 32571 children 32572 }) { 32573 const shortcuts = { 32574 right(event) { 32575 // Stop propagation of the key press event to avoid focus moving 32576 // to another editor area. 32577 event.stopPropagation(); 32578 const newPosition = clampPercent(position + KEYBOARD_CONTROL_POINT_VARIATION); 32579 onChange(newPosition); 32580 }, 32581 32582 left(event) { 32583 // Stop propagation of the key press event to avoid focus moving 32584 // to another editor area. 32585 event.stopPropagation(); 32586 const newPosition = clampPercent(position - KEYBOARD_CONTROL_POINT_VARIATION); 32587 onChange(newPosition); 32588 } 32589 32590 }; 32591 return Object(external_wp_element_["createElement"])(keyboard_shortcuts, { 32592 shortcuts: shortcuts 32593 }, children); 32594 } 32595 32596 function ControlPointButton({ 32597 isOpen, 32598 position, 32599 color, 32600 onChange, 32601 ...additionalProps 32602 }) { 32603 const instanceId = Object(external_wp_compose_["useInstanceId"])(ControlPointButton); 32604 const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`; 32605 return Object(external_wp_element_["createElement"])(ControlPointKeyboardMove, { 32606 value: position, 32607 onChange: onChange 32608 }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 32609 "aria-label": Object(external_wp_i18n_["sprintf"])( // translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151). 32610 Object(external_wp_i18n_["__"])('Gradient control point at position %1$s%% with color code %2$s.'), position, color), 32611 "aria-describedby": descriptionId, 32612 "aria-haspopup": "true", 32613 "aria-expanded": isOpen, 32614 className: classnames_default()('components-custom-gradient-picker__control-point-button', { 32615 'is-active': isOpen 32616 }), 32617 style: { 32618 left: `${position}%` 32619 } 32620 }, additionalProps)), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 32621 id: descriptionId 32622 }, Object(external_wp_i18n_["__"])('Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'))); 32623 } 32624 32625 function ControlPoints({ 32626 disableRemove, 32627 disableAlpha, 32628 gradientPickerDomRef, 32629 ignoreMarkerPosition, 32630 value: controlPoints, 32631 onChange, 32632 onStartControlPointChange, 32633 onStopControlPointChange 32634 }) { 32635 const controlPointMoveState = Object(external_wp_element_["useRef"])(); 32636 32637 const onMouseMove = event => { 32638 const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current, GRADIENT_MARKERS_WIDTH); 32639 const { 32640 initialPosition, 32641 index, 32642 significantMoveHappened 32643 } = controlPointMoveState.current; 32644 32645 if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) { 32646 controlPointMoveState.current.significantMoveHappened = true; 32647 } 32648 32649 onChange(updateControlPointPosition(controlPoints, index, relativePosition)); 32650 }; 32651 32652 const cleanEventListeners = () => { 32653 if (window && window.removeEventListener && controlPointMoveState.current && controlPointMoveState.current.listenersActivated) { 32654 window.removeEventListener('mousemove', onMouseMove); 32655 window.removeEventListener('mouseup', cleanEventListeners); 32656 onStopControlPointChange(); 32657 controlPointMoveState.current.listenersActivated = false; 32658 } 32659 }; 32660 32661 Object(external_wp_element_["useEffect"])(() => { 32662 return () => { 32663 cleanEventListeners(); 32664 }; 32665 }, []); 32666 return controlPoints.map((point, index) => { 32667 const initialPosition = point === null || point === void 0 ? void 0 : point.position; 32668 return ignoreMarkerPosition !== initialPosition && Object(external_wp_element_["createElement"])(Dropdown, { 32669 key: index, 32670 onClose: onStopControlPointChange, 32671 renderToggle: ({ 32672 isOpen, 32673 onToggle 32674 }) => Object(external_wp_element_["createElement"])(ControlPointButton, { 32675 key: index, 32676 onClick: () => { 32677 if (controlPointMoveState.current && controlPointMoveState.current.significantMoveHappened) { 32678 return; 32679 } 32680 32681 if (isOpen) { 32682 onStopControlPointChange(); 32683 } else { 32684 onStartControlPointChange(); 32685 } 32686 32687 onToggle(); 32688 }, 32689 onMouseDown: () => { 32690 if (window && window.addEventListener) { 32691 controlPointMoveState.current = { 32692 initialPosition, 32693 index, 32694 significantMoveHappened: false, 32695 listenersActivated: true 32696 }; 32697 onStartControlPointChange(); 32698 window.addEventListener('mousemove', onMouseMove); 32699 window.addEventListener('mouseup', cleanEventListeners); 32700 } 32701 }, 32702 isOpen: isOpen, 32703 position: point.position, 32704 color: point.color, 32705 onChange: newPosition => { 32706 onChange(updateControlPointPosition(controlPoints, index, newPosition)); 32707 } 32708 }), 32709 renderContent: ({ 32710 onClose 32711 }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(color_picker_ColorPicker, { 32712 disableAlpha: disableAlpha, 32713 color: point.color, 32714 onChangeComplete: ({ 32715 color 32716 }) => { 32717 onChange(updateControlPointColor(controlPoints, index, color.toRgbString())); 32718 } 32719 }), !disableRemove && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 32720 className: "components-custom-gradient-picker__remove-control-point", 32721 onClick: () => { 32722 onChange(removeControlPoint(controlPoints, index)); 32723 onClose(); 32724 }, 32725 isLink: true 32726 }, Object(external_wp_i18n_["__"])('Remove Control Point'))), 32727 popoverProps: COLOR_POPOVER_PROPS 32728 }); 32729 }); 32730 } 32731 32732 function InsertPoint({ 32733 value: controlPoints, 32734 onChange, 32735 onOpenInserter, 32736 onCloseInserter, 32737 insertPosition, 32738 disableAlpha 32739 }) { 32740 const [alreadyInsertedPoint, setAlreadyInsertedPoint] = Object(external_wp_element_["useState"])(false); 32741 return Object(external_wp_element_["createElement"])(Dropdown, { 32742 className: "components-custom-gradient-picker__inserter", 32743 onClose: () => { 32744 onCloseInserter(); 32745 }, 32746 renderToggle: ({ 32747 isOpen, 32748 onToggle 32749 }) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 32750 "aria-expanded": isOpen, 32751 "aria-haspopup": "true", 32752 onClick: () => { 32753 if (isOpen) { 32754 onCloseInserter(); 32755 } else { 32756 setAlreadyInsertedPoint(false); 32757 onOpenInserter(); 32758 } 32759 32760 onToggle(); 32761 }, 32762 className: "components-custom-gradient-picker__insert-point", 32763 icon: plus["a" /* default */], 32764 style: { 32765 left: insertPosition !== null ? `${insertPosition}%` : undefined 32766 } 32767 }), 32768 renderContent: () => Object(external_wp_element_["createElement"])(color_picker_ColorPicker, { 32769 disableAlpha: disableAlpha, 32770 onChangeComplete: ({ 32771 color 32772 }) => { 32773 if (!alreadyInsertedPoint) { 32774 onChange(addControlPoint(controlPoints, insertPosition, color.toRgbString())); 32775 setAlreadyInsertedPoint(true); 32776 } else { 32777 onChange(updateControlPointColorByPosition(controlPoints, insertPosition, color.toRgbString())); 32778 } 32779 } 32780 }), 32781 popoverProps: COLOR_POPOVER_PROPS 32782 }); 32783 } 32784 32785 ControlPoints.InsertPoint = InsertPoint; 32786 /* harmony default export */ var control_points = (ControlPoints); 32787 32788 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/index.js 32789 32790 32791 /** 32792 * External dependencies 32793 */ 32794 32795 32796 /** 32797 * WordPress dependencies 32798 */ 32799 32800 32801 /** 32802 * Internal dependencies 32803 */ 32804 32805 32806 32807 32808 32809 function customGradientBarReducer(state, action) { 32810 switch (action.type) { 32811 case 'MOVE_INSERTER': 32812 if (state.id === 'IDLE' || state.id === 'MOVING_INSERTER') { 32813 return { 32814 id: 'MOVING_INSERTER', 32815 insertPosition: action.insertPosition 32816 }; 32817 } 32818 32819 break; 32820 32821 case 'STOP_INSERTER_MOVE': 32822 if (state.id === 'MOVING_INSERTER') { 32823 return { 32824 id: 'IDLE' 32825 }; 32826 } 32827 32828 break; 32829 32830 case 'OPEN_INSERTER': 32831 if (state.id === 'MOVING_INSERTER') { 32832 return { 32833 id: 'INSERTING_CONTROL_POINT', 32834 insertPosition: state.insertPosition 32835 }; 32836 } 32837 32838 break; 32839 32840 case 'CLOSE_INSERTER': 32841 if (state.id === 'INSERTING_CONTROL_POINT') { 32842 return { 32843 id: 'IDLE' 32844 }; 32845 } 32846 32847 break; 32848 32849 case 'START_CONTROL_CHANGE': 32850 if (state.id === 'IDLE') { 32851 return { 32852 id: 'MOVING_CONTROL_POINT' 32853 }; 32854 } 32855 32856 break; 32857 32858 case 'STOP_CONTROL_CHANGE': 32859 if (state.id === 'MOVING_CONTROL_POINT') { 32860 return { 32861 id: 'IDLE' 32862 }; 32863 } 32864 32865 break; 32866 } 32867 32868 return state; 32869 } 32870 32871 const customGradientBarReducerInitialState = { 32872 id: 'IDLE' 32873 }; 32874 function CustomGradientBar({ 32875 background, 32876 hasGradient, 32877 value: controlPoints, 32878 onChange, 32879 disableInserter = false, 32880 disableAlpha = false 32881 }) { 32882 const gradientPickerDomRef = Object(external_wp_element_["useRef"])(); 32883 const [gradientBarState, gradientBarStateDispatch] = Object(external_wp_element_["useReducer"])(customGradientBarReducer, customGradientBarReducerInitialState); 32884 32885 const onMouseEnterAndMove = event => { 32886 const insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current, INSERT_POINT_WIDTH); // If the insert point is close to an existing control point don't show it. 32887 32888 if (Object(external_lodash_["some"])(controlPoints, ({ 32889 position 32890 }) => { 32891 return Math.abs(insertPosition - position) < MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT; 32892 })) { 32893 if (gradientBarState.id === 'MOVING_INSERTER') { 32894 gradientBarStateDispatch({ 32895 type: 'STOP_INSERTER_MOVE' 32896 }); 32897 } 32898 32899 return; 32900 } 32901 32902 gradientBarStateDispatch({ 32903 type: 'MOVE_INSERTER', 32904 insertPosition 32905 }); 32906 }; 32907 32908 const onMouseLeave = () => { 32909 gradientBarStateDispatch({ 32910 type: 'STOP_INSERTER_MOVE' 32911 }); 32912 }; 32913 32914 const isMovingInserter = gradientBarState.id === 'MOVING_INSERTER'; 32915 const isInsertingControlPoint = gradientBarState.id === 'INSERTING_CONTROL_POINT'; 32916 return Object(external_wp_element_["createElement"])("div", { 32917 ref: gradientPickerDomRef, 32918 className: classnames_default()('components-custom-gradient-picker__gradient-bar', { 32919 'has-gradient': hasGradient 32920 }), 32921 onMouseEnter: onMouseEnterAndMove, 32922 onMouseMove: onMouseEnterAndMove, 32923 style: { 32924 background 32925 }, 32926 onMouseLeave: onMouseLeave 32927 }, Object(external_wp_element_["createElement"])("div", { 32928 className: "components-custom-gradient-picker__markers-container" 32929 }, !disableInserter && (isMovingInserter || isInsertingControlPoint) && Object(external_wp_element_["createElement"])(control_points.InsertPoint, { 32930 disableAlpha: disableAlpha, 32931 insertPosition: gradientBarState.insertPosition, 32932 value: controlPoints, 32933 onChange: onChange, 32934 onOpenInserter: () => { 32935 gradientBarStateDispatch({ 32936 type: 'OPEN_INSERTER' 32937 }); 32938 }, 32939 onCloseInserter: () => { 32940 gradientBarStateDispatch({ 32941 type: 'CLOSE_INSERTER' 32942 }); 32943 } 32944 }), Object(external_wp_element_["createElement"])(control_points, { 32945 disableAlpha: disableAlpha, 32946 disableRemove: disableInserter, 32947 gradientPickerDomRef: gradientPickerDomRef, 32948 ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : undefined, 32949 value: controlPoints, 32950 onChange: onChange, 32951 onStartControlPointChange: () => { 32952 gradientBarStateDispatch({ 32953 type: 'START_CONTROL_CHANGE' 32954 }); 32955 }, 32956 onStopControlPointChange: () => { 32957 gradientBarStateDispatch({ 32958 type: 'STOP_CONTROL_CHANGE' 32959 }); 32960 } 32961 }))); 32962 } 32963 32964 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/custom-duotone-bar.js 32965 32966 32967 /** 32968 * Internal dependencies 32969 */ 32970 32971 32972 const PLACEHOLDER_VALUES = ['#333', '#CCC']; 32973 function CustomDuotoneBar({ 32974 value, 32975 onChange 32976 }) { 32977 const hasGradient = !!value; 32978 const values = hasGradient ? value : PLACEHOLDER_VALUES; 32979 const background = getGradientFromCSSColors(values); 32980 const controlPoints = getColorStopsFromColors(values); 32981 return Object(external_wp_element_["createElement"])(CustomGradientBar, { 32982 disableInserter: true, 32983 disableAlpha: true, 32984 background: background, 32985 hasGradient: hasGradient, 32986 value: controlPoints, 32987 onChange: newColorStops => { 32988 const newValue = getColorsFromColorStops(newColorStops); 32989 onChange(newValue); 32990 } 32991 }); 32992 } 32993 32994 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-picker.js 32995 32996 32997 /** 32998 * External dependencies 32999 */ 33000 33001 /** 33002 * WordPress dependencies 33003 */ 33004 33005 33006 33007 /** 33008 * Internal dependencies 33009 */ 33010 33011 33012 33013 33014 33015 33016 function DuotonePicker({ 33017 colorPalette, 33018 duotonePalette, 33019 disableCustomColors, 33020 disableCustomDuotone, 33021 value, 33022 onChange 33023 }) { 33024 const [defaultDark, defaultLight] = Object(external_wp_element_["useMemo"])(() => getDefaultColors(colorPalette), [colorPalette]); 33025 return Object(external_wp_element_["createElement"])(CircularOptionPicker, { 33026 options: duotonePalette.map(({ 33027 colors, 33028 slug, 33029 name 33030 }) => { 33031 const style = { 33032 background: getGradientFromCSSColors(colors, '135deg'), 33033 color: 'transparent' 33034 }; 33035 const tooltipText = name !== null && name !== void 0 ? name : Object(external_wp_i18n_["sprintf"])( // translators: %s: duotone code e.g: "dark-grayscale" or "7f7f7f-ffffff". 33036 Object(external_wp_i18n_["__"])('Duotone code: %s'), slug); 33037 const label = name ? Object(external_wp_i18n_["sprintf"])( // translators: %s: The name of the option e.g: "Dark grayscale". 33038 Object(external_wp_i18n_["__"])('Duotone: %s'), name) : tooltipText; 33039 const isSelected = Object(external_lodash_["isEqual"])(colors, value); 33040 return Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, { 33041 key: slug, 33042 value: colors, 33043 isSelected: isSelected, 33044 "aria-label": label, 33045 tooltipText: tooltipText, 33046 style: style, 33047 onClick: () => { 33048 onChange(isSelected ? undefined : colors); 33049 } 33050 }); 33051 }), 33052 actions: Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, { 33053 onClick: () => onChange(undefined) 33054 }, Object(external_wp_i18n_["__"])('Clear')) 33055 }, !disableCustomColors && !disableCustomDuotone && Object(external_wp_element_["createElement"])(CustomDuotoneBar, { 33056 value: value, 33057 onChange: onChange 33058 }), !disableCustomDuotone && Object(external_wp_element_["createElement"])(color_list_picker, { 33059 labels: [Object(external_wp_i18n_["__"])('Shadows'), Object(external_wp_i18n_["__"])('Highlights')], 33060 colors: colorPalette, 33061 value: value, 33062 disableCustomColors: disableCustomColors, 33063 onChange: newColors => { 33064 if (!newColors[0]) { 33065 newColors[0] = defaultDark; 33066 } 33067 33068 if (!newColors[1]) { 33069 newColors[1] = defaultLight; 33070 } 33071 33072 const newValue = newColors.length >= 2 ? newColors : undefined; 33073 onChange(newValue); 33074 } 33075 })); 33076 } 33077 33078 /* harmony default export */ var duotone_picker = (DuotonePicker); 33079 33080 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js 33081 var external = __webpack_require__("K+tz"); 33082 33083 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/styles/external-link-styles.js 33084 33085 33086 function external_link_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 33087 33088 /** 33089 * WordPress dependencies 33090 */ 33091 33092 const StyledIcon = /*#__PURE__*/styled_base_browser_esm(build_module_icon["a" /* default */], { 33093 target: "etxm6pv0", 33094 label: "StyledIcon" 33095 })( true ? { 33096 name: "i8uvf3", 33097 styles: "width:1.4em;height:1.4em;margin:-0.2em 0.1em 0;vertical-align:middle;fill:currentColor;" 33098 } : undefined); 33099 33100 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/index.js 33101 33102 33103 33104 /** 33105 * External dependencies 33106 */ 33107 33108 33109 /** 33110 * WordPress dependencies 33111 */ 33112 33113 33114 33115 33116 /** 33117 * Internal dependencies 33118 */ 33119 33120 33121 33122 function ExternalLink({ 33123 href, 33124 children, 33125 className, 33126 rel = '', 33127 ...additionalProps 33128 }, ref) { 33129 rel = Object(external_lodash_["uniq"])(Object(external_lodash_["compact"])([...rel.split(' '), 'external', 'noreferrer', 'noopener'])).join(' '); 33130 const classes = classnames_default()('components-external-link', className); 33131 return ( 33132 /* eslint-disable react/jsx-no-target-blank */ 33133 Object(external_wp_element_["createElement"])("a", Object(esm_extends["a" /* default */])({}, additionalProps, { 33134 className: classes, 33135 href: href, 33136 target: "_blank", 33137 rel: rel, 33138 ref: ref 33139 }), children, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 33140 as: "span" 33141 }, 33142 /* translators: accessibility text */ 33143 Object(external_wp_i18n_["__"])('(opens in a new tab)')), Object(external_wp_element_["createElement"])(StyledIcon, { 33144 icon: external["a" /* default */], 33145 className: "components-external-link__icon" 33146 })) 33147 /* eslint-enable react/jsx-no-target-blank */ 33148 33149 ); 33150 } 33151 /* harmony default export */ var external_link = (Object(external_wp_element_["forwardRef"])(ExternalLink)); 33152 33153 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-picker-style.js 33154 33155 33156 function focal_point_picker_style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 33157 33158 /** 33159 * Internal dependencies 33160 */ 33161 33162 33163 33164 const MediaWrapper = styled_base_browser_esm("div", { 33165 target: "e11wezi70", 33166 label: "MediaWrapper" 33167 })( true ? { 33168 name: "4wwkjz", 33169 styles: "background-color:transparent;box-sizing:border-box;text-align:center;width:100%;" 33170 } : undefined); 33171 const MediaContainer = styled_base_browser_esm("div", { 33172 target: "e11wezi71", 33173 label: "MediaContainer" 33174 })( true ? { 33175 name: "1q0l1fq", 33176 styles: "align-items:center;box-sizing:border-box;box-shadow:0 0 0 1px rgba( 0,0,0,0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}" 33177 } : undefined); 33178 const MediaPlaceholder = styled_base_browser_esm("div", { 33179 target: "e11wezi72", 33180 label: "MediaPlaceholder" 33181 })("background:", COLORS.lightGray[300], ";box-sizing:border-box;height:170px;max-width:280px;min-width:200px;width:100%;" + ( true ? "" : undefined)); 33182 const focal_point_picker_style_UnitControl = /*#__PURE__*/styled_base_browser_esm(unit_control, { 33183 target: "e11wezi73", 33184 label: "UnitControl" 33185 })( true ? { 33186 name: "v7v99c", 33187 styles: "width:100px;" 33188 } : undefined); 33189 const ControlWrapper = /*#__PURE__*/styled_base_browser_esm(flex_component, { 33190 target: "e11wezi74", 33191 label: "ControlWrapper" 33192 })( true ? { 33193 name: "lqoi1w", 33194 styles: "max-width:320px;padding:1em 0;" 33195 } : undefined); 33196 const GridView = styled_base_browser_esm("div", { 33197 target: "e11wezi75", 33198 label: "GridView" 33199 })("box-sizing:border-box;left:50%;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%,-50%,0 );transition:opacity 120ms linear;z-index:1;", ({ 33200 isActive 33201 }) => isActive && ` 33202 opacity: 1; 33203 `, true ? "" : undefined); 33204 const GridLine = styled_base_browser_esm("div", { 33205 target: "e11wezi76", 33206 label: "GridLine" 33207 })( true ? { 33208 name: "18dz4sk", 33209 styles: "box-sizing:border-box;background:white;box-shadow:0 0 2px rgba( 0,0,0,0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 );" 33210 } : undefined); 33211 const GridLineX = /*#__PURE__*/styled_base_browser_esm(GridLine, { 33212 target: "e11wezi77", 33213 label: "GridLineX" 33214 })( true ? { 33215 name: "1u4twh6", 33216 styles: "height:1px;left:0;right:0;" 33217 } : undefined); 33218 const GridLineY = /*#__PURE__*/styled_base_browser_esm(GridLine, { 33219 target: "e11wezi78", 33220 label: "GridLineY" 33221 })( true ? { 33222 name: "13gvipf", 33223 styles: "width:1px;top:0;bottom:0;" 33224 } : undefined); 33225 33226 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/utils.js 33227 const INITIAL_BOUNDS = { 33228 top: 0, 33229 left: 0, 33230 bottom: 0, 33231 right: 0, 33232 width: 0, 33233 height: 0 33234 }; 33235 const VIDEO_EXTENSIONS = ['avi', 'mpg', 'mpeg', 'mov', 'mp4', 'm4v', 'ogg', 'ogv', 'webm', 'wmv']; 33236 /** 33237 * Gets the extension of a file name. 33238 * 33239 * @param {string} filename The file name. 33240 * @return {string} The extension of the file name. 33241 */ 33242 33243 function getExtension(filename = '') { 33244 const parts = filename.split('.'); 33245 return parts[parts.length - 1]; 33246 } 33247 /** 33248 * Checks if a file is a video. 33249 * 33250 * @param {string} filename The file name. 33251 * @return {boolean} Whether the file is a video. 33252 */ 33253 33254 function isVideoType(filename = '') { 33255 if (!filename) return false; 33256 return VIDEO_EXTENSIONS.includes(getExtension(filename)); 33257 } 33258 /** 33259 * Transforms a fraction value to a percentage value. 33260 * 33261 * @param {number} fraction The fraction value. 33262 * @return {number} A percentage value. 33263 */ 33264 33265 function fractionToPercentage(fraction) { 33266 return Math.round(fraction * 100); 33267 } 33268 33269 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/controls.js 33270 33271 33272 33273 /** 33274 * External dependencies 33275 */ 33276 33277 /** 33278 * WordPress dependencies 33279 */ 33280 33281 33282 /** 33283 * Internal dependencies 33284 */ 33285 33286 33287 33288 const TEXTCONTROL_MIN = 0; 33289 const TEXTCONTROL_MAX = 100; 33290 function FocalPointPickerControls({ 33291 onChange = external_lodash_["noop"], 33292 percentages = { 33293 x: 0.5, 33294 y: 0.5 33295 } 33296 }) { 33297 const valueX = fractionToPercentage(percentages.x); 33298 const valueY = fractionToPercentage(percentages.y); 33299 33300 const handleOnXChange = next => { 33301 onChange({ ...percentages, 33302 x: parseInt(next) / 100 33303 }); 33304 }; 33305 33306 const handleOnYChange = next => { 33307 onChange({ ...percentages, 33308 y: parseInt(next) / 100 33309 }); 33310 }; 33311 33312 return Object(external_wp_element_["createElement"])(ControlWrapper, { 33313 className: "focal-point-picker__controls" 33314 }, Object(external_wp_element_["createElement"])(controls_UnitControl, { 33315 label: Object(external_wp_i18n_["__"])('Left'), 33316 value: valueX, 33317 onChange: handleOnXChange, 33318 dragDirection: "e" 33319 }), Object(external_wp_element_["createElement"])(controls_UnitControl, { 33320 label: Object(external_wp_i18n_["__"])('Top'), 33321 value: valueY, 33322 onChange: handleOnYChange, 33323 dragDirection: "s" 33324 })); 33325 } 33326 33327 function controls_UnitControl(props) { 33328 return Object(external_wp_element_["createElement"])(focal_point_picker_style_UnitControl, Object(esm_extends["a" /* default */])({ 33329 className: "focal-point-picker__controls-position-unit-control", 33330 labelPosition: "side", 33331 max: TEXTCONTROL_MAX, 33332 min: TEXTCONTROL_MIN, 33333 unit: "%", 33334 units: [{ 33335 value: '%', 33336 label: '%' 33337 }] 33338 }, props)); 33339 } 33340 33341 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-style.js 33342 33343 33344 function focal_point_style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 33345 33346 /** 33347 * WordPress dependencies 33348 */ 33349 33350 /** 33351 * Internal dependencies 33352 */ 33353 33354 33355 const FocalPointWrapper = styled_base_browser_esm("div", { 33356 target: "eas61re0", 33357 label: "FocalPointWrapper" 33358 })("background-color:transparent;box-sizing:border-box;cursor:grab;height:30px;margin:-15px 0 0 -15px;opacity:0.8;position:absolute;user-select:none;width:30px;will-change:transform;z-index:10000;", ({ 33359 isDragging 33360 }) => isDragging && 'cursor: grabbing;', true ? "" : undefined); 33361 const PointerIconSVG = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["SVG"], { 33362 target: "eas61re1", 33363 label: "PointerIconSVG" 33364 })( true ? { 33365 name: "1fp1hff", 33366 styles: "display:block;height:100%;left:0;position:absolute;top:0;width:100%;" 33367 } : undefined); 33368 const PointerIconPathOutline = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["Path"], { 33369 target: "eas61re2", 33370 label: "PointerIconPathOutline" 33371 })( true ? { 33372 name: "j4aqsr", 33373 styles: "fill:white;" 33374 } : undefined); 33375 const PointerIconPathFill = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["Path"], { 33376 target: "eas61re3", 33377 label: "PointerIconPathFill" 33378 })("fill:", COLORS.blue.wordpress[700], ";fill:", COLORS.ui.theme, ";" + ( true ? "" : undefined)); 33379 33380 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/focal-point.js 33381 33382 33383 33384 /** 33385 * Internal dependencies 33386 */ 33387 33388 /** 33389 * External dependencies 33390 */ 33391 33392 33393 function FocalPoint({ 33394 coordinates = { 33395 left: '50%', 33396 top: '50%' 33397 }, 33398 ...props 33399 }) { 33400 const classes = classnames_default()('components-focal-point-picker__icon_container'); 33401 const style = { 33402 left: coordinates.left, 33403 top: coordinates.top 33404 }; 33405 return Object(external_wp_element_["createElement"])(FocalPointWrapper, Object(esm_extends["a" /* default */])({}, props, { 33406 className: classes, 33407 style: style 33408 }), Object(external_wp_element_["createElement"])(PointerIconSVG, { 33409 className: "components-focal-point-picker__icon", 33410 xmlns: "http://www.w3.org/2000/svg", 33411 viewBox: "0 0 30 30" 33412 }, Object(external_wp_element_["createElement"])(PointerIconPathOutline, { 33413 className: "components-focal-point-picker__icon-outline", 33414 d: "M15 1C7.3 1 1 7.3 1 15s6.3 14 14 14 14-6.3 14-14S22.7 1 15 1zm0 22c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z" 33415 }), Object(external_wp_element_["createElement"])(PointerIconPathFill, { 33416 className: "components-focal-point-picker__icon-fill", 33417 d: "M15 3C8.4 3 3 8.4 3 15s5.4 12 12 12 12-5.4 12-12S21.6 3 15 3zm0 22C9.5 25 5 20.5 5 15S9.5 5 15 5s10 4.5 10 10-4.5 10-10 10z" 33418 }))); 33419 } 33420 33421 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/grid.js 33422 33423 33424 33425 /** 33426 * WordPress dependencies 33427 */ 33428 33429 /** 33430 * Internal dependencies 33431 */ 33432 33433 33434 33435 const { 33436 clearTimeout: grid_clearTimeout, 33437 setTimeout: grid_setTimeout 33438 } = typeof window !== 'undefined' ? window : {}; 33439 function FocalPointPickerGrid({ 33440 bounds = {}, 33441 value, 33442 ...props 33443 }) { 33444 const animationProps = useRevealAnimation(value); 33445 const style = { 33446 width: bounds.width, 33447 height: bounds.height 33448 }; 33449 return Object(external_wp_element_["createElement"])(GridView, Object(esm_extends["a" /* default */])({}, props, animationProps, { 33450 className: "components-focal-point-picker__grid", 33451 style: style 33452 }), Object(external_wp_element_["createElement"])(GridLineX, { 33453 style: { 33454 top: '33%' 33455 } 33456 }), Object(external_wp_element_["createElement"])(GridLineX, { 33457 style: { 33458 top: '66%' 33459 } 33460 }), Object(external_wp_element_["createElement"])(GridLineY, { 33461 style: { 33462 left: '33%' 33463 } 33464 }), Object(external_wp_element_["createElement"])(GridLineY, { 33465 style: { 33466 left: '66%' 33467 } 33468 })); 33469 } 33470 /** 33471 * Custom hook that renders the "flash" animation whenever the value changes. 33472 * 33473 * @param {string} value Value of (box) side. 33474 */ 33475 33476 function useRevealAnimation(value) { 33477 const [isActive, setIsActive] = Object(external_wp_element_["useState"])(false); 33478 use_update_effect(() => { 33479 setIsActive(true); 33480 const timeout = grid_setTimeout(() => { 33481 setIsActive(false); 33482 }, 600); 33483 return () => grid_clearTimeout(timeout); 33484 }, [value]); 33485 return { 33486 isActive 33487 }; 33488 } 33489 33490 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/media.js 33491 33492 33493 33494 /** 33495 * External dependencies 33496 */ 33497 33498 /** 33499 * WordPress dependencies 33500 */ 33501 33502 33503 /** 33504 * Internal dependencies 33505 */ 33506 33507 33508 33509 function Media({ 33510 alt, 33511 autoPlay, 33512 src, 33513 onLoad = external_lodash_["noop"], 33514 mediaRef, 33515 // Exposing muted prop for test rendering purposes 33516 // https://github.com/testing-library/react-testing-library/issues/470 33517 muted = true, 33518 ...props 33519 }) { 33520 if (!src) { 33521 return Object(external_wp_element_["createElement"])(MediaPlaceholderElement, { 33522 className: "components-focal-point-picker__media components-focal-point-picker__media--placeholder", 33523 onLoad: onLoad, 33524 mediaRef: mediaRef 33525 }); 33526 } 33527 33528 const isVideo = isVideoType(src); 33529 return isVideo ? Object(external_wp_element_["createElement"])("video", Object(esm_extends["a" /* default */])({}, props, { 33530 autoPlay: autoPlay, 33531 className: "components-focal-point-picker__media components-focal-point-picker__media--video", 33532 loop: true, 33533 muted: muted, 33534 onLoadedData: onLoad, 33535 ref: mediaRef, 33536 src: src 33537 })) : Object(external_wp_element_["createElement"])("img", Object(esm_extends["a" /* default */])({}, props, { 33538 alt: alt, 33539 className: "components-focal-point-picker__media components-focal-point-picker__media--image", 33540 onLoad: onLoad, 33541 ref: mediaRef, 33542 src: src 33543 })); 33544 } 33545 33546 function MediaPlaceholderElement({ 33547 mediaRef, 33548 onLoad = external_lodash_["noop"], 33549 ...props 33550 }) { 33551 const onLoadRef = Object(external_wp_element_["useRef"])(onLoad); 33552 /** 33553 * This async callback mimics the onLoad (img) / onLoadedData (video) callback 33554 * for media elements. It is used in the main <FocalPointPicker /> component 33555 * to calculate the dimensions + boundaries for positioning. 33556 */ 33557 33558 Object(external_wp_element_["useLayoutEffect"])(() => { 33559 window.requestAnimationFrame(() => { 33560 onLoadRef.current(); 33561 }); 33562 }, []); 33563 return Object(external_wp_element_["createElement"])(MediaPlaceholder, Object(esm_extends["a" /* default */])({ 33564 ref: mediaRef 33565 }, props)); 33566 } 33567 33568 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/index.js 33569 33570 33571 /** 33572 * External dependencies 33573 */ 33574 33575 /** 33576 * WordPress dependencies 33577 */ 33578 33579 33580 33581 33582 33583 /** 33584 * Internal dependencies 33585 */ 33586 33587 33588 33589 33590 33591 33592 33593 33594 33595 class focal_point_picker_FocalPointPicker extends external_wp_element_["Component"] { 33596 constructor(props) { 33597 super(...arguments); 33598 this.state = { 33599 isDragging: false, 33600 bounds: INITIAL_BOUNDS, 33601 percentages: props.value 33602 }; 33603 this.containerRef = Object(external_wp_element_["createRef"])(); 33604 this.mediaRef = Object(external_wp_element_["createRef"])(); 33605 this.onMouseDown = this.startDrag.bind(this); 33606 this.onMouseUp = this.stopDrag.bind(this); 33607 this.onKeyDown = this.onKeyDown.bind(this); 33608 this.onMouseMove = this.doDrag.bind(this); 33609 33610 this.ifDraggingStop = () => { 33611 if (this.state.isDragging) { 33612 this.stopDrag(); 33613 } 33614 }; 33615 33616 this.onChangeAtControls = value => { 33617 this.updateValue(value); 33618 this.props.onChange(value); 33619 }; 33620 33621 this.updateBounds = this.updateBounds.bind(this); 33622 this.updateValue = this.updateValue.bind(this); 33623 } 33624 33625 componentDidMount() { 33626 const { 33627 defaultView 33628 } = this.containerRef.current.ownerDocument; 33629 defaultView.addEventListener('resize', this.updateBounds); 33630 /* 33631 * Set initial bound values. 33632 * 33633 * This is necessary for Safari: 33634 * https://github.com/WordPress/gutenberg/issues/25814 33635 */ 33636 33637 this.updateBounds(); 33638 } 33639 33640 componentDidUpdate(prevProps) { 33641 if (prevProps.url !== this.props.url) { 33642 this.ifDraggingStop(); 33643 } 33644 /* 33645 * Handles cases where the incoming value changes. 33646 * An example is the values resetting based on an UNDO action. 33647 */ 33648 33649 33650 const { 33651 isDragging, 33652 percentages: { 33653 x, 33654 y 33655 } 33656 } = this.state; 33657 const { 33658 value 33659 } = this.props; 33660 33661 if (!isDragging && (value.x !== x || value.y !== y)) { 33662 this.setState({ 33663 percentages: this.props.value 33664 }); 33665 } 33666 } 33667 33668 componentWillUnmount() { 33669 const { 33670 defaultView 33671 } = this.containerRef.current.ownerDocument; 33672 defaultView.removeEventListener('resize', this.updateBounds); 33673 this.ifDraggingStop(); 33674 } 33675 33676 calculateBounds() { 33677 const bounds = INITIAL_BOUNDS; 33678 33679 if (!this.mediaRef.current) { 33680 return bounds; 33681 } // Prevent division by zero when updateBounds runs in componentDidMount 33682 33683 33684 if (this.mediaRef.current.clientWidth === 0 || this.mediaRef.current.clientHeight === 0) { 33685 return bounds; 33686 } 33687 33688 const dimensions = { 33689 width: this.mediaRef.current.clientWidth, 33690 height: this.mediaRef.current.clientHeight 33691 }; 33692 const pickerDimensions = this.pickerDimensions(); 33693 const widthRatio = pickerDimensions.width / dimensions.width; 33694 const heightRatio = pickerDimensions.height / dimensions.height; 33695 33696 if (heightRatio >= widthRatio) { 33697 bounds.width = bounds.right = pickerDimensions.width; 33698 bounds.height = dimensions.height * widthRatio; 33699 bounds.top = (pickerDimensions.height - bounds.height) / 2; 33700 bounds.bottom = bounds.top + bounds.height; 33701 } else { 33702 bounds.height = bounds.bottom = pickerDimensions.height; 33703 bounds.width = dimensions.width * heightRatio; 33704 bounds.left = (pickerDimensions.width - bounds.width) / 2; 33705 bounds.right = bounds.left + bounds.width; 33706 } 33707 33708 return bounds; 33709 } 33710 33711 updateValue(nextValue = {}) { 33712 const { 33713 x, 33714 y 33715 } = nextValue; 33716 const nextPercentage = { 33717 x: parseFloat(x).toFixed(2), 33718 y: parseFloat(y).toFixed(2) 33719 }; 33720 this.setState({ 33721 percentages: nextPercentage 33722 }); 33723 } 33724 33725 updateBounds() { 33726 this.setState({ 33727 bounds: this.calculateBounds() 33728 }); 33729 } 33730 33731 startDrag(event) { 33732 var _this$props$onDragSta, _this$props; 33733 33734 event.persist(); 33735 this.containerRef.current.focus(); 33736 this.setState({ 33737 isDragging: true 33738 }); 33739 const { 33740 ownerDocument 33741 } = this.containerRef.current; 33742 ownerDocument.addEventListener('mouseup', this.onMouseUp); 33743 ownerDocument.addEventListener('mousemove', this.onMouseMove); 33744 const value = this.getValueFromPoint({ 33745 x: event.pageX, 33746 y: event.pageY 33747 }, event.shiftKey); 33748 this.updateValue(value); 33749 (_this$props$onDragSta = (_this$props = this.props).onDragStart) === null || _this$props$onDragSta === void 0 ? void 0 : _this$props$onDragSta.call(_this$props, value, event); 33750 } 33751 33752 stopDrag(event) { 33753 var _this$props$onDragEnd, _this$props2; 33754 33755 const { 33756 ownerDocument 33757 } = this.containerRef.current; 33758 ownerDocument.removeEventListener('mouseup', this.onMouseUp); 33759 ownerDocument.removeEventListener('mousemove', this.onMouseMove); 33760 this.setState({ 33761 isDragging: false 33762 }, () => { 33763 this.props.onChange(this.state.percentages); 33764 }); 33765 (_this$props$onDragEnd = (_this$props2 = this.props).onDragEnd) === null || _this$props$onDragEnd === void 0 ? void 0 : _this$props$onDragEnd.call(_this$props2, event); 33766 } 33767 33768 onKeyDown(event) { 33769 const { 33770 keyCode, 33771 shiftKey 33772 } = event; 33773 if (![external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]].includes(keyCode)) return; 33774 event.preventDefault(); 33775 const next = { ...this.state.percentages 33776 }; 33777 const step = shiftKey ? 0.1 : 0.01; 33778 const delta = keyCode === external_wp_keycodes_["UP"] || keyCode === external_wp_keycodes_["LEFT"] ? -1 * step : step; 33779 const axis = keyCode === external_wp_keycodes_["UP"] || keyCode === external_wp_keycodes_["DOWN"] ? 'y' : 'x'; 33780 const value = parseFloat(next[axis]) + delta; 33781 next[axis] = roundClamp(value, 0, 1, step); 33782 this.updateValue(next); 33783 this.props.onChange(next); 33784 } 33785 33786 doDrag(event) { 33787 var _this$props$onDrag, _this$props3; 33788 33789 // Prevents text-selection when dragging. 33790 event.preventDefault(); 33791 const value = this.getValueFromPoint({ 33792 x: event.pageX, 33793 y: event.pageY 33794 }, event.shiftKey); 33795 this.updateValue(value); 33796 (_this$props$onDrag = (_this$props3 = this.props).onDrag) === null || _this$props$onDrag === void 0 ? void 0 : _this$props$onDrag.call(_this$props3, value, event); 33797 } 33798 33799 getValueFromPoint(point, byTenths) { 33800 const { 33801 bounds 33802 } = this.state; 33803 const pickerDimensions = this.pickerDimensions(); 33804 const relativePoint = { 33805 left: point.x - pickerDimensions.left, 33806 top: point.y - pickerDimensions.top 33807 }; 33808 const left = Math.max(bounds.left, Math.min(relativePoint.left, bounds.right)); 33809 const top = Math.max(bounds.top, Math.min(relativePoint.top, bounds.bottom)); 33810 let nextX = (left - bounds.left) / (pickerDimensions.width - bounds.left * 2); 33811 let nextY = (top - bounds.top) / (pickerDimensions.height - bounds.top * 2); // Enables holding shift to jump values by 10% 33812 33813 const step = byTenths ? 0.1 : 0.01; 33814 nextX = roundClamp(nextX, 0, 1, step); 33815 nextY = roundClamp(nextY, 0, 1, step); 33816 return { 33817 x: nextX, 33818 y: nextY 33819 }; 33820 } 33821 33822 pickerDimensions() { 33823 const containerNode = this.containerRef.current; 33824 33825 if (!containerNode) { 33826 return { 33827 width: 0, 33828 height: 0, 33829 left: 0, 33830 top: 0 33831 }; 33832 } 33833 33834 const { 33835 clientHeight, 33836 clientWidth 33837 } = containerNode; 33838 const { 33839 top, 33840 left 33841 } = containerNode.getBoundingClientRect(); 33842 return { 33843 width: clientWidth, 33844 height: clientHeight, 33845 top: top + document.body.scrollTop, 33846 left 33847 }; 33848 } 33849 33850 iconCoordinates() { 33851 const { 33852 bounds, 33853 percentages: { 33854 x, 33855 y 33856 } 33857 } = this.state; 33858 33859 if (bounds.left === undefined || bounds.top === undefined) { 33860 return { 33861 left: '50%', 33862 top: '50%' 33863 }; 33864 } 33865 33866 const { 33867 width, 33868 height 33869 } = this.pickerDimensions(); 33870 return { 33871 left: x * (width - bounds.left * 2) + bounds.left, 33872 top: y * (height - bounds.top * 2) + bounds.top 33873 }; 33874 } 33875 33876 render() { 33877 const { 33878 autoPlay, 33879 className, 33880 help, 33881 instanceId, 33882 label, 33883 url 33884 } = this.props; 33885 const { 33886 bounds, 33887 isDragging, 33888 percentages 33889 } = this.state; 33890 const iconCoordinates = this.iconCoordinates(); 33891 const classes = classnames_default()('components-focal-point-picker-control', className); 33892 const id = `inspector-focal-point-picker-control-${instanceId}`; 33893 return Object(external_wp_element_["createElement"])(base_control, { 33894 label: label, 33895 id: id, 33896 help: help, 33897 className: classes 33898 }, Object(external_wp_element_["createElement"])(MediaWrapper, { 33899 className: "components-focal-point-picker-wrapper" 33900 }, Object(external_wp_element_["createElement"])(MediaContainer, { 33901 className: "components-focal-point-picker", 33902 onKeyDown: this.onKeyDown, 33903 onMouseDown: this.onMouseDown, 33904 onBlur: this.ifDraggingStop, 33905 ref: this.containerRef, 33906 role: "button", 33907 tabIndex: "-1" 33908 }, Object(external_wp_element_["createElement"])(FocalPointPickerGrid, { 33909 bounds: bounds, 33910 value: percentages.x + percentages.y 33911 }), Object(external_wp_element_["createElement"])(Media, { 33912 alt: Object(external_wp_i18n_["__"])('Media preview'), 33913 autoPlay: autoPlay, 33914 mediaRef: this.mediaRef, 33915 onLoad: this.updateBounds, 33916 src: url 33917 }), Object(external_wp_element_["createElement"])(FocalPoint, { 33918 coordinates: iconCoordinates, 33919 isDragging: isDragging 33920 }))), Object(external_wp_element_["createElement"])(FocalPointPickerControls, { 33921 percentages: percentages, 33922 onChange: this.onChangeAtControls 33923 })); 33924 } 33925 33926 } 33927 focal_point_picker_FocalPointPicker.defaultProps = { 33928 autoPlay: true, 33929 value: { 33930 x: 0.5, 33931 y: 0.5 33932 }, 33933 url: null 33934 }; 33935 /* harmony default export */ var focal_point_picker = (Object(external_wp_compose_["withInstanceId"])(focal_point_picker_FocalPointPicker)); 33936 33937 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focusable-iframe/index.js 33938 33939 33940 33941 /** 33942 * WordPress dependencies 33943 */ 33944 33945 33946 function FocusableIframe({ 33947 iframeRef, 33948 ...props 33949 }) { 33950 const fallbackRef = Object(external_wp_element_["useRef"])(); 33951 const ref = Object(external_wp_compose_["useMergeRefs"])([iframeRef, fallbackRef]); 33952 Object(external_wp_element_["useEffect"])(() => { 33953 const iframe = fallbackRef.current; 33954 const { 33955 ownerDocument 33956 } = iframe; 33957 const { 33958 defaultView 33959 } = ownerDocument; 33960 /** 33961 * Checks whether the iframe is the activeElement, inferring that it has 33962 * then received focus, and calls the `onFocus` prop callback. 33963 */ 33964 33965 function checkFocus() { 33966 if (ownerDocument.activeElement !== iframe) { 33967 return; 33968 } 33969 33970 iframe.focus(); 33971 } 33972 33973 defaultView.addEventListener('blur', checkFocus); 33974 return () => { 33975 defaultView.removeEventListener('blur', checkFocus); 33976 }; 33977 }, []); // Disable reason: The rendered iframe is a pass-through component, 33978 // assigning props inherited from the rendering parent. It's the 33979 // responsibility of the parent to assign a title. 33980 // eslint-disable-next-line jsx-a11y/iframe-has-title 33981 33982 return Object(external_wp_element_["createElement"])("iframe", Object(esm_extends["a" /* default */])({ 33983 ref: ref 33984 }, props)); 33985 } 33986 33987 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js 33988 var text_color = __webpack_require__("uGfJ"); 33989 33990 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/utils.js 33991 /** 33992 * External dependencies 33993 */ 33994 33995 /** 33996 * WordPress dependencies 33997 */ 33998 33999 34000 /** 34001 * Internal dependencies 34002 */ 34003 34004 34005 /** 34006 * A float supported clamp function for a specific value. 34007 * 34008 * @param {number|null} value The value to clamp. 34009 * @param {number} min The minimum value. 34010 * @param {number} max The maximum value. 34011 * 34012 * @return {number} A (float) number 34013 */ 34014 34015 function floatClamp(value, min, max) { 34016 if (typeof value !== 'number') { 34017 return null; 34018 } 34019 34020 return parseFloat(Object(external_lodash_["clamp"])(value, min, max)); 34021 } 34022 /** 34023 * Hook to store a clamped value, derived from props. 34024 * 34025 * @param {Object} settings Hook settings. 34026 * @param {number} settings.min The minimum value. 34027 * @param {number} settings.max The maximum value. 34028 * @param {number} settings.value The current value. 34029 * @param {any} settings.initial The initial value. 34030 * 34031 * @return {[*, Function]} The controlled value and the value setter. 34032 */ 34033 34034 function useControlledRangeValue({ 34035 min, 34036 max, 34037 value: valueProp, 34038 initial 34039 }) { 34040 const [state, setInternalState] = use_controlled_state(floatClamp(valueProp, min, max), { 34041 initial, 34042 fallback: null 34043 }); 34044 const setState = Object(external_wp_element_["useCallback"])(nextValue => { 34045 if (nextValue === null) { 34046 setInternalState(null); 34047 } else { 34048 setInternalState(floatClamp(nextValue, min, max)); 34049 } 34050 }, [min, max]); 34051 return [state, setState]; 34052 } 34053 /** 34054 * Hook to encapsulate the debouncing "hover" to better handle the showing 34055 * and hiding of the Tooltip. 34056 * 34057 * @param {Object} settings Hook settings. 34058 * @param {Function} [settings.onShow=noop] A callback function invoked when the element is shown. 34059 * @param {Function} [settings.onHide=noop] A callback function invoked when the element is hidden. 34060 * @param {Function} [settings.onMouseMove=noop] A callback function invoked when the mouse is moved. 34061 * @param {Function} [settings.onMouseLeave=noop] A callback function invoked when the mouse is moved out of the element. 34062 * @param {number} [settings.timeout=300] Timeout before the element is shown or hidden. 34063 * 34064 * @return {Object} Bound properties for use on a React.Node. 34065 */ 34066 34067 function useDebouncedHoverInteraction({ 34068 onHide = external_lodash_["noop"], 34069 onMouseLeave = external_lodash_["noop"], 34070 onMouseMove = external_lodash_["noop"], 34071 onShow = external_lodash_["noop"], 34072 timeout = 300 34073 }) { 34074 const [show, setShow] = Object(external_wp_element_["useState"])(false); 34075 const timeoutRef = Object(external_wp_element_["useRef"])(); 34076 const setDebouncedTimeout = Object(external_wp_element_["useCallback"])(callback => { 34077 window.clearTimeout(timeoutRef.current); 34078 timeoutRef.current = setTimeout(callback, timeout); 34079 }, [timeout]); 34080 const handleOnMouseMove = Object(external_wp_element_["useCallback"])(event => { 34081 onMouseMove(event); 34082 setDebouncedTimeout(() => { 34083 if (!show) { 34084 setShow(true); 34085 onShow(); 34086 } 34087 }); 34088 }, []); 34089 const handleOnMouseLeave = Object(external_wp_element_["useCallback"])(event => { 34090 onMouseLeave(event); 34091 setDebouncedTimeout(() => { 34092 setShow(false); 34093 onHide(); 34094 }); 34095 }, []); 34096 Object(external_wp_element_["useEffect"])(() => { 34097 return () => { 34098 window.clearTimeout(timeoutRef.current); 34099 }; 34100 }); 34101 return { 34102 onMouseMove: handleOnMouseMove, 34103 onMouseLeave: handleOnMouseLeave 34104 }; 34105 } 34106 34107 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/styles/range-control-styles.js 34108 34109 34110 function range_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 34111 34112 /** 34113 * External dependencies 34114 */ 34115 34116 34117 /** 34118 * Internal dependencies 34119 */ 34120 34121 34122 34123 var range_control_styles_ref = true ? { 34124 name: "tdik1c", 34125 styles: "height:30px;min-height:30px;" 34126 } : undefined; 34127 34128 const rangeHeight = () => range_control_styles_ref; 34129 34130 const thumbSize = 20; 34131 const range_control_styles_Root = styled_base_browser_esm("div", { 34132 target: "exqw8y20", 34133 label: "Root" 34134 })( true ? { 34135 name: "44oaj8", 34136 styles: "-webkit-tap-highlight-color:transparent;box-sizing:border-box;align-items:flex-start;display:inline-flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;" 34137 } : undefined); 34138 34139 const wrapperColor = ({ 34140 color: colorProp = COLORS.ui.borderFocus 34141 }) => { 34142 return /*#__PURE__*/css_browser_esm({ 34143 color: colorProp 34144 }, true ? "" : undefined); 34145 }; 34146 34147 const wrapperMargin = ({ 34148 marks 34149 }) => /*#__PURE__*/css_browser_esm({ 34150 marginBottom: marks ? 16 : null 34151 }, true ? "" : undefined); 34152 34153 const range_control_styles_Wrapper = styled_base_browser_esm("div", { 34154 target: "exqw8y21", 34155 label: "Wrapper" 34156 })("box-sizing:border-box;color:", COLORS.blue.medium.focus, ";display:block;flex:1;padding-top:15px;position:relative;width:100%;", wrapperColor, ";", rangeHeight, ";", wrapperMargin, ";", rtl_rtl({ 34157 marginLeft: 10 34158 }), true ? "" : undefined); 34159 const BeforeIconWrapper = styled_base_browser_esm("span", { 34160 target: "exqw8y22", 34161 label: "BeforeIconWrapper" 34162 })("margin-top:3px;", rtl_rtl({ 34163 marginRight: 6 34164 }), true ? "" : undefined); 34165 const AfterIconWrapper = styled_base_browser_esm("span", { 34166 target: "exqw8y23", 34167 label: "AfterIconWrapper" 34168 })("margin-top:3px;", rtl_rtl({ 34169 marginLeft: 16 34170 }), true ? "" : undefined); 34171 34172 const railBackgroundColor = ({ 34173 disabled, 34174 railColor 34175 }) => { 34176 let background = railColor || null; 34177 34178 if (disabled) { 34179 background = COLORS.lightGray[400]; 34180 } 34181 34182 return /*#__PURE__*/css_browser_esm({ 34183 background 34184 }, true ? "" : undefined); 34185 }; 34186 34187 const Rail = styled_base_browser_esm("span", { 34188 target: "exqw8y24", 34189 label: "Rail" 34190 })("background-color:", COLORS.lightGray[600], ";box-sizing:border-box;left:0;pointer-events:none;right:0;display:block;height:3px;position:absolute;margin-top:14px;top:0;", railBackgroundColor, ";" + ( true ? "" : undefined)); 34191 34192 const trackBackgroundColor = ({ 34193 disabled, 34194 trackColor 34195 }) => { 34196 let background = trackColor || 'currentColor'; 34197 34198 if (disabled) { 34199 background = COLORS.lightGray[800]; 34200 } 34201 34202 return /*#__PURE__*/css_browser_esm({ 34203 background 34204 }, true ? "" : undefined); 34205 }; 34206 34207 const Track = styled_base_browser_esm("span", { 34208 target: "exqw8y25", 34209 label: "Track" 34210 })("background-color:currentColor;border-radius:1px;box-sizing:border-box;height:3px;pointer-events:none;display:block;position:absolute;margin-top:14px;top:0;", trackBackgroundColor, ";" + ( true ? "" : undefined)); 34211 const MarksWrapper = styled_base_browser_esm("span", { 34212 target: "exqw8y26", 34213 label: "MarksWrapper" 34214 })( true ? { 34215 name: "8d21nl", 34216 styles: "box-sizing:border-box;display:block;pointer-events:none;position:relative;width:100%;user-select:none;" 34217 } : undefined); 34218 34219 const markFill = ({ 34220 disabled, 34221 isFilled 34222 }) => { 34223 let backgroundColor = isFilled ? 'currentColor' : COLORS.lightGray[600]; 34224 34225 if (disabled) { 34226 backgroundColor = COLORS.lightGray[800]; 34227 } 34228 34229 return /*#__PURE__*/css_browser_esm({ 34230 backgroundColor 34231 }, true ? "" : undefined); 34232 }; 34233 34234 const Mark = styled_base_browser_esm("span", { 34235 target: "exqw8y27", 34236 label: "Mark" 34237 })("box-sizing:border-box;height:9px;left:0;position:absolute;top:-4px;width:1px;", markFill, ";" + ( true ? "" : undefined)); 34238 34239 const markLabelFill = ({ 34240 isFilled 34241 }) => { 34242 return /*#__PURE__*/css_browser_esm({ 34243 color: isFilled ? COLORS.darkGray[300] : COLORS.lightGray[600] 34244 }, true ? "" : undefined); 34245 }; 34246 34247 const MarkLabel = styled_base_browser_esm("span", { 34248 target: "exqw8y28", 34249 label: "MarkLabel" 34250 })("box-sizing:border-box;color:", COLORS.lightGray[600], ";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;", markLabelFill, ";" + ( true ? "" : undefined)); 34251 const ThumbWrapper = styled_base_browser_esm("span", { 34252 target: "exqw8y29", 34253 label: "ThumbWrapper" 34254 })("align-items:center;box-sizing:border-box;display:flex;height:", thumbSize, "px;justify-content:center;margin-top:5px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:", thumbSize, "px;", rtl_rtl({ 34255 marginLeft: -10 34256 }), true ? "" : undefined); 34257 34258 const thumbFocus = ({ 34259 isFocused 34260 }) => { 34261 return /*#__PURE__*/css_browser_esm({ 34262 borderColor: isFocused ? COLORS.ui.borderFocus : COLORS.darkGray[200], 34263 boxShadow: isFocused ? ` 34264 0 0 0 1px ${COLORS.ui.borderFocus} 34265 ` : ` 34266 0 0 0 rgba(0, 0, 0, 0) 34267 ` 34268 }, true ? "" : undefined); 34269 }; 34270 34271 const Thumb = styled_base_browser_esm("span", { 34272 target: "exqw8y210", 34273 label: "Thumb" 34274 })("align-items:center;background-color:white;border-radius:50%;border:1px solid ", COLORS.darkGray[200], ";box-sizing:border-box;height:100%;outline:0;position:absolute;user-select:none;width:100%;", thumbFocus, ";" + ( true ? "" : undefined)); 34275 const InputRange = styled_base_browser_esm("input", { 34276 target: "exqw8y211", 34277 label: "InputRange" 34278 })("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -", thumbSize / 2, "px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ", thumbSize, "px );" + ( true ? "" : undefined)); 34279 34280 const tooltipShow = ({ 34281 show 34282 }) => { 34283 return /*#__PURE__*/css_browser_esm({ 34284 opacity: show ? 1 : 0 34285 }, true ? "" : undefined); 34286 }; 34287 34288 var range_control_styles_ref2 = true ? { 34289 name: "5qqmyx", 34290 styles: "top:-80%;" 34291 } : undefined; 34292 34293 var range_control_styles_ref3 = true ? { 34294 name: "eda4eg", 34295 styles: "bottom:-80%;" 34296 } : undefined; 34297 34298 const tooltipPosition = ({ 34299 position 34300 }) => { 34301 const isTop = position === 'top'; 34302 34303 if (isTop) { 34304 return range_control_styles_ref2; 34305 } 34306 34307 return range_control_styles_ref3; 34308 }; 34309 34310 const range_control_styles_Tooltip = styled_base_browser_esm("span", { 34311 target: "exqw8y212", 34312 label: "Tooltip" 34313 })("background:", COLORS.ui.border, ";border-radius:2px;box-sizing:border-box;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;", tooltipShow, ";", tooltipPosition, ";", reduceMotion('transition'), ";", rtl_rtl({ 34314 transform: 'translateX(-50%)' 34315 }, { 34316 transform: 'translateX(50%)' 34317 }), true ? "" : undefined); // @todo: Refactor RangeControl with latest HStack configuration 34318 // @wordpress/components/ui/hstack 34319 34320 const InputNumber = /*#__PURE__*/styled_base_browser_esm(number_control, { 34321 target: "exqw8y213", 34322 label: "InputNumber" 34323 })("box-sizing:border-box;display:inline-block;font-size:13px;margin-top:0;width:", space(8), " !important;input[type='number']&{", rangeHeight, ";}", rtl_rtl({ 34324 marginLeft: `${space(2)} !important` 34325 }), true ? "" : undefined); 34326 const ActionRightWrapper = styled_base_browser_esm("span", { 34327 target: "exqw8y214", 34328 label: "ActionRightWrapper" 34329 })("box-sizing:border-box;display:block;margin-top:0;button,button.is-small{margin-left:0;", rangeHeight, ";}", rtl_rtl({ 34330 marginLeft: 8 34331 }), true ? "" : undefined); 34332 34333 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/input-range.js 34334 34335 34336 34337 /** 34338 * External dependencies 34339 */ 34340 34341 /** 34342 * WordPress dependencies 34343 */ 34344 34345 34346 /** 34347 * Internal dependencies 34348 */ 34349 34350 34351 34352 34353 34354 function input_range_InputRange({ 34355 describedBy, 34356 isShiftStepEnabled = true, 34357 label, 34358 onHideTooltip = external_lodash_["noop"], 34359 onMouseLeave = external_lodash_["noop"], 34360 step = 1, 34361 onBlur = external_lodash_["noop"], 34362 onChange = external_lodash_["noop"], 34363 onFocus = external_lodash_["noop"], 34364 onMouseMove = external_lodash_["noop"], 34365 onShowTooltip = external_lodash_["noop"], 34366 shiftStep = 10, 34367 value, 34368 ...props 34369 }, ref) { 34370 const jumpStep = use_jump_step({ 34371 step, 34372 shiftStep, 34373 isShiftStepEnabled 34374 }); 34375 const hoverInteractions = useDebouncedHoverInteraction({ 34376 onHide: onHideTooltip, 34377 onMouseLeave, 34378 onMouseMove, 34379 onShow: onShowTooltip 34380 }); 34381 return Object(external_wp_element_["createElement"])(InputRange, Object(esm_extends["a" /* default */])({}, props, hoverInteractions, { 34382 "aria-describedby": describedBy, 34383 "aria-label": label, 34384 "aria-hidden": false, 34385 onBlur: onBlur, 34386 onChange: onChange, 34387 onFocus: onFocus, 34388 ref: ref, 34389 step: jumpStep, 34390 tabIndex: 0, 34391 type: "range", 34392 value: value 34393 })); 34394 } 34395 34396 const input_range_ForwardedComponent = Object(external_wp_element_["forwardRef"])(input_range_InputRange); 34397 /* harmony default export */ var input_range = (input_range_ForwardedComponent); 34398 34399 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/mark.js 34400 34401 34402 34403 /** 34404 * External dependencies 34405 */ 34406 34407 /** 34408 * Internal dependencies 34409 */ 34410 34411 34412 function RangeMark({ 34413 className, 34414 isFilled = false, 34415 label, 34416 style = {}, 34417 ...props 34418 }) { 34419 const classes = classnames_default()('components-range-control__mark', isFilled && 'is-filled', className); 34420 const labelClasses = classnames_default()('components-range-control__mark-label', isFilled && 'is-filled'); 34421 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(Mark, Object(esm_extends["a" /* default */])({}, props, { 34422 "aria-hidden": "true", 34423 className: classes, 34424 isFilled: isFilled, 34425 style: style 34426 })), label && Object(external_wp_element_["createElement"])(MarkLabel, { 34427 "aria-hidden": "true", 34428 className: labelClasses, 34429 isFilled: isFilled, 34430 style: style 34431 }, label)); 34432 } 34433 34434 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/rail.js 34435 34436 34437 34438 /** 34439 * WordPress dependencies 34440 */ 34441 34442 /** 34443 * Internal dependencies 34444 */ 34445 34446 34447 34448 function RangeRail({ 34449 disabled = false, 34450 marks = false, 34451 min = 0, 34452 max = 100, 34453 step = 1, 34454 value = 0, 34455 ...restProps 34456 }) { 34457 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(Rail, Object(esm_extends["a" /* default */])({ 34458 disabled: disabled 34459 }, restProps)), marks && Object(external_wp_element_["createElement"])(Marks, { 34460 disabled: disabled, 34461 marks: marks, 34462 min: min, 34463 max: max, 34464 step: step, 34465 value: value 34466 })); 34467 } 34468 34469 function Marks({ 34470 disabled = false, 34471 marks = false, 34472 min = 0, 34473 max = 100, 34474 step = 1, 34475 value = 0 34476 }) { 34477 const marksData = useMarks({ 34478 marks, 34479 min, 34480 max, 34481 step, 34482 value 34483 }); 34484 return Object(external_wp_element_["createElement"])(MarksWrapper, { 34485 "aria-hidden": "true", 34486 className: "components-range-control__marks" 34487 }, marksData.map(mark => Object(external_wp_element_["createElement"])(RangeMark, Object(esm_extends["a" /* default */])({}, mark, { 34488 key: mark.key, 34489 "aria-hidden": "true", 34490 disabled: disabled 34491 })))); 34492 } 34493 34494 function useMarks({ 34495 marks, 34496 min = 0, 34497 max = 100, 34498 step = 1, 34499 value = 0 34500 }) { 34501 if (!marks) { 34502 return []; 34503 } 34504 34505 const range = max - min; 34506 34507 if (!Array.isArray(marks)) { 34508 marks = []; 34509 const count = 1 + Math.round(range / step); 34510 34511 while (count > marks.push({ 34512 value: step * marks.length + min 34513 })); 34514 } 34515 34516 const placedMarks = []; 34517 marks.forEach((mark, index) => { 34518 if (mark.value < min || mark.value > max) { 34519 return; 34520 } 34521 34522 const key = `mark-${index}`; 34523 const isFilled = mark.value <= value; 34524 const offset = `${(mark.value - min) / range * 100}%`; 34525 const offsetStyle = { 34526 [Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left']: offset 34527 }; 34528 placedMarks.push({ ...mark, 34529 isFilled, 34530 key, 34531 style: offsetStyle 34532 }); 34533 }); 34534 return placedMarks; 34535 } 34536 34537 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/tooltip.js 34538 34539 34540 34541 /** 34542 * External dependencies 34543 */ 34544 34545 /** 34546 * WordPress dependencies 34547 */ 34548 34549 34550 /** 34551 * Internal dependencies 34552 */ 34553 34554 34555 const TOOLTIP_OFFSET_HEIGHT = 32; 34556 function SimpleTooltip({ 34557 className, 34558 inputRef, 34559 position: positionProp = 'auto', 34560 show = false, 34561 style = {}, 34562 value = 0, 34563 renderTooltipContent = v => v, 34564 zIndex = 100, 34565 ...restProps 34566 }) { 34567 const position = useTooltipPosition({ 34568 inputRef, 34569 position: positionProp 34570 }); 34571 const classes = classnames_default()('components-simple-tooltip', className); 34572 const styles = { ...style, 34573 zIndex 34574 }; 34575 return Object(external_wp_element_["createElement"])(range_control_styles_Tooltip, Object(esm_extends["a" /* default */])({}, restProps, { 34576 "aria-hidden": show, 34577 className: classes, 34578 position: position, 34579 show: show, 34580 role: "tooltip", 34581 style: styles 34582 }), renderTooltipContent(value)); 34583 } 34584 34585 function useTooltipPosition({ 34586 inputRef, 34587 position: positionProp 34588 }) { 34589 const [position, setPosition] = Object(external_wp_element_["useState"])('top'); 34590 const calculatePosition = Object(external_wp_element_["useCallback"])(() => { 34591 if (inputRef && inputRef.current) { 34592 let nextPosition = positionProp; 34593 34594 if (positionProp === 'auto') { 34595 const { 34596 top 34597 } = inputRef.current.getBoundingClientRect(); 34598 const isOffscreenTop = top - TOOLTIP_OFFSET_HEIGHT < 0; 34599 nextPosition = isOffscreenTop ? 'bottom' : 'top'; 34600 } 34601 34602 setPosition(nextPosition); 34603 } 34604 }, [positionProp]); 34605 Object(external_wp_element_["useEffect"])(() => { 34606 calculatePosition(); 34607 }, [calculatePosition]); 34608 Object(external_wp_element_["useEffect"])(() => { 34609 window.addEventListener('resize', calculatePosition); 34610 return () => { 34611 window.removeEventListener('resize', calculatePosition); 34612 }; 34613 }); 34614 return position; 34615 } 34616 34617 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/index.js 34618 34619 34620 34621 /** 34622 * External dependencies 34623 */ 34624 34625 34626 /** 34627 * WordPress dependencies 34628 */ 34629 34630 34631 34632 34633 /** 34634 * Internal dependencies 34635 */ 34636 34637 34638 34639 34640 34641 34642 34643 34644 34645 34646 34647 function RangeControl({ 34648 afterIcon, 34649 allowReset = false, 34650 beforeIcon, 34651 className, 34652 currentInput, 34653 color: colorProp = COLORS.ui.theme, 34654 disabled = false, 34655 help, 34656 initialPosition, 34657 isShiftStepEnabled = true, 34658 label, 34659 marks = false, 34660 max = 100, 34661 min = 0, 34662 onBlur = external_lodash_["noop"], 34663 onChange = external_lodash_["noop"], 34664 onFocus = external_lodash_["noop"], 34665 onMouseMove = external_lodash_["noop"], 34666 onMouseLeave = external_lodash_["noop"], 34667 railColor, 34668 resetFallbackValue, 34669 renderTooltipContent = v => v, 34670 showTooltip: showTooltipProp, 34671 shiftStep = 10, 34672 step = 1, 34673 trackColor, 34674 value: valueProp, 34675 withInputField = true, 34676 ...props 34677 }, ref) { 34678 var _inputRef$current; 34679 34680 const [value, setValue] = useControlledRangeValue({ 34681 min, 34682 max, 34683 value: valueProp, 34684 initial: initialPosition 34685 }); 34686 const isResetPendent = Object(external_wp_element_["useRef"])(false); 34687 const [showTooltip, setShowTooltip] = Object(external_wp_element_["useState"])(showTooltipProp); 34688 const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false); 34689 const inputRef = Object(external_wp_element_["useRef"])(); 34690 34691 const setRef = nodeRef => { 34692 inputRef.current = nodeRef; 34693 34694 if (ref) { 34695 ref(nodeRef); 34696 } 34697 }; 34698 34699 const isCurrentlyFocused = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.matches(':focus'); 34700 const isThumbFocused = !disabled && isFocused; 34701 const isValueReset = value === null; 34702 const currentValue = value !== undefined ? value : currentInput; 34703 const inputSliderValue = isValueReset ? '' : currentValue; 34704 const rangeFillValue = isValueReset ? (max - min) / 2 + min : value; 34705 const calculatedFillValue = (value - min) / (max - min) * 100; 34706 const fillValue = isValueReset ? 50 : calculatedFillValue; 34707 const fillValueOffset = `${Object(external_lodash_["clamp"])(fillValue, 0, 100)}%`; 34708 const classes = classnames_default()('components-range-control', className); 34709 const wrapperClasses = classnames_default()('components-range-control__wrapper', !!marks && 'is-marked'); 34710 const id = Object(external_wp_compose_["useInstanceId"])(RangeControl, 'inspector-range-control'); 34711 const describedBy = !!help ? `${id}__help` : undefined; 34712 const enableTooltip = showTooltipProp !== false && Object(external_lodash_["isFinite"])(value); 34713 34714 const handleOnRangeChange = event => { 34715 const nextValue = parseFloat(event.target.value); 34716 setValue(nextValue); 34717 onChange(nextValue); 34718 }; 34719 34720 const handleOnChange = nextValue => { 34721 nextValue = parseFloat(nextValue); 34722 setValue(nextValue); 34723 /* 34724 * Calls onChange only when nextValue is numeric 34725 * otherwise may queue a reset for the blur event. 34726 */ 34727 34728 if (!isNaN(nextValue)) { 34729 if (nextValue < min || nextValue > max) { 34730 nextValue = floatClamp(nextValue, min, max); 34731 } 34732 34733 onChange(nextValue); 34734 isResetPendent.current = false; 34735 } else if (allowReset) { 34736 isResetPendent.current = true; 34737 } 34738 }; 34739 34740 const handleOnInputNumberBlur = () => { 34741 if (isResetPendent.current) { 34742 handleOnReset(); 34743 isResetPendent.current = false; 34744 } 34745 }; 34746 34747 const handleOnReset = () => { 34748 let resetValue = parseFloat(resetFallbackValue); 34749 let onChangeResetValue = resetValue; 34750 34751 if (isNaN(resetValue)) { 34752 resetValue = null; 34753 onChangeResetValue = undefined; 34754 } 34755 34756 setValue(resetValue); 34757 /** 34758 * Previously, this callback would always receive undefined as 34759 * an argument. This behavior is unexpected, specifically 34760 * when resetFallbackValue is defined. 34761 * 34762 * The value of undefined is not ideal. Passing it through 34763 * to internal <input /> elements would change it from a 34764 * controlled component to an uncontrolled component. 34765 * 34766 * For now, to minimize unexpected regressions, we're going to 34767 * preserve the undefined callback argument, except when a 34768 * resetFallbackValue is defined. 34769 */ 34770 34771 onChange(onChangeResetValue); 34772 }; 34773 34774 const handleShowTooltip = () => setShowTooltip(true); 34775 34776 const handleHideTooltip = () => setShowTooltip(false); 34777 34778 const handleOnBlur = event => { 34779 onBlur(event); 34780 setIsFocused(false); 34781 handleHideTooltip(); 34782 }; 34783 34784 const handleOnFocus = event => { 34785 onFocus(event); 34786 setIsFocused(true); 34787 handleShowTooltip(); 34788 }; 34789 34790 const offsetStyle = { 34791 [Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left']: fillValueOffset 34792 }; 34793 return Object(external_wp_element_["createElement"])(base_control, { 34794 className: classes, 34795 label: label, 34796 id: id, 34797 help: help 34798 }, Object(external_wp_element_["createElement"])(range_control_styles_Root, { 34799 className: "components-range-control__root" 34800 }, beforeIcon && Object(external_wp_element_["createElement"])(BeforeIconWrapper, null, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 34801 icon: beforeIcon 34802 })), Object(external_wp_element_["createElement"])(range_control_styles_Wrapper, { 34803 className: wrapperClasses, 34804 color: colorProp, 34805 marks: !!marks 34806 }, Object(external_wp_element_["createElement"])(input_range, Object(esm_extends["a" /* default */])({}, props, { 34807 className: "components-range-control__slider", 34808 describedBy: describedBy, 34809 disabled: disabled, 34810 id: id, 34811 isShiftStepEnabled: isShiftStepEnabled, 34812 label: label, 34813 max: max, 34814 min: min, 34815 onBlur: handleOnBlur, 34816 onChange: handleOnRangeChange, 34817 onFocus: handleOnFocus, 34818 onMouseMove: onMouseMove, 34819 onMouseLeave: onMouseLeave, 34820 ref: setRef, 34821 shiftStep: shiftStep, 34822 step: step, 34823 value: inputSliderValue 34824 })), Object(external_wp_element_["createElement"])(RangeRail, { 34825 "aria-hidden": true, 34826 disabled: disabled, 34827 marks: marks, 34828 max: max, 34829 min: min, 34830 railColor: railColor, 34831 step: step, 34832 value: rangeFillValue 34833 }), Object(external_wp_element_["createElement"])(Track, { 34834 "aria-hidden": true, 34835 className: "components-range-control__track", 34836 disabled: disabled, 34837 style: { 34838 width: fillValueOffset 34839 }, 34840 trackColor: trackColor 34841 }), Object(external_wp_element_["createElement"])(ThumbWrapper, { 34842 style: offsetStyle 34843 }, Object(external_wp_element_["createElement"])(Thumb, { 34844 "aria-hidden": true, 34845 isFocused: isThumbFocused 34846 })), enableTooltip && Object(external_wp_element_["createElement"])(SimpleTooltip, { 34847 className: "components-range-control__tooltip", 34848 inputRef: inputRef, 34849 renderTooltipContent: renderTooltipContent, 34850 show: isCurrentlyFocused || showTooltip, 34851 style: offsetStyle, 34852 value: value 34853 })), afterIcon && Object(external_wp_element_["createElement"])(AfterIconWrapper, null, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 34854 icon: afterIcon 34855 })), withInputField && Object(external_wp_element_["createElement"])(InputNumber, { 34856 "aria-label": label, 34857 className: "components-range-control__number", 34858 disabled: disabled, 34859 inputMode: "decimal", 34860 isShiftStepEnabled: isShiftStepEnabled, 34861 max: max, 34862 min: min, 34863 onBlur: handleOnInputNumberBlur, 34864 onChange: handleOnChange, 34865 shiftStep: shiftStep, 34866 step: step, 34867 value: inputSliderValue 34868 }), allowReset && Object(external_wp_element_["createElement"])(ActionRightWrapper, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 34869 className: "components-range-control__reset", 34870 disabled: disabled || value === undefined, 34871 isSecondary: true, 34872 isSmall: true, 34873 onClick: handleOnReset 34874 }, Object(external_wp_i18n_["__"])('Reset'))))); 34875 } 34876 34877 const range_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(RangeControl); 34878 /* harmony default export */ var range_control = (range_control_ForwardedComponent); 34879 34880 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/index.js 34881 34882 34883 34884 /** 34885 * External dependencies 34886 */ 34887 34888 /** 34889 * WordPress dependencies 34890 */ 34891 34892 34893 34894 34895 /** 34896 * Internal dependencies 34897 */ 34898 34899 34900 34901 34902 34903 34904 const DEFAULT_FONT_SIZE = 'default'; 34905 const CUSTOM_FONT_SIZE = 'custom'; 34906 const MAX_FONT_SIZE_DISPLAY = '25px'; 34907 34908 function getSelectValueFromFontSize(fontSizes, value) { 34909 if (value) { 34910 const fontSizeValue = fontSizes.find(font => font.size === value); 34911 return fontSizeValue ? fontSizeValue.slug : CUSTOM_FONT_SIZE; 34912 } 34913 34914 return DEFAULT_FONT_SIZE; 34915 } 34916 34917 function getSelectOptions(optionsArray, disableCustomFontSizes) { 34918 if (disableCustomFontSizes && !optionsArray.length) { 34919 return null; 34920 } 34921 34922 optionsArray = [{ 34923 slug: DEFAULT_FONT_SIZE, 34924 name: Object(external_wp_i18n_["__"])('Default') 34925 }, ...optionsArray, ...(disableCustomFontSizes ? [] : [{ 34926 slug: CUSTOM_FONT_SIZE, 34927 name: Object(external_wp_i18n_["__"])('Custom') 34928 }])]; 34929 return optionsArray.map(option => ({ 34930 key: option.slug, 34931 name: option.name, 34932 size: option.size, 34933 style: { 34934 fontSize: `min( ${option.size}, ${MAX_FONT_SIZE_DISPLAY} )` 34935 } 34936 })); 34937 } 34938 34939 function FontSizePicker({ 34940 fallbackFontSize, 34941 fontSizes = [], 34942 disableCustomFontSizes = false, 34943 onChange, 34944 value, 34945 withSlider = false 34946 }, ref) { 34947 const hasUnits = Object(external_lodash_["isString"])(value) || fontSizes[0] && Object(external_lodash_["isString"])(fontSizes[0].size); 34948 let noUnitsValue; 34949 34950 if (!hasUnits) { 34951 noUnitsValue = value; 34952 } else { 34953 noUnitsValue = parseInt(value); 34954 } 34955 34956 const isPixelValue = Object(external_lodash_["isNumber"])(value) || Object(external_lodash_["isString"])(value) && value.endsWith('px'); 34957 const units = useCustomUnits({ 34958 availableUnits: ['px', 'em', 'rem'] 34959 }); 34960 const options = Object(external_wp_element_["useMemo"])(() => getSelectOptions(fontSizes, disableCustomFontSizes), [fontSizes, disableCustomFontSizes]); 34961 34962 if (!options) { 34963 return null; 34964 } 34965 34966 const selectedFontSizeSlug = getSelectValueFromFontSize(fontSizes, value); 34967 return Object(external_wp_element_["createElement"])("fieldset", Object(esm_extends["a" /* default */])({ 34968 className: "components-font-size-picker" 34969 }, ref ? {} : { 34970 ref 34971 }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 34972 as: "legend" 34973 }, Object(external_wp_i18n_["__"])('Font size')), Object(external_wp_element_["createElement"])("div", { 34974 className: "components-font-size-picker__controls" 34975 }, fontSizes.length > 0 && Object(external_wp_element_["createElement"])(CustomSelectControl, { 34976 className: 'components-font-size-picker__select', 34977 label: Object(external_wp_i18n_["__"])('Font size'), 34978 options: options, 34979 value: options.find(option => option.key === selectedFontSizeSlug), 34980 onChange: ({ 34981 selectedItem 34982 }) => { 34983 if (hasUnits) { 34984 onChange(selectedItem.size); 34985 } else { 34986 onChange(Number(selectedItem.size)); 34987 } 34988 } 34989 }), !withSlider && !disableCustomFontSizes && Object(external_wp_element_["createElement"])(unit_control, { 34990 label: Object(external_wp_i18n_["__"])('Custom'), 34991 labelPosition: "top", 34992 __unstableInputWidth: "60px", 34993 value: value, 34994 onChange: nextSize => { 34995 if (0 === parseFloat(nextSize) || !nextSize) { 34996 onChange(undefined); 34997 } else { 34998 onChange(hasUnits ? nextSize : parseInt(nextSize, 10)); 34999 } 35000 }, 35001 units: hasUnits ? units : false 35002 }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 35003 className: "components-color-palette__clear", 35004 disabled: value === undefined, 35005 onClick: () => { 35006 onChange(undefined); 35007 }, 35008 isSmall: true, 35009 isSecondary: true 35010 }, Object(external_wp_i18n_["__"])('Reset'))), withSlider && Object(external_wp_element_["createElement"])(range_control, { 35011 className: "components-font-size-picker__custom-input", 35012 label: Object(external_wp_i18n_["__"])('Custom Size'), 35013 value: isPixelValue && noUnitsValue || '', 35014 initialPosition: fallbackFontSize, 35015 onChange: newValue => { 35016 onChange(hasUnits ? newValue + 'px' : newValue); 35017 }, 35018 min: 12, 35019 max: 100, 35020 beforeIcon: text_color["a" /* default */], 35021 afterIcon: text_color["a" /* default */] 35022 })); 35023 } 35024 35025 /* harmony default export */ var font_size_picker = (Object(external_wp_element_["forwardRef"])(FontSizePicker)); 35026 35027 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-file-upload/index.js 35028 35029 35030 35031 /** 35032 * WordPress dependencies 35033 */ 35034 35035 /** 35036 * Internal dependencies 35037 */ 35038 35039 35040 35041 function FormFileUpload({ 35042 accept, 35043 children, 35044 multiple = false, 35045 onChange, 35046 render, 35047 ...props 35048 }) { 35049 const ref = Object(external_wp_element_["useRef"])(); 35050 35051 const openFileDialog = () => { 35052 ref.current.click(); 35053 }; 35054 35055 const ui = render ? render({ 35056 openFileDialog 35057 }) : Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 35058 onClick: openFileDialog 35059 }, props), children); 35060 return Object(external_wp_element_["createElement"])("div", { 35061 className: "components-form-file-upload" 35062 }, ui, Object(external_wp_element_["createElement"])("input", { 35063 type: "file", 35064 ref: ref, 35065 multiple: multiple, 35066 style: { 35067 display: 'none' 35068 }, 35069 accept: accept, 35070 onChange: onChange 35071 })); 35072 } 35073 35074 /* harmony default export */ var form_file_upload = (FormFileUpload); 35075 35076 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-toggle/index.js 35077 35078 35079 35080 /** 35081 * External dependencies 35082 */ 35083 35084 35085 35086 function FormToggle({ 35087 className, 35088 checked, 35089 id, 35090 disabled, 35091 onChange = external_lodash_["noop"], 35092 ...props 35093 }) { 35094 const wrapperClasses = classnames_default()('components-form-toggle', className, { 35095 'is-checked': checked, 35096 'is-disabled': disabled 35097 }); 35098 return Object(external_wp_element_["createElement"])("span", { 35099 className: wrapperClasses 35100 }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({ 35101 className: "components-form-toggle__input", 35102 id: id, 35103 type: "checkbox", 35104 checked: checked, 35105 onChange: onChange, 35106 disabled: disabled 35107 }, props)), Object(external_wp_element_["createElement"])("span", { 35108 className: "components-form-toggle__track" 35109 }), Object(external_wp_element_["createElement"])("span", { 35110 className: "components-form-toggle__thumb" 35111 })); 35112 } 35113 35114 /* harmony default export */ var form_toggle = (FormToggle); 35115 35116 // EXTERNAL MODULE: external ["wp","isShallowEqual"] 35117 var external_wp_isShallowEqual_ = __webpack_require__("rl8x"); 35118 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_); 35119 35120 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token.js 35121 35122 35123 /** 35124 * External dependencies 35125 */ 35126 35127 35128 /** 35129 * WordPress dependencies 35130 */ 35131 35132 35133 35134 35135 /** 35136 * Internal dependencies 35137 */ 35138 35139 35140 35141 function Token({ 35142 value, 35143 status, 35144 title, 35145 displayTransform, 35146 isBorderless = false, 35147 disabled = false, 35148 onClickRemove = external_lodash_["noop"], 35149 onMouseEnter, 35150 onMouseLeave, 35151 messages, 35152 termPosition, 35153 termsCount 35154 }) { 35155 const instanceId = Object(external_wp_compose_["useInstanceId"])(Token); 35156 const tokenClasses = classnames_default()('components-form-token-field__token', { 35157 'is-error': 'error' === status, 35158 'is-success': 'success' === status, 35159 'is-validating': 'validating' === status, 35160 'is-borderless': isBorderless, 35161 'is-disabled': disabled 35162 }); 35163 35164 const onClick = () => onClickRemove({ 35165 value 35166 }); 35167 35168 const transformedValue = displayTransform(value); 35169 const termPositionAndCount = Object(external_wp_i18n_["sprintf"])( 35170 /* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */ 35171 Object(external_wp_i18n_["__"])('%1$s (%2$s of %3$s)'), transformedValue, termPosition, termsCount); 35172 return Object(external_wp_element_["createElement"])("span", { 35173 className: tokenClasses, 35174 onMouseEnter: onMouseEnter, 35175 onMouseLeave: onMouseLeave, 35176 title: title 35177 }, Object(external_wp_element_["createElement"])("span", { 35178 className: "components-form-token-field__token-text", 35179 id: `components-form-token-field__token-text-${instanceId}` 35180 }, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 35181 as: "span" 35182 }, termPositionAndCount), Object(external_wp_element_["createElement"])("span", { 35183 "aria-hidden": "true" 35184 }, transformedValue)), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 35185 className: "components-form-token-field__remove-token", 35186 icon: close_small["a" /* default */], 35187 onClick: !disabled && onClick, 35188 label: messages.remove, 35189 "aria-describedby": `components-form-token-field__token-text-${instanceId}` 35190 })); 35191 } 35192 35193 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js 35194 35195 35196 35197 /** 35198 * WordPress dependencies 35199 */ 35200 35201 35202 /** 35203 * A Higher Order Component used to be provide speak and debounced speak 35204 * functions. 35205 * 35206 * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak 35207 * 35208 * @param {WPComponent} Component The component to be wrapped. 35209 * 35210 * @return {WPComponent} The wrapped component. 35211 */ 35212 35213 /* harmony default export */ var with_spoken_messages = (Object(external_wp_compose_["createHigherOrderComponent"])(Component => props => Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({}, props, { 35214 speak: external_wp_a11y_["speak"], 35215 debouncedSpeak: Object(external_wp_compose_["useDebounce"])(external_wp_a11y_["speak"], 500) 35216 })), 'withSpokenMessages')); 35217 35218 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/index.js 35219 35220 35221 /** 35222 * External dependencies 35223 */ 35224 35225 35226 /** 35227 * WordPress dependencies 35228 */ 35229 35230 35231 35232 35233 35234 35235 /** 35236 * Internal dependencies 35237 */ 35238 35239 35240 35241 35242 35243 const form_token_field_initialState = { 35244 incompleteTokenValue: '', 35245 inputOffsetFromEnd: 0, 35246 isActive: false, 35247 isExpanded: false, 35248 selectedSuggestionIndex: -1, 35249 selectedSuggestionScroll: false 35250 }; 35251 35252 class form_token_field_FormTokenField extends external_wp_element_["Component"] { 35253 constructor() { 35254 super(...arguments); 35255 this.state = form_token_field_initialState; 35256 this.onKeyDown = this.onKeyDown.bind(this); 35257 this.onKeyPress = this.onKeyPress.bind(this); 35258 this.onFocus = this.onFocus.bind(this); 35259 this.onBlur = this.onBlur.bind(this); 35260 this.deleteTokenBeforeInput = this.deleteTokenBeforeInput.bind(this); 35261 this.deleteTokenAfterInput = this.deleteTokenAfterInput.bind(this); 35262 this.addCurrentToken = this.addCurrentToken.bind(this); 35263 this.onContainerTouched = this.onContainerTouched.bind(this); 35264 this.renderToken = this.renderToken.bind(this); 35265 this.onTokenClickRemove = this.onTokenClickRemove.bind(this); 35266 this.onSuggestionHovered = this.onSuggestionHovered.bind(this); 35267 this.onSuggestionSelected = this.onSuggestionSelected.bind(this); 35268 this.onInputChange = this.onInputChange.bind(this); 35269 this.bindInput = this.bindInput.bind(this); 35270 this.bindTokensAndInput = this.bindTokensAndInput.bind(this); 35271 this.updateSuggestions = this.updateSuggestions.bind(this); 35272 } 35273 35274 componentDidUpdate(prevProps) { 35275 // Make sure to focus the input when the isActive state is true. 35276 if (this.state.isActive && !this.input.hasFocus()) { 35277 this.input.focus(); 35278 } 35279 35280 const { 35281 suggestions, 35282 value 35283 } = this.props; 35284 const suggestionsDidUpdate = !external_wp_isShallowEqual_default()(suggestions, prevProps.suggestions); 35285 35286 if (suggestionsDidUpdate || value !== prevProps.value) { 35287 this.updateSuggestions(suggestionsDidUpdate); 35288 } 35289 } 35290 35291 static getDerivedStateFromProps(props, state) { 35292 if (!props.disabled || !state.isActive) { 35293 return null; 35294 } 35295 35296 return { 35297 isActive: false, 35298 incompleteTokenValue: '' 35299 }; 35300 } 35301 35302 bindInput(ref) { 35303 this.input = ref; 35304 } 35305 35306 bindTokensAndInput(ref) { 35307 this.tokensAndInput = ref; 35308 } 35309 35310 onFocus(event) { 35311 const { 35312 __experimentalExpandOnFocus 35313 } = this.props; // If focus is on the input or on the container, set the isActive state to true. 35314 35315 if (this.input.hasFocus() || event.target === this.tokensAndInput) { 35316 this.setState({ 35317 isActive: true, 35318 isExpanded: !!__experimentalExpandOnFocus || this.state.isExpanded 35319 }); 35320 } else { 35321 /* 35322 * Otherwise, focus is on one of the token "remove" buttons and we 35323 * set the isActive state to false to prevent the input to be 35324 * re-focused, see componentDidUpdate(). 35325 */ 35326 this.setState({ 35327 isActive: false 35328 }); 35329 } 35330 35331 if ('function' === typeof this.props.onFocus) { 35332 this.props.onFocus(event); 35333 } 35334 } 35335 35336 onBlur() { 35337 if (this.inputHasValidValue()) { 35338 this.setState({ 35339 isActive: false 35340 }); 35341 } else { 35342 this.setState(form_token_field_initialState); 35343 } 35344 } 35345 35346 onKeyDown(event) { 35347 let preventDefault = false; 35348 35349 switch (event.keyCode) { 35350 case external_wp_keycodes_["BACKSPACE"]: 35351 preventDefault = this.handleDeleteKey(this.deleteTokenBeforeInput); 35352 break; 35353 35354 case external_wp_keycodes_["ENTER"]: 35355 preventDefault = this.addCurrentToken(); 35356 break; 35357 35358 case external_wp_keycodes_["LEFT"]: 35359 preventDefault = this.handleLeftArrowKey(); 35360 break; 35361 35362 case external_wp_keycodes_["UP"]: 35363 preventDefault = this.handleUpArrowKey(); 35364 break; 35365 35366 case external_wp_keycodes_["RIGHT"]: 35367 preventDefault = this.handleRightArrowKey(); 35368 break; 35369 35370 case external_wp_keycodes_["DOWN"]: 35371 preventDefault = this.handleDownArrowKey(); 35372 break; 35373 35374 case external_wp_keycodes_["DELETE"]: 35375 preventDefault = this.handleDeleteKey(this.deleteTokenAfterInput); 35376 break; 35377 35378 case external_wp_keycodes_["SPACE"]: 35379 if (this.props.tokenizeOnSpace) { 35380 preventDefault = this.addCurrentToken(); 35381 } 35382 35383 break; 35384 35385 case external_wp_keycodes_["ESCAPE"]: 35386 preventDefault = this.handleEscapeKey(event); 35387 event.stopPropagation(); 35388 break; 35389 35390 default: 35391 break; 35392 } 35393 35394 if (preventDefault) { 35395 event.preventDefault(); 35396 } 35397 } 35398 35399 onKeyPress(event) { 35400 let preventDefault = false; 35401 35402 switch (event.charCode) { 35403 case 44: 35404 // comma 35405 preventDefault = this.handleCommaKey(); 35406 break; 35407 35408 default: 35409 break; 35410 } 35411 35412 if (preventDefault) { 35413 event.preventDefault(); 35414 } 35415 } 35416 35417 onContainerTouched(event) { 35418 // Prevent clicking/touching the tokensAndInput container from blurring 35419 // the input and adding the current token. 35420 if (event.target === this.tokensAndInput && this.state.isActive) { 35421 event.preventDefault(); 35422 } 35423 } 35424 35425 onTokenClickRemove(event) { 35426 this.deleteToken(event.value); 35427 this.input.focus(); 35428 } 35429 35430 onSuggestionHovered(suggestion) { 35431 const index = this.getMatchingSuggestions().indexOf(suggestion); 35432 35433 if (index >= 0) { 35434 this.setState({ 35435 selectedSuggestionIndex: index, 35436 selectedSuggestionScroll: false 35437 }); 35438 } 35439 } 35440 35441 onSuggestionSelected(suggestion) { 35442 this.addNewToken(suggestion); 35443 } 35444 35445 onInputChange(event) { 35446 const text = event.value; 35447 const separator = this.props.tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/; 35448 const items = text.split(separator); 35449 const tokenValue = Object(external_lodash_["last"])(items) || ''; 35450 35451 if (items.length > 1) { 35452 this.addNewTokens(items.slice(0, -1)); 35453 } 35454 35455 this.setState({ 35456 incompleteTokenValue: tokenValue 35457 }, this.updateSuggestions); 35458 this.props.onInputChange(tokenValue); 35459 } 35460 35461 handleDeleteKey(deleteToken) { 35462 let preventDefault = false; 35463 35464 if (this.input.hasFocus() && this.isInputEmpty()) { 35465 deleteToken(); 35466 preventDefault = true; 35467 } 35468 35469 return preventDefault; 35470 } 35471 35472 handleLeftArrowKey() { 35473 let preventDefault = false; 35474 35475 if (this.isInputEmpty()) { 35476 this.moveInputBeforePreviousToken(); 35477 preventDefault = true; 35478 } 35479 35480 return preventDefault; 35481 } 35482 35483 handleRightArrowKey() { 35484 let preventDefault = false; 35485 35486 if (this.isInputEmpty()) { 35487 this.moveInputAfterNextToken(); 35488 preventDefault = true; 35489 } 35490 35491 return preventDefault; 35492 } 35493 35494 handleUpArrowKey() { 35495 this.setState((state, props) => ({ 35496 selectedSuggestionIndex: (state.selectedSuggestionIndex === 0 ? this.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length : state.selectedSuggestionIndex) - 1, 35497 selectedSuggestionScroll: true 35498 })); 35499 return true; // preventDefault 35500 } 35501 35502 handleDownArrowKey() { 35503 this.setState((state, props) => ({ 35504 selectedSuggestionIndex: (state.selectedSuggestionIndex + 1) % this.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length, 35505 selectedSuggestionScroll: true 35506 })); 35507 return true; // preventDefault 35508 } 35509 35510 handleEscapeKey(event) { 35511 this.setState({ 35512 incompleteTokenValue: event.target.value, 35513 isExpanded: false, 35514 selectedSuggestionIndex: -1, 35515 selectedSuggestionScroll: false 35516 }); 35517 return true; // preventDefault 35518 } 35519 35520 handleCommaKey() { 35521 if (this.inputHasValidValue()) { 35522 this.addNewToken(this.state.incompleteTokenValue); 35523 } 35524 35525 return true; // preventDefault 35526 } 35527 35528 moveInputToIndex(index) { 35529 this.setState((state, props) => ({ 35530 inputOffsetFromEnd: props.value.length - Math.max(index, -1) - 1 35531 })); 35532 } 35533 35534 moveInputBeforePreviousToken() { 35535 this.setState((state, props) => ({ 35536 inputOffsetFromEnd: Math.min(state.inputOffsetFromEnd + 1, props.value.length) 35537 })); 35538 } 35539 35540 moveInputAfterNextToken() { 35541 this.setState(state => ({ 35542 inputOffsetFromEnd: Math.max(state.inputOffsetFromEnd - 1, 0) 35543 })); 35544 } 35545 35546 deleteTokenBeforeInput() { 35547 const index = this.getIndexOfInput() - 1; 35548 35549 if (index > -1) { 35550 this.deleteToken(this.props.value[index]); 35551 } 35552 } 35553 35554 deleteTokenAfterInput() { 35555 const index = this.getIndexOfInput(); 35556 35557 if (index < this.props.value.length) { 35558 this.deleteToken(this.props.value[index]); // update input offset since it's the offset from the last token 35559 35560 this.moveInputToIndex(index); 35561 } 35562 } 35563 35564 addCurrentToken() { 35565 let preventDefault = false; 35566 const selectedSuggestion = this.getSelectedSuggestion(); 35567 35568 if (selectedSuggestion) { 35569 this.addNewToken(selectedSuggestion); 35570 preventDefault = true; 35571 } else if (this.inputHasValidValue()) { 35572 this.addNewToken(this.state.incompleteTokenValue); 35573 preventDefault = true; 35574 } 35575 35576 return preventDefault; 35577 } 35578 35579 addNewTokens(tokens) { 35580 const tokensToAdd = Object(external_lodash_["uniq"])(tokens.map(this.props.saveTransform).filter(Boolean).filter(token => !this.valueContainsToken(token))); 35581 35582 if (tokensToAdd.length > 0) { 35583 const newValue = Object(external_lodash_["clone"])(this.props.value); 35584 newValue.splice.apply(newValue, [this.getIndexOfInput(), 0].concat(tokensToAdd)); 35585 this.props.onChange(newValue); 35586 } 35587 } 35588 35589 addNewToken(token) { 35590 const { 35591 __experimentalExpandOnFocus, 35592 __experimentalValidateInput 35593 } = this.props; 35594 35595 if (!__experimentalValidateInput(token)) { 35596 this.props.speak(this.props.messages.__experimentalInvalid, 'assertive'); 35597 return; 35598 } 35599 35600 this.addNewTokens([token]); 35601 this.props.speak(this.props.messages.added, 'assertive'); 35602 this.setState({ 35603 incompleteTokenValue: '', 35604 selectedSuggestionIndex: -1, 35605 selectedSuggestionScroll: false, 35606 isExpanded: !__experimentalExpandOnFocus 35607 }); 35608 35609 if (this.state.isActive) { 35610 this.input.focus(); 35611 } 35612 } 35613 35614 deleteToken(token) { 35615 const newTokens = this.props.value.filter(item => { 35616 return this.getTokenValue(item) !== this.getTokenValue(token); 35617 }); 35618 this.props.onChange(newTokens); 35619 this.props.speak(this.props.messages.removed, 'assertive'); 35620 } 35621 35622 getTokenValue(token) { 35623 if ('object' === typeof token) { 35624 return token.value; 35625 } 35626 35627 return token; 35628 } 35629 35630 getMatchingSuggestions(searchValue = this.state.incompleteTokenValue, suggestions = this.props.suggestions, value = this.props.value, maxSuggestions = this.props.maxSuggestions, saveTransform = this.props.saveTransform) { 35631 let match = saveTransform(searchValue); 35632 const startsWithMatch = []; 35633 const containsMatch = []; 35634 35635 if (match.length === 0) { 35636 suggestions = Object(external_lodash_["difference"])(suggestions, value); 35637 } else { 35638 match = match.toLocaleLowerCase(); 35639 Object(external_lodash_["each"])(suggestions, suggestion => { 35640 const index = suggestion.toLocaleLowerCase().indexOf(match); 35641 35642 if (value.indexOf(suggestion) === -1) { 35643 if (index === 0) { 35644 startsWithMatch.push(suggestion); 35645 } else if (index > 0) { 35646 containsMatch.push(suggestion); 35647 } 35648 } 35649 }); 35650 suggestions = startsWithMatch.concat(containsMatch); 35651 } 35652 35653 return Object(external_lodash_["take"])(suggestions, maxSuggestions); 35654 } 35655 35656 getSelectedSuggestion() { 35657 if (this.state.selectedSuggestionIndex !== -1) { 35658 return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex]; 35659 } 35660 } 35661 35662 valueContainsToken(token) { 35663 return Object(external_lodash_["some"])(this.props.value, item => { 35664 return this.getTokenValue(token) === this.getTokenValue(item); 35665 }); 35666 } 35667 35668 getIndexOfInput() { 35669 return this.props.value.length - this.state.inputOffsetFromEnd; 35670 } 35671 35672 isInputEmpty() { 35673 return this.state.incompleteTokenValue.length === 0; 35674 } 35675 35676 inputHasValidValue() { 35677 return this.props.saveTransform(this.state.incompleteTokenValue).length > 0; 35678 } 35679 35680 updateSuggestions(resetSelectedSuggestion = true) { 35681 const { 35682 __experimentalExpandOnFocus 35683 } = this.props; 35684 const { 35685 incompleteTokenValue 35686 } = this.state; 35687 const inputHasMinimumChars = incompleteTokenValue.trim().length > 1; 35688 const matchingSuggestions = this.getMatchingSuggestions(incompleteTokenValue); 35689 const hasMatchingSuggestions = matchingSuggestions.length > 0; 35690 const newState = { 35691 isExpanded: __experimentalExpandOnFocus || inputHasMinimumChars && hasMatchingSuggestions 35692 }; 35693 35694 if (resetSelectedSuggestion) { 35695 newState.selectedSuggestionIndex = -1; 35696 newState.selectedSuggestionScroll = false; 35697 } 35698 35699 this.setState(newState); 35700 35701 if (inputHasMinimumChars) { 35702 const { 35703 debouncedSpeak 35704 } = this.props; 35705 const message = hasMatchingSuggestions ? Object(external_wp_i18n_["sprintf"])( 35706 /* translators: %d: number of results. */ 35707 Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_wp_i18n_["__"])('No results.'); 35708 debouncedSpeak(message, 'assertive'); 35709 } 35710 } 35711 35712 renderTokensAndInput() { 35713 const components = Object(external_lodash_["map"])(this.props.value, this.renderToken); 35714 components.splice(this.getIndexOfInput(), 0, this.renderInput()); 35715 return components; 35716 } 35717 35718 renderToken(token, index, tokens) { 35719 const value = this.getTokenValue(token); 35720 const status = token.status ? token.status : undefined; 35721 const termPosition = index + 1; 35722 const termsCount = tokens.length; 35723 return Object(external_wp_element_["createElement"])(Token, { 35724 key: 'token-' + value, 35725 value: value, 35726 status: status, 35727 title: token.title, 35728 displayTransform: this.props.displayTransform, 35729 onClickRemove: this.onTokenClickRemove, 35730 isBorderless: token.isBorderless || this.props.isBorderless, 35731 onMouseEnter: token.onMouseEnter, 35732 onMouseLeave: token.onMouseLeave, 35733 disabled: 'error' !== status && this.props.disabled, 35734 messages: this.props.messages, 35735 termsCount: termsCount, 35736 termPosition: termPosition 35737 }); 35738 } 35739 35740 renderInput() { 35741 const { 35742 autoCapitalize, 35743 autoComplete, 35744 maxLength, 35745 placeholder, 35746 value, 35747 instanceId 35748 } = this.props; 35749 let props = { 35750 instanceId, 35751 autoCapitalize, 35752 autoComplete, 35753 placeholder: value.length === 0 ? placeholder : '', 35754 ref: this.bindInput, 35755 key: 'input', 35756 disabled: this.props.disabled, 35757 value: this.state.incompleteTokenValue, 35758 onBlur: this.onBlur, 35759 isExpanded: this.state.isExpanded, 35760 selectedSuggestionIndex: this.state.selectedSuggestionIndex 35761 }; 35762 35763 if (!(maxLength && value.length >= maxLength)) { 35764 props = { ...props, 35765 onChange: this.onInputChange 35766 }; 35767 } 35768 35769 return Object(external_wp_element_["createElement"])(token_input, props); 35770 } 35771 35772 render() { 35773 const { 35774 disabled, 35775 label = Object(external_wp_i18n_["__"])('Add item'), 35776 instanceId, 35777 className, 35778 __experimentalShowHowTo 35779 } = this.props; 35780 const { 35781 isExpanded 35782 } = this.state; 35783 const classes = classnames_default()(className, 'components-form-token-field__input-container', { 35784 'is-active': this.state.isActive, 35785 'is-disabled': disabled 35786 }); 35787 let tokenFieldProps = { 35788 className: 'components-form-token-field', 35789 tabIndex: '-1' 35790 }; 35791 const matchingSuggestions = this.getMatchingSuggestions(); 35792 35793 if (!disabled) { 35794 tokenFieldProps = Object.assign({}, tokenFieldProps, { 35795 onKeyDown: this.onKeyDown, 35796 onKeyPress: this.onKeyPress, 35797 onFocus: this.onFocus 35798 }); 35799 } // Disable reason: There is no appropriate role which describes the 35800 // input container intended accessible usability. 35801 // TODO: Refactor click detection to use blur to stop propagation. 35802 35803 /* eslint-disable jsx-a11y/no-static-element-interactions */ 35804 35805 35806 return Object(external_wp_element_["createElement"])("div", tokenFieldProps, Object(external_wp_element_["createElement"])("label", { 35807 htmlFor: `components-form-token-input-${instanceId}`, 35808 className: "components-form-token-field__label" 35809 }, label), Object(external_wp_element_["createElement"])("div", { 35810 ref: this.bindTokensAndInput, 35811 className: classes, 35812 tabIndex: "-1", 35813 onMouseDown: this.onContainerTouched, 35814 onTouchStart: this.onContainerTouched 35815 }, this.renderTokensAndInput(), isExpanded && Object(external_wp_element_["createElement"])(suggestions_list, { 35816 instanceId: instanceId, 35817 match: this.props.saveTransform(this.state.incompleteTokenValue), 35818 displayTransform: this.props.displayTransform, 35819 suggestions: matchingSuggestions, 35820 selectedIndex: this.state.selectedSuggestionIndex, 35821 scrollIntoView: this.state.selectedSuggestionScroll, 35822 onHover: this.onSuggestionHovered, 35823 onSelect: this.onSuggestionSelected 35824 })), __experimentalShowHowTo && Object(external_wp_element_["createElement"])("p", { 35825 id: `components-form-token-suggestions-howto-${instanceId}`, 35826 className: "components-form-token-field__help" 35827 }, this.props.tokenizeOnSpace ? Object(external_wp_i18n_["__"])('Separate with commas, spaces, or the Enter key.') : Object(external_wp_i18n_["__"])('Separate with commas or the Enter key.'))); 35828 /* eslint-enable jsx-a11y/no-static-element-interactions */ 35829 } 35830 35831 } 35832 35833 form_token_field_FormTokenField.defaultProps = { 35834 suggestions: Object.freeze([]), 35835 maxSuggestions: 100, 35836 value: Object.freeze([]), 35837 displayTransform: external_lodash_["identity"], 35838 saveTransform: token => token.trim(), 35839 onChange: () => {}, 35840 onInputChange: () => {}, 35841 isBorderless: false, 35842 disabled: false, 35843 tokenizeOnSpace: false, 35844 messages: { 35845 added: Object(external_wp_i18n_["__"])('Item added.'), 35846 removed: Object(external_wp_i18n_["__"])('Item removed.'), 35847 remove: Object(external_wp_i18n_["__"])('Remove item'), 35848 __experimentalInvalid: Object(external_wp_i18n_["__"])('Invalid item') 35849 }, 35850 __experimentalExpandOnFocus: false, 35851 __experimentalValidateInput: () => true, 35852 __experimentalShowHowTo: true 35853 }; 35854 /* harmony default export */ var form_token_field = (with_spoken_messages(Object(external_wp_compose_["withInstanceId"])(form_token_field_FormTokenField))); 35855 35856 // EXTERNAL MODULE: ./node_modules/gradient-parser/build/node.js 35857 var build_node = __webpack_require__("Jx1U"); 35858 var node_default = /*#__PURE__*/__webpack_require__.n(build_node); 35859 35860 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/constants.js 35861 /** 35862 * WordPress dependencies 35863 */ 35864 35865 const DEFAULT_GRADIENT = 'linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)'; 35866 const DEFAULT_LINEAR_GRADIENT_ANGLE = 180; 35867 const HORIZONTAL_GRADIENT_ORIENTATION = { 35868 type: 'angular', 35869 value: 90 35870 }; 35871 const GRADIENT_OPTIONS = [{ 35872 value: 'linear-gradient', 35873 label: Object(external_wp_i18n_["__"])('Linear') 35874 }, { 35875 value: 'radial-gradient', 35876 label: Object(external_wp_i18n_["__"])('Radial') 35877 }]; 35878 const DIRECTIONAL_ORIENTATION_ANGLE_MAP = { 35879 top: 0, 35880 'top right': 45, 35881 'right top': 45, 35882 right: 90, 35883 'right bottom': 135, 35884 'bottom right': 135, 35885 bottom: 180, 35886 'bottom left': 225, 35887 'left bottom': 225, 35888 left: 270, 35889 'top left': 315, 35890 'left top': 315 35891 }; 35892 35893 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/serializer.js 35894 /** 35895 * External dependencies 35896 */ 35897 35898 function serializeGradientColor({ 35899 type, 35900 value 35901 }) { 35902 if (type === 'literal') { 35903 return value; 35904 } 35905 35906 if (type === 'hex') { 35907 return `#${value}`; 35908 } 35909 35910 return `${type}(${value.join(',')})`; 35911 } 35912 function serializeGradientPosition(position) { 35913 if (!position) { 35914 return ''; 35915 } 35916 35917 const { 35918 value, 35919 type 35920 } = position; 35921 return `${value}${type}`; 35922 } 35923 function serializeGradientColorStop({ 35924 type, 35925 value, 35926 length 35927 }) { 35928 return `${serializeGradientColor({ 35929 type, 35930 value 35931 })} ${serializeGradientPosition(length)}`; 35932 } 35933 function serializeGradientOrientation(orientation) { 35934 if (!orientation || orientation.type !== 'angular') { 35935 return; 35936 } 35937 35938 return `${orientation.value}deg`; 35939 } 35940 function serializeGradient({ 35941 type, 35942 orientation, 35943 colorStops 35944 }) { 35945 const serializedOrientation = serializeGradientOrientation(orientation); 35946 const serializedColorStops = colorStops.sort((colorStop1, colorStop2) => { 35947 return Object(external_lodash_["get"])(colorStop1, ['length', 'value'], 0) - Object(external_lodash_["get"])(colorStop2, ['length', 'value'], 0); 35948 }).map(serializeGradientColorStop); 35949 return `${type}(${Object(external_lodash_["compact"])([serializedOrientation, ...serializedColorStops]).join(',')})`; 35950 } 35951 35952 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/utils.js 35953 /** 35954 * External dependencies 35955 */ 35956 35957 35958 /** 35959 * Internal dependencies 35960 */ 35961 35962 35963 35964 function getLinearGradientRepresentationOfARadial(gradientAST) { 35965 return serializeGradient({ 35966 type: 'linear-gradient', 35967 orientation: HORIZONTAL_GRADIENT_ORIENTATION, 35968 colorStops: gradientAST.colorStops 35969 }); 35970 } 35971 35972 function hasUnsupportedLength(item) { 35973 return item.length === undefined || item.length.type !== '%'; 35974 } 35975 35976 function getGradientAstWithDefault(value) { 35977 var _gradientAST$orientat; 35978 35979 // gradientAST will contain the gradient AST as parsed by gradient-parser npm module. 35980 // More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast. 35981 let gradientAST; 35982 35983 try { 35984 gradientAST = node_default.a.parse(value)[0]; 35985 gradientAST.value = value; 35986 } catch (error) { 35987 gradientAST = node_default.a.parse(DEFAULT_GRADIENT)[0]; 35988 gradientAST.value = DEFAULT_GRADIENT; 35989 } 35990 35991 if (((_gradientAST$orientat = gradientAST.orientation) === null || _gradientAST$orientat === void 0 ? void 0 : _gradientAST$orientat.type) === 'directional') { 35992 gradientAST.orientation.type = 'angular'; 35993 gradientAST.orientation.value = DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString(); 35994 } 35995 35996 if (gradientAST.colorStops.some(hasUnsupportedLength)) { 35997 const { 35998 colorStops 35999 } = gradientAST; 36000 const step = 100 / (colorStops.length - 1); 36001 colorStops.forEach((stop, index) => { 36002 stop.length = { 36003 value: step * index, 36004 type: '%' 36005 }; 36006 }); 36007 gradientAST.value = serializeGradient(gradientAST); 36008 } 36009 36010 return gradientAST; 36011 } 36012 function getGradientAstWithControlPoints(gradientAST, newControlPoints) { 36013 return { ...gradientAST, 36014 colorStops: newControlPoints.map(({ 36015 position, 36016 color 36017 }) => { 36018 const { 36019 r, 36020 g, 36021 b, 36022 a 36023 } = tinycolor_default()(color).toRgb(); 36024 return { 36025 length: { 36026 type: '%', 36027 value: position.toString() 36028 }, 36029 type: a < 1 ? 'rgba' : 'rgb', 36030 value: a < 1 ? [r, g, b, a] : [r, g, b] 36031 }; 36032 }) 36033 }; 36034 } 36035 function getStopCssColor(colorStop) { 36036 switch (colorStop.type) { 36037 case 'hex': 36038 return `#${colorStop.value}`; 36039 36040 case 'literal': 36041 return colorStop.value; 36042 36043 case 'rgb': 36044 case 'rgba': 36045 return `${colorStop.type}(${colorStop.value.join(',')})`; 36046 36047 default: 36048 // Should be unreachable if passing an AST from gradient-parser. 36049 // See https://github.com/rafaelcaricio/gradient-parser#ast. 36050 return 'transparent'; 36051 } 36052 } 36053 36054 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js 36055 36056 36057 function custom_gradient_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 36058 36059 /** 36060 * Internal dependencies 36061 */ 36062 36063 const SelectWrapper = /*#__PURE__*/styled_base_browser_esm(flex_block_component, { 36064 target: "e99xvul0", 36065 label: "SelectWrapper" 36066 })( true ? { 36067 name: "otv6bo", 36068 styles: "flex-grow:5;" 36069 } : undefined); 36070 const AccessoryWrapper = /*#__PURE__*/styled_base_browser_esm(flex_block_component, { 36071 target: "e99xvul1", 36072 label: "AccessoryWrapper" 36073 })( true ? { 36074 name: "gmtefn", 36075 styles: "flex-grow:4;" 36076 } : undefined); 36077 36078 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js 36079 36080 36081 /** 36082 * External dependencies 36083 */ 36084 36085 /** 36086 * WordPress dependencies 36087 */ 36088 36089 36090 /** 36091 * Internal dependencies 36092 */ 36093 36094 36095 36096 36097 36098 36099 36100 36101 36102 36103 const GradientAnglePicker = ({ 36104 gradientAST, 36105 hasGradient, 36106 onChange 36107 }) => { 36108 const angle = Object(external_lodash_["get"])(gradientAST, ['orientation', 'value'], DEFAULT_LINEAR_GRADIENT_ANGLE); 36109 36110 const onAngleChange = newAngle => { 36111 onChange(serializeGradient({ ...gradientAST, 36112 orientation: { 36113 type: 'angular', 36114 value: newAngle 36115 } 36116 })); 36117 }; 36118 36119 return Object(external_wp_element_["createElement"])(AnglePickerControl, { 36120 hideLabelFromVision: true, 36121 onChange: onAngleChange, 36122 value: hasGradient ? angle : '' 36123 }); 36124 }; 36125 36126 const GradientTypePicker = ({ 36127 gradientAST, 36128 hasGradient, 36129 onChange 36130 }) => { 36131 const { 36132 type 36133 } = gradientAST; 36134 36135 const onSetLinearGradient = () => { 36136 onChange(serializeGradient({ ...gradientAST, 36137 ...(gradientAST.orientation ? {} : { 36138 orientation: HORIZONTAL_GRADIENT_ORIENTATION 36139 }), 36140 type: 'linear-gradient' 36141 })); 36142 }; 36143 36144 const onSetRadialGradient = () => { 36145 onChange(serializeGradient({ ...Object(external_lodash_["omit"])(gradientAST, ['orientation']), 36146 type: 'radial-gradient' 36147 })); 36148 }; 36149 36150 const handleOnChange = next => { 36151 if (next === 'linear-gradient') { 36152 onSetLinearGradient(); 36153 } 36154 36155 if (next === 'radial-gradient') { 36156 onSetRadialGradient(); 36157 } 36158 }; 36159 36160 return Object(external_wp_element_["createElement"])(select_control, { 36161 className: "components-custom-gradient-picker__type-picker", 36162 label: Object(external_wp_i18n_["__"])('Type'), 36163 labelPosition: 'side', 36164 onChange: handleOnChange, 36165 options: GRADIENT_OPTIONS, 36166 value: hasGradient && type 36167 }); 36168 }; 36169 36170 function CustomGradientPicker({ 36171 value, 36172 onChange 36173 }) { 36174 const gradientAST = getGradientAstWithDefault(value); // On radial gradients the bar should display a linear gradient. 36175 // On radial gradients the bar represents a slice of the gradient from the center until the outside. 36176 36177 const background = gradientAST.type === 'radial-gradient' ? getLinearGradientRepresentationOfARadial(gradientAST) : gradientAST.value; 36178 const hasGradient = gradientAST.value !== DEFAULT_GRADIENT; // Control points color option may be hex from presets, custom colors will be rgb. 36179 // The position should always be a percentage. 36180 36181 const controlPoints = gradientAST.colorStops.map(colorStop => ({ 36182 color: getStopCssColor(colorStop), 36183 position: parseInt(colorStop.length.value) 36184 })); 36185 return Object(external_wp_element_["createElement"])("div", { 36186 className: "components-custom-gradient-picker" 36187 }, Object(external_wp_element_["createElement"])(CustomGradientBar, { 36188 background: background, 36189 hasGradient: hasGradient, 36190 value: controlPoints, 36191 onChange: newControlPoints => { 36192 onChange(serializeGradient(getGradientAstWithControlPoints(gradientAST, newControlPoints))); 36193 } 36194 }), Object(external_wp_element_["createElement"])(flex_component, { 36195 gap: 3, 36196 className: "components-custom-gradient-picker__ui-line" 36197 }, Object(external_wp_element_["createElement"])(SelectWrapper, null, Object(external_wp_element_["createElement"])(GradientTypePicker, { 36198 gradientAST: gradientAST, 36199 hasGradient: hasGradient, 36200 onChange: onChange 36201 })), Object(external_wp_element_["createElement"])(AccessoryWrapper, null, gradientAST.type === 'linear-gradient' && Object(external_wp_element_["createElement"])(GradientAnglePicker, { 36202 gradientAST: gradientAST, 36203 hasGradient: hasGradient, 36204 onChange: onChange 36205 })))); 36206 } 36207 36208 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/gradient-picker/index.js 36209 36210 36211 /** 36212 * External dependencies 36213 */ 36214 36215 /** 36216 * WordPress dependencies 36217 */ 36218 36219 36220 36221 /** 36222 * Internal dependencies 36223 */ 36224 36225 36226 36227 function GradientPicker({ 36228 className, 36229 gradients, 36230 onChange, 36231 value, 36232 clearable = true, 36233 disableCustomGradients = false 36234 }) { 36235 const clearGradient = Object(external_wp_element_["useCallback"])(() => onChange(undefined), [onChange]); 36236 const gradientOptions = Object(external_wp_element_["useMemo"])(() => { 36237 return Object(external_lodash_["map"])(gradients, ({ 36238 gradient, 36239 name 36240 }) => Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, { 36241 key: gradient, 36242 value: gradient, 36243 isSelected: value === gradient, 36244 tooltipText: name || // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);". 36245 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Gradient code: %s'), gradient), 36246 style: { 36247 color: 'rgba( 0,0,0,0 )', 36248 background: gradient 36249 }, 36250 onClick: value === gradient ? clearGradient : () => onChange(gradient), 36251 "aria-label": name ? // translators: %s: The name of the gradient e.g: "Angular red to blue". 36252 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Gradient: %s'), name) : // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);". 36253 Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Gradient code: %s'), gradient) 36254 })); 36255 }, [gradients, value, onChange, clearGradient]); 36256 return Object(external_wp_element_["createElement"])(CircularOptionPicker, { 36257 className: className, 36258 options: gradientOptions, 36259 actions: clearable && Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, { 36260 onClick: clearGradient 36261 }, Object(external_wp_i18n_["__"])('Clear')) 36262 }, !disableCustomGradients && Object(external_wp_element_["createElement"])(CustomGradientPicker, { 36263 value: value, 36264 onChange: onChange 36265 })); 36266 } 36267 36268 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/utils.js 36269 const utils_ALIGNMENTS = { 36270 bottom: { 36271 alignItems: 'flex-end', 36272 justifyContent: 'center' 36273 }, 36274 bottomLeft: { 36275 alignItems: 'flex-start', 36276 justifyContent: 'flex-end' 36277 }, 36278 bottomRight: { 36279 alignItems: 'flex-end', 36280 justifyContent: 'flex-end' 36281 }, 36282 center: { 36283 alignItems: 'center', 36284 justifyContent: 'center' 36285 }, 36286 spaced: { 36287 alignItems: 'center', 36288 justifyContent: 'space-between' 36289 }, 36290 left: { 36291 alignItems: 'center', 36292 justifyContent: 'flex-start' 36293 }, 36294 right: { 36295 alignItems: 'center', 36296 justifyContent: 'flex-end' 36297 }, 36298 stretch: { 36299 alignItems: 'stretch' 36300 }, 36301 top: { 36302 alignItems: 'flex-start', 36303 justifyContent: 'center' 36304 }, 36305 topLeft: { 36306 alignItems: 'flex-start', 36307 justifyContent: 'flex-start' 36308 }, 36309 topRight: { 36310 alignItems: 'flex-start', 36311 justifyContent: 'flex-end' 36312 } 36313 }; 36314 /* eslint-disable jsdoc/valid-types */ 36315 36316 /** 36317 * @param {keyof typeof ALIGNMENTS | undefined} alignment 36318 * @return {{ alignItems?: import('react').CSSProperties['alignItems'], justifyContent?: import('react').CSSProperties['justifyContent']}} CSS props for alignment 36319 */ 36320 36321 function getAlignmentProps(alignment) { 36322 const alignmentProps = alignment ? utils_ALIGNMENTS[alignment] : {}; 36323 return alignmentProps; 36324 } 36325 /* eslint-enable jsdoc/valid-types */ 36326 36327 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/hook.js 36328 36329 36330 36331 /** 36332 * WordPress dependencies 36333 */ 36334 36335 /** 36336 * Internal dependencies 36337 */ 36338 36339 36340 36341 36342 36343 /** 36344 * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props 36345 */ 36346 36347 function useGrid(props) { 36348 const { 36349 align, 36350 alignment, 36351 className, 36352 columnGap, 36353 columns = 2, 36354 gap = 3, 36355 isInline = false, 36356 justify, 36357 rowGap, 36358 rows, 36359 templateColumns, 36360 templateRows, 36361 ...otherProps 36362 } = Object(use_context_system["a" /* useContextSystem */])(props, 'Grid'); 36363 const columnsAsArray = Array.isArray(columns) ? columns : [columns]; 36364 const column = useResponsiveValue(columnsAsArray); 36365 const rowsAsArray = Array.isArray(rows) ? rows : [rows]; 36366 const row = useResponsiveValue(rowsAsArray); 36367 const gridTemplateColumns = templateColumns || !!columns && `repeat(${column}, 1fr)`; 36368 const gridTemplateRows = templateRows || !!rows && `repeat(${row}, 1fr)`; 36369 const classes = Object(external_wp_element_["useMemo"])(() => { 36370 const alignmentProps = getAlignmentProps(alignment); 36371 36372 const gridClasses = /*#__PURE__*/Object(emotion_esm["a" /* css */])({ 36373 alignItems: align, 36374 display: isInline ? 'inline-grid' : 'grid', 36375 gap: `calc( ${config_values.gridBase} * ${gap} )`, 36376 gridTemplateColumns: gridTemplateColumns || undefined, 36377 gridTemplateRows: gridTemplateRows || undefined, 36378 gridRowGap: rowGap, 36379 gridColumnGap: columnGap, 36380 justifyContent: justify, 36381 verticalAlign: isInline ? 'middle' : undefined, 36382 ...alignmentProps 36383 }, ";label:gridClasses;" + ( true ? "" : undefined)); 36384 36385 return Object(emotion_esm["b" /* cx */])(gridClasses, className); 36386 }, [align, alignment, className, columnGap, gap, gridTemplateColumns, gridTemplateRows, isInline, justify, rowGap]); 36387 return { ...otherProps, 36388 className: classes 36389 }; 36390 } 36391 36392 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/component.js 36393 /** 36394 * Internal dependencies 36395 */ 36396 36397 36398 /** 36399 * `Grid` is a primitive layout component that can arrange content in a grid configuration. 36400 * 36401 * @example 36402 * ```jsx 36403 * import { 36404 * __experimentalGrid as Grid, 36405 * __experimentalText as Text 36406 * } from `@wordpress/components`; 36407 * 36408 * function Example() { 36409 * return ( 36410 * <Grid columns={ 3 }> 36411 * <Text>Code</Text> 36412 * <Text>is</Text> 36413 * <Text>Poetry</Text> 36414 * </Grid> 36415 * ); 36416 * } 36417 * ``` 36418 */ 36419 36420 const Grid = create_component_createComponent({ 36421 as: 'div', 36422 useHook: useGrid, 36423 name: 'Grid' 36424 }); 36425 /* harmony default export */ var grid_component = (Grid); 36426 36427 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/frame.js 36428 36429 36430 /** 36431 * External dependencies 36432 */ 36433 36434 /** 36435 * WordPress dependencies 36436 */ 36437 36438 36439 36440 36441 /** 36442 * Internal dependencies 36443 */ 36444 36445 36446 36447 function ModalFrameContent({ 36448 overlayClassName, 36449 contentLabel, 36450 aria: { 36451 describedby, 36452 labelledby 36453 }, 36454 children, 36455 className, 36456 role, 36457 style, 36458 focusOnMount, 36459 shouldCloseOnEsc, 36460 onRequestClose 36461 }) { 36462 function handleEscapeKeyDown(event) { 36463 if (shouldCloseOnEsc && event.keyCode === external_wp_keycodes_["ESCAPE"]) { 36464 event.stopPropagation(); 36465 36466 if (onRequestClose) { 36467 onRequestClose(event); 36468 } 36469 } 36470 } 36471 36472 const focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])(focusOnMount); 36473 const constrainedTabbingRef = Object(external_wp_compose_["useConstrainedTabbing"])(); 36474 const focusReturnRef = Object(external_wp_compose_["useFocusReturn"])(); 36475 return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions 36476 Object(external_wp_element_["createElement"])("div", { 36477 className: classnames_default()('components-modal__screen-overlay', overlayClassName), 36478 onKeyDown: handleEscapeKeyDown 36479 }, Object(external_wp_element_["createElement"])("div", { 36480 className: classnames_default()('components-modal__frame', className), 36481 style: style, 36482 ref: Object(external_wp_compose_["useMergeRefs"])([constrainedTabbingRef, focusReturnRef, focusOnMountRef]), 36483 role: role, 36484 "aria-label": contentLabel, 36485 "aria-labelledby": contentLabel ? null : labelledby, 36486 "aria-describedby": describedby, 36487 tabIndex: "-1" 36488 }, children)) 36489 ); 36490 } 36491 36492 class frame_ModalFrame extends external_wp_element_["Component"] { 36493 constructor() { 36494 super(...arguments); 36495 this.handleFocusOutside = this.handleFocusOutside.bind(this); 36496 } 36497 /** 36498 * Callback function called when clicked outside the modal. 36499 * 36500 * @param {Object} event Mouse click event. 36501 */ 36502 36503 36504 handleFocusOutside(event) { 36505 if (this.props.shouldCloseOnClickOutside && this.props.onRequestClose) { 36506 this.props.onRequestClose(event); 36507 } 36508 } 36509 /** 36510 * Renders the modal frame element. 36511 * 36512 * @return {WPElement} The modal frame element. 36513 */ 36514 36515 36516 render() { 36517 return Object(external_wp_element_["createElement"])(ModalFrameContent, this.props); 36518 } 36519 36520 } 36521 36522 /* harmony default export */ var modal_frame = (with_focus_outside(frame_ModalFrame)); 36523 36524 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/header.js 36525 36526 36527 /** 36528 * WordPress dependencies 36529 */ 36530 36531 36532 /** 36533 * Internal dependencies 36534 */ 36535 36536 36537 36538 const ModalHeader = ({ 36539 icon, 36540 title, 36541 onClose, 36542 closeLabel, 36543 headingId, 36544 isDismissible 36545 }) => { 36546 const label = closeLabel ? closeLabel : Object(external_wp_i18n_["__"])('Close dialog'); 36547 return Object(external_wp_element_["createElement"])("div", { 36548 className: "components-modal__header" 36549 }, Object(external_wp_element_["createElement"])("div", { 36550 className: "components-modal__header-heading-container" 36551 }, icon && Object(external_wp_element_["createElement"])("span", { 36552 className: "components-modal__icon-container", 36553 "aria-hidden": true 36554 }, icon), title && Object(external_wp_element_["createElement"])("h1", { 36555 id: headingId, 36556 className: "components-modal__header-heading" 36557 }, title)), isDismissible && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 36558 onClick: onClose, 36559 icon: close_small["a" /* default */], 36560 label: label 36561 })); 36562 }; 36563 36564 /* harmony default export */ var modal_header = (ModalHeader); 36565 36566 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/aria-helper.js 36567 /** 36568 * External dependencies 36569 */ 36570 36571 const LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']); 36572 let hiddenElements = [], 36573 isHidden = false; 36574 /** 36575 * Hides all elements in the body element from screen-readers except 36576 * the provided element and elements that should not be hidden from 36577 * screen-readers. 36578 * 36579 * The reason we do this is because `aria-modal="true"` currently is bugged 36580 * in Safari, and support is spotty in other browsers overall. In the future 36581 * we should consider removing these helper functions in favor of 36582 * `aria-modal="true"`. 36583 * 36584 * @param {Element} unhiddenElement The element that should not be hidden. 36585 */ 36586 36587 function hideApp(unhiddenElement) { 36588 if (isHidden) { 36589 return; 36590 } 36591 36592 const elements = document.body.children; 36593 Object(external_lodash_["forEach"])(elements, element => { 36594 if (element === unhiddenElement) { 36595 return; 36596 } 36597 36598 if (elementShouldBeHidden(element)) { 36599 element.setAttribute('aria-hidden', 'true'); 36600 hiddenElements.push(element); 36601 } 36602 }); 36603 isHidden = true; 36604 } 36605 /** 36606 * Determines if the passed element should not be hidden from screen readers. 36607 * 36608 * @param {HTMLElement} element The element that should be checked. 36609 * 36610 * @return {boolean} Whether the element should not be hidden from screen-readers. 36611 */ 36612 36613 function elementShouldBeHidden(element) { 36614 const role = element.getAttribute('role'); 36615 return !(element.tagName === 'SCRIPT' || element.hasAttribute('aria-hidden') || element.hasAttribute('aria-live') || LIVE_REGION_ARIA_ROLES.has(role)); 36616 } 36617 /** 36618 * Makes all elements in the body that have been hidden by `hideApp` 36619 * visible again to screen-readers. 36620 */ 36621 36622 function showApp() { 36623 if (!isHidden) { 36624 return; 36625 } 36626 36627 Object(external_lodash_["forEach"])(hiddenElements, element => { 36628 element.removeAttribute('aria-hidden'); 36629 }); 36630 hiddenElements = []; 36631 isHidden = false; 36632 } 36633 36634 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/index.js 36635 36636 36637 36638 /** 36639 * WordPress dependencies 36640 */ 36641 36642 36643 36644 /** 36645 * Internal dependencies 36646 */ 36647 36648 36649 36650 // Used to count the number of open modals. 36651 36652 let modal_parentElement, 36653 openModalCount = 0; 36654 36655 class modal_Modal extends external_wp_element_["Component"] { 36656 constructor(props) { 36657 super(props); 36658 this.prepareDOM(); 36659 } 36660 /** 36661 * Appends the modal's node to the DOM, so the portal can render the 36662 * modal in it. Also calls the openFirstModal when this is the first modal to be 36663 * opened. 36664 */ 36665 36666 36667 componentDidMount() { 36668 openModalCount++; 36669 36670 if (openModalCount === 1) { 36671 this.openFirstModal(); 36672 } 36673 } 36674 /** 36675 * Removes the modal's node from the DOM. Also calls closeLastModal when this is 36676 * the last modal to be closed. 36677 */ 36678 36679 36680 componentWillUnmount() { 36681 openModalCount--; 36682 36683 if (openModalCount === 0) { 36684 this.closeLastModal(); 36685 } 36686 36687 this.cleanDOM(); 36688 } 36689 /** 36690 * Prepares the DOM for the modals to be rendered. 36691 * 36692 * Every modal is mounted in a separate div appended to a parent div 36693 * that is appended to the document body. 36694 * 36695 * The parent div will be created if it does not yet exist, and the 36696 * separate div for this specific modal will be appended to that. 36697 */ 36698 36699 36700 prepareDOM() { 36701 if (!modal_parentElement) { 36702 modal_parentElement = document.createElement('div'); 36703 document.body.appendChild(modal_parentElement); 36704 } 36705 36706 this.node = document.createElement('div'); 36707 modal_parentElement.appendChild(this.node); 36708 } 36709 /** 36710 * Removes the specific mounting point for this modal from the DOM. 36711 */ 36712 36713 36714 cleanDOM() { 36715 modal_parentElement.removeChild(this.node); 36716 } 36717 /** 36718 * Prepares the DOM for this modal and any additional modal to be mounted. 36719 * 36720 * It appends an additional div to the body for the modals to be rendered in, 36721 * it hides any other elements from screen-readers and adds an additional class 36722 * to the body to prevent scrolling while the modal is open. 36723 */ 36724 36725 36726 openFirstModal() { 36727 hideApp(modal_parentElement); 36728 document.body.classList.add(this.props.bodyOpenClassName); 36729 } 36730 /** 36731 * Cleans up the DOM after the last modal is closed and makes the app available 36732 * for screen-readers again. 36733 */ 36734 36735 36736 closeLastModal() { 36737 document.body.classList.remove(this.props.bodyOpenClassName); 36738 showApp(); 36739 } 36740 /** 36741 * Renders the modal. 36742 * 36743 * @return {WPElement} The modal element. 36744 */ 36745 36746 36747 render() { 36748 const { 36749 onRequestClose, 36750 title, 36751 icon, 36752 closeButtonLabel, 36753 children, 36754 aria, 36755 instanceId, 36756 isDismissible, 36757 isDismissable, 36758 //Deprecated 36759 // Many of the documented props for Modal are passed straight through 36760 // to the ModalFrame component and handled there. 36761 ...otherProps 36762 } = this.props; 36763 const headingId = title ? `components-modal-header-${instanceId}` : aria.labelledby; 36764 36765 if (isDismissable) { 36766 external_wp_deprecated_default()('isDismissable prop of the Modal component', { 36767 since: '5.4', 36768 alternative: 'isDismissible prop (renamed) of the Modal component' 36769 }); 36770 } // Disable reason: this stops mouse events from triggering tooltips and 36771 // other elements underneath the modal overlay. 36772 36773 36774 return Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(modal_frame, Object(esm_extends["a" /* default */])({ 36775 onRequestClose: onRequestClose, 36776 aria: { 36777 labelledby: headingId, 36778 describedby: aria.describedby 36779 } 36780 }, otherProps), Object(external_wp_element_["createElement"])("div", { 36781 className: 'components-modal__content', 36782 role: "document" 36783 }, Object(external_wp_element_["createElement"])(modal_header, { 36784 closeLabel: closeButtonLabel, 36785 headingId: title && headingId, 36786 icon: icon, 36787 isDismissible: isDismissible || isDismissable, 36788 onClose: onRequestClose, 36789 title: title 36790 }), children)), this.node); 36791 } 36792 36793 } 36794 36795 modal_Modal.defaultProps = { 36796 bodyOpenClassName: 'modal-open', 36797 role: 'dialog', 36798 title: null, 36799 focusOnMount: true, 36800 shouldCloseOnEsc: true, 36801 shouldCloseOnClickOutside: true, 36802 isDismissible: true, 36803 36804 /* accessibility */ 36805 aria: { 36806 labelledby: null, 36807 describedby: null 36808 } 36809 }; 36810 /* harmony default export */ var modal = (Object(external_wp_compose_["withInstanceId"])(modal_Modal)); 36811 36812 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/icons.js 36813 36814 36815 /** 36816 * WordPress dependencies 36817 */ 36818 36819 const PageControlIcon = ({ 36820 isSelected 36821 }) => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 36822 width: "8", 36823 height: "8", 36824 fill: "none", 36825 xmlns: "http://www.w3.org/2000/svg" 36826 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Circle"], { 36827 cx: "4", 36828 cy: "4", 36829 r: "4", 36830 fill: isSelected ? '#419ECD' : '#E1E3E6' 36831 })); 36832 36833 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page-control.js 36834 36835 36836 /** 36837 * External dependencies 36838 */ 36839 36840 /** 36841 * WordPress dependencies 36842 */ 36843 36844 36845 /** 36846 * Internal dependencies 36847 */ 36848 36849 36850 36851 function PageControl({ 36852 currentPage, 36853 numberOfPages, 36854 setCurrentPage 36855 }) { 36856 return Object(external_wp_element_["createElement"])("ul", { 36857 className: "components-guide__page-control", 36858 "aria-label": Object(external_wp_i18n_["__"])('Guide controls') 36859 }, Object(external_lodash_["times"])(numberOfPages, page => Object(external_wp_element_["createElement"])("li", { 36860 key: page // Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current 36861 , 36862 "aria-current": page === currentPage ? 'step' : undefined 36863 }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 36864 key: page, 36865 icon: Object(external_wp_element_["createElement"])(PageControlIcon, { 36866 isSelected: page === currentPage 36867 }), 36868 "aria-label": Object(external_wp_i18n_["sprintf"])( 36869 /* translators: 1: current page number 2: total number of pages */ 36870 Object(external_wp_i18n_["__"])('Page %1$d of %2$d'), page + 1, numberOfPages), 36871 onClick: () => setCurrentPage(page) 36872 })))); 36873 } 36874 36875 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/finish-button.js 36876 36877 36878 36879 /** 36880 * WordPress dependencies 36881 */ 36882 36883 /** 36884 * Internal dependencies 36885 */ 36886 36887 36888 function FinishButton(props) { 36889 const ref = Object(external_wp_element_["useRef"])(); // Focus the button on mount if nothing else is focused. This prevents a 36890 // focus loss when the 'Next' button is swapped out. 36891 36892 Object(external_wp_element_["useLayoutEffect"])(() => { 36893 const { 36894 ownerDocument 36895 } = ref.current; 36896 const { 36897 activeElement, 36898 body 36899 } = ownerDocument; 36900 36901 if (!activeElement || activeElement === body) { 36902 ref.current.focus(); 36903 } 36904 }, []); 36905 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, { 36906 ref: ref 36907 })); 36908 } 36909 36910 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/index.js 36911 36912 36913 /** 36914 * External dependencies 36915 */ 36916 36917 /** 36918 * WordPress dependencies 36919 */ 36920 36921 36922 36923 36924 /** 36925 * Internal dependencies 36926 */ 36927 36928 36929 36930 36931 36932 36933 function Guide({ 36934 children, 36935 className, 36936 contentLabel, 36937 finishButtonText, 36938 onFinish, 36939 pages = [] 36940 }) { 36941 const [currentPage, setCurrentPage] = Object(external_wp_element_["useState"])(0); 36942 Object(external_wp_element_["useEffect"])(() => { 36943 if (external_wp_element_["Children"].count(children)) { 36944 external_wp_deprecated_default()('Passing children to <Guide>', { 36945 since: '5.5', 36946 alternative: 'the `pages` prop' 36947 }); 36948 } 36949 }, [children]); 36950 36951 if (external_wp_element_["Children"].count(children)) { 36952 pages = external_wp_element_["Children"].map(children, child => ({ 36953 content: child 36954 })); 36955 } 36956 36957 const canGoBack = currentPage > 0; 36958 const canGoForward = currentPage < pages.length - 1; 36959 36960 const goBack = () => { 36961 if (canGoBack) { 36962 setCurrentPage(currentPage - 1); 36963 } 36964 }; 36965 36966 const goForward = () => { 36967 if (canGoForward) { 36968 setCurrentPage(currentPage + 1); 36969 } 36970 }; 36971 36972 if (pages.length === 0) { 36973 return null; 36974 } 36975 36976 return Object(external_wp_element_["createElement"])(modal, { 36977 className: classnames_default()('components-guide', className), 36978 contentLabel: contentLabel, 36979 onRequestClose: onFinish 36980 }, Object(external_wp_element_["createElement"])(keyboard_shortcuts, { 36981 key: currentPage, 36982 shortcuts: { 36983 left: goBack, 36984 right: goForward 36985 } 36986 }), Object(external_wp_element_["createElement"])("div", { 36987 className: "components-guide__container" 36988 }, Object(external_wp_element_["createElement"])("div", { 36989 className: "components-guide__page" 36990 }, pages[currentPage].image, pages.length > 1 && Object(external_wp_element_["createElement"])(PageControl, { 36991 currentPage: currentPage, 36992 numberOfPages: pages.length, 36993 setCurrentPage: setCurrentPage 36994 }), pages[currentPage].content, !canGoForward && Object(external_wp_element_["createElement"])(FinishButton, { 36995 className: "components-guide__inline-finish-button", 36996 onClick: onFinish 36997 }, finishButtonText || Object(external_wp_i18n_["__"])('Finish'))), Object(external_wp_element_["createElement"])("div", { 36998 className: "components-guide__footer" 36999 }, canGoBack && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 37000 className: "components-guide__back-button", 37001 onClick: goBack 37002 }, Object(external_wp_i18n_["__"])('Previous')), canGoForward && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 37003 className: "components-guide__forward-button", 37004 onClick: goForward 37005 }, Object(external_wp_i18n_["__"])('Next')), !canGoForward && Object(external_wp_element_["createElement"])(FinishButton, { 37006 className: "components-guide__finish-button", 37007 onClick: onFinish 37008 }, finishButtonText || Object(external_wp_i18n_["__"])('Finish'))))); 37009 } 37010 37011 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page.js 37012 37013 37014 /** 37015 * WordPress dependencies 37016 */ 37017 37018 37019 function GuidePage(props) { 37020 Object(external_wp_element_["useEffect"])(() => { 37021 external_wp_deprecated_default()('<GuidePage>', { 37022 since: '5.5', 37023 alternative: 'the `pages` prop in <Guide>' 37024 }); 37025 }, []); 37026 return Object(external_wp_element_["createElement"])("div", props); 37027 } 37028 37029 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/heading/hook.js 37030 /** 37031 * Internal dependencies 37032 */ 37033 // eslint-disable-next-line no-duplicate-imports 37034 37035 37036 37037 37038 function useHeading(props) { 37039 const { 37040 as: asProp, 37041 level = 2, 37042 ...otherProps 37043 } = Object(use_context_system["a" /* useContextSystem */])(props, 'Heading'); 37044 const as = asProp || `h${level}`; 37045 const a11yProps = {}; 37046 37047 if (typeof as === 'string' && as[0] !== 'h') { 37048 // if not a semantic `h` element, add a11y props: 37049 a11yProps.role = 'heading'; 37050 a11yProps['aria-level'] = level; 37051 } 37052 37053 const textProps = useText({ 37054 color: COLORS.darkGray.heading, 37055 size: getHeadingFontSize(level), 37056 isBlock: true, 37057 weight: config_values.fontWeightHeading, 37058 ...otherProps 37059 }); 37060 return { ...textProps, 37061 ...a11yProps, 37062 as 37063 }; 37064 } 37065 37066 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/heading/component.js 37067 /** 37068 * Internal dependencies 37069 */ 37070 37071 37072 /** 37073 * `Heading` renders headings and titles using the library's typography system. 37074 * 37075 * @example 37076 * ```jsx 37077 * import { Heading } from `@wordpress/components/ui` 37078 * 37079 * function Example() { 37080 * return <Heading>Code is Poetry</Heading>; 37081 * } 37082 * ``` 37083 */ 37084 37085 const Heading = create_component_createComponent({ 37086 as: 'h1', 37087 useHook: useHeading, 37088 name: 'Heading' 37089 }); 37090 /* harmony default export */ var heading_component = (Heading); 37091 37092 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/utils.js 37093 /** 37094 * External dependencies 37095 */ 37096 37097 /** @type {import('./types').Alignments} */ 37098 37099 const h_stack_utils_ALIGNMENTS = { 37100 bottom: { 37101 align: 'flex-end', 37102 justify: 'center' 37103 }, 37104 bottomLeft: { 37105 align: 'flex-start', 37106 justify: 'flex-end' 37107 }, 37108 bottomRight: { 37109 align: 'flex-end', 37110 justify: 'flex-end' 37111 }, 37112 center: { 37113 align: 'center', 37114 justify: 'center' 37115 }, 37116 edge: { 37117 align: 'center', 37118 justify: 'space-between' 37119 }, 37120 left: { 37121 align: 'center', 37122 justify: 'flex-start' 37123 }, 37124 right: { 37125 align: 'center', 37126 justify: 'flex-end' 37127 }, 37128 stretch: { 37129 align: 'stretch' 37130 }, 37131 top: { 37132 align: 'flex-start', 37133 justify: 'center' 37134 }, 37135 topLeft: { 37136 align: 'flex-start', 37137 justify: 'flex-start' 37138 }, 37139 topRight: { 37140 align: 'flex-start', 37141 justify: 'flex-end' 37142 } 37143 }; 37144 /** @type {import('./types').Alignments} */ 37145 37146 const V_ALIGNMENTS = { 37147 bottom: { 37148 justify: 'flex-end', 37149 align: 'center' 37150 }, 37151 bottomLeft: { 37152 justify: 'flex-start', 37153 align: 'flex-end' 37154 }, 37155 bottomRight: { 37156 justify: 'flex-end', 37157 align: 'flex-end' 37158 }, 37159 center: { 37160 justify: 'center', 37161 align: 'center' 37162 }, 37163 edge: { 37164 justify: 'space-between', 37165 align: 'center' 37166 }, 37167 left: { 37168 justify: 'center', 37169 align: 'flex-start' 37170 }, 37171 right: { 37172 justify: 'center', 37173 align: 'flex-end' 37174 }, 37175 stretch: { 37176 justify: 'stretch' 37177 }, 37178 top: { 37179 justify: 'flex-start', 37180 align: 'center' 37181 }, 37182 topLeft: { 37183 justify: 'flex-start', 37184 align: 'flex-start' 37185 }, 37186 topRight: { 37187 justify: 'flex-start', 37188 align: 'flex-end' 37189 } 37190 }; 37191 /* eslint-disable jsdoc/valid-types */ 37192 37193 /** 37194 * @param {import('./types').HStackAlignment | import('react').CSSProperties[ 'alignItems' ]} alignment Where to align. 37195 * @param {import('../flex/types').FlexDirection} [direction='row'] Direction to align. 37196 * @return {import('./types').AlignmentProps} Alignment props. 37197 */ 37198 37199 /* eslint-enable jsdoc/valid-types */ 37200 37201 function utils_getAlignmentProps(alignment, direction = 'row') { 37202 if (Object(external_lodash_["isNil"])(alignment)) { 37203 return {}; 37204 } 37205 37206 const isVertical = direction === 'column'; 37207 const props = isVertical ? V_ALIGNMENTS : h_stack_utils_ALIGNMENTS; 37208 const alignmentProps = alignment in props ? props[ 37209 /** @type {keyof typeof ALIGNMENTS} */ 37210 alignment] : { 37211 align: alignment 37212 }; 37213 return alignmentProps; 37214 } 37215 37216 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/get-valid-children.js 37217 /** 37218 * External dependencies 37219 */ 37220 // eslint-disable-next-line no-restricted-imports 37221 37222 /** 37223 * WordPress dependencies 37224 */ 37225 37226 /** 37227 * Gets a collection of available children elements from a React component's children prop. 37228 * 37229 * @param {import('react').ReactNode} children 37230 * 37231 * @return {import('react').ReactNodeArray} An array of available children. 37232 */ 37233 37234 function getValidChildren(children) { 37235 if (typeof children === 'string') return [children]; 37236 return external_wp_element_["Children"].toArray(children).filter(child => Object(external_wp_element_["isValidElement"])(child)); 37237 } 37238 37239 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/hook.js 37240 37241 37242 37243 /** 37244 * Internal dependencies 37245 */ 37246 37247 37248 37249 37250 /** 37251 * 37252 * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props 37253 */ 37254 37255 function useHStack(props) { 37256 const { 37257 alignment = 'edge', 37258 children, 37259 direction, 37260 spacing = 2, 37261 ...otherProps 37262 } = Object(use_context_system["a" /* useContextSystem */])(props, 'HStack'); 37263 const align = utils_getAlignmentProps(alignment, direction); 37264 const validChildren = getValidChildren(children); 37265 const clonedChildren = validChildren.map( // @ts-ignore 37266 ( 37267 /** @type {import('react').ReactElement} */ 37268 child, index) => { 37269 const _key = child.key || `hstack-${index}`; 37270 37271 const _isSpacer = Object(context_connect["b" /* hasConnectNamespace */])(child, ['Spacer']); 37272 37273 if (_isSpacer) { 37274 return Object(external_wp_element_["createElement"])(flex_item_component, Object(esm_extends["a" /* default */])({ 37275 isBlock: true, 37276 key: _key 37277 }, child.props)); 37278 } 37279 37280 return child; 37281 }); 37282 const propsForFlex = { 37283 children: clonedChildren, 37284 direction, 37285 justify: 'center', 37286 ...align, 37287 ...otherProps, 37288 gap: spacing 37289 }; 37290 const flexProps = useFlex(propsForFlex); 37291 return flexProps; 37292 } 37293 37294 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/component.js 37295 /** 37296 * Internal dependencies 37297 */ 37298 37299 37300 /** 37301 * `HStack` (Horizontal Stack) arranges child elements in a horizontal line. 37302 * 37303 * `HStack` can render anything inside. 37304 * 37305 * @example 37306 * ```jsx 37307 * import { 37308 * __experimentalHStack as HStack, 37309 * __experimentalText as Text, 37310 * } from `@wordpress/components`; 37311 * 37312 * function Example() { 37313 * return ( 37314 * <HStack> 37315 * <Text>Code</Text> 37316 * <Text>is</Text> 37317 * <Text>Poetry</Text> 37318 * </HStack> 37319 * ); 37320 * } 37321 * ``` 37322 */ 37323 37324 const HStack = create_component_createComponent({ 37325 as: 'div', 37326 useHook: useHStack, 37327 name: 'HStack' 37328 }); 37329 /* harmony default export */ var h_stack_component = (HStack); 37330 37331 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/deprecated.js 37332 37333 37334 37335 /** 37336 * WordPress dependencies 37337 */ 37338 37339 37340 /** 37341 * Internal dependencies 37342 */ 37343 37344 37345 37346 function IconButton({ 37347 labelPosition, 37348 size, 37349 tooltip, 37350 label, 37351 ...props 37352 }, ref) { 37353 external_wp_deprecated_default()('wp.components.IconButton', { 37354 since: '5.4', 37355 alternative: 'wp.components.Button' 37356 }); 37357 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, { 37358 ref: ref, 37359 tooltipPosition: labelPosition, 37360 iconSize: size, 37361 showTooltip: tooltip !== undefined ? !!tooltip : undefined, 37362 label: tooltip || label 37363 })); 37364 } 37365 37366 /* harmony default export */ var deprecated = (Object(external_wp_element_["forwardRef"])(IconButton)); 37367 37368 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-group/index.js 37369 37370 37371 /** 37372 * External dependencies 37373 */ 37374 37375 /** 37376 * WordPress dependencies 37377 */ 37378 37379 37380 37381 function MenuGroup({ 37382 children, 37383 className = '', 37384 label, 37385 hideSeparator 37386 }) { 37387 const instanceId = Object(external_wp_compose_["useInstanceId"])(MenuGroup); 37388 37389 if (!external_wp_element_["Children"].count(children)) { 37390 return null; 37391 } 37392 37393 const labelId = `components-menu-group-label-${instanceId}`; 37394 const classNames = classnames_default()(className, 'components-menu-group', { 37395 'has-hidden-separator': hideSeparator 37396 }); 37397 return Object(external_wp_element_["createElement"])("div", { 37398 className: classNames 37399 }, label && Object(external_wp_element_["createElement"])("div", { 37400 className: "components-menu-group__label", 37401 id: labelId, 37402 "aria-hidden": "true" 37403 }, label), Object(external_wp_element_["createElement"])("div", { 37404 role: "group", 37405 "aria-labelledby": label ? labelId : null 37406 }, children)); 37407 } 37408 /* harmony default export */ var menu_group = (MenuGroup); 37409 37410 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js 37411 var build_module_shortcut = __webpack_require__("Cw+6"); 37412 37413 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-item/index.js 37414 37415 37416 37417 /** 37418 * External dependencies 37419 */ 37420 37421 37422 /** 37423 * WordPress dependencies 37424 */ 37425 37426 37427 /** 37428 * Internal dependencies 37429 */ 37430 37431 37432 37433 37434 /** 37435 * Renders a generic menu item for use inside the more menu. 37436 * 37437 * @param {Object} props Component props. 37438 * @param {WPElement} props.children Element to render as child of button. 37439 * @param {string} props.info Text to use as description for button text. 37440 * @param {string} props.className Class to set on the container. 37441 * @param {WPIcon} props.icon Button's `icon` prop. 37442 * @param {string|Object} props.shortcut Shortcut's `shortcut` prop. 37443 * @param {boolean} props.isSelected Whether or not the menu item is currently selected. 37444 * @param {string} [props.role="menuitem"] ARIA role of the menu item. 37445 * @param {Object} ref React Element ref. 37446 * 37447 * @return {WPComponent} The component to be rendered. 37448 */ 37449 37450 function MenuItem({ 37451 children, 37452 info, 37453 className, 37454 icon, 37455 shortcut, 37456 isSelected, 37457 role = 'menuitem', 37458 ...props 37459 }, ref) { 37460 className = classnames_default()('components-menu-item__button', className); 37461 37462 if (info) { 37463 children = Object(external_wp_element_["createElement"])("span", { 37464 className: "components-menu-item__info-wrapper" 37465 }, Object(external_wp_element_["createElement"])("span", { 37466 className: "components-menu-item__item" 37467 }, children), Object(external_wp_element_["createElement"])("span", { 37468 className: "components-menu-item__info" 37469 }, info)); 37470 } 37471 37472 if (icon && !Object(external_lodash_["isString"])(icon)) { 37473 icon = Object(external_wp_element_["cloneElement"])(icon, { 37474 className: 'components-menu-items__item-icon' 37475 }); 37476 } 37477 37478 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 37479 ref: ref // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked 37480 , 37481 "aria-checked": role === 'menuitemcheckbox' || role === 'menuitemradio' ? isSelected : undefined, 37482 role: role, 37483 className: className 37484 }, props), Object(external_wp_element_["createElement"])("span", { 37485 className: "components-menu-item__item" 37486 }, children), Object(external_wp_element_["createElement"])(build_module_shortcut["a" /* default */], { 37487 className: "components-menu-item__shortcut", 37488 shortcut: shortcut 37489 }), icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 37490 icon: icon 37491 })); 37492 } 37493 /* harmony default export */ var menu_item = (Object(external_wp_element_["forwardRef"])(MenuItem)); 37494 37495 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js 37496 37497 37498 /** 37499 * External dependencies 37500 */ 37501 37502 /** 37503 * WordPress dependencies 37504 */ 37505 37506 37507 /** 37508 * Internal dependencies 37509 */ 37510 37511 37512 function MenuItemsChoice({ 37513 choices = [], 37514 onHover = external_lodash_["noop"], 37515 onSelect, 37516 value 37517 }) { 37518 return choices.map(item => { 37519 const isSelected = value === item.value; 37520 return Object(external_wp_element_["createElement"])(menu_item, { 37521 key: item.value, 37522 role: "menuitemradio", 37523 icon: isSelected && check["a" /* default */], 37524 info: item.info, 37525 isSelected: isSelected, 37526 shortcut: item.shortcut, 37527 className: "components-menu-items-choice", 37528 onClick: () => { 37529 if (!isSelected) { 37530 onSelect(item.value); 37531 } 37532 }, 37533 onMouseEnter: () => onHover(item.value), 37534 onMouseLeave: () => onHover(null), 37535 "aria-label": item['aria-label'] 37536 }, item.label); 37537 }); 37538 } 37539 37540 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js 37541 var scroll_lock = __webpack_require__("k8OV"); 37542 37543 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js 37544 37545 37546 37547 /** 37548 * WordPress dependencies 37549 */ 37550 37551 37552 /** 37553 * Internal dependencies 37554 */ 37555 37556 37557 function TabbableContainer({ 37558 eventToOffset, 37559 ...props 37560 }, ref) { 37561 const innerEventToOffset = evt => { 37562 const { 37563 keyCode, 37564 shiftKey 37565 } = evt; 37566 37567 if (external_wp_keycodes_["TAB"] === keyCode) { 37568 return shiftKey ? -1 : 1; 37569 } // Allow custom handling of keys besides Tab. 37570 // 37571 // By default, TabbableContainer will move focus forward on Tab and 37572 // backward on Shift+Tab. The handler below will be used for all other 37573 // events. The semantics for `eventToOffset`'s return 37574 // values are the following: 37575 // 37576 // - +1: move focus forward 37577 // - -1: move focus backward 37578 // - 0: don't move focus, but acknowledge event and thus stop it 37579 // - undefined: do nothing, let the event propagate 37580 37581 37582 if (eventToOffset) { 37583 return eventToOffset(evt); 37584 } 37585 }; 37586 37587 return Object(external_wp_element_["createElement"])(navigable_container_container, Object(esm_extends["a" /* default */])({ 37588 ref: ref, 37589 stopNavigationEvents: true, 37590 onlyBrowserTabstops: true, 37591 eventToOffset: innerEventToOffset 37592 }, props)); 37593 } 37594 /* harmony default export */ var tabbable = (Object(external_wp_element_["forwardRef"])(TabbableContainer)); 37595 37596 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/constants.js 37597 const ROOT_MENU = 'root'; 37598 const SEARCH_FOCUS_DELAY = 100; 37599 37600 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/context.js 37601 /** 37602 * External dependencies 37603 */ 37604 37605 /** 37606 * WordPress dependencies 37607 */ 37608 37609 37610 /** 37611 * Internal dependencies 37612 */ 37613 37614 37615 const NavigationContext = Object(external_wp_element_["createContext"])({ 37616 activeItem: undefined, 37617 activeMenu: ROOT_MENU, 37618 setActiveMenu: external_lodash_["noop"], 37619 isMenuEmpty: external_lodash_["noop"], 37620 navigationTree: { 37621 items: {}, 37622 getItem: external_lodash_["noop"], 37623 addItem: external_lodash_["noop"], 37624 removeItem: external_lodash_["noop"], 37625 menus: {}, 37626 getMenu: external_lodash_["noop"], 37627 addMenu: external_lodash_["noop"], 37628 removeMenu: external_lodash_["noop"], 37629 childMenu: {}, 37630 traverseMenu: external_lodash_["noop"], 37631 isMenuEmpty: external_lodash_["noop"] 37632 } 37633 }); 37634 const useNavigationContext = () => Object(external_wp_element_["useContext"])(NavigationContext); 37635 37636 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/styles/navigation-styles.js 37637 37638 37639 function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 37640 37641 /** 37642 * WordPress dependencies 37643 */ 37644 37645 /** 37646 * Internal dependencies 37647 */ 37648 37649 37650 37651 37652 37653 const NavigationUI = styled_base_browser_esm("div", { 37654 target: "ejwewyf0", 37655 label: "NavigationUI" 37656 })("width:100%;background-color:", G2.darkGray.primary, ";box-sizing:border-box;color:#f0f0f0;padding:0 ", space(2), ";overflow:hidden;" + ( true ? "" : undefined)); 37657 const MenuUI = styled_base_browser_esm("div", { 37658 target: "ejwewyf1", 37659 label: "MenuUI" 37660 })("margin-top:", space(3), ";margin-bottom:", space(3), ";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:", space(3), ";}.components-navigation__group + .components-navigation__group{margin-top:", space(3), ";}" + ( true ? "" : undefined)); 37661 const MenuBackButtonUI = /*#__PURE__*/styled_base_browser_esm(build_module_button["a" /* default */], { 37662 target: "ejwewyf2", 37663 label: "MenuBackButtonUI" 37664 })("&.is-tertiary{color:", G2.lightGray.ui, ";&:hover:not(:disabled ){color:#ddd;box-shadow:none;}&:active:not(:disabled ){background:transparent;color:#ddd;}}" + ( true ? "" : undefined)); 37665 const MenuTitleUI = styled_base_browser_esm("div", { 37666 target: "ejwewyf3", 37667 label: "MenuTitleUI" 37668 })( true ? { 37669 name: "16agjqd", 37670 styles: "overflow:hidden;width:100%;" 37671 } : undefined); 37672 const MenuTitleHeadingUI = /*#__PURE__*/styled_base_browser_esm(text_component, { 37673 target: "ejwewyf4", 37674 label: "MenuTitleHeadingUI" 37675 })("align-items:center;color:", G2.gray[100], ";display:flex;justify-content:space-between;margin-bottom:", space(1), ";padding:", () => Object(external_wp_i18n_["isRTL"])() ? `${space(0.5)} ${space(2)} ${space(0.5)} ${space(1.5)}` : `${space(0.5)} ${space(1.5)} ${space(0.5)} ${space(2)}`, ";" + ( true ? "" : undefined)); 37676 const MenuTitleActionsUI = styled_base_browser_esm("span", { 37677 target: "ejwewyf5", 37678 label: "MenuTitleActionsUI" 37679 })("height:", space(3), ";.components-button.is-small{color:", G2.lightGray.ui, ";margin-right:", space(0.5), ";padding:0;&:active:not(:disabled ){background:none;color:", G2.gray[200], ";}&:hover:not(:disabled ){box-shadow:none;color:", G2.gray[200], ";}}" + ( true ? "" : undefined)); 37680 const MenuTitleSearchUI = styled_base_browser_esm("div", { 37681 target: "ejwewyf6", 37682 label: "MenuTitleSearchUI" 37683 })("padding:0;position:relative;input{height:", space(4.5), ";margin-bottom:", space(1), ";padding-left:", space(4), ";padding-right:", space(4), ";&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}> svg{left:", space(0.5), ";position:absolute;top:6px;}.components-button.is-small{height:30px;padding:0;position:absolute;right:", space(1), ";top:3px;&:active:not(:disabled ){background:none;}&:hover:not(:disabled ){box-shadow:none;}}" + ( true ? "" : undefined)); 37684 const GroupTitleUI = /*#__PURE__*/styled_base_browser_esm(text_component, { 37685 target: "ejwewyf7", 37686 label: "GroupTitleUI" 37687 })("margin-top:", space(1), ";padding:", () => Object(external_wp_i18n_["isRTL"])() ? `${space(0.5)} ${space(2)} ${space(0.5)} 0` : `${space(0.5)} 0 ${space(0.5)} ${space(2)}`, ";text-transform:uppercase;color:", G2.gray[100], ";" + ( true ? "" : undefined)); 37688 const ItemBaseUI = styled_base_browser_esm("li", { 37689 target: "ejwewyf8", 37690 label: "ItemBaseUI" 37691 })("border-radius:2px;color:", G2.lightGray.ui, ";margin-bottom:0;button,a.components-button,a{width:100%;color:", G2.lightGray.ui, ";padding:", space(1), " ", space(2), ";", rtl_rtl({ 37692 textAlign: 'left' 37693 }, { 37694 textAlign: 'right' 37695 }), " &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:#ddd;}}&.is-active{background-color:", UI.theme, ";color:", UI.textDark, ";button,a{color:", UI.textDark, ";}}svg path{color:", G2.lightGray.ui, ";}" + ( true ? "" : undefined)); 37696 const ItemUI = styled_base_browser_esm("div", { 37697 target: "ejwewyf9", 37698 label: "ItemUI" 37699 })("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:", space(0.75), " ", space(2), ";font-weight:400;line-height:20px;width:100%;color:", G2.lightGray.ui, ";" + ( true ? "" : undefined)); 37700 const ItemBadgeUI = styled_base_browser_esm("span", { 37701 target: "ejwewyf10", 37702 label: "ItemBadgeUI" 37703 })("margin-left:", () => Object(external_wp_i18n_["isRTL"])() ? '0' : space(1), ";margin-right:", () => Object(external_wp_i18n_["isRTL"])() ? space(1) : '0', ";display:inline-flex;padding:", space(0.5), " ", space(1.5), ";border-radius:2px;animation:fade-in 250ms ease-out;@keyframes fade-in{from{opacity:0;}to{opacity:1;}}", reduceMotion('animation'), ";" + ( true ? "" : undefined)); 37704 const ItemTitleUI = /*#__PURE__*/styled_base_browser_esm(text_component, { 37705 target: "ejwewyf11", 37706 label: "ItemTitleUI" 37707 })(() => Object(external_wp_i18n_["isRTL"])() ? 'margin-left: auto;' : 'margin-right: auto;', " font-size:14px;line-height:20px;color:inherit;" + ( true ? "" : undefined)); 37708 37709 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/use-navigation-tree-nodes.js 37710 /** 37711 * External dependencies 37712 */ 37713 37714 /** 37715 * WordPress dependencies 37716 */ 37717 37718 37719 const useNavigationTreeNodes = () => { 37720 const [nodes, setNodes] = Object(external_wp_element_["useState"])({}); 37721 37722 const getNode = key => nodes[key]; 37723 37724 const addNode = (key, value) => setNodes(original => ({ ...original, 37725 [key]: Object(external_lodash_["omit"])(value, 'children') 37726 })); 37727 37728 const removeNode = key => setNodes(original => Object(external_lodash_["omit"])(original, key)); 37729 37730 return { 37731 nodes, 37732 getNode, 37733 addNode, 37734 removeNode 37735 }; 37736 }; 37737 37738 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/use-create-navigation-tree.js 37739 /** 37740 * WordPress dependencies 37741 */ 37742 37743 /** 37744 * Internal dependencies 37745 */ 37746 37747 37748 const useCreateNavigationTree = () => { 37749 const { 37750 nodes: items, 37751 getNode: getItem, 37752 addNode: addItem, 37753 removeNode: removeItem 37754 } = useNavigationTreeNodes(); 37755 const { 37756 nodes: menus, 37757 getNode: getMenu, 37758 addNode: addMenu, 37759 removeNode: removeMenu 37760 } = useNavigationTreeNodes(); 37761 /** 37762 * Stores direct nested menus of menus 37763 * This makes it easy to traverse menu tree 37764 * 37765 * Key is the menu prop of the menu 37766 * Value is an array of menu keys 37767 */ 37768 37769 const [childMenu, setChildMenu] = Object(external_wp_element_["useState"])({}); 37770 37771 const getChildMenu = menu => childMenu[menu] || []; 37772 37773 const traverseMenu = (startMenu, callback) => { 37774 const visited = []; 37775 let queue = [startMenu]; 37776 let current; 37777 37778 while (queue.length > 0) { 37779 current = getMenu(queue.shift()); 37780 37781 if (!current || visited.includes(current.menu)) { 37782 continue; 37783 } 37784 37785 visited.push(current.menu); 37786 queue = [...queue, ...getChildMenu(current.menu)]; 37787 37788 if (callback(current) === false) { 37789 break; 37790 } 37791 } 37792 }; 37793 37794 const isMenuEmpty = menuToCheck => { 37795 let isEmpty = true; 37796 traverseMenu(menuToCheck, current => { 37797 if (!current.isEmpty) { 37798 isEmpty = false; 37799 return false; 37800 } 37801 }); 37802 return isEmpty; 37803 }; 37804 37805 return { 37806 items, 37807 getItem, 37808 addItem, 37809 removeItem, 37810 menus, 37811 getMenu, 37812 addMenu: (key, value) => { 37813 setChildMenu(state => { 37814 const newState = { ...state 37815 }; 37816 37817 if (!newState[value.parentMenu]) { 37818 newState[value.parentMenu] = []; 37819 } 37820 37821 newState[value.parentMenu].push(key); 37822 return newState; 37823 }); 37824 addMenu(key, value); 37825 }, 37826 removeMenu, 37827 childMenu, 37828 traverseMenu, 37829 isMenuEmpty 37830 }; 37831 }; 37832 37833 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/index.js 37834 37835 37836 /** 37837 * External dependencies 37838 */ 37839 37840 37841 /** 37842 * WordPress dependencies 37843 */ 37844 37845 37846 37847 /** 37848 * Internal dependencies 37849 */ 37850 37851 37852 37853 37854 37855 37856 function Navigation({ 37857 activeItem, 37858 activeMenu = ROOT_MENU, 37859 children, 37860 className, 37861 onActivateMenu = external_lodash_["noop"] 37862 }) { 37863 const [menu, setMenu] = Object(external_wp_element_["useState"])(activeMenu); 37864 const [slideOrigin, setSlideOrigin] = Object(external_wp_element_["useState"])(); 37865 const navigationTree = useCreateNavigationTree(); 37866 const defaultSlideOrigin = Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left'; 37867 37868 const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => { 37869 if (!navigationTree.getMenu(menuId)) { 37870 return; 37871 } 37872 37873 setSlideOrigin(slideInOrigin); 37874 setMenu(menuId); 37875 onActivateMenu(menuId); 37876 }; // Used to prevent the sliding animation on mount 37877 37878 37879 const isMounted = Object(external_wp_element_["useRef"])(false); 37880 Object(external_wp_element_["useEffect"])(() => { 37881 if (!isMounted.current) { 37882 isMounted.current = true; 37883 } 37884 }, []); 37885 Object(external_wp_element_["useEffect"])(() => { 37886 if (activeMenu !== menu) { 37887 setActiveMenu(activeMenu); 37888 } 37889 }, [activeMenu]); 37890 const context = { 37891 activeItem, 37892 activeMenu: menu, 37893 setActiveMenu, 37894 navigationTree 37895 }; 37896 const classes = classnames_default()('components-navigation', className); 37897 const animateClassName = Object(animate["b" /* getAnimateClassName */])({ 37898 type: 'slide-in', 37899 origin: slideOrigin 37900 }); 37901 return Object(external_wp_element_["createElement"])(NavigationUI, { 37902 className: classes 37903 }, Object(external_wp_element_["createElement"])("div", { 37904 key: menu, 37905 className: classnames_default()({ 37906 [animateClassName]: isMounted.current && slideOrigin 37907 }) 37908 }, Object(external_wp_element_["createElement"])(NavigationContext.Provider, { 37909 value: context 37910 }, children))); 37911 } 37912 37913 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js 37914 var chevron_right = __webpack_require__("1iEr"); 37915 37916 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js 37917 var chevron_left = __webpack_require__("2gm7"); 37918 37919 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/back-button/index.js 37920 37921 37922 /** 37923 * External dependencies 37924 */ 37925 37926 /** 37927 * WordPress dependencies 37928 */ 37929 37930 37931 37932 37933 /** 37934 * Internal dependencies 37935 */ 37936 37937 37938 37939 37940 function NavigationBackButton({ 37941 backButtonLabel, 37942 className, 37943 href, 37944 onClick, 37945 parentMenu 37946 }, ref) { 37947 var _navigationTree$getMe; 37948 37949 const { 37950 setActiveMenu, 37951 navigationTree 37952 } = useNavigationContext(); 37953 const classes = classnames_default()('components-navigation__back-button', className); 37954 const parentMenuTitle = (_navigationTree$getMe = navigationTree.getMenu(parentMenu)) === null || _navigationTree$getMe === void 0 ? void 0 : _navigationTree$getMe.title; 37955 37956 const handleOnClick = event => { 37957 if (typeof onClick === 'function') { 37958 onClick(event); 37959 } 37960 37961 const animationDirection = Object(external_wp_i18n_["isRTL"])() ? 'left' : 'right'; 37962 37963 if (parentMenu && !event.defaultPrevented) { 37964 setActiveMenu(parentMenu, animationDirection); 37965 } 37966 }; 37967 37968 const icon = Object(external_wp_i18n_["isRTL"])() ? chevron_right["a" /* default */] : chevron_left["a" /* default */]; 37969 return Object(external_wp_element_["createElement"])(MenuBackButtonUI, { 37970 className: classes, 37971 href: href, 37972 isTertiary: true, 37973 ref: ref, 37974 onClick: handleOnClick 37975 }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 37976 icon: icon 37977 }), backButtonLabel || parentMenuTitle || Object(external_wp_i18n_["__"])('Back')); 37978 } 37979 37980 /* harmony default export */ var back_button = (Object(external_wp_element_["forwardRef"])(NavigationBackButton)); 37981 37982 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/group/context.js 37983 /** 37984 * WordPress dependencies 37985 */ 37986 37987 const NavigationGroupContext = Object(external_wp_element_["createContext"])({ 37988 group: undefined 37989 }); 37990 const useNavigationGroupContext = () => Object(external_wp_element_["useContext"])(NavigationGroupContext); 37991 37992 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/group/index.js 37993 37994 37995 /** 37996 * External dependencies 37997 */ 37998 37999 38000 /** 38001 * WordPress dependencies 38002 */ 38003 38004 38005 /** 38006 * Internal dependencies 38007 */ 38008 38009 38010 38011 38012 function NavigationGroup({ 38013 children, 38014 className, 38015 title 38016 }) { 38017 const [groupId] = Object(external_wp_element_["useState"])(Object(external_lodash_["uniqueId"])('group-')); 38018 const { 38019 navigationTree: { 38020 items 38021 } 38022 } = useNavigationContext(); 38023 const context = { 38024 group: groupId 38025 }; // Keep the children rendered to make sure invisible items are included in the navigation tree. 38026 38027 if (!Object(external_lodash_["find"])(items, { 38028 group: groupId, 38029 _isVisible: true 38030 })) { 38031 return Object(external_wp_element_["createElement"])(NavigationGroupContext.Provider, { 38032 value: context 38033 }, children); 38034 } 38035 38036 const groupTitleId = `components-navigation__group-title-${groupId}`; 38037 const classes = classnames_default()('components-navigation__group', className); 38038 return Object(external_wp_element_["createElement"])(NavigationGroupContext.Provider, { 38039 value: context 38040 }, Object(external_wp_element_["createElement"])("li", { 38041 className: classes 38042 }, title && Object(external_wp_element_["createElement"])(GroupTitleUI, { 38043 as: "h3", 38044 className: "components-navigation__group-title", 38045 id: groupTitleId, 38046 variant: "caption" 38047 }, title), Object(external_wp_element_["createElement"])("ul", { 38048 "aria-labelledby": groupTitleId, 38049 role: "group" 38050 }, children))); 38051 } 38052 38053 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/base-content.js 38054 38055 38056 /** 38057 * Internal dependencies 38058 */ 38059 38060 function NavigationItemBaseContent(props) { 38061 const { 38062 badge, 38063 title 38064 } = props; 38065 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, title && Object(external_wp_element_["createElement"])(ItemTitleUI, { 38066 className: "components-navigation__item-title", 38067 variant: "body.small", 38068 as: "span" 38069 }, title), badge && Object(external_wp_element_["createElement"])(ItemBadgeUI, { 38070 className: "components-navigation__item-badge" 38071 }, badge)); 38072 } 38073 38074 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/context.js 38075 /** 38076 * WordPress dependencies 38077 */ 38078 38079 const NavigationMenuContext = Object(external_wp_element_["createContext"])({ 38080 menu: undefined, 38081 search: '' 38082 }); 38083 const useNavigationMenuContext = () => Object(external_wp_element_["useContext"])(NavigationMenuContext); 38084 38085 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/utils.js 38086 /** 38087 * External dependencies 38088 */ 38089 // @see packages/block-editor/src/components/inserter/search-items.js 38090 38091 const normalizeInput = input => Object(external_lodash_["deburr"])(input).replace(/^\//, '').toLowerCase(); 38092 const normalizedSearch = (title, search) => -1 !== normalizeInput(title).indexOf(normalizeInput(search)); 38093 38094 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/use-navigation-tree-item.js 38095 /** 38096 * WordPress dependencies 38097 */ 38098 38099 /** 38100 * Internal dependencies 38101 */ 38102 38103 38104 38105 38106 38107 const useNavigationTreeItem = (itemId, props) => { 38108 const { 38109 activeMenu, 38110 navigationTree: { 38111 addItem, 38112 removeItem 38113 } 38114 } = useNavigationContext(); 38115 const { 38116 group 38117 } = useNavigationGroupContext(); 38118 const { 38119 menu, 38120 search 38121 } = useNavigationMenuContext(); 38122 Object(external_wp_element_["useEffect"])(() => { 38123 const isMenuActive = activeMenu === menu; 38124 const isItemVisible = !search || normalizedSearch(props.title, search); 38125 addItem(itemId, { ...props, 38126 group, 38127 menu, 38128 _isVisible: isMenuActive && isItemVisible 38129 }); 38130 return () => { 38131 removeItem(itemId); 38132 }; 38133 }, [activeMenu, search]); 38134 }; 38135 38136 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/base.js 38137 38138 38139 38140 /** 38141 * External dependencies 38142 */ 38143 38144 38145 /** 38146 * WordPress dependencies 38147 */ 38148 38149 38150 /** 38151 * Internal dependencies 38152 */ 38153 38154 38155 38156 38157 function NavigationItemBase(props) { 38158 var _navigationTree$getIt; 38159 38160 const { 38161 children, 38162 className, 38163 ...restProps 38164 } = props; 38165 const [itemId] = Object(external_wp_element_["useState"])(Object(external_lodash_["uniqueId"])('item-')); 38166 useNavigationTreeItem(itemId, props); 38167 const { 38168 navigationTree 38169 } = useNavigationContext(); 38170 38171 if (!((_navigationTree$getIt = navigationTree.getItem(itemId)) !== null && _navigationTree$getIt !== void 0 && _navigationTree$getIt._isVisible)) { 38172 return null; 38173 } 38174 38175 const classes = classnames_default()('components-navigation__item', className); 38176 return Object(external_wp_element_["createElement"])(ItemBaseUI, Object(esm_extends["a" /* default */])({ 38177 className: classes 38178 }, restProps), children); 38179 } 38180 38181 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/index.js 38182 38183 38184 38185 /** 38186 * External dependencies 38187 */ 38188 38189 38190 /** 38191 * WordPress dependencies 38192 */ 38193 38194 38195 38196 /** 38197 * Internal dependencies 38198 */ 38199 38200 38201 38202 38203 38204 38205 function NavigationItem(props) { 38206 const { 38207 badge, 38208 children, 38209 className, 38210 href, 38211 item, 38212 navigateToMenu, 38213 onClick = external_lodash_["noop"], 38214 title, 38215 hideIfTargetMenuEmpty, 38216 isText, 38217 ...restProps 38218 } = props; 38219 const { 38220 activeItem, 38221 setActiveMenu, 38222 navigationTree: { 38223 isMenuEmpty 38224 } 38225 } = useNavigationContext(); // If hideIfTargetMenuEmpty prop is true 38226 // And the menu we are supposed to navigate to 38227 // Is marked as empty, then we skip rendering the item 38228 38229 if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) { 38230 return null; 38231 } 38232 38233 const classes = classnames_default()(className, { 38234 'is-active': item && activeItem === item 38235 }); 38236 38237 const onItemClick = event => { 38238 if (navigateToMenu) { 38239 setActiveMenu(navigateToMenu); 38240 } 38241 38242 onClick(event); 38243 }; 38244 38245 const icon = Object(external_wp_i18n_["isRTL"])() ? chevron_left["a" /* default */] : chevron_right["a" /* default */]; 38246 const baseProps = isText ? restProps : { 38247 as: build_module_button["a" /* default */], 38248 href, 38249 onClick: onItemClick, 38250 ...restProps 38251 }; 38252 return Object(external_wp_element_["createElement"])(NavigationItemBase, Object(esm_extends["a" /* default */])({}, props, { 38253 className: classes 38254 }), children || Object(external_wp_element_["createElement"])(ItemUI, baseProps, Object(external_wp_element_["createElement"])(NavigationItemBaseContent, { 38255 title: title, 38256 badge: badge 38257 }), navigateToMenu && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 38258 icon: icon 38259 }))); 38260 } 38261 38262 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js 38263 /** 38264 * WordPress dependencies 38265 */ 38266 38267 /** 38268 * Internal dependencies 38269 */ 38270 38271 38272 38273 const useNavigationTreeMenu = props => { 38274 const { 38275 navigationTree: { 38276 addMenu, 38277 removeMenu 38278 } 38279 } = useNavigationContext(); 38280 const key = props.menu || ROOT_MENU; 38281 Object(external_wp_element_["useEffect"])(() => { 38282 addMenu(key, { ...props, 38283 menu: key 38284 }); 38285 return () => { 38286 removeMenu(key); 38287 }; 38288 }, []); 38289 }; 38290 38291 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js 38292 var library_search = __webpack_require__("cGtP"); 38293 38294 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title-search.js 38295 38296 38297 /** 38298 * External dependencies 38299 */ 38300 38301 /** 38302 * WordPress dependencies 38303 */ 38304 38305 38306 38307 38308 38309 /** 38310 * Internal dependencies 38311 */ 38312 38313 38314 38315 38316 38317 38318 38319 38320 38321 function MenuTitleSearch({ 38322 debouncedSpeak, 38323 onCloseSearch, 38324 onSearch, 38325 search, 38326 title 38327 }) { 38328 const { 38329 navigationTree: { 38330 items 38331 } 38332 } = useNavigationContext(); 38333 const { 38334 menu 38335 } = useNavigationMenuContext(); 38336 const inputRef = Object(external_wp_element_["useRef"])(); // Wait for the slide-in animation to complete before autofocusing the input. 38337 // This prevents scrolling to the input during the animation. 38338 38339 Object(external_wp_element_["useEffect"])(() => { 38340 const delayedFocus = setTimeout(() => { 38341 inputRef.current.focus(); 38342 }, SEARCH_FOCUS_DELAY); 38343 return () => { 38344 clearTimeout(delayedFocus); 38345 }; 38346 }, []); 38347 Object(external_wp_element_["useEffect"])(() => { 38348 if (!search) { 38349 return; 38350 } 38351 38352 const count = Object(external_lodash_["filter"])(items, '_isVisible').length; 38353 const resultsFoundMessage = Object(external_wp_i18n_["sprintf"])( 38354 /* translators: %d: number of results. */ 38355 Object(external_wp_i18n_["_n"])('%d result found.', '%d results found.', count), count); 38356 debouncedSpeak(resultsFoundMessage); 38357 }, [items, search]); 38358 38359 const onClose = () => { 38360 onSearch(''); 38361 onCloseSearch(); 38362 }; 38363 38364 function onKeyDown(event) { 38365 if (event.keyCode === external_wp_keycodes_["ESCAPE"]) { 38366 event.stopPropagation(); 38367 onClose(); 38368 } 38369 } 38370 38371 const menuTitleId = `components-navigation__menu-title-${menu}`; 38372 const inputId = `components-navigation__menu-title-search-${menu}`; 38373 /* translators: placeholder for menu search box. %s: menu title */ 38374 38375 const placeholder = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Search in %s'), title); 38376 return Object(external_wp_element_["createElement"])(MenuTitleSearchUI, { 38377 className: "components-navigation__menu-title-search" 38378 }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 38379 icon: library_search["a" /* default */] 38380 }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], { 38381 as: "label", 38382 htmlFor: inputId, 38383 id: menuTitleId 38384 }, placeholder), Object(external_wp_element_["createElement"])("input", { 38385 autoComplete: "off", 38386 className: "components-text-control__input", 38387 id: inputId, 38388 onChange: event => onSearch(event.target.value), 38389 onKeyDown: onKeyDown, 38390 placeholder: placeholder, 38391 ref: inputRef, 38392 type: "search", 38393 value: search 38394 }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 38395 isSmall: true, 38396 isTertiary: true, 38397 label: Object(external_wp_i18n_["__"])('Close search'), 38398 onClick: onClose 38399 }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 38400 icon: close_small["a" /* default */] 38401 }))); 38402 } 38403 38404 /* harmony default export */ var menu_title_search = (with_spoken_messages(MenuTitleSearch)); 38405 38406 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title.js 38407 38408 38409 /** 38410 * WordPress dependencies 38411 */ 38412 38413 38414 38415 /** 38416 * Internal dependencies 38417 */ 38418 38419 38420 38421 38422 38423 38424 38425 function NavigationMenuTitle({ 38426 hasSearch, 38427 onSearch, 38428 search, 38429 title, 38430 titleAction 38431 }) { 38432 const [isSearching, setIsSearching] = Object(external_wp_element_["useState"])(false); 38433 const { 38434 menu 38435 } = useNavigationMenuContext(); 38436 const searchButtonRef = Object(external_wp_element_["useRef"])(); 38437 38438 if (!title) { 38439 return null; 38440 } 38441 38442 const onCloseSearch = () => { 38443 setIsSearching(false); // Wait for the slide-in animation to complete before focusing the search button. 38444 // eslint-disable-next-line @wordpress/react-no-unsafe-timeout 38445 38446 setTimeout(() => { 38447 searchButtonRef.current.focus(); 38448 }, SEARCH_FOCUS_DELAY); 38449 }; 38450 38451 const menuTitleId = `components-navigation__menu-title-${menu}`; 38452 /* translators: search button label for menu search box. %s: menu title */ 38453 38454 const searchButtonLabel = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Search in %s'), title); 38455 return Object(external_wp_element_["createElement"])(MenuTitleUI, { 38456 className: "components-navigation__menu-title" 38457 }, !isSearching && Object(external_wp_element_["createElement"])(MenuTitleHeadingUI, { 38458 as: "h2", 38459 className: "components-navigation__menu-title-heading", 38460 variant: "title.small" 38461 }, Object(external_wp_element_["createElement"])("span", { 38462 id: menuTitleId 38463 }, title), (hasSearch || titleAction) && Object(external_wp_element_["createElement"])(MenuTitleActionsUI, null, titleAction, hasSearch && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 38464 isSmall: true, 38465 isTertiary: true, 38466 label: searchButtonLabel, 38467 onClick: () => setIsSearching(true), 38468 ref: searchButtonRef 38469 }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 38470 icon: library_search["a" /* default */] 38471 })))), isSearching && Object(external_wp_element_["createElement"])("div", { 38472 className: Object(animate["b" /* getAnimateClassName */])({ 38473 type: 'slide-in', 38474 origin: 'left' 38475 }) 38476 }, Object(external_wp_element_["createElement"])(menu_title_search, { 38477 onCloseSearch: onCloseSearch, 38478 onSearch: onSearch, 38479 search: search, 38480 title: title 38481 }))); 38482 } 38483 38484 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/search-no-results-found.js 38485 38486 38487 /** 38488 * External dependencies 38489 */ 38490 38491 /** 38492 * WordPress dependencies 38493 */ 38494 38495 38496 /** 38497 * Internal dependencies 38498 */ 38499 38500 38501 38502 function NavigationSearchNoResultsFound({ 38503 search 38504 }) { 38505 const { 38506 navigationTree: { 38507 items 38508 } 38509 } = useNavigationContext(); 38510 const resultsCount = Object(external_lodash_["filter"])(items, '_isVisible').length; 38511 38512 if (!search || !!resultsCount) { 38513 return null; 38514 } 38515 38516 return Object(external_wp_element_["createElement"])(ItemBaseUI, null, Object(external_wp_element_["createElement"])(ItemUI, null, Object(external_wp_i18n_["__"])('No results found.'), " ")); 38517 } 38518 38519 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/index.js 38520 38521 38522 /** 38523 * External dependencies 38524 */ 38525 38526 /** 38527 * WordPress dependencies 38528 */ 38529 38530 38531 /** 38532 * Internal dependencies 38533 */ 38534 38535 38536 38537 38538 38539 38540 38541 38542 38543 38544 function NavigationMenu(props) { 38545 const { 38546 backButtonLabel, 38547 children, 38548 className, 38549 hasSearch, 38550 menu = ROOT_MENU, 38551 onBackButtonClick, 38552 onSearch: setControlledSearch, 38553 parentMenu, 38554 search: controlledSearch, 38555 isSearchDebouncing, 38556 title, 38557 titleAction 38558 } = props; 38559 const [uncontrolledSearch, setUncontrolledSearch] = Object(external_wp_element_["useState"])(''); 38560 useNavigationTreeMenu(props); 38561 const { 38562 activeMenu 38563 } = useNavigationContext(); 38564 const context = { 38565 menu, 38566 search: uncontrolledSearch 38567 }; // Keep the children rendered to make sure invisible items are included in the navigation tree 38568 38569 if (activeMenu !== menu) { 38570 return Object(external_wp_element_["createElement"])(NavigationMenuContext.Provider, { 38571 value: context 38572 }, children); 38573 } 38574 38575 const isControlledSearch = !!setControlledSearch; 38576 const search = isControlledSearch ? controlledSearch : uncontrolledSearch; 38577 const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch; 38578 const menuTitleId = `components-navigation__menu-title-${menu}`; 38579 const classes = classnames_default()('components-navigation__menu', className); 38580 return Object(external_wp_element_["createElement"])(NavigationMenuContext.Provider, { 38581 value: context 38582 }, Object(external_wp_element_["createElement"])(MenuUI, { 38583 className: classes 38584 }, (parentMenu || onBackButtonClick) && Object(external_wp_element_["createElement"])(back_button, { 38585 backButtonLabel: backButtonLabel, 38586 parentMenu: parentMenu, 38587 onClick: onBackButtonClick 38588 }), Object(external_wp_element_["createElement"])(NavigationMenuTitle, { 38589 hasSearch: hasSearch, 38590 onSearch: onSearch, 38591 search: search, 38592 title: title, 38593 titleAction: titleAction 38594 }), Object(external_wp_element_["createElement"])(navigable_container_menu, null, Object(external_wp_element_["createElement"])("ul", { 38595 "aria-labelledby": menuTitleId 38596 }, children, search && !isSearchDebouncing && Object(external_wp_element_["createElement"])(NavigationSearchNoResultsFound, { 38597 search: search 38598 }))))); 38599 } 38600 38601 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/index.js 38602 38603 38604 /** 38605 * External dependencies 38606 */ 38607 38608 38609 /** 38610 * WordPress dependencies 38611 */ 38612 38613 38614 38615 38616 38617 /** 38618 * Internal dependencies 38619 */ 38620 38621 38622 /** @typedef {import('@wordpress/element').WPElement} WPElement */ 38623 38624 /** 38625 * Custom hook which announces the message with the given politeness, if a 38626 * valid message is provided. 38627 * 38628 * @param {string|WPElement} [message] Message to announce. 38629 * @param {'polite'|'assertive'} politeness Politeness to announce. 38630 */ 38631 38632 function useSpokenMessage(message, politeness) { 38633 const spokenMessage = typeof message === 'string' ? message : Object(external_wp_element_["renderToString"])(message); 38634 Object(external_wp_element_["useEffect"])(() => { 38635 if (spokenMessage) { 38636 Object(external_wp_a11y_["speak"])(spokenMessage, politeness); 38637 } 38638 }, [spokenMessage, politeness]); 38639 } 38640 /** 38641 * Given a notice status, returns an assumed default politeness for the status. 38642 * Defaults to 'assertive'. 38643 * 38644 * @param {string} [status] Notice status. 38645 * 38646 * @return {'polite'|'assertive'} Notice politeness. 38647 */ 38648 38649 38650 function getDefaultPoliteness(status) { 38651 switch (status) { 38652 case 'success': 38653 case 'warning': 38654 case 'info': 38655 return 'polite'; 38656 38657 case 'error': 38658 default: 38659 return 'assertive'; 38660 } 38661 } 38662 38663 function Notice({ 38664 className, 38665 status = 'info', 38666 children, 38667 spokenMessage = children, 38668 onRemove = external_lodash_["noop"], 38669 isDismissible = true, 38670 actions = [], 38671 politeness = getDefaultPoliteness(status), 38672 __unstableHTML 38673 }) { 38674 useSpokenMessage(spokenMessage, politeness); 38675 const classes = classnames_default()(className, 'components-notice', 'is-' + status, { 38676 'is-dismissible': isDismissible 38677 }); 38678 38679 if (__unstableHTML) { 38680 children = Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, children); 38681 } 38682 38683 return Object(external_wp_element_["createElement"])("div", { 38684 className: classes 38685 }, Object(external_wp_element_["createElement"])("div", { 38686 className: "components-notice__content" 38687 }, children, Object(external_wp_element_["createElement"])("div", { 38688 className: "components-notice__actions" 38689 }, actions.map(({ 38690 className: buttonCustomClasses, 38691 label, 38692 isPrimary, 38693 noDefaultClasses = false, 38694 onClick, 38695 url 38696 }, index) => { 38697 return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 38698 key: index, 38699 href: url, 38700 isPrimary: isPrimary, 38701 isSecondary: !noDefaultClasses && !url, 38702 isLink: !noDefaultClasses && !!url, 38703 onClick: url ? undefined : onClick, 38704 className: classnames_default()('components-notice__action', buttonCustomClasses) 38705 }, label); 38706 }))), isDismissible && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 38707 className: "components-notice__dismiss", 38708 icon: library_close["a" /* default */], 38709 label: Object(external_wp_i18n_["__"])('Dismiss this notice'), 38710 onClick: onRemove, 38711 showTooltip: false 38712 })); 38713 } 38714 38715 /* harmony default export */ var build_module_notice = (Notice); 38716 38717 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/list.js 38718 38719 38720 38721 /** 38722 * External dependencies 38723 */ 38724 38725 38726 /** 38727 * Internal dependencies 38728 */ 38729 38730 38731 /** 38732 * Renders a list of notices. 38733 * 38734 * @param {Object} $0 Props passed to the component. 38735 * @param {Array} $0.notices Array of notices to render. 38736 * @param {Function} $0.onRemove Function called when a notice should be removed / dismissed. 38737 * @param {Object} $0.className Name of the class used by the component. 38738 * @param {Object} $0.children Array of children to be rendered inside the notice list. 38739 * @return {Object} The rendered notices list. 38740 */ 38741 38742 function NoticeList({ 38743 notices, 38744 onRemove = external_lodash_["noop"], 38745 className, 38746 children 38747 }) { 38748 const removeNotice = id => () => onRemove(id); 38749 38750 className = classnames_default()('components-notice-list', className); 38751 return Object(external_wp_element_["createElement"])("div", { 38752 className: className 38753 }, children, [...notices].reverse().map(notice => Object(external_wp_element_["createElement"])(build_module_notice, Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), { 38754 key: notice.id, 38755 onRemove: removeNotice(notice.id) 38756 }), notice.content))); 38757 } 38758 38759 /* harmony default export */ var list = (NoticeList); 38760 38761 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/header.js 38762 38763 38764 function PanelHeader({ 38765 label, 38766 children 38767 }) { 38768 return Object(external_wp_element_["createElement"])("div", { 38769 className: "components-panel__header" 38770 }, label && Object(external_wp_element_["createElement"])("h2", null, label), children); 38771 } 38772 38773 /* harmony default export */ var panel_header = (PanelHeader); 38774 38775 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/index.js 38776 38777 38778 /** 38779 * External dependencies 38780 */ 38781 38782 /** 38783 * WordPress dependencies 38784 */ 38785 38786 38787 /** 38788 * Internal dependencies 38789 */ 38790 38791 38792 38793 function Panel({ 38794 header, 38795 className, 38796 children 38797 }, ref) { 38798 const classNames = classnames_default()(className, 'components-panel'); 38799 return Object(external_wp_element_["createElement"])("div", { 38800 className: classNames, 38801 ref: ref 38802 }, header && Object(external_wp_element_["createElement"])(panel_header, { 38803 label: header 38804 }), children); 38805 } 38806 38807 /* harmony default export */ var panel = (Object(external_wp_element_["forwardRef"])(Panel)); 38808 38809 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/body.js 38810 38811 38812 38813 /** 38814 * External dependencies 38815 */ 38816 38817 38818 /** 38819 * WordPress dependencies 38820 */ 38821 38822 38823 38824 38825 /** 38826 * Internal dependencies 38827 */ 38828 38829 38830 38831 38832 function PanelBody({ 38833 buttonProps = {}, 38834 children, 38835 className, 38836 icon, 38837 initialOpen, 38838 onToggle = external_lodash_["noop"], 38839 opened, 38840 title, 38841 scrollAfterOpen = true 38842 }, ref) { 38843 const [isOpened, setIsOpened] = use_controlled_state(opened, { 38844 initial: initialOpen === undefined ? true : initialOpen 38845 }); 38846 const nodeRef = Object(external_wp_element_["useRef"])(); // Defaults to 'smooth' scrolling 38847 // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView 38848 38849 const scrollBehavior = Object(external_wp_compose_["useReducedMotion"])() ? 'auto' : 'smooth'; 38850 38851 const handleOnToggle = event => { 38852 event.preventDefault(); 38853 const next = !isOpened; 38854 setIsOpened(next); 38855 onToggle(next); 38856 }; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value 38857 38858 38859 const scrollAfterOpenRef = Object(external_wp_element_["useRef"])(); 38860 scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render 38861 38862 use_update_effect(() => { 38863 var _nodeRef$current; 38864 38865 if (isOpened && scrollAfterOpenRef.current && (_nodeRef$current = nodeRef.current) !== null && _nodeRef$current !== void 0 && _nodeRef$current.scrollIntoView) { 38866 /* 38867 * Scrolls the content into view when visible. 38868 * This improves the UX when there are multiple stacking <PanelBody /> 38869 * components in a scrollable container. 38870 */ 38871 nodeRef.current.scrollIntoView({ 38872 inline: 'nearest', 38873 block: 'nearest', 38874 behavior: scrollBehavior 38875 }); 38876 } 38877 }, [isOpened, scrollBehavior]); 38878 const classes = classnames_default()('components-panel__body', className, { 38879 'is-opened': isOpened 38880 }); 38881 return Object(external_wp_element_["createElement"])("div", { 38882 className: classes, 38883 ref: Object(external_wp_compose_["useMergeRefs"])([nodeRef, ref]) 38884 }, Object(external_wp_element_["createElement"])(PanelBodyTitle, Object(esm_extends["a" /* default */])({ 38885 icon: icon, 38886 isOpened: isOpened, 38887 onClick: handleOnToggle, 38888 title: title 38889 }, buttonProps)), typeof children === 'function' ? children({ 38890 opened: isOpened 38891 }) : isOpened && children); 38892 } 38893 const PanelBodyTitle = Object(external_wp_element_["forwardRef"])(({ 38894 isOpened, 38895 icon, 38896 title, 38897 ...props 38898 }, ref) => { 38899 if (!title) return null; 38900 return Object(external_wp_element_["createElement"])("h2", { 38901 className: "components-panel__body-title" 38902 }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 38903 className: "components-panel__body-toggle", 38904 "aria-expanded": isOpened, 38905 ref: ref 38906 }, props), Object(external_wp_element_["createElement"])("span", { 38907 "aria-hidden": "true" 38908 }, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 38909 className: "components-panel__arrow", 38910 icon: isOpened ? chevron_up["a" /* default */] : chevron_down["a" /* default */] 38911 })), title, icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 38912 icon: icon, 38913 className: "components-panel__icon", 38914 size: 20 38915 }))); 38916 }); 38917 const body_ForwardedComponent = Object(external_wp_element_["forwardRef"])(PanelBody); 38918 body_ForwardedComponent.displayName = 'PanelBody'; 38919 /* harmony default export */ var panel_body = (body_ForwardedComponent); 38920 38921 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/row.js 38922 38923 38924 /** 38925 * External dependencies 38926 */ 38927 38928 /** 38929 * WordPress dependencies 38930 */ 38931 38932 38933 const PanelRow = Object(external_wp_element_["forwardRef"])(({ 38934 className, 38935 children 38936 }, ref) => Object(external_wp_element_["createElement"])("div", { 38937 className: classnames_default()('components-panel__row', className), 38938 ref: ref 38939 }, children)); 38940 /* harmony default export */ var panel_row = (PanelRow); 38941 38942 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/placeholder/index.js 38943 38944 38945 38946 /** 38947 * External dependencies 38948 */ 38949 38950 /** 38951 * WordPress dependencies 38952 */ 38953 38954 38955 /** 38956 * Internal dependencies 38957 */ 38958 38959 38960 /** 38961 * Renders a placeholder. Normally used by blocks to render their empty state. 38962 * 38963 * @param {Object} props The component props. 38964 * @param {WPIcon} props.icon An icon rendered before the label. 38965 * @param {WPElement} props.children Children to be rendered. 38966 * @param {string} props.label Title of the placeholder. 38967 * @param {string} props.instructions Instructions of the placeholder. 38968 * @param {string} props.className Class to set on the container div. 38969 * @param {Object} props.notices A rendered notices list. 38970 * @param {Object} props.preview Preview to be rendered in the placeholder. 38971 * @param {boolean} props.isColumnLayout Whether a column layout should be used. 38972 * 38973 * @return {Object} The rendered placeholder. 38974 */ 38975 38976 function Placeholder({ 38977 icon, 38978 children, 38979 label, 38980 instructions, 38981 className, 38982 notices, 38983 preview, 38984 isColumnLayout, 38985 ...additionalProps 38986 }) { 38987 const [resizeListener, { 38988 width 38989 }] = Object(external_wp_compose_["useResizeObserver"])(); // Since `useResizeObserver` will report a width of `null` until after the 38990 // first render, avoid applying any modifier classes until width is known. 38991 38992 let modifierClassNames; 38993 38994 if (typeof width === 'number') { 38995 modifierClassNames = { 38996 'is-large': width >= 480, 38997 'is-medium': width >= 160 && width < 480, 38998 'is-small': width < 160 38999 }; 39000 } 39001 39002 const classes = classnames_default()('components-placeholder', className, modifierClassNames); 39003 const fieldsetClasses = classnames_default()('components-placeholder__fieldset', { 39004 'is-column-layout': isColumnLayout 39005 }); 39006 return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, additionalProps, { 39007 className: classes 39008 }), resizeListener, notices, preview && Object(external_wp_element_["createElement"])("div", { 39009 className: "components-placeholder__preview" 39010 }, preview), Object(external_wp_element_["createElement"])("div", { 39011 className: "components-placeholder__label" 39012 }, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], { 39013 icon: icon 39014 }), label), !!instructions && Object(external_wp_element_["createElement"])("div", { 39015 className: "components-placeholder__instructions" 39016 }, instructions), Object(external_wp_element_["createElement"])("div", { 39017 className: fieldsetClasses 39018 }, children)); 39019 } 39020 39021 /* harmony default export */ var build_module_placeholder = (Placeholder); 39022 39023 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/terms.js 39024 /** 39025 * External dependencies 39026 */ 39027 39028 /** 39029 * Returns terms in a tree form. 39030 * 39031 * @param {Array} flatTerms Array of terms in flat format. 39032 * 39033 * @return {Array} Array of terms in tree format. 39034 */ 39035 39036 function buildTermsTree(flatTerms) { 39037 const flatTermsWithParentAndChildren = flatTerms.map(term => { 39038 return { 39039 children: [], 39040 parent: null, 39041 ...term 39042 }; 39043 }); 39044 const termsByParent = Object(external_lodash_["groupBy"])(flatTermsWithParentAndChildren, 'parent'); 39045 39046 if (termsByParent.null && termsByParent.null.length) { 39047 return flatTermsWithParentAndChildren; 39048 } 39049 39050 const fillWithChildren = terms => { 39051 return terms.map(term => { 39052 const children = termsByParent[term.id]; 39053 return { ...term, 39054 children: children && children.length ? fillWithChildren(children) : [] 39055 }; 39056 }); 39057 }; 39058 39059 return fillWithChildren(termsByParent['0'] || []); 39060 } 39061 39062 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-select/index.js 39063 39064 39065 39066 /** 39067 * External dependencies 39068 */ 39069 39070 /** 39071 * WordPress dependencies 39072 */ 39073 39074 39075 /** 39076 * Internal dependencies 39077 */ 39078 39079 39080 39081 function tree_select_getSelectOptions(tree, level = 0) { 39082 return Object(external_lodash_["flatMap"])(tree, treeNode => [{ 39083 value: treeNode.id, 39084 label: Object(external_lodash_["repeat"])('\u00A0', level * 3) + Object(external_lodash_["unescape"])(treeNode.name) 39085 }, ...tree_select_getSelectOptions(treeNode.children || [], level + 1)]); 39086 } 39087 39088 function TreeSelect({ 39089 label, 39090 noOptionLabel, 39091 onChange, 39092 selectedId, 39093 tree, 39094 ...props 39095 }) { 39096 const options = Object(external_wp_element_["useMemo"])(() => { 39097 return Object(external_lodash_["compact"])([noOptionLabel && { 39098 value: '', 39099 label: noOptionLabel 39100 }, ...tree_select_getSelectOptions(tree)]); 39101 }, [noOptionLabel, tree]); 39102 return Object(external_wp_element_["createElement"])(select_control, Object(esm_extends["a" /* default */])({ 39103 label, 39104 options, 39105 onChange, 39106 value: selectedId 39107 }, props)); 39108 } 39109 39110 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/category-select.js 39111 39112 39113 39114 /** 39115 * Internal dependencies 39116 */ 39117 39118 39119 /** 39120 * WordPress dependencies 39121 */ 39122 39123 39124 function CategorySelect({ 39125 label, 39126 noOptionLabel, 39127 categoriesList, 39128 selectedCategoryId, 39129 onChange, 39130 ...props 39131 }) { 39132 const termsTree = Object(external_wp_element_["useMemo"])(() => { 39133 return buildTermsTree(categoriesList); 39134 }, [categoriesList]); 39135 return Object(external_wp_element_["createElement"])(TreeSelect, Object(esm_extends["a" /* default */])({ 39136 label, 39137 noOptionLabel, 39138 onChange, 39139 tree: termsTree, 39140 selectedId: selectedCategoryId 39141 }, props)); 39142 } 39143 39144 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/author-select.js 39145 39146 39147 /** 39148 * Internal dependencies 39149 */ 39150 39151 39152 function AuthorSelect({ 39153 label, 39154 noOptionLabel, 39155 authorList, 39156 selectedAuthorId, 39157 onChange 39158 }) { 39159 if (!authorList) return null; 39160 const termsTree = buildTermsTree(authorList); 39161 return Object(external_wp_element_["createElement"])(TreeSelect, { 39162 label, 39163 noOptionLabel, 39164 onChange, 39165 tree: termsTree, 39166 selectedId: selectedAuthorId 39167 }); 39168 } 39169 39170 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/index.js 39171 39172 39173 /** 39174 * WordPress dependencies 39175 */ 39176 39177 /** 39178 * Internal dependencies 39179 */ 39180 39181 39182 39183 39184 const DEFAULT_MIN_ITEMS = 1; 39185 const DEFAULT_MAX_ITEMS = 100; 39186 const MAX_CATEGORIES_SUGGESTIONS = 20; 39187 function QueryControls({ 39188 authorList, 39189 selectedAuthorId, 39190 categoriesList, 39191 selectedCategoryId, 39192 categorySuggestions, 39193 selectedCategories, 39194 numberOfItems, 39195 order, 39196 orderBy, 39197 maxItems = DEFAULT_MAX_ITEMS, 39198 minItems = DEFAULT_MIN_ITEMS, 39199 onCategoryChange, 39200 onAuthorChange, 39201 onNumberOfItemsChange, 39202 onOrderChange, 39203 onOrderByChange 39204 }) { 39205 return [onOrderChange && onOrderByChange && Object(external_wp_element_["createElement"])(select_control, { 39206 key: "query-controls-order-select", 39207 label: Object(external_wp_i18n_["__"])('Order by'), 39208 value: `${orderBy}/${order}`, 39209 options: [{ 39210 label: Object(external_wp_i18n_["__"])('Newest to oldest'), 39211 value: 'date/desc' 39212 }, { 39213 label: Object(external_wp_i18n_["__"])('Oldest to newest'), 39214 value: 'date/asc' 39215 }, { 39216 /* translators: label for ordering posts by title in ascending order */ 39217 label: Object(external_wp_i18n_["__"])('A → Z'), 39218 value: 'title/asc' 39219 }, { 39220 /* translators: label for ordering posts by title in descending order */ 39221 label: Object(external_wp_i18n_["__"])('Z → A'), 39222 value: 'title/desc' 39223 }], 39224 onChange: value => { 39225 const [newOrderBy, newOrder] = value.split('/'); 39226 39227 if (newOrder !== order) { 39228 onOrderChange(newOrder); 39229 } 39230 39231 if (newOrderBy !== orderBy) { 39232 onOrderByChange(newOrderBy); 39233 } 39234 } 39235 }), categoriesList && onCategoryChange && Object(external_wp_element_["createElement"])(CategorySelect, { 39236 key: "query-controls-category-select", 39237 categoriesList: categoriesList, 39238 label: Object(external_wp_i18n_["__"])('Category'), 39239 noOptionLabel: Object(external_wp_i18n_["__"])('All'), 39240 selectedCategoryId: selectedCategoryId, 39241 onChange: onCategoryChange 39242 }), categorySuggestions && onCategoryChange && Object(external_wp_element_["createElement"])(form_token_field, { 39243 key: "query-controls-categories-select", 39244 label: Object(external_wp_i18n_["__"])('Categories'), 39245 value: selectedCategories && selectedCategories.map(item => ({ 39246 id: item.id, 39247 value: item.name || item.value 39248 })), 39249 suggestions: Object.keys(categorySuggestions), 39250 onChange: onCategoryChange, 39251 maxSuggestions: MAX_CATEGORIES_SUGGESTIONS 39252 }), onAuthorChange && Object(external_wp_element_["createElement"])(AuthorSelect, { 39253 key: "query-controls-author-select", 39254 authorList: authorList, 39255 label: Object(external_wp_i18n_["__"])('Author'), 39256 noOptionLabel: Object(external_wp_i18n_["__"])('All'), 39257 selectedAuthorId: selectedAuthorId, 39258 onChange: onAuthorChange 39259 }), onNumberOfItemsChange && Object(external_wp_element_["createElement"])(range_control, { 39260 key: "query-controls-range-control", 39261 label: Object(external_wp_i18n_["__"])('Number of items'), 39262 value: numberOfItems, 39263 onChange: onNumberOfItemsChange, 39264 min: minItems, 39265 max: maxItems, 39266 required: true 39267 })]; 39268 } 39269 39270 // EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js 39271 var warning = __webpack_require__("WnOg"); 39272 39273 // CONCATENATED MODULE: ./node_modules/reakit/es/__keys-d251e56b.js 39274 // Automatically generated 39275 var RADIO_STATE_KEYS = ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "state", "setBaseId", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "setState"]; 39276 var RADIO_KEYS = [].concat(RADIO_STATE_KEYS, ["value", "checked", "unstable_checkOnFocus"]); 39277 var RADIO_GROUP_KEYS = RADIO_STATE_KEYS; 39278 39279 39280 39281 // CONCATENATED MODULE: ./node_modules/reakit/es/Radio/Radio.js 39282 39283 39284 39285 39286 39287 39288 39289 39290 39291 39292 39293 39294 39295 39296 39297 39298 39299 39300 39301 39302 39303 39304 39305 39306 39307 39308 39309 39310 39311 39312 39313 39314 39315 function getChecked(options) { 39316 if (typeof options.checked !== "undefined") { 39317 return options.checked; 39318 } 39319 39320 return typeof options.value !== "undefined" && options.state === options.value; 39321 } 39322 39323 function useInitialChecked(options) { 39324 var _React$useState = Object(external_React_["useState"])(function () { 39325 return getChecked(options); 39326 }), 39327 initialChecked = _React$useState[0]; 39328 39329 var _React$useState2 = Object(external_React_["useState"])(options.currentId), 39330 initialCurrentId = _React$useState2[0]; 39331 39332 var id = options.id, 39333 setCurrentId = options.setCurrentId; 39334 Object(external_React_["useEffect"])(function () { 39335 if (initialChecked && id && initialCurrentId !== id) { 39336 setCurrentId === null || setCurrentId === void 0 ? void 0 : setCurrentId(id); 39337 } 39338 }, [initialChecked, id, setCurrentId, initialCurrentId]); 39339 } 39340 39341 function fireChange(element, onChange) { 39342 var event = Object(createEvent["a" /* createEvent */])(element, "change"); 39343 Object.defineProperties(event, { 39344 type: { 39345 value: "change" 39346 }, 39347 target: { 39348 value: element 39349 }, 39350 currentTarget: { 39351 value: element 39352 } 39353 }); 39354 onChange === null || onChange === void 0 ? void 0 : onChange(event); 39355 } 39356 39357 var useRadio = Object(createHook["a" /* createHook */])({ 39358 name: "Radio", 39359 compose: CompositeItem["b" /* useCompositeItem */], 39360 keys: RADIO_KEYS, 39361 useOptions: function useOptions(_ref, _ref2) { 39362 var _options$value; 39363 39364 var value = _ref2.value, 39365 checked = _ref2.checked; 39366 39367 var _ref$unstable_clickOn = _ref.unstable_clickOnEnter, 39368 unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? false : _ref$unstable_clickOn, 39369 _ref$unstable_checkOn = _ref.unstable_checkOnFocus, 39370 unstable_checkOnFocus = _ref$unstable_checkOn === void 0 ? true : _ref$unstable_checkOn, 39371 options = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["unstable_clickOnEnter", "unstable_checkOnFocus"]); 39372 39373 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 39374 checked: checked, 39375 unstable_clickOnEnter: unstable_clickOnEnter, 39376 unstable_checkOnFocus: unstable_checkOnFocus 39377 }, options), {}, { 39378 value: (_options$value = options.value) != null ? _options$value : value 39379 }); 39380 }, 39381 useProps: function useProps(options, _ref3) { 39382 var htmlRef = _ref3.ref, 39383 htmlOnChange = _ref3.onChange, 39384 htmlOnClick = _ref3.onClick, 39385 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref3, ["ref", "onChange", "onClick"]); 39386 39387 var ref = Object(external_React_["useRef"])(null); 39388 39389 var _React$useState3 = Object(external_React_["useState"])(true), 39390 isNativeRadio = _React$useState3[0], 39391 setIsNativeRadio = _React$useState3[1]; 39392 39393 var checked = getChecked(options); 39394 var isCurrentItemRef = Object(useLiveRef["a" /* useLiveRef */])(options.currentId === options.id); 39395 var onChangeRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnChange); 39396 var onClickRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnClick); 39397 useInitialChecked(options); 39398 Object(external_React_["useEffect"])(function () { 39399 var element = ref.current; 39400 39401 if (!element) { 39402 false ? undefined : void 0; 39403 return; 39404 } 39405 39406 if (element.tagName !== "INPUT" || element.type !== "radio") { 39407 setIsNativeRadio(false); 39408 } 39409 }, []); 39410 var onChange = Object(external_React_["useCallback"])(function (event) { 39411 var _onChangeRef$current, _options$setState; 39412 39413 (_onChangeRef$current = onChangeRef.current) === null || _onChangeRef$current === void 0 ? void 0 : _onChangeRef$current.call(onChangeRef, event); 39414 if (event.defaultPrevented) return; 39415 if (options.disabled) return; 39416 (_options$setState = options.setState) === null || _options$setState === void 0 ? void 0 : _options$setState.call(options, options.value); 39417 }, [options.disabled, options.setState, options.value]); 39418 var onClick = Object(external_React_["useCallback"])(function (event) { 39419 var _onClickRef$current; 39420 39421 (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); 39422 if (event.defaultPrevented) return; 39423 if (isNativeRadio) return; 39424 fireChange(event.currentTarget, onChange); 39425 }, [onChange, isNativeRadio]); 39426 Object(external_React_["useEffect"])(function () { 39427 var element = ref.current; 39428 if (!element) return; 39429 39430 if (options.unstable_moves && isCurrentItemRef.current && options.unstable_checkOnFocus) { 39431 fireChange(element, onChange); 39432 } 39433 }, [options.unstable_moves, options.unstable_checkOnFocus, onChange]); 39434 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 39435 ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef), 39436 role: !isNativeRadio ? "radio" : undefined, 39437 type: isNativeRadio ? "radio" : undefined, 39438 value: isNativeRadio ? options.value : undefined, 39439 name: isNativeRadio ? options.baseId : undefined, 39440 "aria-checked": checked, 39441 checked: checked, 39442 onChange: onChange, 39443 onClick: onClick 39444 }, htmlProps); 39445 } 39446 }); 39447 var Radio = Object(createComponent["a" /* createComponent */])({ 39448 as: "input", 39449 memo: true, 39450 useHook: useRadio 39451 }); 39452 39453 39454 39455 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-context/index.js 39456 /** 39457 * WordPress dependencies 39458 */ 39459 39460 const RadioContext = Object(external_wp_element_["createContext"])({ 39461 state: null, 39462 setState: () => {} 39463 }); 39464 /* harmony default export */ var radio_context = (RadioContext); 39465 39466 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio/index.js 39467 39468 39469 39470 /** 39471 * External dependencies 39472 */ 39473 39474 /** 39475 * WordPress dependencies 39476 */ 39477 39478 39479 /** 39480 * Internal dependencies 39481 */ 39482 39483 39484 39485 39486 function radio_Radio({ 39487 children, 39488 value, 39489 ...props 39490 }, ref) { 39491 const radioContext = Object(external_wp_element_["useContext"])(radio_context); 39492 const checked = radioContext.state === value; 39493 return Object(external_wp_element_["createElement"])(Radio, Object(esm_extends["a" /* default */])({ 39494 ref: ref, 39495 as: build_module_button["a" /* default */], 39496 isPrimary: checked, 39497 isSecondary: !checked, 39498 value: value 39499 }, radioContext, props), children || value); 39500 } 39501 39502 /* harmony default export */ var build_module_radio = (Object(external_wp_element_["forwardRef"])(radio_Radio)); 39503 39504 // CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioState.js 39505 39506 39507 39508 39509 39510 39511 39512 39513 39514 39515 39516 39517 39518 function useRadioState(initialState) { 39519 if (initialState === void 0) { 39520 initialState = {}; 39521 } 39522 39523 var _useSealedState = useSealedState(initialState), 39524 initialValue = _useSealedState.state, 39525 _useSealedState$loop = _useSealedState.loop, 39526 loop = _useSealedState$loop === void 0 ? true : _useSealedState$loop, 39527 sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["state", "loop"]); 39528 39529 var _React$useState = Object(external_React_["useState"])(initialValue), 39530 state = _React$useState[0], 39531 setState = _React$useState[1]; 39532 39533 var composite = useCompositeState(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, sealed), {}, { 39534 loop: loop 39535 })); 39536 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, composite), {}, { 39537 state: state, 39538 setState: setState 39539 }); 39540 } 39541 39542 39543 39544 // CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioGroup.js 39545 39546 39547 39548 39549 39550 39551 39552 39553 39554 39555 39556 39557 39558 39559 39560 39561 39562 39563 39564 39565 39566 39567 39568 39569 39570 39571 39572 39573 39574 39575 39576 var useRadioGroup = Object(createHook["a" /* createHook */])({ 39577 name: "RadioGroup", 39578 compose: useComposite, 39579 keys: RADIO_GROUP_KEYS, 39580 useProps: function useProps(_, htmlProps) { 39581 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 39582 role: "radiogroup" 39583 }, htmlProps); 39584 } 39585 }); 39586 var RadioGroup = Object(createComponent["a" /* createComponent */])({ 39587 as: "div", 39588 useHook: useRadioGroup, 39589 useCreateElement: function useCreateElement$1(type, props, children) { 39590 false ? undefined : void 0; 39591 return Object(useCreateElement["a" /* useCreateElement */])(type, props, children); 39592 } 39593 }); 39594 39595 39596 39597 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/index.js 39598 39599 39600 39601 /** 39602 * External dependencies 39603 */ 39604 39605 /** 39606 * WordPress dependencies 39607 */ 39608 39609 39610 /** 39611 * Internal dependencies 39612 */ 39613 39614 39615 39616 39617 function radio_group_RadioGroup({ 39618 label, 39619 checked, 39620 defaultChecked, 39621 disabled, 39622 onChange, 39623 ...props 39624 }, ref) { 39625 const radioState = useRadioState({ 39626 state: defaultChecked, 39627 baseId: props.id 39628 }); 39629 const radioContext = { ...radioState, 39630 disabled, 39631 // controlled or uncontrolled 39632 state: checked !== null && checked !== void 0 ? checked : radioState.state, 39633 setState: onChange !== null && onChange !== void 0 ? onChange : radioState.setState 39634 }; 39635 return Object(external_wp_element_["createElement"])(radio_context.Provider, { 39636 value: radioContext 39637 }, Object(external_wp_element_["createElement"])(RadioGroup, Object(esm_extends["a" /* default */])({ 39638 ref: ref, 39639 as: button_group, 39640 "aria-label": label 39641 }, radioState, props))); 39642 } 39643 39644 /* harmony default export */ var radio_group = (Object(external_wp_element_["forwardRef"])(radio_group_RadioGroup)); 39645 39646 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-control/index.js 39647 39648 39649 39650 /** 39651 * External dependencies 39652 */ 39653 39654 39655 /** 39656 * WordPress dependencies 39657 */ 39658 39659 39660 /** 39661 * Internal dependencies 39662 */ 39663 39664 39665 function RadioControl({ 39666 label, 39667 className, 39668 selected, 39669 help, 39670 onChange, 39671 options = [], 39672 ...props 39673 }) { 39674 const instanceId = Object(external_wp_compose_["useInstanceId"])(RadioControl); 39675 const id = `inspector-radio-control-${instanceId}`; 39676 39677 const onChangeValue = event => onChange(event.target.value); 39678 39679 return !Object(external_lodash_["isEmpty"])(options) && Object(external_wp_element_["createElement"])(base_control, { 39680 label: label, 39681 id: id, 39682 help: help, 39683 className: classnames_default()(className, 'components-radio-control') 39684 }, options.map((option, index) => Object(external_wp_element_["createElement"])("div", { 39685 key: `${id}-${index}`, 39686 className: "components-radio-control__option" 39687 }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({ 39688 id: `${id}-${index}`, 39689 className: "components-radio-control__input", 39690 type: "radio", 39691 name: id, 39692 value: option.value, 39693 onChange: onChangeValue, 39694 checked: option.value === selected, 39695 "aria-describedby": !!help ? `${id}__help` : undefined 39696 }, props)), Object(external_wp_element_["createElement"])("label", { 39697 htmlFor: `${id}-${index}` 39698 }, option.label)))); 39699 } 39700 39701 // CONCATENATED MODULE: ./node_modules/re-resizable/lib/resizer.js 39702 var resizer_extends = (undefined && undefined.__extends) || (function () { 39703 var extendStatics = function (d, b) { 39704 extendStatics = Object.setPrototypeOf || 39705 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 39706 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 39707 return extendStatics(d, b); 39708 }; 39709 return function (d, b) { 39710 extendStatics(d, b); 39711 function __() { this.constructor = d; } 39712 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 39713 }; 39714 })(); 39715 var resizer_assign = (undefined && undefined.__assign) || function () { 39716 resizer_assign = Object.assign || function(t) { 39717 for (var s, i = 1, n = arguments.length; i < n; i++) { 39718 s = arguments[i]; 39719 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 39720 t[p] = s[p]; 39721 } 39722 return t; 39723 }; 39724 return resizer_assign.apply(this, arguments); 39725 }; 39726 39727 var resizer_styles = { 39728 top: { 39729 width: '100%', 39730 height: '10px', 39731 top: '-5px', 39732 left: '0px', 39733 cursor: 'row-resize', 39734 }, 39735 right: { 39736 width: '10px', 39737 height: '100%', 39738 top: '0px', 39739 right: '-5px', 39740 cursor: 'col-resize', 39741 }, 39742 bottom: { 39743 width: '100%', 39744 height: '10px', 39745 bottom: '-5px', 39746 left: '0px', 39747 cursor: 'row-resize', 39748 }, 39749 left: { 39750 width: '10px', 39751 height: '100%', 39752 top: '0px', 39753 left: '-5px', 39754 cursor: 'col-resize', 39755 }, 39756 topRight: { 39757 width: '20px', 39758 height: '20px', 39759 position: 'absolute', 39760 right: '-10px', 39761 top: '-10px', 39762 cursor: 'ne-resize', 39763 }, 39764 bottomRight: { 39765 width: '20px', 39766 height: '20px', 39767 position: 'absolute', 39768 right: '-10px', 39769 bottom: '-10px', 39770 cursor: 'se-resize', 39771 }, 39772 bottomLeft: { 39773 width: '20px', 39774 height: '20px', 39775 position: 'absolute', 39776 left: '-10px', 39777 bottom: '-10px', 39778 cursor: 'sw-resize', 39779 }, 39780 topLeft: { 39781 width: '20px', 39782 height: '20px', 39783 position: 'absolute', 39784 left: '-10px', 39785 top: '-10px', 39786 cursor: 'nw-resize', 39787 }, 39788 }; 39789 var resizer_Resizer = /** @class */ (function (_super) { 39790 resizer_extends(Resizer, _super); 39791 function Resizer() { 39792 var _this = _super !== null && _super.apply(this, arguments) || this; 39793 _this.onMouseDown = function (e) { 39794 _this.props.onResizeStart(e, _this.props.direction); 39795 }; 39796 _this.onTouchStart = function (e) { 39797 _this.props.onResizeStart(e, _this.props.direction); 39798 }; 39799 return _this; 39800 } 39801 Resizer.prototype.render = function () { 39802 return (external_React_["createElement"]("div", { className: this.props.className || '', style: resizer_assign(resizer_assign({ position: 'absolute', userSelect: 'none' }, resizer_styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children)); 39803 }; 39804 return Resizer; 39805 }(external_React_["PureComponent"])); 39806 39807 39808 // EXTERNAL MODULE: ./node_modules/fast-memoize/src/index.js 39809 var fast_memoize_src = __webpack_require__("75pU"); 39810 var src_default = /*#__PURE__*/__webpack_require__.n(fast_memoize_src); 39811 39812 // CONCATENATED MODULE: ./node_modules/re-resizable/lib/index.js 39813 var lib_extends = (undefined && undefined.__extends) || (function () { 39814 var extendStatics = function (d, b) { 39815 extendStatics = Object.setPrototypeOf || 39816 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 39817 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 39818 return extendStatics(d, b); 39819 }; 39820 return function (d, b) { 39821 extendStatics(d, b); 39822 function __() { this.constructor = d; } 39823 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 39824 }; 39825 })(); 39826 var lib_assign = (undefined && undefined.__assign) || function () { 39827 lib_assign = Object.assign || function(t) { 39828 for (var s, i = 1, n = arguments.length; i < n; i++) { 39829 s = arguments[i]; 39830 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 39831 t[p] = s[p]; 39832 } 39833 return t; 39834 }; 39835 return lib_assign.apply(this, arguments); 39836 }; 39837 39838 39839 39840 var DEFAULT_SIZE = { 39841 width: 'auto', 39842 height: 'auto', 39843 }; 39844 var clamp = src_default()(function (n, min, max) { return Math.max(Math.min(n, max), min); }); 39845 var snap = src_default()(function (n, size) { return Math.round(n / size) * size; }); 39846 var hasDirection = src_default()(function (dir, target) { 39847 return new RegExp(dir, 'i').test(target); 39848 }); 39849 // INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`. 39850 var isTouchEvent = function (event) { 39851 return Boolean(event.touches && event.touches.length); 39852 }; 39853 var isMouseEvent = function (event) { 39854 return Boolean((event.clientX || event.clientX === 0) && 39855 (event.clientY || event.clientY === 0)); 39856 }; 39857 var findClosestSnap = src_default()(function (n, snapArray, snapGap) { 39858 if (snapGap === void 0) { snapGap = 0; } 39859 var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0); 39860 var gap = Math.abs(snapArray[closestGapIndex] - n); 39861 return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n; 39862 }); 39863 var endsWith = src_default()(function (str, searchStr) { 39864 return str.substr(str.length - searchStr.length, searchStr.length) === searchStr; 39865 }); 39866 var getStringSize = src_default()(function (n) { 39867 n = n.toString(); 39868 if (n === 'auto') { 39869 return n; 39870 } 39871 if (endsWith(n, 'px')) { 39872 return n; 39873 } 39874 if (endsWith(n, '%')) { 39875 return n; 39876 } 39877 if (endsWith(n, 'vh')) { 39878 return n; 39879 } 39880 if (endsWith(n, 'vw')) { 39881 return n; 39882 } 39883 if (endsWith(n, 'vmax')) { 39884 return n; 39885 } 39886 if (endsWith(n, 'vmin')) { 39887 return n; 39888 } 39889 return n + "px"; 39890 }); 39891 var getPixelSize = function (size, parentSize, innerWidth, innerHeight) { 39892 if (size && typeof size === 'string') { 39893 if (endsWith(size, 'px')) { 39894 return Number(size.replace('px', '')); 39895 } 39896 if (endsWith(size, '%')) { 39897 var ratio = Number(size.replace('%', '')) / 100; 39898 return parentSize * ratio; 39899 } 39900 if (endsWith(size, 'vw')) { 39901 var ratio = Number(size.replace('vw', '')) / 100; 39902 return innerWidth * ratio; 39903 } 39904 if (endsWith(size, 'vh')) { 39905 var ratio = Number(size.replace('vh', '')) / 100; 39906 return innerHeight * ratio; 39907 } 39908 } 39909 return size; 39910 }; 39911 var calculateNewMax = src_default()(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) { 39912 maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight); 39913 maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight); 39914 minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight); 39915 minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight); 39916 return { 39917 maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth), 39918 maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight), 39919 minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth), 39920 minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight), 39921 }; 39922 }); 39923 var definedProps = [ 39924 'as', 39925 'style', 39926 'className', 39927 'grid', 39928 'snap', 39929 'bounds', 39930 'boundsByDirection', 39931 'size', 39932 'defaultSize', 39933 'minWidth', 39934 'minHeight', 39935 'maxWidth', 39936 'maxHeight', 39937 'lockAspectRatio', 39938 'lockAspectRatioExtraWidth', 39939 'lockAspectRatioExtraHeight', 39940 'enable', 39941 'handleStyles', 39942 'handleClasses', 39943 'handleWrapperStyle', 39944 'handleWrapperClass', 39945 'children', 39946 'onResizeStart', 39947 'onResize', 39948 'onResizeStop', 39949 'handleComponent', 39950 'scale', 39951 'resizeRatio', 39952 'snapGap', 39953 ]; 39954 // HACK: This class is used to calculate % size. 39955 var baseClassName = '__resizable_base__'; 39956 var lib_Resizable = /** @class */ (function (_super) { 39957 lib_extends(Resizable, _super); 39958 function Resizable(props) { 39959 var _this = _super.call(this, props) || this; 39960 _this.ratio = 1; 39961 _this.resizable = null; 39962 // For parent boundary 39963 _this.parentLeft = 0; 39964 _this.parentTop = 0; 39965 // For boundary 39966 _this.resizableLeft = 0; 39967 _this.resizableRight = 0; 39968 _this.resizableTop = 0; 39969 _this.resizableBottom = 0; 39970 // For target boundary 39971 _this.targetLeft = 0; 39972 _this.targetTop = 0; 39973 _this.appendBase = function () { 39974 if (!_this.resizable || !_this.window) { 39975 return null; 39976 } 39977 var parent = _this.parentNode; 39978 if (!parent) { 39979 return null; 39980 } 39981 var element = _this.window.document.createElement('div'); 39982 element.style.width = '100%'; 39983 element.style.height = '100%'; 39984 element.style.position = 'absolute'; 39985 element.style.transform = 'scale(0, 0)'; 39986 element.style.left = '0'; 39987 element.style.flex = '0'; 39988 if (element.classList) { 39989 element.classList.add(baseClassName); 39990 } 39991 else { 39992 element.className += baseClassName; 39993 } 39994 parent.appendChild(element); 39995 return element; 39996 }; 39997 _this.removeBase = function (base) { 39998 var parent = _this.parentNode; 39999 if (!parent) { 40000 return; 40001 } 40002 parent.removeChild(base); 40003 }; 40004 _this.ref = function (c) { 40005 if (c) { 40006 _this.resizable = c; 40007 } 40008 }; 40009 _this.state = { 40010 isResizing: false, 40011 width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined' 40012 ? 'auto' 40013 : _this.propsSize && _this.propsSize.width, 40014 height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined' 40015 ? 'auto' 40016 : _this.propsSize && _this.propsSize.height, 40017 direction: 'right', 40018 original: { 40019 x: 0, 40020 y: 0, 40021 width: 0, 40022 height: 0, 40023 }, 40024 backgroundStyle: { 40025 height: '100%', 40026 width: '100%', 40027 backgroundColor: 'rgba(0,0,0,0)', 40028 cursor: 'auto', 40029 opacity: 0, 40030 position: 'fixed', 40031 zIndex: 9999, 40032 top: '0', 40033 left: '0', 40034 bottom: '0', 40035 right: '0', 40036 }, 40037 flexBasis: undefined, 40038 }; 40039 _this.onResizeStart = _this.onResizeStart.bind(_this); 40040 _this.onMouseMove = _this.onMouseMove.bind(_this); 40041 _this.onMouseUp = _this.onMouseUp.bind(_this); 40042 return _this; 40043 } 40044 Object.defineProperty(Resizable.prototype, "parentNode", { 40045 get: function () { 40046 if (!this.resizable) { 40047 return null; 40048 } 40049 return this.resizable.parentNode; 40050 }, 40051 enumerable: false, 40052 configurable: true 40053 }); 40054 Object.defineProperty(Resizable.prototype, "window", { 40055 get: function () { 40056 if (!this.resizable) { 40057 return null; 40058 } 40059 if (!this.resizable.ownerDocument) { 40060 return null; 40061 } 40062 return this.resizable.ownerDocument.defaultView; 40063 }, 40064 enumerable: false, 40065 configurable: true 40066 }); 40067 Object.defineProperty(Resizable.prototype, "propsSize", { 40068 get: function () { 40069 return this.props.size || this.props.defaultSize || DEFAULT_SIZE; 40070 }, 40071 enumerable: false, 40072 configurable: true 40073 }); 40074 Object.defineProperty(Resizable.prototype, "size", { 40075 get: function () { 40076 var width = 0; 40077 var height = 0; 40078 if (this.resizable && this.window) { 40079 var orgWidth = this.resizable.offsetWidth; 40080 var orgHeight = this.resizable.offsetHeight; 40081 // HACK: Set position `relative` to get parent size. 40082 // This is because when re-resizable set `absolute`, I can not get base width correctly. 40083 var orgPosition = this.resizable.style.position; 40084 if (orgPosition !== 'relative') { 40085 this.resizable.style.position = 'relative'; 40086 } 40087 // INFO: Use original width or height if set auto. 40088 width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth; 40089 height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight; 40090 // Restore original position 40091 this.resizable.style.position = orgPosition; 40092 } 40093 return { width: width, height: height }; 40094 }, 40095 enumerable: false, 40096 configurable: true 40097 }); 40098 Object.defineProperty(Resizable.prototype, "sizeStyle", { 40099 get: function () { 40100 var _this = this; 40101 var size = this.props.size; 40102 var getSize = function (key) { 40103 if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') { 40104 return 'auto'; 40105 } 40106 if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) { 40107 if (endsWith(_this.state[key].toString(), '%')) { 40108 return _this.state[key].toString(); 40109 } 40110 var parentSize = _this.getParentSize(); 40111 var value = Number(_this.state[key].toString().replace('px', '')); 40112 var percent = (value / parentSize[key]) * 100; 40113 return percent + "%"; 40114 } 40115 return getStringSize(_this.state[key]); 40116 }; 40117 var width = size && typeof size.width !== 'undefined' && !this.state.isResizing 40118 ? getStringSize(size.width) 40119 : getSize('width'); 40120 var height = size && typeof size.height !== 'undefined' && !this.state.isResizing 40121 ? getStringSize(size.height) 40122 : getSize('height'); 40123 return { width: width, height: height }; 40124 }, 40125 enumerable: false, 40126 configurable: true 40127 }); 40128 Resizable.prototype.getParentSize = function () { 40129 if (!this.parentNode) { 40130 if (!this.window) { 40131 return { width: 0, height: 0 }; 40132 } 40133 return { width: this.window.innerWidth, height: this.window.innerHeight }; 40134 } 40135 var base = this.appendBase(); 40136 if (!base) { 40137 return { width: 0, height: 0 }; 40138 } 40139 // INFO: To calculate parent width with flex layout 40140 var wrapChanged = false; 40141 var wrap = this.parentNode.style.flexWrap; 40142 if (wrap !== 'wrap') { 40143 wrapChanged = true; 40144 this.parentNode.style.flexWrap = 'wrap'; 40145 // HACK: Use relative to get parent padding size 40146 } 40147 base.style.position = 'relative'; 40148 base.style.minWidth = '100%'; 40149 var size = { 40150 width: base.offsetWidth, 40151 height: base.offsetHeight, 40152 }; 40153 if (wrapChanged) { 40154 this.parentNode.style.flexWrap = wrap; 40155 } 40156 this.removeBase(base); 40157 return size; 40158 }; 40159 Resizable.prototype.bindEvents = function () { 40160 if (this.window) { 40161 this.window.addEventListener('mouseup', this.onMouseUp); 40162 this.window.addEventListener('mousemove', this.onMouseMove); 40163 this.window.addEventListener('mouseleave', this.onMouseUp); 40164 this.window.addEventListener('touchmove', this.onMouseMove, { 40165 capture: true, 40166 passive: false, 40167 }); 40168 this.window.addEventListener('touchend', this.onMouseUp); 40169 } 40170 }; 40171 Resizable.prototype.unbindEvents = function () { 40172 if (this.window) { 40173 this.window.removeEventListener('mouseup', this.onMouseUp); 40174 this.window.removeEventListener('mousemove', this.onMouseMove); 40175 this.window.removeEventListener('mouseleave', this.onMouseUp); 40176 this.window.removeEventListener('touchmove', this.onMouseMove, true); 40177 this.window.removeEventListener('touchend', this.onMouseUp); 40178 } 40179 }; 40180 Resizable.prototype.componentDidMount = function () { 40181 if (!this.resizable || !this.window) { 40182 return; 40183 } 40184 var computedStyle = this.window.getComputedStyle(this.resizable); 40185 this.setState({ 40186 width: this.state.width || this.size.width, 40187 height: this.state.height || this.size.height, 40188 flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined, 40189 }); 40190 }; 40191 Resizable.prototype.componentWillUnmount = function () { 40192 if (this.window) { 40193 this.unbindEvents(); 40194 } 40195 }; 40196 Resizable.prototype.createSizeForCssProperty = function (newSize, kind) { 40197 var propsSize = this.propsSize && this.propsSize[kind]; 40198 return this.state[kind] === 'auto' && 40199 this.state.original[kind] === newSize && 40200 (typeof propsSize === 'undefined' || propsSize === 'auto') 40201 ? 'auto' 40202 : newSize; 40203 }; 40204 Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) { 40205 var boundsByDirection = this.props.boundsByDirection; 40206 var direction = this.state.direction; 40207 var widthByDirection = boundsByDirection && hasDirection('left', direction); 40208 var heightByDirection = boundsByDirection && hasDirection('top', direction); 40209 var boundWidth; 40210 var boundHeight; 40211 if (this.props.bounds === 'parent') { 40212 var parent_1 = this.parentNode; 40213 if (parent_1) { 40214 boundWidth = widthByDirection 40215 ? this.resizableRight - this.parentLeft 40216 : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft); 40217 boundHeight = heightByDirection 40218 ? this.resizableBottom - this.parentTop 40219 : parent_1.offsetHeight + (this.parentTop - this.resizableTop); 40220 } 40221 } 40222 else if (this.props.bounds === 'window') { 40223 if (this.window) { 40224 boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft; 40225 boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop; 40226 } 40227 } 40228 else if (this.props.bounds) { 40229 boundWidth = widthByDirection 40230 ? this.resizableRight - this.targetLeft 40231 : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft); 40232 boundHeight = heightByDirection 40233 ? this.resizableBottom - this.targetTop 40234 : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop); 40235 } 40236 if (boundWidth && Number.isFinite(boundWidth)) { 40237 maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth; 40238 } 40239 if (boundHeight && Number.isFinite(boundHeight)) { 40240 maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight; 40241 } 40242 return { maxWidth: maxWidth, maxHeight: maxHeight }; 40243 }; 40244 Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) { 40245 var scale = this.props.scale || 1; 40246 var resizeRatio = this.props.resizeRatio || 1; 40247 var _a = this.state, direction = _a.direction, original = _a.original; 40248 var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth; 40249 var newWidth = original.width; 40250 var newHeight = original.height; 40251 var extraHeight = lockAspectRatioExtraHeight || 0; 40252 var extraWidth = lockAspectRatioExtraWidth || 0; 40253 if (hasDirection('right', direction)) { 40254 newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale; 40255 if (lockAspectRatio) { 40256 newHeight = (newWidth - extraWidth) / this.ratio + extraHeight; 40257 } 40258 } 40259 if (hasDirection('left', direction)) { 40260 newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale; 40261 if (lockAspectRatio) { 40262 newHeight = (newWidth - extraWidth) / this.ratio + extraHeight; 40263 } 40264 } 40265 if (hasDirection('bottom', direction)) { 40266 newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale; 40267 if (lockAspectRatio) { 40268 newWidth = (newHeight - extraHeight) * this.ratio + extraWidth; 40269 } 40270 } 40271 if (hasDirection('top', direction)) { 40272 newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale; 40273 if (lockAspectRatio) { 40274 newWidth = (newHeight - extraHeight) * this.ratio + extraWidth; 40275 } 40276 } 40277 return { newWidth: newWidth, newHeight: newHeight }; 40278 }; 40279 Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) { 40280 var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth; 40281 var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width; 40282 var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width; 40283 var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height; 40284 var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height; 40285 var extraHeight = lockAspectRatioExtraHeight || 0; 40286 var extraWidth = lockAspectRatioExtraWidth || 0; 40287 if (lockAspectRatio) { 40288 var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth; 40289 var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth; 40290 var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight; 40291 var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight; 40292 var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth); 40293 var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth); 40294 var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight); 40295 var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight); 40296 newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth); 40297 newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight); 40298 } 40299 else { 40300 newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth); 40301 newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight); 40302 } 40303 return { newWidth: newWidth, newHeight: newHeight }; 40304 }; 40305 Resizable.prototype.setBoundingClientRect = function () { 40306 // For parent boundary 40307 if (this.props.bounds === 'parent') { 40308 var parent_2 = this.parentNode; 40309 if (parent_2) { 40310 var parentRect = parent_2.getBoundingClientRect(); 40311 this.parentLeft = parentRect.left; 40312 this.parentTop = parentRect.top; 40313 } 40314 } 40315 // For target(html element) boundary 40316 if (this.props.bounds && typeof this.props.bounds !== 'string') { 40317 var targetRect = this.props.bounds.getBoundingClientRect(); 40318 this.targetLeft = targetRect.left; 40319 this.targetTop = targetRect.top; 40320 } 40321 // For boundary 40322 if (this.resizable) { 40323 var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom; 40324 this.resizableLeft = left; 40325 this.resizableRight = right; 40326 this.resizableTop = top_1; 40327 this.resizableBottom = bottom; 40328 } 40329 }; 40330 Resizable.prototype.onResizeStart = function (event, direction) { 40331 if (!this.resizable || !this.window) { 40332 return; 40333 } 40334 var clientX = 0; 40335 var clientY = 0; 40336 if (event.nativeEvent && isMouseEvent(event.nativeEvent)) { 40337 clientX = event.nativeEvent.clientX; 40338 clientY = event.nativeEvent.clientY; 40339 // When user click with right button the resize is stuck in resizing mode 40340 // until users clicks again, dont continue if right click is used. 40341 // HACK: MouseEvent does not have `which` from flow-bin v0.68. 40342 if (event.nativeEvent.which === 3) { 40343 return; 40344 } 40345 } 40346 else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) { 40347 clientX = event.nativeEvent.touches[0].clientX; 40348 clientY = event.nativeEvent.touches[0].clientY; 40349 } 40350 if (this.props.onResizeStart) { 40351 if (this.resizable) { 40352 var startResize = this.props.onResizeStart(event, direction, this.resizable); 40353 if (startResize === false) { 40354 return; 40355 } 40356 } 40357 } 40358 // Fix #168 40359 if (this.props.size) { 40360 if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) { 40361 this.setState({ height: this.props.size.height }); 40362 } 40363 if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) { 40364 this.setState({ width: this.props.size.width }); 40365 } 40366 } 40367 // For lockAspectRatio case 40368 this.ratio = 40369 typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height; 40370 var flexBasis; 40371 var computedStyle = this.window.getComputedStyle(this.resizable); 40372 if (computedStyle.flexBasis !== 'auto') { 40373 var parent_3 = this.parentNode; 40374 if (parent_3) { 40375 var dir = this.window.getComputedStyle(parent_3).flexDirection; 40376 this.flexDir = dir.startsWith('row') ? 'row' : 'column'; 40377 flexBasis = computedStyle.flexBasis; 40378 } 40379 } 40380 // For boundary 40381 this.setBoundingClientRect(); 40382 this.bindEvents(); 40383 var state = { 40384 original: { 40385 x: clientX, 40386 y: clientY, 40387 width: this.size.width, 40388 height: this.size.height, 40389 }, 40390 isResizing: true, 40391 backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }), 40392 direction: direction, 40393 flexBasis: flexBasis, 40394 }; 40395 this.setState(state); 40396 }; 40397 Resizable.prototype.onMouseMove = function (event) { 40398 if (!this.state.isResizing || !this.resizable || !this.window) { 40399 return; 40400 } 40401 if (this.window.TouchEvent && isTouchEvent(event)) { 40402 try { 40403 event.preventDefault(); 40404 event.stopPropagation(); 40405 } 40406 catch (e) { 40407 // Ignore on fail 40408 } 40409 } 40410 var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight; 40411 var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX; 40412 var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY; 40413 var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height; 40414 var parentSize = this.getParentSize(); 40415 var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight); 40416 maxWidth = max.maxWidth; 40417 maxHeight = max.maxHeight; 40418 minWidth = max.minWidth; 40419 minHeight = max.minHeight; 40420 // Calculate new size 40421 var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth; 40422 // Calculate max size from boundary settings 40423 var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight); 40424 // Calculate new size from aspect ratio 40425 var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight }); 40426 newWidth = newSize.newWidth; 40427 newHeight = newSize.newHeight; 40428 if (this.props.grid) { 40429 var newGridWidth = snap(newWidth, this.props.grid[0]); 40430 var newGridHeight = snap(newHeight, this.props.grid[1]); 40431 var gap = this.props.snapGap || 0; 40432 newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth; 40433 newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight; 40434 } 40435 if (this.props.snap && this.props.snap.x) { 40436 newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap); 40437 } 40438 if (this.props.snap && this.props.snap.y) { 40439 newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap); 40440 } 40441 var delta = { 40442 width: newWidth - original.width, 40443 height: newHeight - original.height, 40444 }; 40445 if (width && typeof width === 'string') { 40446 if (endsWith(width, '%')) { 40447 var percent = (newWidth / parentSize.width) * 100; 40448 newWidth = percent + "%"; 40449 } 40450 else if (endsWith(width, 'vw')) { 40451 var vw = (newWidth / this.window.innerWidth) * 100; 40452 newWidth = vw + "vw"; 40453 } 40454 else if (endsWith(width, 'vh')) { 40455 var vh = (newWidth / this.window.innerHeight) * 100; 40456 newWidth = vh + "vh"; 40457 } 40458 } 40459 if (height && typeof height === 'string') { 40460 if (endsWith(height, '%')) { 40461 var percent = (newHeight / parentSize.height) * 100; 40462 newHeight = percent + "%"; 40463 } 40464 else if (endsWith(height, 'vw')) { 40465 var vw = (newHeight / this.window.innerWidth) * 100; 40466 newHeight = vw + "vw"; 40467 } 40468 else if (endsWith(height, 'vh')) { 40469 var vh = (newHeight / this.window.innerHeight) * 100; 40470 newHeight = vh + "vh"; 40471 } 40472 } 40473 var newState = { 40474 width: this.createSizeForCssProperty(newWidth, 'width'), 40475 height: this.createSizeForCssProperty(newHeight, 'height'), 40476 }; 40477 if (this.flexDir === 'row') { 40478 newState.flexBasis = newState.width; 40479 } 40480 else if (this.flexDir === 'column') { 40481 newState.flexBasis = newState.height; 40482 } 40483 this.setState(newState); 40484 if (this.props.onResize) { 40485 this.props.onResize(event, direction, this.resizable, delta); 40486 } 40487 }; 40488 Resizable.prototype.onMouseUp = function (event) { 40489 var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original; 40490 if (!isResizing || !this.resizable) { 40491 return; 40492 } 40493 var delta = { 40494 width: this.size.width - original.width, 40495 height: this.size.height - original.height, 40496 }; 40497 if (this.props.onResizeStop) { 40498 this.props.onResizeStop(event, direction, this.resizable, delta); 40499 } 40500 if (this.props.size) { 40501 this.setState(this.props.size); 40502 } 40503 this.unbindEvents(); 40504 this.setState({ 40505 isResizing: false, 40506 backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: 'auto' }), 40507 }); 40508 }; 40509 Resizable.prototype.updateSize = function (size) { 40510 this.setState({ width: size.width, height: size.height }); 40511 }; 40512 Resizable.prototype.renderResizer = function () { 40513 var _this = this; 40514 var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent; 40515 if (!enable) { 40516 return null; 40517 } 40518 var resizers = Object.keys(enable).map(function (dir) { 40519 if (enable[dir] !== false) { 40520 return (external_React_["createElement"](resizer_Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null)); 40521 } 40522 return null; 40523 }); 40524 // #93 Wrap the resize box in span (will not break 100% width/height) 40525 return (external_React_["createElement"]("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers)); 40526 }; 40527 Resizable.prototype.render = function () { 40528 var _this = this; 40529 var extendsProps = Object.keys(this.props).reduce(function (acc, key) { 40530 if (definedProps.indexOf(key) !== -1) { 40531 return acc; 40532 } 40533 acc[key] = _this.props[key]; 40534 return acc; 40535 }, {}); 40536 var style = lib_assign(lib_assign(lib_assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 }); 40537 if (this.state.flexBasis) { 40538 style.flexBasis = this.state.flexBasis; 40539 } 40540 var Wrapper = this.props.as || 'div'; 40541 return (external_React_["createElement"](Wrapper, lib_assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps), 40542 this.state.isResizing && external_React_["createElement"]("div", { style: this.state.backgroundStyle }), 40543 this.props.children, 40544 this.renderResizer())); 40545 }; 40546 Resizable.defaultProps = { 40547 as: 'div', 40548 onResizeStart: function () { }, 40549 onResize: function () { }, 40550 onResizeStop: function () { }, 40551 enable: { 40552 top: true, 40553 right: true, 40554 bottom: true, 40555 left: true, 40556 topRight: true, 40557 bottomRight: true, 40558 bottomLeft: true, 40559 topLeft: true, 40560 }, 40561 style: {}, 40562 grid: [1, 1], 40563 lockAspectRatio: false, 40564 lockAspectRatioExtraWidth: 0, 40565 lockAspectRatioExtraHeight: 0, 40566 scale: 1, 40567 resizeRatio: 1, 40568 snapGap: 0, 40569 }; 40570 return Resizable; 40571 }(external_React_["PureComponent"])); 40572 40573 40574 // EXTERNAL MODULE: ./node_modules/react-resize-aware/dist/index.js 40575 var react_resize_aware_dist = __webpack_require__("SSiF"); 40576 var react_resize_aware_dist_default = /*#__PURE__*/__webpack_require__.n(react_resize_aware_dist); 40577 40578 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/utils.js 40579 /** 40580 * External dependencies 40581 */ 40582 40583 40584 /** 40585 * WordPress dependencies 40586 */ 40587 40588 40589 const { 40590 clearTimeout: utils_clearTimeout, 40591 setTimeout: utils_setTimeout 40592 } = typeof window !== 'undefined' ? window : {}; 40593 const POSITIONS = { 40594 bottom: 'bottom', 40595 corner: 'corner' 40596 }; 40597 /** 40598 * @typedef {Object} UseResizeLabelProps 40599 * 40600 * @property {undefined|string} label The label value. 40601 * @property {Function} resizeListener Element to be rendered for resize listening events. 40602 */ 40603 40604 /** 40605 * Custom hook that manages resize listener events. It also provides a label 40606 * based on current resize width x height values. 40607 * 40608 * @param {Object} props 40609 * @param {string} props.axis Only shows the label corresponding to the axis. 40610 * @param {number} props.fadeTimeout Duration (ms) before deactivating the resize label. 40611 * @param {boolean} props.onResize Callback when a resize occurs. Provides { width, height } callback. 40612 * @param {string} props.position Adjusts label value. 40613 * @param {boolean} props.showPx Whether to add `PX` to the label. 40614 * 40615 * @return {UseResizeLabelProps} Properties for hook. 40616 */ 40617 40618 function useResizeLabel({ 40619 axis, 40620 fadeTimeout = 180, 40621 onResize = external_lodash_["noop"], 40622 position = POSITIONS.bottom, 40623 showPx = false 40624 }) { 40625 /* 40626 * The width/height values derive from this special useResizeAware hook. 40627 * This custom hook uses injects an iFrame into the element, allowing it 40628 * to tap into the onResize (window) callback events. 40629 */ 40630 const [resizeListener, sizes] = react_resize_aware_dist_default()(); 40631 /* 40632 * Indicates if the x/y axis is preferred. 40633 * If set, we will avoid resetting the moveX and moveY values. 40634 * This will allow for the preferred axis values to persist in the label. 40635 */ 40636 40637 const isAxisControlled = !!axis; 40638 /* 40639 * The moveX and moveY values are used to track whether the label should 40640 * display width, height, or width x height. 40641 */ 40642 40643 const [moveX, setMoveX] = Object(external_wp_element_["useState"])(false); 40644 const [moveY, setMoveY] = Object(external_wp_element_["useState"])(false); 40645 /* 40646 * Cached dimension values to check for width/height updates from the 40647 * sizes property from useResizeAware() 40648 */ 40649 40650 const { 40651 width, 40652 height 40653 } = sizes; 40654 const heightRef = Object(external_wp_element_["useRef"])(height); 40655 const widthRef = Object(external_wp_element_["useRef"])(width); 40656 /* 40657 * This timeout is used with setMoveX and setMoveY to determine of 40658 * both width and height values have changed at (roughly) the same time. 40659 */ 40660 40661 const moveTimeoutRef = Object(external_wp_element_["useRef"])(); 40662 40663 const unsetMoveXY = () => { 40664 /* 40665 * If axis is controlled, we will avoid resetting the moveX and moveY values. 40666 * This will allow for the preferred axis values to persist in the label. 40667 */ 40668 if (isAxisControlled) return; 40669 setMoveX(false); 40670 setMoveY(false); 40671 }; 40672 40673 const debounceUnsetMoveXY = () => { 40674 if (moveTimeoutRef.current) { 40675 utils_clearTimeout(moveTimeoutRef.current); 40676 } 40677 40678 moveTimeoutRef.current = utils_setTimeout(unsetMoveXY, fadeTimeout); 40679 }; 40680 40681 Object(external_wp_element_["useEffect"])(() => { 40682 /* 40683 * On the initial render of useResizeAware, the height and width values are 40684 * null. They are calculated then set using via an internal useEffect hook. 40685 */ 40686 const isRendered = width !== null || height !== null; 40687 if (!isRendered) return; 40688 const didWidthChange = width !== widthRef.current; 40689 const didHeightChange = height !== heightRef.current; 40690 if (!didWidthChange && !didHeightChange) return; 40691 /* 40692 * After the initial render, the useResizeAware will set the first 40693 * width and height values. We'll sync those values with our 40694 * width and height refs. However, we shouldn't render our Tooltip 40695 * label on this first cycle. 40696 */ 40697 40698 if (width && !widthRef.current && height && !heightRef.current) { 40699 widthRef.current = width; 40700 heightRef.current = height; 40701 return; 40702 } 40703 /* 40704 * After the first cycle, we can track width and height changes. 40705 */ 40706 40707 40708 if (didWidthChange) { 40709 setMoveX(true); 40710 widthRef.current = width; 40711 } 40712 40713 if (didHeightChange) { 40714 setMoveY(true); 40715 heightRef.current = height; 40716 } 40717 40718 onResize({ 40719 width, 40720 height 40721 }); 40722 debounceUnsetMoveXY(); 40723 }, [width, height]); 40724 const label = getSizeLabel({ 40725 axis, 40726 height, 40727 moveX, 40728 moveY, 40729 position, 40730 showPx, 40731 width 40732 }); 40733 return { 40734 label, 40735 resizeListener 40736 }; 40737 } 40738 /** 40739 * Gets the resize label based on width and height values (as well as recent changes). 40740 * 40741 * @param {Object} props 40742 * @param {string} props.axis Only shows the label corresponding to the axis. 40743 * @param {number} props.height Height value. 40744 * @param {boolean} props.moveX Recent width (x axis) changes. 40745 * @param {boolean} props.moveY Recent width (y axis) changes. 40746 * @param {string} props.position Adjusts label value. 40747 * @param {boolean} props.showPx Whether to add `PX` to the label. 40748 * @param {number} props.width Width value. 40749 * 40750 * @return {undefined | string} The rendered label. 40751 */ 40752 40753 function getSizeLabel({ 40754 axis, 40755 height, 40756 moveX = false, 40757 moveY = false, 40758 position = POSITIONS.bottom, 40759 showPx = false, 40760 width 40761 }) { 40762 if (!moveX && !moveY) return null; 40763 /* 40764 * Corner position... 40765 * We want the label to appear like width x height. 40766 */ 40767 40768 if (position === POSITIONS.corner) { 40769 return `${width} x ${height}`; 40770 } 40771 /* 40772 * Other POSITIONS... 40773 * The label will combine both width x height values if both 40774 * values have recently been changed. 40775 * 40776 * Otherwise, only width or height will be displayed. 40777 * The `PX` unit will be added, if specified by the `showPx` prop. 40778 */ 40779 40780 40781 const labelUnit = showPx ? ' px' : ''; 40782 40783 if (axis) { 40784 if (axis === 'x' && moveX) { 40785 return `${width}${labelUnit}`; 40786 } 40787 40788 if (axis === 'y' && moveY) { 40789 return `${height}${labelUnit}`; 40790 } 40791 } 40792 40793 if (moveX && moveY) { 40794 return `${width} x ${height}`; 40795 } 40796 40797 if (moveX) { 40798 return `${width}${labelUnit}`; 40799 } 40800 40801 if (moveY) { 40802 return `${height}${labelUnit}`; 40803 } 40804 40805 return null; 40806 } 40807 40808 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js 40809 40810 40811 function resize_tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 40812 40813 /** 40814 * Internal dependencies 40815 */ 40816 40817 40818 const resize_tooltip_styles_Root = styled_base_browser_esm("div", { 40819 target: "ekdag500", 40820 label: "Root" 40821 })( true ? { 40822 name: "mt2ez5", 40823 styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0;" 40824 } : undefined); 40825 const TooltipWrapper = styled_base_browser_esm("div", { 40826 target: "ekdag501", 40827 label: "TooltipWrapper" 40828 })( true ? { 40829 name: "1kllayo", 40830 styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear;" 40831 } : undefined); 40832 const resize_tooltip_styles_Tooltip = styled_base_browser_esm("div", { 40833 target: "ekdag502", 40834 label: "Tooltip" 40835 })("background:", COLORS.ui.border, ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + ( true ? "" : undefined)); // TODO: Resolve need to use &&& to increase specificity 40836 // https://github.com/WordPress/gutenberg/issues/18483 40837 40838 const LabelText = /*#__PURE__*/styled_base_browser_esm(text_component, { 40839 target: "ekdag503", 40840 label: "LabelText" 40841 })( true ? { 40842 name: "1kboj1g", 40843 styles: "&&&{color:white;display:block;font-size:13px;line-height:1.4;}" 40844 } : undefined); 40845 40846 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/label.js 40847 40848 40849 40850 /** 40851 * WordPress dependencies 40852 */ 40853 40854 40855 /** 40856 * Internal dependencies 40857 */ 40858 40859 40860 40861 const CORNER_OFFSET = 4; 40862 const CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5; 40863 40864 function resize_tooltip_label_Label({ 40865 label, 40866 position = POSITIONS.corner, 40867 zIndex = 1000, 40868 ...props 40869 }, ref) { 40870 const showLabel = !!label; 40871 const isBottom = position === POSITIONS.bottom; 40872 const isCorner = position === POSITIONS.corner; 40873 if (!showLabel) return null; 40874 let style = { 40875 opacity: showLabel ? 1 : null, 40876 zIndex 40877 }; 40878 let labelStyle = {}; 40879 40880 if (isBottom) { 40881 style = { ...style, 40882 position: 'absolute', 40883 bottom: CURSOR_OFFSET_TOP * -1, 40884 left: '50%', 40885 transform: 'translate(-50%, 0)' 40886 }; 40887 labelStyle = { 40888 transform: `translate(0, 100%)` 40889 }; 40890 } 40891 40892 if (isCorner) { 40893 style = { ...style, 40894 position: 'absolute', 40895 top: CORNER_OFFSET, 40896 right: Object(external_wp_i18n_["isRTL"])() ? null : CORNER_OFFSET, 40897 left: Object(external_wp_i18n_["isRTL"])() ? CORNER_OFFSET : null 40898 }; 40899 } 40900 40901 return Object(external_wp_element_["createElement"])(TooltipWrapper, Object(esm_extends["a" /* default */])({ 40902 "aria-hidden": "true", 40903 className: "components-resizable-tooltip__tooltip-wrapper", 40904 isActive: showLabel, 40905 ref: ref, 40906 style: style 40907 }, props), Object(external_wp_element_["createElement"])(resize_tooltip_styles_Tooltip, { 40908 className: "components-resizable-tooltip__tooltip", 40909 style: labelStyle 40910 }, Object(external_wp_element_["createElement"])(LabelText, { 40911 as: "span" 40912 }, label))); 40913 } 40914 40915 const label_ForwardedComponent = Object(external_wp_element_["forwardRef"])(resize_tooltip_label_Label); 40916 /* harmony default export */ var resize_tooltip_label = (label_ForwardedComponent); 40917 40918 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/index.js 40919 40920 40921 40922 /** 40923 * External dependencies 40924 */ 40925 40926 40927 /** 40928 * WordPress dependencies 40929 */ 40930 40931 40932 /** 40933 * Internal dependencies 40934 */ 40935 40936 40937 40938 40939 40940 function ResizeTooltip({ 40941 axis, 40942 className, 40943 fadeTimeout = 180, 40944 isVisible = true, 40945 labelRef, 40946 onResize = external_lodash_["noop"], 40947 position = POSITIONS.bottom, 40948 showPx = true, 40949 zIndex = 1000, 40950 ...props 40951 }, ref) { 40952 const { 40953 label, 40954 resizeListener 40955 } = useResizeLabel({ 40956 axis, 40957 fadeTimeout, 40958 onResize, 40959 showPx, 40960 position 40961 }); 40962 if (!isVisible) return null; 40963 const classes = classnames_default()('components-resize-tooltip', className); 40964 return Object(external_wp_element_["createElement"])(resize_tooltip_styles_Root, Object(esm_extends["a" /* default */])({ 40965 "aria-hidden": "true", 40966 className: classes, 40967 ref: ref 40968 }, props), resizeListener, Object(external_wp_element_["createElement"])(resize_tooltip_label, { 40969 "aria-hidden": props['aria-hidden'], 40970 fadeTimeout: fadeTimeout, 40971 isVisible: isVisible, 40972 label: label, 40973 position: position, 40974 ref: labelRef, 40975 zIndex: zIndex 40976 })); 40977 } 40978 40979 const resize_tooltip_ForwardedComponent = Object(external_wp_element_["forwardRef"])(ResizeTooltip); 40980 /* harmony default export */ var resize_tooltip = (resize_tooltip_ForwardedComponent); 40981 40982 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/index.js 40983 40984 40985 40986 /** 40987 * WordPress dependencies 40988 */ 40989 40990 /** 40991 * External dependencies 40992 */ 40993 40994 40995 40996 /** 40997 * Internal dependencies 40998 */ 40999 41000 41001 41002 function ResizableBox({ 41003 className, 41004 children, 41005 showHandle = true, 41006 __experimentalShowTooltip: showTooltip = false, 41007 __experimentalTooltipProps: tooltipProps = {}, 41008 ...props 41009 }, ref) { 41010 // Removes the inline styles in the drag handles. 41011 const handleStylesOverrides = { 41012 width: null, 41013 height: null, 41014 top: null, 41015 right: null, 41016 bottom: null, 41017 left: null 41018 }; 41019 const handleClassName = 'components-resizable-box__handle'; 41020 const sideHandleClassName = 'components-resizable-box__side-handle'; 41021 const cornerHandleClassName = 'components-resizable-box__corner-handle'; 41022 return Object(external_wp_element_["createElement"])(lib_Resizable, Object(esm_extends["a" /* default */])({ 41023 className: classnames_default()('components-resizable-box__container', showHandle && 'has-show-handle', className), 41024 handleClasses: { 41025 top: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-top'), 41026 right: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-right'), 41027 bottom: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-bottom'), 41028 left: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-left'), 41029 topLeft: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-left'), 41030 topRight: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-right'), 41031 bottomRight: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-right'), 41032 bottomLeft: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-left') 41033 }, 41034 handleStyles: { 41035 top: handleStylesOverrides, 41036 right: handleStylesOverrides, 41037 bottom: handleStylesOverrides, 41038 left: handleStylesOverrides, 41039 topLeft: handleStylesOverrides, 41040 topRight: handleStylesOverrides, 41041 bottomRight: handleStylesOverrides, 41042 bottomLeft: handleStylesOverrides 41043 }, 41044 ref: ref 41045 }, props), children, showTooltip && Object(external_wp_element_["createElement"])(resize_tooltip, tooltipProps)); 41046 } 41047 41048 /* harmony default export */ var resizable_box = (Object(external_wp_element_["forwardRef"])(ResizableBox)); 41049 41050 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js 41051 41052 41053 /** 41054 * External dependencies 41055 */ 41056 41057 /** 41058 * WordPress dependencies 41059 */ 41060 41061 41062 41063 41064 function ResponsiveWrapper({ 41065 naturalWidth, 41066 naturalHeight, 41067 children, 41068 isInline = false 41069 }) { 41070 const [containerResizeListener, { 41071 width: containerWidth 41072 }] = Object(external_wp_compose_["useResizeObserver"])(); 41073 41074 if (external_wp_element_["Children"].count(children) !== 1) { 41075 return null; 41076 } 41077 41078 const imageStyle = { 41079 paddingBottom: naturalWidth < containerWidth ? naturalHeight : naturalHeight / naturalWidth * 100 + '%' 41080 }; 41081 const TagName = isInline ? 'span' : 'div'; 41082 return Object(external_wp_element_["createElement"])(TagName, { 41083 className: "components-responsive-wrapper" 41084 }, containerResizeListener, Object(external_wp_element_["createElement"])(TagName, { 41085 style: imageStyle 41086 }), Object(external_wp_element_["cloneElement"])(children, { 41087 className: classnames_default()('components-responsive-wrapper__content', children.props.className) 41088 })); 41089 } 41090 41091 /* harmony default export */ var responsive_wrapper = (ResponsiveWrapper); 41092 41093 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/sandbox/index.js 41094 41095 41096 /** 41097 * WordPress dependencies 41098 */ 41099 41100 /** 41101 * Internal dependencies 41102 */ 41103 41104 41105 const observeAndResizeJS = ` 41106 ( function() { 41107 var observer; 41108 41109 if ( ! window.MutationObserver || ! document.body || ! window.parent ) { 41110 return; 41111 } 41112 41113 function sendResize() { 41114 var clientBoundingRect = document.body.getBoundingClientRect(); 41115 41116 window.parent.postMessage( { 41117 action: 'resize', 41118 width: clientBoundingRect.width, 41119 height: clientBoundingRect.height, 41120 }, '*' ); 41121 } 41122 41123 observer = new MutationObserver( sendResize ); 41124 observer.observe( document.body, { 41125 attributes: true, 41126 attributeOldValue: false, 41127 characterData: true, 41128 characterDataOldValue: false, 41129 childList: true, 41130 subtree: true 41131 } ); 41132 41133 window.addEventListener( 'load', sendResize, true ); 41134 41135 // Hack: Remove viewport unit styles, as these are relative 41136 // the iframe root and interfere with our mechanism for 41137 // determining the unconstrained page bounds. 41138 function removeViewportStyles( ruleOrNode ) { 41139 if( ruleOrNode.style ) { 41140 [ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) { 41141 if ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) { 41142 ruleOrNode.style[ style ] = ''; 41143 } 41144 } ); 41145 } 41146 } 41147 41148 Array.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles ); 41149 Array.prototype.forEach.call( document.styleSheets, function( stylesheet ) { 41150 Array.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles ); 41151 } ); 41152 41153 document.body.style.position = 'absolute'; 41154 document.body.style.width = '100%'; 41155 document.body.setAttribute( 'data-resizable-iframe-connected', '' ); 41156 41157 sendResize(); 41158 41159 // Resize events can change the width of elements with 100% width, but we don't 41160 // get an DOM mutations for that, so do the resize when the window is resized, too. 41161 window.addEventListener( 'resize', sendResize, true ); 41162 } )();`; 41163 const sandbox_style = ` 41164 body { 41165 margin: 0; 41166 } 41167 html, 41168 body, 41169 body > div, 41170 body > div iframe { 41171 width: 100%; 41172 } 41173 html.wp-has-aspect-ratio, 41174 body.wp-has-aspect-ratio, 41175 body.wp-has-aspect-ratio > div, 41176 body.wp-has-aspect-ratio > div iframe { 41177 height: 100%; 41178 overflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */ 41179 } 41180 body > div > * { 41181 margin-top: 0 !important; /* Has to have !important to override inline styles. */ 41182 margin-bottom: 0 !important; 41183 } 41184 `; 41185 function Sandbox({ 41186 html = '', 41187 title = '', 41188 type, 41189 styles = [], 41190 scripts = [], 41191 onFocus 41192 }) { 41193 const ref = Object(external_wp_element_["useRef"])(); 41194 const [width, setWidth] = Object(external_wp_element_["useState"])(0); 41195 const [height, setHeight] = Object(external_wp_element_["useState"])(0); 41196 41197 function isFrameAccessible() { 41198 try { 41199 return !!ref.current.contentDocument.body; 41200 } catch (e) { 41201 return false; 41202 } 41203 } 41204 41205 function trySandbox(forceRerender = false) { 41206 if (!isFrameAccessible()) { 41207 return; 41208 } 41209 41210 const { 41211 contentDocument, 41212 ownerDocument 41213 } = ref.current; 41214 const { 41215 body 41216 } = contentDocument; 41217 41218 if (!forceRerender && null !== body.getAttribute('data-resizable-iframe-connected')) { 41219 return; 41220 } // put the html snippet into a html document, and then write it to the iframe's document 41221 // we can use this in the future to inject custom styles or scripts. 41222 // Scripts go into the body rather than the head, to support embedded content such as Instagram 41223 // that expect the scripts to be part of the body. 41224 41225 41226 const htmlDoc = Object(external_wp_element_["createElement"])("html", { 41227 lang: ownerDocument.documentElement.lang, 41228 className: type 41229 }, Object(external_wp_element_["createElement"])("head", null, Object(external_wp_element_["createElement"])("title", null, title), Object(external_wp_element_["createElement"])("style", { 41230 dangerouslySetInnerHTML: { 41231 __html: sandbox_style 41232 } 41233 }), styles.map((rules, i) => Object(external_wp_element_["createElement"])("style", { 41234 key: i, 41235 dangerouslySetInnerHTML: { 41236 __html: rules 41237 } 41238 }))), Object(external_wp_element_["createElement"])("body", { 41239 "data-resizable-iframe-connected": "data-resizable-iframe-connected", 41240 className: type 41241 }, Object(external_wp_element_["createElement"])("div", { 41242 dangerouslySetInnerHTML: { 41243 __html: html 41244 } 41245 }), Object(external_wp_element_["createElement"])("script", { 41246 type: "text/javascript", 41247 dangerouslySetInnerHTML: { 41248 __html: observeAndResizeJS 41249 } 41250 }), scripts.map(src => Object(external_wp_element_["createElement"])("script", { 41251 key: src, 41252 src: src 41253 })))); // writing the document like this makes it act in the same way as if it was 41254 // loaded over the network, so DOM creation and mutation, script execution, etc. 41255 // all work as expected 41256 41257 contentDocument.open(); 41258 contentDocument.write('<!DOCTYPE html>' + Object(external_wp_element_["renderToString"])(htmlDoc)); 41259 contentDocument.close(); 41260 } 41261 41262 Object(external_wp_element_["useEffect"])(() => { 41263 trySandbox(); 41264 41265 function tryNoForceSandbox() { 41266 trySandbox(false); 41267 } 41268 41269 function checkMessageForResize(event) { 41270 const iframe = ref.current; // Verify that the mounted element is the source of the message 41271 41272 if (!iframe || iframe.contentWindow !== event.source) { 41273 return; 41274 } // Attempt to parse the message data as JSON if passed as string 41275 41276 41277 let data = event.data || {}; 41278 41279 if ('string' === typeof data) { 41280 try { 41281 data = JSON.parse(data); 41282 } catch (e) {} 41283 } // Update the state only if the message is formatted as we expect, 41284 // i.e. as an object with a 'resize' action. 41285 41286 41287 if ('resize' !== data.action) { 41288 return; 41289 } 41290 41291 setWidth(data.width); 41292 setHeight(data.height); 41293 } 41294 41295 const { 41296 ownerDocument 41297 } = ref.current; 41298 const { 41299 defaultView 41300 } = ownerDocument; // This used to be registered using <iframe onLoad={} />, but it made the iframe blank 41301 // after reordering the containing block. See these two issues for more details: 41302 // https://github.com/WordPress/gutenberg/issues/6146 41303 // https://github.com/facebook/react/issues/18752 41304 41305 ref.current.addEventListener('load', tryNoForceSandbox, false); 41306 defaultView.addEventListener('message', checkMessageForResize); 41307 return () => { 41308 ref.current.removeEventListener('load', tryNoForceSandbox, false); 41309 defaultView.addEventListener('message', checkMessageForResize); 41310 }; 41311 }, []); 41312 Object(external_wp_element_["useEffect"])(() => { 41313 trySandbox(); 41314 }, [title, type, styles, scripts]); 41315 Object(external_wp_element_["useEffect"])(() => { 41316 trySandbox(true); 41317 }, [html]); 41318 return Object(external_wp_element_["createElement"])(FocusableIframe, { 41319 iframeRef: ref, 41320 title: title, 41321 className: "components-sandbox", 41322 sandbox: "allow-scripts allow-same-origin allow-presentation", 41323 onFocus: onFocus, 41324 width: Math.ceil(width), 41325 height: Math.ceil(height) 41326 }); 41327 } 41328 41329 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/snackbar/index.js 41330 var snackbar = __webpack_require__("iB/h"); 41331 41332 // EXTERNAL MODULE: ./node_modules/react-spring/web.cjs.js 41333 var web_cjs = __webpack_require__("ZO3Q"); 41334 41335 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/list.js 41336 41337 41338 41339 /** 41340 * External dependencies 41341 */ 41342 41343 41344 41345 /** 41346 * WordPress dependencies 41347 */ 41348 41349 41350 41351 /** 41352 * Internal dependencies 41353 */ 41354 41355 41356 /** 41357 * Renders a list of notices. 41358 * 41359 * @param {Object} $0 Props passed to the component. 41360 * @param {Array} $0.notices Array of notices to render. 41361 * @param {Function} $0.onRemove Function called when a notice should be removed / dismissed. 41362 * @param {Object} $0.className Name of the class used by the component. 41363 * @param {Object} $0.children Array of children to be rendered inside the notice list. 41364 * @return {Object} The rendered notices list. 41365 */ 41366 41367 function SnackbarList({ 41368 notices, 41369 className, 41370 children, 41371 onRemove = external_lodash_["noop"] 41372 }) { 41373 const isReducedMotion = Object(external_wp_compose_["useReducedMotion"])(); 41374 const [refMap] = Object(external_wp_element_["useState"])(() => new WeakMap()); 41375 const transitions = Object(web_cjs["useTransition"])(notices, notice => notice.id, { 41376 from: { 41377 opacity: 0, 41378 height: 0 41379 }, 41380 enter: item => async (next) => await next({ 41381 opacity: 1, 41382 height: refMap.get(item).offsetHeight 41383 }), 41384 leave: () => async next => { 41385 await next({ 41386 opacity: 0 41387 }); 41388 await next({ 41389 height: 0 41390 }); 41391 }, 41392 immediate: isReducedMotion 41393 }); 41394 className = classnames_default()('components-snackbar-list', className); 41395 41396 const removeNotice = notice => () => onRemove(notice.id); 41397 41398 return Object(external_wp_element_["createElement"])("div", { 41399 className: className 41400 }, children, transitions.map(({ 41401 item: notice, 41402 key, 41403 props: style 41404 }) => Object(external_wp_element_["createElement"])(web_cjs["animated"].div, { 41405 key: key, 41406 style: style 41407 }, Object(external_wp_element_["createElement"])("div", { 41408 className: "components-snackbar-list__notice-container", 41409 ref: ref => ref && refMap.set(notice, ref) 41410 }, Object(external_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), { 41411 onRemove: removeNotice(notice) 41412 }), notice.content))))); 41413 } 41414 41415 /* harmony default export */ var snackbar_list = (SnackbarList); 41416 41417 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spacer/hook.js 41418 41419 41420 41421 /** 41422 * Internal dependencies 41423 */ 41424 // eslint-disable-next-line no-duplicate-imports 41425 41426 41427 41428 const isDefined = o => typeof o !== 'undefined' && o !== null; 41429 41430 function useSpacer(props) { 41431 const { 41432 className, 41433 margin, 41434 marginBottom = 2, 41435 marginLeft, 41436 marginRight, 41437 marginTop, 41438 marginX, 41439 marginY, 41440 padding, 41441 paddingBottom, 41442 paddingLeft, 41443 paddingRight, 41444 paddingTop, 41445 paddingX, 41446 paddingY, 41447 ...otherProps 41448 } = Object(use_context_system["a" /* useContextSystem */])(props, 'Spacer'); 41449 41450 const classes = Object(emotion_esm["b" /* cx */])(isDefined(marginTop) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-top:", space_space(marginTop), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginBottom) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(marginBottom), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginLeft) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-left:", space_space(marginLeft), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginRight) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-right:", space_space(marginRight), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginX) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-left:", space_space(marginX), ";margin-right:", space_space(marginX), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginY) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(marginY), ";margin-top:", space_space(marginY), ";;label:classes;" + ( true ? "" : undefined)), isDefined(margin) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin:", space_space(margin), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingTop) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-top:", space_space(paddingTop), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingBottom) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-bottom:", space_space(paddingBottom), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingLeft) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-left:", space_space(paddingLeft), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingRight) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-right:", space_space(paddingRight), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingX) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-left:", space_space(paddingX), ";padding-right:", space_space(paddingX), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingY) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-bottom:", space_space(paddingY), ";padding-top:", space_space(paddingY), ";;label:classes;" + ( true ? "" : undefined)), isDefined(padding) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding:", space_space(padding), ";;label:classes;" + ( true ? "" : undefined)), className); 41451 41452 return { ...otherProps, 41453 className: classes 41454 }; 41455 } 41456 41457 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spacer/component.js 41458 /** 41459 * Internal dependencies 41460 */ 41461 41462 41463 /** 41464 * `Spacer` is a primitive layout component that providers inner (`padding`) or outer (`margin`) space in-between components. It can also be used to adaptively provide space within an `HStack` or `VStack`. 41465 * 41466 * `Spacer` comes with a bunch of shorthand props to adjust `margin` and `padding`. The values of these props work as a multiplier to the library's grid system (base of `4px`). 41467 * 41468 * @example 41469 * ```jsx 41470 * import { Spacer } from `@wordpress/components` 41471 * 41472 * function Example() { 41473 * return ( 41474 * <View> 41475 * <Spacer> 41476 * <Heading>WordPress.org</Heading> 41477 * </Spacer> 41478 * <Text> 41479 * Code is Poetry 41480 * </Text> 41481 * </View> 41482 * ); 41483 * } 41484 * ``` 41485 */ 41486 41487 const Spacer = create_component_createComponent({ 41488 as: 'div', 41489 useHook: useSpacer, 41490 name: 'Spacer' 41491 }); 41492 /* harmony default export */ var spacer_component = (Spacer); 41493 41494 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spinner/styles/spinner-styles.js 41495 41496 41497 /** 41498 * Internal dependencies 41499 */ 41500 41501 41502 const spinAnimation = core_browser_esm_keyframes` 41503 from { 41504 transform: rotate(0deg); 41505 } 41506 41507 to { 41508 transform: rotate(360deg); 41509 } 41510 `; 41511 const topLeft = `calc( ( ${config_values.spinnerSize} - ${config_values.spinnerSize} * ( 2 / 3 ) ) / 2 )`; 41512 const StyledSpinner = styled_base_browser_esm("span", { 41513 target: "e1s472tg0", 41514 label: "StyledSpinner" 41515 })("display:inline-block;background-color:", COLORS.gray[600], ";width:", config_values.spinnerSize, ";height:", config_values.spinnerSize, ";opacity:0.7;margin:5px 11px 0;border-radius:100%;position:relative;&::before{content:'';position:absolute;background-color:", COLORS.white, ";top:", topLeft, ";left:", topLeft, ";width:calc( ", config_values.spinnerSize, " / 4.5 );height:calc( ", config_values.spinnerSize, " / 4.5 );border-radius:100%;transform-origin:calc( ", config_values.spinnerSize, " / 3 ) calc( ", config_values.spinnerSize, " / 3 );animation:", spinAnimation, " 1s infinite linear;}" + ( true ? "" : undefined)); 41516 41517 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spinner/index.js 41518 41519 41520 /** 41521 * Internal dependencies 41522 */ 41523 41524 function Spinner() { 41525 return Object(external_wp_element_["createElement"])(StyledSpinner, { 41526 className: "components-spinner" 41527 }); 41528 } 41529 41530 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tab-panel/index.js 41531 41532 41533 41534 /** 41535 * External dependencies 41536 */ 41537 41538 41539 /** 41540 * WordPress dependencies 41541 */ 41542 41543 41544 41545 /** 41546 * Internal dependencies 41547 */ 41548 41549 41550 41551 41552 const TabButton = ({ 41553 tabId, 41554 onClick, 41555 children, 41556 selected, 41557 ...rest 41558 }) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 41559 role: "tab", 41560 tabIndex: selected ? null : -1, 41561 "aria-selected": selected, 41562 id: tabId, 41563 onClick: onClick 41564 }, rest), children); 41565 41566 function TabPanel({ 41567 className, 41568 children, 41569 tabs, 41570 initialTabName, 41571 orientation = 'horizontal', 41572 activeClass = 'is-active', 41573 onSelect = external_lodash_["noop"] 41574 }) { 41575 var _selectedTab$name; 41576 41577 const instanceId = Object(external_wp_compose_["useInstanceId"])(TabPanel, 'tab-panel'); 41578 const [selected, setSelected] = Object(external_wp_element_["useState"])(null); 41579 41580 const handleClick = tabKey => { 41581 setSelected(tabKey); 41582 onSelect(tabKey); 41583 }; 41584 41585 const onNavigate = (childIndex, child) => { 41586 child.click(); 41587 }; 41588 41589 const selectedTab = Object(external_lodash_["find"])(tabs, { 41590 name: selected 41591 }); 41592 const selectedId = `${instanceId}-${(_selectedTab$name = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name) !== null && _selectedTab$name !== void 0 ? _selectedTab$name : 'none'}`; 41593 Object(external_wp_element_["useEffect"])(() => { 41594 const newSelectedTab = Object(external_lodash_["find"])(tabs, { 41595 name: selected 41596 }); 41597 41598 if (!newSelectedTab) { 41599 setSelected(initialTabName || (tabs.length > 0 ? tabs[0].name : null)); 41600 } 41601 }, [tabs]); 41602 return Object(external_wp_element_["createElement"])("div", { 41603 className: className 41604 }, Object(external_wp_element_["createElement"])(navigable_container_menu, { 41605 role: "tablist", 41606 orientation: orientation, 41607 onNavigate: onNavigate, 41608 className: "components-tab-panel__tabs" 41609 }, tabs.map(tab => Object(external_wp_element_["createElement"])(TabButton, { 41610 className: classnames_default()('components-tab-panel__tabs-item', tab.className, { 41611 [activeClass]: tab.name === selected 41612 }), 41613 tabId: `${instanceId}-${tab.name}`, 41614 "aria-controls": `${instanceId}-${tab.name}-view`, 41615 selected: tab.name === selected, 41616 key: tab.name, 41617 onClick: Object(external_lodash_["partial"])(handleClick, tab.name) 41618 }, tab.title))), selectedTab && Object(external_wp_element_["createElement"])("div", { 41619 key: selectedId, 41620 "aria-labelledby": selectedId, 41621 role: "tabpanel", 41622 id: `${selectedId}-view`, 41623 className: "components-tab-panel__tab-content" 41624 }, children(selectedTab))); 41625 } 41626 41627 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/input/base.js 41628 /** 41629 * External dependencies 41630 */ 41631 41632 /** 41633 * Internal dependencies 41634 */ 41635 41636 41637 41638 41639 const inputStyleNeutral = /*#__PURE__*/css_browser_esm("box-shadow:0 0 0 transparent;transition:box-shadow 0.1s linear;border-radius:", config_values.radiusBlockUi, ";border:", config_values.borderWidth, " solid ", COLORS.ui.border, "};", reduceMotion('transition'), ";label:inputStyleNeutral;" + ( true ? "" : undefined)); 41640 const inputStyleFocus = /*#__PURE__*/css_browser_esm("border-color:var( --wp-admin-theme-color );box-shadow:0 0 0 calc( ", config_values.borderWidthFocus, " - ", config_values.borderWidth, " ) var( --wp-admin-theme-color );outline:2px solid transparent;;label:inputStyleFocus;" + ( true ? "" : undefined)); 41641 41642 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/breakpoint-values.js 41643 /* harmony default export */ var breakpoint_values = ({ 41644 huge: '1440px', 41645 wide: '1280px', 41646 'x-large': '1080px', 41647 large: '960px', 41648 // admin sidebar auto folds 41649 medium: '782px', 41650 // adminbar goes big 41651 small: '600px', 41652 mobile: '480px', 41653 'zoomed-in': '280px' 41654 }); 41655 41656 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/breakpoint.js 41657 /** 41658 * Internal dependencies 41659 */ 41660 41661 /** 41662 * @param {keyof breakpoints} point 41663 * @return {string} Media query declaration. 41664 */ 41665 41666 const breakpoint = point => `@media (min-width: ${breakpoint_values[point]})`; 41667 41668 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/input/input-control.js 41669 /** 41670 * External dependencies 41671 */ 41672 41673 /** 41674 * Internal dependencies 41675 */ 41676 41677 41678 41679 41680 41681 const inputControl = /*#__PURE__*/css_browser_esm("font-family:", font('default.fontFamily'), ";padding:6px 8px;", inputStyleNeutral, ";font-size:", font('mobileTextMinFontSize'), ";line-height:normal;", breakpoint('small'), "{font-size:", font('default.fontSize'), ";line-height:normal;}&:focus{", inputStyleFocus, "}&::-webkit-input-placeholder{color:", COLORS.darkGray.placeholder, ";}&::-moz-placeholder{opacity:1;color:", COLORS.darkGray.placeholder, ";}&:-ms-input-placeholder{color:", COLORS.darkGray.placeholder, ";}.is-dark-theme &{&::-webkit-input-placeholder{color:", COLORS.lightGray.placeholder, ";}&::-moz-placeholder{opacity:1;color:", COLORS.lightGray.placeholder, ";}&:-ms-input-placeholder{color:", COLORS.lightGray.placeholder, ";}};label:inputControl;" + ( true ? "" : undefined)); 41682 41683 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/textarea-control/styles/textarea-control-styles.js 41684 41685 41686 /** 41687 * Internal dependencies 41688 */ 41689 41690 const StyledTextarea = styled_base_browser_esm("textarea", { 41691 target: "ebk7yr50", 41692 label: "StyledTextarea" 41693 })("width:100%;", inputControl, true ? "" : undefined); 41694 41695 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/textarea-control/index.js 41696 41697 41698 41699 /** 41700 * WordPress dependencies 41701 */ 41702 41703 /** 41704 * Internal dependencies 41705 */ 41706 41707 41708 41709 function TextareaControl({ 41710 label, 41711 hideLabelFromVision, 41712 value, 41713 help, 41714 onChange, 41715 rows = 4, 41716 className, 41717 ...props 41718 }) { 41719 const instanceId = Object(external_wp_compose_["useInstanceId"])(TextareaControl); 41720 const id = `inspector-textarea-control-${instanceId}`; 41721 41722 const onChangeValue = event => onChange(event.target.value); 41723 41724 return Object(external_wp_element_["createElement"])(base_control, { 41725 label: label, 41726 hideLabelFromVision: hideLabelFromVision, 41727 id: id, 41728 help: help, 41729 className: className 41730 }, Object(external_wp_element_["createElement"])(StyledTextarea, Object(esm_extends["a" /* default */])({ 41731 className: "components-textarea-control__input", 41732 id: id, 41733 rows: rows, 41734 onChange: onChangeValue, 41735 "aria-describedby": !!help ? id + '__help' : undefined, 41736 value: value 41737 }, props))); 41738 } 41739 41740 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-highlight/index.js 41741 41742 41743 /** 41744 * External dependencies 41745 */ 41746 41747 /** 41748 * WordPress dependencies 41749 */ 41750 41751 41752 41753 const TextHighlight = ({ 41754 text = '', 41755 highlight = '' 41756 }) => { 41757 const trimmedHighlightText = highlight.trim(); 41758 41759 if (!trimmedHighlightText) { 41760 return text; 41761 } 41762 41763 const regex = new RegExp(`(${Object(external_lodash_["escapeRegExp"])(trimmedHighlightText)})`, 'gi'); 41764 return Object(external_wp_element_["createInterpolateElement"])(text.replace(regex, '<mark>$&</mark>'), { 41765 mark: Object(external_wp_element_["createElement"])("mark", null) 41766 }); 41767 }; 41768 41769 /* harmony default export */ var text_highlight = (TextHighlight); 41770 41771 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tip/index.js 41772 41773 41774 /** 41775 * WordPress dependencies 41776 */ 41777 41778 /** 41779 * @typedef Props 41780 * @property {import('react').ReactNode} children Children to render in the tip. 41781 */ 41782 41783 /** 41784 * @param {Props} props 41785 * @return {JSX.Element} Element 41786 */ 41787 41788 function Tip(props) { 41789 return Object(external_wp_element_["createElement"])("div", { 41790 className: "components-tip" 41791 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 41792 width: "24", 41793 height: "24", 41794 viewBox: "0 0 24 24" 41795 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 41796 d: "M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z" 41797 })), Object(external_wp_element_["createElement"])("p", null, props.children)); 41798 } 41799 41800 /* harmony default export */ var tip = (Tip); 41801 41802 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-control/index.js 41803 41804 41805 /** 41806 * External dependencies 41807 */ 41808 41809 41810 /** 41811 * WordPress dependencies 41812 */ 41813 41814 41815 /** 41816 * Internal dependencies 41817 */ 41818 41819 41820 41821 function ToggleControl({ 41822 label, 41823 checked, 41824 help, 41825 className, 41826 onChange, 41827 disabled 41828 }) { 41829 function onChangeToggle(event) { 41830 onChange(event.target.checked); 41831 } 41832 41833 const instanceId = Object(external_wp_compose_["useInstanceId"])(ToggleControl); 41834 const id = `inspector-toggle-control-${instanceId}`; 41835 let describedBy, helpLabel; 41836 41837 if (help) { 41838 describedBy = id + '__help'; 41839 helpLabel = Object(external_lodash_["isFunction"])(help) ? help(checked) : help; 41840 } 41841 41842 return Object(external_wp_element_["createElement"])(base_control, { 41843 id: id, 41844 help: helpLabel, 41845 className: classnames_default()('components-toggle-control', className) 41846 }, Object(external_wp_element_["createElement"])(form_toggle, { 41847 id: id, 41848 checked: checked, 41849 onChange: onChangeToggle, 41850 "aria-describedby": describedBy, 41851 disabled: disabled 41852 }), Object(external_wp_element_["createElement"])("label", { 41853 htmlFor: id, 41854 className: "components-toggle-control__label" 41855 }, label)); 41856 } 41857 41858 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/toolbar-item/index.js 41859 var toolbar_item = __webpack_require__("aA0e"); 41860 41861 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/toolbar-context/index.js 41862 var toolbar_context = __webpack_require__("GK4x"); 41863 41864 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-button/toolbar-button-container.js 41865 41866 41867 const ToolbarButtonContainer = props => Object(external_wp_element_["createElement"])("div", { 41868 className: props.className 41869 }, props.children); 41870 41871 /* harmony default export */ var toolbar_button_container = (ToolbarButtonContainer); 41872 41873 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-button/index.js 41874 41875 41876 41877 /** 41878 * External dependencies 41879 */ 41880 41881 /** 41882 * WordPress dependencies 41883 */ 41884 41885 41886 /** 41887 * Internal dependencies 41888 */ 41889 41890 41891 41892 41893 41894 41895 function ToolbarButton({ 41896 containerClassName, 41897 className, 41898 extraProps, 41899 children, 41900 title, 41901 isActive, 41902 isDisabled, 41903 ...props 41904 }, ref) { 41905 const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]); 41906 41907 if (!accessibleToolbarState) { 41908 return Object(external_wp_element_["createElement"])(toolbar_button_container, { 41909 className: containerClassName 41910 }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 41911 ref: ref, 41912 icon: props.icon, 41913 label: title, 41914 shortcut: props.shortcut, 41915 "data-subscript": props.subscript, 41916 onClick: event => { 41917 event.stopPropagation(); 41918 41919 if (props.onClick) { 41920 props.onClick(event); 41921 } 41922 }, 41923 className: classnames_default()('components-toolbar__control', className), 41924 isPressed: isActive, 41925 disabled: isDisabled, 41926 "data-toolbar-item": true 41927 }, extraProps, props), children)); 41928 } // ToobarItem will pass all props to the render prop child, which will pass 41929 // all props to Button. This means that ToolbarButton has the same API as 41930 // Button. 41931 41932 41933 return Object(external_wp_element_["createElement"])(toolbar_item["a" /* default */], Object(esm_extends["a" /* default */])({ 41934 className: classnames_default()('components-toolbar-button', className) 41935 }, extraProps, props, { 41936 ref: ref 41937 }), toolbarItemProps => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({ 41938 label: title, 41939 isPressed: isActive, 41940 disabled: isDisabled 41941 }, toolbarItemProps), children)); 41942 } 41943 41944 /* harmony default export */ var toolbar_button = (Object(external_wp_element_["forwardRef"])(ToolbarButton)); 41945 41946 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/toolbar-group-container.js 41947 41948 41949 41950 const ToolbarGroupContainer = ({ 41951 className, 41952 children, 41953 ...props 41954 }) => Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ 41955 className: className 41956 }, props), children); 41957 41958 /* harmony default export */ var toolbar_group_container = (ToolbarGroupContainer); 41959 41960 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/toolbar-group-collapsed.js 41961 41962 41963 41964 /** 41965 * WordPress dependencies 41966 */ 41967 41968 /** 41969 * Internal dependencies 41970 */ 41971 41972 41973 41974 41975 41976 function ToolbarGroupCollapsed({ 41977 controls = [], 41978 toggleProps, 41979 ...props 41980 }) { 41981 // It'll contain state if `ToolbarGroup` is being used within 41982 // `<Toolbar label="label" />` 41983 const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]); 41984 41985 const renderDropdownMenu = internalToggleProps => Object(external_wp_element_["createElement"])(dropdown_menu, Object(esm_extends["a" /* default */])({ 41986 controls: controls, 41987 toggleProps: { ...internalToggleProps, 41988 'data-toolbar-item': true 41989 } 41990 }, props)); 41991 41992 if (accessibleToolbarState) { 41993 return Object(external_wp_element_["createElement"])(toolbar_item["a" /* default */], toggleProps, renderDropdownMenu); 41994 } 41995 41996 return renderDropdownMenu(toggleProps); 41997 } 41998 41999 /* harmony default export */ var toolbar_group_collapsed = (ToolbarGroupCollapsed); 42000 42001 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/index.js 42002 42003 42004 42005 /** 42006 * External dependencies 42007 */ 42008 42009 42010 /** 42011 * WordPress dependencies 42012 */ 42013 42014 42015 /** 42016 * Internal dependencies 42017 */ 42018 42019 42020 42021 42022 42023 /** 42024 * Renders a collapsible group of controls 42025 * 42026 * The `controls` prop accepts an array of sets. A set is an array of controls. 42027 * Controls have the following shape: 42028 * 42029 * ``` 42030 * { 42031 * icon: string, 42032 * title: string, 42033 * subscript: string, 42034 * onClick: Function, 42035 * isActive: boolean, 42036 * isDisabled: boolean 42037 * } 42038 * ``` 42039 * 42040 * For convenience it is also possible to pass only an array of controls. It is 42041 * then assumed this is the only set. 42042 * 42043 * Either `controls` or `children` is required, otherwise this components 42044 * renders nothing. 42045 * 42046 * @param {Object} props Component props. 42047 * @param {Array} [props.controls] The controls to render in this toolbar. 42048 * @param {WPElement} [props.children] Any other things to render inside the toolbar besides the controls. 42049 * @param {string} [props.className] Class to set on the container div. 42050 * @param {boolean} [props.isCollapsed] Turns ToolbarGroup into a dropdown menu. 42051 * @param {string} [props.title] ARIA label for dropdown menu if is collapsed. 42052 */ 42053 42054 function ToolbarGroup({ 42055 controls = [], 42056 children, 42057 className, 42058 isCollapsed, 42059 title, 42060 ...props 42061 }) { 42062 // It'll contain state if `ToolbarGroup` is being used within 42063 // `<Toolbar label="label" />` 42064 const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]); 42065 42066 if ((!controls || !controls.length) && !children) { 42067 return null; 42068 } 42069 42070 const finalClassName = classnames_default()( // Unfortunately, there's legacy code referencing to `.components-toolbar` 42071 // So we can't get rid of it 42072 accessibleToolbarState ? 'components-toolbar-group' : 'components-toolbar', className); // Normalize controls to nested array of objects (sets of controls) 42073 42074 let controlSets = controls; 42075 42076 if (!Array.isArray(controlSets[0])) { 42077 controlSets = [controlSets]; 42078 } 42079 42080 if (isCollapsed) { 42081 return Object(external_wp_element_["createElement"])(toolbar_group_collapsed, Object(esm_extends["a" /* default */])({ 42082 label: title, 42083 controls: controlSets, 42084 className: finalClassName, 42085 children: children 42086 }, props)); 42087 } 42088 42089 return Object(external_wp_element_["createElement"])(toolbar_group_container, Object(esm_extends["a" /* default */])({ 42090 className: finalClassName 42091 }, props), Object(external_lodash_["flatMap"])(controlSets, (controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => Object(external_wp_element_["createElement"])(toolbar_button, Object(esm_extends["a" /* default */])({ 42092 key: [indexOfSet, indexOfControl].join(), 42093 containerClassName: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : null 42094 }, control)))), children); 42095 } 42096 42097 /* harmony default export */ var toolbar_group = (ToolbarGroup); 42098 42099 // CONCATENATED MODULE: ./node_modules/reakit/es/Toolbar/ToolbarState.js 42100 42101 42102 42103 42104 42105 42106 42107 42108 42109 42110 42111 42112 42113 function useToolbarState(initialState) { 42114 if (initialState === void 0) { 42115 initialState = {}; 42116 } 42117 42118 var _useSealedState = useSealedState(initialState), 42119 _useSealedState$orien = _useSealedState.orientation, 42120 orientation = _useSealedState$orien === void 0 ? "horizontal" : _useSealedState$orien, 42121 sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["orientation"]); 42122 42123 return useCompositeState(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 42124 orientation: orientation 42125 }, sealed)); 42126 } 42127 42128 42129 42130 // EXTERNAL MODULE: ./node_modules/reakit/es/__keys-ae468c11.js 42131 var _keys_ae468c11 = __webpack_require__("mjVI"); 42132 42133 // CONCATENATED MODULE: ./node_modules/reakit/es/Toolbar/Toolbar.js 42134 42135 42136 42137 42138 42139 42140 42141 42142 42143 42144 42145 42146 42147 42148 42149 42150 42151 42152 42153 42154 42155 42156 42157 42158 42159 42160 42161 42162 42163 42164 42165 var useToolbar = Object(createHook["a" /* createHook */])({ 42166 name: "Toolbar", 42167 compose: useComposite, 42168 keys: _keys_ae468c11["a" /* T */], 42169 useProps: function useProps(options, htmlProps) { 42170 return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ 42171 role: "toolbar", 42172 "aria-orientation": options.orientation 42173 }, htmlProps); 42174 } 42175 }); 42176 var Toolbar = Object(createComponent["a" /* createComponent */])({ 42177 as: "div", 42178 useHook: useToolbar, 42179 useCreateElement: function useCreateElement$1(type, props, children) { 42180 false ? undefined : void 0; 42181 return Object(useCreateElement["a" /* useCreateElement */])(type, props, children); 42182 } 42183 }); 42184 42185 42186 42187 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js 42188 42189 42190 42191 /** 42192 * External dependencies 42193 */ 42194 42195 /** 42196 * WordPress dependencies 42197 */ 42198 42199 42200 42201 /** 42202 * Internal dependencies 42203 */ 42204 42205 42206 42207 function ToolbarContainer({ 42208 label, 42209 ...props 42210 }, ref) { 42211 // https://reakit.io/docs/basic-concepts/#state-hooks 42212 // Passing baseId for server side rendering (which includes snapshots) 42213 // If an id prop is passed to Toolbar, toolbar items will use it as a base for their ids 42214 const toolbarState = useToolbarState({ 42215 loop: true, 42216 baseId: props.id, 42217 rtl: Object(external_wp_i18n_["isRTL"])() 42218 }); 42219 return (// This will provide state for `ToolbarButton`'s 42220 Object(external_wp_element_["createElement"])(toolbar_context["a" /* default */].Provider, { 42221 value: toolbarState 42222 }, Object(external_wp_element_["createElement"])(Toolbar, Object(esm_extends["a" /* default */])({ 42223 ref: ref, 42224 "aria-label": label 42225 }, toolbarState, props))) 42226 ); 42227 } 42228 42229 /* harmony default export */ var toolbar_container = (Object(external_wp_element_["forwardRef"])(ToolbarContainer)); 42230 42231 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/index.js 42232 42233 42234 42235 /** 42236 * External dependencies 42237 */ 42238 42239 /** 42240 * WordPress dependencies 42241 */ 42242 42243 42244 42245 /** 42246 * Internal dependencies 42247 */ 42248 42249 42250 42251 /** 42252 * Renders a toolbar. 42253 * 42254 * To add controls, simply pass `ToolbarButton` components as children. 42255 * 42256 * @param {Object} props Component props. 42257 * @param {string} [props.className] Class to set on the container div. 42258 * @param {string} [props.label] ARIA label for toolbar container. 42259 * @param {Object} ref React Element ref. 42260 */ 42261 42262 function toolbar_Toolbar({ 42263 className, 42264 label, 42265 ...props 42266 }, ref) { 42267 if (!label) { 42268 external_wp_deprecated_default()('Using Toolbar without label prop', { 42269 since: '5.6', 42270 alternative: 'ToolbarGroup component', 42271 link: 'https://developer.wordpress.org/block-editor/components/toolbar/' 42272 }); 42273 return Object(external_wp_element_["createElement"])(toolbar_group, Object(esm_extends["a" /* default */])({}, props, { 42274 className: className 42275 })); 42276 } // `ToolbarGroup` already uses components-toolbar for compatibility reasons 42277 42278 42279 const finalClassName = classnames_default()('components-accessible-toolbar', className); 42280 return Object(external_wp_element_["createElement"])(toolbar_container, Object(esm_extends["a" /* default */])({ 42281 className: finalClassName, 42282 label: label, 42283 ref: ref 42284 }, props)); 42285 } 42286 42287 /* harmony default export */ var toolbar = (Object(external_wp_element_["forwardRef"])(toolbar_Toolbar)); 42288 42289 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-dropdown-menu/index.js 42290 42291 42292 42293 /** 42294 * WordPress dependencies 42295 */ 42296 42297 /** 42298 * Internal dependencies 42299 */ 42300 42301 42302 42303 42304 42305 function ToolbarDropdownMenu(props) { 42306 const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]); 42307 42308 if (!accessibleToolbarState) { 42309 return Object(external_wp_element_["createElement"])(dropdown_menu, props); 42310 } // ToobarItem will pass all props to the render prop child, which will pass 42311 // all props to the toggle of DrpodownMenu. This means that ToolbarDropdownMenu has the same API as 42312 // DrpodownMenu. 42313 42314 42315 return Object(external_wp_element_["createElement"])(toolbar_item["a" /* default */], null, toolbarItemProps => Object(external_wp_element_["createElement"])(dropdown_menu, Object(esm_extends["a" /* default */])({}, props, { 42316 toggleProps: props.toggleProps ? { ...props.toggleProps, 42317 ...toolbarItemProps 42318 } : toolbarItemProps 42319 }))); 42320 } 42321 42322 /* harmony default export */ var toolbar_dropdown_menu = (ToolbarDropdownMenu); 42323 42324 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-context.js 42325 /** 42326 * WordPress dependencies 42327 */ 42328 42329 const RovingTabIndexContext = Object(external_wp_element_["createContext"])(); 42330 const useRovingTabIndexContext = () => Object(external_wp_element_["useContext"])(RovingTabIndexContext); 42331 const RovingTabIndexProvider = RovingTabIndexContext.Provider; 42332 42333 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index.js 42334 42335 42336 /** 42337 * WordPress dependencies 42338 */ 42339 42340 /** 42341 * Internal dependencies 42342 */ 42343 42344 42345 /** 42346 * Provider for adding roving tab index behaviors to tree grid structures. 42347 * 42348 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md 42349 * 42350 * @param {Object} props Component props. 42351 * @param {WPElement} props.children Children to be rendered 42352 */ 42353 42354 function RovingTabIndex({ 42355 children 42356 }) { 42357 const [lastFocusedElement, setLastFocusedElement] = Object(external_wp_element_["useState"])(); // Use `useMemo` to avoid creation of a new object for the providerValue 42358 // on every render. Only create a new object when the `lastFocusedElement` 42359 // value changes. 42360 42361 const providerValue = Object(external_wp_element_["useMemo"])(() => ({ 42362 lastFocusedElement, 42363 setLastFocusedElement 42364 }), [lastFocusedElement]); 42365 return Object(external_wp_element_["createElement"])(RovingTabIndexProvider, { 42366 value: providerValue 42367 }, children); 42368 } 42369 42370 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/index.js 42371 42372 42373 42374 /** 42375 * External dependencies 42376 */ 42377 42378 /** 42379 * WordPress dependencies 42380 */ 42381 42382 42383 42384 42385 /** 42386 * Internal dependencies 42387 */ 42388 42389 42390 /** 42391 * Return focusables in a row element, excluding those from other branches 42392 * nested within the row. 42393 * 42394 * @param {Element} rowElement The DOM element representing the row. 42395 * 42396 * @return {?Array} The array of focusables in the row. 42397 */ 42398 42399 function getRowFocusables(rowElement) { 42400 const focusablesInRow = external_wp_dom_["focus"].focusable.find(rowElement); 42401 42402 if (!focusablesInRow || !focusablesInRow.length) { 42403 return; 42404 } 42405 42406 return focusablesInRow.filter(focusable => { 42407 return focusable.closest('[role="row"]') === rowElement; 42408 }); 42409 } 42410 /** 42411 * Renders both a table and tbody element, used to create a tree hierarchy. 42412 * 42413 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md 42414 * @param {Object} props Component props. 42415 * @param {WPElement} props.children Children to be rendered. 42416 * @param {Object} ref A ref to the underlying DOM table element. 42417 */ 42418 42419 42420 function TreeGrid({ 42421 children, 42422 ...props 42423 }, ref) { 42424 const onKeyDown = Object(external_wp_element_["useCallback"])(event => { 42425 const { 42426 keyCode, 42427 metaKey, 42428 ctrlKey, 42429 altKey, 42430 shiftKey 42431 } = event; 42432 const hasModifierKeyPressed = metaKey || ctrlKey || altKey || shiftKey; 42433 42434 if (hasModifierKeyPressed || !Object(external_lodash_["includes"])([external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) { 42435 return; 42436 } // The event will be handled, stop propagation. 42437 42438 42439 event.stopPropagation(); 42440 const { 42441 activeElement 42442 } = document; 42443 const { 42444 currentTarget: treeGridElement 42445 } = event; 42446 42447 if (!treeGridElement.contains(activeElement)) { 42448 return; 42449 } // Calculate the columnIndex of the active element. 42450 42451 42452 const activeRow = activeElement.closest('[role="row"]'); 42453 const focusablesInRow = getRowFocusables(activeRow); 42454 const currentColumnIndex = focusablesInRow.indexOf(activeElement); 42455 42456 if (Object(external_lodash_["includes"])([external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) { 42457 // Calculate to the next element. 42458 let nextIndex; 42459 42460 if (keyCode === external_wp_keycodes_["LEFT"]) { 42461 nextIndex = Math.max(0, currentColumnIndex - 1); 42462 } else { 42463 nextIndex = Math.min(currentColumnIndex + 1, focusablesInRow.length - 1); 42464 } // Focus is either at the left or right edge of the grid. Do nothing. 42465 42466 42467 if (nextIndex === currentColumnIndex) { 42468 // Prevent key use for anything else. For example, Voiceover 42469 // will start reading text on continued use of left/right arrow 42470 // keys. 42471 event.preventDefault(); 42472 return; 42473 } // Focus the next element. 42474 42475 42476 focusablesInRow[nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover 42477 // doesn't try to handle key navigation. 42478 42479 event.preventDefault(); 42480 } else if (Object(external_lodash_["includes"])([external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"]], keyCode)) { 42481 // Calculate the rowIndex of the next row. 42482 const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]')); 42483 const currentRowIndex = rows.indexOf(activeRow); 42484 let nextRowIndex; 42485 42486 if (keyCode === external_wp_keycodes_["UP"]) { 42487 nextRowIndex = Math.max(0, currentRowIndex - 1); 42488 } else { 42489 nextRowIndex = Math.min(currentRowIndex + 1, rows.length - 1); 42490 } // Focus is either at the top or bottom edge of the grid. Do nothing. 42491 42492 42493 if (nextRowIndex === currentRowIndex) { 42494 // Prevent key use for anything else. For example, Voiceover 42495 // will start navigating horizontally when reaching the vertical 42496 // bounds of a table. 42497 event.preventDefault(); 42498 return; 42499 } // Get the focusables in the next row. 42500 42501 42502 const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]); // If for some reason there are no focusables in the next row, do nothing. 42503 42504 if (!focusablesInNextRow || !focusablesInNextRow.length) { 42505 // Prevent key use for anything else. For example, Voiceover 42506 // will still focus text when using arrow keys, while this 42507 // component should limit navigation to focusables. 42508 event.preventDefault(); 42509 return; 42510 } // Try to focus the element in the next row that's at a similar column to the activeElement. 42511 42512 42513 const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1); 42514 focusablesInNextRow[nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover 42515 // doesn't try to handle key navigation. 42516 42517 event.preventDefault(); 42518 } 42519 }, []); 42520 /* Disable reason: A treegrid is implemented using a table element. */ 42521 42522 /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */ 42523 42524 return Object(external_wp_element_["createElement"])(RovingTabIndex, null, Object(external_wp_element_["createElement"])("table", Object(esm_extends["a" /* default */])({}, props, { 42525 role: "treegrid", 42526 onKeyDown: onKeyDown, 42527 ref: ref 42528 }), Object(external_wp_element_["createElement"])("tbody", null, children))); 42529 /* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */ 42530 } 42531 42532 /* harmony default export */ var tree_grid = (Object(external_wp_element_["forwardRef"])(TreeGrid)); 42533 42534 42535 42536 42537 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/row.js 42538 42539 42540 42541 /** 42542 * WordPress dependencies 42543 */ 42544 42545 42546 function TreeGridRow({ 42547 children, 42548 level, 42549 positionInSet, 42550 setSize, 42551 isExpanded, 42552 ...props 42553 }, ref) { 42554 return (// Disable reason: Due to an error in the ARIA 1.1 specification, the 42555 // aria-posinset and aria-setsize properties are not supported on row 42556 // elements. This is being corrected in ARIA 1.2. Consequently, the 42557 // linting rule fails when validating this markup. 42558 // 42559 // eslint-disable-next-line jsx-a11y/role-supports-aria-props 42560 Object(external_wp_element_["createElement"])("tr", Object(esm_extends["a" /* default */])({}, props, { 42561 ref: ref, 42562 role: "row", 42563 "aria-level": level, 42564 "aria-posinset": positionInSet, 42565 "aria-setsize": setSize, 42566 "aria-expanded": isExpanded 42567 }), children) 42568 ); 42569 } 42570 42571 /* harmony default export */ var tree_grid_row = (Object(external_wp_element_["forwardRef"])(TreeGridRow)); 42572 42573 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-item.js 42574 42575 42576 /** 42577 * WordPress dependencies 42578 */ 42579 42580 /** 42581 * Internal dependencies 42582 */ 42583 42584 42585 /* harmony default export */ var roving_tab_index_item = (Object(external_wp_element_["forwardRef"])(function RovingTabIndexItem({ 42586 children, 42587 as: Component, 42588 ...props 42589 }, forwardedRef) { 42590 const localRef = Object(external_wp_element_["useRef"])(); 42591 const ref = forwardedRef || localRef; 42592 const { 42593 lastFocusedElement, 42594 setLastFocusedElement 42595 } = useRovingTabIndexContext(); 42596 let tabIndex; 42597 42598 if (lastFocusedElement) { 42599 tabIndex = lastFocusedElement === ref.current ? 0 : -1; 42600 } 42601 42602 const onFocus = event => setLastFocusedElement(event.target); 42603 42604 const allProps = { 42605 ref, 42606 tabIndex, 42607 onFocus, 42608 ...props 42609 }; 42610 42611 if (typeof children === 'function') { 42612 return children(allProps); 42613 } 42614 42615 return Object(external_wp_element_["createElement"])(Component, allProps, children); 42616 })); 42617 42618 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/item.js 42619 42620 42621 42622 /** 42623 * WordPress dependencies 42624 */ 42625 42626 /** 42627 * Internal dependencies 42628 */ 42629 42630 42631 /* harmony default export */ var tree_grid_item = (Object(external_wp_element_["forwardRef"])(function TreeGridItem({ 42632 children, 42633 ...props 42634 }, ref) { 42635 return Object(external_wp_element_["createElement"])(roving_tab_index_item, Object(esm_extends["a" /* default */])({ 42636 ref: ref 42637 }, props), children); 42638 })); 42639 42640 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/cell.js 42641 42642 42643 42644 /** 42645 * WordPress dependencies 42646 */ 42647 42648 /** 42649 * Internal dependencies 42650 */ 42651 42652 42653 /* harmony default export */ var tree_grid_cell = (Object(external_wp_element_["forwardRef"])(function TreeGridCell({ 42654 children, 42655 withoutGridItem = false, 42656 ...props 42657 }, ref) { 42658 return Object(external_wp_element_["createElement"])("td", Object(esm_extends["a" /* default */])({}, props, { 42659 role: "gridcell" 42660 }), withoutGridItem ? children : Object(external_wp_element_["createElement"])(tree_grid_item, { 42661 ref: ref 42662 }, children)); 42663 })); 42664 42665 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/component.js 42666 /** 42667 * Internal dependencies 42668 */ 42669 42670 42671 /** 42672 * `Truncate` is a typography primitive that trims text content. 42673 * For almost all cases, it is recommended that `Text`, `Heading`, or 42674 * `Subheading` is used to render text content. However,`Truncate` is 42675 * available for custom implementations. 42676 * 42677 * @example 42678 * ```jsx 42679 * import { __experimentalTruncate as Truncate } from `@wordpress/components`; 42680 * 42681 * function Example() { 42682 * return ( 42683 * <Truncate> 42684 * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex 42685 * neque, vulputate a diam et, luctus convallis lacus. Vestibulum ac 42686 * mollis mi. Morbi id elementum massa. 42687 * </Truncate> 42688 * ); 42689 * } 42690 * ``` 42691 */ 42692 42693 const component_Truncate = create_component_createComponent({ 42694 as: 'span', 42695 useHook: useTruncate, 42696 name: 'Truncate' 42697 }); 42698 /* harmony default export */ var truncate_component = (component_Truncate); 42699 42700 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/v-stack/hook.js 42701 /** 42702 * Internal dependencies 42703 */ 42704 42705 42706 /** 42707 * 42708 * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props 42709 */ 42710 42711 function useVStack(props) { 42712 const { 42713 expanded = false, 42714 ...otherProps 42715 } = Object(use_context_system["a" /* useContextSystem */])(props, 'VStack'); 42716 const hStackProps = useHStack({ 42717 direction: 'column', 42718 expanded, 42719 ...otherProps 42720 }); 42721 return hStackProps; 42722 } 42723 42724 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/v-stack/component.js 42725 /** 42726 * Internal dependencies 42727 */ 42728 42729 42730 /** 42731 * `VStack` (or Vertical Stack) is a layout component that arranges child elements in a vertical line. 42732 * 42733 * `VStack` can render anything inside. 42734 * 42735 * @example 42736 * ```jsx 42737 * import { 42738 * __experimentalText as Text, 42739 * __experimentalVStack as VStack, 42740 * } from `@wordpress/components`; 42741 * 42742 * function Example() { 42743 * return ( 42744 * <VStack> 42745 * <Text>Code</Text> 42746 * <Text>is</Text> 42747 * <Text>Poetry</Text> 42748 * </VStack> 42749 * ); 42750 * } 42751 * ``` 42752 */ 42753 42754 const VStack = create_component_createComponent({ 42755 as: 'div', 42756 useHook: useVStack, 42757 name: 'VStack' 42758 }); 42759 /* harmony default export */ var v_stack_component = (VStack); 42760 42761 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js 42762 42763 42764 42765 /** 42766 * WordPress dependencies 42767 */ 42768 42769 42770 42771 function stopPropagation(event) { 42772 event.stopPropagation(); 42773 } 42774 42775 /* harmony default export */ var isolated_event_container = (Object(external_wp_element_["forwardRef"])(({ 42776 children, 42777 ...props 42778 }, ref) => { 42779 external_wp_deprecated_default()('wp.components.IsolatedEventContainer', { 42780 since: '5.7' 42781 }); // Disable reason: this stops certain events from propagating outside of the component. 42782 // - onMouseDown is disabled as this can cause interactions with other DOM elements 42783 42784 /* eslint-disable jsx-a11y/no-static-element-interactions */ 42785 42786 return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, props, { 42787 ref: ref, 42788 onMouseDown: stopPropagation 42789 }), children); 42790 /* eslint-enable jsx-a11y/no-static-element-interactions */ 42791 })); 42792 42793 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 8 modules 42794 var slot_fill = __webpack_require__("dSD1"); 42795 42796 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js 42797 var use_slot = __webpack_require__("+WFq"); 42798 42799 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/style-provider/index.js 42800 42801 42802 /** 42803 * External dependencies 42804 */ 42805 42806 42807 42808 const memoizedCreateCacheWithContainer = memize_default()(container => { 42809 return Object(cache_browser_esm["a" /* default */])({ 42810 container 42811 }); 42812 }); 42813 function StyleProvider({ 42814 children, 42815 document 42816 }) { 42817 if (!document) { 42818 return null; 42819 } 42820 42821 const cache = memoizedCreateCacheWithContainer(document.head); 42822 return Object(external_wp_element_["createElement"])(CacheProvider, { 42823 value: cache 42824 }, children); 42825 } 42826 42827 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js 42828 42829 42830 /** 42831 * WordPress dependencies 42832 */ 42833 42834 42835 42836 const defaultShortcuts = { 42837 previous: ['ctrl+shift+`', external_wp_keycodes_["rawShortcut"].access('p')], 42838 next: ['ctrl+`', external_wp_keycodes_["rawShortcut"].access('n')] 42839 }; 42840 function useNavigateRegions(ref, shortcuts = defaultShortcuts) { 42841 const [isFocusingRegions, setIsFocusingRegions] = Object(external_wp_element_["useState"])(false); 42842 42843 function focusRegion(offset) { 42844 const regions = Array.from(ref.current.querySelectorAll('[role="region"]')); 42845 42846 if (!regions.length) { 42847 return; 42848 } 42849 42850 let nextRegion = regions[0]; 42851 const selectedIndex = regions.indexOf(ref.current.ownerDocument.activeElement); 42852 42853 if (selectedIndex !== -1) { 42854 let nextIndex = selectedIndex + offset; 42855 nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex; 42856 nextIndex = nextIndex === regions.length ? 0 : nextIndex; 42857 nextRegion = regions[nextIndex]; 42858 } 42859 42860 nextRegion.focus(); 42861 setIsFocusingRegions(true); 42862 } 42863 42864 const focusPrevious = Object(external_wp_element_["useCallback"])(() => focusRegion(-1), []); 42865 const focusNext = Object(external_wp_element_["useCallback"])(() => focusRegion(1), []); 42866 Object(external_wp_compose_["useKeyboardShortcut"])(shortcuts.previous, focusPrevious, { 42867 bindGlobal: true 42868 }); 42869 Object(external_wp_compose_["useKeyboardShortcut"])(shortcuts.next, focusNext, { 42870 bindGlobal: true 42871 }); 42872 Object(external_wp_element_["useEffect"])(() => { 42873 function onClick() { 42874 setIsFocusingRegions(false); 42875 } 42876 42877 ref.current.addEventListener('click', onClick); 42878 return () => { 42879 ref.current.removeEventListener('click', onClick); 42880 }; 42881 }, [setIsFocusingRegions]); 42882 42883 if (!isFocusingRegions) { 42884 return; 42885 } 42886 42887 return 'is-focusing-regions'; 42888 } 42889 /* harmony default export */ var navigate_regions = (Object(external_wp_compose_["createHigherOrderComponent"])(Component => ({ 42890 shortcuts, 42891 ...props 42892 }) => { 42893 const ref = Object(external_wp_element_["useRef"])(); 42894 const className = useNavigateRegions(ref, shortcuts); 42895 return Object(external_wp_element_["createElement"])("div", { 42896 ref: ref, 42897 className: className 42898 }, Object(external_wp_element_["createElement"])(Component, props)); 42899 }, 'navigateRegions')); 42900 42901 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js 42902 42903 42904 /** 42905 * WordPress dependencies 42906 */ 42907 42908 const withConstrainedTabbing = Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => function ComponentWithConstrainedTabbing(props) { 42909 const ref = Object(external_wp_compose_["useConstrainedTabbing"])(); 42910 return Object(external_wp_element_["createElement"])("div", { 42911 ref: ref, 42912 tabIndex: "-1" 42913 }, Object(external_wp_element_["createElement"])(WrappedComponent, props)); 42914 }, 'withConstrainedTabbing'); 42915 /* harmony default export */ var with_constrained_tabbing = (withConstrainedTabbing); 42916 42917 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js 42918 42919 42920 42921 /** 42922 * External dependencies 42923 */ 42924 42925 /** 42926 * WordPress dependencies 42927 */ 42928 42929 42930 42931 /* harmony default export */ var with_fallback_styles = (mapNodeToProps => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => { 42932 return class extends external_wp_element_["Component"] { 42933 constructor() { 42934 super(...arguments); 42935 this.nodeRef = this.props.node; 42936 this.state = { 42937 fallbackStyles: undefined, 42938 grabStylesCompleted: false 42939 }; 42940 this.bindRef = this.bindRef.bind(this); 42941 } 42942 42943 bindRef(node) { 42944 if (!node) { 42945 return; 42946 } 42947 42948 this.nodeRef = node; 42949 } 42950 42951 componentDidMount() { 42952 this.grabFallbackStyles(); 42953 } 42954 42955 componentDidUpdate() { 42956 this.grabFallbackStyles(); 42957 } 42958 42959 grabFallbackStyles() { 42960 const { 42961 grabStylesCompleted, 42962 fallbackStyles 42963 } = this.state; 42964 42965 if (this.nodeRef && !grabStylesCompleted) { 42966 const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props); 42967 42968 if (!Object(external_lodash_["isEqual"])(newFallbackStyles, fallbackStyles)) { 42969 this.setState({ 42970 fallbackStyles: newFallbackStyles, 42971 grabStylesCompleted: !!Object(external_lodash_["every"])(newFallbackStyles) 42972 }); 42973 } 42974 } 42975 } 42976 42977 render() { 42978 const wrappedComponent = Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, this.state.fallbackStyles)); 42979 return this.props.node ? wrappedComponent : Object(external_wp_element_["createElement"])("div", { 42980 ref: this.bindRef 42981 }, " ", wrappedComponent, " "); 42982 } 42983 42984 }; 42985 }, 'withFallbackStyles')); 42986 42987 // EXTERNAL MODULE: external ["wp","hooks"] 42988 var external_wp_hooks_ = __webpack_require__("g56x"); 42989 42990 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js 42991 42992 42993 /** 42994 * External dependencies 42995 */ 42996 42997 /** 42998 * WordPress dependencies 42999 */ 43000 43001 43002 43003 43004 const ANIMATION_FRAME_PERIOD = 16; 43005 /** 43006 * Creates a higher-order component which adds filtering capability to the 43007 * wrapped component. Filters get applied when the original component is about 43008 * to be mounted. When a filter is added or removed that matches the hook name, 43009 * the wrapped component re-renders. 43010 * 43011 * @param {string} hookName Hook name exposed to be used by filters. 43012 * 43013 * @return {Function} Higher-order component factory. 43014 */ 43015 43016 function withFilters(hookName) { 43017 return Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => { 43018 const namespace = 'core/with-filters/' + hookName; 43019 /** 43020 * The component definition with current filters applied. Each instance 43021 * reuse this shared reference as an optimization to avoid excessive 43022 * calls to `applyFilters` when many instances exist. 43023 * 43024 * @type {?Component} 43025 */ 43026 43027 let FilteredComponent; 43028 /** 43029 * Initializes the FilteredComponent variable once, if not already 43030 * assigned. Subsequent calls are effectively a noop. 43031 */ 43032 43033 function ensureFilteredComponent() { 43034 if (FilteredComponent === undefined) { 43035 FilteredComponent = Object(external_wp_hooks_["applyFilters"])(hookName, OriginalComponent); 43036 } 43037 } 43038 43039 class FilteredComponentRenderer extends external_wp_element_["Component"] { 43040 constructor() { 43041 super(...arguments); 43042 ensureFilteredComponent(); 43043 } 43044 43045 componentDidMount() { 43046 FilteredComponentRenderer.instances.push(this); // If there were previously no mounted instances for components 43047 // filtered on this hook, add the hook handler. 43048 43049 if (FilteredComponentRenderer.instances.length === 1) { 43050 Object(external_wp_hooks_["addAction"])('hookRemoved', namespace, onHooksUpdated); 43051 Object(external_wp_hooks_["addAction"])('hookAdded', namespace, onHooksUpdated); 43052 } 43053 } 43054 43055 componentWillUnmount() { 43056 FilteredComponentRenderer.instances = Object(external_lodash_["without"])(FilteredComponentRenderer.instances, this); // If this was the last of the mounted components filtered on 43057 // this hook, remove the hook handler. 43058 43059 if (FilteredComponentRenderer.instances.length === 0) { 43060 Object(external_wp_hooks_["removeAction"])('hookRemoved', namespace); 43061 Object(external_wp_hooks_["removeAction"])('hookAdded', namespace); 43062 } 43063 } 43064 43065 render() { 43066 return Object(external_wp_element_["createElement"])(FilteredComponent, this.props); 43067 } 43068 43069 } 43070 43071 FilteredComponentRenderer.instances = []; 43072 /** 43073 * Updates the FilteredComponent definition, forcing a render for each 43074 * mounted instance. This occurs a maximum of once per animation frame. 43075 */ 43076 43077 const throttledForceUpdate = Object(external_lodash_["debounce"])(() => { 43078 // Recreate the filtered component, only after delay so that it's 43079 // computed once, even if many filters added. 43080 FilteredComponent = Object(external_wp_hooks_["applyFilters"])(hookName, OriginalComponent); // Force each instance to render. 43081 43082 FilteredComponentRenderer.instances.forEach(instance => { 43083 instance.forceUpdate(); 43084 }); 43085 }, ANIMATION_FRAME_PERIOD); 43086 /** 43087 * When a filter is added or removed for the matching hook name, each 43088 * mounted instance should re-render with the new filters having been 43089 * applied to the original component. 43090 * 43091 * @param {string} updatedHookName Name of the hook that was updated. 43092 */ 43093 43094 function onHooksUpdated(updatedHookName) { 43095 if (updatedHookName === hookName) { 43096 throttledForceUpdate(); 43097 } 43098 } 43099 43100 return FilteredComponentRenderer; 43101 }, 'withFilters'); 43102 } 43103 43104 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js 43105 43106 43107 /** 43108 * WordPress dependencies 43109 */ 43110 43111 43112 43113 /** 43114 * Returns true if the given object is component-like. An object is component- 43115 * like if it is an instance of wp.element.Component, or is a function. 43116 * 43117 * @param {*} object Object to test. 43118 * 43119 * @return {boolean} Whether object is component-like. 43120 */ 43121 43122 function isComponentLike(object) { 43123 return object instanceof external_wp_element_["Component"] || typeof object === 'function'; 43124 } 43125 /** 43126 * Higher Order Component used to be used to wrap disposable elements like 43127 * sidebars, modals, dropdowns. When mounting the wrapped component, we track a 43128 * reference to the current active element so we know where to restore focus 43129 * when the component is unmounted. 43130 * 43131 * @param {(WPComponent|Object)} options The component to be enhanced with 43132 * focus return behavior, or an object 43133 * describing the component and the 43134 * focus return characteristics. 43135 * 43136 * @return {Function} Higher Order Component with the focus restauration behaviour. 43137 */ 43138 43139 43140 /* harmony default export */ var with_focus_return = (Object(external_wp_compose_["createHigherOrderComponent"])(options => { 43141 const HoC = ({ 43142 onFocusReturn 43143 } = {}) => WrappedComponent => { 43144 const WithFocusReturn = props => { 43145 const ref = Object(external_wp_compose_["useFocusReturn"])(onFocusReturn); 43146 return Object(external_wp_element_["createElement"])("div", { 43147 ref: ref 43148 }, Object(external_wp_element_["createElement"])(WrappedComponent, props)); 43149 }; 43150 43151 return WithFocusReturn; 43152 }; 43153 43154 if (isComponentLike(options)) { 43155 const WrappedComponent = options; 43156 return HoC()(WrappedComponent); 43157 } 43158 43159 return HoC(options); 43160 }, 'withFocusReturn')); 43161 const with_focus_return_Provider = ({ 43162 children 43163 }) => { 43164 external_wp_deprecated_default()('wp.components.FocusReturnProvider component', { 43165 since: '5.7', 43166 hint: 'This provider is not used anymore. You can just remove it from your codebase' 43167 }); 43168 return children; 43169 }; 43170 43171 // EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules 43172 var v4 = __webpack_require__("7Cbv"); 43173 43174 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js 43175 43176 43177 43178 /** 43179 * External dependencies 43180 */ 43181 43182 /** 43183 * WordPress dependencies 43184 */ 43185 43186 43187 43188 /** 43189 * Internal dependencies 43190 */ 43191 43192 43193 /** 43194 * Override the default edit UI to include notices if supported. 43195 * 43196 * @param {WPComponent} OriginalComponent Original component. 43197 * 43198 * @return {WPComponent} Wrapped component. 43199 */ 43200 43201 /* harmony default export */ var with_notices = (Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => { 43202 function Component(props, ref) { 43203 const [noticeList, setNoticeList] = Object(external_wp_element_["useState"])([]); 43204 const noticeOperations = Object(external_wp_element_["useMemo"])(() => { 43205 /** 43206 * Function passed down as a prop that adds a new notice. 43207 * 43208 * @param {Object} notice Notice to add. 43209 */ 43210 const createNotice = notice => { 43211 const noticeToAdd = notice.id ? notice : { ...notice, 43212 id: Object(v4["a" /* default */])() 43213 }; 43214 setNoticeList(current => [...current, noticeToAdd]); 43215 }; 43216 43217 return { 43218 createNotice, 43219 43220 /** 43221 * Function passed as a prop that adds a new error notice. 43222 * 43223 * @param {string} msg Error message of the notice. 43224 */ 43225 createErrorNotice: msg => { 43226 createNotice({ 43227 status: 'error', 43228 content: msg 43229 }); 43230 }, 43231 43232 /** 43233 * Removes a notice by id. 43234 * 43235 * @param {string} id Id of the notice to remove. 43236 */ 43237 removeNotice: id => { 43238 setNoticeList(current => current.filter(notice => notice.id !== id)); 43239 }, 43240 43241 /** 43242 * Removes all notices 43243 */ 43244 removeAllNotices: () => { 43245 setNoticeList([]); 43246 } 43247 }; 43248 }, []); 43249 const propsOut = { ...props, 43250 noticeList, 43251 noticeOperations, 43252 noticeUI: noticeList.length > 0 && Object(external_wp_element_["createElement"])(list, { 43253 className: "components-with-notices-ui", 43254 notices: noticeList, 43255 onRemove: noticeOperations.removeNotice 43256 }) 43257 }; 43258 return isForwardRef ? Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, propsOut, { 43259 ref: ref 43260 })) : Object(external_wp_element_["createElement"])(OriginalComponent, propsOut); 43261 } 43262 43263 let isForwardRef; 43264 const { 43265 render 43266 } = OriginalComponent; // Returns a forwardRef if OriginalComponent appears to be a forwardRef 43267 43268 if (typeof render === 'function') { 43269 isForwardRef = true; 43270 return Object(external_wp_element_["forwardRef"])(Component); 43271 } 43272 43273 return Component; 43274 })); 43275 43276 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js 43277 var with_next = __webpack_require__("9NHk"); 43278 43279 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/component-system-provider.js 43280 43281 43282 /** 43283 * Internal dependencies 43284 */ 43285 43286 /** 43287 * @param {Object} props 43288 * @param {string[]} [props.__unstableNextInclude] 43289 * @param {import('react').ReactNode} props.children 43290 * @param {any} props.value 43291 */ 43292 43293 function ComponentSystemProvider({ 43294 __unstableNextInclude = [], 43295 children, 43296 value = {} 43297 }) { 43298 if (false) {} 43299 43300 return children; 43301 } 43302 43303 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/index.js 43304 // Primitives 43305 // Components 43306 43307 43308 43309 43310 43311 43312 43313 43314 43315 43316 43317 43318 43319 43320 43321 43322 43323 43324 43325 43326 43327 43328 43329 43330 43331 43332 43333 43334 43335 43336 43337 43338 43339 43340 43341 43342 43343 43344 43345 43346 43347 43348 43349 43350 43351 43352 43353 43354 43355 43356 43357 43358 43359 43360 43361 43362 43363 43364 43365 43366 43367 43368 43369 43370 43371 43372 43373 43374 43375 43376 43377 43378 43379 43380 43381 43382 43383 43384 43385 43386 43387 43388 43389 43390 43391 43392 43393 43394 43395 43396 43397 43398 43399 43400 43401 43402 43403 43404 43405 43406 43407 43408 43409 43410 43411 43412 43413 43414 43415 43416 // Higher-Order Components 43417 43418 43419 43420 43421 43422 43423 43424 43425 // Component System 43426 43427 43428 43429 43430 /***/ }), 43431 43432 /***/ "SIPS": 43433 /***/ (function(module, __webpack_exports__, __webpack_require__) { 43434 43435 "use strict"; 43436 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRegisteredStyles; }); 43437 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return insertStyles; }); 43438 var isBrowser = "object" !== 'undefined'; 43439 function getRegisteredStyles(registered, registeredStyles, classNames) { 43440 var rawClassName = ''; 43441 classNames.split(' ').forEach(function (className) { 43442 if (registered[className] !== undefined) { 43443 registeredStyles.push(registered[className]); 43444 } else { 43445 rawClassName += className + " "; 43446 } 43447 }); 43448 return rawClassName; 43449 } 43450 var insertStyles = function insertStyles(cache, serialized, isStringTag) { 43451 var className = cache.key + "-" + serialized.name; 43452 43453 if ( // we only need to add the styles to the registered cache if the 43454 // class name could be used further down 43455 // the tree but if it's a string tag, we know it won't 43456 // so we don't have to add it to registered cache. 43457 // this improves memory usage since we can avoid storing the whole style string 43458 (isStringTag === false || // we need to always store it if we're in compat mode and 43459 // in node since emotion-server relies on whether a style is in 43460 // the registered cache to know whether a style is global or not 43461 // also, note that this check will be dead code eliminated in the browser 43462 isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) { 43463 cache.registered[className] = serialized.styles; 43464 } 43465 43466 if (cache.inserted[serialized.name] === undefined) { 43467 var current = serialized; 43468 43469 do { 43470 var maybeStyles = cache.insert("." + className, current, cache.sheet, true); 43471 43472 current = current.next; 43473 } while (current !== undefined); 43474 } 43475 }; 43476 43477 43478 43479 43480 /***/ }), 43481 43482 /***/ "SSiF": 43483 /***/ (function(module, exports, __webpack_require__) { 43484 43485 var e=__webpack_require__("cDcd"),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,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)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]}; 43486 43487 43488 /***/ }), 43489 43490 /***/ "SegQ": 43491 /***/ (function(module, exports, __webpack_require__) { 43492 43493 "use strict"; 43494 43495 43496 var callBound = __webpack_require__("6ZB3"); 43497 var hasToStringTag = __webpack_require__("B6Q+")(); 43498 var has; 43499 var $exec; 43500 var isRegexMarker; 43501 var badStringifier; 43502 43503 if (hasToStringTag) { 43504 has = callBound('Object.prototype.hasOwnProperty'); 43505 $exec = callBound('RegExp.prototype.exec'); 43506 isRegexMarker = {}; 43507 43508 var throwRegexMarker = function () { 43509 throw isRegexMarker; 43510 }; 43511 badStringifier = { 43512 toString: throwRegexMarker, 43513 valueOf: throwRegexMarker 43514 }; 43515 43516 if (typeof Symbol.toPrimitive === 'symbol') { 43517 badStringifier[Symbol.toPrimitive] = throwRegexMarker; 43518 } 43519 } 43520 43521 var $toString = callBound('Object.prototype.toString'); 43522 var gOPD = Object.getOwnPropertyDescriptor; 43523 var regexClass = '[object RegExp]'; 43524 43525 module.exports = hasToStringTag 43526 // eslint-disable-next-line consistent-return 43527 ? function isRegex(value) { 43528 if (!value || typeof value !== 'object') { 43529 return false; 43530 } 43531 43532 var descriptor = gOPD(value, 'lastIndex'); 43533 var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); 43534 if (!hasLastIndexDataProperty) { 43535 return false; 43536 } 43537 43538 try { 43539 $exec(value, badStringifier); 43540 } catch (e) { 43541 return e === isRegexMarker; 43542 } 43543 } 43544 : function isRegex(value) { 43545 // In older browsers, typeof regex incorrectly returns 'function' 43546 if (!value || (typeof value !== 'object' && typeof value !== 'function')) { 43547 return false; 43548 } 43549 43550 return $toString(value) === regexClass; 43551 }; 43552 43553 43554 /***/ }), 43555 43556 /***/ "SksO": 43557 /***/ (function(module, exports) { 43558 43559 function _setPrototypeOf(o, p) { 43560 module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 43561 o.__proto__ = p; 43562 return o; 43563 }; 43564 43565 module.exports["default"] = module.exports, module.exports.__esModule = true; 43566 return _setPrototypeOf(o, p); 43567 } 43568 43569 module.exports = _setPrototypeOf; 43570 module.exports["default"] = module.exports, module.exports.__esModule = true; 43571 43572 /***/ }), 43573 43574 /***/ "SyVe": 43575 /***/ (function(module, __webpack_exports__, __webpack_require__) { 43576 43577 "use strict"; 43578 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindow; }); 43579 /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs"); 43580 43581 43582 // Thanks to Fluent UI for doing the [research on IE11 memery leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427) 43583 43584 var _window; // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window" 43585 // hits a memory leak, whereas aliasing it and calling "typeof _window" does not. 43586 // Caching the window value at the file scope lets us minimize the impact. 43587 43588 43589 try { 43590 _window = window; 43591 } catch (e) { 43592 /* no-op */ 43593 } 43594 /** 43595 * Returns `element.ownerDocument.defaultView || window`. 43596 */ 43597 43598 43599 function getWindow(element) { 43600 if (!element) { 43601 return _window; 43602 } 43603 43604 return Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).defaultView || _window; 43605 } 43606 43607 43608 43609 43610 /***/ }), 43611 43612 /***/ "TFuP": 43613 /***/ (function(module, __webpack_exports__, __webpack_require__) { 43614 43615 "use strict"; 43616 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COMPOSITE_KEYS; }); 43617 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return COMPOSITE_GROUP_KEYS; }); 43618 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMPOSITE_ITEM_KEYS; }); 43619 /* unused harmony export c */ 43620 // Automatically generated 43621 var COMPOSITE_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"]; 43622 var COMPOSITE_KEYS = COMPOSITE_STATE_KEYS; 43623 var COMPOSITE_GROUP_KEYS = COMPOSITE_KEYS; 43624 var COMPOSITE_ITEM_KEYS = COMPOSITE_GROUP_KEYS; 43625 var COMPOSITE_ITEM_WIDGET_KEYS = COMPOSITE_ITEM_KEYS; 43626 43627 43628 43629 43630 /***/ }), 43631 43632 /***/ "TG4+": 43633 /***/ (function(module, exports, __webpack_require__) { 43634 43635 "use strict"; 43636 43637 43638 Object.defineProperty(exports, "__esModule", { 43639 value: true 43640 }); 43641 exports.withStylesPropTypes = exports.css = undefined; 43642 43643 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; }; 43644 43645 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; }; }(); 43646 43647 exports.withStyles = withStyles; 43648 43649 var _object = __webpack_require__("Koq/"); 43650 43651 var _object2 = _interopRequireDefault(_object); 43652 43653 var _react = __webpack_require__("cDcd"); 43654 43655 var _react2 = _interopRequireDefault(_react); 43656 43657 var _propTypes = __webpack_require__("17x9"); 43658 43659 var _propTypes2 = _interopRequireDefault(_propTypes); 43660 43661 var _hoistNonReactStatics = __webpack_require__("2mql"); 43662 43663 var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); 43664 43665 var _constants = __webpack_require__("QEu6"); 43666 43667 var _brcast = __webpack_require__("sDMB"); 43668 43669 var _brcast2 = _interopRequireDefault(_brcast); 43670 43671 var _ThemedStyleSheet = __webpack_require__("030x"); 43672 43673 var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet); 43674 43675 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 43676 43677 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 43678 43679 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; } 43680 43681 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; } 43682 43683 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 */ 43684 43685 // Add some named exports to assist in upgrading and for convenience 43686 var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR; 43687 var withStylesPropTypes = exports.withStylesPropTypes = { 43688 styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types 43689 theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types 43690 css: _propTypes2['default'].func.isRequired 43691 }; 43692 43693 var EMPTY_STYLES = {}; 43694 var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() { 43695 return EMPTY_STYLES; 43696 }; 43697 43698 var START_MARK = 'react-with-styles.createStyles.start'; 43699 var END_MARK = 'react-with-styles.createStyles.end'; 43700 43701 function baseClass(pureComponent) { 43702 if (pureComponent) { 43703 if (!_react2['default'].PureComponent) { 43704 throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later'); 43705 } 43706 43707 return _react2['default'].PureComponent; 43708 } 43709 43710 return _react2['default'].Component; 43711 } 43712 43713 var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']); 43714 43715 var defaultDirection = _constants.DIRECTIONS.LTR; 43716 43717 function withStyles(styleFn) { 43718 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 43719 _ref$stylesPropName = _ref.stylesPropName, 43720 stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName, 43721 _ref$themePropName = _ref.themePropName, 43722 themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName, 43723 _ref$cssPropName = _ref.cssPropName, 43724 cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName, 43725 _ref$flushBefore = _ref.flushBefore, 43726 flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore, 43727 _ref$pureComponent = _ref.pureComponent, 43728 pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent; 43729 43730 var styleDefLTR = void 0; 43731 var styleDefRTL = void 0; 43732 var currentThemeLTR = void 0; 43733 var currentThemeRTL = void 0; 43734 var BaseClass = baseClass(pureComponent); 43735 43736 function getResolveMethod(direction) { 43737 return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL; 43738 } 43739 43740 function getCurrentTheme(direction) { 43741 return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL; 43742 } 43743 43744 function getStyleDef(direction, wrappedComponentName) { 43745 var currentTheme = getCurrentTheme(direction); 43746 var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL; 43747 43748 var registeredTheme = _ThemedStyleSheet2['default'].get(); 43749 43750 // Return the existing styles if they've already been defined 43751 // and if the theme used to create them corresponds to the theme 43752 // registered with ThemedStyleSheet 43753 if (styleDef && currentTheme === registeredTheme) { 43754 return styleDef; 43755 } 43756 43757 if (false) {} 43758 43759 var isRTL = direction === _constants.DIRECTIONS.RTL; 43760 43761 if (isRTL) { 43762 styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN; 43763 43764 currentThemeRTL = registeredTheme; 43765 styleDef = styleDefRTL; 43766 } else { 43767 styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN; 43768 43769 currentThemeLTR = registeredTheme; 43770 styleDef = styleDefLTR; 43771 } 43772 43773 if (false) { var measureName; } 43774 43775 return styleDef; 43776 } 43777 43778 function getState(direction, wrappedComponentName) { 43779 return { 43780 resolveMethod: getResolveMethod(direction), 43781 styleDef: getStyleDef(direction, wrappedComponentName) 43782 }; 43783 } 43784 43785 return function () { 43786 function withStylesHOC(WrappedComponent) { 43787 var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; 43788 43789 // NOTE: Use a class here so components are ref-able if need be: 43790 // eslint-disable-next-line react/prefer-stateless-function 43791 43792 var WithStyles = function (_BaseClass) { 43793 _inherits(WithStyles, _BaseClass); 43794 43795 function WithStyles(props, context) { 43796 _classCallCheck(this, WithStyles); 43797 43798 var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context)); 43799 43800 var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection; 43801 43802 _this.state = getState(direction, wrappedComponentName); 43803 return _this; 43804 } 43805 43806 _createClass(WithStyles, [{ 43807 key: 'componentDidMount', 43808 value: function () { 43809 function componentDidMount() { 43810 var _this2 = this; 43811 43812 if (this.context[_constants.CHANNEL]) { 43813 // subscribe to future direction changes 43814 this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) { 43815 _this2.setState(getState(direction, wrappedComponentName)); 43816 }); 43817 } 43818 } 43819 43820 return componentDidMount; 43821 }() 43822 }, { 43823 key: 'componentWillUnmount', 43824 value: function () { 43825 function componentWillUnmount() { 43826 if (this.channelUnsubscribe) { 43827 this.channelUnsubscribe(); 43828 } 43829 } 43830 43831 return componentWillUnmount; 43832 }() 43833 }, { 43834 key: 'render', 43835 value: function () { 43836 function render() { 43837 var _ref2; 43838 43839 // As some components will depend on previous styles in 43840 // the component tree, we provide the option of flushing the 43841 // buffered styles (i.e. to a style tag) **before** the rendering 43842 // cycle begins. 43843 // 43844 // The interfaces provide the optional "flush" method which 43845 // is run in turn by ThemedStyleSheet.flush. 43846 if (flushBefore) { 43847 _ThemedStyleSheet2['default'].flush(); 43848 } 43849 43850 var _state = this.state, 43851 resolveMethod = _state.resolveMethod, 43852 styleDef = _state.styleDef; 43853 43854 43855 return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2))); 43856 } 43857 43858 return render; 43859 }() 43860 }]); 43861 43862 return WithStyles; 43863 }(BaseClass); 43864 43865 WithStyles.WrappedComponent = WrappedComponent; 43866 WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')'; 43867 WithStyles.contextTypes = contextTypes; 43868 if (WrappedComponent.propTypes) { 43869 WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes); 43870 delete WithStyles.propTypes[stylesPropName]; 43871 delete WithStyles.propTypes[themePropName]; 43872 delete WithStyles.propTypes[cssPropName]; 43873 } 43874 if (WrappedComponent.defaultProps) { 43875 WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps); 43876 } 43877 43878 return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent); 43879 } 43880 43881 return withStylesHOC; 43882 }(); 43883 } 43884 43885 /***/ }), 43886 43887 /***/ "TO8r": 43888 /***/ (function(module, exports) { 43889 43890 /** Used to match a single whitespace character. */ 43891 var reWhitespace = /\s/; 43892 43893 /** 43894 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 43895 * character of `string`. 43896 * 43897 * @private 43898 * @param {string} string The string to inspect. 43899 * @returns {number} Returns the index of the last non-whitespace character. 43900 */ 43901 function trimmedEndIndex(string) { 43902 var index = string.length; 43903 43904 while (index-- && reWhitespace.test(string.charAt(index))) {} 43905 return index; 43906 } 43907 43908 module.exports = trimmedEndIndex; 43909 43910 43911 /***/ }), 43912 43913 /***/ "TOwV": 43914 /***/ (function(module, exports, __webpack_require__) { 43915 43916 "use strict"; 43917 43918 43919 if (true) { 43920 module.exports = __webpack_require__("qT12"); 43921 } else {} 43922 43923 43924 /***/ }), 43925 43926 /***/ "TSYQ": 43927 /***/ (function(module, exports, __webpack_require__) { 43928 43929 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 43930 Copyright (c) 2018 Jed Watson. 43931 Licensed under the MIT License (MIT), see 43932 http://jedwatson.github.io/classnames 43933 */ 43934 /* global define */ 43935 43936 (function () { 43937 'use strict'; 43938 43939 var hasOwn = {}.hasOwnProperty; 43940 43941 function classNames() { 43942 var classes = []; 43943 43944 for (var i = 0; i < arguments.length; i++) { 43945 var arg = arguments[i]; 43946 if (!arg) continue; 43947 43948 var argType = typeof arg; 43949 43950 if (argType === 'string' || argType === 'number') { 43951 classes.push(arg); 43952 } else if (Array.isArray(arg)) { 43953 if (arg.length) { 43954 var inner = classNames.apply(null, arg); 43955 if (inner) { 43956 classes.push(inner); 43957 } 43958 } 43959 } else if (argType === 'object') { 43960 if (arg.toString === Object.prototype.toString) { 43961 for (var key in arg) { 43962 if (hasOwn.call(arg, key) && arg[key]) { 43963 classes.push(key); 43964 } 43965 } 43966 } else { 43967 classes.push(arg.toString()); 43968 } 43969 } 43970 } 43971 43972 return classes.join(' '); 43973 } 43974 43975 if ( true && module.exports) { 43976 classNames.default = classNames; 43977 module.exports = classNames; 43978 } else if (true) { 43979 // register as 'classnames', consistent with npm package name 43980 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 43981 return classNames; 43982 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 43983 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 43984 } else {} 43985 }()); 43986 43987 43988 /***/ }), 43989 43990 /***/ "TUyu": 43991 /***/ (function(module, exports, __webpack_require__) { 43992 43993 "use strict"; 43994 43995 43996 Object.defineProperty(exports, "__esModule", { 43997 value: true 43998 }); 43999 exports['default'] = registerCSSInterfaceWithDefaultTheme; 44000 44001 var _reactWithStylesInterfaceCss = __webpack_require__("lzPt"); 44002 44003 var _reactWithStylesInterfaceCss2 = _interopRequireDefault(_reactWithStylesInterfaceCss); 44004 44005 var _registerInterfaceWithDefaultTheme = __webpack_require__("WI5Z"); 44006 44007 var _registerInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerInterfaceWithDefaultTheme); 44008 44009 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 44010 44011 function registerCSSInterfaceWithDefaultTheme() { 44012 (0, _registerInterfaceWithDefaultTheme2['default'])(_reactWithStylesInterfaceCss2['default']); 44013 } 44014 44015 /***/ }), 44016 44017 /***/ "Teho": 44018 /***/ (function(module, exports, __webpack_require__) { 44019 44020 "use strict"; 44021 44022 44023 module.exports = function isPrimitive(value) { 44024 return value === null || (typeof value !== 'function' && typeof value !== 'object'); 44025 }; 44026 44027 44028 /***/ }), 44029 44030 /***/ "Thzv": 44031 /***/ (function(module, exports, __webpack_require__) { 44032 44033 "use strict"; 44034 44035 44036 Object.defineProperty(exports, "__esModule", { 44037 value: true 44038 }); 44039 44040 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; }; 44041 44042 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; }; }(); 44043 44044 var _object = __webpack_require__("Koq/"); 44045 44046 var _object2 = _interopRequireDefault(_object); 44047 44048 var _react = __webpack_require__("cDcd"); 44049 44050 var _react2 = _interopRequireDefault(_react); 44051 44052 var _propTypes = __webpack_require__("17x9"); 44053 44054 var _propTypes2 = _interopRequireDefault(_propTypes); 44055 44056 var _reactAddonsShallowCompare = __webpack_require__("YZDV"); 44057 44058 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 44059 44060 var _reactMomentProptypes = __webpack_require__("XGBb"); 44061 44062 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 44063 44064 var _airbnbPropTypes = __webpack_require__("Hsqg"); 44065 44066 var _reactWithStyles = __webpack_require__("TG4+"); 44067 44068 var _moment = __webpack_require__("wy2R"); 44069 44070 var _moment2 = _interopRequireDefault(_moment); 44071 44072 var _consolidatedEvents = __webpack_require__("1TsT"); 44073 44074 var _defaultPhrases = __webpack_require__("vV+G"); 44075 44076 var _getPhrasePropTypes = __webpack_require__("yc2e"); 44077 44078 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 44079 44080 var _CalendarMonth = __webpack_require__("mMiH"); 44081 44082 var _CalendarMonth2 = _interopRequireDefault(_CalendarMonth); 44083 44084 var _isTransitionEndSupported = __webpack_require__("dRQD"); 44085 44086 var _isTransitionEndSupported2 = _interopRequireDefault(_isTransitionEndSupported); 44087 44088 var _getTransformStyles = __webpack_require__("q86A"); 44089 44090 var _getTransformStyles2 = _interopRequireDefault(_getTransformStyles); 44091 44092 var _getCalendarMonthWidth = __webpack_require__("m2ax"); 44093 44094 var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth); 44095 44096 var _toISOMonthString = __webpack_require__("jenk"); 44097 44098 var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString); 44099 44100 var _isPrevMonth = __webpack_require__("Pq96"); 44101 44102 var _isPrevMonth2 = _interopRequireDefault(_isPrevMonth); 44103 44104 var _isNextMonth = __webpack_require__("6HWY"); 44105 44106 var _isNextMonth2 = _interopRequireDefault(_isNextMonth); 44107 44108 var _ModifiersShape = __webpack_require__("J7JS"); 44109 44110 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 44111 44112 var _ScrollableOrientationShape = __webpack_require__("aE6U"); 44113 44114 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 44115 44116 var _DayOfWeekShape = __webpack_require__("2S2E"); 44117 44118 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 44119 44120 var _constants = __webpack_require__("Fv1B"); 44121 44122 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 44123 44124 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 44125 44126 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; } 44127 44128 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; } 44129 44130 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 44131 enableOutsideDays: _propTypes2['default'].bool, 44132 firstVisibleMonthIndex: _propTypes2['default'].number, 44133 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 44134 initialMonth: _reactMomentProptypes2['default'].momentObj, 44135 isAnimating: _propTypes2['default'].bool, 44136 numberOfMonths: _propTypes2['default'].number, 44137 modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])), 44138 orientation: _ScrollableOrientationShape2['default'], 44139 onDayClick: _propTypes2['default'].func, 44140 onDayMouseEnter: _propTypes2['default'].func, 44141 onDayMouseLeave: _propTypes2['default'].func, 44142 onMonthTransitionEnd: _propTypes2['default'].func, 44143 onMonthChange: _propTypes2['default'].func, 44144 onYearChange: _propTypes2['default'].func, 44145 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 44146 renderCalendarDay: _propTypes2['default'].func, 44147 renderDayContents: _propTypes2['default'].func, 44148 translationValue: _propTypes2['default'].number, 44149 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 44150 daySize: _airbnbPropTypes.nonNegativeInteger, 44151 focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day 44152 isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day 44153 firstDayOfWeek: _DayOfWeekShape2['default'], 44154 setMonthTitleHeight: _propTypes2['default'].func, 44155 isRTL: _propTypes2['default'].bool, 44156 transitionDuration: _airbnbPropTypes.nonNegativeInteger, 44157 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 44158 44159 // i18n 44160 monthFormat: _propTypes2['default'].string, 44161 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)), 44162 dayAriaLabelFormat: _propTypes2['default'].string 44163 })); 44164 44165 var defaultProps = { 44166 enableOutsideDays: false, 44167 firstVisibleMonthIndex: 0, 44168 horizontalMonthPadding: 13, 44169 initialMonth: (0, _moment2['default'])(), 44170 isAnimating: false, 44171 numberOfMonths: 1, 44172 modifiers: {}, 44173 orientation: _constants.HORIZONTAL_ORIENTATION, 44174 onDayClick: function () { 44175 function onDayClick() {} 44176 44177 return onDayClick; 44178 }(), 44179 onDayMouseEnter: function () { 44180 function onDayMouseEnter() {} 44181 44182 return onDayMouseEnter; 44183 }(), 44184 onDayMouseLeave: function () { 44185 function onDayMouseLeave() {} 44186 44187 return onDayMouseLeave; 44188 }(), 44189 onMonthChange: function () { 44190 function onMonthChange() {} 44191 44192 return onMonthChange; 44193 }(), 44194 onYearChange: function () { 44195 function onYearChange() {} 44196 44197 return onYearChange; 44198 }(), 44199 onMonthTransitionEnd: function () { 44200 function onMonthTransitionEnd() {} 44201 44202 return onMonthTransitionEnd; 44203 }(), 44204 44205 renderMonthText: null, 44206 renderCalendarDay: undefined, 44207 renderDayContents: null, 44208 translationValue: null, 44209 renderMonthElement: null, 44210 daySize: _constants.DAY_SIZE, 44211 focusedDate: null, 44212 isFocused: false, 44213 firstDayOfWeek: null, 44214 setMonthTitleHeight: null, 44215 isRTL: false, 44216 transitionDuration: 200, 44217 verticalBorderSpacing: undefined, 44218 44219 // i18n 44220 monthFormat: 'MMMM YYYY', // english locale 44221 phrases: _defaultPhrases.CalendarDayPhrases, 44222 dayAriaLabelFormat: undefined 44223 }; 44224 44225 function getMonths(initialMonth, numberOfMonths, withoutTransitionMonths) { 44226 var month = initialMonth.clone(); 44227 if (!withoutTransitionMonths) month = month.subtract(1, 'month'); 44228 44229 var months = []; 44230 for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) { 44231 months.push(month); 44232 month = month.clone().add(1, 'month'); 44233 } 44234 44235 return months; 44236 } 44237 44238 var CalendarMonthGrid = function (_React$Component) { 44239 _inherits(CalendarMonthGrid, _React$Component); 44240 44241 function CalendarMonthGrid(props) { 44242 _classCallCheck(this, CalendarMonthGrid); 44243 44244 var _this = _possibleConstructorReturn(this, (CalendarMonthGrid.__proto__ || Object.getPrototypeOf(CalendarMonthGrid)).call(this, props)); 44245 44246 var withoutTransitionMonths = props.orientation === _constants.VERTICAL_SCROLLABLE; 44247 _this.state = { 44248 months: getMonths(props.initialMonth, props.numberOfMonths, withoutTransitionMonths) 44249 }; 44250 44251 _this.isTransitionEndSupported = (0, _isTransitionEndSupported2['default'])(); 44252 _this.onTransitionEnd = _this.onTransitionEnd.bind(_this); 44253 _this.setContainerRef = _this.setContainerRef.bind(_this); 44254 44255 _this.locale = _moment2['default'].locale(); 44256 _this.onMonthSelect = _this.onMonthSelect.bind(_this); 44257 _this.onYearSelect = _this.onYearSelect.bind(_this); 44258 return _this; 44259 } 44260 44261 _createClass(CalendarMonthGrid, [{ 44262 key: 'componentDidMount', 44263 value: function () { 44264 function componentDidMount() { 44265 this.removeEventListener = (0, _consolidatedEvents.addEventListener)(this.container, 'transitionend', this.onTransitionEnd); 44266 } 44267 44268 return componentDidMount; 44269 }() 44270 }, { 44271 key: 'componentWillReceiveProps', 44272 value: function () { 44273 function componentWillReceiveProps(nextProps) { 44274 var _this2 = this; 44275 44276 var initialMonth = nextProps.initialMonth, 44277 numberOfMonths = nextProps.numberOfMonths, 44278 orientation = nextProps.orientation; 44279 var months = this.state.months; 44280 var _props = this.props, 44281 prevInitialMonth = _props.initialMonth, 44282 prevNumberOfMonths = _props.numberOfMonths; 44283 44284 var hasMonthChanged = !prevInitialMonth.isSame(initialMonth, 'month'); 44285 var hasNumberOfMonthsChanged = prevNumberOfMonths !== numberOfMonths; 44286 var newMonths = months; 44287 44288 if (hasMonthChanged && !hasNumberOfMonthsChanged) { 44289 if ((0, _isNextMonth2['default'])(prevInitialMonth, initialMonth)) { 44290 newMonths = months.slice(1); 44291 newMonths.push(months[months.length - 1].clone().add(1, 'month')); 44292 } else if ((0, _isPrevMonth2['default'])(prevInitialMonth, initialMonth)) { 44293 newMonths = months.slice(0, months.length - 1); 44294 newMonths.unshift(months[0].clone().subtract(1, 'month')); 44295 } else { 44296 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 44297 newMonths = getMonths(initialMonth, numberOfMonths, withoutTransitionMonths); 44298 } 44299 } 44300 44301 if (hasNumberOfMonthsChanged) { 44302 var _withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 44303 newMonths = getMonths(initialMonth, numberOfMonths, _withoutTransitionMonths); 44304 } 44305 44306 var momentLocale = _moment2['default'].locale(); 44307 if (this.locale !== momentLocale) { 44308 this.locale = momentLocale; 44309 newMonths = newMonths.map(function (m) { 44310 return m.locale(_this2.locale); 44311 }); 44312 } 44313 44314 this.setState({ 44315 months: newMonths 44316 }); 44317 } 44318 44319 return componentWillReceiveProps; 44320 }() 44321 }, { 44322 key: 'shouldComponentUpdate', 44323 value: function () { 44324 function shouldComponentUpdate(nextProps, nextState) { 44325 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 44326 } 44327 44328 return shouldComponentUpdate; 44329 }() 44330 }, { 44331 key: 'componentDidUpdate', 44332 value: function () { 44333 function componentDidUpdate() { 44334 var _props2 = this.props, 44335 isAnimating = _props2.isAnimating, 44336 transitionDuration = _props2.transitionDuration, 44337 onMonthTransitionEnd = _props2.onMonthTransitionEnd; 44338 44339 // For IE9, immediately call onMonthTransitionEnd instead of 44340 // waiting for the animation to complete. Similarly, if transitionDuration 44341 // is set to 0, also immediately invoke the onMonthTransitionEnd callback 44342 44343 if ((!this.isTransitionEndSupported || !transitionDuration) && isAnimating) { 44344 onMonthTransitionEnd(); 44345 } 44346 } 44347 44348 return componentDidUpdate; 44349 }() 44350 }, { 44351 key: 'componentWillUnmount', 44352 value: function () { 44353 function componentWillUnmount() { 44354 if (this.removeEventListener) this.removeEventListener(); 44355 } 44356 44357 return componentWillUnmount; 44358 }() 44359 }, { 44360 key: 'onTransitionEnd', 44361 value: function () { 44362 function onTransitionEnd() { 44363 var onMonthTransitionEnd = this.props.onMonthTransitionEnd; 44364 44365 onMonthTransitionEnd(); 44366 } 44367 44368 return onTransitionEnd; 44369 }() 44370 }, { 44371 key: 'onMonthSelect', 44372 value: function () { 44373 function onMonthSelect(currentMonth, newMonthVal) { 44374 var newMonth = currentMonth.clone(); 44375 var _props3 = this.props, 44376 onMonthChange = _props3.onMonthChange, 44377 orientation = _props3.orientation; 44378 var months = this.state.months; 44379 44380 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 44381 var initialMonthSubtraction = months.indexOf(currentMonth); 44382 if (!withoutTransitionMonths) { 44383 initialMonthSubtraction -= 1; 44384 } 44385 newMonth.set('month', newMonthVal).subtract(initialMonthSubtraction, 'months'); 44386 onMonthChange(newMonth); 44387 } 44388 44389 return onMonthSelect; 44390 }() 44391 }, { 44392 key: 'onYearSelect', 44393 value: function () { 44394 function onYearSelect(currentMonth, newYearVal) { 44395 var newMonth = currentMonth.clone(); 44396 var _props4 = this.props, 44397 onYearChange = _props4.onYearChange, 44398 orientation = _props4.orientation; 44399 var months = this.state.months; 44400 44401 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 44402 var initialMonthSubtraction = months.indexOf(currentMonth); 44403 if (!withoutTransitionMonths) { 44404 initialMonthSubtraction -= 1; 44405 } 44406 newMonth.set('year', newYearVal).subtract(initialMonthSubtraction, 'months'); 44407 onYearChange(newMonth); 44408 } 44409 44410 return onYearSelect; 44411 }() 44412 }, { 44413 key: 'setContainerRef', 44414 value: function () { 44415 function setContainerRef(ref) { 44416 this.container = ref; 44417 } 44418 44419 return setContainerRef; 44420 }() 44421 }, { 44422 key: 'render', 44423 value: function () { 44424 function render() { 44425 var _this3 = this; 44426 44427 var _props5 = this.props, 44428 enableOutsideDays = _props5.enableOutsideDays, 44429 firstVisibleMonthIndex = _props5.firstVisibleMonthIndex, 44430 horizontalMonthPadding = _props5.horizontalMonthPadding, 44431 isAnimating = _props5.isAnimating, 44432 modifiers = _props5.modifiers, 44433 numberOfMonths = _props5.numberOfMonths, 44434 monthFormat = _props5.monthFormat, 44435 orientation = _props5.orientation, 44436 translationValue = _props5.translationValue, 44437 daySize = _props5.daySize, 44438 onDayMouseEnter = _props5.onDayMouseEnter, 44439 onDayMouseLeave = _props5.onDayMouseLeave, 44440 onDayClick = _props5.onDayClick, 44441 renderMonthText = _props5.renderMonthText, 44442 renderCalendarDay = _props5.renderCalendarDay, 44443 renderDayContents = _props5.renderDayContents, 44444 renderMonthElement = _props5.renderMonthElement, 44445 onMonthTransitionEnd = _props5.onMonthTransitionEnd, 44446 firstDayOfWeek = _props5.firstDayOfWeek, 44447 focusedDate = _props5.focusedDate, 44448 isFocused = _props5.isFocused, 44449 isRTL = _props5.isRTL, 44450 styles = _props5.styles, 44451 phrases = _props5.phrases, 44452 dayAriaLabelFormat = _props5.dayAriaLabelFormat, 44453 transitionDuration = _props5.transitionDuration, 44454 verticalBorderSpacing = _props5.verticalBorderSpacing, 44455 setMonthTitleHeight = _props5.setMonthTitleHeight; 44456 var months = this.state.months; 44457 44458 var isVertical = orientation === _constants.VERTICAL_ORIENTATION; 44459 var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 44460 var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION; 44461 44462 var calendarMonthWidth = (0, _getCalendarMonthWidth2['default'])(daySize, horizontalMonthPadding); 44463 44464 var width = isVertical || isVerticalScrollable ? calendarMonthWidth : (numberOfMonths + 2) * calendarMonthWidth; 44465 44466 var transformType = isVertical || isVerticalScrollable ? 'translateY' : 'translateX'; 44467 var transformValue = transformType + '(' + String(translationValue) + 'px)'; 44468 44469 return _react2['default'].createElement( 44470 'div', 44471 _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonthGrid, isHorizontal && styles.CalendarMonthGrid__horizontal, isVertical && styles.CalendarMonthGrid__vertical, isVerticalScrollable && styles.CalendarMonthGrid__vertical_scrollable, isAnimating && styles.CalendarMonthGrid__animating, isAnimating && transitionDuration && { 44472 transition: 'transform ' + String(transitionDuration) + 'ms ease-in-out' 44473 }, (0, _object2['default'])({}, (0, _getTransformStyles2['default'])(transformValue), { 44474 width: width 44475 })), { 44476 ref: this.setContainerRef, 44477 onTransitionEnd: onMonthTransitionEnd 44478 }), 44479 months.map(function (month, i) { 44480 var isVisible = i >= firstVisibleMonthIndex && i < firstVisibleMonthIndex + numberOfMonths; 44481 var hideForAnimation = i === 0 && !isVisible; 44482 var showForAnimation = i === 0 && isAnimating && isVisible; 44483 var monthString = (0, _toISOMonthString2['default'])(month); 44484 return _react2['default'].createElement( 44485 'div', 44486 _extends({ 44487 key: monthString 44488 }, (0, _reactWithStyles.css)(isHorizontal && styles.CalendarMonthGrid_month__horizontal, hideForAnimation && styles.CalendarMonthGrid_month__hideForAnimation, showForAnimation && !isVertical && !isRTL && { 44489 position: 'absolute', 44490 left: -calendarMonthWidth 44491 }, showForAnimation && !isVertical && isRTL && { 44492 position: 'absolute', 44493 right: 0 44494 }, showForAnimation && isVertical && { 44495 position: 'absolute', 44496 top: -translationValue 44497 }, !isVisible && !isAnimating && styles.CalendarMonthGrid_month__hidden)), 44498 _react2['default'].createElement(_CalendarMonth2['default'], { 44499 month: month, 44500 isVisible: isVisible, 44501 enableOutsideDays: enableOutsideDays, 44502 modifiers: modifiers[monthString], 44503 monthFormat: monthFormat, 44504 orientation: orientation, 44505 onDayMouseEnter: onDayMouseEnter, 44506 onDayMouseLeave: onDayMouseLeave, 44507 onDayClick: onDayClick, 44508 onMonthSelect: _this3.onMonthSelect, 44509 onYearSelect: _this3.onYearSelect, 44510 renderMonthText: renderMonthText, 44511 renderCalendarDay: renderCalendarDay, 44512 renderDayContents: renderDayContents, 44513 renderMonthElement: renderMonthElement, 44514 firstDayOfWeek: firstDayOfWeek, 44515 daySize: daySize, 44516 focusedDate: isVisible ? focusedDate : null, 44517 isFocused: isFocused, 44518 phrases: phrases, 44519 setMonthTitleHeight: setMonthTitleHeight, 44520 dayAriaLabelFormat: dayAriaLabelFormat, 44521 verticalBorderSpacing: verticalBorderSpacing, 44522 horizontalMonthPadding: horizontalMonthPadding 44523 }) 44524 ); 44525 }) 44526 ); 44527 } 44528 44529 return render; 44530 }() 44531 }]); 44532 44533 return CalendarMonthGrid; 44534 }(_react2['default'].Component); 44535 44536 CalendarMonthGrid.propTypes = propTypes; 44537 CalendarMonthGrid.defaultProps = defaultProps; 44538 44539 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) { 44540 var _ref$reactDates = _ref.reactDates, 44541 color = _ref$reactDates.color, 44542 noScrollBarOnVerticalScrollable = _ref$reactDates.noScrollBarOnVerticalScrollable, 44543 spacing = _ref$reactDates.spacing, 44544 zIndex = _ref$reactDates.zIndex; 44545 return { 44546 CalendarMonthGrid: { 44547 background: color.background, 44548 textAlign: 'left', 44549 zIndex: zIndex 44550 }, 44551 44552 CalendarMonthGrid__animating: { 44553 zIndex: zIndex + 1 44554 }, 44555 44556 CalendarMonthGrid__horizontal: { 44557 position: 'absolute', 44558 left: spacing.dayPickerHorizontalPadding 44559 }, 44560 44561 CalendarMonthGrid__vertical: { 44562 margin: '0 auto' 44563 }, 44564 44565 CalendarMonthGrid__vertical_scrollable: (0, _object2['default'])({ 44566 margin: '0 auto', 44567 overflowY: 'scroll' 44568 }, noScrollBarOnVerticalScrollable && { 44569 '-webkitOverflowScrolling': 'touch', 44570 '::-webkit-scrollbar': { 44571 '-webkit-appearance': 'none', 44572 display: 'none' 44573 } 44574 }), 44575 44576 CalendarMonthGrid_month__horizontal: { 44577 display: 'inline-block', 44578 verticalAlign: 'top', 44579 minHeight: '100%' 44580 }, 44581 44582 CalendarMonthGrid_month__hideForAnimation: { 44583 position: 'absolute', 44584 zIndex: zIndex - 1, 44585 opacity: 0, 44586 pointerEvents: 'none' 44587 }, 44588 44589 CalendarMonthGrid_month__hidden: { 44590 visibility: 'hidden' 44591 } 44592 }; 44593 })(CalendarMonthGrid); 44594 44595 /***/ }), 44596 44597 /***/ "TqVZ": 44598 /***/ (function(module, __webpack_exports__, __webpack_require__) { 44599 44600 "use strict"; 44601 44602 // EXTERNAL MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js 44603 var sheet_browser_esm = __webpack_require__("z9I/"); 44604 44605 // CONCATENATED MODULE: ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js 44606 function stylis_min (W) { 44607 function M(d, c, e, h, a) { 44608 for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) { 44609 g = e.charCodeAt(l); 44610 l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++); 44611 44612 if (0 === b + n + v + m) { 44613 if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) { 44614 switch (g) { 44615 case 32: 44616 case 9: 44617 case 59: 44618 case 13: 44619 case 10: 44620 break; 44621 44622 default: 44623 f += e.charAt(l); 44624 } 44625 44626 g = 59; 44627 } 44628 44629 switch (g) { 44630 case 123: 44631 f = f.trim(); 44632 q = f.charCodeAt(0); 44633 k = 1; 44634 44635 for (t = ++l; l < B;) { 44636 switch (g = e.charCodeAt(l)) { 44637 case 123: 44638 k++; 44639 break; 44640 44641 case 125: 44642 k--; 44643 break; 44644 44645 case 47: 44646 switch (g = e.charCodeAt(l + 1)) { 44647 case 42: 44648 case 47: 44649 a: { 44650 for (u = l + 1; u < J; ++u) { 44651 switch (e.charCodeAt(u)) { 44652 case 47: 44653 if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) { 44654 l = u + 1; 44655 break a; 44656 } 44657 44658 break; 44659 44660 case 10: 44661 if (47 === g) { 44662 l = u + 1; 44663 break a; 44664 } 44665 44666 } 44667 } 44668 44669 l = u; 44670 } 44671 44672 } 44673 44674 break; 44675 44676 case 91: 44677 g++; 44678 44679 case 40: 44680 g++; 44681 44682 case 34: 44683 case 39: 44684 for (; l++ < J && e.charCodeAt(l) !== g;) { 44685 } 44686 44687 } 44688 44689 if (0 === k) break; 44690 l++; 44691 } 44692 44693 k = e.substring(t, l); 44694 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0)); 44695 44696 switch (q) { 44697 case 64: 44698 0 < r && (f = f.replace(N, '')); 44699 g = f.charCodeAt(1); 44700 44701 switch (g) { 44702 case 100: 44703 case 109: 44704 case 115: 44705 case 45: 44706 r = c; 44707 break; 44708 44709 default: 44710 r = O; 44711 } 44712 44713 k = M(c, r, k, g, a + 1); 44714 t = k.length; 44715 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = '')); 44716 if (0 < t) switch (g) { 44717 case 115: 44718 f = f.replace(da, ea); 44719 44720 case 100: 44721 case 109: 44722 case 45: 44723 k = f + '{' + k + '}'; 44724 break; 44725 44726 case 107: 44727 f = f.replace(fa, '$1 $2'); 44728 k = f + '{' + k + '}'; 44729 k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k; 44730 break; 44731 44732 default: 44733 k = f + k, 112 === h && (k = (p += k, '')); 44734 } else k = ''; 44735 break; 44736 44737 default: 44738 k = M(c, X(c, f, I), k, h, a + 1); 44739 } 44740 44741 F += k; 44742 k = I = r = u = q = 0; 44743 f = ''; 44744 g = e.charCodeAt(++l); 44745 break; 44746 44747 case 125: 44748 case 59: 44749 f = (0 < r ? f.replace(N, '') : f).trim(); 44750 if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) { 44751 case 0: 44752 break; 44753 44754 case 64: 44755 if (105 === g || 99 === g) { 44756 G += f + e.charAt(l); 44757 break; 44758 } 44759 44760 default: 44761 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2))); 44762 } 44763 I = r = u = q = 0; 44764 f = ''; 44765 g = e.charCodeAt(++l); 44766 } 44767 } 44768 44769 switch (g) { 44770 case 13: 44771 case 10: 44772 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00'); 44773 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h); 44774 z = 1; 44775 D++; 44776 break; 44777 44778 case 59: 44779 case 125: 44780 if (0 === b + n + v + m) { 44781 z++; 44782 break; 44783 } 44784 44785 default: 44786 z++; 44787 y = e.charAt(l); 44788 44789 switch (g) { 44790 case 9: 44791 case 32: 44792 if (0 === n + m + b) switch (x) { 44793 case 44: 44794 case 58: 44795 case 9: 44796 case 32: 44797 y = ''; 44798 break; 44799 44800 default: 44801 32 !== g && (y = ' '); 44802 } 44803 break; 44804 44805 case 0: 44806 y = '\\0'; 44807 break; 44808 44809 case 12: 44810 y = '\\f'; 44811 break; 44812 44813 case 11: 44814 y = '\\v'; 44815 break; 44816 44817 case 38: 44818 0 === n + b + m && (r = I = 1, y = '\f' + y); 44819 break; 44820 44821 case 108: 44822 if (0 === n + b + m + E && 0 < u) switch (l - u) { 44823 case 2: 44824 112 === x && 58 === e.charCodeAt(l - 3) && (E = x); 44825 44826 case 8: 44827 111 === K && (E = K); 44828 } 44829 break; 44830 44831 case 58: 44832 0 === n + b + m && (u = l); 44833 break; 44834 44835 case 44: 44836 0 === b + v + n + m && (r = 1, y += '\r'); 44837 break; 44838 44839 case 34: 44840 case 39: 44841 0 === b && (n = n === g ? 0 : 0 === n ? g : n); 44842 break; 44843 44844 case 91: 44845 0 === n + b + v && m++; 44846 break; 44847 44848 case 93: 44849 0 === n + b + v && m--; 44850 break; 44851 44852 case 41: 44853 0 === n + b + m && v--; 44854 break; 44855 44856 case 40: 44857 if (0 === n + b + m) { 44858 if (0 === q) switch (2 * x + 3 * K) { 44859 case 533: 44860 break; 44861 44862 default: 44863 q = 1; 44864 } 44865 v++; 44866 } 44867 44868 break; 44869 44870 case 64: 44871 0 === b + v + n + m + u + k && (k = 1); 44872 break; 44873 44874 case 42: 44875 case 47: 44876 if (!(0 < n + m + v)) switch (b) { 44877 case 0: 44878 switch (2 * g + 3 * e.charCodeAt(l + 1)) { 44879 case 235: 44880 b = 47; 44881 break; 44882 44883 case 220: 44884 t = l, b = 42; 44885 } 44886 44887 break; 44888 44889 case 42: 44890 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0); 44891 } 44892 } 44893 44894 0 === b && (f += y); 44895 } 44896 44897 K = x; 44898 x = g; 44899 l++; 44900 } 44901 44902 t = p.length; 44903 44904 if (0 < t) { 44905 r = c; 44906 if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F; 44907 p = r.join(',') + '{' + p + '}'; 44908 44909 if (0 !== w * E) { 44910 2 !== w || L(p, 2) || (E = 0); 44911 44912 switch (E) { 44913 case 111: 44914 p = p.replace(ha, ':-moz-$1') + p; 44915 break; 44916 44917 case 112: 44918 p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p; 44919 } 44920 44921 E = 0; 44922 } 44923 } 44924 44925 return G + p + F; 44926 } 44927 44928 function X(d, c, e) { 44929 var h = c.trim().split(ia); 44930 c = h; 44931 var a = h.length, 44932 m = d.length; 44933 44934 switch (m) { 44935 case 0: 44936 case 1: 44937 var b = 0; 44938 44939 for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) { 44940 c[b] = Z(d, c[b], e).trim(); 44941 } 44942 44943 break; 44944 44945 default: 44946 var v = b = 0; 44947 44948 for (c = []; b < a; ++b) { 44949 for (var n = 0; n < m; ++n) { 44950 c[v++] = Z(d[n] + ' ', h[b], e).trim(); 44951 } 44952 } 44953 44954 } 44955 44956 return c; 44957 } 44958 44959 function Z(d, c, e) { 44960 var h = c.charCodeAt(0); 44961 33 > h && (h = (c = c.trim()).charCodeAt(0)); 44962 44963 switch (h) { 44964 case 38: 44965 return c.replace(F, '$1' + d.trim()); 44966 44967 case 58: 44968 return d.trim() + c.replace(F, '$1' + d.trim()); 44969 44970 default: 44971 if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim()); 44972 } 44973 44974 return d + c; 44975 } 44976 44977 function P(d, c, e, h) { 44978 var a = d + ';', 44979 m = 2 * c + 3 * e + 4 * h; 44980 44981 if (944 === m) { 44982 d = a.indexOf(':', 9) + 1; 44983 var b = a.substring(d, a.length - 1).trim(); 44984 b = a.substring(0, d).trim() + b + ';'; 44985 return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b; 44986 } 44987 44988 if (0 === w || 2 === w && !L(a, 1)) return a; 44989 44990 switch (m) { 44991 case 1015: 44992 return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a; 44993 44994 case 951: 44995 return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a; 44996 44997 case 963: 44998 return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a; 44999 45000 case 1009: 45001 if (100 !== a.charCodeAt(4)) break; 45002 45003 case 969: 45004 case 942: 45005 return '-webkit-' + a + a; 45006 45007 case 978: 45008 return '-webkit-' + a + '-moz-' + a + a; 45009 45010 case 1019: 45011 case 983: 45012 return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a; 45013 45014 case 883: 45015 if (45 === a.charCodeAt(8)) return '-webkit-' + a + a; 45016 if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a; 45017 break; 45018 45019 case 932: 45020 if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) { 45021 case 103: 45022 return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a; 45023 45024 case 115: 45025 return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a; 45026 45027 case 98: 45028 return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a; 45029 } 45030 return '-webkit-' + a + '-ms-' + a + a; 45031 45032 case 964: 45033 return '-webkit-' + a + '-ms-flex-' + a + a; 45034 45035 case 1023: 45036 if (99 !== a.charCodeAt(8)) break; 45037 b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify'); 45038 return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a; 45039 45040 case 1005: 45041 return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a; 45042 45043 case 1e3: 45044 b = a.substring(13).trim(); 45045 c = b.indexOf('-') + 1; 45046 45047 switch (b.charCodeAt(0) + b.charCodeAt(c)) { 45048 case 226: 45049 b = a.replace(G, 'tb'); 45050 break; 45051 45052 case 232: 45053 b = a.replace(G, 'tb-rl'); 45054 break; 45055 45056 case 220: 45057 b = a.replace(G, 'lr'); 45058 break; 45059 45060 default: 45061 return a; 45062 } 45063 45064 return '-webkit-' + a + '-ms-' + b + a; 45065 45066 case 1017: 45067 if (-1 === a.indexOf('sticky', 9)) break; 45068 45069 case 975: 45070 c = (a = d).length - 10; 45071 b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim(); 45072 45073 switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) { 45074 case 203: 45075 if (111 > b.charCodeAt(8)) break; 45076 45077 case 115: 45078 a = a.replace(b, '-webkit-' + b) + ';' + a; 45079 break; 45080 45081 case 207: 45082 case 102: 45083 a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a; 45084 } 45085 45086 return a + ';'; 45087 45088 case 938: 45089 if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) { 45090 case 105: 45091 return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a; 45092 45093 case 115: 45094 return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a; 45095 45096 default: 45097 return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a; 45098 } 45099 break; 45100 45101 case 973: 45102 case 989: 45103 if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break; 45104 45105 case 931: 45106 case 953: 45107 if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a; 45108 break; 45109 45110 case 962: 45111 if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a; 45112 } 45113 45114 return a; 45115 } 45116 45117 function L(d, c) { 45118 var e = d.indexOf(1 === c ? ':' : '{'), 45119 h = d.substring(0, 3 !== c ? e : 10); 45120 e = d.substring(e + 1, d.length - 1); 45121 return R(2 !== c ? h : h.replace(na, '$1'), e, c); 45122 } 45123 45124 function ea(d, c) { 45125 var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2)); 45126 return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')'; 45127 } 45128 45129 function H(d, c, e, h, a, m, b, v, n, q) { 45130 for (var g = 0, x = c, w; g < A; ++g) { 45131 switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) { 45132 case void 0: 45133 case !1: 45134 case !0: 45135 case null: 45136 break; 45137 45138 default: 45139 x = w; 45140 } 45141 } 45142 45143 if (x !== c) return x; 45144 } 45145 45146 function T(d) { 45147 switch (d) { 45148 case void 0: 45149 case null: 45150 A = S.length = 0; 45151 break; 45152 45153 default: 45154 if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) { 45155 T(d[c]); 45156 } else Y = !!d | 0; 45157 } 45158 45159 return T; 45160 } 45161 45162 function U(d) { 45163 d = d.prefix; 45164 void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0); 45165 return U; 45166 } 45167 45168 function B(d, c) { 45169 var e = d; 45170 33 > e.charCodeAt(0) && (e = e.trim()); 45171 V = e; 45172 e = [V]; 45173 45174 if (0 < A) { 45175 var h = H(-1, c, e, e, D, z, 0, 0, 0, 0); 45176 void 0 !== h && 'string' === typeof h && (c = h); 45177 } 45178 45179 var a = M(O, e, c, 0, 0); 45180 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h)); 45181 V = ''; 45182 E = 0; 45183 z = D = 1; 45184 return a; 45185 } 45186 45187 var ca = /^\0+/g, 45188 N = /[\0\r\f]/g, 45189 aa = /: */g, 45190 ka = /zoo|gra/, 45191 ma = /([,: ])(transform)/g, 45192 ia = /,\r+?/g, 45193 F = /([\t\r\n ])*\f?&/g, 45194 fa = /@(k\w+)\s*(\S*)\s*/, 45195 Q = /::(place)/g, 45196 ha = /:(read-only)/g, 45197 G = /[svh]\w+-[tblr]{2}/, 45198 da = /\(\s*(.*)\s*\)/g, 45199 oa = /([\s\S]*?);/g, 45200 ba = /-self|flex-/g, 45201 na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, 45202 la = /stretch|:\s*\w+\-(?:conte|avail)/, 45203 ja = /([^-])(image-set\()/, 45204 z = 1, 45205 D = 1, 45206 E = 0, 45207 w = 1, 45208 O = [], 45209 S = [], 45210 A = 0, 45211 R = null, 45212 Y = 0, 45213 V = ''; 45214 B.use = T; 45215 B.set = U; 45216 void 0 !== W && U(W); 45217 return B; 45218 } 45219 45220 /* harmony default export */ var stylis_browser_esm = (stylis_min); 45221 45222 // CONCATENATED MODULE: ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js 45223 var weakMemoize = function weakMemoize(func) { 45224 // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps 45225 var cache = new WeakMap(); 45226 return function (arg) { 45227 if (cache.has(arg)) { 45228 // $FlowFixMe 45229 return cache.get(arg); 45230 } 45231 45232 var ret = func(arg); 45233 cache.set(arg, ret); 45234 return ret; 45235 }; 45236 }; 45237 45238 /* harmony default export */ var weak_memoize_browser_esm = (weakMemoize); 45239 45240 // CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js 45241 45242 45243 45244 45245 // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet 45246 // inlined to avoid umd wrapper and peerDep warnings/installing stylis 45247 // since we use stylis after closure compiler 45248 var delimiter = '/*|*/'; 45249 var needle = delimiter + '}'; 45250 45251 function toSheet(block) { 45252 if (block) { 45253 Sheet.current.insert(block + '}'); 45254 } 45255 } 45256 45257 var Sheet = { 45258 current: null 45259 }; 45260 var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) { 45261 switch (context) { 45262 // property 45263 case 1: 45264 { 45265 switch (content.charCodeAt(0)) { 45266 case 64: 45267 { 45268 // @import 45269 Sheet.current.insert(content + ';'); 45270 return ''; 45271 } 45272 // charcode for l 45273 45274 case 108: 45275 { 45276 // charcode for b 45277 // this ignores label 45278 if (content.charCodeAt(2) === 98) { 45279 return ''; 45280 } 45281 } 45282 } 45283 45284 break; 45285 } 45286 // selector 45287 45288 case 2: 45289 { 45290 if (ns === 0) return content + delimiter; 45291 break; 45292 } 45293 // at-rule 45294 45295 case 3: 45296 { 45297 switch (ns) { 45298 // @font-face, @page 45299 case 102: 45300 case 112: 45301 { 45302 Sheet.current.insert(selectors[0] + content); 45303 return ''; 45304 } 45305 45306 default: 45307 { 45308 return content + (at === 0 ? delimiter : ''); 45309 } 45310 } 45311 } 45312 45313 case -2: 45314 { 45315 content.split(needle).forEach(toSheet); 45316 } 45317 } 45318 }; 45319 45320 var cache_browser_esm_createCache = function createCache(options) { 45321 if (options === undefined) options = {}; 45322 var key = options.key || 'css'; 45323 var stylisOptions; 45324 45325 if (options.prefix !== undefined) { 45326 stylisOptions = { 45327 prefix: options.prefix 45328 }; 45329 } 45330 45331 var stylis = new stylis_browser_esm(stylisOptions); 45332 45333 if (false) {} 45334 45335 var inserted = {}; // $FlowFixMe 45336 45337 var container; 45338 45339 { 45340 container = options.container || document.head; 45341 var nodes = document.querySelectorAll("style[data-emotion-" + key + "]"); 45342 Array.prototype.forEach.call(nodes, function (node) { 45343 var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe 45344 45345 attrib.split(' ').forEach(function (id) { 45346 inserted[id] = true; 45347 }); 45348 45349 if (node.parentNode !== container) { 45350 container.appendChild(node); 45351 } 45352 }); 45353 } 45354 45355 var _insert; 45356 45357 { 45358 stylis.use(options.stylisPlugins)(ruleSheet); 45359 45360 _insert = function insert(selector, serialized, sheet, shouldCache) { 45361 var name = serialized.name; 45362 Sheet.current = sheet; 45363 45364 if (false) { var map; } 45365 45366 stylis(selector, serialized.styles); 45367 45368 if (shouldCache) { 45369 cache.inserted[name] = true; 45370 } 45371 }; 45372 } 45373 45374 if (false) { var commentEnd, commentStart; } 45375 45376 var cache = { 45377 key: key, 45378 sheet: new sheet_browser_esm["a" /* StyleSheet */]({ 45379 key: key, 45380 container: container, 45381 nonce: options.nonce, 45382 speedy: options.speedy 45383 }), 45384 nonce: options.nonce, 45385 inserted: inserted, 45386 registered: {}, 45387 insert: _insert 45388 }; 45389 return cache; 45390 }; 45391 45392 /* harmony default export */ var cache_browser_esm = __webpack_exports__["a"] = (cache_browser_esm_createCache); 45393 45394 45395 /***/ }), 45396 45397 /***/ "Tqx9": 45398 /***/ (function(module, exports) { 45399 45400 (function() { module.exports = window["wp"]["primitives"]; }()); 45401 45402 /***/ }), 45403 45404 /***/ "UAm0": 45405 /***/ (function(module, __webpack_exports__, __webpack_require__) { 45406 45407 "use strict"; 45408 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStyledClassNameFromKey; }); 45409 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl"); 45410 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 45411 /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("4eJC"); 45412 /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_1__); 45413 /** 45414 * External dependencies 45415 */ 45416 45417 45418 /** 45419 * Generates the connected component CSS className based on the namespace. 45420 * 45421 * @param namespace The name of the connected component. 45422 * @return The generated CSS className. 45423 */ 45424 45425 function getStyledClassName(namespace) { 45426 const kebab = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(namespace); 45427 return `components-${kebab}`; 45428 } 45429 45430 const getStyledClassNameFromKey = memize__WEBPACK_IMPORTED_MODULE_1___default()(getStyledClassName); 45431 45432 45433 /***/ }), 45434 45435 /***/ "UFhG": 45436 /***/ (function(module, exports, __webpack_require__) { 45437 45438 "use strict"; 45439 45440 45441 // var modulo = require('./modulo'); 45442 var $floor = Math.floor; 45443 45444 // http://262.ecma-international.org/5.1/#sec-5.2 45445 45446 module.exports = function floor(x) { 45447 // return x - modulo(x, 1); 45448 return $floor(x); 45449 }; 45450 45451 45452 /***/ }), 45453 45454 /***/ "UVaH": 45455 /***/ (function(module, exports, __webpack_require__) { 45456 45457 "use strict"; 45458 /* WEBPACK VAR INJECTION */(function(global) { 45459 45460 var origSymbol = global.Symbol; 45461 var hasSymbolSham = __webpack_require__("FpZJ"); 45462 45463 module.exports = function hasNativeSymbols() { 45464 if (typeof origSymbol !== 'function') { return false; } 45465 if (typeof Symbol !== 'function') { return false; } 45466 if (typeof origSymbol('foo') !== 'symbol') { return false; } 45467 if (typeof Symbol('bar') !== 'symbol') { return false; } 45468 45469 return hasSymbolSham(); 45470 }; 45471 45472 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) 45473 45474 /***/ }), 45475 45476 /***/ "V1cy": 45477 /***/ (function(module, exports, __webpack_require__) { 45478 45479 "use strict"; 45480 45481 45482 var ES5Type = __webpack_require__("60zJ"); 45483 45484 // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values 45485 45486 module.exports = function Type(x) { 45487 if (typeof x === 'symbol') { 45488 return 'Symbol'; 45489 } 45490 if (typeof x === 'bigint') { 45491 return 'BigInt'; 45492 } 45493 return ES5Type(x); 45494 }; 45495 45496 45497 /***/ }), 45498 45499 /***/ "VDVV": 45500 /***/ (function(module, exports, __webpack_require__) { 45501 45502 Object.defineProperty(exports, "__esModule", { 45503 value: true 45504 }); 45505 45506 var _arrayPrototype = __webpack_require__("/ZKw"); 45507 45508 var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype); 45509 45510 var _globalCache = __webpack_require__("9pTB"); 45511 45512 var _globalCache2 = _interopRequireDefault(_globalCache); 45513 45514 var _constants = __webpack_require__("kFtd"); 45515 45516 var _getClassName = __webpack_require__("nLTY"); 45517 45518 var _getClassName2 = _interopRequireDefault(_getClassName); 45519 45520 var _separateStyles2 = __webpack_require__("3HjQ"); 45521 45522 var _separateStyles3 = _interopRequireDefault(_separateStyles2); 45523 45524 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 45525 45526 /** 45527 * Function required as part of the react-with-styles interface. Parses the styles provided by 45528 * react-with-styles to produce class names based on the style name and optionally the namespace if 45529 * available. 45530 * 45531 * stylesObject {Object} The styles object passed to withStyles. 45532 * 45533 * Return an object mapping style names to class names. 45534 */ 45535 function create(stylesObject) { 45536 var stylesToClasses = {}; 45537 var styleNames = Object.keys(stylesObject); 45538 var sharedState = _globalCache2['default'].get(_constants.GLOBAL_CACHE_KEY) || {}; 45539 var _sharedState$namespac = sharedState.namespace, 45540 namespace = _sharedState$namespac === undefined ? '' : _sharedState$namespac; 45541 45542 styleNames.forEach(function (styleName) { 45543 var className = (0, _getClassName2['default'])(namespace, styleName); 45544 stylesToClasses[styleName] = className; 45545 }); 45546 return stylesToClasses; 45547 } 45548 45549 /** 45550 * Process styles to be consumed by a component. 45551 * 45552 * stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects 45553 * representing inline styles, or arrays thereof. 45554 * 45555 * Return an object with optional className and style properties to be spread on a component. 45556 */ 45557 function resolve(stylesArray) { 45558 var flattenedStyles = (0, _arrayPrototype2['default'])(stylesArray, Infinity); 45559 45560 var _separateStyles = (0, _separateStyles3['default'])(flattenedStyles), 45561 classNames = _separateStyles.classNames, 45562 hasInlineStyles = _separateStyles.hasInlineStyles, 45563 inlineStyles = _separateStyles.inlineStyles; 45564 45565 var specificClassNames = classNames.map(function (name, index) { 45566 return String(name) + ' ' + String(name) + '_' + String(index + 1); 45567 }); 45568 var className = specificClassNames.join(' '); 45569 45570 var result = { className: className }; 45571 if (hasInlineStyles) result.style = inlineStyles; 45572 return result; 45573 } 45574 45575 exports['default'] = { create: create, resolve: resolve }; 45576 45577 /***/ }), 45578 45579 /***/ "VF6F": 45580 /***/ (function(module, exports, __webpack_require__) { 45581 45582 "use strict"; 45583 45584 45585 var GetIntrinsic = __webpack_require__("AM7I"); 45586 45587 var callBind = __webpack_require__("PrET"); 45588 45589 var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 45590 45591 module.exports = function callBoundIntrinsic(name, allowMissing) { 45592 var intrinsic = GetIntrinsic(name, !!allowMissing); 45593 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 45594 return callBind(intrinsic); 45595 } 45596 return intrinsic; 45597 }; 45598 45599 45600 /***/ }), 45601 45602 /***/ "VbXa": 45603 /***/ (function(module, exports, __webpack_require__) { 45604 45605 var setPrototypeOf = __webpack_require__("SksO"); 45606 45607 function _inheritsLoose(subClass, superClass) { 45608 subClass.prototype = Object.create(superClass.prototype); 45609 subClass.prototype.constructor = subClass; 45610 setPrototypeOf(subClass, superClass); 45611 } 45612 45613 module.exports = _inheritsLoose; 45614 module.exports["default"] = module.exports, module.exports.__esModule = true; 45615 45616 /***/ }), 45617 45618 /***/ "Vq1w": 45619 /***/ (function(module, __webpack_exports__, __webpack_require__) { 45620 45621 "use strict"; 45622 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isPortalEvent; }); 45623 /* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("utzN"); 45624 45625 45626 /** 45627 * Returns `true` if `event` has been fired within a React Portal element. 45628 */ 45629 45630 function isPortalEvent(event) { 45631 return !Object(_contains_js__WEBPACK_IMPORTED_MODULE_0__[/* contains */ "a"])(event.currentTarget, event.target); 45632 } 45633 45634 45635 45636 45637 /***/ }), 45638 45639 /***/ "W/NR": 45640 /***/ (function(module, __webpack_exports__, __webpack_require__) { 45641 45642 "use strict"; 45643 45644 // UNUSED EXPORTS: TOOLTIP_DELAY 45645 45646 // EXTERNAL MODULE: external ["wp","element"] 45647 var external_wp_element_ = __webpack_require__("GRId"); 45648 45649 // EXTERNAL MODULE: external "lodash" 45650 var external_lodash_ = __webpack_require__("YLtl"); 45651 45652 // EXTERNAL MODULE: external ["wp","compose"] 45653 var external_wp_compose_ = __webpack_require__("K9lf"); 45654 45655 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js + 1 modules 45656 var popover = __webpack_require__("oXO/"); 45657 45658 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js 45659 var build_module_shortcut = __webpack_require__("Cw+6"); 45660 45661 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js 45662 var with_next = __webpack_require__("9NHk"); 45663 45664 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/next.js 45665 /** 45666 * Internal dependencies 45667 */ 45668 45669 45670 const Tooltip = false ? undefined : undefined; 45671 45672 const adapter = ({ 45673 text, 45674 ...props 45675 }) => ({ ...props, 45676 content: text 45677 }); 45678 45679 function withNextComponent(Component) { 45680 return Object(with_next["a" /* withNext */])(Component, Tooltip, 'WPComponentsTooltip', adapter); 45681 } 45682 45683 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js 45684 45685 45686 /** 45687 * External dependencies 45688 */ 45689 45690 /** 45691 * WordPress dependencies 45692 */ 45693 45694 45695 45696 /** 45697 * Internal dependencies 45698 */ 45699 45700 45701 45702 45703 /** 45704 * Time over children to wait before showing tooltip 45705 * 45706 * @type {number} 45707 */ 45708 45709 const TOOLTIP_DELAY = 700; 45710 const eventCatcher = Object(external_wp_element_["createElement"])("div", { 45711 className: "event-catcher" 45712 }); 45713 45714 const getDisabledElement = ({ 45715 eventHandlers, 45716 child, 45717 childrenWithPopover 45718 }) => Object(external_wp_element_["cloneElement"])(Object(external_wp_element_["createElement"])("span", { 45719 className: "disabled-element-wrapper" 45720 }, Object(external_wp_element_["cloneElement"])(eventCatcher, eventHandlers), Object(external_wp_element_["cloneElement"])(child, { 45721 children: childrenWithPopover 45722 }), ","), eventHandlers); 45723 45724 const getRegularElement = ({ 45725 child, 45726 eventHandlers, 45727 childrenWithPopover 45728 }) => Object(external_wp_element_["cloneElement"])(child, { ...eventHandlers, 45729 children: childrenWithPopover 45730 }); 45731 45732 const addPopoverToGrandchildren = ({ 45733 grandchildren, 45734 isOver, 45735 position, 45736 text, 45737 shortcut 45738 }) => Object(external_wp_element_["concatChildren"])(grandchildren, isOver && Object(external_wp_element_["createElement"])(popover["a" /* default */], { 45739 focusOnMount: false, 45740 position: position, 45741 className: "components-tooltip", 45742 "aria-hidden": "true", 45743 animate: false, 45744 noArrow: true 45745 }, text, Object(external_wp_element_["createElement"])(build_module_shortcut["a" /* default */], { 45746 className: "components-tooltip__shortcut", 45747 shortcut: shortcut 45748 }))); 45749 45750 const emitToChild = (children, eventName, event) => { 45751 if (external_wp_element_["Children"].count(children) !== 1) { 45752 return; 45753 } 45754 45755 const child = external_wp_element_["Children"].only(children); 45756 45757 if (typeof child.props[eventName] === 'function') { 45758 child.props[eventName](event); 45759 } 45760 }; 45761 45762 function tooltip_Tooltip({ 45763 children, 45764 position, 45765 text, 45766 shortcut 45767 }) { 45768 /** 45769 * Whether a mouse is currently pressed, used in determining whether 45770 * to handle a focus event as displaying the tooltip immediately. 45771 * 45772 * @type {boolean} 45773 */ 45774 const [isMouseDown, setIsMouseDown] = Object(external_wp_element_["useState"])(false); 45775 const [isOver, setIsOver] = Object(external_wp_element_["useState"])(false); 45776 const delayedSetIsOver = Object(external_wp_compose_["useDebounce"])(setIsOver, TOOLTIP_DELAY); 45777 45778 const createMouseDown = event => { 45779 // Preserve original child callback behavior 45780 emitToChild(children, 'onMouseDown', event); // On mouse down, the next `mouseup` should revert the value of the 45781 // instance property and remove its own event handler. The bind is 45782 // made on the document since the `mouseup` might not occur within 45783 // the bounds of the element. 45784 45785 document.addEventListener('mouseup', cancelIsMouseDown); 45786 setIsMouseDown(true); 45787 }; 45788 45789 const createMouseUp = event => { 45790 emitToChild(children, 'onMouseUp', event); 45791 document.removeEventListener('mouseup', cancelIsMouseDown); 45792 setIsMouseDown(false); 45793 }; 45794 45795 const createMouseEvent = type => { 45796 if (type === 'mouseUp') return createMouseUp; 45797 if (type === 'mouseDown') return createMouseDown; 45798 }; 45799 /** 45800 * Prebound `isInMouseDown` handler, created as a constant reference to 45801 * assure ability to remove in component unmount. 45802 * 45803 * @type {Function} 45804 */ 45805 45806 45807 const cancelIsMouseDown = createMouseEvent('mouseUp'); 45808 45809 const createToggleIsOver = (eventName, isDelayed) => { 45810 return event => { 45811 // Preserve original child callback behavior 45812 emitToChild(children, eventName, event); // Mouse events behave unreliably in React for disabled elements, 45813 // firing on mouseenter but not mouseleave. Further, the default 45814 // behavior for disabled elements in some browsers is to ignore 45815 // mouse events. Don't bother trying to to handle them. 45816 // 45817 // See: https://github.com/facebook/react/issues/4251 45818 45819 if (event.currentTarget.disabled) { 45820 return; 45821 } // A focus event will occur as a result of a mouse click, but it 45822 // should be disambiguated between interacting with the button and 45823 // using an explicit focus shift as a cue to display the tooltip. 45824 45825 45826 if ('focus' === event.type && isMouseDown) { 45827 return; 45828 } // Needed in case unsetting is over while delayed set pending, i.e. 45829 // quickly blur/mouseleave before delayedSetIsOver is called 45830 45831 45832 delayedSetIsOver.cancel(); 45833 45834 const _isOver = Object(external_lodash_["includes"])(['focus', 'mouseenter'], event.type); 45835 45836 if (_isOver === isOver) { 45837 return; 45838 } 45839 45840 if (isDelayed) { 45841 delayedSetIsOver(_isOver); 45842 } else { 45843 setIsOver(_isOver); 45844 } 45845 }; 45846 }; 45847 45848 const clearOnUnmount = () => { 45849 delayedSetIsOver.cancel(); 45850 document.removeEventListener('mouseup', cancelIsMouseDown); 45851 }; 45852 45853 Object(external_wp_element_["useEffect"])(() => clearOnUnmount, []); 45854 45855 if (external_wp_element_["Children"].count(children) !== 1) { 45856 if (false) {} 45857 45858 return children; 45859 } 45860 45861 const eventHandlers = { 45862 onMouseEnter: createToggleIsOver('onMouseEnter', true), 45863 onMouseLeave: createToggleIsOver('onMouseLeave'), 45864 onClick: createToggleIsOver('onClick'), 45865 onFocus: createToggleIsOver('onFocus'), 45866 onBlur: createToggleIsOver('onBlur'), 45867 onMouseDown: createMouseEvent('mouseDown') 45868 }; 45869 const child = external_wp_element_["Children"].only(children); 45870 const { 45871 children: grandchildren, 45872 disabled 45873 } = child.props; 45874 const getElementWithPopover = disabled ? getDisabledElement : getRegularElement; 45875 const popoverData = { 45876 isOver, 45877 position, 45878 text, 45879 shortcut 45880 }; 45881 const childrenWithPopover = addPopoverToGrandchildren({ 45882 grandchildren, 45883 ...popoverData 45884 }); 45885 return getElementWithPopover({ 45886 child, 45887 eventHandlers, 45888 childrenWithPopover 45889 }); 45890 } 45891 45892 /* harmony default export */ var tooltip = __webpack_exports__["a"] = (withNextComponent(tooltip_Tooltip)); 45893 45894 45895 /***/ }), 45896 45897 /***/ "WFqU": 45898 /***/ (function(module, exports, __webpack_require__) { 45899 45900 /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ 45901 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 45902 45903 module.exports = freeGlobal; 45904 45905 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) 45906 45907 /***/ }), 45908 45909 /***/ "WI5Z": 45910 /***/ (function(module, exports, __webpack_require__) { 45911 45912 "use strict"; 45913 45914 45915 Object.defineProperty(exports, "__esModule", { 45916 value: true 45917 }); 45918 exports['default'] = registerInterfaceWithDefaultTheme; 45919 45920 var _ThemedStyleSheet = __webpack_require__("030x"); 45921 45922 var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet); 45923 45924 var _DefaultTheme = __webpack_require__("xOhs"); 45925 45926 var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme); 45927 45928 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 45929 45930 function registerInterfaceWithDefaultTheme(reactWithStylesInterface) { 45931 _ThemedStyleSheet2['default'].registerInterface(reactWithStylesInterface); 45932 _ThemedStyleSheet2['default'].registerTheme(_DefaultTheme2['default']); 45933 } 45934 45935 /***/ }), 45936 45937 /***/ "WZeS": 45938 /***/ (function(module, exports, __webpack_require__) { 45939 45940 "use strict"; 45941 45942 45943 var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; 45944 45945 var isPrimitive = __webpack_require__("Teho"); 45946 var isCallable = __webpack_require__("IdCN"); 45947 var isDate = __webpack_require__("DmXP"); 45948 var isSymbol = __webpack_require__("/sVA"); 45949 45950 var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { 45951 if (typeof O === 'undefined' || O === null) { 45952 throw new TypeError('Cannot call method on ' + O); 45953 } 45954 if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { 45955 throw new TypeError('hint must be "string" or "number"'); 45956 } 45957 var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; 45958 var method, result, i; 45959 for (i = 0; i < methodNames.length; ++i) { 45960 method = O[methodNames[i]]; 45961 if (isCallable(method)) { 45962 result = method.call(O); 45963 if (isPrimitive(result)) { 45964 return result; 45965 } 45966 } 45967 } 45968 throw new TypeError('No default value'); 45969 }; 45970 45971 var GetMethod = function GetMethod(O, P) { 45972 var func = O[P]; 45973 if (func !== null && typeof func !== 'undefined') { 45974 if (!isCallable(func)) { 45975 throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); 45976 } 45977 return func; 45978 } 45979 return void 0; 45980 }; 45981 45982 // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive 45983 module.exports = function ToPrimitive(input) { 45984 if (isPrimitive(input)) { 45985 return input; 45986 } 45987 var hint = 'default'; 45988 if (arguments.length > 1) { 45989 if (arguments[1] === String) { 45990 hint = 'string'; 45991 } else if (arguments[1] === Number) { 45992 hint = 'number'; 45993 } 45994 } 45995 45996 var exoticToPrim; 45997 if (hasSymbols) { 45998 if (Symbol.toPrimitive) { 45999 exoticToPrim = GetMethod(input, Symbol.toPrimitive); 46000 } else if (isSymbol(input)) { 46001 exoticToPrim = Symbol.prototype.valueOf; 46002 } 46003 } 46004 if (typeof exoticToPrim !== 'undefined') { 46005 var result = exoticToPrim.call(input, hint); 46006 if (isPrimitive(result)) { 46007 return result; 46008 } 46009 throw new TypeError('unable to convert exotic object to primitive'); 46010 } 46011 if (hint === 'default' && (isDate(input) || isSymbol(input))) { 46012 hint = 'string'; 46013 } 46014 return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); 46015 }; 46016 46017 46018 /***/ }), 46019 46020 /***/ "WbBG": 46021 /***/ (function(module, exports, __webpack_require__) { 46022 46023 "use strict"; 46024 /** 46025 * Copyright (c) 2013-present, Facebook, Inc. 46026 * 46027 * This source code is licensed under the MIT license found in the 46028 * LICENSE file in the root directory of this source tree. 46029 */ 46030 46031 46032 46033 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; 46034 46035 module.exports = ReactPropTypesSecret; 46036 46037 46038 /***/ }), 46039 46040 /***/ "Wfh+": 46041 /***/ (function(module, exports, __webpack_require__) { 46042 46043 "use strict"; 46044 46045 46046 var abs = __webpack_require__("nKkb"); 46047 var floor = __webpack_require__("UFhG"); 46048 var ToNumber = __webpack_require__("Pjai"); 46049 46050 var $isNaN = __webpack_require__("HwJD"); 46051 var $isFinite = __webpack_require__("ald4"); 46052 var $sign = __webpack_require__("6I5v"); 46053 46054 // http://262.ecma-international.org/5.1/#sec-9.4 46055 46056 module.exports = function ToInteger(value) { 46057 var number = ToNumber(value); 46058 if ($isNaN(number)) { return 0; } 46059 if (number === 0 || !$isFinite(number)) { return number; } 46060 return $sign(number) * floor(abs(number)); 46061 }; 46062 46063 46064 /***/ }), 46065 46066 /***/ "WmS1": 46067 /***/ (function(module, exports, __webpack_require__) { 46068 46069 "use strict"; 46070 46071 46072 Object.defineProperty(exports, "__esModule", { 46073 value: true 46074 }); 46075 exports['default'] = toMomentObject; 46076 46077 var _moment = __webpack_require__("wy2R"); 46078 46079 var _moment2 = _interopRequireDefault(_moment); 46080 46081 var _constants = __webpack_require__("Fv1B"); 46082 46083 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 46084 46085 function toMomentObject(dateString, customFormat) { 46086 var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT]; 46087 46088 var date = (0, _moment2['default'])(dateString, dateFormats, true); 46089 return date.isValid() ? date.hour(12) : null; 46090 } 46091 46092 /***/ }), 46093 46094 /***/ "WnOg": 46095 /***/ (function(module, __webpack_exports__, __webpack_require__) { 46096 46097 "use strict"; 46098 /* unused harmony export warning */ 46099 46100 46101 /** 46102 * Logs `messages` to the console using `console.warn` based on a `condition`. 46103 * 46104 * @example 46105 * import { warning } from "reakit-warning"; 46106 * 46107 * warning(true, "a", "b"); // console.warn("a", "\n", "b") 46108 * warning(false, "a", "b"); // does nothing 46109 */ 46110 46111 function warning(condition) { 46112 if (false) { var warns, _len, messages, _key, _console; } 46113 } 46114 46115 46116 46117 46118 /***/ }), 46119 46120 /***/ "WvKp": 46121 /***/ (function(module, exports, __webpack_require__) { 46122 46123 "use strict"; 46124 46125 46126 var GetIntrinsic = __webpack_require__("rZ7t"); 46127 46128 var $TypeError = GetIntrinsic('%TypeError%'); 46129 46130 var CreateDataProperty = __webpack_require__("DvWQ"); 46131 var IsPropertyKey = __webpack_require__("i10q"); 46132 var Type = __webpack_require__("V1cy"); 46133 46134 // // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow 46135 46136 module.exports = function CreateDataPropertyOrThrow(O, P, V) { 46137 if (Type(O) !== 'Object') { 46138 throw new $TypeError('Assertion failed: Type(O) is not Object'); 46139 } 46140 if (!IsPropertyKey(P)) { 46141 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); 46142 } 46143 var success = CreateDataProperty(O, P, V); 46144 if (!success) { 46145 throw new $TypeError('unable to create data property'); 46146 } 46147 return success; 46148 }; 46149 46150 46151 /***/ }), 46152 46153 /***/ "XGBb": 46154 /***/ (function(module, exports, __webpack_require__) { 46155 46156 var moment = __webpack_require__("wy2R"); 46157 var momentValidationWrapper = __webpack_require__("c6aN"); 46158 var core = __webpack_require__("iNdV"); 46159 46160 module.exports = { 46161 46162 momentObj : core.createMomentChecker( 46163 'object', 46164 function(obj) { 46165 return typeof obj === 'object'; 46166 }, 46167 function isValid(value) { 46168 return momentValidationWrapper.isValidMoment(value); 46169 }, 46170 'Moment' 46171 ), 46172 46173 momentString : core.createMomentChecker( 46174 'string', 46175 function(str) { 46176 return typeof str === 'string'; 46177 }, 46178 function isValid(value) { 46179 return momentValidationWrapper.isValidMoment(moment(value)); 46180 }, 46181 'Moment' 46182 ), 46183 46184 momentDurationObj : core.createMomentChecker( 46185 'object', 46186 function(obj) { 46187 return typeof obj === 'object'; 46188 }, 46189 function isValid(value) { 46190 return moment.isDuration(value); 46191 }, 46192 'Duration' 46193 ), 46194 46195 }; 46196 46197 46198 /***/ }), 46199 46200 /***/ "XgzB": 46201 /***/ (function(module, __webpack_exports__, __webpack_require__) { 46202 46203 "use strict"; 46204 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 46205 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 46206 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 46207 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 46208 46209 46210 /** 46211 * WordPress dependencies 46212 */ 46213 46214 const chevronUp = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 46215 viewBox: "0 0 24 24", 46216 xmlns: "http://www.w3.org/2000/svg" 46217 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 46218 d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" 46219 })); 46220 /* harmony default export */ __webpack_exports__["a"] = (chevronUp); 46221 46222 46223 /***/ }), 46224 46225 /***/ "Xtko": 46226 /***/ (function(module, exports, __webpack_require__) { 46227 46228 "use strict"; 46229 46230 46231 Object.defineProperty(exports, "__esModule", { 46232 value: true 46233 }); 46234 46235 var _slicedToArray = function () { function sliceIterator(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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 46236 46237 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; }; }(); 46238 46239 var _object = __webpack_require__("Koq/"); 46240 46241 var _object2 = _interopRequireDefault(_object); 46242 46243 var _react = __webpack_require__("cDcd"); 46244 46245 var _react2 = _interopRequireDefault(_react); 46246 46247 var _propTypes = __webpack_require__("17x9"); 46248 46249 var _propTypes2 = _interopRequireDefault(_propTypes); 46250 46251 var _reactMomentProptypes = __webpack_require__("XGBb"); 46252 46253 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 46254 46255 var _airbnbPropTypes = __webpack_require__("Hsqg"); 46256 46257 var _moment = __webpack_require__("wy2R"); 46258 46259 var _moment2 = _interopRequireDefault(_moment); 46260 46261 var _object3 = __webpack_require__("4cSd"); 46262 46263 var _object4 = _interopRequireDefault(_object3); 46264 46265 var _isTouchDevice = __webpack_require__("LTAC"); 46266 46267 var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice); 46268 46269 var _defaultPhrases = __webpack_require__("vV+G"); 46270 46271 var _getPhrasePropTypes = __webpack_require__("yc2e"); 46272 46273 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 46274 46275 var _isSameDay = __webpack_require__("pRvc"); 46276 46277 var _isSameDay2 = _interopRequireDefault(_isSameDay); 46278 46279 var _isAfterDay = __webpack_require__("Nho6"); 46280 46281 var _isAfterDay2 = _interopRequireDefault(_isAfterDay); 46282 46283 var _getVisibleDays = __webpack_require__("u5Fq"); 46284 46285 var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays); 46286 46287 var _isDayVisible = __webpack_require__("IgE5"); 46288 46289 var _isDayVisible2 = _interopRequireDefault(_isDayVisible); 46290 46291 var _toISODateString = __webpack_require__("pYxT"); 46292 46293 var _toISODateString2 = _interopRequireDefault(_toISODateString); 46294 46295 var _toISOMonthString = __webpack_require__("jenk"); 46296 46297 var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString); 46298 46299 var _ScrollableOrientationShape = __webpack_require__("aE6U"); 46300 46301 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 46302 46303 var _DayOfWeekShape = __webpack_require__("2S2E"); 46304 46305 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 46306 46307 var _CalendarInfoPositionShape = __webpack_require__("oR9Z"); 46308 46309 var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape); 46310 46311 var _constants = __webpack_require__("Fv1B"); 46312 46313 var _DayPicker = __webpack_require__("Nloh"); 46314 46315 var _DayPicker2 = _interopRequireDefault(_DayPicker); 46316 46317 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 46318 46319 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; } 46320 46321 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 46322 46323 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; } 46324 46325 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; } 46326 46327 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({ 46328 date: _reactMomentProptypes2['default'].momentObj, 46329 onDateChange: _propTypes2['default'].func, 46330 46331 focused: _propTypes2['default'].bool, 46332 onFocusChange: _propTypes2['default'].func, 46333 onClose: _propTypes2['default'].func, 46334 46335 keepOpenOnDateSelect: _propTypes2['default'].bool, 46336 isOutsideRange: _propTypes2['default'].func, 46337 isDayBlocked: _propTypes2['default'].func, 46338 isDayHighlighted: _propTypes2['default'].func, 46339 46340 // DayPicker props 46341 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 46342 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 46343 enableOutsideDays: _propTypes2['default'].bool, 46344 numberOfMonths: _propTypes2['default'].number, 46345 orientation: _ScrollableOrientationShape2['default'], 46346 withPortal: _propTypes2['default'].bool, 46347 initialVisibleMonth: _propTypes2['default'].func, 46348 firstDayOfWeek: _DayOfWeekShape2['default'], 46349 hideKeyboardShortcutsPanel: _propTypes2['default'].bool, 46350 daySize: _airbnbPropTypes.nonNegativeInteger, 46351 verticalHeight: _airbnbPropTypes.nonNegativeInteger, 46352 noBorder: _propTypes2['default'].bool, 46353 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 46354 transitionDuration: _airbnbPropTypes.nonNegativeInteger, 46355 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 46356 46357 navPrev: _propTypes2['default'].node, 46358 navNext: _propTypes2['default'].node, 46359 46360 onPrevMonthClick: _propTypes2['default'].func, 46361 onNextMonthClick: _propTypes2['default'].func, 46362 onOutsideClick: _propTypes2['default'].func, 46363 renderCalendarDay: _propTypes2['default'].func, 46364 renderDayContents: _propTypes2['default'].func, 46365 renderCalendarInfo: _propTypes2['default'].func, 46366 calendarInfoPosition: _CalendarInfoPositionShape2['default'], 46367 46368 // accessibility 46369 onBlur: _propTypes2['default'].func, 46370 isFocused: _propTypes2['default'].bool, 46371 showKeyboardShortcuts: _propTypes2['default'].bool, 46372 46373 // i18n 46374 monthFormat: _propTypes2['default'].string, 46375 weekDayFormat: _propTypes2['default'].string, 46376 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)), 46377 dayAriaLabelFormat: _propTypes2['default'].string, 46378 46379 isRTL: _propTypes2['default'].bool 46380 }); 46381 46382 var defaultProps = { 46383 date: undefined, // TODO: use null 46384 onDateChange: function () { 46385 function onDateChange() {} 46386 46387 return onDateChange; 46388 }(), 46389 46390 46391 focused: false, 46392 onFocusChange: function () { 46393 function onFocusChange() {} 46394 46395 return onFocusChange; 46396 }(), 46397 onClose: function () { 46398 function onClose() {} 46399 46400 return onClose; 46401 }(), 46402 46403 46404 keepOpenOnDateSelect: false, 46405 isOutsideRange: function () { 46406 function isOutsideRange() {} 46407 46408 return isOutsideRange; 46409 }(), 46410 isDayBlocked: function () { 46411 function isDayBlocked() {} 46412 46413 return isDayBlocked; 46414 }(), 46415 isDayHighlighted: function () { 46416 function isDayHighlighted() {} 46417 46418 return isDayHighlighted; 46419 }(), 46420 46421 46422 // DayPicker props 46423 renderMonthText: null, 46424 enableOutsideDays: false, 46425 numberOfMonths: 1, 46426 orientation: _constants.HORIZONTAL_ORIENTATION, 46427 withPortal: false, 46428 hideKeyboardShortcutsPanel: false, 46429 initialVisibleMonth: null, 46430 firstDayOfWeek: null, 46431 daySize: _constants.DAY_SIZE, 46432 verticalHeight: null, 46433 noBorder: false, 46434 verticalBorderSpacing: undefined, 46435 transitionDuration: undefined, 46436 horizontalMonthPadding: 13, 46437 46438 navPrev: null, 46439 navNext: null, 46440 46441 onPrevMonthClick: function () { 46442 function onPrevMonthClick() {} 46443 46444 return onPrevMonthClick; 46445 }(), 46446 onNextMonthClick: function () { 46447 function onNextMonthClick() {} 46448 46449 return onNextMonthClick; 46450 }(), 46451 onOutsideClick: function () { 46452 function onOutsideClick() {} 46453 46454 return onOutsideClick; 46455 }(), 46456 46457 46458 renderCalendarDay: undefined, 46459 renderDayContents: null, 46460 renderCalendarInfo: null, 46461 renderMonthElement: null, 46462 calendarInfoPosition: _constants.INFO_POSITION_BOTTOM, 46463 46464 // accessibility 46465 onBlur: function () { 46466 function onBlur() {} 46467 46468 return onBlur; 46469 }(), 46470 46471 isFocused: false, 46472 showKeyboardShortcuts: false, 46473 46474 // i18n 46475 monthFormat: 'MMMM YYYY', 46476 weekDayFormat: 'dd', 46477 phrases: _defaultPhrases.DayPickerPhrases, 46478 dayAriaLabelFormat: undefined, 46479 46480 isRTL: false 46481 }; 46482 46483 var DayPickerSingleDateController = function (_React$Component) { 46484 _inherits(DayPickerSingleDateController, _React$Component); 46485 46486 function DayPickerSingleDateController(props) { 46487 _classCallCheck(this, DayPickerSingleDateController); 46488 46489 var _this = _possibleConstructorReturn(this, (DayPickerSingleDateController.__proto__ || Object.getPrototypeOf(DayPickerSingleDateController)).call(this, props)); 46490 46491 _this.isTouchDevice = false; 46492 _this.today = (0, _moment2['default'])(); 46493 46494 _this.modifiers = { 46495 today: function () { 46496 function today(day) { 46497 return _this.isToday(day); 46498 } 46499 46500 return today; 46501 }(), 46502 blocked: function () { 46503 function blocked(day) { 46504 return _this.isBlocked(day); 46505 } 46506 46507 return blocked; 46508 }(), 46509 'blocked-calendar': function () { 46510 function blockedCalendar(day) { 46511 return props.isDayBlocked(day); 46512 } 46513 46514 return blockedCalendar; 46515 }(), 46516 'blocked-out-of-range': function () { 46517 function blockedOutOfRange(day) { 46518 return props.isOutsideRange(day); 46519 } 46520 46521 return blockedOutOfRange; 46522 }(), 46523 'highlighted-calendar': function () { 46524 function highlightedCalendar(day) { 46525 return props.isDayHighlighted(day); 46526 } 46527 46528 return highlightedCalendar; 46529 }(), 46530 valid: function () { 46531 function valid(day) { 46532 return !_this.isBlocked(day); 46533 } 46534 46535 return valid; 46536 }(), 46537 hovered: function () { 46538 function hovered(day) { 46539 return _this.isHovered(day); 46540 } 46541 46542 return hovered; 46543 }(), 46544 selected: function () { 46545 function selected(day) { 46546 return _this.isSelected(day); 46547 } 46548 46549 return selected; 46550 }(), 46551 'first-day-of-week': function () { 46552 function firstDayOfWeek(day) { 46553 return _this.isFirstDayOfWeek(day); 46554 } 46555 46556 return firstDayOfWeek; 46557 }(), 46558 'last-day-of-week': function () { 46559 function lastDayOfWeek(day) { 46560 return _this.isLastDayOfWeek(day); 46561 } 46562 46563 return lastDayOfWeek; 46564 }() 46565 }; 46566 46567 var _this$getStateForNewM = _this.getStateForNewMonth(props), 46568 currentMonth = _this$getStateForNewM.currentMonth, 46569 visibleDays = _this$getStateForNewM.visibleDays; 46570 46571 _this.state = { 46572 hoverDate: null, 46573 currentMonth: currentMonth, 46574 visibleDays: visibleDays 46575 }; 46576 46577 _this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this); 46578 _this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this); 46579 _this.onDayClick = _this.onDayClick.bind(_this); 46580 46581 _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this); 46582 _this.onNextMonthClick = _this.onNextMonthClick.bind(_this); 46583 _this.onMonthChange = _this.onMonthChange.bind(_this); 46584 _this.onYearChange = _this.onYearChange.bind(_this); 46585 46586 _this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this); 46587 return _this; 46588 } 46589 46590 _createClass(DayPickerSingleDateController, [{ 46591 key: 'componentDidMount', 46592 value: function () { 46593 function componentDidMount() { 46594 this.isTouchDevice = (0, _isTouchDevice2['default'])(); 46595 } 46596 46597 return componentDidMount; 46598 }() 46599 }, { 46600 key: 'componentWillReceiveProps', 46601 value: function () { 46602 function componentWillReceiveProps(nextProps) { 46603 var _this2 = this; 46604 46605 var date = nextProps.date, 46606 focused = nextProps.focused, 46607 isOutsideRange = nextProps.isOutsideRange, 46608 isDayBlocked = nextProps.isDayBlocked, 46609 isDayHighlighted = nextProps.isDayHighlighted, 46610 initialVisibleMonth = nextProps.initialVisibleMonth, 46611 numberOfMonths = nextProps.numberOfMonths, 46612 enableOutsideDays = nextProps.enableOutsideDays; 46613 var _props = this.props, 46614 prevIsOutsideRange = _props.isOutsideRange, 46615 prevIsDayBlocked = _props.isDayBlocked, 46616 prevIsDayHighlighted = _props.isDayHighlighted, 46617 prevNumberOfMonths = _props.numberOfMonths, 46618 prevEnableOutsideDays = _props.enableOutsideDays, 46619 prevInitialVisibleMonth = _props.initialVisibleMonth, 46620 prevFocused = _props.focused, 46621 prevDate = _props.date; 46622 var visibleDays = this.state.visibleDays; 46623 46624 46625 var recomputeOutsideRange = false; 46626 var recomputeDayBlocked = false; 46627 var recomputeDayHighlighted = false; 46628 46629 if (isOutsideRange !== prevIsOutsideRange) { 46630 this.modifiers['blocked-out-of-range'] = function (day) { 46631 return isOutsideRange(day); 46632 }; 46633 recomputeOutsideRange = true; 46634 } 46635 46636 if (isDayBlocked !== prevIsDayBlocked) { 46637 this.modifiers['blocked-calendar'] = function (day) { 46638 return isDayBlocked(day); 46639 }; 46640 recomputeDayBlocked = true; 46641 } 46642 46643 if (isDayHighlighted !== prevIsDayHighlighted) { 46644 this.modifiers['highlighted-calendar'] = function (day) { 46645 return isDayHighlighted(day); 46646 }; 46647 recomputeDayHighlighted = true; 46648 } 46649 46650 var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted; 46651 46652 if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocused && focused) { 46653 var newMonthState = this.getStateForNewMonth(nextProps); 46654 var currentMonth = newMonthState.currentMonth; 46655 visibleDays = newMonthState.visibleDays; 46656 46657 this.setState({ 46658 currentMonth: currentMonth, 46659 visibleDays: visibleDays 46660 }); 46661 } 46662 46663 var didDateChange = date !== prevDate; 46664 var didFocusChange = focused !== prevFocused; 46665 46666 var modifiers = {}; 46667 46668 if (didDateChange) { 46669 modifiers = this.deleteModifier(modifiers, prevDate, 'selected'); 46670 modifiers = this.addModifier(modifiers, date, 'selected'); 46671 } 46672 46673 if (didFocusChange || recomputePropModifiers) { 46674 (0, _object4['default'])(visibleDays).forEach(function (days) { 46675 Object.keys(days).forEach(function (day) { 46676 var momentObj = (0, _moment2['default'])(day); 46677 if (_this2.isBlocked(momentObj)) { 46678 modifiers = _this2.addModifier(modifiers, momentObj, 'blocked'); 46679 } else { 46680 modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked'); 46681 } 46682 46683 if (didFocusChange || recomputeOutsideRange) { 46684 if (isOutsideRange(momentObj)) { 46685 modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range'); 46686 } else { 46687 modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range'); 46688 } 46689 } 46690 46691 if (didFocusChange || recomputeDayBlocked) { 46692 if (isDayBlocked(momentObj)) { 46693 modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar'); 46694 } else { 46695 modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar'); 46696 } 46697 } 46698 46699 if (didFocusChange || recomputeDayHighlighted) { 46700 if (isDayHighlighted(momentObj)) { 46701 modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar'); 46702 } else { 46703 modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar'); 46704 } 46705 } 46706 }); 46707 }); 46708 } 46709 46710 var today = (0, _moment2['default'])(); 46711 if (!(0, _isSameDay2['default'])(this.today, today)) { 46712 modifiers = this.deleteModifier(modifiers, this.today, 'today'); 46713 modifiers = this.addModifier(modifiers, today, 'today'); 46714 this.today = today; 46715 } 46716 46717 if (Object.keys(modifiers).length > 0) { 46718 this.setState({ 46719 visibleDays: (0, _object2['default'])({}, visibleDays, modifiers) 46720 }); 46721 } 46722 } 46723 46724 return componentWillReceiveProps; 46725 }() 46726 }, { 46727 key: 'componentWillUpdate', 46728 value: function () { 46729 function componentWillUpdate() { 46730 this.today = (0, _moment2['default'])(); 46731 } 46732 46733 return componentWillUpdate; 46734 }() 46735 }, { 46736 key: 'onDayClick', 46737 value: function () { 46738 function onDayClick(day, e) { 46739 if (e) e.preventDefault(); 46740 if (this.isBlocked(day)) return; 46741 var _props2 = this.props, 46742 onDateChange = _props2.onDateChange, 46743 keepOpenOnDateSelect = _props2.keepOpenOnDateSelect, 46744 onFocusChange = _props2.onFocusChange, 46745 onClose = _props2.onClose; 46746 46747 46748 onDateChange(day); 46749 if (!keepOpenOnDateSelect) { 46750 onFocusChange({ focused: false }); 46751 onClose({ date: day }); 46752 } 46753 } 46754 46755 return onDayClick; 46756 }() 46757 }, { 46758 key: 'onDayMouseEnter', 46759 value: function () { 46760 function onDayMouseEnter(day) { 46761 if (this.isTouchDevice) return; 46762 var _state = this.state, 46763 hoverDate = _state.hoverDate, 46764 visibleDays = _state.visibleDays; 46765 46766 46767 var modifiers = this.deleteModifier({}, hoverDate, 'hovered'); 46768 modifiers = this.addModifier(modifiers, day, 'hovered'); 46769 46770 this.setState({ 46771 hoverDate: day, 46772 visibleDays: (0, _object2['default'])({}, visibleDays, modifiers) 46773 }); 46774 } 46775 46776 return onDayMouseEnter; 46777 }() 46778 }, { 46779 key: 'onDayMouseLeave', 46780 value: function () { 46781 function onDayMouseLeave() { 46782 var _state2 = this.state, 46783 hoverDate = _state2.hoverDate, 46784 visibleDays = _state2.visibleDays; 46785 46786 if (this.isTouchDevice || !hoverDate) return; 46787 46788 var modifiers = this.deleteModifier({}, hoverDate, 'hovered'); 46789 46790 this.setState({ 46791 hoverDate: null, 46792 visibleDays: (0, _object2['default'])({}, visibleDays, modifiers) 46793 }); 46794 } 46795 46796 return onDayMouseLeave; 46797 }() 46798 }, { 46799 key: 'onPrevMonthClick', 46800 value: function () { 46801 function onPrevMonthClick() { 46802 var _props3 = this.props, 46803 onPrevMonthClick = _props3.onPrevMonthClick, 46804 numberOfMonths = _props3.numberOfMonths, 46805 enableOutsideDays = _props3.enableOutsideDays; 46806 var _state3 = this.state, 46807 currentMonth = _state3.currentMonth, 46808 visibleDays = _state3.visibleDays; 46809 46810 46811 var newVisibleDays = {}; 46812 Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) { 46813 newVisibleDays[month] = visibleDays[month]; 46814 }); 46815 46816 var prevMonth = currentMonth.clone().subtract(1, 'month'); 46817 var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays); 46818 46819 this.setState({ 46820 currentMonth: prevMonth, 46821 visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays)) 46822 }, function () { 46823 onPrevMonthClick(prevMonth.clone()); 46824 }); 46825 } 46826 46827 return onPrevMonthClick; 46828 }() 46829 }, { 46830 key: 'onNextMonthClick', 46831 value: function () { 46832 function onNextMonthClick() { 46833 var _props4 = this.props, 46834 onNextMonthClick = _props4.onNextMonthClick, 46835 numberOfMonths = _props4.numberOfMonths, 46836 enableOutsideDays = _props4.enableOutsideDays; 46837 var _state4 = this.state, 46838 currentMonth = _state4.currentMonth, 46839 visibleDays = _state4.visibleDays; 46840 46841 46842 var newVisibleDays = {}; 46843 Object.keys(visibleDays).sort().slice(1).forEach(function (month) { 46844 newVisibleDays[month] = visibleDays[month]; 46845 }); 46846 46847 var nextMonth = currentMonth.clone().add(numberOfMonths, 'month'); 46848 var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays); 46849 46850 var newCurrentMonth = currentMonth.clone().add(1, 'month'); 46851 this.setState({ 46852 currentMonth: newCurrentMonth, 46853 visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays)) 46854 }, function () { 46855 onNextMonthClick(newCurrentMonth.clone()); 46856 }); 46857 } 46858 46859 return onNextMonthClick; 46860 }() 46861 }, { 46862 key: 'onMonthChange', 46863 value: function () { 46864 function onMonthChange(newMonth) { 46865 var _props5 = this.props, 46866 numberOfMonths = _props5.numberOfMonths, 46867 enableOutsideDays = _props5.enableOutsideDays, 46868 orientation = _props5.orientation; 46869 46870 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 46871 var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths); 46872 46873 this.setState({ 46874 currentMonth: newMonth.clone(), 46875 visibleDays: this.getModifiers(newVisibleDays) 46876 }); 46877 } 46878 46879 return onMonthChange; 46880 }() 46881 }, { 46882 key: 'onYearChange', 46883 value: function () { 46884 function onYearChange(newMonth) { 46885 var _props6 = this.props, 46886 numberOfMonths = _props6.numberOfMonths, 46887 enableOutsideDays = _props6.enableOutsideDays, 46888 orientation = _props6.orientation; 46889 46890 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 46891 var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths); 46892 46893 this.setState({ 46894 currentMonth: newMonth.clone(), 46895 visibleDays: this.getModifiers(newVisibleDays) 46896 }); 46897 } 46898 46899 return onYearChange; 46900 }() 46901 }, { 46902 key: 'getFirstFocusableDay', 46903 value: function () { 46904 function getFirstFocusableDay(newMonth) { 46905 var _this3 = this; 46906 46907 var _props7 = this.props, 46908 date = _props7.date, 46909 numberOfMonths = _props7.numberOfMonths; 46910 46911 46912 var focusedDate = newMonth.clone().startOf('month'); 46913 if (date) { 46914 focusedDate = date.clone(); 46915 } 46916 46917 if (this.isBlocked(focusedDate)) { 46918 var days = []; 46919 var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month'); 46920 var currentDay = focusedDate.clone(); 46921 while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) { 46922 currentDay = currentDay.clone().add(1, 'day'); 46923 days.push(currentDay); 46924 } 46925 46926 var viableDays = days.filter(function (day) { 46927 return !_this3.isBlocked(day) && (0, _isAfterDay2['default'])(day, focusedDate); 46928 }); 46929 if (viableDays.length > 0) { 46930 var _viableDays = _slicedToArray(viableDays, 1); 46931 46932 focusedDate = _viableDays[0]; 46933 } 46934 } 46935 46936 return focusedDate; 46937 } 46938 46939 return getFirstFocusableDay; 46940 }() 46941 }, { 46942 key: 'getModifiers', 46943 value: function () { 46944 function getModifiers(visibleDays) { 46945 var _this4 = this; 46946 46947 var modifiers = {}; 46948 Object.keys(visibleDays).forEach(function (month) { 46949 modifiers[month] = {}; 46950 visibleDays[month].forEach(function (day) { 46951 modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day); 46952 }); 46953 }); 46954 46955 return modifiers; 46956 } 46957 46958 return getModifiers; 46959 }() 46960 }, { 46961 key: 'getModifiersForDay', 46962 value: function () { 46963 function getModifiersForDay(day) { 46964 var _this5 = this; 46965 46966 return new Set(Object.keys(this.modifiers).filter(function (modifier) { 46967 return _this5.modifiers[modifier](day); 46968 })); 46969 } 46970 46971 return getModifiersForDay; 46972 }() 46973 }, { 46974 key: 'getStateForNewMonth', 46975 value: function () { 46976 function getStateForNewMonth(nextProps) { 46977 var _this6 = this; 46978 46979 var initialVisibleMonth = nextProps.initialVisibleMonth, 46980 date = nextProps.date, 46981 numberOfMonths = nextProps.numberOfMonths, 46982 enableOutsideDays = nextProps.enableOutsideDays; 46983 46984 var initialVisibleMonthThunk = initialVisibleMonth || (date ? function () { 46985 return date; 46986 } : function () { 46987 return _this6.today; 46988 }); 46989 var currentMonth = initialVisibleMonthThunk(); 46990 var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays)); 46991 return { currentMonth: currentMonth, visibleDays: visibleDays }; 46992 } 46993 46994 return getStateForNewMonth; 46995 }() 46996 }, { 46997 key: 'addModifier', 46998 value: function () { 46999 function addModifier(updatedDays, day, modifier) { 47000 var _props8 = this.props, 47001 numberOfVisibleMonths = _props8.numberOfMonths, 47002 enableOutsideDays = _props8.enableOutsideDays, 47003 orientation = _props8.orientation; 47004 var _state5 = this.state, 47005 firstVisibleMonth = _state5.currentMonth, 47006 visibleDays = _state5.visibleDays; 47007 47008 47009 var currentMonth = firstVisibleMonth; 47010 var numberOfMonths = numberOfVisibleMonths; 47011 if (orientation === _constants.VERTICAL_SCROLLABLE) { 47012 numberOfMonths = Object.keys(visibleDays).length; 47013 } else { 47014 currentMonth = currentMonth.clone().subtract(1, 'month'); 47015 numberOfMonths += 2; 47016 } 47017 if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) { 47018 return updatedDays; 47019 } 47020 47021 var iso = (0, _toISODateString2['default'])(day); 47022 47023 var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays); 47024 if (enableOutsideDays) { 47025 var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) { 47026 return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1; 47027 }); 47028 47029 updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) { 47030 var month = updatedDays[monthIso] || visibleDays[monthIso]; 47031 var modifiers = new Set(month[iso]); 47032 modifiers.add(modifier); 47033 return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 47034 }, updatedDaysAfterAddition); 47035 } else { 47036 var monthIso = (0, _toISOMonthString2['default'])(day); 47037 var month = updatedDays[monthIso] || visibleDays[monthIso]; 47038 47039 var modifiers = new Set(month[iso]); 47040 modifiers.add(modifier); 47041 updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 47042 } 47043 47044 return updatedDaysAfterAddition; 47045 } 47046 47047 return addModifier; 47048 }() 47049 }, { 47050 key: 'deleteModifier', 47051 value: function () { 47052 function deleteModifier(updatedDays, day, modifier) { 47053 var _props9 = this.props, 47054 numberOfVisibleMonths = _props9.numberOfMonths, 47055 enableOutsideDays = _props9.enableOutsideDays, 47056 orientation = _props9.orientation; 47057 var _state6 = this.state, 47058 firstVisibleMonth = _state6.currentMonth, 47059 visibleDays = _state6.visibleDays; 47060 47061 47062 var currentMonth = firstVisibleMonth; 47063 var numberOfMonths = numberOfVisibleMonths; 47064 if (orientation === _constants.VERTICAL_SCROLLABLE) { 47065 numberOfMonths = Object.keys(visibleDays).length; 47066 } else { 47067 currentMonth = currentMonth.clone().subtract(1, 'month'); 47068 numberOfMonths += 2; 47069 } 47070 if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) { 47071 return updatedDays; 47072 } 47073 47074 var iso = (0, _toISODateString2['default'])(day); 47075 47076 var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays); 47077 if (enableOutsideDays) { 47078 var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) { 47079 return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1; 47080 }); 47081 47082 updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) { 47083 var month = updatedDays[monthIso] || visibleDays[monthIso]; 47084 var modifiers = new Set(month[iso]); 47085 modifiers['delete'](modifier); 47086 return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 47087 }, updatedDaysAfterDeletion); 47088 } else { 47089 var monthIso = (0, _toISOMonthString2['default'])(day); 47090 var month = updatedDays[monthIso] || visibleDays[monthIso]; 47091 47092 var modifiers = new Set(month[iso]); 47093 modifiers['delete'](modifier); 47094 updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 47095 } 47096 47097 return updatedDaysAfterDeletion; 47098 } 47099 47100 return deleteModifier; 47101 }() 47102 }, { 47103 key: 'isBlocked', 47104 value: function () { 47105 function isBlocked(day) { 47106 var _props10 = this.props, 47107 isDayBlocked = _props10.isDayBlocked, 47108 isOutsideRange = _props10.isOutsideRange; 47109 47110 return isDayBlocked(day) || isOutsideRange(day); 47111 } 47112 47113 return isBlocked; 47114 }() 47115 }, { 47116 key: 'isHovered', 47117 value: function () { 47118 function isHovered(day) { 47119 var _ref = this.state || {}, 47120 hoverDate = _ref.hoverDate; 47121 47122 return (0, _isSameDay2['default'])(day, hoverDate); 47123 } 47124 47125 return isHovered; 47126 }() 47127 }, { 47128 key: 'isSelected', 47129 value: function () { 47130 function isSelected(day) { 47131 var date = this.props.date; 47132 47133 return (0, _isSameDay2['default'])(day, date); 47134 } 47135 47136 return isSelected; 47137 }() 47138 }, { 47139 key: 'isToday', 47140 value: function () { 47141 function isToday(day) { 47142 return (0, _isSameDay2['default'])(day, this.today); 47143 } 47144 47145 return isToday; 47146 }() 47147 }, { 47148 key: 'isFirstDayOfWeek', 47149 value: function () { 47150 function isFirstDayOfWeek(day) { 47151 var firstDayOfWeek = this.props.firstDayOfWeek; 47152 47153 return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()); 47154 } 47155 47156 return isFirstDayOfWeek; 47157 }() 47158 }, { 47159 key: 'isLastDayOfWeek', 47160 value: function () { 47161 function isLastDayOfWeek(day) { 47162 var firstDayOfWeek = this.props.firstDayOfWeek; 47163 47164 return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7; 47165 } 47166 47167 return isLastDayOfWeek; 47168 }() 47169 }, { 47170 key: 'render', 47171 value: function () { 47172 function render() { 47173 var _props11 = this.props, 47174 numberOfMonths = _props11.numberOfMonths, 47175 orientation = _props11.orientation, 47176 monthFormat = _props11.monthFormat, 47177 renderMonthText = _props11.renderMonthText, 47178 navPrev = _props11.navPrev, 47179 navNext = _props11.navNext, 47180 onOutsideClick = _props11.onOutsideClick, 47181 withPortal = _props11.withPortal, 47182 focused = _props11.focused, 47183 enableOutsideDays = _props11.enableOutsideDays, 47184 hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel, 47185 daySize = _props11.daySize, 47186 firstDayOfWeek = _props11.firstDayOfWeek, 47187 renderCalendarDay = _props11.renderCalendarDay, 47188 renderDayContents = _props11.renderDayContents, 47189 renderCalendarInfo = _props11.renderCalendarInfo, 47190 renderMonthElement = _props11.renderMonthElement, 47191 calendarInfoPosition = _props11.calendarInfoPosition, 47192 isFocused = _props11.isFocused, 47193 isRTL = _props11.isRTL, 47194 phrases = _props11.phrases, 47195 dayAriaLabelFormat = _props11.dayAriaLabelFormat, 47196 onBlur = _props11.onBlur, 47197 showKeyboardShortcuts = _props11.showKeyboardShortcuts, 47198 weekDayFormat = _props11.weekDayFormat, 47199 verticalHeight = _props11.verticalHeight, 47200 noBorder = _props11.noBorder, 47201 transitionDuration = _props11.transitionDuration, 47202 verticalBorderSpacing = _props11.verticalBorderSpacing, 47203 horizontalMonthPadding = _props11.horizontalMonthPadding; 47204 var _state7 = this.state, 47205 currentMonth = _state7.currentMonth, 47206 visibleDays = _state7.visibleDays; 47207 47208 47209 return _react2['default'].createElement(_DayPicker2['default'], { 47210 orientation: orientation, 47211 enableOutsideDays: enableOutsideDays, 47212 modifiers: visibleDays, 47213 numberOfMonths: numberOfMonths, 47214 onDayClick: this.onDayClick, 47215 onDayMouseEnter: this.onDayMouseEnter, 47216 onDayMouseLeave: this.onDayMouseLeave, 47217 onPrevMonthClick: this.onPrevMonthClick, 47218 onNextMonthClick: this.onNextMonthClick, 47219 onMonthChange: this.onMonthChange, 47220 onYearChange: this.onYearChange, 47221 monthFormat: monthFormat, 47222 withPortal: withPortal, 47223 hidden: !focused, 47224 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 47225 initialVisibleMonth: function () { 47226 function initialVisibleMonth() { 47227 return currentMonth; 47228 } 47229 47230 return initialVisibleMonth; 47231 }(), 47232 firstDayOfWeek: firstDayOfWeek, 47233 onOutsideClick: onOutsideClick, 47234 navPrev: navPrev, 47235 navNext: navNext, 47236 renderMonthText: renderMonthText, 47237 renderCalendarDay: renderCalendarDay, 47238 renderDayContents: renderDayContents, 47239 renderCalendarInfo: renderCalendarInfo, 47240 renderMonthElement: renderMonthElement, 47241 calendarInfoPosition: calendarInfoPosition, 47242 isFocused: isFocused, 47243 getFirstFocusableDay: this.getFirstFocusableDay, 47244 onBlur: onBlur, 47245 phrases: phrases, 47246 daySize: daySize, 47247 isRTL: isRTL, 47248 showKeyboardShortcuts: showKeyboardShortcuts, 47249 weekDayFormat: weekDayFormat, 47250 dayAriaLabelFormat: dayAriaLabelFormat, 47251 verticalHeight: verticalHeight, 47252 noBorder: noBorder, 47253 transitionDuration: transitionDuration, 47254 verticalBorderSpacing: verticalBorderSpacing, 47255 horizontalMonthPadding: horizontalMonthPadding 47256 }); 47257 } 47258 47259 return render; 47260 }() 47261 }]); 47262 47263 return DayPickerSingleDateController; 47264 }(_react2['default'].Component); 47265 47266 exports['default'] = DayPickerSingleDateController; 47267 47268 47269 DayPickerSingleDateController.propTypes = propTypes; 47270 DayPickerSingleDateController.defaultProps = defaultProps; 47271 47272 /***/ }), 47273 47274 /***/ "YLtl": 47275 /***/ (function(module, exports) { 47276 47277 (function() { module.exports = window["lodash"]; }()); 47278 47279 /***/ }), 47280 47281 /***/ "YZDV": 47282 /***/ (function(module, exports, __webpack_require__) { 47283 47284 "use strict"; 47285 /** 47286 * Copyright (c) 2013-present, Facebook, Inc. 47287 * 47288 * This source code is licensed under the MIT license found in the 47289 * LICENSE file in the root directory of this source tree. 47290 * 47291 * @providesModule shallowCompare 47292 */ 47293 47294 47295 47296 var hasOwnProperty = Object.prototype.hasOwnProperty; 47297 47298 /** 47299 * inlined Object.is polyfill to avoid requiring consumers ship their own 47300 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is 47301 */ 47302 function is(x, y) { 47303 // SameValue algorithm 47304 if (x === y) { 47305 // Steps 1-5, 7-10 47306 // Steps 6.b-6.e: +0 != -0 47307 // Added the nonzero y check to make Flow happy, but it is redundant 47308 return x !== 0 || y !== 0 || 1 / x === 1 / y; 47309 } else { 47310 // Step 6.a: NaN == NaN 47311 return x !== x && y !== y; 47312 } 47313 } 47314 47315 /** 47316 * Performs equality by iterating through keys on an object and returning false 47317 * when any key has values which are not strictly equal between the arguments. 47318 * Returns true when the values of all keys are strictly equal. 47319 */ 47320 function shallowEqual(objA, objB) { 47321 if (is(objA, objB)) { 47322 return true; 47323 } 47324 47325 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { 47326 return false; 47327 } 47328 47329 var keysA = Object.keys(objA); 47330 var keysB = Object.keys(objB); 47331 47332 if (keysA.length !== keysB.length) { 47333 return false; 47334 } 47335 47336 // Test for A's keys different from B. 47337 for (var i = 0; i < keysA.length; i++) { 47338 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { 47339 return false; 47340 } 47341 } 47342 47343 return true; 47344 } 47345 47346 /** 47347 * Does a shallow comparison for props and state. 47348 * See ReactComponentWithPureRenderMixin 47349 * See also https://facebook.github.io/react/docs/shallow-compare.html 47350 */ 47351 function shallowCompare(instance, nextProps, nextState) { 47352 return ( 47353 !shallowEqual(instance.props, nextProps) || 47354 !shallowEqual(instance.state, nextState) 47355 ); 47356 } 47357 47358 module.exports = shallowCompare; 47359 47360 47361 /***/ }), 47362 47363 /***/ "Z23Y": 47364 /***/ (function(module, exports) { 47365 47366 (function() { module.exports = window["wp"]["warning"]; }()); 47367 47368 /***/ }), 47369 47370 /***/ "ZO3Q": 47371 /***/ (function(module, exports, __webpack_require__) { 47372 47373 "use strict"; 47374 47375 47376 Object.defineProperty(exports, '__esModule', { value: true }); 47377 47378 function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } 47379 47380 var _extends = _interopDefault(__webpack_require__("pVnL")); 47381 var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__("8OQS")); 47382 var React = __webpack_require__("cDcd"); 47383 var React__default = _interopDefault(React); 47384 var _inheritsLoose = _interopDefault(__webpack_require__("VbXa")); 47385 var _assertThisInitialized = _interopDefault(__webpack_require__("PJYZ")); 47386 47387 var is = { 47388 arr: Array.isArray, 47389 obj: function obj(a) { 47390 return Object.prototype.toString.call(a) === '[object Object]'; 47391 }, 47392 fun: function fun(a) { 47393 return typeof a === 'function'; 47394 }, 47395 str: function str(a) { 47396 return typeof a === 'string'; 47397 }, 47398 num: function num(a) { 47399 return typeof a === 'number'; 47400 }, 47401 und: function und(a) { 47402 return a === void 0; 47403 }, 47404 nul: function nul(a) { 47405 return a === null; 47406 }, 47407 set: function set(a) { 47408 return a instanceof Set; 47409 }, 47410 map: function map(a) { 47411 return a instanceof Map; 47412 }, 47413 equ: function equ(a, b) { 47414 if (typeof a !== typeof b) return false; 47415 if (is.str(a) || is.num(a)) return a === b; 47416 if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true; 47417 var i; 47418 47419 for (i in a) { 47420 if (!(i in b)) return false; 47421 } 47422 47423 for (i in b) { 47424 if (a[i] !== b[i]) return false; 47425 } 47426 47427 return is.und(i) ? a === b : true; 47428 } 47429 }; 47430 function merge(target, lowercase) { 47431 if (lowercase === void 0) { 47432 lowercase = true; 47433 } 47434 47435 return function (object) { 47436 return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) { 47437 var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element; 47438 acc[key] = target(key); 47439 return acc; 47440 }, target); 47441 }; 47442 } 47443 function useForceUpdate() { 47444 var _useState = React.useState(false), 47445 f = _useState[1]; 47446 47447 var forceUpdate = React.useCallback(function () { 47448 return f(function (v) { 47449 return !v; 47450 }); 47451 }, []); 47452 return forceUpdate; 47453 } 47454 function withDefault(value, defaultValue) { 47455 return is.und(value) || is.nul(value) ? defaultValue : value; 47456 } 47457 function toArray(a) { 47458 return !is.und(a) ? is.arr(a) ? a : [a] : []; 47459 } 47460 function callProp(obj) { 47461 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 47462 args[_key - 1] = arguments[_key]; 47463 } 47464 47465 return is.fun(obj) ? obj.apply(void 0, args) : obj; 47466 } 47467 47468 function getForwardProps(props) { 47469 var to = props.to, 47470 from = props.from, 47471 config = props.config, 47472 onStart = props.onStart, 47473 onRest = props.onRest, 47474 onFrame = props.onFrame, 47475 children = props.children, 47476 reset = props.reset, 47477 reverse = props.reverse, 47478 force = props.force, 47479 immediate = props.immediate, 47480 delay = props.delay, 47481 attach = props.attach, 47482 destroyed = props.destroyed, 47483 interpolateTo = props.interpolateTo, 47484 ref = props.ref, 47485 lazy = props.lazy, 47486 forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]); 47487 47488 return forward; 47489 } 47490 47491 function interpolateTo(props) { 47492 var forward = getForwardProps(props); 47493 if (is.und(forward)) return _extends({ 47494 to: forward 47495 }, props); 47496 var rest = Object.keys(props).reduce(function (a, k) { 47497 var _extends2; 47498 47499 return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2)); 47500 }, {}); 47501 return _extends({ 47502 to: forward 47503 }, rest); 47504 } 47505 function handleRef(ref, forward) { 47506 if (forward) { 47507 // If it's a function, assume it's a ref callback 47508 if (is.fun(forward)) forward(ref);else if (is.obj(forward)) { 47509 forward.current = ref; 47510 } 47511 } 47512 47513 return ref; 47514 } 47515 47516 var Animated = 47517 /*#__PURE__*/ 47518 function () { 47519 function Animated() { 47520 this.payload = void 0; 47521 this.children = []; 47522 } 47523 47524 var _proto = Animated.prototype; 47525 47526 _proto.getAnimatedValue = function getAnimatedValue() { 47527 return this.getValue(); 47528 }; 47529 47530 _proto.getPayload = function getPayload() { 47531 return this.payload || this; 47532 }; 47533 47534 _proto.attach = function attach() {}; 47535 47536 _proto.detach = function detach() {}; 47537 47538 _proto.getChildren = function getChildren() { 47539 return this.children; 47540 }; 47541 47542 _proto.addChild = function addChild(child) { 47543 if (this.children.length === 0) this.attach(); 47544 this.children.push(child); 47545 }; 47546 47547 _proto.removeChild = function removeChild(child) { 47548 var index = this.children.indexOf(child); 47549 this.children.splice(index, 1); 47550 if (this.children.length === 0) this.detach(); 47551 }; 47552 47553 return Animated; 47554 }(); 47555 var AnimatedArray = 47556 /*#__PURE__*/ 47557 function (_Animated) { 47558 _inheritsLoose(AnimatedArray, _Animated); 47559 47560 function AnimatedArray() { 47561 var _this; 47562 47563 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 47564 args[_key] = arguments[_key]; 47565 } 47566 47567 _this = _Animated.call.apply(_Animated, [this].concat(args)) || this; 47568 _this.payload = []; 47569 47570 _this.attach = function () { 47571 return _this.payload.forEach(function (p) { 47572 return p instanceof Animated && p.addChild(_assertThisInitialized(_this)); 47573 }); 47574 }; 47575 47576 _this.detach = function () { 47577 return _this.payload.forEach(function (p) { 47578 return p instanceof Animated && p.removeChild(_assertThisInitialized(_this)); 47579 }); 47580 }; 47581 47582 return _this; 47583 } 47584 47585 return AnimatedArray; 47586 }(Animated); 47587 var AnimatedObject = 47588 /*#__PURE__*/ 47589 function (_Animated2) { 47590 _inheritsLoose(AnimatedObject, _Animated2); 47591 47592 function AnimatedObject() { 47593 var _this2; 47594 47595 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 47596 args[_key3] = arguments[_key3]; 47597 } 47598 47599 _this2 = _Animated2.call.apply(_Animated2, [this].concat(args)) || this; 47600 _this2.payload = {}; 47601 47602 _this2.attach = function () { 47603 return Object.values(_this2.payload).forEach(function (s) { 47604 return s instanceof Animated && s.addChild(_assertThisInitialized(_this2)); 47605 }); 47606 }; 47607 47608 _this2.detach = function () { 47609 return Object.values(_this2.payload).forEach(function (s) { 47610 return s instanceof Animated && s.removeChild(_assertThisInitialized(_this2)); 47611 }); 47612 }; 47613 47614 return _this2; 47615 } 47616 47617 var _proto2 = AnimatedObject.prototype; 47618 47619 _proto2.getValue = function getValue(animated) { 47620 if (animated === void 0) { 47621 animated = false; 47622 } 47623 47624 var payload = {}; 47625 47626 for (var _key4 in this.payload) { 47627 var value = this.payload[_key4]; 47628 if (animated && !(value instanceof Animated)) continue; 47629 payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value; 47630 } 47631 47632 return payload; 47633 }; 47634 47635 _proto2.getAnimatedValue = function getAnimatedValue() { 47636 return this.getValue(true); 47637 }; 47638 47639 return AnimatedObject; 47640 }(Animated); 47641 47642 var applyAnimatedValues; 47643 function injectApplyAnimatedValues(fn, transform) { 47644 applyAnimatedValues = { 47645 fn: fn, 47646 transform: transform 47647 }; 47648 } 47649 var colorNames; 47650 function injectColorNames(names) { 47651 colorNames = names; 47652 } 47653 var requestFrame = function requestFrame(cb) { 47654 return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1; 47655 }; 47656 var cancelFrame = function cancelFrame(id) { 47657 typeof window !== 'undefined' && window.cancelAnimationFrame(id); 47658 }; 47659 function injectFrame(raf, caf) { 47660 requestFrame = raf; 47661 cancelFrame = caf; 47662 } 47663 var interpolation; 47664 function injectStringInterpolator(fn) { 47665 interpolation = fn; 47666 } 47667 var now = function now() { 47668 return Date.now(); 47669 }; 47670 function injectNow(nowFn) { 47671 now = nowFn; 47672 } 47673 var defaultElement; 47674 function injectDefaultElement(el) { 47675 defaultElement = el; 47676 } 47677 var animatedApi = function animatedApi(node) { 47678 return node.current; 47679 }; 47680 function injectAnimatedApi(fn) { 47681 animatedApi = fn; 47682 } 47683 var createAnimatedStyle; 47684 function injectCreateAnimatedStyle(factory) { 47685 createAnimatedStyle = factory; 47686 } 47687 var manualFrameloop; 47688 function injectManualFrameloop(callback) { 47689 manualFrameloop = callback; 47690 } 47691 47692 var Globals = /*#__PURE__*/Object.freeze({ 47693 get applyAnimatedValues () { return applyAnimatedValues; }, 47694 injectApplyAnimatedValues: injectApplyAnimatedValues, 47695 get colorNames () { return colorNames; }, 47696 injectColorNames: injectColorNames, 47697 get requestFrame () { return requestFrame; }, 47698 get cancelFrame () { return cancelFrame; }, 47699 injectFrame: injectFrame, 47700 get interpolation () { return interpolation; }, 47701 injectStringInterpolator: injectStringInterpolator, 47702 get now () { return now; }, 47703 injectNow: injectNow, 47704 get defaultElement () { return defaultElement; }, 47705 injectDefaultElement: injectDefaultElement, 47706 get animatedApi () { return animatedApi; }, 47707 injectAnimatedApi: injectAnimatedApi, 47708 get createAnimatedStyle () { return createAnimatedStyle; }, 47709 injectCreateAnimatedStyle: injectCreateAnimatedStyle, 47710 get manualFrameloop () { return manualFrameloop; }, 47711 injectManualFrameloop: injectManualFrameloop 47712 }); 47713 47714 /** 47715 * Wraps the `style` property with `AnimatedStyle`. 47716 */ 47717 47718 var AnimatedProps = 47719 /*#__PURE__*/ 47720 function (_AnimatedObject) { 47721 _inheritsLoose(AnimatedProps, _AnimatedObject); 47722 47723 function AnimatedProps(props, callback) { 47724 var _this; 47725 47726 _this = _AnimatedObject.call(this) || this; 47727 _this.update = void 0; 47728 _this.payload = !props.style ? props : _extends({}, props, { 47729 style: createAnimatedStyle(props.style) 47730 }); 47731 _this.update = callback; 47732 47733 _this.attach(); 47734 47735 return _this; 47736 } 47737 47738 return AnimatedProps; 47739 }(AnimatedObject); 47740 47741 var isFunctionComponent = function isFunctionComponent(val) { 47742 return is.fun(val) && !(val.prototype instanceof React__default.Component); 47743 }; 47744 47745 var createAnimatedComponent = function createAnimatedComponent(Component) { 47746 var AnimatedComponent = React.forwardRef(function (props, ref) { 47747 var forceUpdate = useForceUpdate(); 47748 var mounted = React.useRef(true); 47749 var propsAnimated = React.useRef(null); 47750 var node = React.useRef(null); 47751 var attachProps = React.useCallback(function (props) { 47752 var oldPropsAnimated = propsAnimated.current; 47753 47754 var callback = function callback() { 47755 var didUpdate = false; 47756 47757 if (node.current) { 47758 didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue()); 47759 } 47760 47761 if (!node.current || didUpdate === false) { 47762 // If no referenced node has been found, or the update target didn't have a 47763 // native-responder, then forceUpdate the animation ... 47764 forceUpdate(); 47765 } 47766 }; 47767 47768 propsAnimated.current = new AnimatedProps(props, callback); 47769 oldPropsAnimated && oldPropsAnimated.detach(); 47770 }, []); 47771 React.useEffect(function () { 47772 return function () { 47773 mounted.current = false; 47774 propsAnimated.current && propsAnimated.current.detach(); 47775 }; 47776 }, []); 47777 React.useImperativeHandle(ref, function () { 47778 return animatedApi(node, mounted, forceUpdate); 47779 }); 47780 attachProps(props); 47781 47782 var _getValue = propsAnimated.current.getValue(), 47783 scrollTop = _getValue.scrollTop, 47784 scrollLeft = _getValue.scrollLeft, 47785 animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see: 47786 // See: https://github.com/react-spring/react-spring/issues/569 47787 47788 47789 var refFn = isFunctionComponent(Component) ? undefined : function (childRef) { 47790 return node.current = handleRef(childRef, ref); 47791 }; 47792 return React__default.createElement(Component, _extends({}, animatedProps, { 47793 ref: refFn 47794 })); 47795 }); 47796 return AnimatedComponent; 47797 }; 47798 47799 var active = false; 47800 var controllers = new Set(); 47801 47802 var update = function update() { 47803 if (!active) return false; 47804 var time = now(); 47805 47806 for (var _iterator = controllers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 47807 var _ref; 47808 47809 if (_isArray) { 47810 if (_i >= _iterator.length) break; 47811 _ref = _iterator[_i++]; 47812 } else { 47813 _i = _iterator.next(); 47814 if (_i.done) break; 47815 _ref = _i.value; 47816 } 47817 47818 var controller = _ref; 47819 var isActive = false; 47820 47821 for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) { 47822 var config = controller.configs[configIdx]; 47823 var endOfAnimation = void 0, 47824 lastTime = void 0; 47825 47826 for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) { 47827 var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude 47828 47829 if (animation.done) continue; 47830 var from = config.fromValues[valIdx]; 47831 var to = config.toValues[valIdx]; 47832 var position = animation.lastPosition; 47833 var isAnimated = to instanceof Animated; 47834 var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity; 47835 if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state 47836 47837 if (config.immediate) { 47838 animation.setValue(to); 47839 animation.done = true; 47840 continue; 47841 } // Break animation when string values are involved 47842 47843 47844 if (typeof from === 'string' || typeof to === 'string') { 47845 animation.setValue(to); 47846 animation.done = true; 47847 continue; 47848 } 47849 47850 if (config.duration !== void 0) { 47851 /** Duration easing */ 47852 position = from + config.easing((time - animation.startTime) / config.duration) * (to - from); 47853 endOfAnimation = time >= animation.startTime + config.duration; 47854 } else if (config.decay) { 47855 /** Decay easing */ 47856 position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime))); 47857 endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1; 47858 if (endOfAnimation) to = position; 47859 } else { 47860 /** Spring easing */ 47861 lastTime = animation.lastTime !== void 0 ? animation.lastTime : time; 47862 velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end. 47863 47864 if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/ 47865 47866 var numSteps = Math.floor(time - lastTime); 47867 47868 for (var i = 0; i < numSteps; ++i) { 47869 var force = -config.tension * (position - to); 47870 var damping = -config.friction * velocity; 47871 var acceleration = (force + damping) / config.mass; 47872 velocity = velocity + acceleration * 1 / 1000; 47873 position = position + velocity * 1 / 1000; 47874 } // Conditions for stopping the spring animation 47875 47876 47877 var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false; 47878 var isVelocity = Math.abs(velocity) <= config.precision; 47879 var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true; 47880 endOfAnimation = isOvershooting || isVelocity && isDisplacement; 47881 animation.lastVelocity = velocity; 47882 animation.lastTime = time; 47883 } // Trails aren't done until their parents conclude 47884 47885 47886 if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false; 47887 47888 if (endOfAnimation) { 47889 // Ensure that we end up with a round value 47890 if (animation.value !== to) position = to; 47891 animation.done = true; 47892 } else isActive = true; 47893 47894 animation.setValue(position); 47895 animation.lastPosition = position; 47896 } // Keep track of updated values only when necessary 47897 47898 47899 if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue(); 47900 } // Update callbacks in the end of the frame 47901 47902 47903 if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame 47904 47905 if (!isActive) { 47906 controllers.delete(controller); 47907 controller.stop(true); 47908 } 47909 } // Loop over as long as there are controllers ... 47910 47911 47912 if (controllers.size) { 47913 if (manualFrameloop) manualFrameloop();else requestFrame(update); 47914 } else { 47915 active = false; 47916 } 47917 47918 return active; 47919 }; 47920 47921 var start = function start(controller) { 47922 if (!controllers.has(controller)) controllers.add(controller); 47923 47924 if (!active) { 47925 active = true; 47926 if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update); 47927 } 47928 }; 47929 47930 var stop = function stop(controller) { 47931 if (controllers.has(controller)) controllers.delete(controller); 47932 }; 47933 47934 function createInterpolator(range, output, extrapolate) { 47935 if (typeof range === 'function') { 47936 return range; 47937 } 47938 47939 if (Array.isArray(range)) { 47940 return createInterpolator({ 47941 range: range, 47942 output: output, 47943 extrapolate: extrapolate 47944 }); 47945 } 47946 47947 if (interpolation && typeof range.output[0] === 'string') { 47948 return interpolation(range); 47949 } 47950 47951 var config = range; 47952 var outputRange = config.output; 47953 var inputRange = config.range || [0, 1]; 47954 var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend'; 47955 var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend'; 47956 47957 var easing = config.easing || function (t) { 47958 return t; 47959 }; 47960 47961 return function (input) { 47962 var range = findRange(input, inputRange); 47963 return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map); 47964 }; 47965 } 47966 47967 function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) { 47968 var result = map ? map(input) : input; // Extrapolate 47969 47970 if (result < inputMin) { 47971 if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin; 47972 } 47973 47974 if (result > inputMax) { 47975 if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax; 47976 } 47977 47978 if (outputMin === outputMax) return outputMin; 47979 if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range 47980 47981 if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing 47982 47983 result = easing(result); // Output Range 47984 47985 if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin; 47986 return result; 47987 } 47988 47989 function findRange(input, inputRange) { 47990 for (var i = 1; i < inputRange.length - 1; ++i) { 47991 if (inputRange[i] >= input) break; 47992 } 47993 47994 return i - 1; 47995 } 47996 47997 var AnimatedInterpolation = 47998 /*#__PURE__*/ 47999 function (_AnimatedArray) { 48000 _inheritsLoose(AnimatedInterpolation, _AnimatedArray); 48001 48002 function AnimatedInterpolation(parents, range, output, extrapolate) { 48003 var _this; 48004 48005 _this = _AnimatedArray.call(this) || this; 48006 _this.calc = void 0; 48007 _this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents]; 48008 _this.calc = createInterpolator(range, output, extrapolate); 48009 return _this; 48010 } 48011 48012 var _proto = AnimatedInterpolation.prototype; 48013 48014 _proto.getValue = function getValue() { 48015 return this.calc.apply(this, this.payload.map(function (value) { 48016 return value.getValue(); 48017 })); 48018 }; 48019 48020 _proto.updateConfig = function updateConfig(range, output, extrapolate) { 48021 this.calc = createInterpolator(range, output, extrapolate); 48022 }; 48023 48024 _proto.interpolate = function interpolate(range, output, extrapolate) { 48025 return new AnimatedInterpolation(this, range, output, extrapolate); 48026 }; 48027 48028 return AnimatedInterpolation; 48029 }(AnimatedArray); 48030 48031 var interpolate$1 = function interpolate(parents, range, output) { 48032 return parents && new AnimatedInterpolation(parents, range, output); 48033 }; 48034 48035 var config = { 48036 default: { 48037 tension: 170, 48038 friction: 26 48039 }, 48040 gentle: { 48041 tension: 120, 48042 friction: 14 48043 }, 48044 wobbly: { 48045 tension: 180, 48046 friction: 12 48047 }, 48048 stiff: { 48049 tension: 210, 48050 friction: 20 48051 }, 48052 slow: { 48053 tension: 280, 48054 friction: 60 48055 }, 48056 molasses: { 48057 tension: 280, 48058 friction: 120 48059 } 48060 }; 48061 48062 /** API 48063 * useChain(references, timeSteps, timeFrame) 48064 */ 48065 48066 function useChain(refs, timeSteps, timeFrame) { 48067 if (timeFrame === void 0) { 48068 timeFrame = 1000; 48069 } 48070 48071 var previous = React.useRef(); 48072 React.useEffect(function () { 48073 if (is.equ(refs, previous.current)) refs.forEach(function (_ref) { 48074 var current = _ref.current; 48075 return current && current.start(); 48076 });else if (timeSteps) { 48077 refs.forEach(function (_ref2, index) { 48078 var current = _ref2.current; 48079 48080 if (current) { 48081 var ctrls = current.controllers; 48082 48083 if (ctrls.length) { 48084 var t = timeFrame * timeSteps[index]; 48085 ctrls.forEach(function (ctrl) { 48086 ctrl.queue = ctrl.queue.map(function (e) { 48087 return _extends({}, e, { 48088 delay: e.delay + t 48089 }); 48090 }); 48091 ctrl.start(); 48092 }); 48093 } 48094 } 48095 }); 48096 } else refs.reduce(function (q, _ref3, rI) { 48097 var current = _ref3.current; 48098 return q = q.then(function () { 48099 return current.start(); 48100 }); 48101 }, Promise.resolve()); 48102 previous.current = refs; 48103 }); 48104 } 48105 48106 /** 48107 * Animated works by building a directed acyclic graph of dependencies 48108 * transparently when you render your Animated components. 48109 * 48110 * new Animated.Value(0) 48111 * .interpolate() .interpolate() new Animated.Value(1) 48112 * opacity translateY scale 48113 * style transform 48114 * View#234 style 48115 * View#123 48116 * 48117 * A) Top Down phase 48118 * When an AnimatedValue is updated, we recursively go down through this 48119 * graph in order to find leaf nodes: the views that we flag as needing 48120 * an update. 48121 * 48122 * B) Bottom Up phase 48123 * When a view is flagged as needing an update, we recursively go back up 48124 * in order to build the new value that it needs. The reason why we need 48125 * this two-phases process is to deal with composite props such as 48126 * transform which can receive values from multiple parents. 48127 */ 48128 function addAnimatedStyles(node, styles) { 48129 if ('update' in node) { 48130 styles.add(node); 48131 } else { 48132 node.getChildren().forEach(function (child) { 48133 return addAnimatedStyles(child, styles); 48134 }); 48135 } 48136 } 48137 48138 var AnimatedValue = 48139 /*#__PURE__*/ 48140 function (_Animated) { 48141 _inheritsLoose(AnimatedValue, _Animated); 48142 48143 function AnimatedValue(_value) { 48144 var _this; 48145 48146 _this = _Animated.call(this) || this; 48147 _this.animatedStyles = new Set(); 48148 _this.value = void 0; 48149 _this.startPosition = void 0; 48150 _this.lastPosition = void 0; 48151 _this.lastVelocity = void 0; 48152 _this.startTime = void 0; 48153 _this.lastTime = void 0; 48154 _this.done = false; 48155 48156 _this.setValue = function (value, flush) { 48157 if (flush === void 0) { 48158 flush = true; 48159 } 48160 48161 _this.value = value; 48162 if (flush) _this.flush(); 48163 }; 48164 48165 _this.value = _value; 48166 _this.startPosition = _value; 48167 _this.lastPosition = _value; 48168 return _this; 48169 } 48170 48171 var _proto = AnimatedValue.prototype; 48172 48173 _proto.flush = function flush() { 48174 if (this.animatedStyles.size === 0) { 48175 addAnimatedStyles(this, this.animatedStyles); 48176 } 48177 48178 this.animatedStyles.forEach(function (animatedStyle) { 48179 return animatedStyle.update(); 48180 }); 48181 }; 48182 48183 _proto.clearStyles = function clearStyles() { 48184 this.animatedStyles.clear(); 48185 }; 48186 48187 _proto.getValue = function getValue() { 48188 return this.value; 48189 }; 48190 48191 _proto.interpolate = function interpolate(range, output, extrapolate) { 48192 return new AnimatedInterpolation(this, range, output, extrapolate); 48193 }; 48194 48195 return AnimatedValue; 48196 }(Animated); 48197 48198 var AnimatedValueArray = 48199 /*#__PURE__*/ 48200 function (_AnimatedArray) { 48201 _inheritsLoose(AnimatedValueArray, _AnimatedArray); 48202 48203 function AnimatedValueArray(values) { 48204 var _this; 48205 48206 _this = _AnimatedArray.call(this) || this; 48207 _this.payload = values.map(function (n) { 48208 return new AnimatedValue(n); 48209 }); 48210 return _this; 48211 } 48212 48213 var _proto = AnimatedValueArray.prototype; 48214 48215 _proto.setValue = function setValue(value, flush) { 48216 var _this2 = this; 48217 48218 if (flush === void 0) { 48219 flush = true; 48220 } 48221 48222 if (Array.isArray(value)) { 48223 if (value.length === this.payload.length) { 48224 value.forEach(function (v, i) { 48225 return _this2.payload[i].setValue(v, flush); 48226 }); 48227 } 48228 } else { 48229 this.payload.forEach(function (p) { 48230 return p.setValue(value, flush); 48231 }); 48232 } 48233 }; 48234 48235 _proto.getValue = function getValue() { 48236 return this.payload.map(function (v) { 48237 return v.getValue(); 48238 }); 48239 }; 48240 48241 _proto.interpolate = function interpolate(range, output) { 48242 return new AnimatedInterpolation(this, range, output); 48243 }; 48244 48245 return AnimatedValueArray; 48246 }(AnimatedArray); 48247 48248 var G = 0; 48249 48250 var Controller = 48251 /*#__PURE__*/ 48252 function () { 48253 function Controller() { 48254 var _this = this; 48255 48256 this.id = void 0; 48257 this.idle = true; 48258 this.hasChanged = false; 48259 this.guid = 0; 48260 this.local = 0; 48261 this.props = {}; 48262 this.merged = {}; 48263 this.animations = {}; 48264 this.interpolations = {}; 48265 this.values = {}; 48266 this.configs = []; 48267 this.listeners = []; 48268 this.queue = []; 48269 this.localQueue = void 0; 48270 48271 this.getValues = function () { 48272 return _this.interpolations; 48273 }; 48274 48275 this.id = G++; 48276 } 48277 /** update(props) 48278 * This function filters input props and creates an array of tasks which are executed in .start() 48279 * Each task is allowed to carry a delay, which means it can execute asnychroneously */ 48280 48281 48282 var _proto = Controller.prototype; 48283 48284 _proto.update = function update$$1(args) { 48285 //this._id = n + this.id 48286 if (!args) return this; // Extract delay and the to-prop from props 48287 48288 var _ref = interpolateTo(args), 48289 _ref$delay = _ref.delay, 48290 delay = _ref$delay === void 0 ? 0 : _ref$delay, 48291 to = _ref.to, 48292 props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]); 48293 48294 if (is.arr(to) || is.fun(to)) { 48295 // If config is either a function or an array queue it up as is 48296 this.queue.push(_extends({}, props, { 48297 delay: delay, 48298 to: to 48299 })); 48300 } else if (to) { 48301 // Otherwise go through each key since it could be delayed individually 48302 var ops = {}; 48303 Object.entries(to).forEach(function (_ref2) { 48304 var _to; 48305 48306 var k = _ref2[0], 48307 v = _ref2[1]; 48308 48309 // Fetch delay and create an entry, consisting of the to-props, the delay, and basic props 48310 var entry = _extends({ 48311 to: (_to = {}, _to[k] = v, _to), 48312 delay: callProp(delay, k) 48313 }, props); 48314 48315 var previous = ops[entry.delay] && ops[entry.delay].to; 48316 ops[entry.delay] = _extends({}, ops[entry.delay], entry, { 48317 to: _extends({}, previous, entry.to) 48318 }); 48319 }); 48320 this.queue = Object.values(ops); 48321 } // Sort queue, so that async calls go last 48322 48323 48324 this.queue = this.queue.sort(function (a, b) { 48325 return a.delay - b.delay; 48326 }); // Diff the reduced props immediately (they'll contain the from-prop and some config) 48327 48328 this.diff(props); 48329 return this; 48330 } 48331 /** start(onEnd) 48332 * This function either executes a queue, if present, or starts the frameloop, which animates */ 48333 ; 48334 48335 _proto.start = function start$$1(onEnd) { 48336 var _this2 = this; 48337 48338 // If a queue is present we must excecute it 48339 if (this.queue.length) { 48340 this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values 48341 48342 if (this.localQueue) { 48343 this.localQueue.forEach(function (_ref3) { 48344 var _ref3$from = _ref3.from, 48345 from = _ref3$from === void 0 ? {} : _ref3$from, 48346 _ref3$to = _ref3.to, 48347 to = _ref3$to === void 0 ? {} : _ref3$to; 48348 if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged); 48349 if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to); 48350 }); 48351 } // The guid helps us tracking frames, a new queue over an old one means an override 48352 // We discard async calls in that caseÍ 48353 48354 48355 var local = this.local = ++this.guid; 48356 var queue = this.localQueue = this.queue; 48357 this.queue = []; // Go through each entry and execute it 48358 48359 queue.forEach(function (_ref4, index) { 48360 var delay = _ref4.delay, 48361 props = _objectWithoutPropertiesLoose(_ref4, ["delay"]); 48362 48363 var cb = function cb(finished) { 48364 if (index === queue.length - 1 && local === _this2.guid && finished) { 48365 _this2.idle = true; 48366 if (_this2.props.onRest) _this2.props.onRest(_this2.merged); 48367 } 48368 48369 if (onEnd) onEnd(); 48370 }; // Entries can be delayed, ansyc or immediate 48371 48372 48373 var async = is.arr(props.to) || is.fun(props.to); 48374 48375 if (delay) { 48376 setTimeout(function () { 48377 if (local === _this2.guid) { 48378 if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb); 48379 } 48380 }, delay); 48381 } else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb); 48382 }); 48383 } // Otherwise we kick of the frameloop 48384 else { 48385 if (is.fun(onEnd)) this.listeners.push(onEnd); 48386 if (this.props.onStart) this.props.onStart(); 48387 48388 start(this); 48389 } 48390 48391 return this; 48392 }; 48393 48394 _proto.stop = function stop$$1(finished) { 48395 this.listeners.forEach(function (onEnd) { 48396 return onEnd(finished); 48397 }); 48398 this.listeners = []; 48399 return this; 48400 } 48401 /** Pause sets onEnd listeners free, but also removes the controller from the frameloop */ 48402 ; 48403 48404 _proto.pause = function pause(finished) { 48405 this.stop(true); 48406 if (finished) stop(this); 48407 return this; 48408 }; 48409 48410 _proto.runAsync = function runAsync(_ref5, onEnd) { 48411 var _this3 = this; 48412 48413 var delay = _ref5.delay, 48414 props = _objectWithoutPropertiesLoose(_ref5, ["delay"]); 48415 48416 var local = this.local; // If "to" is either a function or an array it will be processed async, therefor "to" should be empty right now 48417 // If the view relies on certain values "from" has to be present 48418 48419 var queue = Promise.resolve(undefined); 48420 48421 if (is.arr(props.to)) { 48422 var _loop = function _loop(i) { 48423 var index = i; 48424 48425 var fresh = _extends({}, props, interpolateTo(props.to[index])); 48426 48427 if (is.arr(fresh.config)) fresh.config = fresh.config[index]; 48428 queue = queue.then(function () { 48429 //this.stop() 48430 if (local === _this3.guid) return new Promise(function (r) { 48431 return _this3.diff(fresh).start(r); 48432 }); 48433 }); 48434 }; 48435 48436 for (var i = 0; i < props.to.length; i++) { 48437 _loop(i); 48438 } 48439 } else if (is.fun(props.to)) { 48440 var index = 0; 48441 var last; 48442 queue = queue.then(function () { 48443 return props.to( // next(props) 48444 function (p) { 48445 var fresh = _extends({}, props, interpolateTo(p)); 48446 48447 if (is.arr(fresh.config)) fresh.config = fresh.config[index]; 48448 index++; //this.stop() 48449 48450 if (local === _this3.guid) return last = new Promise(function (r) { 48451 return _this3.diff(fresh).start(r); 48452 }); 48453 return; 48454 }, // cancel() 48455 function (finished) { 48456 if (finished === void 0) { 48457 finished = true; 48458 } 48459 48460 return _this3.stop(finished); 48461 }).then(function () { 48462 return last; 48463 }); 48464 }); 48465 } 48466 48467 queue.then(onEnd); 48468 }; 48469 48470 _proto.diff = function diff(props) { 48471 var _this4 = this; 48472 48473 this.props = _extends({}, this.props, props); 48474 var _this$props = this.props, 48475 _this$props$from = _this$props.from, 48476 from = _this$props$from === void 0 ? {} : _this$props$from, 48477 _this$props$to = _this$props.to, 48478 to = _this$props$to === void 0 ? {} : _this$props$to, 48479 _this$props$config = _this$props.config, 48480 config = _this$props$config === void 0 ? {} : _this$props$config, 48481 reverse = _this$props.reverse, 48482 attach = _this$props.attach, 48483 reset = _this$props.reset, 48484 immediate = _this$props.immediate; // Reverse values when requested 48485 48486 if (reverse) { 48487 var _ref6 = [to, from]; 48488 from = _ref6[0]; 48489 to = _ref6[1]; 48490 } // This will collect all props that were ever set, reset merged props when necessary 48491 48492 48493 this.merged = _extends({}, from, this.merged, to); 48494 this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring 48495 48496 var target = attach && attach(this); // Reduces input { name: value } pairs into animated values 48497 48498 this.animations = Object.entries(this.merged).reduce(function (acc, _ref7) { 48499 var name = _ref7[0], 48500 value = _ref7[1]; 48501 // Issue cached entries, except on reset 48502 var entry = acc[name] || {}; // Figure out what the value is supposed to be 48503 48504 var isNumber = is.num(value); 48505 var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value]; 48506 var isArray = is.arr(value); 48507 var isInterpolation = !isNumber && !isArray && !isString; 48508 var fromValue = !is.und(from[name]) ? from[name] : value; 48509 var toValue = isNumber || isArray ? value : isString ? value : 1; 48510 var toConfig = callProp(config, name); 48511 if (target) toValue = target.animations[name].parent; 48512 var parent = entry.parent, 48513 interpolation$$1 = entry.interpolation, 48514 toValues = toArray(target ? toValue.getPayload() : toValue), 48515 animatedValues; 48516 var newValue = value; 48517 if (isInterpolation) newValue = interpolation({ 48518 range: [0, 1], 48519 output: [value, value] 48520 })(1); 48521 var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags 48522 48523 var isFirst = is.und(parent); 48524 var isActive = !isFirst && entry.animatedValues.some(function (v) { 48525 return !v.done; 48526 }); 48527 var currentValueDiffersFromGoal = !is.equ(newValue, currentValue); 48528 var hasNewGoal = !is.equ(newValue, entry.previous); 48529 var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one) 48530 // and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?) 48531 48532 if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) { 48533 var _extends2; 48534 48535 // Convert regular values into animated values, ALWAYS re-use if possible 48536 if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) { 48537 var prev = entry.interpolation && entry.interpolation.calc(entry.parent.value); 48538 prev = prev !== void 0 && !reset ? prev : fromValue; 48539 48540 if (entry.parent) { 48541 parent = entry.parent; 48542 parent.setValue(0, false); 48543 } else parent = new AnimatedValue(0); 48544 48545 var range = { 48546 output: [prev, value] 48547 }; 48548 48549 if (entry.interpolation) { 48550 interpolation$$1 = entry.interpolation; 48551 entry.interpolation.updateConfig(range); 48552 } else interpolation$$1 = parent.interpolate(range); 48553 } 48554 toValues = toArray(target ? toValue.getPayload() : toValue); 48555 animatedValues = toArray(parent.getPayload()); 48556 if (reset && !isInterpolation) parent.setValue(fromValue, false); 48557 _this4.hasChanged = true; // Reset animated values 48558 48559 animatedValues.forEach(function (value) { 48560 value.startPosition = value.value; 48561 value.lastPosition = value.value; 48562 value.lastVelocity = isActive ? value.lastVelocity : undefined; 48563 value.lastTime = isActive ? value.lastTime : undefined; 48564 value.startTime = now(); 48565 value.done = false; 48566 value.animatedStyles.clear(); 48567 }); // Set immediate values 48568 48569 if (callProp(immediate, name)) { 48570 parent.setValue(isInterpolation ? toValue : value, false); 48571 } 48572 48573 return _extends({}, acc, (_extends2 = {}, _extends2[name] = _extends({}, entry, { 48574 name: name, 48575 parent: parent, 48576 interpolation: interpolation$$1, 48577 animatedValues: animatedValues, 48578 toValues: toValues, 48579 previous: newValue, 48580 config: toConfig, 48581 fromValues: toArray(parent.getValue()), 48582 immediate: callProp(immediate, name), 48583 initialVelocity: withDefault(toConfig.velocity, 0), 48584 clamp: withDefault(toConfig.clamp, false), 48585 precision: withDefault(toConfig.precision, 0.01), 48586 tension: withDefault(toConfig.tension, 170), 48587 friction: withDefault(toConfig.friction, 26), 48588 mass: withDefault(toConfig.mass, 1), 48589 duration: toConfig.duration, 48590 easing: withDefault(toConfig.easing, function (t) { 48591 return t; 48592 }), 48593 decay: toConfig.decay 48594 }), _extends2)); 48595 } else { 48596 if (!currentValueDiffersFromGoal) { 48597 var _extends3; 48598 48599 // So ... the current target value (newValue) appears to be different from the previous value, 48600 // which normally constitutes an update, but the actual value (currentValue) matches the target! 48601 // In order to resolve this without causing an animation update we silently flag the animation as done, 48602 // which it technically is. Interpolations also needs a config update with their target set to 1. 48603 if (isInterpolation) { 48604 parent.setValue(1, false); 48605 interpolation$$1.updateConfig({ 48606 output: [newValue, newValue] 48607 }); 48608 } 48609 48610 parent.done = true; 48611 _this4.hasChanged = true; 48612 return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], { 48613 previous: newValue 48614 }), _extends3)); 48615 } 48616 48617 return acc; 48618 } 48619 }, this.animations); 48620 48621 if (this.hasChanged) { 48622 // Make animations available to frameloop 48623 this.configs = Object.values(this.animations); 48624 this.values = {}; 48625 this.interpolations = {}; 48626 48627 for (var key in this.animations) { 48628 this.interpolations[key] = this.animations[key].interpolation; 48629 this.values[key] = this.animations[key].interpolation.getValue(); 48630 } 48631 } 48632 48633 return this; 48634 }; 48635 48636 _proto.destroy = function destroy() { 48637 this.stop(); 48638 this.props = {}; 48639 this.merged = {}; 48640 this.animations = {}; 48641 this.interpolations = {}; 48642 this.values = {}; 48643 this.configs = []; 48644 this.local = 0; 48645 }; 48646 48647 return Controller; 48648 }(); 48649 48650 /** API 48651 * const props = useSprings(number, [{ ... }, { ... }, ...]) 48652 * const [props, set] = useSprings(number, (i, controller) => ({ ... })) 48653 */ 48654 48655 var useSprings = function useSprings(length, props) { 48656 var mounted = React.useRef(false); 48657 var ctrl = React.useRef(); 48658 var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations 48659 48660 var _useMemo = React.useMemo(function () { 48661 // Remove old controllers 48662 if (ctrl.current) { 48663 ctrl.current.map(function (c) { 48664 return c.destroy(); 48665 }); 48666 ctrl.current = undefined; 48667 } 48668 48669 var ref; 48670 return [new Array(length).fill().map(function (_, i) { 48671 var ctrl = new Controller(); 48672 var newProps = isFn ? callProp(props, i, ctrl) : props[i]; 48673 if (i === 0) ref = newProps.ref; 48674 ctrl.update(newProps); 48675 if (!ref) ctrl.start(); 48676 return ctrl; 48677 }), ref]; 48678 }, [length]), 48679 controllers = _useMemo[0], 48680 ref = _useMemo[1]; 48681 48682 ctrl.current = controllers; // The hooks reference api gets defined here ... 48683 48684 var api = React.useImperativeHandle(ref, function () { 48685 return { 48686 start: function start() { 48687 return Promise.all(ctrl.current.map(function (c) { 48688 return new Promise(function (r) { 48689 return c.start(r); 48690 }); 48691 })); 48692 }, 48693 stop: function stop(finished) { 48694 return ctrl.current.forEach(function (c) { 48695 return c.stop(finished); 48696 }); 48697 }, 48698 48699 get controllers() { 48700 return ctrl.current; 48701 } 48702 48703 }; 48704 }); // This function updates the controllers 48705 48706 var updateCtrl = React.useMemo(function () { 48707 return function (updateProps) { 48708 return ctrl.current.map(function (c, i) { 48709 c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]); 48710 if (!ref) c.start(); 48711 }); 48712 }; 48713 }, [length]); // Update controller if props aren't functional 48714 48715 React.useEffect(function () { 48716 if (mounted.current) { 48717 if (!isFn) updateCtrl(props); 48718 } else if (!ref) ctrl.current.forEach(function (c) { 48719 return c.start(); 48720 }); 48721 }); // Update mounted flag and destroy controller on unmount 48722 48723 React.useEffect(function () { 48724 return mounted.current = true, function () { 48725 return ctrl.current.forEach(function (c) { 48726 return c.destroy(); 48727 }); 48728 }; 48729 }, []); // Return animated props, or, anim-props + the update-setter above 48730 48731 var propValues = ctrl.current.map(function (c) { 48732 return c.getValues(); 48733 }); 48734 return isFn ? [propValues, updateCtrl, function (finished) { 48735 return ctrl.current.forEach(function (c) { 48736 return c.pause(finished); 48737 }); 48738 }] : propValues; 48739 }; 48740 48741 /** API 48742 * const props = useSpring({ ... }) 48743 * const [props, set] = useSpring(() => ({ ... })) 48744 */ 48745 48746 var useSpring = function useSpring(props) { 48747 var isFn = is.fun(props); 48748 48749 var _useSprings = useSprings(1, isFn ? props : [props]), 48750 result = _useSprings[0], 48751 set = _useSprings[1], 48752 pause = _useSprings[2]; 48753 48754 return isFn ? [result[0], set, pause] : result; 48755 }; 48756 48757 /** API 48758 * const trails = useTrail(number, { ... }) 48759 * const [trails, set] = useTrail(number, () => ({ ... })) 48760 */ 48761 48762 var useTrail = function useTrail(length, props) { 48763 var mounted = React.useRef(false); 48764 var isFn = is.fun(props); 48765 var updateProps = callProp(props); 48766 var instances = React.useRef(); 48767 48768 var _useSprings = useSprings(length, function (i, ctrl) { 48769 if (i === 0) instances.current = []; 48770 instances.current.push(ctrl); 48771 return _extends({}, updateProps, { 48772 config: callProp(updateProps.config, i), 48773 attach: i > 0 && function () { 48774 return instances.current[i - 1]; 48775 } 48776 }); 48777 }), 48778 result = _useSprings[0], 48779 set = _useSprings[1], 48780 pause = _useSprings[2]; // Set up function to update controller 48781 48782 48783 var updateCtrl = React.useMemo(function () { 48784 return function (props) { 48785 return set(function (i, ctrl) { 48786 var last = props.reverse ? i === 0 : length - 1 === i; 48787 var attachIdx = props.reverse ? i + 1 : i - 1; 48788 var attachController = instances.current[attachIdx]; 48789 return _extends({}, props, { 48790 config: callProp(props.config || updateProps.config, i), 48791 attach: attachController && function () { 48792 return attachController; 48793 } 48794 }); 48795 }); 48796 }; 48797 }, [length, updateProps.reverse]); // Update controller if props aren't functional 48798 48799 React.useEffect(function () { 48800 return void (mounted.current && !isFn && updateCtrl(props)); 48801 }); // Update mounted flag and destroy controller on unmount 48802 48803 React.useEffect(function () { 48804 return void (mounted.current = true); 48805 }, []); 48806 return isFn ? [result, updateCtrl, pause] : result; 48807 }; 48808 48809 /** API 48810 * const transitions = useTransition(items, itemKeys, { ... }) 48811 * const [transitions, update] = useTransition(items, itemKeys, () => ({ ... })) 48812 */ 48813 48814 var guid = 0; 48815 var ENTER = 'enter'; 48816 var LEAVE = 'leave'; 48817 var UPDATE = 'update'; 48818 48819 var mapKeys = function mapKeys(items, keys) { 48820 return (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String); 48821 }; 48822 48823 var get = function get(props) { 48824 var items = props.items, 48825 _props$keys = props.keys, 48826 keys = _props$keys === void 0 ? function (item) { 48827 return item; 48828 } : _props$keys, 48829 rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]); 48830 48831 items = toArray(items !== void 0 ? items : null); 48832 return _extends({ 48833 items: items, 48834 keys: mapKeys(items, keys) 48835 }, rest); 48836 }; 48837 48838 function useTransition(input, keyTransform, config) { 48839 var props = _extends({ 48840 items: input, 48841 keys: keyTransform || function (i) { 48842 return i; 48843 } 48844 }, config); 48845 48846 var _get = get(props), 48847 _get$lazy = _get.lazy, 48848 lazy = _get$lazy === void 0 ? false : _get$lazy, 48849 _get$unique = _get.unique, 48850 _get$reset = _get.reset, 48851 reset = _get$reset === void 0 ? false : _get$reset, 48852 enter = _get.enter, 48853 leave = _get.leave, 48854 update = _get.update, 48855 onDestroyed = _get.onDestroyed, 48856 keys = _get.keys, 48857 items = _get.items, 48858 onFrame = _get.onFrame, 48859 _onRest = _get.onRest, 48860 onStart = _get.onStart, 48861 ref = _get.ref, 48862 extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]); 48863 48864 var forceUpdate = useForceUpdate(); 48865 var mounted = React.useRef(false); 48866 var state = React.useRef({ 48867 mounted: false, 48868 first: true, 48869 deleted: [], 48870 current: {}, 48871 transitions: [], 48872 prevProps: {}, 48873 paused: !!props.ref, 48874 instances: !mounted.current && new Map(), 48875 forceUpdate: forceUpdate 48876 }); 48877 React.useImperativeHandle(props.ref, function () { 48878 return { 48879 start: function start() { 48880 return Promise.all(Array.from(state.current.instances).map(function (_ref) { 48881 var c = _ref[1]; 48882 return new Promise(function (r) { 48883 return c.start(r); 48884 }); 48885 })); 48886 }, 48887 stop: function stop(finished) { 48888 return Array.from(state.current.instances).forEach(function (_ref2) { 48889 var c = _ref2[1]; 48890 return c.stop(finished); 48891 }); 48892 }, 48893 48894 get controllers() { 48895 return Array.from(state.current.instances).map(function (_ref3) { 48896 var c = _ref3[1]; 48897 return c; 48898 }); 48899 } 48900 48901 }; 48902 }); // Update state 48903 48904 state.current = diffItems(state.current, props); 48905 48906 if (state.current.changed) { 48907 // Update state 48908 state.current.transitions.forEach(function (transition) { 48909 var slot = transition.slot, 48910 from = transition.from, 48911 to = transition.to, 48912 config = transition.config, 48913 trail = transition.trail, 48914 key = transition.key, 48915 item = transition.item; 48916 if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object 48917 48918 var ctrl = state.current.instances.get(key); 48919 48920 var newProps = _extends({}, extra, { 48921 to: to, 48922 from: from, 48923 config: config, 48924 ref: ref, 48925 onRest: function onRest(values) { 48926 if (state.current.mounted) { 48927 if (transition.destroyed) { 48928 // If no ref is given delete destroyed items immediately 48929 if (!ref && !lazy) cleanUp(state, key); 48930 if (onDestroyed) onDestroyed(item); 48931 } // A transition comes to rest once all its springs conclude 48932 48933 48934 var curInstances = Array.from(state.current.instances); 48935 var active = curInstances.some(function (_ref4) { 48936 var c = _ref4[1]; 48937 return !c.idle; 48938 }); 48939 if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state); 48940 if (_onRest) _onRest(item, slot, values); 48941 } 48942 }, 48943 onStart: onStart && function () { 48944 return onStart(item, slot); 48945 }, 48946 onFrame: onFrame && function (values) { 48947 return onFrame(item, slot, values); 48948 }, 48949 delay: trail, 48950 reset: reset && slot === ENTER // Update controller 48951 48952 }); 48953 48954 ctrl.update(newProps); 48955 if (!state.current.paused) ctrl.start(); 48956 }); 48957 } 48958 48959 React.useEffect(function () { 48960 state.current.mounted = mounted.current = true; 48961 return function () { 48962 state.current.mounted = mounted.current = false; 48963 Array.from(state.current.instances).map(function (_ref5) { 48964 var c = _ref5[1]; 48965 return c.destroy(); 48966 }); 48967 state.current.instances.clear(); 48968 }; 48969 }, []); 48970 return state.current.transitions.map(function (_ref6) { 48971 var item = _ref6.item, 48972 slot = _ref6.slot, 48973 key = _ref6.key; 48974 return { 48975 item: item, 48976 key: key, 48977 state: slot, 48978 props: state.current.instances.get(key).getValues() 48979 }; 48980 }); 48981 } 48982 48983 function cleanUp(state, filterKey) { 48984 var deleted = state.current.deleted; 48985 48986 var _loop = function _loop() { 48987 if (_isArray) { 48988 if (_i >= _iterator.length) return "break"; 48989 _ref8 = _iterator[_i++]; 48990 } else { 48991 _i = _iterator.next(); 48992 if (_i.done) return "break"; 48993 _ref8 = _i.value; 48994 } 48995 48996 var _ref7 = _ref8; 48997 var key = _ref7.key; 48998 48999 var filter = function filter(t) { 49000 return t.key !== key; 49001 }; 49002 49003 if (is.und(filterKey) || filterKey === key) { 49004 state.current.instances.delete(key); 49005 state.current.transitions = state.current.transitions.filter(filter); 49006 state.current.deleted = state.current.deleted.filter(filter); 49007 } 49008 }; 49009 49010 for (var _iterator = deleted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 49011 var _ref8; 49012 49013 var _ret = _loop(); 49014 49015 if (_ret === "break") break; 49016 } 49017 49018 state.current.forceUpdate(); 49019 } 49020 49021 function diffItems(_ref9, props) { 49022 var first = _ref9.first, 49023 prevProps = _ref9.prevProps, 49024 state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]); 49025 49026 var _get2 = get(props), 49027 items = _get2.items, 49028 keys = _get2.keys, 49029 initial = _get2.initial, 49030 from = _get2.from, 49031 enter = _get2.enter, 49032 leave = _get2.leave, 49033 update = _get2.update, 49034 _get2$trail = _get2.trail, 49035 trail = _get2$trail === void 0 ? 0 : _get2$trail, 49036 unique = _get2.unique, 49037 config = _get2.config, 49038 _get2$order = _get2.order, 49039 order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order; 49040 49041 var _get3 = get(prevProps), 49042 _keys = _get3.keys, 49043 _items = _get3.items; 49044 49045 var current = _extends({}, state.current); 49046 49047 var deleted = [].concat(state.deleted); // Compare next keys with current keys 49048 49049 var currentKeys = Object.keys(current); 49050 var currentSet = new Set(currentKeys); 49051 var nextSet = new Set(keys); 49052 var added = keys.filter(function (item) { 49053 return !currentSet.has(item); 49054 }); 49055 var removed = state.transitions.filter(function (item) { 49056 return !item.destroyed && !nextSet.has(item.originalKey); 49057 }).map(function (i) { 49058 return i.originalKey; 49059 }); 49060 var updated = keys.filter(function (item) { 49061 return currentSet.has(item); 49062 }); 49063 var delay = -trail; 49064 49065 while (order.length) { 49066 var changeType = order.shift(); 49067 49068 switch (changeType) { 49069 case ENTER: 49070 { 49071 added.forEach(function (key, index) { 49072 // In unique mode, remove fading out transitions if their key comes in again 49073 if (unique && deleted.find(function (d) { 49074 return d.originalKey === key; 49075 })) deleted = deleted.filter(function (t) { 49076 return t.originalKey !== key; 49077 }); 49078 var keyIndex = keys.indexOf(key); 49079 var item = items[keyIndex]; 49080 var slot = first && initial !== void 0 ? 'initial' : ENTER; 49081 current[key] = { 49082 slot: slot, 49083 originalKey: key, 49084 key: unique ? String(key) : guid++, 49085 item: item, 49086 trail: delay = delay + trail, 49087 config: callProp(config, item, slot), 49088 from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item), 49089 to: callProp(enter, item) 49090 }; 49091 }); 49092 break; 49093 } 49094 49095 case LEAVE: 49096 { 49097 removed.forEach(function (key) { 49098 var keyIndex = _keys.indexOf(key); 49099 49100 var item = _items[keyIndex]; 49101 var slot = LEAVE; 49102 deleted.unshift(_extends({}, current[key], { 49103 slot: slot, 49104 destroyed: true, 49105 left: _keys[Math.max(0, keyIndex - 1)], 49106 right: _keys[Math.min(_keys.length, keyIndex + 1)], 49107 trail: delay = delay + trail, 49108 config: callProp(config, item, slot), 49109 to: callProp(leave, item) 49110 })); 49111 delete current[key]; 49112 }); 49113 break; 49114 } 49115 49116 case UPDATE: 49117 { 49118 updated.forEach(function (key) { 49119 var keyIndex = keys.indexOf(key); 49120 var item = items[keyIndex]; 49121 var slot = UPDATE; 49122 current[key] = _extends({}, current[key], { 49123 item: item, 49124 slot: slot, 49125 trail: delay = delay + trail, 49126 config: callProp(config, item, slot), 49127 to: callProp(update, item) 49128 }); 49129 }); 49130 break; 49131 } 49132 } 49133 } 49134 49135 var out = keys.map(function (key) { 49136 return current[key]; 49137 }); // This tries to restore order for deleted items by finding their last known siblings 49138 // only using the left sibling to keep order placement consistent for all deleted items 49139 49140 deleted.forEach(function (_ref10) { 49141 var left = _ref10.left, 49142 right = _ref10.right, 49143 item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]); 49144 49145 var pos; // Was it the element on the left, if yes, move there ... 49146 49147 if ((pos = out.findIndex(function (t) { 49148 return t.originalKey === left; 49149 })) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯ 49150 49151 pos = Math.max(0, pos); 49152 out = [].concat(out.slice(0, pos), [item], out.slice(pos)); 49153 }); 49154 return _extends({}, state, { 49155 changed: added.length || removed.length || updated.length, 49156 first: first && added.length === 0, 49157 transitions: out, 49158 current: current, 49159 deleted: deleted, 49160 prevProps: props 49161 }); 49162 } 49163 49164 var AnimatedStyle = 49165 /*#__PURE__*/ 49166 function (_AnimatedObject) { 49167 _inheritsLoose(AnimatedStyle, _AnimatedObject); 49168 49169 function AnimatedStyle(style) { 49170 var _this; 49171 49172 if (style === void 0) { 49173 style = {}; 49174 } 49175 49176 _this = _AnimatedObject.call(this) || this; 49177 49178 if (style.transform && !(style.transform instanceof Animated)) { 49179 style = applyAnimatedValues.transform(style); 49180 } 49181 49182 _this.payload = style; 49183 return _this; 49184 } 49185 49186 return AnimatedStyle; 49187 }(AnimatedObject); 49188 49189 // http://www.w3.org/TR/css3-color/#svg-color 49190 var colors = { 49191 transparent: 0x00000000, 49192 aliceblue: 0xf0f8ffff, 49193 antiquewhite: 0xfaebd7ff, 49194 aqua: 0x00ffffff, 49195 aquamarine: 0x7fffd4ff, 49196 azure: 0xf0ffffff, 49197 beige: 0xf5f5dcff, 49198 bisque: 0xffe4c4ff, 49199 black: 0x000000ff, 49200 blanchedalmond: 0xffebcdff, 49201 blue: 0x0000ffff, 49202 blueviolet: 0x8a2be2ff, 49203 brown: 0xa52a2aff, 49204 burlywood: 0xdeb887ff, 49205 burntsienna: 0xea7e5dff, 49206 cadetblue: 0x5f9ea0ff, 49207 chartreuse: 0x7fff00ff, 49208 chocolate: 0xd2691eff, 49209 coral: 0xff7f50ff, 49210 cornflowerblue: 0x6495edff, 49211 cornsilk: 0xfff8dcff, 49212 crimson: 0xdc143cff, 49213 cyan: 0x00ffffff, 49214 darkblue: 0x00008bff, 49215 darkcyan: 0x008b8bff, 49216 darkgoldenrod: 0xb8860bff, 49217 darkgray: 0xa9a9a9ff, 49218 darkgreen: 0x006400ff, 49219 darkgrey: 0xa9a9a9ff, 49220 darkkhaki: 0xbdb76bff, 49221 darkmagenta: 0x8b008bff, 49222 darkolivegreen: 0x556b2fff, 49223 darkorange: 0xff8c00ff, 49224 darkorchid: 0x9932ccff, 49225 darkred: 0x8b0000ff, 49226 darksalmon: 0xe9967aff, 49227 darkseagreen: 0x8fbc8fff, 49228 darkslateblue: 0x483d8bff, 49229 darkslategray: 0x2f4f4fff, 49230 darkslategrey: 0x2f4f4fff, 49231 darkturquoise: 0x00ced1ff, 49232 darkviolet: 0x9400d3ff, 49233 deeppink: 0xff1493ff, 49234 deepskyblue: 0x00bfffff, 49235 dimgray: 0x696969ff, 49236 dimgrey: 0x696969ff, 49237 dodgerblue: 0x1e90ffff, 49238 firebrick: 0xb22222ff, 49239 floralwhite: 0xfffaf0ff, 49240 forestgreen: 0x228b22ff, 49241 fuchsia: 0xff00ffff, 49242 gainsboro: 0xdcdcdcff, 49243 ghostwhite: 0xf8f8ffff, 49244 gold: 0xffd700ff, 49245 goldenrod: 0xdaa520ff, 49246 gray: 0x808080ff, 49247 green: 0x008000ff, 49248 greenyellow: 0xadff2fff, 49249 grey: 0x808080ff, 49250 honeydew: 0xf0fff0ff, 49251 hotpink: 0xff69b4ff, 49252 indianred: 0xcd5c5cff, 49253 indigo: 0x4b0082ff, 49254 ivory: 0xfffff0ff, 49255 khaki: 0xf0e68cff, 49256 lavender: 0xe6e6faff, 49257 lavenderblush: 0xfff0f5ff, 49258 lawngreen: 0x7cfc00ff, 49259 lemonchiffon: 0xfffacdff, 49260 lightblue: 0xadd8e6ff, 49261 lightcoral: 0xf08080ff, 49262 lightcyan: 0xe0ffffff, 49263 lightgoldenrodyellow: 0xfafad2ff, 49264 lightgray: 0xd3d3d3ff, 49265 lightgreen: 0x90ee90ff, 49266 lightgrey: 0xd3d3d3ff, 49267 lightpink: 0xffb6c1ff, 49268 lightsalmon: 0xffa07aff, 49269 lightseagreen: 0x20b2aaff, 49270 lightskyblue: 0x87cefaff, 49271 lightslategray: 0x778899ff, 49272 lightslategrey: 0x778899ff, 49273 lightsteelblue: 0xb0c4deff, 49274 lightyellow: 0xffffe0ff, 49275 lime: 0x00ff00ff, 49276 limegreen: 0x32cd32ff, 49277 linen: 0xfaf0e6ff, 49278 magenta: 0xff00ffff, 49279 maroon: 0x800000ff, 49280 mediumaquamarine: 0x66cdaaff, 49281 mediumblue: 0x0000cdff, 49282 mediumorchid: 0xba55d3ff, 49283 mediumpurple: 0x9370dbff, 49284 mediumseagreen: 0x3cb371ff, 49285 mediumslateblue: 0x7b68eeff, 49286 mediumspringgreen: 0x00fa9aff, 49287 mediumturquoise: 0x48d1ccff, 49288 mediumvioletred: 0xc71585ff, 49289 midnightblue: 0x191970ff, 49290 mintcream: 0xf5fffaff, 49291 mistyrose: 0xffe4e1ff, 49292 moccasin: 0xffe4b5ff, 49293 navajowhite: 0xffdeadff, 49294 navy: 0x000080ff, 49295 oldlace: 0xfdf5e6ff, 49296 olive: 0x808000ff, 49297 olivedrab: 0x6b8e23ff, 49298 orange: 0xffa500ff, 49299 orangered: 0xff4500ff, 49300 orchid: 0xda70d6ff, 49301 palegoldenrod: 0xeee8aaff, 49302 palegreen: 0x98fb98ff, 49303 paleturquoise: 0xafeeeeff, 49304 palevioletred: 0xdb7093ff, 49305 papayawhip: 0xffefd5ff, 49306 peachpuff: 0xffdab9ff, 49307 peru: 0xcd853fff, 49308 pink: 0xffc0cbff, 49309 plum: 0xdda0ddff, 49310 powderblue: 0xb0e0e6ff, 49311 purple: 0x800080ff, 49312 rebeccapurple: 0x663399ff, 49313 red: 0xff0000ff, 49314 rosybrown: 0xbc8f8fff, 49315 royalblue: 0x4169e1ff, 49316 saddlebrown: 0x8b4513ff, 49317 salmon: 0xfa8072ff, 49318 sandybrown: 0xf4a460ff, 49319 seagreen: 0x2e8b57ff, 49320 seashell: 0xfff5eeff, 49321 sienna: 0xa0522dff, 49322 silver: 0xc0c0c0ff, 49323 skyblue: 0x87ceebff, 49324 slateblue: 0x6a5acdff, 49325 slategray: 0x708090ff, 49326 slategrey: 0x708090ff, 49327 snow: 0xfffafaff, 49328 springgreen: 0x00ff7fff, 49329 steelblue: 0x4682b4ff, 49330 tan: 0xd2b48cff, 49331 teal: 0x008080ff, 49332 thistle: 0xd8bfd8ff, 49333 tomato: 0xff6347ff, 49334 turquoise: 0x40e0d0ff, 49335 violet: 0xee82eeff, 49336 wheat: 0xf5deb3ff, 49337 white: 0xffffffff, 49338 whitesmoke: 0xf5f5f5ff, 49339 yellow: 0xffff00ff, 49340 yellowgreen: 0x9acd32ff 49341 }; 49342 49343 // const INTEGER = '[-+]?\\d+'; 49344 var NUMBER = '[-+]?\\d*\\.?\\d+'; 49345 var PERCENTAGE = NUMBER + '%'; 49346 49347 function call() { 49348 for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) { 49349 parts[_key] = arguments[_key]; 49350 } 49351 49352 return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)'; 49353 } 49354 49355 var rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)); 49356 var rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)); 49357 var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)); 49358 var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)); 49359 var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; 49360 var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; 49361 var hex6 = /^#([0-9a-fA-F]{6})$/; 49362 var hex8 = /^#([0-9a-fA-F]{8})$/; 49363 49364 /* 49365 https://github.com/react-community/normalize-css-color 49366 49367 BSD 3-Clause License 49368 49369 Copyright (c) 2016, React Community 49370 All rights reserved. 49371 49372 Redistribution and use in source and binary forms, with or without 49373 modification, are permitted provided that the following conditions are met: 49374 49375 * Redistributions of source code must retain the above copyright notice, this 49376 list of conditions and the following disclaimer. 49377 49378 * Redistributions in binary form must reproduce the above copyright notice, 49379 this list of conditions and the following disclaimer in the documentation 49380 and/or other materials provided with the distribution. 49381 49382 * Neither the name of the copyright holder nor the names of its 49383 contributors may be used to endorse or promote products derived from 49384 this software without specific prior written permission. 49385 49386 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 49387 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 49388 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 49389 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 49390 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 49391 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 49392 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 49393 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 49394 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 49395 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 49396 */ 49397 function normalizeColor(color) { 49398 var match; 49399 49400 if (typeof color === 'number') { 49401 return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null; 49402 } // Ordered based on occurrences on Facebook codebase 49403 49404 49405 if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0; 49406 if (colors.hasOwnProperty(color)) return colors[color]; 49407 49408 if (match = rgb.exec(color)) { 49409 return (parse255(match[1]) << 24 | // r 49410 parse255(match[2]) << 16 | // g 49411 parse255(match[3]) << 8 | // b 49412 0x000000ff) >>> // a 49413 0; 49414 } 49415 49416 if (match = rgba.exec(color)) { 49417 return (parse255(match[1]) << 24 | // r 49418 parse255(match[2]) << 16 | // g 49419 parse255(match[3]) << 8 | // b 49420 parse1(match[4])) >>> // a 49421 0; 49422 } 49423 49424 if (match = hex3.exec(color)) { 49425 return parseInt(match[1] + match[1] + // r 49426 match[2] + match[2] + // g 49427 match[3] + match[3] + // b 49428 'ff', // a 49429 16) >>> 0; 49430 } // https://drafts.csswg.org/css-color-4/#hex-notation 49431 49432 49433 if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0; 49434 49435 if (match = hex4.exec(color)) { 49436 return parseInt(match[1] + match[1] + // r 49437 match[2] + match[2] + // g 49438 match[3] + match[3] + // b 49439 match[4] + match[4], // a 49440 16) >>> 0; 49441 } 49442 49443 if (match = hsl.exec(color)) { 49444 return (hslToRgb(parse360(match[1]), // h 49445 parsePercentage(match[2]), // s 49446 parsePercentage(match[3]) // l 49447 ) | 0x000000ff) >>> // a 49448 0; 49449 } 49450 49451 if (match = hsla.exec(color)) { 49452 return (hslToRgb(parse360(match[1]), // h 49453 parsePercentage(match[2]), // s 49454 parsePercentage(match[3]) // l 49455 ) | parse1(match[4])) >>> // a 49456 0; 49457 } 49458 49459 return null; 49460 } 49461 49462 function hue2rgb(p, q, t) { 49463 if (t < 0) t += 1; 49464 if (t > 1) t -= 1; 49465 if (t < 1 / 6) return p + (q - p) * 6 * t; 49466 if (t < 1 / 2) return q; 49467 if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; 49468 return p; 49469 } 49470 49471 function hslToRgb(h, s, l) { 49472 var q = l < 0.5 ? l * (1 + s) : l + s - l * s; 49473 var p = 2 * l - q; 49474 var r = hue2rgb(p, q, h + 1 / 3); 49475 var g = hue2rgb(p, q, h); 49476 var b = hue2rgb(p, q, h - 1 / 3); 49477 return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8; 49478 } 49479 49480 function parse255(str) { 49481 var int = parseInt(str, 10); 49482 if (int < 0) return 0; 49483 if (int > 255) return 255; 49484 return int; 49485 } 49486 49487 function parse360(str) { 49488 var int = parseFloat(str); 49489 return (int % 360 + 360) % 360 / 360; 49490 } 49491 49492 function parse1(str) { 49493 var num = parseFloat(str); 49494 if (num < 0) return 0; 49495 if (num > 1) return 255; 49496 return Math.round(num * 255); 49497 } 49498 49499 function parsePercentage(str) { 49500 // parseFloat conveniently ignores the final % 49501 var int = parseFloat(str); 49502 if (int < 0) return 0; 49503 if (int > 100) return 1; 49504 return int / 100; 49505 } 49506 49507 function colorToRgba(input) { 49508 var int32Color = normalizeColor(input); 49509 if (int32Color === null) return input; 49510 int32Color = int32Color || 0; 49511 var r = (int32Color & 0xff000000) >>> 24; 49512 var g = (int32Color & 0x00ff0000) >>> 16; 49513 var b = (int32Color & 0x0000ff00) >>> 8; 49514 var a = (int32Color & 0x000000ff) / 255; 49515 return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")"; 49516 } // Problem: https://github.com/animatedjs/animated/pull/102 49517 // Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662 49518 49519 49520 var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla 49521 // Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e 49522 49523 var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.) 49524 49525 var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g'); 49526 /** 49527 * Supports string shapes by extracting numbers so new values can be computed, 49528 * and recombines those values into new strings of the same shape. Supports 49529 * things like: 49530 * 49531 * rgba(123, 42, 99, 0.36) // colors 49532 * -45deg // values with units 49533 * 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows 49534 */ 49535 49536 var createStringInterpolator = function createStringInterpolator(config) { 49537 // Replace colors with rgba 49538 var outputRange = config.output.map(function (rangeValue) { 49539 return rangeValue.replace(colorRegex, colorToRgba); 49540 }).map(function (rangeValue) { 49541 return rangeValue.replace(colorNamesRegex, colorToRgba); 49542 }); 49543 var outputRanges = outputRange[0].match(stringShapeRegex).map(function () { 49544 return []; 49545 }); 49546 outputRange.forEach(function (value) { 49547 value.match(stringShapeRegex).forEach(function (number, i) { 49548 return outputRanges[i].push(+number); 49549 }); 49550 }); 49551 var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) { 49552 return createInterpolator(_extends({}, config, { 49553 output: outputRanges[i] 49554 })); 49555 }); 49556 return function (input) { 49557 var i = 0; 49558 return outputRange[0] // 'rgba(0, 100, 200, 0)' 49559 // -> 49560 // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...' 49561 .replace(stringShapeRegex, function () { 49562 return interpolations[i++](input); 49563 }) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to 49564 // round the opacity (4th column). 49565 .replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) { 49566 return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")"; 49567 }); 49568 }; 49569 }; 49570 49571 var isUnitlessNumber = { 49572 animationIterationCount: true, 49573 borderImageOutset: true, 49574 borderImageSlice: true, 49575 borderImageWidth: true, 49576 boxFlex: true, 49577 boxFlexGroup: true, 49578 boxOrdinalGroup: true, 49579 columnCount: true, 49580 columns: true, 49581 flex: true, 49582 flexGrow: true, 49583 flexPositive: true, 49584 flexShrink: true, 49585 flexNegative: true, 49586 flexOrder: true, 49587 gridRow: true, 49588 gridRowEnd: true, 49589 gridRowSpan: true, 49590 gridRowStart: true, 49591 gridColumn: true, 49592 gridColumnEnd: true, 49593 gridColumnSpan: true, 49594 gridColumnStart: true, 49595 fontWeight: true, 49596 lineClamp: true, 49597 lineHeight: true, 49598 opacity: true, 49599 order: true, 49600 orphans: true, 49601 tabSize: true, 49602 widows: true, 49603 zIndex: true, 49604 zoom: true, 49605 // SVG-related properties 49606 fillOpacity: true, 49607 floodOpacity: true, 49608 stopOpacity: true, 49609 strokeDasharray: true, 49610 strokeDashoffset: true, 49611 strokeMiterlimit: true, 49612 strokeOpacity: true, 49613 strokeWidth: true 49614 }; 49615 49616 var prefixKey = function prefixKey(prefix, key) { 49617 return prefix + key.charAt(0).toUpperCase() + key.substring(1); 49618 }; 49619 49620 var prefixes = ['Webkit', 'Ms', 'Moz', 'O']; 49621 isUnitlessNumber = Object.keys(isUnitlessNumber).reduce(function (acc, prop) { 49622 prefixes.forEach(function (prefix) { 49623 return acc[prefixKey(prefix, prop)] = acc[prop]; 49624 }); 49625 return acc; 49626 }, isUnitlessNumber); 49627 49628 function dangerousStyleValue(name, value, isCustomProperty) { 49629 if (value == null || typeof value === 'boolean' || value === '') return ''; 49630 if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers 49631 49632 return ('' + value).trim(); 49633 } 49634 49635 var attributeCache = {}; 49636 injectCreateAnimatedStyle(function (style) { 49637 return new AnimatedStyle(style); 49638 }); 49639 injectDefaultElement('div'); 49640 injectStringInterpolator(createStringInterpolator); 49641 injectColorNames(colors); 49642 injectApplyAnimatedValues(function (instance, props) { 49643 if (instance.nodeType && instance.setAttribute !== undefined) { 49644 var style = props.style, 49645 children = props.children, 49646 scrollTop = props.scrollTop, 49647 scrollLeft = props.scrollLeft, 49648 attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]); 49649 49650 var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter'; 49651 if (scrollTop !== void 0) instance.scrollTop = scrollTop; 49652 if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value 49653 49654 if (children !== void 0) instance.textContent = children; // Set styles ... 49655 49656 for (var styleName in style) { 49657 if (!style.hasOwnProperty(styleName)) continue; 49658 var isCustomProperty = styleName.indexOf('--') === 0; 49659 var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty); 49660 if (styleName === 'float') styleName = 'cssFloat'; 49661 if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue; 49662 } // Set attributes ... 49663 49664 49665 for (var name in attributes) { 49666 // Attributes are written in dash case 49667 var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) { 49668 return '-' + n.toLowerCase(); 49669 })); 49670 if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]); 49671 } 49672 49673 return; 49674 } else return false; 49675 }, function (style) { 49676 return style; 49677 }); 49678 49679 var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG 49680 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; 49681 // Extend animated with all the available THREE elements 49682 var apply = merge(createAnimatedComponent, false); 49683 var extendedAnimated = apply(domElements); 49684 49685 exports.apply = apply; 49686 exports.config = config; 49687 exports.update = update; 49688 exports.animated = extendedAnimated; 49689 exports.a = extendedAnimated; 49690 exports.interpolate = interpolate$1; 49691 exports.Globals = Globals; 49692 exports.useSpring = useSpring; 49693 exports.useTrail = useTrail; 49694 exports.useTransition = useTransition; 49695 exports.useChain = useChain; 49696 exports.useSprings = useSprings; 49697 49698 49699 /***/ }), 49700 49701 /***/ "ZbWB": 49702 /***/ (function(module, exports, __webpack_require__) { 49703 49704 "use strict"; 49705 49706 49707 var GetIntrinsic = __webpack_require__("rZ7t"); 49708 49709 var $test = GetIntrinsic('RegExp.prototype.test'); 49710 49711 var callBind = __webpack_require__("hZ2/"); 49712 49713 module.exports = function regexTester(regex) { 49714 return callBind($test, regex); 49715 }; 49716 49717 49718 /***/ }), 49719 49720 /***/ "Zss7": 49721 /***/ (function(module, exports, __webpack_require__) { 49722 49723 var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2 49724 // https://github.com/bgrins/TinyColor 49725 // Brian Grinstead, MIT License 49726 49727 (function(Math) { 49728 49729 var trimLeft = /^\s+/, 49730 trimRight = /\s+$/, 49731 tinyCounter = 0, 49732 mathRound = Math.round, 49733 mathMin = Math.min, 49734 mathMax = Math.max, 49735 mathRandom = Math.random; 49736 49737 function tinycolor (color, opts) { 49738 49739 color = (color) ? color : ''; 49740 opts = opts || { }; 49741 49742 // If input is already a tinycolor, return itself 49743 if (color instanceof tinycolor) { 49744 return color; 49745 } 49746 // If we are called as a function, call using new instead 49747 if (!(this instanceof tinycolor)) { 49748 return new tinycolor(color, opts); 49749 } 49750 49751 var rgb = inputToRGB(color); 49752 this._originalInput = color, 49753 this._r = rgb.r, 49754 this._g = rgb.g, 49755 this._b = rgb.b, 49756 this._a = rgb.a, 49757 this._roundA = mathRound(100*this._a) / 100, 49758 this._format = opts.format || rgb.format; 49759 this._gradientType = opts.gradientType; 49760 49761 // Don't let the range of [0,255] come back in [0,1]. 49762 // Potentially lose a little bit of precision here, but will fix issues where 49763 // .5 gets interpreted as half of the total, instead of half of 1 49764 // If it was supposed to be 128, this was already taken care of by `inputToRgb` 49765 if (this._r < 1) { this._r = mathRound(this._r); } 49766 if (this._g < 1) { this._g = mathRound(this._g); } 49767 if (this._b < 1) { this._b = mathRound(this._b); } 49768 49769 this._ok = rgb.ok; 49770 this._tc_id = tinyCounter++; 49771 } 49772 49773 tinycolor.prototype = { 49774 isDark: function() { 49775 return this.getBrightness() < 128; 49776 }, 49777 isLight: function() { 49778 return !this.isDark(); 49779 }, 49780 isValid: function() { 49781 return this._ok; 49782 }, 49783 getOriginalInput: function() { 49784 return this._originalInput; 49785 }, 49786 getFormat: function() { 49787 return this._format; 49788 }, 49789 getAlpha: function() { 49790 return this._a; 49791 }, 49792 getBrightness: function() { 49793 //http://www.w3.org/TR/AERT#color-contrast 49794 var rgb = this.toRgb(); 49795 return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; 49796 }, 49797 getLuminance: function() { 49798 //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef 49799 var rgb = this.toRgb(); 49800 var RsRGB, GsRGB, BsRGB, R, G, B; 49801 RsRGB = rgb.r/255; 49802 GsRGB = rgb.g/255; 49803 BsRGB = rgb.b/255; 49804 49805 if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} 49806 if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} 49807 if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} 49808 return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); 49809 }, 49810 setAlpha: function(value) { 49811 this._a = boundAlpha(value); 49812 this._roundA = mathRound(100*this._a) / 100; 49813 return this; 49814 }, 49815 toHsv: function() { 49816 var hsv = rgbToHsv(this._r, this._g, this._b); 49817 return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; 49818 }, 49819 toHsvString: function() { 49820 var hsv = rgbToHsv(this._r, this._g, this._b); 49821 var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); 49822 return (this._a == 1) ? 49823 "hsv(" + h + ", " + s + "%, " + v + "%)" : 49824 "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; 49825 }, 49826 toHsl: function() { 49827 var hsl = rgbToHsl(this._r, this._g, this._b); 49828 return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; 49829 }, 49830 toHslString: function() { 49831 var hsl = rgbToHsl(this._r, this._g, this._b); 49832 var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); 49833 return (this._a == 1) ? 49834 "hsl(" + h + ", " + s + "%, " + l + "%)" : 49835 "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; 49836 }, 49837 toHex: function(allow3Char) { 49838 return rgbToHex(this._r, this._g, this._b, allow3Char); 49839 }, 49840 toHexString: function(allow3Char) { 49841 return '#' + this.toHex(allow3Char); 49842 }, 49843 toHex8: function(allow4Char) { 49844 return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); 49845 }, 49846 toHex8String: function(allow4Char) { 49847 return '#' + this.toHex8(allow4Char); 49848 }, 49849 toRgb: function() { 49850 return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; 49851 }, 49852 toRgbString: function() { 49853 return (this._a == 1) ? 49854 "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : 49855 "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; 49856 }, 49857 toPercentageRgb: function() { 49858 return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; 49859 }, 49860 toPercentageRgbString: function() { 49861 return (this._a == 1) ? 49862 "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : 49863 "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; 49864 }, 49865 toName: function() { 49866 if (this._a === 0) { 49867 return "transparent"; 49868 } 49869 49870 if (this._a < 1) { 49871 return false; 49872 } 49873 49874 return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; 49875 }, 49876 toFilter: function(secondColor) { 49877 var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); 49878 var secondHex8String = hex8String; 49879 var gradientType = this._gradientType ? "GradientType = 1, " : ""; 49880 49881 if (secondColor) { 49882 var s = tinycolor(secondColor); 49883 secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); 49884 } 49885 49886 return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; 49887 }, 49888 toString: function(format) { 49889 var formatSet = !!format; 49890 format = format || this._format; 49891 49892 var formattedString = false; 49893 var hasAlpha = this._a < 1 && this._a >= 0; 49894 var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); 49895 49896 if (needsAlphaFormat) { 49897 // Special case for "transparent", all other non-alpha formats 49898 // will return rgba when there is transparency. 49899 if (format === "name" && this._a === 0) { 49900 return this.toName(); 49901 } 49902 return this.toRgbString(); 49903 } 49904 if (format === "rgb") { 49905 formattedString = this.toRgbString(); 49906 } 49907 if (format === "prgb") { 49908 formattedString = this.toPercentageRgbString(); 49909 } 49910 if (format === "hex" || format === "hex6") { 49911 formattedString = this.toHexString(); 49912 } 49913 if (format === "hex3") { 49914 formattedString = this.toHexString(true); 49915 } 49916 if (format === "hex4") { 49917 formattedString = this.toHex8String(true); 49918 } 49919 if (format === "hex8") { 49920 formattedString = this.toHex8String(); 49921 } 49922 if (format === "name") { 49923 formattedString = this.toName(); 49924 } 49925 if (format === "hsl") { 49926 formattedString = this.toHslString(); 49927 } 49928 if (format === "hsv") { 49929 formattedString = this.toHsvString(); 49930 } 49931 49932 return formattedString || this.toHexString(); 49933 }, 49934 clone: function() { 49935 return tinycolor(this.toString()); 49936 }, 49937 49938 _applyModification: function(fn, args) { 49939 var color = fn.apply(null, [this].concat([].slice.call(args))); 49940 this._r = color._r; 49941 this._g = color._g; 49942 this._b = color._b; 49943 this.setAlpha(color._a); 49944 return this; 49945 }, 49946 lighten: function() { 49947 return this._applyModification(lighten, arguments); 49948 }, 49949 brighten: function() { 49950 return this._applyModification(brighten, arguments); 49951 }, 49952 darken: function() { 49953 return this._applyModification(darken, arguments); 49954 }, 49955 desaturate: function() { 49956 return this._applyModification(desaturate, arguments); 49957 }, 49958 saturate: function() { 49959 return this._applyModification(saturate, arguments); 49960 }, 49961 greyscale: function() { 49962 return this._applyModification(greyscale, arguments); 49963 }, 49964 spin: function() { 49965 return this._applyModification(spin, arguments); 49966 }, 49967 49968 _applyCombination: function(fn, args) { 49969 return fn.apply(null, [this].concat([].slice.call(args))); 49970 }, 49971 analogous: function() { 49972 return this._applyCombination(analogous, arguments); 49973 }, 49974 complement: function() { 49975 return this._applyCombination(complement, arguments); 49976 }, 49977 monochromatic: function() { 49978 return this._applyCombination(monochromatic, arguments); 49979 }, 49980 splitcomplement: function() { 49981 return this._applyCombination(splitcomplement, arguments); 49982 }, 49983 triad: function() { 49984 return this._applyCombination(triad, arguments); 49985 }, 49986 tetrad: function() { 49987 return this._applyCombination(tetrad, arguments); 49988 } 49989 }; 49990 49991 // If input is an object, force 1 into "1.0" to handle ratios properly 49992 // String input requires "1.0" as input, so 1 will be treated as 1 49993 tinycolor.fromRatio = function(color, opts) { 49994 if (typeof color == "object") { 49995 var newColor = {}; 49996 for (var i in color) { 49997 if (color.hasOwnProperty(i)) { 49998 if (i === "a") { 49999 newColor[i] = color[i]; 50000 } 50001 else { 50002 newColor[i] = convertToPercentage(color[i]); 50003 } 50004 } 50005 } 50006 color = newColor; 50007 } 50008 50009 return tinycolor(color, opts); 50010 }; 50011 50012 // Given a string or object, convert that input to RGB 50013 // Possible string inputs: 50014 // 50015 // "red" 50016 // "#f00" or "f00" 50017 // "#ff0000" or "ff0000" 50018 // "#ff000000" or "ff000000" 50019 // "rgb 255 0 0" or "rgb (255, 0, 0)" 50020 // "rgb 1.0 0 0" or "rgb (1, 0, 0)" 50021 // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" 50022 // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" 50023 // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" 50024 // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" 50025 // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" 50026 // 50027 function inputToRGB(color) { 50028 50029 var rgb = { r: 0, g: 0, b: 0 }; 50030 var a = 1; 50031 var s = null; 50032 var v = null; 50033 var l = null; 50034 var ok = false; 50035 var format = false; 50036 50037 if (typeof color == "string") { 50038 color = stringInputToObject(color); 50039 } 50040 50041 if (typeof color == "object") { 50042 if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { 50043 rgb = rgbToRgb(color.r, color.g, color.b); 50044 ok = true; 50045 format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; 50046 } 50047 else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { 50048 s = convertToPercentage(color.s); 50049 v = convertToPercentage(color.v); 50050 rgb = hsvToRgb(color.h, s, v); 50051 ok = true; 50052 format = "hsv"; 50053 } 50054 else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { 50055 s = convertToPercentage(color.s); 50056 l = convertToPercentage(color.l); 50057 rgb = hslToRgb(color.h, s, l); 50058 ok = true; 50059 format = "hsl"; 50060 } 50061 50062 if (color.hasOwnProperty("a")) { 50063 a = color.a; 50064 } 50065 } 50066 50067 a = boundAlpha(a); 50068 50069 return { 50070 ok: ok, 50071 format: color.format || format, 50072 r: mathMin(255, mathMax(rgb.r, 0)), 50073 g: mathMin(255, mathMax(rgb.g, 0)), 50074 b: mathMin(255, mathMax(rgb.b, 0)), 50075 a: a 50076 }; 50077 } 50078 50079 50080 // Conversion Functions 50081 // -------------------- 50082 50083 // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: 50084 // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript> 50085 50086 // `rgbToRgb` 50087 // Handle bounds / percentage checking to conform to CSS color spec 50088 // <http://www.w3.org/TR/css3-color/> 50089 // *Assumes:* r, g, b in [0, 255] or [0, 1] 50090 // *Returns:* { r, g, b } in [0, 255] 50091 function rgbToRgb(r, g, b){ 50092 return { 50093 r: bound01(r, 255) * 255, 50094 g: bound01(g, 255) * 255, 50095 b: bound01(b, 255) * 255 50096 }; 50097 } 50098 50099 // `rgbToHsl` 50100 // Converts an RGB color value to HSL. 50101 // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] 50102 // *Returns:* { h, s, l } in [0,1] 50103 function rgbToHsl(r, g, b) { 50104 50105 r = bound01(r, 255); 50106 g = bound01(g, 255); 50107 b = bound01(b, 255); 50108 50109 var max = mathMax(r, g, b), min = mathMin(r, g, b); 50110 var h, s, l = (max + min) / 2; 50111 50112 if(max == min) { 50113 h = s = 0; // achromatic 50114 } 50115 else { 50116 var d = max - min; 50117 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 50118 switch(max) { 50119 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 50120 case g: h = (b - r) / d + 2; break; 50121 case b: h = (r - g) / d + 4; break; 50122 } 50123 50124 h /= 6; 50125 } 50126 50127 return { h: h, s: s, l: l }; 50128 } 50129 50130 // `hslToRgb` 50131 // Converts an HSL color value to RGB. 50132 // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] 50133 // *Returns:* { r, g, b } in the set [0, 255] 50134 function hslToRgb(h, s, l) { 50135 var r, g, b; 50136 50137 h = bound01(h, 360); 50138 s = bound01(s, 100); 50139 l = bound01(l, 100); 50140 50141 function hue2rgb(p, q, t) { 50142 if(t < 0) t += 1; 50143 if(t > 1) t -= 1; 50144 if(t < 1/6) return p + (q - p) * 6 * t; 50145 if(t < 1/2) return q; 50146 if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; 50147 return p; 50148 } 50149 50150 if(s === 0) { 50151 r = g = b = l; // achromatic 50152 } 50153 else { 50154 var q = l < 0.5 ? l * (1 + s) : l + s - l * s; 50155 var p = 2 * l - q; 50156 r = hue2rgb(p, q, h + 1/3); 50157 g = hue2rgb(p, q, h); 50158 b = hue2rgb(p, q, h - 1/3); 50159 } 50160 50161 return { r: r * 255, g: g * 255, b: b * 255 }; 50162 } 50163 50164 // `rgbToHsv` 50165 // Converts an RGB color value to HSV 50166 // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] 50167 // *Returns:* { h, s, v } in [0,1] 50168 function rgbToHsv(r, g, b) { 50169 50170 r = bound01(r, 255); 50171 g = bound01(g, 255); 50172 b = bound01(b, 255); 50173 50174 var max = mathMax(r, g, b), min = mathMin(r, g, b); 50175 var h, s, v = max; 50176 50177 var d = max - min; 50178 s = max === 0 ? 0 : d / max; 50179 50180 if(max == min) { 50181 h = 0; // achromatic 50182 } 50183 else { 50184 switch(max) { 50185 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 50186 case g: h = (b - r) / d + 2; break; 50187 case b: h = (r - g) / d + 4; break; 50188 } 50189 h /= 6; 50190 } 50191 return { h: h, s: s, v: v }; 50192 } 50193 50194 // `hsvToRgb` 50195 // Converts an HSV color value to RGB. 50196 // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] 50197 // *Returns:* { r, g, b } in the set [0, 255] 50198 function hsvToRgb(h, s, v) { 50199 50200 h = bound01(h, 360) * 6; 50201 s = bound01(s, 100); 50202 v = bound01(v, 100); 50203 50204 var i = Math.floor(h), 50205 f = h - i, 50206 p = v * (1 - s), 50207 q = v * (1 - f * s), 50208 t = v * (1 - (1 - f) * s), 50209 mod = i % 6, 50210 r = [v, q, p, p, t, v][mod], 50211 g = [t, v, v, q, p, p][mod], 50212 b = [p, p, t, v, v, q][mod]; 50213 50214 return { r: r * 255, g: g * 255, b: b * 255 }; 50215 } 50216 50217 // `rgbToHex` 50218 // Converts an RGB color to hex 50219 // Assumes r, g, and b are contained in the set [0, 255] 50220 // Returns a 3 or 6 character hex 50221 function rgbToHex(r, g, b, allow3Char) { 50222 50223 var hex = [ 50224 pad2(mathRound(r).toString(16)), 50225 pad2(mathRound(g).toString(16)), 50226 pad2(mathRound(b).toString(16)) 50227 ]; 50228 50229 // Return a 3 character hex if possible 50230 if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { 50231 return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); 50232 } 50233 50234 return hex.join(""); 50235 } 50236 50237 // `rgbaToHex` 50238 // Converts an RGBA color plus alpha transparency to hex 50239 // Assumes r, g, b are contained in the set [0, 255] and 50240 // a in [0, 1]. Returns a 4 or 8 character rgba hex 50241 function rgbaToHex(r, g, b, a, allow4Char) { 50242 50243 var hex = [ 50244 pad2(mathRound(r).toString(16)), 50245 pad2(mathRound(g).toString(16)), 50246 pad2(mathRound(b).toString(16)), 50247 pad2(convertDecimalToHex(a)) 50248 ]; 50249 50250 // Return a 4 character hex if possible 50251 if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { 50252 return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); 50253 } 50254 50255 return hex.join(""); 50256 } 50257 50258 // `rgbaToArgbHex` 50259 // Converts an RGBA color to an ARGB Hex8 string 50260 // Rarely used, but required for "toFilter()" 50261 function rgbaToArgbHex(r, g, b, a) { 50262 50263 var hex = [ 50264 pad2(convertDecimalToHex(a)), 50265 pad2(mathRound(r).toString(16)), 50266 pad2(mathRound(g).toString(16)), 50267 pad2(mathRound(b).toString(16)) 50268 ]; 50269 50270 return hex.join(""); 50271 } 50272 50273 // `equals` 50274 // Can be called with any tinycolor input 50275 tinycolor.equals = function (color1, color2) { 50276 if (!color1 || !color2) { return false; } 50277 return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); 50278 }; 50279 50280 tinycolor.random = function() { 50281 return tinycolor.fromRatio({ 50282 r: mathRandom(), 50283 g: mathRandom(), 50284 b: mathRandom() 50285 }); 50286 }; 50287 50288 50289 // Modification Functions 50290 // ---------------------- 50291 // Thanks to less.js for some of the basics here 50292 // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js> 50293 50294 function desaturate(color, amount) { 50295 amount = (amount === 0) ? 0 : (amount || 10); 50296 var hsl = tinycolor(color).toHsl(); 50297 hsl.s -= amount / 100; 50298 hsl.s = clamp01(hsl.s); 50299 return tinycolor(hsl); 50300 } 50301 50302 function saturate(color, amount) { 50303 amount = (amount === 0) ? 0 : (amount || 10); 50304 var hsl = tinycolor(color).toHsl(); 50305 hsl.s += amount / 100; 50306 hsl.s = clamp01(hsl.s); 50307 return tinycolor(hsl); 50308 } 50309 50310 function greyscale(color) { 50311 return tinycolor(color).desaturate(100); 50312 } 50313 50314 function lighten (color, amount) { 50315 amount = (amount === 0) ? 0 : (amount || 10); 50316 var hsl = tinycolor(color).toHsl(); 50317 hsl.l += amount / 100; 50318 hsl.l = clamp01(hsl.l); 50319 return tinycolor(hsl); 50320 } 50321 50322 function brighten(color, amount) { 50323 amount = (amount === 0) ? 0 : (amount || 10); 50324 var rgb = tinycolor(color).toRgb(); 50325 rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); 50326 rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); 50327 rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); 50328 return tinycolor(rgb); 50329 } 50330 50331 function darken (color, amount) { 50332 amount = (amount === 0) ? 0 : (amount || 10); 50333 var hsl = tinycolor(color).toHsl(); 50334 hsl.l -= amount / 100; 50335 hsl.l = clamp01(hsl.l); 50336 return tinycolor(hsl); 50337 } 50338 50339 // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. 50340 // Values outside of this range will be wrapped into this range. 50341 function spin(color, amount) { 50342 var hsl = tinycolor(color).toHsl(); 50343 var hue = (hsl.h + amount) % 360; 50344 hsl.h = hue < 0 ? 360 + hue : hue; 50345 return tinycolor(hsl); 50346 } 50347 50348 // Combination Functions 50349 // --------------------- 50350 // Thanks to jQuery xColor for some of the ideas behind these 50351 // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js> 50352 50353 function complement(color) { 50354 var hsl = tinycolor(color).toHsl(); 50355 hsl.h = (hsl.h + 180) % 360; 50356 return tinycolor(hsl); 50357 } 50358 50359 function triad(color) { 50360 var hsl = tinycolor(color).toHsl(); 50361 var h = hsl.h; 50362 return [ 50363 tinycolor(color), 50364 tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), 50365 tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) 50366 ]; 50367 } 50368 50369 function tetrad(color) { 50370 var hsl = tinycolor(color).toHsl(); 50371 var h = hsl.h; 50372 return [ 50373 tinycolor(color), 50374 tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), 50375 tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), 50376 tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) 50377 ]; 50378 } 50379 50380 function splitcomplement(color) { 50381 var hsl = tinycolor(color).toHsl(); 50382 var h = hsl.h; 50383 return [ 50384 tinycolor(color), 50385 tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), 50386 tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) 50387 ]; 50388 } 50389 50390 function analogous(color, results, slices) { 50391 results = results || 6; 50392 slices = slices || 30; 50393 50394 var hsl = tinycolor(color).toHsl(); 50395 var part = 360 / slices; 50396 var ret = [tinycolor(color)]; 50397 50398 for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { 50399 hsl.h = (hsl.h + part) % 360; 50400 ret.push(tinycolor(hsl)); 50401 } 50402 return ret; 50403 } 50404 50405 function monochromatic(color, results) { 50406 results = results || 6; 50407 var hsv = tinycolor(color).toHsv(); 50408 var h = hsv.h, s = hsv.s, v = hsv.v; 50409 var ret = []; 50410 var modification = 1 / results; 50411 50412 while (results--) { 50413 ret.push(tinycolor({ h: h, s: s, v: v})); 50414 v = (v + modification) % 1; 50415 } 50416 50417 return ret; 50418 } 50419 50420 // Utility Functions 50421 // --------------------- 50422 50423 tinycolor.mix = function(color1, color2, amount) { 50424 amount = (amount === 0) ? 0 : (amount || 50); 50425 50426 var rgb1 = tinycolor(color1).toRgb(); 50427 var rgb2 = tinycolor(color2).toRgb(); 50428 50429 var p = amount / 100; 50430 50431 var rgba = { 50432 r: ((rgb2.r - rgb1.r) * p) + rgb1.r, 50433 g: ((rgb2.g - rgb1.g) * p) + rgb1.g, 50434 b: ((rgb2.b - rgb1.b) * p) + rgb1.b, 50435 a: ((rgb2.a - rgb1.a) * p) + rgb1.a 50436 }; 50437 50438 return tinycolor(rgba); 50439 }; 50440 50441 50442 // Readability Functions 50443 // --------------------- 50444 // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2) 50445 50446 // `contrast` 50447 // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2) 50448 tinycolor.readability = function(color1, color2) { 50449 var c1 = tinycolor(color1); 50450 var c2 = tinycolor(color2); 50451 return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05); 50452 }; 50453 50454 // `isReadable` 50455 // Ensure that foreground and background color combinations meet WCAG2 guidelines. 50456 // The third argument is an optional Object. 50457 // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA'; 50458 // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'. 50459 // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}. 50460 50461 // *Example* 50462 // tinycolor.isReadable("#000", "#111") => false 50463 // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false 50464 tinycolor.isReadable = function(color1, color2, wcag2) { 50465 var readability = tinycolor.readability(color1, color2); 50466 var wcag2Parms, out; 50467 50468 out = false; 50469 50470 wcag2Parms = validateWCAG2Parms(wcag2); 50471 switch (wcag2Parms.level + wcag2Parms.size) { 50472 case "AAsmall": 50473 case "AAAlarge": 50474 out = readability >= 4.5; 50475 break; 50476 case "AAlarge": 50477 out = readability >= 3; 50478 break; 50479 case "AAAsmall": 50480 out = readability >= 7; 50481 break; 50482 } 50483 return out; 50484 50485 }; 50486 50487 // `mostReadable` 50488 // Given a base color and a list of possible foreground or background 50489 // colors for that base, returns the most readable color. 50490 // Optionally returns Black or White if the most readable color is unreadable. 50491 // *Example* 50492 // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" 50493 // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" 50494 // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" 50495 // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" 50496 tinycolor.mostReadable = function(baseColor, colorList, args) { 50497 var bestColor = null; 50498 var bestScore = 0; 50499 var readability; 50500 var includeFallbackColors, level, size ; 50501 args = args || {}; 50502 includeFallbackColors = args.includeFallbackColors ; 50503 level = args.level; 50504 size = args.size; 50505 50506 for (var i= 0; i < colorList.length ; i++) { 50507 readability = tinycolor.readability(baseColor, colorList[i]); 50508 if (readability > bestScore) { 50509 bestScore = readability; 50510 bestColor = tinycolor(colorList[i]); 50511 } 50512 } 50513 50514 if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { 50515 return bestColor; 50516 } 50517 else { 50518 args.includeFallbackColors=false; 50519 return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); 50520 } 50521 }; 50522 50523 50524 // Big List of Colors 50525 // ------------------ 50526 // <http://www.w3.org/TR/css3-color/#svg-color> 50527 var names = tinycolor.names = { 50528 aliceblue: "f0f8ff", 50529 antiquewhite: "faebd7", 50530 aqua: "0ff", 50531 aquamarine: "7fffd4", 50532 azure: "f0ffff", 50533 beige: "f5f5dc", 50534 bisque: "ffe4c4", 50535 black: "000", 50536 blanchedalmond: "ffebcd", 50537 blue: "00f", 50538 blueviolet: "8a2be2", 50539 brown: "a52a2a", 50540 burlywood: "deb887", 50541 burntsienna: "ea7e5d", 50542 cadetblue: "5f9ea0", 50543 chartreuse: "7fff00", 50544 chocolate: "d2691e", 50545 coral: "ff7f50", 50546 cornflowerblue: "6495ed", 50547 cornsilk: "fff8dc", 50548 crimson: "dc143c", 50549 cyan: "0ff", 50550 darkblue: "00008b", 50551 darkcyan: "008b8b", 50552 darkgoldenrod: "b8860b", 50553 darkgray: "a9a9a9", 50554 darkgreen: "006400", 50555 darkgrey: "a9a9a9", 50556 darkkhaki: "bdb76b", 50557 darkmagenta: "8b008b", 50558 darkolivegreen: "556b2f", 50559 darkorange: "ff8c00", 50560 darkorchid: "9932cc", 50561 darkred: "8b0000", 50562 darksalmon: "e9967a", 50563 darkseagreen: "8fbc8f", 50564 darkslateblue: "483d8b", 50565 darkslategray: "2f4f4f", 50566 darkslategrey: "2f4f4f", 50567 darkturquoise: "00ced1", 50568 darkviolet: "9400d3", 50569 deeppink: "ff1493", 50570 deepskyblue: "00bfff", 50571 dimgray: "696969", 50572 dimgrey: "696969", 50573 dodgerblue: "1e90ff", 50574 firebrick: "b22222", 50575 floralwhite: "fffaf0", 50576 forestgreen: "228b22", 50577 fuchsia: "f0f", 50578 gainsboro: "dcdcdc", 50579 ghostwhite: "f8f8ff", 50580 gold: "ffd700", 50581 goldenrod: "daa520", 50582 gray: "808080", 50583 green: "008000", 50584 greenyellow: "adff2f", 50585 grey: "808080", 50586 honeydew: "f0fff0", 50587 hotpink: "ff69b4", 50588 indianred: "cd5c5c", 50589 indigo: "4b0082", 50590 ivory: "fffff0", 50591 khaki: "f0e68c", 50592 lavender: "e6e6fa", 50593 lavenderblush: "fff0f5", 50594 lawngreen: "7cfc00", 50595 lemonchiffon: "fffacd", 50596 lightblue: "add8e6", 50597 lightcoral: "f08080", 50598 lightcyan: "e0ffff", 50599 lightgoldenrodyellow: "fafad2", 50600 lightgray: "d3d3d3", 50601 lightgreen: "90ee90", 50602 lightgrey: "d3d3d3", 50603 lightpink: "ffb6c1", 50604 lightsalmon: "ffa07a", 50605 lightseagreen: "20b2aa", 50606 lightskyblue: "87cefa", 50607 lightslategray: "789", 50608 lightslategrey: "789", 50609 lightsteelblue: "b0c4de", 50610 lightyellow: "ffffe0", 50611 lime: "0f0", 50612 limegreen: "32cd32", 50613 linen: "faf0e6", 50614 magenta: "f0f", 50615 maroon: "800000", 50616 mediumaquamarine: "66cdaa", 50617 mediumblue: "0000cd", 50618 mediumorchid: "ba55d3", 50619 mediumpurple: "9370db", 50620 mediumseagreen: "3cb371", 50621 mediumslateblue: "7b68ee", 50622 mediumspringgreen: "00fa9a", 50623 mediumturquoise: "48d1cc", 50624 mediumvioletred: "c71585", 50625 midnightblue: "191970", 50626 mintcream: "f5fffa", 50627 mistyrose: "ffe4e1", 50628 moccasin: "ffe4b5", 50629 navajowhite: "ffdead", 50630 navy: "000080", 50631 oldlace: "fdf5e6", 50632 olive: "808000", 50633 olivedrab: "6b8e23", 50634 orange: "ffa500", 50635 orangered: "ff4500", 50636 orchid: "da70d6", 50637 palegoldenrod: "eee8aa", 50638 palegreen: "98fb98", 50639 paleturquoise: "afeeee", 50640 palevioletred: "db7093", 50641 papayawhip: "ffefd5", 50642 peachpuff: "ffdab9", 50643 peru: "cd853f", 50644 pink: "ffc0cb", 50645 plum: "dda0dd", 50646 powderblue: "b0e0e6", 50647 purple: "800080", 50648 rebeccapurple: "663399", 50649 red: "f00", 50650 rosybrown: "bc8f8f", 50651 royalblue: "4169e1", 50652 saddlebrown: "8b4513", 50653 salmon: "fa8072", 50654 sandybrown: "f4a460", 50655 seagreen: "2e8b57", 50656 seashell: "fff5ee", 50657 sienna: "a0522d", 50658 silver: "c0c0c0", 50659 skyblue: "87ceeb", 50660 slateblue: "6a5acd", 50661 slategray: "708090", 50662 slategrey: "708090", 50663 snow: "fffafa", 50664 springgreen: "00ff7f", 50665 steelblue: "4682b4", 50666 tan: "d2b48c", 50667 teal: "008080", 50668 thistle: "d8bfd8", 50669 tomato: "ff6347", 50670 turquoise: "40e0d0", 50671 violet: "ee82ee", 50672 wheat: "f5deb3", 50673 white: "fff", 50674 whitesmoke: "f5f5f5", 50675 yellow: "ff0", 50676 yellowgreen: "9acd32" 50677 }; 50678 50679 // Make it easy to access colors via `hexNames[hex]` 50680 var hexNames = tinycolor.hexNames = flip(names); 50681 50682 50683 // Utilities 50684 // --------- 50685 50686 // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` 50687 function flip(o) { 50688 var flipped = { }; 50689 for (var i in o) { 50690 if (o.hasOwnProperty(i)) { 50691 flipped[o[i]] = i; 50692 } 50693 } 50694 return flipped; 50695 } 50696 50697 // Return a valid alpha value [0,1] with all invalid values being set to 1 50698 function boundAlpha(a) { 50699 a = parseFloat(a); 50700 50701 if (isNaN(a) || a < 0 || a > 1) { 50702 a = 1; 50703 } 50704 50705 return a; 50706 } 50707 50708 // Take input from [0, n] and return it as [0, 1] 50709 function bound01(n, max) { 50710 if (isOnePointZero(n)) { n = "100%"; } 50711 50712 var processPercent = isPercentage(n); 50713 n = mathMin(max, mathMax(0, parseFloat(n))); 50714 50715 // Automatically convert percentage into number 50716 if (processPercent) { 50717 n = parseInt(n * max, 10) / 100; 50718 } 50719 50720 // Handle floating point rounding errors 50721 if ((Math.abs(n - max) < 0.000001)) { 50722 return 1; 50723 } 50724 50725 // Convert into [0, 1] range if it isn't already 50726 return (n % max) / parseFloat(max); 50727 } 50728 50729 // Force a number between 0 and 1 50730 function clamp01(val) { 50731 return mathMin(1, mathMax(0, val)); 50732 } 50733 50734 // Parse a base-16 hex value into a base-10 integer 50735 function parseIntFromHex(val) { 50736 return parseInt(val, 16); 50737 } 50738 50739 // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 50740 // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0> 50741 function isOnePointZero(n) { 50742 return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; 50743 } 50744 50745 // Check to see if string passed in is a percentage 50746 function isPercentage(n) { 50747 return typeof n === "string" && n.indexOf('%') != -1; 50748 } 50749 50750 // Force a hex value to have 2 characters 50751 function pad2(c) { 50752 return c.length == 1 ? '0' + c : '' + c; 50753 } 50754 50755 // Replace a decimal with it's percentage value 50756 function convertToPercentage(n) { 50757 if (n <= 1) { 50758 n = (n * 100) + "%"; 50759 } 50760 50761 return n; 50762 } 50763 50764 // Converts a decimal to a hex value 50765 function convertDecimalToHex(d) { 50766 return Math.round(parseFloat(d) * 255).toString(16); 50767 } 50768 // Converts a hex value to a decimal 50769 function convertHexToDecimal(h) { 50770 return (parseIntFromHex(h) / 255); 50771 } 50772 50773 var matchers = (function() { 50774 50775 // <http://www.w3.org/TR/css3-values/#integers> 50776 var CSS_INTEGER = "[-\\+]?\\d+%?"; 50777 50778 // <http://www.w3.org/TR/css3-values/#number-value> 50779 var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; 50780 50781 // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. 50782 var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; 50783 50784 // Actual matching. 50785 // Parentheses and commas are optional, but not required. 50786 // Whitespace can take the place of commas or opening paren 50787 var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 50788 var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 50789 50790 return { 50791 CSS_UNIT: new RegExp(CSS_UNIT), 50792 rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), 50793 rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), 50794 hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), 50795 hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), 50796 hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), 50797 hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), 50798 hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 50799 hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, 50800 hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 50801 hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ 50802 }; 50803 })(); 50804 50805 // `isValidCSSUnit` 50806 // Take in a single string / number and check to see if it looks like a CSS unit 50807 // (see `matchers` above for definition). 50808 function isValidCSSUnit(color) { 50809 return !!matchers.CSS_UNIT.exec(color); 50810 } 50811 50812 // `stringInputToObject` 50813 // Permissive string parsing. Take in a number of formats, and output an object 50814 // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` 50815 function stringInputToObject(color) { 50816 50817 color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); 50818 var named = false; 50819 if (names[color]) { 50820 color = names[color]; 50821 named = true; 50822 } 50823 else if (color == 'transparent') { 50824 return { r: 0, g: 0, b: 0, a: 0, format: "name" }; 50825 } 50826 50827 // Try to match string input using regular expressions. 50828 // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] 50829 // Just return an object and let the conversion functions handle that. 50830 // This way the result will be the same whether the tinycolor is initialized with string or object. 50831 var match; 50832 if ((match = matchers.rgb.exec(color))) { 50833 return { r: match[1], g: match[2], b: match[3] }; 50834 } 50835 if ((match = matchers.rgba.exec(color))) { 50836 return { r: match[1], g: match[2], b: match[3], a: match[4] }; 50837 } 50838 if ((match = matchers.hsl.exec(color))) { 50839 return { h: match[1], s: match[2], l: match[3] }; 50840 } 50841 if ((match = matchers.hsla.exec(color))) { 50842 return { h: match[1], s: match[2], l: match[3], a: match[4] }; 50843 } 50844 if ((match = matchers.hsv.exec(color))) { 50845 return { h: match[1], s: match[2], v: match[3] }; 50846 } 50847 if ((match = matchers.hsva.exec(color))) { 50848 return { h: match[1], s: match[2], v: match[3], a: match[4] }; 50849 } 50850 if ((match = matchers.hex8.exec(color))) { 50851 return { 50852 r: parseIntFromHex(match[1]), 50853 g: parseIntFromHex(match[2]), 50854 b: parseIntFromHex(match[3]), 50855 a: convertHexToDecimal(match[4]), 50856 format: named ? "name" : "hex8" 50857 }; 50858 } 50859 if ((match = matchers.hex6.exec(color))) { 50860 return { 50861 r: parseIntFromHex(match[1]), 50862 g: parseIntFromHex(match[2]), 50863 b: parseIntFromHex(match[3]), 50864 format: named ? "name" : "hex" 50865 }; 50866 } 50867 if ((match = matchers.hex4.exec(color))) { 50868 return { 50869 r: parseIntFromHex(match[1] + '' + match[1]), 50870 g: parseIntFromHex(match[2] + '' + match[2]), 50871 b: parseIntFromHex(match[3] + '' + match[3]), 50872 a: convertHexToDecimal(match[4] + '' + match[4]), 50873 format: named ? "name" : "hex8" 50874 }; 50875 } 50876 if ((match = matchers.hex3.exec(color))) { 50877 return { 50878 r: parseIntFromHex(match[1] + '' + match[1]), 50879 g: parseIntFromHex(match[2] + '' + match[2]), 50880 b: parseIntFromHex(match[3] + '' + match[3]), 50881 format: named ? "name" : "hex" 50882 }; 50883 } 50884 50885 return false; 50886 } 50887 50888 function validateWCAG2Parms(parms) { 50889 // return valid WCAG2 parms for isReadable. 50890 // If input parms are invalid, return {"level":"AA", "size":"small"} 50891 var level, size; 50892 parms = parms || {"level":"AA", "size":"small"}; 50893 level = (parms.level || "AA").toUpperCase(); 50894 size = (parms.size || "small").toLowerCase(); 50895 if (level !== "AA" && level !== "AAA") { 50896 level = "AA"; 50897 } 50898 if (size !== "small" && size !== "large") { 50899 size = "small"; 50900 } 50901 return {"level":level, "size":size}; 50902 } 50903 50904 // Node: Export function 50905 if ( true && module.exports) { 50906 module.exports = tinycolor; 50907 } 50908 // AMD/requirejs: Define the module 50909 else if (true) { 50910 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module), 50911 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 50912 } 50913 // Browser: Expose to window 50914 else {} 50915 50916 })(Math); 50917 50918 50919 /***/ }), 50920 50921 /***/ "aA0e": 50922 /***/ (function(module, __webpack_exports__, __webpack_require__) { 50923 50924 "use strict"; 50925 /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); 50926 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); 50927 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 50928 /* harmony import */ var reakit_Toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("zTEx"); 50929 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Z23Y"); 50930 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_3__); 50931 /* harmony import */ var _toolbar_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("GK4x"); 50932 50933 50934 50935 /** 50936 * External dependencies 50937 */ 50938 50939 /** 50940 * WordPress dependencies 50941 */ 50942 50943 50944 50945 /** 50946 * Internal dependencies 50947 */ 50948 50949 50950 50951 function ToolbarItem({ 50952 children, 50953 as: Component, 50954 ...props 50955 }, ref) { 50956 const accessibleToolbarState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_toolbar_context__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]); 50957 50958 if (typeof children !== 'function' && !Component) { 50959 typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default()('`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' + 'See https://developer.wordpress.org/block-editor/components/toolbar-item/') : void 0; 50960 return null; 50961 } 50962 50963 const allProps = { ...props, 50964 ref, 50965 'data-toolbar-item': true 50966 }; 50967 50968 if (!accessibleToolbarState) { 50969 if (Component) { 50970 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Component, allProps, children); 50971 } 50972 50973 return children(allProps); 50974 } 50975 50976 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(reakit_Toolbar__WEBPACK_IMPORTED_MODULE_2__[/* ToolbarItem */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, accessibleToolbarState, allProps, { 50977 as: Component 50978 }), children); 50979 } 50980 50981 /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(ToolbarItem)); 50982 50983 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) 50984 50985 /***/ }), 50986 50987 /***/ "aE6U": 50988 /***/ (function(module, exports, __webpack_require__) { 50989 50990 "use strict"; 50991 50992 50993 Object.defineProperty(exports, "__esModule", { 50994 value: true 50995 }); 50996 50997 var _propTypes = __webpack_require__("17x9"); 50998 50999 var _propTypes2 = _interopRequireDefault(_propTypes); 51000 51001 var _constants = __webpack_require__("Fv1B"); 51002 51003 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 51004 51005 exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]); 51006 51007 /***/ }), 51008 51009 /***/ "aI7X": 51010 /***/ (function(module, exports, __webpack_require__) { 51011 51012 "use strict"; 51013 51014 51015 /* eslint no-invalid-this: 1 */ 51016 51017 var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; 51018 var slice = Array.prototype.slice; 51019 var toStr = Object.prototype.toString; 51020 var funcType = '[object Function]'; 51021 51022 module.exports = function bind(that) { 51023 var target = this; 51024 if (typeof target !== 'function' || toStr.call(target) !== funcType) { 51025 throw new TypeError(ERROR_MESSAGE + target); 51026 } 51027 var args = slice.call(arguments, 1); 51028 51029 var bound; 51030 var binder = function () { 51031 if (this instanceof bound) { 51032 var result = target.apply( 51033 this, 51034 args.concat(slice.call(arguments)) 51035 ); 51036 if (Object(result) === result) { 51037 return result; 51038 } 51039 return this; 51040 } else { 51041 return target.apply( 51042 that, 51043 args.concat(slice.call(arguments)) 51044 ); 51045 } 51046 }; 51047 51048 var boundLength = Math.max(0, target.length - args.length); 51049 var boundArgs = []; 51050 for (var i = 0; i < boundLength; i++) { 51051 boundArgs.push('$' + i); 51052 } 51053 51054 bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); 51055 51056 if (target.prototype) { 51057 var Empty = function Empty() {}; 51058 Empty.prototype = target.prototype; 51059 bound.prototype = new Empty(); 51060 Empty.prototype = null; 51061 } 51062 51063 return bound; 51064 }; 51065 51066 51067 /***/ }), 51068 51069 /***/ "aU41": 51070 /***/ (function(module, __webpack_exports__, __webpack_require__) { 51071 51072 "use strict"; 51073 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useForkRef; }); 51074 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd"); 51075 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 51076 51077 51078 // https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js 51079 51080 function setRef(ref, value) { 51081 if (value === void 0) { 51082 value = null; 51083 } 51084 51085 if (!ref) return; 51086 51087 if (typeof ref === "function") { 51088 ref(value); 51089 } else { 51090 ref.current = value; 51091 } 51092 } 51093 /** 51094 * Merges up to two React Refs into a single memoized function React Ref so you 51095 * can pass it to an element. 51096 * 51097 * @example 51098 * import React from "react"; 51099 * import { useForkRef } from "reakit-utils"; 51100 * 51101 * const Component = React.forwardRef((props, ref) => { 51102 * const internalRef = React.useRef(); 51103 * return <div {...props} ref={useForkRef(internalRef, ref)} />; 51104 * }); 51105 */ 51106 51107 51108 function useForkRef(refA, refB) { 51109 return Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () { 51110 if (refA == null && refB == null) { 51111 return null; 51112 } 51113 51114 return function (value) { 51115 setRef(refA, value); 51116 setRef(refB, value); 51117 }; 51118 }, [refA, refB]); 51119 } 51120 51121 51122 51123 51124 /***/ }), 51125 51126 /***/ "aUaa": 51127 /***/ (function(module, exports, __webpack_require__) { 51128 51129 "use strict"; 51130 51131 51132 var GetIntrinsic = __webpack_require__("v7lB"); 51133 51134 var $TypeError = GetIntrinsic('%TypeError%'); 51135 51136 // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 51137 51138 module.exports = function CheckObjectCoercible(value, optMessage) { 51139 if (value == null) { 51140 throw new $TypeError(optMessage || ('Cannot call method on ' + value)); 51141 } 51142 return value; 51143 }; 51144 51145 51146 /***/ }), 51147 51148 /***/ "aenO": 51149 /***/ (function(module, exports, __webpack_require__) { 51150 51151 "use strict"; 51152 51153 51154 var GetIntrinsic = __webpack_require__("rZ7t"); 51155 51156 var $TypeError = GetIntrinsic('%TypeError%'); 51157 51158 var IsPropertyKey = __webpack_require__("i10q"); 51159 var Type = __webpack_require__("V1cy"); 51160 51161 // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty 51162 51163 module.exports = function HasProperty(O, P) { 51164 if (Type(O) !== 'Object') { 51165 throw new $TypeError('Assertion failed: `O` must be an Object'); 51166 } 51167 if (!IsPropertyKey(P)) { 51168 throw new $TypeError('Assertion failed: `P` must be a Property Key'); 51169 } 51170 return P in O; 51171 }; 51172 51173 51174 /***/ }), 51175 51176 /***/ "agUq": 51177 /***/ (function(module, exports, __webpack_require__) { 51178 51179 "use strict"; 51180 51181 51182 // http://262.ecma-international.org/5.1/#sec-9.11 51183 51184 module.exports = __webpack_require__("Asd8"); 51185 51186 51187 /***/ }), 51188 51189 /***/ "ald4": 51190 /***/ (function(module, exports, __webpack_require__) { 51191 51192 "use strict"; 51193 51194 51195 var $isNaN = Number.isNaN || function (a) { return a !== a; }; 51196 51197 module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; 51198 51199 51200 /***/ }), 51201 51202 /***/ "bWcr": 51203 /***/ (function(module, __webpack_exports__, __webpack_require__) { 51204 51205 "use strict"; 51206 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 51207 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 51208 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 51209 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 51210 51211 51212 /** 51213 * WordPress dependencies 51214 */ 51215 51216 const closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 51217 xmlns: "http://www.w3.org/2000/svg", 51218 viewBox: "0 0 24 24" 51219 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 51220 d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" 51221 })); 51222 /* harmony default export */ __webpack_exports__["a"] = (closeSmall); 51223 51224 51225 /***/ }), 51226 51227 /***/ "c6aN": 51228 /***/ (function(module, exports, __webpack_require__) { 51229 51230 var moment = __webpack_require__("wy2R"); 51231 51232 function isValidMoment(testMoment) { 51233 if (typeof moment.isMoment === 'function' && !moment.isMoment(testMoment)) { 51234 return false; 51235 } 51236 51237 /* istanbul ignore else */ 51238 if (typeof testMoment.isValid === 'function') { 51239 // moment 1.7.0+ 51240 return testMoment.isValid(); 51241 } 51242 51243 /* istanbul ignore next */ 51244 return !isNaN(testMoment); 51245 } 51246 51247 module.exports = { 51248 isValidMoment : isValidMoment, 51249 }; 51250 51251 51252 /***/ }), 51253 51254 /***/ "cD2C": 51255 /***/ (function(module, exports, __webpack_require__) { 51256 51257 "use strict"; 51258 51259 51260 if (true) { 51261 module.exports = __webpack_require__("5aBA"); 51262 } else {} 51263 51264 51265 /***/ }), 51266 51267 /***/ "cDcd": 51268 /***/ (function(module, exports) { 51269 51270 (function() { module.exports = window["React"]; }()); 51271 51272 /***/ }), 51273 51274 /***/ "cGtP": 51275 /***/ (function(module, __webpack_exports__, __webpack_require__) { 51276 51277 "use strict"; 51278 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 51279 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 51280 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 51281 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 51282 51283 51284 /** 51285 * WordPress dependencies 51286 */ 51287 51288 const search = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 51289 xmlns: "http://www.w3.org/2000/svg", 51290 viewBox: "0 0 24 24" 51291 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 51292 d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z" 51293 })); 51294 /* harmony default export */ __webpack_exports__["a"] = (search); 51295 51296 51297 /***/ }), 51298 51299 /***/ "dRQD": 51300 /***/ (function(module, exports, __webpack_require__) { 51301 51302 "use strict"; 51303 51304 51305 Object.defineProperty(exports, "__esModule", { 51306 value: true 51307 }); 51308 exports['default'] = isTransitionEndSupported; 51309 function isTransitionEndSupported() { 51310 return !!(typeof window !== 'undefined' && 'TransitionEvent' in window); 51311 } 51312 51313 /***/ }), 51314 51315 /***/ "dSD1": 51316 /***/ (function(module, __webpack_exports__, __webpack_require__) { 51317 51318 "use strict"; 51319 51320 // EXPORTS 51321 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; }); 51322 __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ slot_fill_Slot; }); 51323 __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ Provider; }); 51324 __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createSlotFill; }); 51325 51326 // UNUSED EXPORTS: useSlot 51327 51328 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 51329 var esm_extends = __webpack_require__("wx14"); 51330 51331 // EXTERNAL MODULE: external ["wp","element"] 51332 var external_wp_element_ = __webpack_require__("GRId"); 51333 51334 // EXTERNAL MODULE: external "lodash" 51335 var external_lodash_ = __webpack_require__("YLtl"); 51336 51337 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js 51338 /** 51339 * WordPress dependencies 51340 */ 51341 51342 const SlotFillContext = Object(external_wp_element_["createContext"])({ 51343 registerSlot: () => {}, 51344 unregisterSlot: () => {}, 51345 registerFill: () => {}, 51346 unregisterFill: () => {}, 51347 getSlot: () => {}, 51348 getFills: () => {}, 51349 subscribe: () => {} 51350 }); 51351 /* harmony default export */ var context = (SlotFillContext); 51352 51353 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/use-slot.js 51354 /** 51355 * WordPress dependencies 51356 */ 51357 51358 /** 51359 * Internal dependencies 51360 */ 51361 51362 51363 /** 51364 * React hook returning the active slot given a name. 51365 * 51366 * @param {string} name Slot name. 51367 * @return {Object} Slot object. 51368 */ 51369 51370 const useSlot = name => { 51371 const { 51372 getSlot, 51373 subscribe 51374 } = Object(external_wp_element_["useContext"])(context); 51375 const [slot, setSlot] = Object(external_wp_element_["useState"])(getSlot(name)); 51376 Object(external_wp_element_["useEffect"])(() => { 51377 setSlot(getSlot(name)); 51378 const unsubscribe = subscribe(() => { 51379 setSlot(getSlot(name)); 51380 }); 51381 return unsubscribe; 51382 }, [name]); 51383 return slot; 51384 }; 51385 51386 /* harmony default export */ var use_slot = (useSlot); 51387 51388 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js 51389 51390 51391 51392 /** 51393 * External dependencies 51394 */ 51395 51396 /** 51397 * WordPress dependencies 51398 */ 51399 51400 51401 /** 51402 * Internal dependencies 51403 */ 51404 51405 51406 51407 51408 function fill_FillComponent({ 51409 name, 51410 children, 51411 registerFill, 51412 unregisterFill 51413 }) { 51414 const slot = use_slot(name); 51415 const ref = Object(external_wp_element_["useRef"])({ 51416 name, 51417 children 51418 }); 51419 Object(external_wp_element_["useLayoutEffect"])(() => { 51420 registerFill(name, ref.current); 51421 return () => unregisterFill(name, ref.current); 51422 }, []); 51423 Object(external_wp_element_["useLayoutEffect"])(() => { 51424 ref.current.children = children; 51425 51426 if (slot) { 51427 slot.forceUpdate(); 51428 } 51429 }, [children]); 51430 Object(external_wp_element_["useLayoutEffect"])(() => { 51431 if (name === ref.current.name) { 51432 // ignore initial effect 51433 return; 51434 } 51435 51436 unregisterFill(ref.current.name, ref.current); 51437 ref.current.name = name; 51438 registerFill(name, ref.current); 51439 }, [name]); 51440 51441 if (!slot || !slot.node) { 51442 return null; 51443 } // If a function is passed as a child, provide it with the fillProps. 51444 51445 51446 if (Object(external_lodash_["isFunction"])(children)) { 51447 children = children(slot.props.fillProps); 51448 } 51449 51450 return Object(external_wp_element_["createPortal"])(children, slot.node); 51451 } 51452 51453 const Fill = props => Object(external_wp_element_["createElement"])(context.Consumer, null, ({ 51454 registerFill, 51455 unregisterFill 51456 }) => Object(external_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, { 51457 registerFill: registerFill, 51458 unregisterFill: unregisterFill 51459 }))); 51460 51461 /* harmony default export */ var slot_fill_fill = (Fill); 51462 51463 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js 51464 51465 51466 51467 /** 51468 * External dependencies 51469 */ 51470 51471 /** 51472 * WordPress dependencies 51473 */ 51474 51475 51476 /** 51477 * Internal dependencies 51478 */ 51479 51480 51481 51482 class slot_SlotComponent extends external_wp_element_["Component"] { 51483 constructor() { 51484 super(...arguments); 51485 this.isUnmounted = false; 51486 this.bindNode = this.bindNode.bind(this); 51487 } 51488 51489 componentDidMount() { 51490 const { 51491 registerSlot 51492 } = this.props; 51493 registerSlot(this.props.name, this); 51494 } 51495 51496 componentWillUnmount() { 51497 const { 51498 unregisterSlot 51499 } = this.props; 51500 this.isUnmounted = true; 51501 unregisterSlot(this.props.name, this); 51502 } 51503 51504 componentDidUpdate(prevProps) { 51505 const { 51506 name, 51507 unregisterSlot, 51508 registerSlot 51509 } = this.props; 51510 51511 if (prevProps.name !== name) { 51512 unregisterSlot(prevProps.name); 51513 registerSlot(name, this); 51514 } 51515 } 51516 51517 bindNode(node) { 51518 this.node = node; 51519 } 51520 51521 forceUpdate() { 51522 if (this.isUnmounted) { 51523 return; 51524 } 51525 51526 super.forceUpdate(); 51527 } 51528 51529 render() { 51530 const { 51531 children, 51532 name, 51533 fillProps = {}, 51534 getFills 51535 } = this.props; 51536 const fills = Object(external_lodash_["map"])(getFills(name, this), fill => { 51537 const fillChildren = Object(external_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children; 51538 return external_wp_element_["Children"].map(fillChildren, (child, childIndex) => { 51539 if (!child || Object(external_lodash_["isString"])(child)) { 51540 return child; 51541 } 51542 51543 const childKey = child.key || childIndex; 51544 return Object(external_wp_element_["cloneElement"])(child, { 51545 key: childKey 51546 }); 51547 }); 51548 }).filter( // In some cases fills are rendered only when some conditions apply. 51549 // This ensures that we only use non-empty fills when rendering, i.e., 51550 // it allows us to render wrappers only when the fills are actually present. 51551 Object(external_lodash_["negate"])(external_wp_element_["isEmptyElement"])); 51552 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_lodash_["isFunction"])(children) ? children(fills) : fills); 51553 } 51554 51555 } 51556 51557 const Slot = props => Object(external_wp_element_["createElement"])(context.Consumer, null, ({ 51558 registerSlot, 51559 unregisterSlot, 51560 getFills 51561 }) => Object(external_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, { 51562 registerSlot: registerSlot, 51563 unregisterSlot: unregisterSlot, 51564 getFills: getFills 51565 }))); 51566 51567 /* harmony default export */ var slot_fill_slot = (Slot); 51568 51569 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js 51570 var bubbles_virtually_use_slot = __webpack_require__("+WFq"); 51571 51572 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js 51573 /** 51574 * WordPress dependencies 51575 */ 51576 51577 /** 51578 * Internal dependencies 51579 */ 51580 51581 51582 51583 function useForceUpdate() { 51584 const [, setState] = Object(external_wp_element_["useState"])({}); 51585 const mounted = Object(external_wp_element_["useRef"])(true); 51586 Object(external_wp_element_["useEffect"])(() => { 51587 return () => { 51588 mounted.current = false; 51589 }; 51590 }, []); 51591 return () => { 51592 if (mounted.current) { 51593 setState({}); 51594 } 51595 }; 51596 } 51597 51598 function fill_Fill({ 51599 name, 51600 children 51601 }) { 51602 const slot = Object(bubbles_virtually_use_slot["a" /* default */])(name); 51603 const ref = Object(external_wp_element_["useRef"])({ 51604 rerender: useForceUpdate() 51605 }); 51606 Object(external_wp_element_["useEffect"])(() => { 51607 // We register fills so we can keep track of their existance. 51608 // Some Slot implementations need to know if there're already fills 51609 // registered so they can choose to render themselves or not. 51610 slot.registerFill(ref); 51611 return () => { 51612 slot.unregisterFill(ref); 51613 }; 51614 }, [slot.registerFill, slot.unregisterFill]); 51615 51616 if (!slot.ref || !slot.ref.current) { 51617 return null; 51618 } 51619 51620 if (typeof children === 'function') { 51621 children = children(slot.fillProps); 51622 } 51623 51624 return Object(external_wp_element_["createPortal"])(children, slot.ref.current); 51625 } 51626 51627 // EXTERNAL MODULE: external ["wp","compose"] 51628 var external_wp_compose_ = __webpack_require__("K9lf"); 51629 51630 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js 51631 var slot_fill_context = __webpack_require__("JYkG"); 51632 51633 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js 51634 51635 51636 51637 /** 51638 * WordPress dependencies 51639 */ 51640 51641 51642 /** 51643 * Internal dependencies 51644 */ 51645 51646 51647 51648 function slot_Slot({ 51649 name, 51650 fillProps = {}, 51651 as: Component = 'div', 51652 ...props 51653 }, forwardedRef) { 51654 const registry = Object(external_wp_element_["useContext"])(slot_fill_context["a" /* default */]); 51655 const ref = Object(external_wp_element_["useRef"])(); 51656 Object(external_wp_element_["useLayoutEffect"])(() => { 51657 registry.registerSlot(name, ref, fillProps); 51658 return () => { 51659 registry.unregisterSlot(name, ref); 51660 }; // We are not including fillProps in the deps because we don't want to 51661 // unregister and register the slot whenever fillProps change, which would 51662 // cause the fill to be re-mounted. We are only considering the initial value 51663 // of fillProps. 51664 }, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we 51665 // useLayoutEffect 51666 51667 Object(external_wp_element_["useLayoutEffect"])(() => { 51668 registry.updateSlot(name, fillProps); 51669 }); 51670 return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({ 51671 ref: Object(external_wp_compose_["useMergeRefs"])([forwardedRef, ref]) 51672 }, props)); 51673 } 51674 51675 /* harmony default export */ var bubbles_virtually_slot = (Object(external_wp_element_["forwardRef"])(slot_Slot)); 51676 51677 // EXTERNAL MODULE: external ["wp","isShallowEqual"] 51678 var external_wp_isShallowEqual_ = __webpack_require__("rl8x"); 51679 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_); 51680 51681 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js 51682 51683 51684 /** 51685 * WordPress dependencies 51686 */ 51687 51688 51689 /** 51690 * Internal dependencies 51691 */ 51692 51693 51694 51695 function useSlotRegistry() { 51696 const [slots, setSlots] = Object(external_wp_element_["useState"])({}); 51697 const [fills, setFills] = Object(external_wp_element_["useState"])({}); 51698 const registerSlot = Object(external_wp_element_["useCallback"])((name, ref, fillProps) => { 51699 setSlots(prevSlots => { 51700 const slot = prevSlots[name] || {}; 51701 return { ...prevSlots, 51702 [name]: { ...slot, 51703 ref: ref || slot.ref, 51704 fillProps: fillProps || slot.fillProps || {} 51705 } 51706 }; 51707 }); 51708 }, []); 51709 const unregisterSlot = Object(external_wp_element_["useCallback"])((name, ref) => { 51710 setSlots(prevSlots => { 51711 const { 51712 [name]: slot, 51713 ...nextSlots 51714 } = prevSlots; // Make sure we're not unregistering a slot registered by another element 51715 // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 51716 51717 if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) { 51718 return nextSlots; 51719 } 51720 51721 return prevSlots; 51722 }); 51723 }, []); 51724 const updateSlot = Object(external_wp_element_["useCallback"])((name, fillProps) => { 51725 const slot = slots[name]; 51726 51727 if (!slot) { 51728 return; 51729 } 51730 51731 if (!external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) { 51732 slot.fillProps = fillProps; 51733 const slotFills = fills[name]; 51734 51735 if (slotFills) { 51736 // Force update fills 51737 slotFills.map(fill => fill.current.rerender()); 51738 } 51739 } 51740 }, [slots, fills]); 51741 const registerFill = Object(external_wp_element_["useCallback"])((name, ref) => { 51742 setFills(prevFills => ({ ...prevFills, 51743 [name]: [...(prevFills[name] || []), ref] 51744 })); 51745 }, []); 51746 const unregisterFill = Object(external_wp_element_["useCallback"])((name, ref) => { 51747 setFills(prevFills => { 51748 if (prevFills[name]) { 51749 return { ...prevFills, 51750 [name]: prevFills[name].filter(fillRef => fillRef !== ref) 51751 }; 51752 } 51753 51754 return prevFills; 51755 }); 51756 }, []); // Memoizing the return value so it can be directly passed to Provider value 51757 51758 const registry = Object(external_wp_element_["useMemo"])(() => ({ 51759 slots, 51760 fills, 51761 registerSlot, 51762 updateSlot, 51763 unregisterSlot, 51764 registerFill, 51765 unregisterFill 51766 }), [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]); 51767 return registry; 51768 } 51769 51770 function slot_fill_provider_SlotFillProvider({ 51771 children 51772 }) { 51773 const registry = useSlotRegistry(); 51774 return Object(external_wp_element_["createElement"])(slot_fill_context["a" /* default */].Provider, { 51775 value: registry 51776 }, children); 51777 } 51778 51779 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js 51780 51781 51782 /** 51783 * External dependencies 51784 */ 51785 51786 /** 51787 * WordPress dependencies 51788 */ 51789 51790 51791 /** 51792 * Internal dependencies 51793 */ 51794 51795 51796 class provider_SlotFillProvider extends external_wp_element_["Component"] { 51797 constructor() { 51798 super(...arguments); 51799 this.registerSlot = this.registerSlot.bind(this); 51800 this.registerFill = this.registerFill.bind(this); 51801 this.unregisterSlot = this.unregisterSlot.bind(this); 51802 this.unregisterFill = this.unregisterFill.bind(this); 51803 this.getSlot = this.getSlot.bind(this); 51804 this.getFills = this.getFills.bind(this); 51805 this.hasFills = this.hasFills.bind(this); 51806 this.subscribe = this.subscribe.bind(this); 51807 this.slots = {}; 51808 this.fills = {}; 51809 this.listeners = []; 51810 this.contextValue = { 51811 registerSlot: this.registerSlot, 51812 unregisterSlot: this.unregisterSlot, 51813 registerFill: this.registerFill, 51814 unregisterFill: this.unregisterFill, 51815 getSlot: this.getSlot, 51816 getFills: this.getFills, 51817 hasFills: this.hasFills, 51818 subscribe: this.subscribe 51819 }; 51820 } 51821 51822 registerSlot(name, slot) { 51823 const previousSlot = this.slots[name]; 51824 this.slots[name] = slot; 51825 this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot 51826 // But before the registerSlot call, we need to rerender the slot 51827 51828 this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the 51829 // same name exists, force its update _after_ the new slot has been 51830 // assigned into the instance, such that its own rendering of children 51831 // will be empty (the new Slot will subsume all fills for this name). 51832 51833 if (previousSlot) { 51834 previousSlot.forceUpdate(); 51835 } 51836 } 51837 51838 registerFill(name, instance) { 51839 this.fills[name] = [...(this.fills[name] || []), instance]; 51840 this.forceUpdateSlot(name); 51841 } 51842 51843 unregisterSlot(name, instance) { 51844 // If a previous instance of a Slot by this name unmounts, do nothing, 51845 // as the slot and its fills should only be removed for the current 51846 // known instance. 51847 if (this.slots[name] !== instance) { 51848 return; 51849 } 51850 51851 delete this.slots[name]; 51852 this.triggerListeners(); 51853 } 51854 51855 unregisterFill(name, instance) { 51856 this.fills[name] = Object(external_lodash_["without"])(this.fills[name], instance); 51857 this.forceUpdateSlot(name); 51858 } 51859 51860 getSlot(name) { 51861 return this.slots[name]; 51862 } 51863 51864 getFills(name, slotInstance) { 51865 // Fills should only be returned for the current instance of the slot 51866 // in which they occupy. 51867 if (this.slots[name] !== slotInstance) { 51868 return []; 51869 } 51870 51871 return this.fills[name]; 51872 } 51873 51874 hasFills(name) { 51875 return this.fills[name] && !!this.fills[name].length; 51876 } 51877 51878 forceUpdateSlot(name) { 51879 const slot = this.getSlot(name); 51880 51881 if (slot) { 51882 slot.forceUpdate(); 51883 } 51884 } 51885 51886 triggerListeners() { 51887 this.listeners.forEach(listener => listener()); 51888 } 51889 51890 subscribe(listener) { 51891 this.listeners.push(listener); 51892 return () => { 51893 this.listeners = Object(external_lodash_["without"])(this.listeners, listener); 51894 }; 51895 } 51896 51897 render() { 51898 return Object(external_wp_element_["createElement"])(context.Provider, { 51899 value: this.contextValue 51900 }, this.props.children); 51901 } 51902 51903 } 51904 51905 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js 51906 51907 51908 51909 /** 51910 * WordPress dependencies 51911 */ 51912 51913 /** 51914 * Internal dependencies 51915 */ 51916 51917 51918 51919 51920 51921 51922 51923 51924 function slot_fill_Fill(props) { 51925 // We're adding both Fills here so they can register themselves before 51926 // their respective slot has been registered. Only the Fill that has a slot 51927 // will render. The other one will return null. 51928 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(slot_fill_fill, props), Object(external_wp_element_["createElement"])(fill_Fill, props)); 51929 } 51930 const slot_fill_Slot = Object(external_wp_element_["forwardRef"])(({ 51931 bubblesVirtually, 51932 ...props 51933 }, ref) => { 51934 if (bubblesVirtually) { 51935 return Object(external_wp_element_["createElement"])(bubbles_virtually_slot, Object(esm_extends["a" /* default */])({}, props, { 51936 ref: ref 51937 })); 51938 } 51939 51940 return Object(external_wp_element_["createElement"])(slot_fill_slot, props); 51941 }); 51942 function Provider({ 51943 children, 51944 ...props 51945 }) { 51946 return Object(external_wp_element_["createElement"])(provider_SlotFillProvider, props, Object(external_wp_element_["createElement"])(slot_fill_provider_SlotFillProvider, null, children)); 51947 } 51948 function createSlotFill(name) { 51949 const FillComponent = props => Object(external_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({ 51950 name: name 51951 }, props)); 51952 51953 FillComponent.displayName = name + 'Fill'; 51954 51955 const SlotComponent = props => Object(external_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({ 51956 name: name 51957 }, props)); 51958 51959 SlotComponent.displayName = name + 'Slot'; 51960 SlotComponent.__unstableName = name; 51961 return { 51962 Fill: FillComponent, 51963 Slot: SlotComponent 51964 }; 51965 } 51966 51967 51968 51969 /***/ }), 51970 51971 /***/ "ddK1": 51972 /***/ (function(module, exports, __webpack_require__) { 51973 51974 "use strict"; 51975 51976 51977 var ES5ToInteger = __webpack_require__("Wfh+"); 51978 51979 var ToNumber = __webpack_require__("xCFm"); 51980 51981 // https://262.ecma-international.org/11.0/#sec-tointeger 51982 51983 module.exports = function ToInteger(value) { 51984 var number = ToNumber(value); 51985 if (number !== 0) { 51986 number = ES5ToInteger(number); 51987 } 51988 return number === 0 ? 0 : number; 51989 }; 51990 51991 51992 /***/ }), 51993 51994 /***/ "eBsn": 51995 /***/ (function(module, exports, __webpack_require__) { 51996 51997 "use strict"; 51998 51999 52000 var has = __webpack_require__("oNNP"); 52001 52002 var GetIntrinsic = __webpack_require__("rZ7t"); 52003 52004 var $TypeError = GetIntrinsic('%TypeError%'); 52005 52006 var Type = __webpack_require__("V1cy"); 52007 var ToBoolean = __webpack_require__("kvlw"); 52008 var IsCallable = __webpack_require__("agUq"); 52009 52010 // https://262.ecma-international.org/5.1/#sec-8.10.5 52011 52012 module.exports = function ToPropertyDescriptor(Obj) { 52013 if (Type(Obj) !== 'Object') { 52014 throw new $TypeError('ToPropertyDescriptor requires an object'); 52015 } 52016 52017 var desc = {}; 52018 if (has(Obj, 'enumerable')) { 52019 desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); 52020 } 52021 if (has(Obj, 'configurable')) { 52022 desc['[[Configurable]]'] = ToBoolean(Obj.configurable); 52023 } 52024 if (has(Obj, 'value')) { 52025 desc['[[Value]]'] = Obj.value; 52026 } 52027 if (has(Obj, 'writable')) { 52028 desc['[[Writable]]'] = ToBoolean(Obj.writable); 52029 } 52030 if (has(Obj, 'get')) { 52031 var getter = Obj.get; 52032 if (typeof getter !== 'undefined' && !IsCallable(getter)) { 52033 throw new $TypeError('getter must be a function'); 52034 } 52035 desc['[[Get]]'] = getter; 52036 } 52037 if (has(Obj, 'set')) { 52038 var setter = Obj.set; 52039 if (typeof setter !== 'undefined' && !IsCallable(setter)) { 52040 throw new $TypeError('setter must be a function'); 52041 } 52042 desc['[[Set]]'] = setter; 52043 } 52044 52045 if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { 52046 throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); 52047 } 52048 return desc; 52049 }; 52050 52051 52052 /***/ }), 52053 52054 /***/ "eJkf": 52055 /***/ (function(module, exports, __webpack_require__) { 52056 52057 "use strict"; 52058 52059 52060 /* eslint complexity: [2, 18], max-statements: [2, 33] */ 52061 module.exports = function hasSymbols() { 52062 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 52063 if (typeof Symbol.iterator === 'symbol') { return true; } 52064 52065 var obj = {}; 52066 var sym = Symbol('test'); 52067 var symObj = Object(sym); 52068 if (typeof sym === 'string') { return false; } 52069 52070 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 52071 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 52072 52073 // temp disabled per https://github.com/ljharb/object.assign/issues/17 52074 // if (sym instanceof Symbol) { return false; } 52075 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 52076 // if (!(symObj instanceof Symbol)) { return false; } 52077 52078 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 52079 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 52080 52081 var symVal = 42; 52082 obj[sym] = symVal; 52083 for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 52084 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 52085 52086 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 52087 52088 var syms = Object.getOwnPropertySymbols(obj); 52089 if (syms.length !== 1 || syms[0] !== sym) { return false; } 52090 52091 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 52092 52093 if (typeof Object.getOwnPropertyDescriptor === 'function') { 52094 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 52095 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 52096 } 52097 52098 return true; 52099 }; 52100 52101 52102 /***/ }), 52103 52104 /***/ "eNtd": 52105 /***/ (function(module, __webpack_exports__, __webpack_require__) { 52106 52107 "use strict"; 52108 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useLiveRef; }); 52109 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd"); 52110 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 52111 /* harmony import */ var _useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("AXvK"); 52112 52113 52114 52115 52116 52117 52118 /** 52119 * A `React.Ref` that keeps track of the passed `value`. 52120 */ 52121 52122 function useLiveRef(value) { 52123 var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value); 52124 Object(_useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__[/* useIsomorphicEffect */ "a"])(function () { 52125 ref.current = value; 52126 }); 52127 return ref; 52128 } 52129 52130 52131 52132 52133 /***/ }), 52134 52135 /***/ "eOFJ": 52136 /***/ (function(module, exports, __webpack_require__) { 52137 52138 "use strict"; 52139 52140 52141 var GetIntrinsic = __webpack_require__("rZ7t"); 52142 52143 var $TypeError = GetIntrinsic('%TypeError%'); 52144 52145 var isPropertyDescriptor = __webpack_require__("Qmvf"); 52146 var DefineOwnProperty = __webpack_require__("wTIp"); 52147 52148 var FromPropertyDescriptor = __webpack_require__("zYbv"); 52149 var IsAccessorDescriptor = __webpack_require__("z3X9"); 52150 var IsDataDescriptor = __webpack_require__("CGNl"); 52151 var IsPropertyKey = __webpack_require__("i10q"); 52152 var SameValue = __webpack_require__("HI8u"); 52153 var ToPropertyDescriptor = __webpack_require__("eBsn"); 52154 var Type = __webpack_require__("V1cy"); 52155 52156 // https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow 52157 52158 module.exports = function DefinePropertyOrThrow(O, P, desc) { 52159 if (Type(O) !== 'Object') { 52160 throw new $TypeError('Assertion failed: Type(O) is not Object'); 52161 } 52162 52163 if (!IsPropertyKey(P)) { 52164 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); 52165 } 52166 52167 var Desc = isPropertyDescriptor({ 52168 Type: Type, 52169 IsDataDescriptor: IsDataDescriptor, 52170 IsAccessorDescriptor: IsAccessorDescriptor 52171 }, desc) ? desc : ToPropertyDescriptor(desc); 52172 if (!isPropertyDescriptor({ 52173 Type: Type, 52174 IsDataDescriptor: IsDataDescriptor, 52175 IsAccessorDescriptor: IsAccessorDescriptor 52176 }, Desc)) { 52177 throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); 52178 } 52179 52180 return DefineOwnProperty( 52181 IsDataDescriptor, 52182 SameValue, 52183 FromPropertyDescriptor, 52184 O, 52185 P, 52186 Desc 52187 ); 52188 }; 52189 52190 52191 /***/ }), 52192 52193 /***/ "eUCI": 52194 /***/ (function(module, __webpack_exports__, __webpack_require__) { 52195 52196 "use strict"; 52197 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SystemContext; }); 52198 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd"); 52199 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 52200 52201 52202 var SystemContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])({}); 52203 52204 52205 52206 52207 /***/ }), 52208 52209 /***/ "fW1L": 52210 /***/ (function(module, exports, __webpack_require__) { 52211 52212 "use strict"; 52213 52214 52215 var GetIntrinsic = __webpack_require__("rZ7t"); 52216 var callBound = __webpack_require__("EXo9"); 52217 52218 var $TypeError = GetIntrinsic('%TypeError%'); 52219 52220 var IsArray = __webpack_require__("9cOx"); 52221 52222 var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); 52223 52224 // https://ecma-international.org/ecma-262/6.0/#sec-call 52225 52226 module.exports = function Call(F, V) { 52227 var argumentsList = arguments.length > 2 ? arguments[2] : []; 52228 if (!IsArray(argumentsList)) { 52229 throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List'); 52230 } 52231 return $apply(F, V, argumentsList); 52232 }; 52233 52234 52235 /***/ }), 52236 52237 /***/ "g56x": 52238 /***/ (function(module, exports) { 52239 52240 (function() { module.exports = window["wp"]["hooks"]; }()); 52241 52242 /***/ }), 52243 52244 /***/ "gZI3": 52245 /***/ (function(module, exports, __webpack_require__) { 52246 52247 "use strict"; 52248 52249 52250 Object.defineProperty(exports, "__esModule", { 52251 value: true 52252 }); 52253 52254 var _react = __webpack_require__("cDcd"); 52255 52256 var _react2 = _interopRequireDefault(_react); 52257 52258 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 52259 52260 var RightArrow = function () { 52261 function RightArrow(props) { 52262 return _react2['default'].createElement( 52263 'svg', 52264 props, 52265 _react2['default'].createElement('path', { 52266 d: 'M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z' 52267 }) 52268 ); 52269 } 52270 52271 return RightArrow; 52272 }(); 52273 52274 RightArrow.defaultProps = { 52275 viewBox: '0 0 1000 1000' 52276 }; 52277 exports['default'] = RightArrow; 52278 52279 /***/ }), 52280 52281 /***/ "gdqT": 52282 /***/ (function(module, exports) { 52283 52284 (function() { module.exports = window["wp"]["a11y"]; }()); 52285 52286 /***/ }), 52287 52288 /***/ "h6xH": 52289 /***/ (function(module, exports, __webpack_require__) { 52290 52291 "use strict"; 52292 52293 52294 Object.defineProperty(exports, "__esModule", { 52295 value: true 52296 }); 52297 exports['default'] = isBeforeDay; 52298 52299 var _moment = __webpack_require__("wy2R"); 52300 52301 var _moment2 = _interopRequireDefault(_moment); 52302 52303 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 52304 52305 function isBeforeDay(a, b) { 52306 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 52307 52308 var aYear = a.year(); 52309 var aMonth = a.month(); 52310 52311 var bYear = b.year(); 52312 var bMonth = b.month(); 52313 52314 var isSameYear = aYear === bYear; 52315 var isSameMonth = aMonth === bMonth; 52316 52317 if (isSameYear && isSameMonth) return a.date() < b.date(); 52318 if (isSameYear) return aMonth < bMonth; 52319 return aYear < bYear; 52320 } 52321 52322 /***/ }), 52323 52324 /***/ "hE48": 52325 /***/ (function(module, __webpack_exports__, __webpack_require__) { 52326 52327 "use strict"; 52328 52329 // EXPORTS 52330 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createComponent; }); 52331 52332 // EXTERNAL MODULE: external "React" 52333 var external_React_ = __webpack_require__("cDcd"); 52334 52335 // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js 52336 var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__("RDTF"); 52337 52338 // EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js 52339 var useCreateElement = __webpack_require__("IVEb"); 52340 52341 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js 52342 var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("I/A+"); 52343 52344 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js 52345 var isObject = __webpack_require__("Ptb8"); 52346 52347 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPlainObject.js 52348 52349 52350 /** 52351 * Checks whether `arg` is a plain object or not. 52352 * 52353 * @returns {boolean} 52354 */ 52355 52356 function isPlainObject(arg) { 52357 var _proto$constructor; 52358 52359 if (!Object(isObject["a" /* isObject */])(arg)) return false; 52360 var proto = Object.getPrototypeOf(arg); 52361 if (proto == null) return true; 52362 return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString(); 52363 } 52364 52365 52366 52367 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js 52368 52369 52370 52371 52372 /** 52373 * Splits an object (`props`) into a tuple where the first item is an object 52374 * with the passed `keys`, and the second item is an object with these keys 52375 * omitted. 52376 * 52377 * @deprecated will be removed in version 2 52378 * 52379 * @example 52380 * import { splitProps } from "reakit-utils"; 52381 * 52382 * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] 52383 */ 52384 52385 function __deprecatedSplitProps(props, keys) { 52386 var propsKeys = Object.keys(props); 52387 var picked = {}; 52388 var omitted = {}; 52389 52390 for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) { 52391 var key = _propsKeys[_i]; 52392 52393 if (keys.indexOf(key) >= 0) { 52394 picked[key] = props[key]; 52395 } else { 52396 omitted[key] = props[key]; 52397 } 52398 } 52399 52400 return [picked, omitted]; 52401 } 52402 /** 52403 * Splits an object (`props`) into a tuple where the first item 52404 * is the `state` property, and the second item is the rest of the properties. 52405 * 52406 * It is also backward compatible with version 1. If `keys` are passed then 52407 * splits an object (`props`) into a tuple where the first item is an object 52408 * with the passed `keys`, and the second item is an object with these keys 52409 * omitted. 52410 * 52411 * @example 52412 * import { splitProps } from "reakit-utils"; 52413 * 52414 * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] 52415 * 52416 * @example 52417 * import { splitProps } from "reakit-utils"; 52418 * 52419 * splitProps({ state: { a: "a" }, b: "b" }); // [{ a: "a" }, { b: "b" }] 52420 */ 52421 52422 52423 function splitProps(props, keys) { 52424 if (keys === void 0) { 52425 keys = []; 52426 } 52427 52428 if (!isPlainObject(props.state)) { 52429 return __deprecatedSplitProps(props, keys); 52430 } 52431 52432 var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, ["state"])), 52433 picked = _deprecatedSplitProp[0], 52434 omitted = _deprecatedSplitProp[1]; 52435 52436 var state = picked.state, 52437 restPicked = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(picked, ["state"]); 52438 52439 return [Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), restPicked), omitted]; 52440 } 52441 52442 52443 52444 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js 52445 var shallowEqual = __webpack_require__("uqqE"); 52446 52447 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/normalizePropsAreEqual.js 52448 52449 52450 52451 52452 /** 52453 * This higher order functions take `propsAreEqual` function and 52454 * returns a new function which normalizes the props. 52455 * 52456 * Normalizing in our case is making sure the `propsAreEqual` works with 52457 * both version 1 (object spreading) and version 2 (state object) state passing. 52458 * 52459 * To achieve this, the returned function in case of a state object 52460 * will spread the state object in both `prev` and `next props. 52461 * 52462 * Other case it just returns the function as is which makes sure 52463 * that we are still backward compatible 52464 */ 52465 function normalizePropsAreEqual(propsAreEqual) { 52466 if (propsAreEqual.name === "normalizePropsAreEqualInner") { 52467 return propsAreEqual; 52468 } 52469 52470 return function normalizePropsAreEqualInner(prev, next) { 52471 if (!isPlainObject(prev.state) || !isPlainObject(next.state)) { 52472 return propsAreEqual(prev, next); 52473 } 52474 52475 return propsAreEqual(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, prev.state), prev), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, next.state), next)); 52476 }; 52477 } 52478 52479 52480 52481 // CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js 52482 52483 52484 52485 52486 52487 52488 52489 52490 function forwardRef(component) { 52491 return /*#__PURE__*/Object(external_React_["forwardRef"])(component); 52492 } 52493 52494 function memo(component, propsAreEqual) { 52495 return /*#__PURE__*/Object(external_React_["memo"])(component, propsAreEqual); 52496 } 52497 52498 /** 52499 * Creates a React component. 52500 * 52501 * @example 52502 * import { createComponent } from "reakit-system"; 52503 * 52504 * const A = createComponent({ as: "a" }); 52505 * 52506 * @param options 52507 */ 52508 function createComponent(_ref) { 52509 var type = _ref.as, 52510 useHook = _ref.useHook, 52511 shouldMemo = _ref.memo, 52512 _ref$propsAreEqual = _ref.propsAreEqual, 52513 propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual, 52514 _ref$keys = _ref.keys, 52515 keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys, 52516 _ref$useCreateElement = _ref.useCreateElement, 52517 useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement["a" /* useCreateElement */] : _ref$useCreateElement; 52518 52519 var Comp = function Comp(_ref2, ref) { 52520 var _ref2$as = _ref2.as, 52521 as = _ref2$as === void 0 ? type : _ref2$as, 52522 props = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_ref2, ["as"]); 52523 52524 if (useHook) { 52525 var _as$render; 52526 52527 var _splitProps = splitProps(props, keys), 52528 _options = _splitProps[0], 52529 htmlProps = _splitProps[1]; 52530 52531 var _useHook = useHook(_options, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({ 52532 ref: ref 52533 }, htmlProps)), 52534 wrapElement = _useHook.wrapElement, 52535 elementProps = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_useHook, ["wrapElement"]); // @ts-ignore 52536 52537 52538 var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys; 52539 var asOptions = asKeys && splitProps(props, asKeys)[0]; 52540 var allProps = asOptions ? Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, elementProps), asOptions) : elementProps; 52541 52542 var _element = useCreateElement$1(as, allProps); 52543 52544 if (wrapElement) { 52545 return wrapElement(_element); 52546 } 52547 52548 return _element; 52549 } 52550 52551 return useCreateElement$1(as, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({ 52552 ref: ref 52553 }, props)); 52554 }; 52555 52556 if (false) {} 52557 52558 Comp = forwardRef(Comp); 52559 52560 if (shouldMemo) { 52561 Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual)); 52562 } 52563 52564 Comp.__keys = keys; 52565 Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual["a" /* shallowEqual */]); 52566 return Comp; 52567 } 52568 52569 52570 52571 52572 /***/ }), 52573 52574 /***/ "hZ2/": 52575 /***/ (function(module, exports, __webpack_require__) { 52576 52577 "use strict"; 52578 52579 52580 var bind = __webpack_require__("D3zA"); 52581 var GetIntrinsic = __webpack_require__("rZ7t"); 52582 52583 var $apply = GetIntrinsic('%Function.prototype.apply%'); 52584 var $call = GetIntrinsic('%Function.prototype.call%'); 52585 var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); 52586 52587 var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); 52588 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 52589 var $max = GetIntrinsic('%Math.max%'); 52590 52591 if ($defineProperty) { 52592 try { 52593 $defineProperty({}, 'a', { value: 1 }); 52594 } catch (e) { 52595 // IE 8 has a broken defineProperty 52596 $defineProperty = null; 52597 } 52598 } 52599 52600 module.exports = function callBind(originalFunction) { 52601 var func = $reflectApply(bind, $call, arguments); 52602 if ($gOPD && $defineProperty) { 52603 var desc = $gOPD(func, 'length'); 52604 if (desc.configurable) { 52605 // original length, plus the receiver, minus any additional arguments (after the receiver) 52606 $defineProperty( 52607 func, 52608 'length', 52609 { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } 52610 ); 52611 } 52612 } 52613 return func; 52614 }; 52615 52616 var applyBind = function applyBind() { 52617 return $reflectApply(bind, $apply, arguments); 52618 }; 52619 52620 if ($defineProperty) { 52621 $defineProperty(module.exports, 'apply', { value: applyBind }); 52622 } else { 52623 module.exports.apply = applyBind; 52624 } 52625 52626 52627 /***/ }), 52628 52629 /***/ "i10q": 52630 /***/ (function(module, exports, __webpack_require__) { 52631 52632 "use strict"; 52633 52634 52635 // https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey 52636 52637 module.exports = function IsPropertyKey(argument) { 52638 return typeof argument === 'string' || typeof argument === 'symbol'; 52639 }; 52640 52641 52642 /***/ }), 52643 52644 /***/ "iB/h": 52645 /***/ (function(module, __webpack_exports__, __webpack_require__) { 52646 52647 "use strict"; 52648 /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 52649 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 52650 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl"); 52651 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 52652 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); 52653 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); 52654 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("gdqT"); 52655 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__); 52656 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj"); 52657 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 52658 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Z23Y"); 52659 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__); 52660 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("kA6J"); 52661 52662 52663 /** 52664 * External dependencies 52665 */ 52666 52667 52668 /** 52669 * WordPress dependencies 52670 */ 52671 52672 52673 52674 52675 52676 /** 52677 * Internal dependencies 52678 */ 52679 52680 52681 const NOTICE_TIMEOUT = 10000; 52682 /** @typedef {import('@wordpress/element').WPElement} WPElement */ 52683 52684 /** 52685 * Custom hook which announces the message with the given politeness, if a 52686 * valid message is provided. 52687 * 52688 * @param {string|WPElement} [message] Message to announce. 52689 * @param {'polite'|'assertive'} politeness Politeness to announce. 52690 */ 52691 52692 function useSpokenMessage(message, politeness) { 52693 const spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message); 52694 Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => { 52695 if (spokenMessage) { 52696 Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__["speak"])(spokenMessage, politeness); 52697 } 52698 }, [spokenMessage, politeness]); 52699 } 52700 52701 function Snackbar({ 52702 className, 52703 children, 52704 spokenMessage = children, 52705 politeness = 'polite', 52706 actions = [], 52707 onRemove = lodash__WEBPACK_IMPORTED_MODULE_1__["noop"], 52708 icon = null, 52709 explicitDismiss = false, 52710 // onDismiss is a callback executed when the snackbar is dismissed. 52711 // It is distinct from onRemove, which _looks_ like a callback but is 52712 // actually the function to call to remove the snackbar from the UI. 52713 onDismiss = lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] 52714 }, ref) { 52715 onDismiss = onDismiss || lodash__WEBPACK_IMPORTED_MODULE_1__["noop"]; 52716 52717 function dismissMe(event) { 52718 if (event && event.preventDefault) { 52719 event.preventDefault(); 52720 } 52721 52722 onDismiss(); 52723 onRemove(); 52724 } 52725 52726 function onActionClick(event, onClick) { 52727 event.stopPropagation(); 52728 onRemove(); 52729 52730 if (onClick) { 52731 onClick(event); 52732 } 52733 } 52734 52735 useSpokenMessage(spokenMessage, politeness); // Only set up the timeout dismiss if we're not explicitly dismissing. 52736 52737 Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => { 52738 const timeoutHandle = setTimeout(() => { 52739 if (!explicitDismiss) { 52740 onDismiss(); 52741 onRemove(); 52742 } 52743 }, NOTICE_TIMEOUT); 52744 return () => clearTimeout(timeoutHandle); 52745 }, [onDismiss, onRemove]); 52746 const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar', { 52747 'components-snackbar-explicit-dismiss': !!explicitDismiss 52748 }); 52749 52750 if (actions && actions.length > 1) { 52751 // we need to inform developers that snackbar only accepts 1 action 52752 typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array 52753 52754 actions = [actions[0]]; 52755 } 52756 52757 const snackbarContentClassnames = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-snackbar__content', { 52758 'components-snackbar__content-with-icon': !!icon 52759 }); 52760 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 52761 ref: ref, 52762 className: classes, 52763 onClick: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"], 52764 tabIndex: "0", 52765 role: !explicitDismiss ? 'button' : '', 52766 onKeyPress: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"], 52767 "aria-label": !explicitDismiss ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice') : '' 52768 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 52769 className: snackbarContentClassnames 52770 }, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 52771 className: "components-snackbar__icon" 52772 }, icon), children, actions.map(({ 52773 label, 52774 onClick, 52775 url 52776 }, index) => { 52777 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { 52778 key: index, 52779 href: url, 52780 isTertiary: true, 52781 onClick: event => onActionClick(event, onClick), 52782 className: "components-snackbar__action" 52783 }, label); 52784 }), explicitDismiss && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { 52785 role: "button", 52786 "aria-label": "Dismiss this notice", 52787 tabIndex: "0", 52788 className: "components-snackbar__dismiss-button", 52789 onClick: dismissMe, 52790 onKeyPress: dismissMe 52791 }, "\u2715"))); 52792 } 52793 52794 /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar)); 52795 52796 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) 52797 52798 /***/ }), 52799 52800 /***/ "iClF": 52801 /***/ (function(module, __webpack_exports__, __webpack_require__) { 52802 52803 "use strict"; 52804 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 52805 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 52806 /** 52807 * WordPress dependencies 52808 */ 52809 52810 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 52811 52812 /** 52813 * Return an SVG icon. 52814 * 52815 * @param {IconProps} props icon is the SVG component to render 52816 * size is a number specifiying the icon size in pixels 52817 * Other props will be passed to wrapped SVG component 52818 * 52819 * @return {JSX.Element} Icon component 52820 */ 52821 52822 function Icon({ 52823 icon, 52824 size = 24, 52825 ...props 52826 }) { 52827 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, { 52828 width: size, 52829 height: size, 52830 ...props 52831 }); 52832 } 52833 52834 /* harmony default export */ __webpack_exports__["a"] = (Icon); 52835 52836 52837 /***/ }), 52838 52839 /***/ "iNdV": 52840 /***/ (function(module, exports) { 52841 52842 var messages = { 52843 invalidPredicate: '`predicate` must be a function', 52844 invalidPropValidator: '`propValidator` must be a function', 52845 requiredCore: 'is marked as required', 52846 invalidTypeCore: 'Invalid input type', 52847 predicateFailureCore: 'Failed to succeed with predicate', 52848 anonymousMessage: '<<anonymous>>', 52849 baseInvalidMessage: 'Invalid ', 52850 }; 52851 52852 function constructPropValidatorVariations(propValidator) { 52853 if (typeof propValidator !== 'function') { 52854 throw new Error(messages.invalidPropValidator); 52855 } 52856 52857 var requiredPropValidator = propValidator.bind(null, false, null); 52858 requiredPropValidator.isRequired = propValidator.bind(null, true, null); 52859 52860 requiredPropValidator.withPredicate = function predicateApplication(predicate) { 52861 if (typeof predicate !== 'function') { 52862 throw new Error(messages.invalidPredicate); 52863 } 52864 var basePropValidator = propValidator.bind(null, false, predicate); 52865 basePropValidator.isRequired = propValidator.bind(null, true, predicate); 52866 return basePropValidator; 52867 }; 52868 52869 return requiredPropValidator; 52870 } 52871 52872 function createInvalidRequiredErrorMessage(propName, componentName, value) { 52873 return new Error( 52874 'The prop `' + propName + '` ' + messages.requiredCore + 52875 ' in `' + componentName + '`, but its value is `' + value + '`.' 52876 ); 52877 } 52878 52879 var independentGuardianValue = -1; 52880 52881 function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) { 52882 var isPropValueUndefined = typeof propValue === 'undefined'; 52883 var isPropValueNull = propValue === null; 52884 52885 if (isRequired) { 52886 if (isPropValueUndefined) { 52887 return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined'); 52888 } else if (isPropValueNull) { 52889 return createInvalidRequiredErrorMessage(propFullName, componentName, 'null'); 52890 } 52891 } 52892 52893 if (isPropValueUndefined || isPropValueNull) { 52894 return null; 52895 } 52896 52897 return independentGuardianValue; 52898 } 52899 52900 function createMomentChecker(type, typeValidator, validator, momentType) { 52901 52902 function propValidator( 52903 isRequired, // Bound parameter to indicate with the propType is required 52904 predicate, // Bound parameter to allow user to add dynamic validation 52905 props, 52906 propName, 52907 componentName, 52908 location, 52909 propFullName 52910 ) { 52911 var propValue = props[ propName ]; 52912 var propType = typeof propValue; 52913 52914 componentName = componentName || messages.anonymousMessage; 52915 propFullName = propFullName || propName; 52916 52917 var preValidationRequireCheckValue = preValidationRequireCheck( 52918 isRequired, componentName, propFullName, propValue 52919 ); 52920 52921 if (preValidationRequireCheckValue !== independentGuardianValue) { 52922 return preValidationRequireCheckValue; 52923 } 52924 52925 if (typeValidator && !typeValidator(propValue)) { 52926 return new Error( 52927 messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' + 52928 'supplied to `' + componentName + '`, expected `' + type + '`.' 52929 ); 52930 } 52931 52932 if (!validator(propValue)) { 52933 return new Error( 52934 messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' + 52935 'supplied to `' + componentName + '`, expected `' + momentType + '`.' 52936 ); 52937 } 52938 52939 if (predicate && !predicate(propValue)) { 52940 var predicateName = predicate.name || messages.anonymousMessage; 52941 return new Error( 52942 messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' + 52943 'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' + 52944 predicateName + '`.' 52945 ); 52946 } 52947 52948 return null; 52949 52950 } 52951 52952 return constructPropValidatorVariations(propValidator); 52953 52954 } 52955 52956 module.exports = { 52957 constructPropValidatorVariations: constructPropValidatorVariations, 52958 createMomentChecker: createMomentChecker, 52959 messages: messages, 52960 }; 52961 52962 52963 /***/ }), 52964 52965 /***/ "iYXd": 52966 /***/ (function(module, __webpack_exports__, __webpack_require__) { 52967 52968 "use strict"; 52969 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findFirstEnabledItem; }); 52970 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCurrentId; }); 52971 function findFirstEnabledItem(items, excludeId) { 52972 if (excludeId) { 52973 return items.find(function (item) { 52974 return !item.disabled && item.id !== excludeId; 52975 }); 52976 } 52977 52978 return items.find(function (item) { 52979 return !item.disabled; 52980 }); 52981 } 52982 52983 function getCurrentId(options, passedId) { 52984 var _findFirstEnabledItem; 52985 52986 if (passedId || passedId === null) { 52987 return passedId; 52988 } 52989 52990 if (options.currentId || options.currentId === null) { 52991 return options.currentId; 52992 } 52993 52994 return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id; 52995 } 52996 52997 52998 52999 53000 /***/ }), 53001 53002 /***/ "ib7Q": 53003 /***/ (function(module, exports, __webpack_require__) { 53004 53005 "use strict"; 53006 53007 53008 var getPolyfill = __webpack_require__("xoj2"); 53009 var define = __webpack_require__("82c2"); 53010 53011 module.exports = function shimValues() { 53012 var polyfill = getPolyfill(); 53013 define(Object, { values: polyfill }, { 53014 values: function testValues() { 53015 return Object.values !== polyfill; 53016 } 53017 }); 53018 return polyfill; 53019 }; 53020 53021 53022 /***/ }), 53023 53024 /***/ "ixyq": 53025 /***/ (function(module, exports, __webpack_require__) { 53026 53027 "use strict"; 53028 53029 53030 Object.defineProperty(exports, "__esModule", { 53031 value: true 53032 }); 53033 exports['default'] = calculateDimension; 53034 function calculateDimension(el, axis) { 53035 var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 53036 var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 53037 53038 if (!el) { 53039 return 0; 53040 } 53041 53042 var axisStart = axis === 'width' ? 'Left' : 'Top'; 53043 var axisEnd = axis === 'width' ? 'Right' : 'Bottom'; 53044 53045 // Only read styles if we need to 53046 var style = !borderBox || withMargin ? window.getComputedStyle(el) : null; 53047 53048 // Offset includes border and padding 53049 var offsetWidth = el.offsetWidth, 53050 offsetHeight = el.offsetHeight; 53051 53052 var size = axis === 'width' ? offsetWidth : offsetHeight; 53053 53054 // Get the inner size 53055 if (!borderBox) { 53056 size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']); 53057 } 53058 53059 // Apply margin 53060 if (withMargin) { 53061 size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]); 53062 } 53063 53064 return size; 53065 } 53066 53067 /***/ }), 53068 53069 /***/ "iz0l": 53070 /***/ (function(module, exports, __webpack_require__) { 53071 53072 "use strict"; 53073 53074 53075 var GetIntrinsic = __webpack_require__("rZ7t"); 53076 53077 var $TypeError = GetIntrinsic('%TypeError%'); 53078 53079 var MAX_SAFE_INTEGER = __webpack_require__("yyeE"); 53080 53081 var Call = __webpack_require__("fW1L"); 53082 var CreateDataPropertyOrThrow = __webpack_require__("WvKp"); 53083 var Get = __webpack_require__("3aeR"); 53084 var HasProperty = __webpack_require__("aenO"); 53085 var IsArray = __webpack_require__("9cOx"); 53086 var LengthOfArrayLike = __webpack_require__("y9oe"); 53087 var ToString = __webpack_require__("Hx/O"); 53088 53089 // https://262.ecma-international.org/11.0/#sec-flattenintoarray 53090 53091 // eslint-disable-next-line max-params 53092 module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { 53093 var mapperFunction; 53094 if (arguments.length > 5) { 53095 mapperFunction = arguments[5]; 53096 } 53097 53098 var targetIndex = start; 53099 var sourceIndex = 0; 53100 while (sourceIndex < sourceLen) { 53101 var P = ToString(sourceIndex); 53102 var exists = HasProperty(source, P); 53103 if (exists === true) { 53104 var element = Get(source, P); 53105 if (typeof mapperFunction !== 'undefined') { 53106 if (arguments.length <= 6) { 53107 throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); 53108 } 53109 element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); 53110 } 53111 var shouldFlatten = false; 53112 if (depth > 0) { 53113 shouldFlatten = IsArray(element); 53114 } 53115 if (shouldFlatten) { 53116 var elementLen = LengthOfArrayLike(element); 53117 targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); 53118 } else { 53119 if (targetIndex >= MAX_SAFE_INTEGER) { 53120 throw new $TypeError('index too large'); 53121 } 53122 CreateDataPropertyOrThrow(target, ToString(targetIndex), element); 53123 targetIndex += 1; 53124 } 53125 } 53126 sourceIndex += 1; 53127 } 53128 53129 return targetIndex; 53130 }; 53131 53132 53133 /***/ }), 53134 53135 /***/ "jB5C": 53136 /***/ (function(module, exports, __webpack_require__) { 53137 53138 "use strict"; 53139 53140 53141 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; }; 53142 53143 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; }; 53144 53145 var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; 53146 53147 function getClientPosition(elem) { 53148 var box = undefined; 53149 var x = undefined; 53150 var y = undefined; 53151 var doc = elem.ownerDocument; 53152 var body = doc.body; 53153 var docElem = doc && doc.documentElement; 53154 // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 53155 box = elem.getBoundingClientRect(); 53156 53157 // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop 53158 // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 53159 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin 53160 53161 x = box.left; 53162 y = box.top; 53163 53164 // In IE, most of the time, 2 extra pixels are added to the top and left 53165 // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and 53166 // IE6 standards mode, this border can be overridden by setting the 53167 // document element's border to zero -- thus, we cannot rely on the 53168 // offset always being 2 pixels. 53169 53170 // In quirks mode, the offset can be determined by querying the body's 53171 // clientLeft/clientTop, but in standards mode, it is found by querying 53172 // the document element's clientLeft/clientTop. Since we already called 53173 // getClientBoundingRect we have already forced a reflow, so it is not 53174 // too expensive just to query them all. 53175 53176 // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 53177 // 窗口边框标准是设 documentElement ,quirks 时设置 body 53178 // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 53179 // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 53180 // 标准 ie 下 docElem.clientTop 就是 border-top 53181 // ie7 html 即窗口边框改变不了。永远为 2 53182 // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 53183 53184 x -= docElem.clientLeft || body.clientLeft || 0; 53185 y -= docElem.clientTop || body.clientTop || 0; 53186 53187 return { 53188 left: x, 53189 top: y 53190 }; 53191 } 53192 53193 function getScroll(w, top) { 53194 var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; 53195 var method = 'scroll' + (top ? 'Top' : 'Left'); 53196 if (typeof ret !== 'number') { 53197 var d = w.document; 53198 // ie6,7,8 standard mode 53199 ret = d.documentElement[method]; 53200 if (typeof ret !== 'number') { 53201 // quirks mode 53202 ret = d.body[method]; 53203 } 53204 } 53205 return ret; 53206 } 53207 53208 function getScrollLeft(w) { 53209 return getScroll(w); 53210 } 53211 53212 function getScrollTop(w) { 53213 return getScroll(w, true); 53214 } 53215 53216 function getOffset(el) { 53217 var pos = getClientPosition(el); 53218 var doc = el.ownerDocument; 53219 var w = doc.defaultView || doc.parentWindow; 53220 pos.left += getScrollLeft(w); 53221 pos.top += getScrollTop(w); 53222 return pos; 53223 } 53224 function _getComputedStyle(elem, name, computedStyle_) { 53225 var val = ''; 53226 var d = elem.ownerDocument; 53227 var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null); 53228 53229 // https://github.com/kissyteam/kissy/issues/61 53230 if (computedStyle) { 53231 val = computedStyle.getPropertyValue(name) || computedStyle[name]; 53232 } 53233 53234 return val; 53235 } 53236 53237 var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); 53238 var RE_POS = /^(top|right|bottom|left)$/; 53239 var CURRENT_STYLE = 'currentStyle'; 53240 var RUNTIME_STYLE = 'runtimeStyle'; 53241 var LEFT = 'left'; 53242 var PX = 'px'; 53243 53244 function _getComputedStyleIE(elem, name) { 53245 // currentStyle maybe null 53246 // http://msdn.microsoft.com/en-us/library/ms535231.aspx 53247 var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; 53248 53249 // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 53250 // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 53251 // 在 ie 下不对,需要直接用 offset 方式 53252 // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 53253 53254 // From the awesome hack by Dean Edwards 53255 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 53256 // If we're not dealing with a regular pixel number 53257 // but a number that has a weird ending, we need to convert it to pixels 53258 // exclude left right for relativity 53259 if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { 53260 // Remember the original values 53261 var style = elem.style; 53262 var left = style[LEFT]; 53263 var rsLeft = elem[RUNTIME_STYLE][LEFT]; 53264 53265 // prevent flashing of content 53266 elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; 53267 53268 // Put in the new values to get a computed value out 53269 style[LEFT] = name === 'fontSize' ? '1em' : ret || 0; 53270 ret = style.pixelLeft + PX; 53271 53272 // Revert the changed values 53273 style[LEFT] = left; 53274 53275 elem[RUNTIME_STYLE][LEFT] = rsLeft; 53276 } 53277 return ret === '' ? 'auto' : ret; 53278 } 53279 53280 var getComputedStyleX = undefined; 53281 if (typeof window !== 'undefined') { 53282 getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; 53283 } 53284 53285 function each(arr, fn) { 53286 for (var i = 0; i < arr.length; i++) { 53287 fn(arr[i]); 53288 } 53289 } 53290 53291 function isBorderBoxFn(elem) { 53292 return getComputedStyleX(elem, 'boxSizing') === 'border-box'; 53293 } 53294 53295 var BOX_MODELS = ['margin', 'border', 'padding']; 53296 var CONTENT_INDEX = -1; 53297 var PADDING_INDEX = 2; 53298 var BORDER_INDEX = 1; 53299 var MARGIN_INDEX = 0; 53300 53301 function swap(elem, options, callback) { 53302 var old = {}; 53303 var style = elem.style; 53304 var name = undefined; 53305 53306 // Remember the old values, and insert the new ones 53307 for (name in options) { 53308 if (options.hasOwnProperty(name)) { 53309 old[name] = style[name]; 53310 style[name] = options[name]; 53311 } 53312 } 53313 53314 callback.call(elem); 53315 53316 // Revert the old values 53317 for (name in options) { 53318 if (options.hasOwnProperty(name)) { 53319 style[name] = old[name]; 53320 } 53321 } 53322 } 53323 53324 function getPBMWidth(elem, props, which) { 53325 var value = 0; 53326 var prop = undefined; 53327 var j = undefined; 53328 var i = undefined; 53329 for (j = 0; j < props.length; j++) { 53330 prop = props[j]; 53331 if (prop) { 53332 for (i = 0; i < which.length; i++) { 53333 var cssProp = undefined; 53334 if (prop === 'border') { 53335 cssProp = prop + which[i] + 'Width'; 53336 } else { 53337 cssProp = prop + which[i]; 53338 } 53339 value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; 53340 } 53341 } 53342 } 53343 return value; 53344 } 53345 53346 /** 53347 * A crude way of determining if an object is a window 53348 * @member util 53349 */ 53350 function isWindow(obj) { 53351 // must use == for ie8 53352 /* eslint eqeqeq:0 */ 53353 return obj != null && obj == obj.window; 53354 } 53355 53356 var domUtils = {}; 53357 53358 each(['Width', 'Height'], function (name) { 53359 domUtils['doc' + name] = function (refWin) { 53360 var d = refWin.document; 53361 return Math.max( 53362 // firefox chrome documentElement.scrollHeight< body.scrollHeight 53363 // ie standard mode : documentElement.scrollHeight> body.scrollHeight 53364 d.documentElement['scroll' + name], 53365 // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? 53366 d.body['scroll' + name], domUtils['viewport' + name](d)); 53367 }; 53368 53369 domUtils['viewport' + name] = function (win) { 53370 // pc browser includes scrollbar in window.innerWidth 53371 var prop = 'client' + name; 53372 var doc = win.document; 53373 var body = doc.body; 53374 var documentElement = doc.documentElement; 53375 var documentElementProp = documentElement[prop]; 53376 // 标准模式取 documentElement 53377 // backcompat 取 body 53378 return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; 53379 }; 53380 }); 53381 53382 /* 53383 得到元素的大小信息 53384 @param elem 53385 @param name 53386 @param {String} [extra] 'padding' : (css width) + padding 53387 'border' : (css width) + padding + border 53388 'margin' : (css width) + padding + border + margin 53389 */ 53390 function getWH(elem, name, extra) { 53391 if (isWindow(elem)) { 53392 return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); 53393 } else if (elem.nodeType === 9) { 53394 return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); 53395 } 53396 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; 53397 var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; 53398 var computedStyle = getComputedStyleX(elem); 53399 var isBorderBox = isBorderBoxFn(elem, computedStyle); 53400 var cssBoxValue = 0; 53401 if (borderBoxValue == null || borderBoxValue <= 0) { 53402 borderBoxValue = undefined; 53403 // Fall back to computed then un computed css if necessary 53404 cssBoxValue = getComputedStyleX(elem, name); 53405 if (cssBoxValue == null || Number(cssBoxValue) < 0) { 53406 cssBoxValue = elem.style[name] || 0; 53407 } 53408 // Normalize '', auto, and prepare for extra 53409 cssBoxValue = parseFloat(cssBoxValue) || 0; 53410 } 53411 if (extra === undefined) { 53412 extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; 53413 } 53414 var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; 53415 var val = borderBoxValue || cssBoxValue; 53416 if (extra === CONTENT_INDEX) { 53417 if (borderBoxValueOrIsBorderBox) { 53418 return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); 53419 } 53420 return cssBoxValue; 53421 } 53422 if (borderBoxValueOrIsBorderBox) { 53423 var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle); 53424 return val + (extra === BORDER_INDEX ? 0 : padding); 53425 } 53426 return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); 53427 } 53428 53429 var cssShow = { 53430 position: 'absolute', 53431 visibility: 'hidden', 53432 display: 'block' 53433 }; 53434 53435 // fix #119 : https://github.com/kissyteam/kissy/issues/119 53436 function getWHIgnoreDisplay(elem) { 53437 var val = undefined; 53438 var args = arguments; 53439 // in case elem is window 53440 // elem.offsetWidth === undefined 53441 if (elem.offsetWidth !== 0) { 53442 val = getWH.apply(undefined, args); 53443 } else { 53444 swap(elem, cssShow, function () { 53445 val = getWH.apply(undefined, args); 53446 }); 53447 } 53448 return val; 53449 } 53450 53451 function css(el, name, v) { 53452 var value = v; 53453 if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { 53454 for (var i in name) { 53455 if (name.hasOwnProperty(i)) { 53456 css(el, i, name[i]); 53457 } 53458 } 53459 return undefined; 53460 } 53461 if (typeof value !== 'undefined') { 53462 if (typeof value === 'number') { 53463 value += 'px'; 53464 } 53465 el.style[name] = value; 53466 return undefined; 53467 } 53468 return getComputedStyleX(el, name); 53469 } 53470 53471 each(['width', 'height'], function (name) { 53472 var first = name.charAt(0).toUpperCase() + name.slice(1); 53473 domUtils['outer' + first] = function (el, includeMargin) { 53474 return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); 53475 }; 53476 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; 53477 53478 domUtils[name] = function (elem, val) { 53479 if (val !== undefined) { 53480 if (elem) { 53481 var computedStyle = getComputedStyleX(elem); 53482 var isBorderBox = isBorderBoxFn(elem); 53483 if (isBorderBox) { 53484 val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); 53485 } 53486 return css(elem, name, val); 53487 } 53488 return undefined; 53489 } 53490 return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); 53491 }; 53492 }); 53493 53494 // 设置 elem 相对 elem.ownerDocument 的坐标 53495 function setOffset(elem, offset) { 53496 // set position first, in-case top/left are set even on static elem 53497 if (css(elem, 'position') === 'static') { 53498 elem.style.position = 'relative'; 53499 } 53500 53501 var old = getOffset(elem); 53502 var ret = {}; 53503 var current = undefined; 53504 var key = undefined; 53505 53506 for (key in offset) { 53507 if (offset.hasOwnProperty(key)) { 53508 current = parseFloat(css(elem, key)) || 0; 53509 ret[key] = current + offset[key] - old[key]; 53510 } 53511 } 53512 css(elem, ret); 53513 } 53514 53515 module.exports = _extends({ 53516 getWindow: function getWindow(node) { 53517 var doc = node.ownerDocument || node; 53518 return doc.defaultView || doc.parentWindow; 53519 }, 53520 offset: function offset(el, value) { 53521 if (typeof value !== 'undefined') { 53522 setOffset(el, value); 53523 } else { 53524 return getOffset(el); 53525 } 53526 }, 53527 53528 isWindow: isWindow, 53529 each: each, 53530 css: css, 53531 clone: function clone(obj) { 53532 var ret = {}; 53533 for (var i in obj) { 53534 if (obj.hasOwnProperty(i)) { 53535 ret[i] = obj[i]; 53536 } 53537 } 53538 var overflow = obj.overflow; 53539 if (overflow) { 53540 for (var i in obj) { 53541 if (obj.hasOwnProperty(i)) { 53542 ret.overflow[i] = obj.overflow[i]; 53543 } 53544 } 53545 } 53546 return ret; 53547 }, 53548 scrollLeft: function scrollLeft(w, v) { 53549 if (isWindow(w)) { 53550 if (v === undefined) { 53551 return getScrollLeft(w); 53552 } 53553 window.scrollTo(v, getScrollTop(w)); 53554 } else { 53555 if (v === undefined) { 53556 return w.scrollLeft; 53557 } 53558 w.scrollLeft = v; 53559 } 53560 }, 53561 scrollTop: function scrollTop(w, v) { 53562 if (isWindow(w)) { 53563 if (v === undefined) { 53564 return getScrollTop(w); 53565 } 53566 window.scrollTo(getScrollLeft(w), v); 53567 } else { 53568 if (v === undefined) { 53569 return w.scrollTop; 53570 } 53571 w.scrollTop = v; 53572 } 53573 }, 53574 53575 viewportWidth: 0, 53576 viewportHeight: 0 53577 }, domUtils); 53578 53579 /***/ }), 53580 53581 /***/ "jXQH": 53582 /***/ (function(module, exports, __webpack_require__) { 53583 53584 var trimmedEndIndex = __webpack_require__("TO8r"); 53585 53586 /** Used to match leading whitespace. */ 53587 var reTrimStart = /^\s+/; 53588 53589 /** 53590 * The base implementation of `_.trim`. 53591 * 53592 * @private 53593 * @param {string} string The string to trim. 53594 * @returns {string} Returns the trimmed string. 53595 */ 53596 function baseTrim(string) { 53597 return string 53598 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 53599 : string; 53600 } 53601 53602 module.exports = baseTrim; 53603 53604 53605 /***/ }), 53606 53607 /***/ "jenk": 53608 /***/ (function(module, exports, __webpack_require__) { 53609 53610 "use strict"; 53611 53612 53613 Object.defineProperty(exports, "__esModule", { 53614 value: true 53615 }); 53616 exports['default'] = toISOMonthString; 53617 53618 var _moment = __webpack_require__("wy2R"); 53619 53620 var _moment2 = _interopRequireDefault(_moment); 53621 53622 var _toMomentObject = __webpack_require__("WmS1"); 53623 53624 var _toMomentObject2 = _interopRequireDefault(_toMomentObject); 53625 53626 var _constants = __webpack_require__("Fv1B"); 53627 53628 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 53629 53630 function toISOMonthString(date, currentFormat) { 53631 var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat); 53632 if (!dateObj) return null; 53633 53634 return dateObj.format(_constants.ISO_MONTH_FORMAT); 53635 } 53636 53637 /***/ }), 53638 53639 /***/ "k2cL": 53640 /***/ (function(module, __webpack_exports__, __webpack_require__) { 53641 53642 "use strict"; 53643 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isSelfTarget; }); 53644 /** 53645 * Returns `true` if `event.target` and `event.currentTarget` are the same. 53646 */ 53647 function isSelfTarget(event) { 53648 return event.target === event.currentTarget; 53649 } 53650 53651 53652 53653 53654 /***/ }), 53655 53656 /***/ "k8OV": 53657 /***/ (function(module, __webpack_exports__, __webpack_require__) { 53658 53659 "use strict"; 53660 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollLock; }); 53661 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 53662 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 53663 /** 53664 * WordPress dependencies 53665 */ 53666 53667 /* 53668 * Setting `overflow: hidden` on html and body elements resets body scroll in iOS. 53669 * Save scroll top so we can restore it after locking scroll. 53670 * 53671 * NOTE: It would be cleaner and possibly safer to find a localized solution such 53672 * as preventing default on certain touchmove events. 53673 */ 53674 53675 let previousScrollTop = 0; 53676 /** 53677 * @param {boolean} locked 53678 */ 53679 53680 function setLocked(locked) { 53681 const scrollingElement = document.scrollingElement || document.body; 53682 53683 if (locked) { 53684 previousScrollTop = scrollingElement.scrollTop; 53685 } 53686 53687 const methodName = locked ? 'add' : 'remove'; 53688 scrollingElement.classList[methodName]('lockscroll'); // Adding the class to the document element seems to be necessary in iOS. 53689 53690 document.documentElement.classList[methodName]('lockscroll'); 53691 53692 if (!locked) { 53693 scrollingElement.scrollTop = previousScrollTop; 53694 } 53695 } 53696 53697 let lockCounter = 0; 53698 /** 53699 * A component that will lock scrolling when it is mounted and unlock scrolling when it is unmounted. 53700 * 53701 * @return {null} Render nothing. 53702 */ 53703 53704 function ScrollLock() { 53705 Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => { 53706 if (lockCounter === 0) { 53707 setLocked(true); 53708 } 53709 53710 ++lockCounter; 53711 return () => { 53712 if (lockCounter === 1) { 53713 setLocked(false); 53714 } 53715 53716 --lockCounter; 53717 }; 53718 }, []); 53719 return null; 53720 } 53721 53722 53723 /***/ }), 53724 53725 /***/ "kA6J": 53726 /***/ (function(module, __webpack_exports__, __webpack_require__) { 53727 53728 "use strict"; 53729 /* unused harmony export Button */ 53730 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); 53731 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); 53732 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 53733 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ"); 53734 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); 53735 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("YLtl"); 53736 /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); 53737 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("NMb1"); 53738 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__); 53739 /* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("W/NR"); 53740 /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("9VDH"); 53741 /* harmony import */ var _visually_hidden__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("ldlY"); 53742 53743 53744 53745 /** 53746 * External dependencies 53747 */ 53748 53749 53750 /** 53751 * WordPress dependencies 53752 */ 53753 53754 53755 53756 /** 53757 * Internal dependencies 53758 */ 53759 53760 53761 53762 53763 const disabledEventsOnDisabledButton = ['onMouseDown', 'onClick']; 53764 function Button(props, ref) { 53765 const { 53766 href, 53767 target, 53768 isPrimary, 53769 isSmall, 53770 isTertiary, 53771 isPressed, 53772 isBusy, 53773 isDefault, 53774 isSecondary, 53775 isLink, 53776 isDestructive, 53777 className, 53778 disabled, 53779 icon, 53780 iconPosition = 'left', 53781 iconSize, 53782 showTooltip, 53783 tooltipPosition, 53784 shortcut, 53785 label, 53786 children, 53787 text, 53788 __experimentalIsFocusable: isFocusable, 53789 describedBy, 53790 ...additionalProps 53791 } = props; 53792 53793 if (isDefault) { 53794 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default()('Button isDefault prop', { 53795 since: '5.4', 53796 alternative: 'isSecondary' 53797 }); 53798 } 53799 53800 const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-button', className, { 53801 'is-secondary': isDefault || isSecondary, 53802 'is-primary': isPrimary, 53803 'is-small': isSmall, 53804 'is-tertiary': isTertiary, 53805 'is-pressed': isPressed, 53806 'is-busy': isBusy, 53807 'is-link': isLink, 53808 'is-destructive': isDestructive, 53809 'has-text': !!icon && !!children, 53810 'has-icon': !!icon 53811 }); 53812 const trulyDisabled = disabled && !isFocusable; 53813 const Tag = href !== undefined && !trulyDisabled ? 'a' : 'button'; 53814 const tagProps = Tag === 'a' ? { 53815 href, 53816 target 53817 } : { 53818 type: 'button', 53819 disabled: trulyDisabled, 53820 'aria-pressed': isPressed 53821 }; 53822 53823 if (disabled && isFocusable) { 53824 // In this case, the button will be disabled, but still focusable and 53825 // perceivable by screen reader users. 53826 tagProps['aria-disabled'] = true; 53827 53828 for (const disabledEvent of disabledEventsOnDisabledButton) { 53829 additionalProps[disabledEvent] = event => { 53830 event.stopPropagation(); 53831 event.preventDefault(); 53832 }; 53833 } 53834 } // Should show the tooltip if... 53835 53836 53837 const shouldShowTooltip = !trulyDisabled && ( // an explicit tooltip is passed or... 53838 showTooltip && label || // there's a shortcut or... 53839 shortcut || // there's a label and... 53840 !!label && ( // the children are empty and... 53841 !children || Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled. 53842 false !== showTooltip); 53843 const descriptionId = describedBy ? Object(lodash__WEBPACK_IMPORTED_MODULE_3__["uniqueId"])() : null; 53844 const describedById = additionalProps['aria-describedby'] || descriptionId; 53845 const element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, tagProps, additionalProps, { 53846 className: classes, 53847 "aria-label": additionalProps['aria-label'] || label, 53848 "aria-describedby": describedById, 53849 ref: ref 53850 }), icon && iconPosition === 'left' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { 53851 icon: icon, 53852 size: iconSize 53853 }), text && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, text), icon && iconPosition === 'right' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { 53854 icon: icon, 53855 size: iconSize 53856 }), children); 53857 53858 if (!shouldShowTooltip) { 53859 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, element, describedBy && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_visually_hidden__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", { 53860 id: descriptionId 53861 }, describedBy))); 53862 } 53863 53864 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], { 53865 text: describedBy ? describedBy : label, 53866 shortcut: shortcut, 53867 position: tooltipPosition 53868 }, element), describedBy && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_visually_hidden__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", { 53869 id: descriptionId 53870 }, describedBy))); 53871 } 53872 /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Button)); 53873 53874 53875 /***/ }), 53876 53877 /***/ "kDDq": 53878 /***/ (function(module, __webpack_exports__, __webpack_require__) { 53879 53880 "use strict"; 53881 53882 // EXPORTS 53883 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ emotion_esm_css; }); 53884 __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ emotion_esm_cx; }); 53885 53886 // UNUSED EXPORTS: cache, flush, getRegisteredStyles, hydrate, injectGlobal, keyframes, merge, sheet 53887 53888 // EXTERNAL MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js + 2 modules 53889 var cache_browser_esm = __webpack_require__("TqVZ"); 53890 53891 // EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules 53892 var serialize_browser_esm = __webpack_require__("MiSq"); 53893 53894 // EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js 53895 var utils_browser_esm = __webpack_require__("SIPS"); 53896 53897 // CONCATENATED MODULE: ./node_modules/create-emotion/dist/create-emotion.browser.esm.js 53898 53899 53900 53901 53902 function insertWithoutScoping(cache, serialized) { 53903 if (cache.inserted[serialized.name] === undefined) { 53904 return cache.insert('', serialized, cache.sheet, true); 53905 } 53906 } 53907 53908 function merge(registered, css, className) { 53909 var registeredStyles = []; 53910 var rawClassName = Object(utils_browser_esm["a" /* getRegisteredStyles */])(registered, registeredStyles, className); 53911 53912 if (registeredStyles.length < 2) { 53913 return className; 53914 } 53915 53916 return rawClassName + css(registeredStyles); 53917 } 53918 53919 var create_emotion_browser_esm_createEmotion = function createEmotion(options) { 53920 var cache = Object(cache_browser_esm["a" /* default */])(options); // $FlowFixMe 53921 53922 cache.sheet.speedy = function (value) { 53923 if (false) {} 53924 53925 this.isSpeedy = value; 53926 }; 53927 53928 cache.compat = true; 53929 53930 var css = function css() { 53931 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 53932 args[_key] = arguments[_key]; 53933 } 53934 53935 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, cache.registered, undefined); 53936 Object(utils_browser_esm["b" /* insertStyles */])(cache, serialized, false); 53937 return cache.key + "-" + serialized.name; 53938 }; 53939 53940 var keyframes = function keyframes() { 53941 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 53942 args[_key2] = arguments[_key2]; 53943 } 53944 53945 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, cache.registered); 53946 var animation = "animation-" + serialized.name; 53947 insertWithoutScoping(cache, { 53948 name: serialized.name, 53949 styles: "@keyframes " + animation + "{" + serialized.styles + "}" 53950 }); 53951 return animation; 53952 }; 53953 53954 var injectGlobal = function injectGlobal() { 53955 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 53956 args[_key3] = arguments[_key3]; 53957 } 53958 53959 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, cache.registered); 53960 insertWithoutScoping(cache, serialized); 53961 }; 53962 53963 var cx = function cx() { 53964 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 53965 args[_key4] = arguments[_key4]; 53966 } 53967 53968 return merge(cache.registered, css, classnames(args)); 53969 }; 53970 53971 return { 53972 css: css, 53973 cx: cx, 53974 injectGlobal: injectGlobal, 53975 keyframes: keyframes, 53976 hydrate: function hydrate(ids) { 53977 ids.forEach(function (key) { 53978 cache.inserted[key] = true; 53979 }); 53980 }, 53981 flush: function flush() { 53982 cache.registered = {}; 53983 cache.inserted = {}; 53984 cache.sheet.flush(); 53985 }, 53986 // $FlowFixMe 53987 sheet: cache.sheet, 53988 cache: cache, 53989 getRegisteredStyles: utils_browser_esm["a" /* getRegisteredStyles */].bind(null, cache.registered), 53990 merge: merge.bind(null, cache.registered, css) 53991 }; 53992 }; 53993 53994 var classnames = function classnames(args) { 53995 var cls = ''; 53996 53997 for (var i = 0; i < args.length; i++) { 53998 var arg = args[i]; 53999 if (arg == null) continue; 54000 var toAdd = void 0; 54001 54002 switch (typeof arg) { 54003 case 'boolean': 54004 break; 54005 54006 case 'object': 54007 { 54008 if (Array.isArray(arg)) { 54009 toAdd = classnames(arg); 54010 } else { 54011 toAdd = ''; 54012 54013 for (var k in arg) { 54014 if (arg[k] && k) { 54015 toAdd && (toAdd += ' '); 54016 toAdd += k; 54017 } 54018 } 54019 } 54020 54021 break; 54022 } 54023 54024 default: 54025 { 54026 toAdd = arg; 54027 } 54028 } 54029 54030 if (toAdd) { 54031 cls && (cls += ' '); 54032 cls += toAdd; 54033 } 54034 } 54035 54036 return cls; 54037 }; 54038 54039 /* harmony default export */ var create_emotion_browser_esm = (create_emotion_browser_esm_createEmotion); 54040 54041 // CONCATENATED MODULE: ./node_modules/emotion/dist/emotion.esm.js 54042 54043 54044 var _createEmotion = create_emotion_browser_esm(), 54045 flush = _createEmotion.flush, 54046 hydrate = _createEmotion.hydrate, 54047 emotion_esm_cx = _createEmotion.cx, 54048 emotion_esm_merge = _createEmotion.merge, 54049 getRegisteredStyles = _createEmotion.getRegisteredStyles, 54050 emotion_esm_injectGlobal = _createEmotion.injectGlobal, 54051 emotion_esm_keyframes = _createEmotion.keyframes, 54052 emotion_esm_css = _createEmotion.css, 54053 sheet = _createEmotion.sheet, 54054 emotion_esm_cache = _createEmotion.cache; 54055 54056 54057 54058 54059 /***/ }), 54060 54061 /***/ "kFtd": 54062 /***/ (function(module, exports) { 54063 54064 Object.defineProperty(exports, "__esModule", { 54065 value: true 54066 }); 54067 var GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS'; 54068 var MAX_SPECIFICITY = 20; 54069 54070 exports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY; 54071 exports.MAX_SPECIFICITY = MAX_SPECIFICITY; 54072 54073 /***/ }), 54074 54075 /***/ "kTC8": 54076 /***/ (function(module, __webpack_exports__, __webpack_require__) { 54077 54078 "use strict"; 54079 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CompositeItem; }); 54080 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useCompositeItem; }); 54081 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5"); 54082 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48"); 54083 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes"); 54084 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd"); 54085 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); 54086 /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aU41"); 54087 /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("KA1K"); 54088 /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("eNtd"); 54089 /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("k2cL"); 54090 /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("PcHe"); 54091 /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("Vq1w"); 54092 /* harmony import */ var _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("JLmN"); 54093 /* harmony import */ var reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("ouKs"); 54094 /* harmony import */ var _getCurrentId_5aa9849e_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("iYXd"); 54095 /* harmony import */ var _keys_6742f591_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("TFuP"); 54096 /* harmony import */ var _userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("Mih7"); 54097 /* harmony import */ var reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("4po3"); 54098 /* harmony import */ var reakit_utils_ensureFocus__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("AClM"); 54099 /* harmony import */ var _Id_Id_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("ym77"); 54100 /* harmony import */ var _setTextFieldValue_0a221f4e_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("0HL0"); 54101 54102 54103 54104 54105 54106 54107 54108 54109 54110 54111 54112 54113 54114 54115 54116 54117 54118 54119 54120 54121 54122 54123 54124 54125 54126 54127 54128 54129 54130 function getWidget(itemElement) { 54131 return itemElement.querySelector("[data-composite-item-widget]"); 54132 } 54133 54134 function useItem(options) { 54135 return Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () { 54136 var _options$items; 54137 54138 return (_options$items = options.items) === null || _options$items === void 0 ? void 0 : _options$items.find(function (item) { 54139 return options.id && item.id === options.id; 54140 }); 54141 }, [options.items, options.id]); 54142 } 54143 54144 function targetIsAnotherItem(event, items) { 54145 if (Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return false; 54146 54147 for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(items), _step; !(_step = _iterator()).done;) { 54148 var item = _step.value; 54149 54150 if (item.ref.current === event.target) { 54151 return true; 54152 } 54153 } 54154 54155 return false; 54156 } 54157 54158 var useCompositeItem = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 54159 name: "CompositeItem", 54160 compose: [_Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__[/* useClickable */ "a"], _Id_Id_js__WEBPACK_IMPORTED_MODULE_17__[/* unstable_useId */ "a"]], 54161 keys: _keys_6742f591_js__WEBPACK_IMPORTED_MODULE_13__[/* b */ "c"], 54162 propsAreEqual: function propsAreEqual(prev, next) { 54163 if (!next.id || prev.id !== next.id) { 54164 return _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__[/* useClickable */ "a"].unstable_propsAreEqual(prev, next); 54165 } 54166 54167 var prevCurrentId = prev.currentId, 54168 prevMoves = prev.unstable_moves, 54169 prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["currentId", "unstable_moves"]); 54170 54171 var nextCurrentId = next.currentId, 54172 nextMoves = next.unstable_moves, 54173 nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["currentId", "unstable_moves"]); 54174 54175 if (nextCurrentId !== prevCurrentId) { 54176 if (next.id === nextCurrentId || next.id === prevCurrentId) { 54177 return false; 54178 } 54179 } else if (prevMoves !== nextMoves) { 54180 return false; 54181 } 54182 54183 return _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__[/* useClickable */ "a"].unstable_propsAreEqual(prevProps, nextProps); 54184 }, 54185 useOptions: function useOptions(options) { 54186 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, { 54187 id: options.id, 54188 currentId: Object(_getCurrentId_5aa9849e_js__WEBPACK_IMPORTED_MODULE_12__[/* g */ "b"])(options), 54189 unstable_clickOnSpace: options.unstable_hasActiveWidget ? false : options.unstable_clickOnSpace 54190 }); 54191 }, 54192 useProps: function useProps(options, _ref) { 54193 var _options$items2; 54194 54195 var htmlRef = _ref.ref, 54196 _ref$tabIndex = _ref.tabIndex, 54197 htmlTabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex, 54198 htmlOnMouseDown = _ref.onMouseDown, 54199 htmlOnFocus = _ref.onFocus, 54200 htmlOnBlurCapture = _ref.onBlurCapture, 54201 htmlOnKeyDown = _ref.onKeyDown, 54202 htmlOnClick = _ref.onClick, 54203 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["ref", "tabIndex", "onMouseDown", "onFocus", "onBlurCapture", "onKeyDown", "onClick"]); 54204 54205 var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null); 54206 var id = options.id; 54207 var trulyDisabled = options.disabled && !options.focusable; 54208 var isCurrentItem = options.currentId === id; 54209 var isCurrentItemRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(isCurrentItem); 54210 var hasFocusedComposite = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(false); 54211 var item = useItem(options); 54212 var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnMouseDown); 54213 var onFocusRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnFocus); 54214 var onBlurCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnBlurCapture); 54215 var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown); 54216 var onClickRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnClick); 54217 var shouldTabIndex = !options.unstable_virtual && !options.unstable_hasActiveWidget && isCurrentItem || // We don't want to set tabIndex="-1" when using CompositeItem as a 54218 // standalone component, without state props. 54219 !((_options$items2 = options.items) !== null && _options$items2 !== void 0 && _options$items2.length); 54220 Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () { 54221 var _options$registerItem; 54222 54223 if (!id) return undefined; 54224 (_options$registerItem = options.registerItem) === null || _options$registerItem === void 0 ? void 0 : _options$registerItem.call(options, { 54225 id: id, 54226 ref: ref, 54227 disabled: !!trulyDisabled 54228 }); 54229 return function () { 54230 var _options$unregisterIt; 54231 54232 (_options$unregisterIt = options.unregisterItem) === null || _options$unregisterIt === void 0 ? void 0 : _options$unregisterIt.call(options, id); 54233 }; 54234 }, [id, trulyDisabled, options.registerItem, options.unregisterItem]); 54235 Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () { 54236 var element = ref.current; 54237 54238 if (!element) { 54239 false ? undefined : void 0; 54240 return; 54241 } // `moves` will be incremented whenever next, previous, up, down, first, 54242 // last or move have been called. This means that the composite item will 54243 // be focused whenever some of these functions are called. We're using 54244 // isCurrentItemRef instead of isCurrentItem because we don't want to 54245 // focus the item if isCurrentItem changes (and options.moves doesn't). 54246 54247 54248 if (options.unstable_moves && isCurrentItemRef.current) { 54249 Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* u */ "c"])(element); 54250 } 54251 }, [options.unstable_moves]); 54252 var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 54253 var _onMouseDownRef$curre; 54254 54255 (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); 54256 Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* s */ "b"])(event.currentTarget, true); 54257 }, []); 54258 var onFocus = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 54259 var _onFocusRef$current, _options$setCurrentId; 54260 54261 var shouldFocusComposite = Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* h */ "a"])(event.currentTarget); 54262 Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* s */ "b"])(event.currentTarget, false); 54263 (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); 54264 if (event.defaultPrevented) return; 54265 if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_9__[/* isPortalEvent */ "a"])(event)) return; 54266 if (!id) return; 54267 if (targetIsAnotherItem(event, options.items)) return; 54268 (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, id); // When using aria-activedescendant, we want to make sure that the 54269 // composite container receives focus, not the composite item. 54270 // But we don't want to do this if the target is another focusable 54271 // element inside the composite item, such as CompositeItemWidget. 54272 54273 if (shouldFocusComposite && options.unstable_virtual && options.baseId && Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) { 54274 var target = event.target; 54275 var composite = Object(reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_11__[/* getDocument */ "a"])(target).getElementById(options.baseId); 54276 54277 if (composite) { 54278 hasFocusedComposite.current = true; 54279 Object(reakit_utils_ensureFocus__WEBPACK_IMPORTED_MODULE_16__[/* ensureFocus */ "a"])(composite); 54280 } 54281 } 54282 }, [id, options.items, options.setCurrentId, options.unstable_virtual, options.baseId]); 54283 var onBlurCapture = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 54284 var _onBlurCaptureRef$cur; 54285 54286 (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event); 54287 if (event.defaultPrevented) return; 54288 54289 if (options.unstable_virtual && hasFocusedComposite.current) { 54290 // When hasFocusedComposite is true, composite has been focused right 54291 // after focusing this item. This is an intermediate blur event, so 54292 // we ignore it. 54293 hasFocusedComposite.current = false; 54294 event.preventDefault(); 54295 event.stopPropagation(); 54296 } 54297 }, [options.unstable_virtual]); 54298 var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 54299 var _onKeyDownRef$current; 54300 54301 if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return; 54302 var isVertical = options.orientation !== "horizontal"; 54303 var isHorizontal = options.orientation !== "vertical"; 54304 var isGrid = !!(item !== null && item !== void 0 && item.groupId); 54305 var keyMap = { 54306 ArrowUp: (isGrid || isVertical) && options.up, 54307 ArrowRight: (isGrid || isHorizontal) && options.next, 54308 ArrowDown: (isGrid || isVertical) && options.down, 54309 ArrowLeft: (isGrid || isHorizontal) && options.previous, 54310 Home: function Home() { 54311 if (!isGrid || event.ctrlKey) { 54312 var _options$first; 54313 54314 (_options$first = options.first) === null || _options$first === void 0 ? void 0 : _options$first.call(options); 54315 } else { 54316 var _options$previous; 54317 54318 (_options$previous = options.previous) === null || _options$previous === void 0 ? void 0 : _options$previous.call(options, true); 54319 } 54320 }, 54321 End: function End() { 54322 if (!isGrid || event.ctrlKey) { 54323 var _options$last; 54324 54325 (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); 54326 } else { 54327 var _options$next; 54328 54329 (_options$next = options.next) === null || _options$next === void 0 ? void 0 : _options$next.call(options, true); 54330 } 54331 }, 54332 PageUp: function PageUp() { 54333 if (isGrid) { 54334 var _options$up; 54335 54336 (_options$up = options.up) === null || _options$up === void 0 ? void 0 : _options$up.call(options, true); 54337 } else { 54338 var _options$first2; 54339 54340 (_options$first2 = options.first) === null || _options$first2 === void 0 ? void 0 : _options$first2.call(options); 54341 } 54342 }, 54343 PageDown: function PageDown() { 54344 if (isGrid) { 54345 var _options$down; 54346 54347 (_options$down = options.down) === null || _options$down === void 0 ? void 0 : _options$down.call(options, true); 54348 } else { 54349 var _options$last2; 54350 54351 (_options$last2 = options.last) === null || _options$last2 === void 0 ? void 0 : _options$last2.call(options); 54352 } 54353 } 54354 }; 54355 var action = keyMap[event.key]; 54356 54357 if (action) { 54358 event.preventDefault(); 54359 action(); 54360 return; 54361 } 54362 54363 (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); 54364 if (event.defaultPrevented) return; 54365 54366 if (event.key.length === 1 && event.key !== " ") { 54367 var widget = getWidget(event.currentTarget); 54368 54369 if (widget && Object(reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_15__[/* isTextField */ "a"])(widget)) { 54370 widget.focus(); 54371 Object(_setTextFieldValue_0a221f4e_js__WEBPACK_IMPORTED_MODULE_18__[/* s */ "a"])(widget, ""); 54372 } 54373 } else if (event.key === "Delete" || event.key === "Backspace") { 54374 var _widget = getWidget(event.currentTarget); 54375 54376 if (_widget && Object(reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_15__[/* isTextField */ "a"])(_widget)) { 54377 event.preventDefault(); 54378 Object(_setTextFieldValue_0a221f4e_js__WEBPACK_IMPORTED_MODULE_18__[/* s */ "a"])(_widget, ""); 54379 } 54380 } 54381 }, [options.orientation, item, options.up, options.next, options.down, options.previous, options.first, options.last]); 54382 var onClick = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 54383 var _onClickRef$current; 54384 54385 (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); 54386 if (event.defaultPrevented) return; 54387 var element = event.currentTarget; 54388 var widget = getWidget(element); 54389 54390 if (widget && !Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_8__[/* hasFocusWithin */ "a"])(widget)) { 54391 // If there's a widget inside the composite item, we make sure it's 54392 // focused when pressing enter, space or clicking on the composite item. 54393 widget.focus(); 54394 } 54395 }, []); 54396 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 54397 ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef), 54398 id: id, 54399 tabIndex: shouldTabIndex ? htmlTabIndex : -1, 54400 "aria-selected": options.unstable_virtual && isCurrentItem ? true : undefined, 54401 onMouseDown: onMouseDown, 54402 onFocus: onFocus, 54403 onBlurCapture: onBlurCapture, 54404 onKeyDown: onKeyDown, 54405 onClick: onClick 54406 }, htmlProps); 54407 } 54408 }); 54409 var CompositeItem = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 54410 as: "button", 54411 memo: true, 54412 useHook: useCompositeItem 54413 }); 54414 54415 54416 54417 54418 /***/ }), 54419 54420 /***/ "kgBv": 54421 /***/ (function(module, exports, __webpack_require__) { 54422 54423 "use strict"; 54424 54425 54426 var GetIntrinsic = __webpack_require__("rZ7t"); 54427 54428 var $gOPD = __webpack_require__("knm9"); 54429 var $TypeError = GetIntrinsic('%TypeError%'); 54430 54431 var callBound = __webpack_require__("EXo9"); 54432 54433 var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 54434 54435 var has = __webpack_require__("oNNP"); 54436 54437 var IsArray = __webpack_require__("9cOx"); 54438 var IsPropertyKey = __webpack_require__("i10q"); 54439 var IsRegExp = __webpack_require__("yy3d"); 54440 var ToPropertyDescriptor = __webpack_require__("eBsn"); 54441 var Type = __webpack_require__("V1cy"); 54442 54443 // https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty 54444 54445 module.exports = function OrdinaryGetOwnProperty(O, P) { 54446 if (Type(O) !== 'Object') { 54447 throw new $TypeError('Assertion failed: O must be an Object'); 54448 } 54449 if (!IsPropertyKey(P)) { 54450 throw new $TypeError('Assertion failed: P must be a Property Key'); 54451 } 54452 if (!has(O, P)) { 54453 return void 0; 54454 } 54455 if (!$gOPD) { 54456 // ES3 / IE 8 fallback 54457 var arrayLength = IsArray(O) && P === 'length'; 54458 var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; 54459 return { 54460 '[[Configurable]]': !(arrayLength || regexLastIndex), 54461 '[[Enumerable]]': $isEnumerable(O, P), 54462 '[[Value]]': O[P], 54463 '[[Writable]]': true 54464 }; 54465 } 54466 return ToPropertyDescriptor($gOPD(O, P)); 54467 }; 54468 54469 54470 /***/ }), 54471 54472 /***/ "khzz": 54473 /***/ (function(module, __webpack_exports__, __webpack_require__) { 54474 54475 "use strict"; 54476 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createEvent; }); 54477 /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs"); 54478 54479 54480 /** 54481 * Creates an `Event` in a way that also works on IE 11. 54482 * 54483 * @example 54484 * import { createEvent } from "reakit-utils"; 54485 * 54486 * const el = document.getElementById("id"); 54487 * el.dispatchEvent(createEvent(el, "blur", { bubbles: false })); 54488 */ 54489 54490 function createEvent(element, type, eventInit) { 54491 if (typeof Event === "function") { 54492 return new Event(type, eventInit); 54493 } // IE 11 doesn't support Event constructors 54494 54495 54496 var event = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).createEvent("Event"); 54497 event.initEvent(type, eventInit === null || eventInit === void 0 ? void 0 : eventInit.bubbles, eventInit === null || eventInit === void 0 ? void 0 : eventInit.cancelable); 54498 return event; 54499 } 54500 54501 54502 54503 54504 /***/ }), 54505 54506 /***/ "knm9": 54507 /***/ (function(module, exports, __webpack_require__) { 54508 54509 "use strict"; 54510 54511 54512 var GetIntrinsic = __webpack_require__("rZ7t"); 54513 54514 var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); 54515 if ($gOPD) { 54516 try { 54517 $gOPD([], 'length'); 54518 } catch (e) { 54519 // IE 8 has a broken gOPD 54520 $gOPD = null; 54521 } 54522 } 54523 54524 module.exports = $gOPD; 54525 54526 54527 /***/ }), 54528 54529 /***/ "kqkJ": 54530 /***/ (function(module, __webpack_exports__, __webpack_require__) { 54531 54532 "use strict"; 54533 54534 // EXPORTS 54535 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ isFocusable; }); 54536 54537 // UNUSED EXPORTS: getAllFocusableIn, getAllTabbableIn, getClosestFocusable, getFirstFocusableIn, getFirstTabbableIn, getLastTabbableIn, getNextTabbableIn, getPreviousTabbableIn, isTabbable 54538 54539 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js 54540 /** 54541 * Ponyfill for `Element.prototype.matches` 54542 * 54543 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches 54544 */ 54545 function matches(element, selectors) { 54546 if ("matches" in element) { 54547 return element.matches(selectors); 54548 } 54549 54550 if ("msMatchesSelector" in element) { 54551 return element.msMatchesSelector(selectors); 54552 } 54553 54554 return element.webkitMatchesSelector(selectors); 54555 } 54556 54557 54558 54559 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/closest.js 54560 54561 54562 /** 54563 * Ponyfill for `Element.prototype.closest` 54564 * 54565 * @example 54566 * import { closest } from "reakit-utils"; 54567 * 54568 * closest(document.getElementById("id"), "div"); 54569 * // same as 54570 * document.getElementById("id").closest("div"); 54571 */ 54572 function closest(element, selectors) { 54573 if ("closest" in element) return element.closest(selectors); 54574 54575 do { 54576 if (matches(element, selectors)) return element; 54577 element = element.parentElement || element.parentNode; 54578 } while (element !== null && element.nodeType === 1); 54579 54580 return null; 54581 } 54582 54583 54584 54585 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js 54586 var getActiveElement = __webpack_require__("Nym8"); 54587 54588 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js 54589 54590 54591 54592 54593 54594 /** @module tabbable */ 54595 var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), " + "textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], " + "iframe, object, embed, area[href], audio[controls], video[controls], " + "[contenteditable]:not([contenteditable='false'])"; 54596 54597 function isVisible(element) { 54598 var htmlElement = element; 54599 return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; 54600 } 54601 54602 function hasNegativeTabIndex(element) { 54603 var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); 54604 return tabIndex < 0; 54605 } 54606 /** 54607 * Checks whether `element` is focusable or not. 54608 * 54609 * @memberof tabbable 54610 * 54611 * @example 54612 * import { isFocusable } from "reakit-utils"; 54613 * 54614 * isFocusable(document.querySelector("input")); // true 54615 * isFocusable(document.querySelector("input[tabindex='-1']")); // true 54616 * isFocusable(document.querySelector("input[hidden]")); // false 54617 * isFocusable(document.querySelector("input:disabled")); // false 54618 */ 54619 54620 54621 function isFocusable(element) { 54622 return matches(element, selector) && isVisible(element); 54623 } 54624 /** 54625 * Checks whether `element` is tabbable or not. 54626 * 54627 * @memberof tabbable 54628 * 54629 * @example 54630 * import { isTabbable } from "reakit-utils"; 54631 * 54632 * isTabbable(document.querySelector("input")); // true 54633 * isTabbable(document.querySelector("input[tabindex='-1']")); // false 54634 * isTabbable(document.querySelector("input[hidden]")); // false 54635 * isTabbable(document.querySelector("input:disabled")); // false 54636 */ 54637 54638 function isTabbable(element) { 54639 return isFocusable(element) && !hasNegativeTabIndex(element); 54640 } 54641 /** 54642 * Returns all the focusable elements in `container`. 54643 * 54644 * @memberof tabbable 54645 * 54646 * @param {Element} container 54647 * 54648 * @returns {Element[]} 54649 */ 54650 54651 function getAllFocusableIn(container) { 54652 var allFocusable = Array.from(container.querySelectorAll(selector)); 54653 allFocusable.unshift(container); 54654 return allFocusable.filter(isFocusable); 54655 } 54656 /** 54657 * Returns the first focusable element in `container`. 54658 * 54659 * @memberof tabbable 54660 * 54661 * @param {Element} container 54662 * 54663 * @returns {Element|null} 54664 */ 54665 54666 function getFirstFocusableIn(container) { 54667 var _getAllFocusableIn = getAllFocusableIn(container), 54668 first = _getAllFocusableIn[0]; 54669 54670 return first || null; 54671 } 54672 /** 54673 * Returns all the tabbable elements in `container`, including the container 54674 * itself. 54675 * 54676 * @memberof tabbable 54677 * 54678 * @param {Element} container 54679 * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones. 54680 * 54681 * @returns {Element[]} 54682 */ 54683 54684 function getAllTabbableIn(container, fallbackToFocusable) { 54685 var allFocusable = Array.from(container.querySelectorAll(selector)); 54686 var allTabbable = allFocusable.filter(isTabbable); 54687 54688 if (isTabbable(container)) { 54689 allTabbable.unshift(container); 54690 } 54691 54692 if (!allTabbable.length && fallbackToFocusable) { 54693 return allFocusable; 54694 } 54695 54696 return allTabbable; 54697 } 54698 /** 54699 * Returns the first tabbable element in `container`, including the container 54700 * itself if it's tabbable. 54701 * 54702 * @memberof tabbable 54703 * 54704 * @param {Element} container 54705 * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones. 54706 * 54707 * @returns {Element|null} 54708 */ 54709 54710 function getFirstTabbableIn(container, fallbackToFocusable) { 54711 var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable), 54712 first = _getAllTabbableIn[0]; 54713 54714 return first || null; 54715 } 54716 /** 54717 * Returns the last tabbable element in `container`, including the container 54718 * itself if it's tabbable. 54719 * 54720 * @memberof tabbable 54721 * 54722 * @param {Element} container 54723 * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones. 54724 * 54725 * @returns {Element|null} 54726 */ 54727 54728 function getLastTabbableIn(container, fallbackToFocusable) { 54729 var allTabbable = getAllTabbableIn(container, fallbackToFocusable); 54730 return allTabbable[allTabbable.length - 1] || null; 54731 } 54732 /** 54733 * Returns the next tabbable element in `container`. 54734 * 54735 * @memberof tabbable 54736 * 54737 * @param {Element} container 54738 * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones. 54739 * 54740 * @returns {Element|null} 54741 */ 54742 54743 function getNextTabbableIn(container, fallbackToFocusable) { 54744 var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container); 54745 var allFocusable = getAllFocusableIn(container); 54746 var index = allFocusable.indexOf(activeElement); 54747 var slice = allFocusable.slice(index + 1); 54748 return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); 54749 } 54750 /** 54751 * Returns the previous tabbable element in `container`. 54752 * 54753 * @memberof tabbable 54754 * 54755 * @param {Element} container 54756 * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones. 54757 * 54758 * @returns {Element|null} 54759 */ 54760 54761 function getPreviousTabbableIn(container, fallbackToFocusable) { 54762 var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container); 54763 var allFocusable = getAllFocusableIn(container).reverse(); 54764 var index = allFocusable.indexOf(activeElement); 54765 var slice = allFocusable.slice(index + 1); 54766 return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); 54767 } 54768 /** 54769 * Returns the closest focusable element. 54770 * 54771 * @memberof tabbable 54772 * 54773 * @param {Element} container 54774 * 54775 * @returns {Element|null} 54776 */ 54777 54778 function getClosestFocusable(element) { 54779 while (element && !isFocusable(element)) { 54780 element = closest(element, selector); 54781 } 54782 54783 return element; 54784 } 54785 54786 54787 54788 54789 /***/ }), 54790 54791 /***/ "kuGu": 54792 /***/ (function(module, exports, __webpack_require__) { 54793 54794 "use strict"; 54795 54796 54797 var GetIntrinsic = __webpack_require__("Jt44"); 54798 54799 var $construct = GetIntrinsic('%Reflect.construct%', true); 54800 54801 var DefinePropertyOrThrow = __webpack_require__("eOFJ"); 54802 try { 54803 DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); 54804 } catch (e) { 54805 // Accessor properties aren't supported 54806 DefinePropertyOrThrow = null; 54807 } 54808 54809 // https://ecma-international.org/ecma-262/6.0/#sec-isconstructor 54810 54811 if (DefinePropertyOrThrow && $construct) { 54812 var isConstructorMarker = {}; 54813 var badArrayLike = {}; 54814 DefinePropertyOrThrow(badArrayLike, 'length', { 54815 '[[Get]]': function () { 54816 throw isConstructorMarker; 54817 }, 54818 '[[Enumerable]]': true 54819 }); 54820 54821 module.exports = function IsConstructor(argument) { 54822 try { 54823 // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: 54824 $construct(argument, badArrayLike); 54825 } catch (err) { 54826 return err === isConstructorMarker; 54827 } 54828 }; 54829 } else { 54830 module.exports = function IsConstructor(argument) { 54831 // unfortunately there's no way to truly check this without try/catch `new argument` in old environments 54832 return typeof argument === 'function' && !!argument.prototype; 54833 }; 54834 } 54835 54836 54837 /***/ }), 54838 54839 /***/ "kvlw": 54840 /***/ (function(module, exports, __webpack_require__) { 54841 54842 "use strict"; 54843 54844 54845 // http://262.ecma-international.org/5.1/#sec-9.2 54846 54847 module.exports = function ToBoolean(value) { return !!value; }; 54848 54849 54850 /***/ }), 54851 54852 /***/ "l3Sj": 54853 /***/ (function(module, exports) { 54854 54855 (function() { module.exports = window["wp"]["i18n"]; }()); 54856 54857 /***/ }), 54858 54859 /***/ "lSNA": 54860 /***/ (function(module, exports) { 54861 54862 function _defineProperty(obj, key, value) { 54863 if (key in obj) { 54864 Object.defineProperty(obj, key, { 54865 value: value, 54866 enumerable: true, 54867 configurable: true, 54868 writable: true 54869 }); 54870 } else { 54871 obj[key] = value; 54872 } 54873 54874 return obj; 54875 } 54876 54877 module.exports = _defineProperty; 54878 module.exports["default"] = module.exports, module.exports.__esModule = true; 54879 54880 /***/ }), 54881 54882 /***/ "laOf": 54883 /***/ (function(module, exports, __webpack_require__) { 54884 54885 "use strict"; 54886 54887 54888 var GetIntrinsic = __webpack_require__("rZ7t"); 54889 54890 var $TypeError = GetIntrinsic('%TypeError%'); 54891 54892 // http://262.ecma-international.org/5.1/#sec-9.10 54893 54894 module.exports = function CheckObjectCoercible(value, optMessage) { 54895 if (value == null) { 54896 throw new $TypeError(optMessage || ('Cannot call method on ' + value)); 54897 } 54898 return value; 54899 }; 54900 54901 54902 /***/ }), 54903 54904 /***/ "ldlY": 54905 /***/ (function(module, __webpack_exports__, __webpack_require__) { 54906 54907 "use strict"; 54908 54909 // EXTERNAL MODULE: ./node_modules/classnames/index.js 54910 var classnames = __webpack_require__("TSYQ"); 54911 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 54912 54913 // EXTERNAL MODULE: external ["wp","element"] 54914 var external_wp_element_ = __webpack_require__("GRId"); 54915 54916 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/utils.js 54917 54918 54919 /** 54920 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 54921 * @typedef OwnProps 54922 * @property {T} [as='div'] Component to render 54923 * @property {import('react').ReactNode | ((props: import('react').ComponentProps<T>) => JSX.Element) } [children] Children or render props function 54924 */ 54925 54926 /** 54927 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 54928 * @typedef {OwnProps<T> & import('react').ComponentProps<T>} Props 54929 */ 54930 54931 /** 54932 * renderAsRenderProps is used to wrap a component and convert 54933 * the passed property "as" either a string or component, to the 54934 * rendered tag if a string, or component. 54935 * 54936 * See VisuallyHidden hidden for example. 54937 * 54938 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 54939 * @param {Props<T>} props 54940 * @return {JSX.Element} The rendered element. 54941 */ 54942 function renderAsRenderProps({ 54943 as: Component = 'div', 54944 ...props 54945 }) { 54946 if (typeof props.children === 'function') { 54947 return props.children(props); 54948 } 54949 54950 return Object(external_wp_element_["createElement"])(Component, props); 54951 } 54952 54953 54954 54955 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js 54956 var with_next = __webpack_require__("9NHk"); 54957 54958 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/next.js 54959 /** 54960 * Internal dependencies 54961 */ 54962 54963 54964 const VisuallyHidden = false ? undefined : undefined; 54965 /** 54966 * There is nothing to adapt, the props are equal. 54967 * 54968 * @param {import('.').Props<any>} props 54969 * @return {import('../ui/visually-hidden/hook').Props} Adapted props 54970 */ 54971 54972 const adapter = props => 54973 /** @type {import('../ui/visually-hidden/hook').Props} */ 54974 props; 54975 /** 54976 * The generic type is too difficult to type here, default to any to circumvent that. 54977 * 54978 * @param {import('react').ForwardRefExoticComponent<import('.').Props<any>>} Current 54979 */ 54980 54981 54982 function withNextComponent(Current) { 54983 return Object(with_next["a" /* withNext */])(Current, VisuallyHidden, 'WPComponentsVisuallyHidden', adapter); 54984 } 54985 54986 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js 54987 /** 54988 * External dependencies 54989 */ 54990 54991 /** 54992 * WordPress dependencies 54993 */ 54994 54995 54996 /** 54997 * Internal dependencies 54998 */ 54999 55000 55001 55002 /** 55003 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 55004 * @typedef OwnProps 55005 * @property {T} [as='div'] Component to render, e.g. `"div"` or `MyComponent`. 55006 */ 55007 55008 /** 55009 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 55010 * @typedef {OwnProps<T> & import('react').ComponentPropsWithRef<T>} Props 55011 */ 55012 55013 /** 55014 * VisuallyHidden component to render text out non-visually 55015 * for use in devices such as a screen reader. 55016 * 55017 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T T 55018 * @param {Props<T>} props 55019 * @param {import('react').Ref<any>} forwardedRef 55020 * @return {JSX.Element} Element 55021 */ 55022 55023 function visually_hidden_VisuallyHidden({ 55024 as = 'div', 55025 className, 55026 ...props 55027 }, forwardedRef) { 55028 return renderAsRenderProps({ 55029 as, 55030 className: classnames_default()('components-visually-hidden', className), 55031 ...props, 55032 ref: forwardedRef 55033 }); 55034 } 55035 55036 /* harmony default export */ var visually_hidden = __webpack_exports__["a"] = (withNextComponent(Object(external_wp_element_["forwardRef"])(visually_hidden_VisuallyHidden))); 55037 55038 55039 /***/ }), 55040 55041 /***/ "lzPt": 55042 /***/ (function(module, exports, __webpack_require__) { 55043 55044 // eslint-disable-next-line import/no-unresolved 55045 module.exports = __webpack_require__("VDVV").default; 55046 55047 55048 /***/ }), 55049 55050 /***/ "m2ax": 55051 /***/ (function(module, exports, __webpack_require__) { 55052 55053 "use strict"; 55054 55055 55056 Object.defineProperty(exports, "__esModule", { 55057 value: true 55058 }); 55059 exports["default"] = getCalendarMonthWidth; 55060 function getCalendarMonthWidth(daySize, calendarMonthPadding) { 55061 return 7 * daySize + 2 * calendarMonthPadding + 1; 55062 } 55063 55064 /***/ }), 55065 55066 /***/ "mMiH": 55067 /***/ (function(module, exports, __webpack_require__) { 55068 55069 "use strict"; 55070 55071 55072 Object.defineProperty(exports, "__esModule", { 55073 value: true 55074 }); 55075 55076 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; }; 55077 55078 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; }; }(); 55079 55080 var _object = __webpack_require__("Koq/"); 55081 55082 var _object2 = _interopRequireDefault(_object); 55083 55084 var _react = __webpack_require__("cDcd"); 55085 55086 var _react2 = _interopRequireDefault(_react); 55087 55088 var _propTypes = __webpack_require__("17x9"); 55089 55090 var _propTypes2 = _interopRequireDefault(_propTypes); 55091 55092 var _reactAddonsShallowCompare = __webpack_require__("YZDV"); 55093 55094 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 55095 55096 var _reactMomentProptypes = __webpack_require__("XGBb"); 55097 55098 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 55099 55100 var _airbnbPropTypes = __webpack_require__("Hsqg"); 55101 55102 var _reactWithStyles = __webpack_require__("TG4+"); 55103 55104 var _moment = __webpack_require__("wy2R"); 55105 55106 var _moment2 = _interopRequireDefault(_moment); 55107 55108 var _defaultPhrases = __webpack_require__("vV+G"); 55109 55110 var _getPhrasePropTypes = __webpack_require__("yc2e"); 55111 55112 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 55113 55114 var _CalendarWeek = __webpack_require__("2Q00"); 55115 55116 var _CalendarWeek2 = _interopRequireDefault(_CalendarWeek); 55117 55118 var _CalendarDay = __webpack_require__("N3k4"); 55119 55120 var _CalendarDay2 = _interopRequireDefault(_CalendarDay); 55121 55122 var _calculateDimension = __webpack_require__("ixyq"); 55123 55124 var _calculateDimension2 = _interopRequireDefault(_calculateDimension); 55125 55126 var _getCalendarMonthWeeks = __webpack_require__("F7ZS"); 55127 55128 var _getCalendarMonthWeeks2 = _interopRequireDefault(_getCalendarMonthWeeks); 55129 55130 var _isSameDay = __webpack_require__("pRvc"); 55131 55132 var _isSameDay2 = _interopRequireDefault(_isSameDay); 55133 55134 var _toISODateString = __webpack_require__("pYxT"); 55135 55136 var _toISODateString2 = _interopRequireDefault(_toISODateString); 55137 55138 var _ModifiersShape = __webpack_require__("J7JS"); 55139 55140 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 55141 55142 var _ScrollableOrientationShape = __webpack_require__("aE6U"); 55143 55144 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 55145 55146 var _DayOfWeekShape = __webpack_require__("2S2E"); 55147 55148 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 55149 55150 var _constants = __webpack_require__("Fv1B"); 55151 55152 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 55153 55154 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 55155 55156 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; } 55157 55158 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; } /* eslint react/no-array-index-key: 0 */ 55159 55160 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 55161 month: _reactMomentProptypes2['default'].momentObj, 55162 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 55163 isVisible: _propTypes2['default'].bool, 55164 enableOutsideDays: _propTypes2['default'].bool, 55165 modifiers: _propTypes2['default'].objectOf(_ModifiersShape2['default']), 55166 orientation: _ScrollableOrientationShape2['default'], 55167 daySize: _airbnbPropTypes.nonNegativeInteger, 55168 onDayClick: _propTypes2['default'].func, 55169 onDayMouseEnter: _propTypes2['default'].func, 55170 onDayMouseLeave: _propTypes2['default'].func, 55171 onMonthSelect: _propTypes2['default'].func, 55172 onYearSelect: _propTypes2['default'].func, 55173 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 55174 renderCalendarDay: _propTypes2['default'].func, 55175 renderDayContents: _propTypes2['default'].func, 55176 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 55177 firstDayOfWeek: _DayOfWeekShape2['default'], 55178 setMonthTitleHeight: _propTypes2['default'].func, 55179 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 55180 55181 focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day 55182 isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day 55183 55184 // i18n 55185 monthFormat: _propTypes2['default'].string, 55186 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)), 55187 dayAriaLabelFormat: _propTypes2['default'].string 55188 })); 55189 55190 var defaultProps = { 55191 month: (0, _moment2['default'])(), 55192 horizontalMonthPadding: 13, 55193 isVisible: true, 55194 enableOutsideDays: false, 55195 modifiers: {}, 55196 orientation: _constants.HORIZONTAL_ORIENTATION, 55197 daySize: _constants.DAY_SIZE, 55198 onDayClick: function () { 55199 function onDayClick() {} 55200 55201 return onDayClick; 55202 }(), 55203 onDayMouseEnter: function () { 55204 function onDayMouseEnter() {} 55205 55206 return onDayMouseEnter; 55207 }(), 55208 onDayMouseLeave: function () { 55209 function onDayMouseLeave() {} 55210 55211 return onDayMouseLeave; 55212 }(), 55213 onMonthSelect: function () { 55214 function onMonthSelect() {} 55215 55216 return onMonthSelect; 55217 }(), 55218 onYearSelect: function () { 55219 function onYearSelect() {} 55220 55221 return onYearSelect; 55222 }(), 55223 55224 renderMonthText: null, 55225 renderCalendarDay: function () { 55226 function renderCalendarDay(props) { 55227 return _react2['default'].createElement(_CalendarDay2['default'], props); 55228 } 55229 55230 return renderCalendarDay; 55231 }(), 55232 renderDayContents: null, 55233 renderMonthElement: null, 55234 firstDayOfWeek: null, 55235 setMonthTitleHeight: null, 55236 55237 focusedDate: null, 55238 isFocused: false, 55239 55240 // i18n 55241 monthFormat: 'MMMM YYYY', // english locale 55242 phrases: _defaultPhrases.CalendarDayPhrases, 55243 dayAriaLabelFormat: undefined, 55244 verticalBorderSpacing: undefined 55245 }; 55246 55247 var CalendarMonth = function (_React$Component) { 55248 _inherits(CalendarMonth, _React$Component); 55249 55250 function CalendarMonth(props) { 55251 _classCallCheck(this, CalendarMonth); 55252 55253 var _this = _possibleConstructorReturn(this, (CalendarMonth.__proto__ || Object.getPrototypeOf(CalendarMonth)).call(this, props)); 55254 55255 _this.state = { 55256 weeks: (0, _getCalendarMonthWeeks2['default'])(props.month, props.enableOutsideDays, props.firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : props.firstDayOfWeek) 55257 }; 55258 55259 _this.setCaptionRef = _this.setCaptionRef.bind(_this); 55260 _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this); 55261 return _this; 55262 } 55263 55264 _createClass(CalendarMonth, [{ 55265 key: 'componentDidMount', 55266 value: function () { 55267 function componentDidMount() { 55268 this.setMonthTitleHeightTimeout = setTimeout(this.setMonthTitleHeight, 0); 55269 } 55270 55271 return componentDidMount; 55272 }() 55273 }, { 55274 key: 'componentWillReceiveProps', 55275 value: function () { 55276 function componentWillReceiveProps(nextProps) { 55277 var month = nextProps.month, 55278 enableOutsideDays = nextProps.enableOutsideDays, 55279 firstDayOfWeek = nextProps.firstDayOfWeek; 55280 var _props = this.props, 55281 prevMonth = _props.month, 55282 prevEnableOutsideDays = _props.enableOutsideDays, 55283 prevFirstDayOfWeek = _props.firstDayOfWeek; 55284 55285 if (!month.isSame(prevMonth) || enableOutsideDays !== prevEnableOutsideDays || firstDayOfWeek !== prevFirstDayOfWeek) { 55286 this.setState({ 55287 weeks: (0, _getCalendarMonthWeeks2['default'])(month, enableOutsideDays, firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : firstDayOfWeek) 55288 }); 55289 } 55290 } 55291 55292 return componentWillReceiveProps; 55293 }() 55294 }, { 55295 key: 'shouldComponentUpdate', 55296 value: function () { 55297 function shouldComponentUpdate(nextProps, nextState) { 55298 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 55299 } 55300 55301 return shouldComponentUpdate; 55302 }() 55303 }, { 55304 key: 'componentWillUnmount', 55305 value: function () { 55306 function componentWillUnmount() { 55307 if (this.setMonthTitleHeightTimeout) { 55308 clearTimeout(this.setMonthTitleHeightTimeout); 55309 } 55310 } 55311 55312 return componentWillUnmount; 55313 }() 55314 }, { 55315 key: 'setMonthTitleHeight', 55316 value: function () { 55317 function setMonthTitleHeight() { 55318 var setMonthTitleHeight = this.props.setMonthTitleHeight; 55319 55320 if (setMonthTitleHeight) { 55321 var captionHeight = (0, _calculateDimension2['default'])(this.captionRef, 'height', true, true); 55322 setMonthTitleHeight(captionHeight); 55323 } 55324 } 55325 55326 return setMonthTitleHeight; 55327 }() 55328 }, { 55329 key: 'setCaptionRef', 55330 value: function () { 55331 function setCaptionRef(ref) { 55332 this.captionRef = ref; 55333 } 55334 55335 return setCaptionRef; 55336 }() 55337 }, { 55338 key: 'render', 55339 value: function () { 55340 function render() { 55341 var _props2 = this.props, 55342 dayAriaLabelFormat = _props2.dayAriaLabelFormat, 55343 daySize = _props2.daySize, 55344 focusedDate = _props2.focusedDate, 55345 horizontalMonthPadding = _props2.horizontalMonthPadding, 55346 isFocused = _props2.isFocused, 55347 isVisible = _props2.isVisible, 55348 modifiers = _props2.modifiers, 55349 month = _props2.month, 55350 monthFormat = _props2.monthFormat, 55351 onDayClick = _props2.onDayClick, 55352 onDayMouseEnter = _props2.onDayMouseEnter, 55353 onDayMouseLeave = _props2.onDayMouseLeave, 55354 onMonthSelect = _props2.onMonthSelect, 55355 onYearSelect = _props2.onYearSelect, 55356 orientation = _props2.orientation, 55357 phrases = _props2.phrases, 55358 renderCalendarDay = _props2.renderCalendarDay, 55359 renderDayContents = _props2.renderDayContents, 55360 renderMonthElement = _props2.renderMonthElement, 55361 renderMonthText = _props2.renderMonthText, 55362 styles = _props2.styles, 55363 verticalBorderSpacing = _props2.verticalBorderSpacing; 55364 var weeks = this.state.weeks; 55365 55366 var monthTitle = renderMonthText ? renderMonthText(month) : month.format(monthFormat); 55367 55368 var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 55369 55370 return _react2['default'].createElement( 55371 'div', 55372 _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonth, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), { 55373 'data-visible': isVisible 55374 }), 55375 _react2['default'].createElement( 55376 'div', 55377 _extends({ 55378 ref: this.setCaptionRef 55379 }, (0, _reactWithStyles.css)(styles.CalendarMonth_caption, verticalScrollable && styles.CalendarMonth_caption__verticalScrollable)), 55380 renderMonthElement ? renderMonthElement({ month: month, onMonthSelect: onMonthSelect, onYearSelect: onYearSelect }) : _react2['default'].createElement( 55381 'strong', 55382 null, 55383 monthTitle 55384 ) 55385 ), 55386 _react2['default'].createElement( 55387 'table', 55388 _extends({}, (0, _reactWithStyles.css)(!verticalBorderSpacing && styles.CalendarMonth_table, verticalBorderSpacing && styles.CalendarMonth_verticalSpacing, verticalBorderSpacing && { borderSpacing: '0px ' + String(verticalBorderSpacing) + 'px' }), { 55389 role: 'presentation' 55390 }), 55391 _react2['default'].createElement( 55392 'tbody', 55393 null, 55394 weeks.map(function (week, i) { 55395 return _react2['default'].createElement( 55396 _CalendarWeek2['default'], 55397 { key: i }, 55398 week.map(function (day, dayOfWeek) { 55399 return renderCalendarDay({ 55400 key: dayOfWeek, 55401 day: day, 55402 daySize: daySize, 55403 isOutsideDay: !day || day.month() !== month.month(), 55404 tabIndex: isVisible && (0, _isSameDay2['default'])(day, focusedDate) ? 0 : -1, 55405 isFocused: isFocused, 55406 onDayMouseEnter: onDayMouseEnter, 55407 onDayMouseLeave: onDayMouseLeave, 55408 onDayClick: onDayClick, 55409 renderDayContents: renderDayContents, 55410 phrases: phrases, 55411 modifiers: modifiers[(0, _toISODateString2['default'])(day)], 55412 ariaLabelFormat: dayAriaLabelFormat 55413 }); 55414 }) 55415 ); 55416 }) 55417 ) 55418 ) 55419 ); 55420 } 55421 55422 return render; 55423 }() 55424 }]); 55425 55426 return CalendarMonth; 55427 }(_react2['default'].Component); 55428 55429 CalendarMonth.propTypes = propTypes; 55430 CalendarMonth.defaultProps = defaultProps; 55431 55432 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) { 55433 var _ref$reactDates = _ref.reactDates, 55434 color = _ref$reactDates.color, 55435 font = _ref$reactDates.font, 55436 spacing = _ref$reactDates.spacing; 55437 return { 55438 CalendarMonth: { 55439 background: color.background, 55440 textAlign: 'center', 55441 verticalAlign: 'top', 55442 userSelect: 'none' 55443 }, 55444 55445 CalendarMonth_table: { 55446 borderCollapse: 'collapse', 55447 borderSpacing: 0 55448 }, 55449 55450 CalendarMonth_verticalSpacing: { 55451 borderCollapse: 'separate' 55452 }, 55453 55454 CalendarMonth_caption: { 55455 color: color.text, 55456 fontSize: font.captionSize, 55457 textAlign: 'center', 55458 paddingTop: spacing.captionPaddingTop, 55459 paddingBottom: spacing.captionPaddingBottom, 55460 captionSide: 'initial' 55461 }, 55462 55463 CalendarMonth_caption__verticalScrollable: { 55464 paddingTop: 12, 55465 paddingBottom: 7 55466 } 55467 }; 55468 })(CalendarMonth); 55469 55470 /***/ }), 55471 55472 /***/ "mjVI": 55473 /***/ (function(module, __webpack_exports__, __webpack_require__) { 55474 55475 "use strict"; 55476 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TOOLBAR_KEYS; }); 55477 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return TOOLBAR_ITEM_KEYS; }); 55478 /* unused harmony export b */ 55479 // Automatically generated 55480 var TOOLBAR_STATE_KEYS = ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "setBaseId", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"]; 55481 var TOOLBAR_KEYS = TOOLBAR_STATE_KEYS; 55482 var TOOLBAR_ITEM_KEYS = TOOLBAR_KEYS; 55483 var TOOLBAR_SEPARATOR_KEYS = TOOLBAR_ITEM_KEYS; 55484 55485 55486 55487 55488 /***/ }), 55489 55490 /***/ "n1Y7": 55491 /***/ (function(module, exports, __webpack_require__) { 55492 55493 "use strict"; 55494 55495 55496 var define = __webpack_require__("82c2"); 55497 55498 var implementation = __webpack_require__("nRDI"); 55499 var getPolyfill = __webpack_require__("5yQQ"); 55500 var polyfill = getPolyfill(); 55501 var shim = __webpack_require__("Gn0q"); 55502 55503 var boundContains = function contains(node, other) { 55504 return polyfill.apply(node, [other]); 55505 }; 55506 55507 define(boundContains, { 55508 getPolyfill: getPolyfill, 55509 implementation: implementation, 55510 shim: shim 55511 }); 55512 55513 module.exports = boundContains; 55514 55515 55516 /***/ }), 55517 55518 /***/ "nKkb": 55519 /***/ (function(module, exports, __webpack_require__) { 55520 55521 "use strict"; 55522 55523 55524 var GetIntrinsic = __webpack_require__("rZ7t"); 55525 55526 var $abs = GetIntrinsic('%Math.abs%'); 55527 55528 // http://262.ecma-international.org/5.1/#sec-5.2 55529 55530 module.exports = function abs(x) { 55531 return $abs(x); 55532 }; 55533 55534 55535 /***/ }), 55536 55537 /***/ "nLTY": 55538 /***/ (function(module, exports) { 55539 55540 Object.defineProperty(exports, "__esModule", { 55541 value: true 55542 }); 55543 exports['default'] = getClassName; 55544 /** 55545 * Construct a class name. 55546 * 55547 * namespace {String} Used to construct unique class names. 55548 * styleName {String} Name identifying the specific style. 55549 * 55550 * Return the class name. 55551 */ 55552 function getClassName(namespace, styleName) { 55553 var namespaceSegment = namespace.length > 0 ? String(namespace) + '__' : ''; 55554 return '' + namespaceSegment + String(styleName); 55555 } 55556 55557 /***/ }), 55558 55559 /***/ "nRDI": 55560 /***/ (function(module, exports, __webpack_require__) { 55561 55562 "use strict"; 55563 55564 55565 module.exports = function contains(other) { 55566 if (arguments.length < 1) { 55567 throw new TypeError('1 argument is required'); 55568 } 55569 if (typeof other !== 'object') { 55570 throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node'); 55571 } 55572 55573 var node = other; 55574 do { 55575 if (this === node) { 55576 return true; 55577 } 55578 if (node) { 55579 node = node.parentNode; 55580 } 55581 } while (node); 55582 55583 return false; 55584 }; 55585 55586 55587 /***/ }), 55588 55589 /***/ "nmnc": 55590 /***/ (function(module, exports, __webpack_require__) { 55591 55592 var root = __webpack_require__("Kz5y"); 55593 55594 /** Built-in value references. */ 55595 var Symbol = root.Symbol; 55596 55597 module.exports = Symbol; 55598 55599 55600 /***/ }), 55601 55602 /***/ "oNNP": 55603 /***/ (function(module, exports, __webpack_require__) { 55604 55605 "use strict"; 55606 55607 55608 var bind = __webpack_require__("D3zA"); 55609 55610 module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); 55611 55612 55613 /***/ }), 55614 55615 /***/ "oOcr": 55616 /***/ (function(module, exports, __webpack_require__) { 55617 55618 "use strict"; 55619 55620 55621 Object.defineProperty(exports, "__esModule", { 55622 value: true 55623 }); 55624 exports['default'] = getPhrase; 55625 function getPhrase(phrase, args) { 55626 if (typeof phrase === 'string') return phrase; 55627 55628 if (typeof phrase === 'function') { 55629 return phrase(args); 55630 } 55631 55632 return ''; 55633 } 55634 55635 /***/ }), 55636 55637 /***/ "oR9Z": 55638 /***/ (function(module, exports, __webpack_require__) { 55639 55640 "use strict"; 55641 55642 55643 Object.defineProperty(exports, "__esModule", { 55644 value: true 55645 }); 55646 55647 var _propTypes = __webpack_require__("17x9"); 55648 55649 var _propTypes2 = _interopRequireDefault(_propTypes); 55650 55651 var _constants = __webpack_require__("Fv1B"); 55652 55653 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 55654 55655 exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]); 55656 55657 /***/ }), 55658 55659 /***/ "oXO/": 55660 /***/ (function(module, __webpack_exports__, __webpack_require__) { 55661 55662 "use strict"; 55663 55664 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 55665 var esm_extends = __webpack_require__("wx14"); 55666 55667 // EXTERNAL MODULE: external ["wp","element"] 55668 var external_wp_element_ = __webpack_require__("GRId"); 55669 55670 // EXTERNAL MODULE: ./node_modules/classnames/index.js 55671 var classnames = __webpack_require__("TSYQ"); 55672 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 55673 55674 // EXTERNAL MODULE: external ["wp","dom"] 55675 var external_wp_dom_ = __webpack_require__("1CF3"); 55676 55677 // EXTERNAL MODULE: external ["wp","keycodes"] 55678 var external_wp_keycodes_ = __webpack_require__("RxS6"); 55679 55680 // EXTERNAL MODULE: external ["wp","deprecated"] 55681 var external_wp_deprecated_ = __webpack_require__("NMb1"); 55682 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); 55683 55684 // EXTERNAL MODULE: external ["wp","compose"] 55685 var external_wp_compose_ = __webpack_require__("K9lf"); 55686 55687 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js 55688 var library_close = __webpack_require__("w95h"); 55689 55690 // EXTERNAL MODULE: external ["wp","i18n"] 55691 var external_wp_i18n_ = __webpack_require__("l3Sj"); 55692 55693 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js 55694 /** 55695 * WordPress dependencies 55696 */ 55697 55698 /** 55699 * Module constants 55700 */ 55701 55702 const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space 55703 55704 /** 55705 * Utility used to compute the popover position over the xAxis 55706 * 55707 * @param {Object} anchorRect Anchor Rect. 55708 * @param {Object} contentSize Content Size. 55709 * @param {string} xAxis Desired xAxis. 55710 * @param {string} corner Desired corner. 55711 * @param {boolean} stickyBoundaryElement The boundary element to use when 55712 * switching between sticky and normal 55713 * position. 55714 * @param {string} chosenYAxis yAxis to be used. 55715 * @param {Element} boundaryElement Boundary element. 55716 * @param {boolean} forcePosition Don't adjust position based on anchor. 55717 * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis 55718 * 55719 * @return {Object} Popover xAxis position and constraints. 55720 */ 55721 55722 function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) { 55723 const { 55724 width 55725 } = contentSize; // Correct xAxis for RTL support 55726 55727 if (xAxis === 'left' && Object(external_wp_i18n_["isRTL"])()) { 55728 xAxis = 'right'; 55729 } else if (xAxis === 'right' && Object(external_wp_i18n_["isRTL"])()) { 55730 xAxis = 'left'; 55731 } 55732 55733 if (corner === 'left' && Object(external_wp_i18n_["isRTL"])()) { 55734 corner = 'right'; 55735 } else if (corner === 'right' && Object(external_wp_i18n_["isRTL"])()) { 55736 corner = 'left'; 55737 } // x axis alignment choices 55738 55739 55740 const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2); 55741 const centerAlignment = { 55742 popoverLeft: anchorMidPoint, 55743 contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2) 55744 }; 55745 let leftAlignmentX = anchorRect.left; 55746 55747 if (corner === 'right') { 55748 leftAlignmentX = anchorRect.right; 55749 } else if (chosenYAxis !== 'middle' && !forceXAlignment) { 55750 leftAlignmentX = anchorMidPoint; 55751 } 55752 55753 let rightAlignmentX = anchorRect.right; 55754 55755 if (corner === 'left') { 55756 rightAlignmentX = anchorRect.left; 55757 } else if (chosenYAxis !== 'middle' && !forceXAlignment) { 55758 rightAlignmentX = anchorMidPoint; 55759 } 55760 55761 const leftAlignment = { 55762 popoverLeft: leftAlignmentX, 55763 contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX 55764 }; 55765 const rightAlignment = { 55766 popoverLeft: rightAlignmentX, 55767 contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width 55768 }; // Choosing the x axis 55769 55770 let chosenXAxis = xAxis; 55771 let contentWidth = null; 55772 55773 if (!stickyBoundaryElement && !forcePosition) { 55774 if (xAxis === 'center' && centerAlignment.contentWidth === width) { 55775 chosenXAxis = 'center'; 55776 } else if (xAxis === 'left' && leftAlignment.contentWidth === width) { 55777 chosenXAxis = 'left'; 55778 } else if (xAxis === 'right' && rightAlignment.contentWidth === width) { 55779 chosenXAxis = 'right'; 55780 } else { 55781 chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right'; 55782 const chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width 55783 55784 if (width > window.innerWidth) { 55785 contentWidth = window.innerWidth; 55786 } // If we can't find any alignment options that could fit 55787 // our content, then let's fallback to the center of the viewport. 55788 55789 55790 if (chosenWidth !== width) { 55791 chosenXAxis = 'center'; 55792 centerAlignment.popoverLeft = window.innerWidth / 2; 55793 } 55794 } 55795 } 55796 55797 let popoverLeft; 55798 55799 if (chosenXAxis === 'center') { 55800 popoverLeft = centerAlignment.popoverLeft; 55801 } else if (chosenXAxis === 'left') { 55802 popoverLeft = leftAlignment.popoverLeft; 55803 } else { 55804 popoverLeft = rightAlignment.popoverLeft; 55805 } 55806 55807 if (boundaryElement) { 55808 const boundaryRect = boundaryElement.getBoundingClientRect(); 55809 popoverLeft = Math.min(popoverLeft, boundaryRect.right - width); // Avoid the popover being position beyond the left boundary if the 55810 // direction is left to right. 55811 55812 if (!Object(external_wp_i18n_["isRTL"])()) { 55813 popoverLeft = Math.max(popoverLeft, 0); 55814 } 55815 } 55816 55817 return { 55818 xAxis: chosenXAxis, 55819 popoverLeft, 55820 contentWidth 55821 }; 55822 } 55823 /** 55824 * Utility used to compute the popover position over the yAxis 55825 * 55826 * @param {Object} anchorRect Anchor Rect. 55827 * @param {Object} contentSize Content Size. 55828 * @param {string} yAxis Desired yAxis. 55829 * @param {string} corner Desired corner. 55830 * @param {boolean} stickyBoundaryElement The boundary element to use when 55831 * switching between sticky and normal 55832 * position. 55833 * @param {Element} anchorRef The anchor element. 55834 * @param {Element} relativeOffsetTop If applicable, top offset of the 55835 * relative positioned parent container. 55836 * @param {boolean} forcePosition Don't adjust position based on anchor. 55837 * 55838 * @return {Object} Popover xAxis position and constraints. 55839 */ 55840 55841 function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition) { 55842 const { 55843 height 55844 } = contentSize; 55845 55846 if (stickyBoundaryElement) { 55847 const stickyRect = stickyBoundaryElement.getBoundingClientRect(); 55848 const stickyPosition = stickyRect.top + height - relativeOffsetTop; 55849 55850 if (anchorRect.top <= stickyPosition) { 55851 return { 55852 yAxis, 55853 popoverTop: Math.min(anchorRect.bottom, stickyPosition) 55854 }; 55855 } 55856 } // y axis alignment choices 55857 55858 55859 let anchorMidPoint = anchorRect.top + anchorRect.height / 2; 55860 55861 if (corner === 'bottom') { 55862 anchorMidPoint = anchorRect.bottom; 55863 } else if (corner === 'top') { 55864 anchorMidPoint = anchorRect.top; 55865 } 55866 55867 const middleAlignment = { 55868 popoverTop: anchorMidPoint, 55869 contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2) 55870 }; 55871 const topAlignment = { 55872 popoverTop: anchorRect.top, 55873 contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET 55874 }; 55875 const bottomAlignment = { 55876 popoverTop: anchorRect.bottom, 55877 contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height 55878 }; // Choosing the y axis 55879 55880 let chosenYAxis = yAxis; 55881 let contentHeight = null; 55882 55883 if (!stickyBoundaryElement && !forcePosition) { 55884 if (yAxis === 'middle' && middleAlignment.contentHeight === height) { 55885 chosenYAxis = 'middle'; 55886 } else if (yAxis === 'top' && topAlignment.contentHeight === height) { 55887 chosenYAxis = 'top'; 55888 } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) { 55889 chosenYAxis = 'bottom'; 55890 } else { 55891 chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom'; 55892 const chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight; 55893 contentHeight = chosenHeight !== height ? chosenHeight : null; 55894 } 55895 } 55896 55897 let popoverTop; 55898 55899 if (chosenYAxis === 'middle') { 55900 popoverTop = middleAlignment.popoverTop; 55901 } else if (chosenYAxis === 'top') { 55902 popoverTop = topAlignment.popoverTop; 55903 } else { 55904 popoverTop = bottomAlignment.popoverTop; 55905 } 55906 55907 return { 55908 yAxis: chosenYAxis, 55909 popoverTop, 55910 contentHeight 55911 }; 55912 } 55913 /** 55914 * Utility used to compute the popover position and the content max width/height 55915 * for a popover given its anchor rect and its content size. 55916 * 55917 * @param {Object} anchorRect Anchor Rect. 55918 * @param {Object} contentSize Content Size. 55919 * @param {string} position Position. 55920 * @param {boolean} stickyBoundaryElement The boundary element to use when 55921 * switching between sticky and normal 55922 * position. 55923 * @param {Element} anchorRef The anchor element. 55924 * @param {number} relativeOffsetTop If applicable, top offset of the 55925 * relative positioned parent container. 55926 * @param {Element} boundaryElement Boundary element. 55927 * @param {boolean} forcePosition Don't adjust position based on anchor. 55928 * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis 55929 * 55930 * @return {Object} Popover position and constraints. 55931 */ 55932 55933 function computePopoverPosition(anchorRect, contentSize, position = 'top', stickyBoundaryElement, anchorRef, relativeOffsetTop, boundaryElement, forcePosition, forceXAlignment) { 55934 const [yAxis, xAxis = 'center', corner] = position.split(' '); 55935 const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition); 55936 const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment); 55937 return { ...xAxisPosition, 55938 ...yAxisPosition 55939 }; 55940 } 55941 /** 55942 * Offsets the given rect by the position of the iframe that contains the 55943 * element. If the owner document is not in an iframe then it returns with the 55944 * original rect. If the popover container document and the anchor document are 55945 * the same, the original rect will also be returned. 55946 * 55947 * @param {DOMRect} rect bounds of the element 55948 * @param {Document} ownerDocument document of the element 55949 * @param {Element} container The popover container to position. 55950 * 55951 * @return {DOMRect} offsetted bounds 55952 */ 55953 55954 function offsetIframe(rect, ownerDocument, container) { 55955 const { 55956 defaultView 55957 } = ownerDocument; 55958 const { 55959 frameElement 55960 } = defaultView; 55961 55962 if (!frameElement || ownerDocument === container.ownerDocument) { 55963 return rect; 55964 } 55965 55966 const iframeRect = frameElement.getBoundingClientRect(); 55967 return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height); 55968 } 55969 55970 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js 55971 var build_module_button = __webpack_require__("kA6J"); 55972 55973 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js 55974 var scroll_lock = __webpack_require__("k8OV"); 55975 55976 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js 55977 var use_slot = __webpack_require__("+WFq"); 55978 55979 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 8 modules 55980 var slot_fill = __webpack_require__("dSD1"); 55981 55982 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js 55983 var build_module_animate = __webpack_require__("L8Kx"); 55984 55985 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js 55986 55987 55988 55989 /** 55990 * External dependencies 55991 */ 55992 55993 /** 55994 * WordPress dependencies 55995 */ 55996 55997 55998 55999 56000 56001 56002 56003 /** 56004 * Internal dependencies 56005 */ 56006 56007 56008 56009 56010 56011 56012 /** 56013 * Name of slot in which popover should fill. 56014 * 56015 * @type {string} 56016 */ 56017 56018 const SLOT_NAME = 'Popover'; 56019 56020 function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef = false, shouldAnchorIncludePadding, container) { 56021 if (anchorRect) { 56022 return anchorRect; 56023 } 56024 56025 if (getAnchorRect) { 56026 if (!anchorRefFallback.current) { 56027 return; 56028 } 56029 56030 const rect = getAnchorRect(anchorRefFallback.current); 56031 return offsetIframe(rect, rect.ownerDocument || anchorRefFallback.current.ownerDocument, container); 56032 } 56033 56034 if (anchorRef !== false) { 56035 if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) { 56036 return; 56037 } // Duck-type to check if `anchorRef` is an instance of Range 56038 // `anchorRef instanceof window.Range` checks will break across document boundaries 56039 // such as in an iframe 56040 56041 56042 if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') { 56043 return offsetIframe(Object(external_wp_dom_["getRectangleFromRange"])(anchorRef), anchorRef.endContainer.ownerDocument, container); 56044 } // Duck-type to check if `anchorRef` is an instance of Element 56045 // `anchorRef instanceof window.Element` checks will break across document boundaries 56046 // such as in an iframe 56047 56048 56049 if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') { 56050 const rect = offsetIframe(anchorRef.getBoundingClientRect(), anchorRef.ownerDocument, container); 56051 56052 if (shouldAnchorIncludePadding) { 56053 return rect; 56054 } 56055 56056 return withoutPadding(rect, anchorRef); 56057 } 56058 56059 const { 56060 top, 56061 bottom 56062 } = anchorRef; 56063 const topRect = top.getBoundingClientRect(); 56064 const bottomRect = bottom.getBoundingClientRect(); 56065 const rect = offsetIframe(new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top), top.ownerDocument, container); 56066 56067 if (shouldAnchorIncludePadding) { 56068 return rect; 56069 } 56070 56071 return withoutPadding(rect, anchorRef); 56072 } 56073 56074 if (!anchorRefFallback.current) { 56075 return; 56076 } 56077 56078 const { 56079 parentNode 56080 } = anchorRefFallback.current; 56081 const rect = parentNode.getBoundingClientRect(); 56082 56083 if (shouldAnchorIncludePadding) { 56084 return rect; 56085 } 56086 56087 return withoutPadding(rect, parentNode); 56088 } 56089 56090 function getComputedStyle(node) { 56091 return node.ownerDocument.defaultView.getComputedStyle(node); 56092 } 56093 56094 function withoutPadding(rect, element) { 56095 const { 56096 paddingTop, 56097 paddingBottom, 56098 paddingLeft, 56099 paddingRight 56100 } = getComputedStyle(element); 56101 const top = paddingTop ? parseInt(paddingTop, 10) : 0; 56102 const bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0; 56103 const left = paddingLeft ? parseInt(paddingLeft, 10) : 0; 56104 const right = paddingRight ? parseInt(paddingRight, 10) : 0; 56105 return { 56106 x: rect.left + left, 56107 y: rect.top + top, 56108 width: rect.width - left - right, 56109 height: rect.height - top - bottom, 56110 left: rect.left + left, 56111 right: rect.right - right, 56112 top: rect.top + top, 56113 bottom: rect.bottom - bottom 56114 }; 56115 } 56116 /** 56117 * Sets or removes an element attribute. 56118 * 56119 * @param {Element} element The element to modify. 56120 * @param {string} name The attribute name to set or remove. 56121 * @param {?string} value The value to set. A falsy value will remove the 56122 * attribute. 56123 */ 56124 56125 56126 function setAttribute(element, name, value) { 56127 if (!value) { 56128 if (element.hasAttribute(name)) { 56129 element.removeAttribute(name); 56130 } 56131 } else if (element.getAttribute(name) !== value) { 56132 element.setAttribute(name, value); 56133 } 56134 } 56135 /** 56136 * Sets or removes an element style property. 56137 * 56138 * @param {Element} element The element to modify. 56139 * @param {string} property The property to set or remove. 56140 * @param {?string} value The value to set. A falsy value will remove the 56141 * property. 56142 */ 56143 56144 56145 function setStyle(element, property, value = '') { 56146 if (element.style[property] !== value) { 56147 element.style[property] = value; 56148 } 56149 } 56150 /** 56151 * Sets or removes an element class. 56152 * 56153 * @param {Element} element The element to modify. 56154 * @param {string} name The class to set or remove. 56155 * @param {boolean} toggle True to set the class, false to remove. 56156 */ 56157 56158 56159 function setClass(element, name, toggle) { 56160 if (toggle) { 56161 if (!element.classList.contains(name)) { 56162 element.classList.add(name); 56163 } 56164 } else if (element.classList.contains(name)) { 56165 element.classList.remove(name); 56166 } 56167 } 56168 56169 function getAnchorDocument(anchor) { 56170 if (!anchor) { 56171 return; 56172 } 56173 56174 if (anchor.endContainer) { 56175 return anchor.endContainer.ownerDocument; 56176 } 56177 56178 if (anchor.top) { 56179 return anchor.top.ownerDocument; 56180 } 56181 56182 return anchor.ownerDocument; 56183 } 56184 56185 const Popover = ({ 56186 headerTitle, 56187 onClose, 56188 children, 56189 className, 56190 noArrow = true, 56191 isAlternate, 56192 // Disable reason: We generate the `...contentProps` rest as remainder 56193 // of props which aren't explicitly handled by this component. 56194 56195 /* eslint-disable no-unused-vars */ 56196 position = 'bottom right', 56197 range, 56198 focusOnMount = 'firstElement', 56199 anchorRef, 56200 shouldAnchorIncludePadding, 56201 anchorRect, 56202 getAnchorRect, 56203 expandOnMobile, 56204 animate = true, 56205 onClickOutside, 56206 onFocusOutside, 56207 __unstableStickyBoundaryElement, 56208 __unstableSlotName = SLOT_NAME, 56209 __unstableObserveElement, 56210 __unstableBoundaryParent, 56211 __unstableForcePosition, 56212 __unstableForceXAlignment, 56213 56214 /* eslint-enable no-unused-vars */ 56215 ...contentProps 56216 }, ref) => { 56217 const anchorRefFallback = Object(external_wp_element_["useRef"])(null); 56218 const contentRef = Object(external_wp_element_["useRef"])(null); 56219 const containerRef = Object(external_wp_element_["useRef"])(); 56220 const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); 56221 const [animateOrigin, setAnimateOrigin] = Object(external_wp_element_["useState"])(); 56222 const slot = Object(use_slot["a" /* default */])(__unstableSlotName); 56223 const isExpanded = expandOnMobile && isMobileViewport; 56224 const [containerResizeListener, contentSize] = Object(external_wp_compose_["useResizeObserver"])(); 56225 noArrow = isExpanded || noArrow; 56226 Object(external_wp_element_["useLayoutEffect"])(() => { 56227 if (isExpanded) { 56228 setClass(containerRef.current, 'is-without-arrow', noArrow); 56229 setClass(containerRef.current, 'is-alternate', isAlternate); 56230 setAttribute(containerRef.current, 'data-x-axis'); 56231 setAttribute(containerRef.current, 'data-y-axis'); 56232 setStyle(containerRef.current, 'top'); 56233 setStyle(containerRef.current, 'left'); 56234 setStyle(contentRef.current, 'maxHeight'); 56235 setStyle(contentRef.current, 'maxWidth'); 56236 return; 56237 } 56238 56239 const refresh = () => { 56240 if (!containerRef.current || !contentRef.current) { 56241 return; 56242 } 56243 56244 let anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, containerRef.current); 56245 56246 if (!anchor) { 56247 return; 56248 } 56249 56250 const { 56251 offsetParent, 56252 ownerDocument 56253 } = containerRef.current; 56254 let relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body, 56255 // subtract the position from the anchor rect. If the position of 56256 // the popover is fixed, the offset parent is null or the body 56257 // element, in which case the position is relative to the viewport. 56258 // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent 56259 56260 if (offsetParent && offsetParent !== ownerDocument.body) { 56261 const offsetParentRect = offsetParent.getBoundingClientRect(); 56262 relativeOffsetTop = offsetParentRect.top; 56263 anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height); 56264 } 56265 56266 let boundaryElement; 56267 56268 if (__unstableBoundaryParent) { 56269 var _containerRef$current; 56270 56271 boundaryElement = (_containerRef$current = containerRef.current.closest('.popover-slot')) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.parentNode; 56272 } 56273 56274 const usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize; 56275 const { 56276 popoverTop, 56277 popoverLeft, 56278 xAxis, 56279 yAxis, 56280 contentHeight, 56281 contentWidth 56282 } = computePopoverPosition(anchor, usedContentSize, position, __unstableStickyBoundaryElement, containerRef.current, relativeOffsetTop, boundaryElement, __unstableForcePosition, __unstableForceXAlignment); 56283 56284 if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') { 56285 setStyle(containerRef.current, 'top', popoverTop + 'px'); 56286 setStyle(containerRef.current, 'left', popoverLeft + 'px'); 56287 } 56288 56289 setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle'); 56290 setClass(containerRef.current, 'is-alternate', isAlternate); 56291 setAttribute(containerRef.current, 'data-x-axis', xAxis); 56292 setAttribute(containerRef.current, 'data-y-axis', yAxis); 56293 setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : ''); 56294 setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position 56295 56296 const yAxisMapping = { 56297 top: 'bottom', 56298 bottom: 'top' 56299 }; 56300 const xAxisMapping = { 56301 left: 'right', 56302 right: 'left' 56303 }; 56304 const animateYAxis = yAxisMapping[yAxis] || 'middle'; 56305 const animateXAxis = xAxisMapping[xAxis] || 'center'; 56306 setAnimateOrigin(animateXAxis + ' ' + animateYAxis); 56307 }; 56308 56309 refresh(); 56310 const { 56311 ownerDocument 56312 } = containerRef.current; 56313 const { 56314 defaultView 56315 } = ownerDocument; 56316 /* 56317 * There are sometimes we need to reposition or resize the popover that 56318 * are not handled by the resize/scroll window events (i.e. CSS changes 56319 * in the layout that changes the position of the anchor). 56320 * 56321 * For these situations, we refresh the popover every 0.5s 56322 */ 56323 56324 const intervalHandle = defaultView.setInterval(refresh, 500); 56325 let rafId; 56326 56327 const refreshOnAnimationFrame = () => { 56328 defaultView.cancelAnimationFrame(rafId); 56329 rafId = defaultView.requestAnimationFrame(refresh); 56330 }; // Sometimes a click trigger a layout change that affects the popover 56331 // position. This is an opportunity to immediately refresh rather than 56332 // at the interval. 56333 56334 56335 defaultView.addEventListener('click', refreshOnAnimationFrame); 56336 defaultView.addEventListener('resize', refresh); 56337 defaultView.addEventListener('scroll', refresh, true); 56338 const anchorDocument = getAnchorDocument(anchorRef); // If the anchor is within an iframe, the popover position also needs 56339 // to refrest when the iframe content is scrolled or resized. 56340 56341 if (anchorDocument && anchorDocument !== ownerDocument) { 56342 anchorDocument.defaultView.addEventListener('resize', refresh); 56343 anchorDocument.defaultView.addEventListener('scroll', refresh, true); 56344 } 56345 56346 let observer; 56347 56348 if (__unstableObserveElement) { 56349 observer = new defaultView.MutationObserver(refresh); 56350 observer.observe(__unstableObserveElement, { 56351 attributes: true 56352 }); 56353 } 56354 56355 return () => { 56356 defaultView.clearInterval(intervalHandle); 56357 defaultView.removeEventListener('resize', refresh); 56358 defaultView.removeEventListener('scroll', refresh, true); 56359 defaultView.removeEventListener('click', refreshOnAnimationFrame); 56360 defaultView.cancelAnimationFrame(rafId); 56361 56362 if (anchorDocument && anchorDocument !== ownerDocument) { 56363 anchorDocument.defaultView.removeEventListener('resize', refresh); 56364 anchorDocument.defaultView.removeEventListener('scroll', refresh, true); 56365 } 56366 56367 if (observer) { 56368 observer.disconnect(); 56369 } 56370 }; 56371 }, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableStickyBoundaryElement, __unstableObserveElement, __unstableBoundaryParent]); // Event handlers for closing the popover. 56372 56373 const closeEventRef = Object(external_wp_compose_["useRefEffect"])(node => { 56374 function maybeClose(event) { 56375 // Close on escape. 56376 if (event.keyCode === external_wp_keycodes_["ESCAPE"] && onClose) { 56377 event.stopPropagation(); 56378 onClose(); 56379 } 56380 } 56381 56382 node.addEventListener('keydown', maybeClose); 56383 return () => { 56384 node.removeEventListener('keydown', maybeClose); 56385 }; 56386 }, [onClose]); 56387 const constrainedTabbingRef = Object(external_wp_compose_["useConstrainedTabbing"])(); 56388 const focusReturnRef = Object(external_wp_compose_["useFocusReturn"])(); 56389 const focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])(focusOnMount); 56390 const focusOutsideProps = Object(external_wp_compose_["__experimentalUseFocusOutside"])(handleOnFocusOutside); 56391 const mergedRefs = Object(external_wp_compose_["useMergeRefs"])([ref, containerRef, // Don't register the event at all if there's no onClose callback. 56392 onClose ? closeEventRef : null, focusOnMount ? constrainedTabbingRef : null, focusOnMount ? focusReturnRef : null, focusOnMount ? focusOnMountRef : null]); 56393 /** 56394 * Shims an onFocusOutside callback to be compatible with a deprecated 56395 * onClickOutside prop function, if provided. 56396 * 56397 * @param {FocusEvent} event Focus event from onFocusOutside. 56398 */ 56399 56400 function handleOnFocusOutside(event) { 56401 // Defer to given `onFocusOutside` if specified. Call `onClose` only if 56402 // both `onFocusOutside` and `onClickOutside` are unspecified. Doing so 56403 // assures backwards-compatibility for prior `onClickOutside` default. 56404 if (onFocusOutside) { 56405 onFocusOutside(event); 56406 return; 56407 } else if (!onClickOutside) { 56408 if (onClose) { 56409 onClose(); 56410 } 56411 56412 return; 56413 } // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click 56414 // target. MouseEvent constructor is unsupported in Internet Explorer. 56415 56416 56417 let clickEvent; 56418 56419 try { 56420 clickEvent = new window.MouseEvent('click'); 56421 } catch (error) { 56422 clickEvent = document.createEvent('MouseEvent'); 56423 clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 56424 } 56425 56426 Object.defineProperty(clickEvent, 'target', { 56427 get: () => event.relatedTarget 56428 }); 56429 external_wp_deprecated_default()('Popover onClickOutside prop', { 56430 since: '5.3', 56431 alternative: 'onFocusOutside' 56432 }); 56433 onClickOutside(clickEvent); 56434 } 56435 /** @type {false | string} */ 56436 56437 56438 const animateClassName = Boolean(animate && animateOrigin) && Object(build_module_animate["b" /* getAnimateClassName */])({ 56439 type: 'appear', 56440 origin: animateOrigin 56441 }); // Disable reason: We care to capture the _bubbled_ events from inputs 56442 // within popover as inferring close intent. 56443 56444 let content = // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions 56445 // eslint-disable-next-line jsx-a11y/no-static-element-interactions 56446 Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ 56447 className: classnames_default()('components-popover', className, animateClassName, { 56448 'is-expanded': isExpanded, 56449 'is-without-arrow': noArrow, 56450 'is-alternate': isAlternate 56451 }) 56452 }, contentProps, focusOutsideProps, { 56453 ref: mergedRefs, 56454 tabIndex: "-1" 56455 }), isExpanded && Object(external_wp_element_["createElement"])(scroll_lock["a" /* default */], null), isExpanded && Object(external_wp_element_["createElement"])("div", { 56456 className: "components-popover__header" 56457 }, Object(external_wp_element_["createElement"])("span", { 56458 className: "components-popover__header-title" 56459 }, headerTitle), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], { 56460 className: "components-popover__close", 56461 icon: library_close["a" /* default */], 56462 onClick: onClose 56463 })), Object(external_wp_element_["createElement"])("div", { 56464 ref: contentRef, 56465 className: "components-popover__content" 56466 }, Object(external_wp_element_["createElement"])("div", { 56467 style: { 56468 position: 'relative' 56469 } 56470 }, containerResizeListener, children))); 56471 56472 if (slot.ref) { 56473 content = Object(external_wp_element_["createElement"])(slot_fill["a" /* Fill */], { 56474 name: __unstableSlotName 56475 }, content); 56476 } 56477 56478 if (anchorRef || anchorRect) { 56479 return content; 56480 } 56481 56482 return Object(external_wp_element_["createElement"])("span", { 56483 ref: anchorRefFallback 56484 }, content); 56485 }; 56486 56487 const PopoverContainer = Object(external_wp_element_["forwardRef"])(Popover); 56488 56489 function PopoverSlot({ 56490 name = SLOT_NAME 56491 }, ref) { 56492 return Object(external_wp_element_["createElement"])(slot_fill["c" /* Slot */], { 56493 bubblesVirtually: true, 56494 name: name, 56495 className: "popover-slot", 56496 ref: ref 56497 }); 56498 } 56499 56500 PopoverContainer.Slot = Object(external_wp_element_["forwardRef"])(PopoverSlot); 56501 /* harmony default export */ var popover = __webpack_exports__["a"] = (PopoverContainer); 56502 56503 56504 /***/ }), 56505 56506 /***/ "ouKs": 56507 /***/ (function(module, __webpack_exports__, __webpack_require__) { 56508 56509 "use strict"; 56510 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; }); 56511 /** 56512 * Returns `element.ownerDocument || document`. 56513 */ 56514 function getDocument(element) { 56515 return element ? element.ownerDocument || element : document; 56516 } 56517 56518 56519 56520 56521 /***/ }), 56522 56523 /***/ "pRvc": 56524 /***/ (function(module, exports, __webpack_require__) { 56525 56526 "use strict"; 56527 56528 56529 Object.defineProperty(exports, "__esModule", { 56530 value: true 56531 }); 56532 exports['default'] = isSameDay; 56533 56534 var _moment = __webpack_require__("wy2R"); 56535 56536 var _moment2 = _interopRequireDefault(_moment); 56537 56538 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 56539 56540 function isSameDay(a, b) { 56541 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 56542 // Compare least significant, most likely to change units first 56543 // Moment's isSame clones moment inputs and is a tad slow 56544 return a.date() === b.date() && a.month() === b.month() && a.year() === b.year(); 56545 } 56546 56547 /***/ }), 56548 56549 /***/ "pVnL": 56550 /***/ (function(module, exports) { 56551 56552 function _extends() { 56553 module.exports = _extends = Object.assign || function (target) { 56554 for (var i = 1; i < arguments.length; i++) { 56555 var source = arguments[i]; 56556 56557 for (var key in source) { 56558 if (Object.prototype.hasOwnProperty.call(source, key)) { 56559 target[key] = source[key]; 56560 } 56561 } 56562 } 56563 56564 return target; 56565 }; 56566 56567 module.exports["default"] = module.exports, module.exports.__esModule = true; 56568 return _extends.apply(this, arguments); 56569 } 56570 56571 module.exports = _extends; 56572 module.exports["default"] = module.exports, module.exports.__esModule = true; 56573 56574 /***/ }), 56575 56576 /***/ "pYxT": 56577 /***/ (function(module, exports, __webpack_require__) { 56578 56579 "use strict"; 56580 56581 56582 Object.defineProperty(exports, "__esModule", { 56583 value: true 56584 }); 56585 exports['default'] = toISODateString; 56586 56587 var _moment = __webpack_require__("wy2R"); 56588 56589 var _moment2 = _interopRequireDefault(_moment); 56590 56591 var _toMomentObject = __webpack_require__("WmS1"); 56592 56593 var _toMomentObject2 = _interopRequireDefault(_toMomentObject); 56594 56595 var _constants = __webpack_require__("Fv1B"); 56596 56597 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 56598 56599 function toISODateString(date, currentFormat) { 56600 var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat); 56601 if (!dateObj) return null; 56602 56603 return dateObj.format(_constants.ISO_FORMAT); 56604 } 56605 56606 /***/ }), 56607 56608 /***/ "q86A": 56609 /***/ (function(module, exports, __webpack_require__) { 56610 56611 "use strict"; 56612 56613 56614 Object.defineProperty(exports, "__esModule", { 56615 value: true 56616 }); 56617 exports["default"] = getTransformStyles; 56618 function getTransformStyles(transformValue) { 56619 return { 56620 transform: transformValue, 56621 msTransform: transformValue, 56622 MozTransform: transformValue, 56623 WebkitTransform: transformValue 56624 }; 56625 } 56626 56627 /***/ }), 56628 56629 /***/ "qGip": 56630 /***/ (function(module, exports, __webpack_require__) { 56631 56632 "use strict"; 56633 56634 56635 /* eslint complexity: [2, 18], max-statements: [2, 33] */ 56636 module.exports = function hasSymbols() { 56637 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 56638 if (typeof Symbol.iterator === 'symbol') { return true; } 56639 56640 var obj = {}; 56641 var sym = Symbol('test'); 56642 var symObj = Object(sym); 56643 if (typeof sym === 'string') { return false; } 56644 56645 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 56646 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 56647 56648 // temp disabled per https://github.com/ljharb/object.assign/issues/17 56649 // if (sym instanceof Symbol) { return false; } 56650 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 56651 // if (!(symObj instanceof Symbol)) { return false; } 56652 56653 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 56654 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 56655 56656 var symVal = 42; 56657 obj[sym] = symVal; 56658 for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 56659 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 56660 56661 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 56662 56663 var syms = Object.getOwnPropertySymbols(obj); 56664 if (syms.length !== 1 || syms[0] !== sym) { return false; } 56665 56666 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 56667 56668 if (typeof Object.getOwnPropertyDescriptor === 'function') { 56669 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 56670 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 56671 } 56672 56673 return true; 56674 }; 56675 56676 56677 /***/ }), 56678 56679 /***/ "qOxZ": 56680 /***/ (function(module, __webpack_exports__, __webpack_require__) { 56681 56682 "use strict"; 56683 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return fireEvent; }); 56684 /* harmony import */ var _createEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("khzz"); 56685 56686 56687 56688 /** 56689 * Creates and dispatches `Event` in a way that also works on IE 11. 56690 * 56691 * @example 56692 * import { fireEvent } from "reakit-utils"; 56693 * 56694 * fireEvent(document.getElementById("id"), "blur", { 56695 * bubbles: true, 56696 * cancelable: true, 56697 * }); 56698 */ 56699 56700 function fireEvent(element, type, eventInit) { 56701 return element.dispatchEvent(Object(_createEvent_js__WEBPACK_IMPORTED_MODULE_0__[/* createEvent */ "a"])(element, type, eventInit)); 56702 } 56703 56704 56705 56706 56707 /***/ }), 56708 56709 /***/ "qRz9": 56710 /***/ (function(module, exports) { 56711 56712 (function() { module.exports = window["wp"]["richText"]; }()); 56713 56714 /***/ }), 56715 56716 /***/ "qT12": 56717 /***/ (function(module, exports, __webpack_require__) { 56718 56719 "use strict"; 56720 /** @license React v16.13.1 56721 * react-is.production.min.js 56722 * 56723 * Copyright (c) Facebook, Inc. and its affiliates. 56724 * 56725 * This source code is licensed under the MIT license found in the 56726 * LICENSE file in the root directory of this source tree. 56727 */ 56728 56729 var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? 56730 Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; 56731 function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; 56732 exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; 56733 exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; 56734 exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; 56735 56736 56737 /***/ }), 56738 56739 /***/ "qdes": 56740 /***/ (function(module, __webpack_exports__, __webpack_require__) { 56741 56742 "use strict"; 56743 56744 // EXPORTS 56745 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createHook; }); 56746 56747 // EXTERNAL MODULE: external "React" 56748 var external_React_ = __webpack_require__("cDcd"); 56749 56750 // EXTERNAL MODULE: ./node_modules/reakit-system/es/SystemContext.js 56751 var SystemContext = __webpack_require__("eUCI"); 56752 56753 // CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js 56754 56755 56756 56757 /** 56758 * React custom hook that returns the value of any token defined in the 56759 * SystemContext. It's mainly used internally in [`useOptions`](#useoptions) 56760 * and [`useProps`](#useprops). 56761 * 56762 * @example 56763 * import { SystemProvider, useToken } from "reakit-system"; 56764 * 56765 * const system = { 56766 * token: "value", 56767 * }; 56768 * 56769 * function Component(props) { 56770 * const token = useToken("token", "default value"); 56771 * return <div {...props}>{token}</div>; 56772 * } 56773 * 56774 * function App() { 56775 * return ( 56776 * <SystemProvider unstable_system={system}> 56777 * <Component /> 56778 * </SystemProvider> 56779 * ); 56780 * } 56781 */ 56782 56783 function useToken(token, defaultValue) { 56784 Object(external_React_["useDebugValue"])(token); 56785 var context = Object(external_React_["useContext"])(SystemContext["a" /* SystemContext */]); 56786 return context[token] != null ? context[token] : defaultValue; 56787 } 56788 56789 56790 56791 // CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js 56792 56793 56794 56795 56796 /** 56797 * React custom hook that returns the props returned by a given 56798 * `use${name}Props` in the SystemContext. 56799 * 56800 * @example 56801 * import { SystemProvider, useProps } from "reakit-system"; 56802 * 56803 * const system = { 56804 * useAProps(options, htmlProps) { 56805 * return { 56806 * ...htmlProps, 56807 * href: options.url, 56808 * }; 56809 * }, 56810 * }; 56811 * 56812 * function A({ url, ...htmlProps }) { 56813 * const props = useProps("A", { url }, htmlProps); 56814 * return <a {...props} />; 56815 * } 56816 * 56817 * function App() { 56818 * return ( 56819 * <SystemProvider unstable_system={system}> 56820 * <A url="url">It will convert url into href in useAProps</A> 56821 * </SystemProvider> 56822 * ); 56823 * } 56824 */ 56825 56826 function useProps(name, options, htmlProps) { 56827 if (options === void 0) { 56828 options = {}; 56829 } 56830 56831 if (htmlProps === void 0) { 56832 htmlProps = {}; 56833 } 56834 56835 var hookName = "use" + name + "Props"; 56836 Object(external_React_["useDebugValue"])(hookName); 56837 var useHook = useToken(hookName); 56838 56839 if (useHook) { 56840 return useHook(options, htmlProps); 56841 } 56842 56843 return htmlProps; 56844 } 56845 56846 56847 56848 // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js 56849 var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__("RDTF"); 56850 56851 // CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js 56852 56853 56854 56855 56856 56857 /** 56858 * React custom hook that returns the options returned by a given 56859 * `use${name}Options` in the SystemContext. 56860 * 56861 * @example 56862 * import React from "react"; 56863 * import { SystemProvider, useOptions } from "reakit-system"; 56864 * 56865 * const system = { 56866 * useAOptions(options, htmlProps) { 56867 * return { 56868 * ...options, 56869 * url: htmlProps.href, 56870 * }; 56871 * }, 56872 * }; 56873 * 56874 * function A({ url, ...htmlProps }) { 56875 * const options = useOptions("A", { url }, htmlProps); 56876 * return <a href={options.url} {...htmlProps} />; 56877 * } 56878 * 56879 * function App() { 56880 * return ( 56881 * <SystemProvider unstable_system={system}> 56882 * <A href="url"> 56883 * It will convert href into url in useAOptions and then url into href in A 56884 * </A> 56885 * </SystemProvider> 56886 * ); 56887 * } 56888 */ 56889 56890 function useOptions(name, options, htmlProps) { 56891 if (options === void 0) { 56892 options = {}; 56893 } 56894 56895 if (htmlProps === void 0) { 56896 htmlProps = {}; 56897 } 56898 56899 var hookName = "use" + name + "Options"; 56900 Object(external_React_["useDebugValue"])(hookName); 56901 var useHook = useToken(hookName); 56902 56903 if (useHook) { 56904 return Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, options), useHook(options, htmlProps)); 56905 } 56906 56907 return options; 56908 } 56909 56910 56911 56912 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js 56913 var shallowEqual = __webpack_require__("uqqE"); 56914 56915 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js 56916 /** 56917 * Transforms `arg` into an array if it's not already. 56918 * 56919 * @example 56920 * import { toArray } from "reakit-utils"; 56921 * 56922 * toArray("a"); // ["a"] 56923 * toArray(["a"]); // ["a"] 56924 */ 56925 function toArray(arg) { 56926 if (Array.isArray(arg)) { 56927 return arg; 56928 } 56929 56930 return typeof arg !== "undefined" ? [arg] : []; 56931 } 56932 56933 56934 56935 // CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js 56936 56937 56938 56939 56940 56941 56942 56943 56944 56945 /** 56946 * Creates a React custom hook that will return component props. 56947 * 56948 * @example 56949 * import { createHook } from "reakit-system"; 56950 * 56951 * const useA = createHook({ 56952 * name: "A", 56953 * keys: ["url"], // custom props/options keys 56954 * useProps(options, htmlProps) { 56955 * return { 56956 * ...htmlProps, 56957 * href: options.url, 56958 * }; 56959 * }, 56960 * }); 56961 * 56962 * function A({ url, ...htmlProps }) { 56963 * const props = useA({ url }, htmlProps); 56964 * return <a {...props} />; 56965 * } 56966 * 56967 * @param options 56968 */ 56969 function createHook(options) { 56970 var _options$useState, _composedHooks$; 56971 56972 var composedHooks = toArray(options.compose); 56973 56974 var __useOptions = function __useOptions(hookOptions, htmlProps) { 56975 // Call the current hook's useOptions first 56976 if (options.useOptions) { 56977 hookOptions = options.useOptions(hookOptions, htmlProps); 56978 } // If there's name, call useOptions from the system context 56979 56980 56981 if (options.name) { 56982 hookOptions = useOptions(options.name, hookOptions, htmlProps); 56983 } // Run composed hooks useOptions 56984 56985 56986 if (options.compose) { 56987 for (var _iterator = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step; !(_step = _iterator()).done;) { 56988 var hook = _step.value; 56989 hookOptions = hook.__useOptions(hookOptions, htmlProps); 56990 } 56991 } 56992 56993 return hookOptions; 56994 }; 56995 56996 var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) { 56997 if (hookOptions === void 0) { 56998 hookOptions = {}; 56999 } 57000 57001 if (htmlProps === void 0) { 57002 htmlProps = {}; 57003 } 57004 57005 if (unstable_ignoreUseOptions === void 0) { 57006 unstable_ignoreUseOptions = false; 57007 } 57008 57009 // This won't execute when useHook was called from within another useHook 57010 if (!unstable_ignoreUseOptions) { 57011 hookOptions = __useOptions(hookOptions, htmlProps); 57012 } // Call the current hook's useProps 57013 57014 57015 if (options.useProps) { 57016 htmlProps = options.useProps(hookOptions, htmlProps); 57017 } // If there's name, call useProps from the system context 57018 57019 57020 if (options.name) { 57021 htmlProps = useProps(options.name, hookOptions, htmlProps); 57022 } 57023 57024 if (options.compose) { 57025 if (options.useComposeOptions) { 57026 hookOptions = options.useComposeOptions(hookOptions, htmlProps); 57027 } 57028 57029 if (options.useComposeProps) { 57030 htmlProps = options.useComposeProps(hookOptions, htmlProps); 57031 } else { 57032 for (var _iterator2 = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step2; !(_step2 = _iterator2()).done;) { 57033 var hook = _step2.value; 57034 htmlProps = hook(hookOptions, htmlProps, true); 57035 } 57036 } 57037 } // Remove undefined values from htmlProps 57038 57039 57040 var finalHTMLProps = {}; 57041 var definedHTMLProps = htmlProps || {}; 57042 57043 for (var prop in definedHTMLProps) { 57044 if (definedHTMLProps[prop] !== undefined) { 57045 finalHTMLProps[prop] = definedHTMLProps[prop]; 57046 } 57047 } 57048 57049 return finalHTMLProps; 57050 }; 57051 57052 useHook.__useOptions = __useOptions; 57053 var composedKeys = composedHooks.reduce(function (keys, hook) { 57054 keys.push.apply(keys, hook.__keys || []); 57055 return keys; 57056 }, []); // It's used by createComponent to split option props (keys) and html props 57057 57058 useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []); 57059 useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual["a" /* shallowEqual */]; 57060 57061 if (false) {} 57062 57063 return useHook; 57064 } 57065 57066 57067 57068 57069 /***/ }), 57070 57071 /***/ "rDFq": 57072 /***/ (function(module, exports, __webpack_require__) { 57073 57074 "use strict"; 57075 57076 57077 var GetIntrinsic = __webpack_require__("rZ7t"); 57078 57079 var $Object = GetIntrinsic('%Object%'); 57080 57081 var isPrimitive = __webpack_require__("BeK9"); 57082 57083 var $preventExtensions = $Object.preventExtensions; 57084 var $isExtensible = $Object.isExtensible; 57085 57086 // https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o 57087 57088 module.exports = $preventExtensions 57089 ? function IsExtensible(obj) { 57090 return !isPrimitive(obj) && $isExtensible(obj); 57091 } 57092 : function IsExtensible(obj) { 57093 return !isPrimitive(obj); 57094 }; 57095 57096 57097 /***/ }), 57098 57099 /***/ "rQy3": 57100 /***/ (function(module, exports, __webpack_require__) { 57101 57102 "use strict"; 57103 57104 57105 var has = __webpack_require__("oNNP"); 57106 var RequireObjectCoercible = __webpack_require__("25kQ"); 57107 var callBound = __webpack_require__("VF6F"); 57108 57109 var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 57110 57111 module.exports = function values(O) { 57112 var obj = RequireObjectCoercible(O); 57113 var vals = []; 57114 for (var key in obj) { 57115 if (has(obj, key) && $isEnumerable(obj, key)) { 57116 vals.push(obj[key]); 57117 } 57118 } 57119 return vals; 57120 }; 57121 57122 57123 /***/ }), 57124 57125 /***/ "rZ7t": 57126 /***/ (function(module, exports, __webpack_require__) { 57127 57128 "use strict"; 57129 57130 57131 var undefined; 57132 57133 var $SyntaxError = SyntaxError; 57134 var $Function = Function; 57135 var $TypeError = TypeError; 57136 57137 // eslint-disable-next-line consistent-return 57138 var getEvalledConstructor = function (expressionSyntax) { 57139 try { 57140 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 57141 } catch (e) {} 57142 }; 57143 57144 var $gOPD = Object.getOwnPropertyDescriptor; 57145 if ($gOPD) { 57146 try { 57147 $gOPD({}, ''); 57148 } catch (e) { 57149 $gOPD = null; // this is IE 8, which has a broken gOPD 57150 } 57151 } 57152 57153 var throwTypeError = function () { 57154 throw new $TypeError(); 57155 }; 57156 var ThrowTypeError = $gOPD 57157 ? (function () { 57158 try { 57159 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 57160 arguments.callee; // IE 8 does not throw here 57161 return throwTypeError; 57162 } catch (calleeThrows) { 57163 try { 57164 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 57165 return $gOPD(arguments, 'callee').get; 57166 } catch (gOPDthrows) { 57167 return throwTypeError; 57168 } 57169 } 57170 }()) 57171 : throwTypeError; 57172 57173 var hasSymbols = __webpack_require__("HyUg")(); 57174 57175 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 57176 57177 var needsEval = {}; 57178 57179 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 57180 57181 var INTRINSICS = { 57182 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 57183 '%Array%': Array, 57184 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 57185 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 57186 '%AsyncFromSyncIteratorPrototype%': undefined, 57187 '%AsyncFunction%': needsEval, 57188 '%AsyncGenerator%': needsEval, 57189 '%AsyncGeneratorFunction%': needsEval, 57190 '%AsyncIteratorPrototype%': needsEval, 57191 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 57192 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 57193 '%Boolean%': Boolean, 57194 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 57195 '%Date%': Date, 57196 '%decodeURI%': decodeURI, 57197 '%decodeURIComponent%': decodeURIComponent, 57198 '%encodeURI%': encodeURI, 57199 '%encodeURIComponent%': encodeURIComponent, 57200 '%Error%': Error, 57201 '%eval%': eval, // eslint-disable-line no-eval 57202 '%EvalError%': EvalError, 57203 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 57204 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 57205 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 57206 '%Function%': $Function, 57207 '%GeneratorFunction%': needsEval, 57208 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 57209 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 57210 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 57211 '%isFinite%': isFinite, 57212 '%isNaN%': isNaN, 57213 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 57214 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 57215 '%Map%': typeof Map === 'undefined' ? undefined : Map, 57216 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 57217 '%Math%': Math, 57218 '%Number%': Number, 57219 '%Object%': Object, 57220 '%parseFloat%': parseFloat, 57221 '%parseInt%': parseInt, 57222 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 57223 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 57224 '%RangeError%': RangeError, 57225 '%ReferenceError%': ReferenceError, 57226 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 57227 '%RegExp%': RegExp, 57228 '%Set%': typeof Set === 'undefined' ? undefined : Set, 57229 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 57230 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 57231 '%String%': String, 57232 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 57233 '%Symbol%': hasSymbols ? Symbol : undefined, 57234 '%SyntaxError%': $SyntaxError, 57235 '%ThrowTypeError%': ThrowTypeError, 57236 '%TypedArray%': TypedArray, 57237 '%TypeError%': $TypeError, 57238 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 57239 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 57240 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 57241 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 57242 '%URIError%': URIError, 57243 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 57244 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 57245 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 57246 }; 57247 57248 var doEval = function doEval(name) { 57249 var value; 57250 if (name === '%AsyncFunction%') { 57251 value = getEvalledConstructor('async function () {}'); 57252 } else if (name === '%GeneratorFunction%') { 57253 value = getEvalledConstructor('function* () {}'); 57254 } else if (name === '%AsyncGeneratorFunction%') { 57255 value = getEvalledConstructor('async function* () {}'); 57256 } else if (name === '%AsyncGenerator%') { 57257 var fn = doEval('%AsyncGeneratorFunction%'); 57258 if (fn) { 57259 value = fn.prototype; 57260 } 57261 } else if (name === '%AsyncIteratorPrototype%') { 57262 var gen = doEval('%AsyncGenerator%'); 57263 if (gen) { 57264 value = getProto(gen.prototype); 57265 } 57266 } 57267 57268 INTRINSICS[name] = value; 57269 57270 return value; 57271 }; 57272 57273 var LEGACY_ALIASES = { 57274 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 57275 '%ArrayPrototype%': ['Array', 'prototype'], 57276 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 57277 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 57278 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 57279 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 57280 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 57281 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 57282 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 57283 '%BooleanPrototype%': ['Boolean', 'prototype'], 57284 '%DataViewPrototype%': ['DataView', 'prototype'], 57285 '%DatePrototype%': ['Date', 'prototype'], 57286 '%ErrorPrototype%': ['Error', 'prototype'], 57287 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 57288 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 57289 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 57290 '%FunctionPrototype%': ['Function', 'prototype'], 57291 '%Generator%': ['GeneratorFunction', 'prototype'], 57292 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 57293 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 57294 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 57295 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 57296 '%JSONParse%': ['JSON', 'parse'], 57297 '%JSONStringify%': ['JSON', 'stringify'], 57298 '%MapPrototype%': ['Map', 'prototype'], 57299 '%NumberPrototype%': ['Number', 'prototype'], 57300 '%ObjectPrototype%': ['Object', 'prototype'], 57301 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 57302 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 57303 '%PromisePrototype%': ['Promise', 'prototype'], 57304 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 57305 '%Promise_all%': ['Promise', 'all'], 57306 '%Promise_reject%': ['Promise', 'reject'], 57307 '%Promise_resolve%': ['Promise', 'resolve'], 57308 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 57309 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 57310 '%RegExpPrototype%': ['RegExp', 'prototype'], 57311 '%SetPrototype%': ['Set', 'prototype'], 57312 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 57313 '%StringPrototype%': ['String', 'prototype'], 57314 '%SymbolPrototype%': ['Symbol', 'prototype'], 57315 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 57316 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 57317 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 57318 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 57319 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 57320 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 57321 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 57322 '%URIErrorPrototype%': ['URIError', 'prototype'], 57323 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 57324 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 57325 }; 57326 57327 var bind = __webpack_require__("D3zA"); 57328 var hasOwn = __webpack_require__("oNNP"); 57329 var $concat = bind.call(Function.call, Array.prototype.concat); 57330 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 57331 var $replace = bind.call(Function.call, String.prototype.replace); 57332 var $strSlice = bind.call(Function.call, String.prototype.slice); 57333 57334 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 57335 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 57336 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 57337 var stringToPath = function stringToPath(string) { 57338 var first = $strSlice(string, 0, 1); 57339 var last = $strSlice(string, -1); 57340 if (first === '%' && last !== '%') { 57341 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 57342 } else if (last === '%' && first !== '%') { 57343 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 57344 } 57345 var result = []; 57346 $replace(string, rePropName, function (match, number, quote, subString) { 57347 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 57348 }); 57349 return result; 57350 }; 57351 /* end adaptation */ 57352 57353 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 57354 var intrinsicName = name; 57355 var alias; 57356 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 57357 alias = LEGACY_ALIASES[intrinsicName]; 57358 intrinsicName = '%' + alias[0] + '%'; 57359 } 57360 57361 if (hasOwn(INTRINSICS, intrinsicName)) { 57362 var value = INTRINSICS[intrinsicName]; 57363 if (value === needsEval) { 57364 value = doEval(intrinsicName); 57365 } 57366 if (typeof value === 'undefined' && !allowMissing) { 57367 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 57368 } 57369 57370 return { 57371 alias: alias, 57372 name: intrinsicName, 57373 value: value 57374 }; 57375 } 57376 57377 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 57378 }; 57379 57380 module.exports = function GetIntrinsic(name, allowMissing) { 57381 if (typeof name !== 'string' || name.length === 0) { 57382 throw new $TypeError('intrinsic name must be a non-empty string'); 57383 } 57384 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 57385 throw new $TypeError('"allowMissing" argument must be a boolean'); 57386 } 57387 57388 var parts = stringToPath(name); 57389 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 57390 57391 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 57392 var intrinsicRealName = intrinsic.name; 57393 var value = intrinsic.value; 57394 var skipFurtherCaching = false; 57395 57396 var alias = intrinsic.alias; 57397 if (alias) { 57398 intrinsicBaseName = alias[0]; 57399 $spliceApply(parts, $concat([0, 1], alias)); 57400 } 57401 57402 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 57403 var part = parts[i]; 57404 var first = $strSlice(part, 0, 1); 57405 var last = $strSlice(part, -1); 57406 if ( 57407 ( 57408 (first === '"' || first === "'" || first === '`') 57409 || (last === '"' || last === "'" || last === '`') 57410 ) 57411 && first !== last 57412 ) { 57413 throw new $SyntaxError('property names with quotes must have matching quotes'); 57414 } 57415 if (part === 'constructor' || !isOwn) { 57416 skipFurtherCaching = true; 57417 } 57418 57419 intrinsicBaseName += '.' + part; 57420 intrinsicRealName = '%' + intrinsicBaseName + '%'; 57421 57422 if (hasOwn(INTRINSICS, intrinsicRealName)) { 57423 value = INTRINSICS[intrinsicRealName]; 57424 } else if (value != null) { 57425 if (!(part in value)) { 57426 if (!allowMissing) { 57427 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 57428 } 57429 return void undefined; 57430 } 57431 if ($gOPD && (i + 1) >= parts.length) { 57432 var desc = $gOPD(value, part); 57433 isOwn = !!desc; 57434 57435 // By convention, when a data property is converted to an accessor 57436 // property to emulate a data property that does not suffer from 57437 // the override mistake, that accessor's getter is marked with 57438 // an `originalValue` property. Here, when we detect this, we 57439 // uphold the illusion by pretending to see that original data 57440 // property, i.e., returning the value rather than the getter 57441 // itself. 57442 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 57443 value = desc.get; 57444 } else { 57445 value = value[part]; 57446 } 57447 } else { 57448 isOwn = hasOwn(value, part); 57449 value = value[part]; 57450 } 57451 57452 if (isOwn && !skipFurtherCaching) { 57453 INTRINSICS[intrinsicRealName] = value; 57454 } 57455 } 57456 } 57457 return value; 57458 }; 57459 57460 57461 /***/ }), 57462 57463 /***/ "reMF": 57464 /***/ (function(module, __webpack_exports__, __webpack_require__) { 57465 57466 "use strict"; 57467 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isUA; }); 57468 /* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("+ipW"); 57469 57470 57471 57472 57473 /** 57474 * Checks if a given string exists in the user agent string. 57475 */ 57476 57477 function isUA(string) { 57478 if (!_canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__[/* canUseDOM */ "a"]) return false; 57479 return window.navigator.userAgent.indexOf(string) !== -1; 57480 } 57481 57482 57483 57484 57485 /***/ }), 57486 57487 /***/ "rl8x": 57488 /***/ (function(module, exports) { 57489 57490 (function() { module.exports = window["wp"]["isShallowEqual"]; }()); 57491 57492 /***/ }), 57493 57494 /***/ "sA9S": 57495 /***/ (function(module, exports, __webpack_require__) { 57496 57497 "use strict"; 57498 57499 57500 var GetIntrinsic = __webpack_require__("rZ7t"); 57501 57502 var $Object = GetIntrinsic('%Object%'); 57503 57504 var RequireObjectCoercible = __webpack_require__("S0jC"); 57505 57506 // https://ecma-international.org/ecma-262/6.0/#sec-toobject 57507 57508 module.exports = function ToObject(value) { 57509 RequireObjectCoercible(value); 57510 return $Object(value); 57511 }; 57512 57513 57514 /***/ }), 57515 57516 /***/ "sDMB": 57517 /***/ (function(module, exports, __webpack_require__) { 57518 57519 "use strict"; 57520 57521 57522 Object.defineProperty(exports, "__esModule", { 57523 value: true 57524 }); 57525 57526 var _propTypes = __webpack_require__("17x9"); 57527 57528 var _propTypes2 = _interopRequireDefault(_propTypes); 57529 57530 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 57531 57532 exports['default'] = _propTypes2['default'].shape({ 57533 getState: _propTypes2['default'].func, 57534 setState: _propTypes2['default'].func, 57535 subscribe: _propTypes2['default'].func 57536 }); 57537 57538 /***/ }), 57539 57540 /***/ "sEfC": 57541 /***/ (function(module, exports, __webpack_require__) { 57542 57543 var isObject = __webpack_require__("GoyQ"), 57544 now = __webpack_require__("QIyF"), 57545 toNumber = __webpack_require__("tLB3"); 57546 57547 /** Error message constants. */ 57548 var FUNC_ERROR_TEXT = 'Expected a function'; 57549 57550 /* Built-in method references for those with the same name as other `lodash` methods. */ 57551 var nativeMax = Math.max, 57552 nativeMin = Math.min; 57553 57554 /** 57555 * Creates a debounced function that delays invoking `func` until after `wait` 57556 * milliseconds have elapsed since the last time the debounced function was 57557 * invoked. The debounced function comes with a `cancel` method to cancel 57558 * delayed `func` invocations and a `flush` method to immediately invoke them. 57559 * Provide `options` to indicate whether `func` should be invoked on the 57560 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 57561 * with the last arguments provided to the debounced function. Subsequent 57562 * calls to the debounced function return the result of the last `func` 57563 * invocation. 57564 * 57565 * **Note:** If `leading` and `trailing` options are `true`, `func` is 57566 * invoked on the trailing edge of the timeout only if the debounced function 57567 * is invoked more than once during the `wait` timeout. 57568 * 57569 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 57570 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 57571 * 57572 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 57573 * for details over the differences between `_.debounce` and `_.throttle`. 57574 * 57575 * @static 57576 * @memberOf _ 57577 * @since 0.1.0 57578 * @category Function 57579 * @param {Function} func The function to debounce. 57580 * @param {number} [wait=0] The number of milliseconds to delay. 57581 * @param {Object} [options={}] The options object. 57582 * @param {boolean} [options.leading=false] 57583 * Specify invoking on the leading edge of the timeout. 57584 * @param {number} [options.maxWait] 57585 * The maximum time `func` is allowed to be delayed before it's invoked. 57586 * @param {boolean} [options.trailing=true] 57587 * Specify invoking on the trailing edge of the timeout. 57588 * @returns {Function} Returns the new debounced function. 57589 * @example 57590 * 57591 * // Avoid costly calculations while the window size is in flux. 57592 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 57593 * 57594 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 57595 * jQuery(element).on('click', _.debounce(sendMail, 300, { 57596 * 'leading': true, 57597 * 'trailing': false 57598 * })); 57599 * 57600 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 57601 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 57602 * var source = new EventSource('/stream'); 57603 * jQuery(source).on('message', debounced); 57604 * 57605 * // Cancel the trailing debounced invocation. 57606 * jQuery(window).on('popstate', debounced.cancel); 57607 */ 57608 function debounce(func, wait, options) { 57609 var lastArgs, 57610 lastThis, 57611 maxWait, 57612 result, 57613 timerId, 57614 lastCallTime, 57615 lastInvokeTime = 0, 57616 leading = false, 57617 maxing = false, 57618 trailing = true; 57619 57620 if (typeof func != 'function') { 57621 throw new TypeError(FUNC_ERROR_TEXT); 57622 } 57623 wait = toNumber(wait) || 0; 57624 if (isObject(options)) { 57625 leading = !!options.leading; 57626 maxing = 'maxWait' in options; 57627 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 57628 trailing = 'trailing' in options ? !!options.trailing : trailing; 57629 } 57630 57631 function invokeFunc(time) { 57632 var args = lastArgs, 57633 thisArg = lastThis; 57634 57635 lastArgs = lastThis = undefined; 57636 lastInvokeTime = time; 57637 result = func.apply(thisArg, args); 57638 return result; 57639 } 57640 57641 function leadingEdge(time) { 57642 // Reset any `maxWait` timer. 57643 lastInvokeTime = time; 57644 // Start the timer for the trailing edge. 57645 timerId = setTimeout(timerExpired, wait); 57646 // Invoke the leading edge. 57647 return leading ? invokeFunc(time) : result; 57648 } 57649 57650 function remainingWait(time) { 57651 var timeSinceLastCall = time - lastCallTime, 57652 timeSinceLastInvoke = time - lastInvokeTime, 57653 timeWaiting = wait - timeSinceLastCall; 57654 57655 return maxing 57656 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 57657 : timeWaiting; 57658 } 57659 57660 function shouldInvoke(time) { 57661 var timeSinceLastCall = time - lastCallTime, 57662 timeSinceLastInvoke = time - lastInvokeTime; 57663 57664 // Either this is the first call, activity has stopped and we're at the 57665 // trailing edge, the system time has gone backwards and we're treating 57666 // it as the trailing edge, or we've hit the `maxWait` limit. 57667 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 57668 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 57669 } 57670 57671 function timerExpired() { 57672 var time = now(); 57673 if (shouldInvoke(time)) { 57674 return trailingEdge(time); 57675 } 57676 // Restart the timer. 57677 timerId = setTimeout(timerExpired, remainingWait(time)); 57678 } 57679 57680 function trailingEdge(time) { 57681 timerId = undefined; 57682 57683 // Only invoke if we have `lastArgs` which means `func` has been 57684 // debounced at least once. 57685 if (trailing && lastArgs) { 57686 return invokeFunc(time); 57687 } 57688 lastArgs = lastThis = undefined; 57689 return result; 57690 } 57691 57692 function cancel() { 57693 if (timerId !== undefined) { 57694 clearTimeout(timerId); 57695 } 57696 lastInvokeTime = 0; 57697 lastArgs = lastCallTime = lastThis = timerId = undefined; 57698 } 57699 57700 function flush() { 57701 return timerId === undefined ? result : trailingEdge(now()); 57702 } 57703 57704 function debounced() { 57705 var time = now(), 57706 isInvoking = shouldInvoke(time); 57707 57708 lastArgs = arguments; 57709 lastThis = this; 57710 lastCallTime = time; 57711 57712 if (isInvoking) { 57713 if (timerId === undefined) { 57714 return leadingEdge(lastCallTime); 57715 } 57716 if (maxing) { 57717 // Handle invocations in a tight loop. 57718 clearTimeout(timerId); 57719 timerId = setTimeout(timerExpired, wait); 57720 return invokeFunc(lastCallTime); 57721 } 57722 } 57723 if (timerId === undefined) { 57724 timerId = setTimeout(timerExpired, wait); 57725 } 57726 return result; 57727 } 57728 debounced.cancel = cancel; 57729 debounced.flush = flush; 57730 return debounced; 57731 } 57732 57733 module.exports = debounce; 57734 57735 57736 /***/ }), 57737 57738 /***/ "sYn3": 57739 /***/ (function(module, exports, __webpack_require__) { 57740 57741 "use strict"; 57742 57743 57744 var keysShim; 57745 if (!Object.keys) { 57746 // modified from https://github.com/es-shims/es5-shim 57747 var has = Object.prototype.hasOwnProperty; 57748 var toStr = Object.prototype.toString; 57749 var isArgs = __webpack_require__("1KsK"); // eslint-disable-line global-require 57750 var isEnumerable = Object.prototype.propertyIsEnumerable; 57751 var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); 57752 var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); 57753 var dontEnums = [ 57754 'toString', 57755 'toLocaleString', 57756 'valueOf', 57757 'hasOwnProperty', 57758 'isPrototypeOf', 57759 'propertyIsEnumerable', 57760 'constructor' 57761 ]; 57762 var equalsConstructorPrototype = function (o) { 57763 var ctor = o.constructor; 57764 return ctor && ctor.prototype === o; 57765 }; 57766 var excludedKeys = { 57767 $applicationCache: true, 57768 $console: true, 57769 $external: true, 57770 $frame: true, 57771 $frameElement: true, 57772 $frames: true, 57773 $innerHeight: true, 57774 $innerWidth: true, 57775 $onmozfullscreenchange: true, 57776 $onmozfullscreenerror: true, 57777 $outerHeight: true, 57778 $outerWidth: true, 57779 $pageXOffset: true, 57780 $pageYOffset: true, 57781 $parent: true, 57782 $scrollLeft: true, 57783 $scrollTop: true, 57784 $scrollX: true, 57785 $scrollY: true, 57786 $self: true, 57787 $webkitIndexedDB: true, 57788 $webkitStorageInfo: true, 57789 $window: true 57790 }; 57791 var hasAutomationEqualityBug = (function () { 57792 /* global window */ 57793 if (typeof window === 'undefined') { return false; } 57794 for (var k in window) { 57795 try { 57796 if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { 57797 try { 57798 equalsConstructorPrototype(window[k]); 57799 } catch (e) { 57800 return true; 57801 } 57802 } 57803 } catch (e) { 57804 return true; 57805 } 57806 } 57807 return false; 57808 }()); 57809 var equalsConstructorPrototypeIfNotBuggy = function (o) { 57810 /* global window */ 57811 if (typeof window === 'undefined' || !hasAutomationEqualityBug) { 57812 return equalsConstructorPrototype(o); 57813 } 57814 try { 57815 return equalsConstructorPrototype(o); 57816 } catch (e) { 57817 return false; 57818 } 57819 }; 57820 57821 keysShim = function keys(object) { 57822 var isObject = object !== null && typeof object === 'object'; 57823 var isFunction = toStr.call(object) === '[object Function]'; 57824 var isArguments = isArgs(object); 57825 var isString = isObject && toStr.call(object) === '[object String]'; 57826 var theKeys = []; 57827 57828 if (!isObject && !isFunction && !isArguments) { 57829 throw new TypeError('Object.keys called on a non-object'); 57830 } 57831 57832 var skipProto = hasProtoEnumBug && isFunction; 57833 if (isString && object.length > 0 && !has.call(object, 0)) { 57834 for (var i = 0; i < object.length; ++i) { 57835 theKeys.push(String(i)); 57836 } 57837 } 57838 57839 if (isArguments && object.length > 0) { 57840 for (var j = 0; j < object.length; ++j) { 57841 theKeys.push(String(j)); 57842 } 57843 } else { 57844 for (var name in object) { 57845 if (!(skipProto && name === 'prototype') && has.call(object, name)) { 57846 theKeys.push(String(name)); 57847 } 57848 } 57849 } 57850 57851 if (hasDontEnumBug) { 57852 var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); 57853 57854 for (var k = 0; k < dontEnums.length; ++k) { 57855 if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { 57856 theKeys.push(dontEnums[k]); 57857 } 57858 } 57859 } 57860 return theKeys; 57861 }; 57862 } 57863 module.exports = keysShim; 57864 57865 57866 /***/ }), 57867 57868 /***/ "tLB3": 57869 /***/ (function(module, exports, __webpack_require__) { 57870 57871 var baseTrim = __webpack_require__("jXQH"), 57872 isObject = __webpack_require__("GoyQ"), 57873 isSymbol = __webpack_require__("/9aa"); 57874 57875 /** Used as references for various `Number` constants. */ 57876 var NAN = 0 / 0; 57877 57878 /** Used to detect bad signed hexadecimal string values. */ 57879 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 57880 57881 /** Used to detect binary string values. */ 57882 var reIsBinary = /^0b[01]+$/i; 57883 57884 /** Used to detect octal string values. */ 57885 var reIsOctal = /^0o[0-7]+$/i; 57886 57887 /** Built-in method references without a dependency on `root`. */ 57888 var freeParseInt = parseInt; 57889 57890 /** 57891 * Converts `value` to a number. 57892 * 57893 * @static 57894 * @memberOf _ 57895 * @since 4.0.0 57896 * @category Lang 57897 * @param {*} value The value to process. 57898 * @returns {number} Returns the number. 57899 * @example 57900 * 57901 * _.toNumber(3.2); 57902 * // => 3.2 57903 * 57904 * _.toNumber(Number.MIN_VALUE); 57905 * // => 5e-324 57906 * 57907 * _.toNumber(Infinity); 57908 * // => Infinity 57909 * 57910 * _.toNumber('3.2'); 57911 * // => 3.2 57912 */ 57913 function toNumber(value) { 57914 if (typeof value == 'number') { 57915 return value; 57916 } 57917 if (isSymbol(value)) { 57918 return NAN; 57919 } 57920 if (isObject(value)) { 57921 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 57922 value = isObject(other) ? (other + '') : other; 57923 } 57924 if (typeof value != 'string') { 57925 return value === 0 ? value : +value; 57926 } 57927 value = baseTrim(value); 57928 var isBinary = reIsBinary.test(value); 57929 return (isBinary || reIsOctal.test(value)) 57930 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 57931 : (reIsBadHex.test(value) ? NAN : +value); 57932 } 57933 57934 module.exports = toNumber; 57935 57936 57937 /***/ }), 57938 57939 /***/ "tQ+x": 57940 /***/ (function(module, __webpack_exports__, __webpack_require__) { 57941 57942 "use strict"; 57943 /* unused harmony export REACT_TYPEOF_KEY */ 57944 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COMPONENT_NAMESPACE; }); 57945 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CONNECTED_NAMESPACE; }); 57946 /* unused harmony export CONTEXT_COMPONENT_NAMESPACE */ 57947 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CONNECT_STATIC_NAMESPACE; }); 57948 const REACT_TYPEOF_KEY = '$$typeof'; 57949 const COMPONENT_NAMESPACE = 'data-wp-component'; 57950 const CONNECTED_NAMESPACE = 'data-wp-c16t'; 57951 const CONTEXT_COMPONENT_NAMESPACE = 'data-wp-c5tc8t'; 57952 /** 57953 * Special key where the connected namespaces are stored. 57954 * This is attached to Context connected components as a static property. 57955 */ 57956 57957 const CONNECT_STATIC_NAMESPACE = '__contextSystemKey__'; 57958 57959 57960 /***/ }), 57961 57962 /***/ "u5Fq": 57963 /***/ (function(module, exports, __webpack_require__) { 57964 57965 "use strict"; 57966 57967 57968 Object.defineProperty(exports, "__esModule", { 57969 value: true 57970 }); 57971 exports['default'] = getVisibleDays; 57972 57973 var _moment = __webpack_require__("wy2R"); 57974 57975 var _moment2 = _interopRequireDefault(_moment); 57976 57977 var _toISOMonthString = __webpack_require__("jenk"); 57978 57979 var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString); 57980 57981 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 57982 57983 function getVisibleDays(month, numberOfMonths, enableOutsideDays, withoutTransitionMonths) { 57984 if (!_moment2['default'].isMoment(month)) return {}; 57985 57986 var visibleDaysByMonth = {}; 57987 var currentMonth = withoutTransitionMonths ? month.clone() : month.clone().subtract(1, 'month'); 57988 for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) { 57989 var visibleDays = []; 57990 57991 // set utc offset to get correct dates in future (when timezone changes) 57992 var baseDate = currentMonth.clone(); 57993 var firstOfMonth = baseDate.clone().startOf('month').hour(12); 57994 var lastOfMonth = baseDate.clone().endOf('month').hour(12); 57995 57996 var currentDay = firstOfMonth.clone(); 57997 57998 // days belonging to the previous month 57999 if (enableOutsideDays) { 58000 for (var j = 0; j < currentDay.weekday(); j += 1) { 58001 var prevDay = currentDay.clone().subtract(j + 1, 'day'); 58002 visibleDays.unshift(prevDay); 58003 } 58004 } 58005 58006 while (currentDay < lastOfMonth) { 58007 visibleDays.push(currentDay.clone()); 58008 currentDay.add(1, 'day'); 58009 } 58010 58011 if (enableOutsideDays) { 58012 // weekday() returns the index of the day of the week according to the locale 58013 // this means if the week starts on Monday, weekday() will return 0 for a Monday date, not 1 58014 if (currentDay.weekday() !== 0) { 58015 // days belonging to the next month 58016 for (var k = currentDay.weekday(), count = 0; k < 7; k += 1, count += 1) { 58017 var nextDay = currentDay.clone().add(count, 'day'); 58018 visibleDays.push(nextDay); 58019 } 58020 } 58021 } 58022 58023 visibleDaysByMonth[(0, _toISOMonthString2['default'])(currentMonth)] = visibleDays; 58024 currentMonth = currentMonth.clone().add(1, 'month'); 58025 } 58026 58027 return visibleDaysByMonth; 58028 } 58029 58030 /***/ }), 58031 58032 /***/ "uGfJ": 58033 /***/ (function(module, __webpack_exports__, __webpack_require__) { 58034 58035 "use strict"; 58036 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 58037 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 58038 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 58039 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 58040 58041 58042 /** 58043 * WordPress dependencies 58044 */ 58045 58046 const textColor = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 58047 xmlns: "http://www.w3.org/2000/svg", 58048 viewBox: "0 0 24 24" 58049 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 58050 d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" 58051 })); 58052 /* harmony default export */ __webpack_exports__["a"] = (textColor); 58053 58054 58055 /***/ }), 58056 58057 /***/ "ulUS": 58058 /***/ (function(module, exports, __webpack_require__) { 58059 58060 "use strict"; 58061 58062 58063 Object.defineProperty(exports, "__esModule", { 58064 value: true 58065 }); 58066 exports['default'] = isSameMonth; 58067 58068 var _moment = __webpack_require__("wy2R"); 58069 58070 var _moment2 = _interopRequireDefault(_moment); 58071 58072 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 58073 58074 function isSameMonth(a, b) { 58075 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 58076 // Compare least significant, most likely to change units first 58077 // Moment's isSame clones moment inputs and is a tad slow 58078 return a.month() === b.month() && a.year() === b.year(); 58079 } 58080 58081 /***/ }), 58082 58083 /***/ "uqqE": 58084 /***/ (function(module, __webpack_exports__, __webpack_require__) { 58085 58086 "use strict"; 58087 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return shallowEqual; }); 58088 /** 58089 * Compares two objects. 58090 * 58091 * @example 58092 * import { shallowEqual } from "reakit-utils"; 58093 * 58094 * shallowEqual({ a: "a" }, {}); // false 58095 * shallowEqual({ a: "a" }, { b: "b" }); // false 58096 * shallowEqual({ a: "a" }, { a: "a" }); // true 58097 * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false 58098 */ 58099 function shallowEqual(objA, objB) { 58100 if (objA === objB) return true; 58101 if (!objA) return false; 58102 if (!objB) return false; 58103 if (typeof objA !== "object") return false; 58104 if (typeof objB !== "object") return false; 58105 var aKeys = Object.keys(objA); 58106 var bKeys = Object.keys(objB); 58107 var length = aKeys.length; 58108 if (bKeys.length !== length) return false; 58109 58110 for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) { 58111 var key = _aKeys[_i]; 58112 58113 if (objA[key] !== objB[key]) { 58114 return false; 58115 } 58116 } 58117 58118 return true; 58119 } 58120 58121 58122 58123 58124 /***/ }), 58125 58126 /***/ "utzN": 58127 /***/ (function(module, __webpack_exports__, __webpack_require__) { 58128 58129 "use strict"; 58130 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contains; }); 58131 /** 58132 * Similar to `Element.prototype.contains`, but a little bit faster when 58133 * `element` is the same as `child`. 58134 * 58135 * @example 58136 * import { contains } from "reakit-utils"; 58137 * 58138 * contains(document.getElementById("parent"), document.getElementById("child")); 58139 */ 58140 function contains(parent, child) { 58141 return parent === child || parent.contains(child); 58142 } 58143 58144 58145 58146 58147 /***/ }), 58148 58149 /***/ "v3P4": 58150 /***/ (function(module, exports, __webpack_require__) { 58151 58152 "use strict"; 58153 58154 58155 var define = __webpack_require__("82c2"); 58156 var getPolyfill = __webpack_require__("22yB"); 58157 58158 module.exports = function shimFlat() { 58159 var polyfill = getPolyfill(); 58160 define( 58161 Array.prototype, 58162 { flat: polyfill }, 58163 { flat: function () { return Array.prototype.flat !== polyfill; } } 58164 ); 58165 return polyfill; 58166 }; 58167 58168 58169 /***/ }), 58170 58171 /***/ "v7lB": 58172 /***/ (function(module, exports, __webpack_require__) { 58173 58174 "use strict"; 58175 58176 58177 /* globals 58178 AggregateError, 58179 Atomics, 58180 FinalizationRegistry, 58181 SharedArrayBuffer, 58182 WeakRef, 58183 */ 58184 58185 var undefined; 58186 58187 var $SyntaxError = SyntaxError; 58188 var $Function = Function; 58189 var $TypeError = TypeError; 58190 58191 // eslint-disable-next-line consistent-return 58192 var getEvalledConstructor = function (expressionSyntax) { 58193 try { 58194 // eslint-disable-next-line no-new-func 58195 return Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 58196 } catch (e) {} 58197 }; 58198 58199 var $gOPD = Object.getOwnPropertyDescriptor; 58200 if ($gOPD) { 58201 try { 58202 $gOPD({}, ''); 58203 } catch (e) { 58204 $gOPD = null; // this is IE 8, which has a broken gOPD 58205 } 58206 } 58207 58208 var throwTypeError = function () { throw new $TypeError(); }; 58209 var ThrowTypeError = $gOPD 58210 ? (function () { 58211 try { 58212 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 58213 arguments.callee; // IE 8 does not throw here 58214 return throwTypeError; 58215 } catch (calleeThrows) { 58216 try { 58217 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 58218 return $gOPD(arguments, 'callee').get; 58219 } catch (gOPDthrows) { 58220 return throwTypeError; 58221 } 58222 } 58223 }()) 58224 : throwTypeError; 58225 58226 var hasSymbols = __webpack_require__("UVaH")(); 58227 58228 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 58229 58230 var asyncGenFunction = getEvalledConstructor('async function* () {}'); 58231 var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined; 58232 var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined; 58233 58234 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 58235 58236 var INTRINSICS = { 58237 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 58238 '%Array%': Array, 58239 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 58240 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 58241 '%AsyncFromSyncIteratorPrototype%': undefined, 58242 '%AsyncFunction%': getEvalledConstructor('async function () {}'), 58243 '%AsyncGenerator%': asyncGenFunctionPrototype, 58244 '%AsyncGeneratorFunction%': asyncGenFunction, 58245 '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined, 58246 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 58247 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 58248 '%Boolean%': Boolean, 58249 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 58250 '%Date%': Date, 58251 '%decodeURI%': decodeURI, 58252 '%decodeURIComponent%': decodeURIComponent, 58253 '%encodeURI%': encodeURI, 58254 '%encodeURIComponent%': encodeURIComponent, 58255 '%Error%': Error, 58256 '%eval%': eval, // eslint-disable-line no-eval 58257 '%EvalError%': EvalError, 58258 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 58259 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 58260 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 58261 '%Function%': $Function, 58262 '%GeneratorFunction%': getEvalledConstructor('function* () {}'), 58263 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 58264 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 58265 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 58266 '%isFinite%': isFinite, 58267 '%isNaN%': isNaN, 58268 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 58269 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 58270 '%Map%': typeof Map === 'undefined' ? undefined : Map, 58271 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 58272 '%Math%': Math, 58273 '%Number%': Number, 58274 '%Object%': Object, 58275 '%parseFloat%': parseFloat, 58276 '%parseInt%': parseInt, 58277 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 58278 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 58279 '%RangeError%': RangeError, 58280 '%ReferenceError%': ReferenceError, 58281 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 58282 '%RegExp%': RegExp, 58283 '%Set%': typeof Set === 'undefined' ? undefined : Set, 58284 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 58285 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 58286 '%String%': String, 58287 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 58288 '%Symbol%': hasSymbols ? Symbol : undefined, 58289 '%SyntaxError%': $SyntaxError, 58290 '%ThrowTypeError%': ThrowTypeError, 58291 '%TypedArray%': TypedArray, 58292 '%TypeError%': $TypeError, 58293 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 58294 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 58295 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 58296 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 58297 '%URIError%': URIError, 58298 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 58299 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 58300 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 58301 }; 58302 58303 var LEGACY_ALIASES = { 58304 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 58305 '%ArrayPrototype%': ['Array', 'prototype'], 58306 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 58307 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 58308 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 58309 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 58310 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 58311 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 58312 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 58313 '%BooleanPrototype%': ['Boolean', 'prototype'], 58314 '%DataViewPrototype%': ['DataView', 'prototype'], 58315 '%DatePrototype%': ['Date', 'prototype'], 58316 '%ErrorPrototype%': ['Error', 'prototype'], 58317 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 58318 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 58319 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 58320 '%FunctionPrototype%': ['Function', 'prototype'], 58321 '%Generator%': ['GeneratorFunction', 'prototype'], 58322 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 58323 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 58324 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 58325 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 58326 '%JSONParse%': ['JSON', 'parse'], 58327 '%JSONStringify%': ['JSON', 'stringify'], 58328 '%MapPrototype%': ['Map', 'prototype'], 58329 '%NumberPrototype%': ['Number', 'prototype'], 58330 '%ObjectPrototype%': ['Object', 'prototype'], 58331 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 58332 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 58333 '%PromisePrototype%': ['Promise', 'prototype'], 58334 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 58335 '%Promise_all%': ['Promise', 'all'], 58336 '%Promise_reject%': ['Promise', 'reject'], 58337 '%Promise_resolve%': ['Promise', 'resolve'], 58338 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 58339 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 58340 '%RegExpPrototype%': ['RegExp', 'prototype'], 58341 '%SetPrototype%': ['Set', 'prototype'], 58342 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 58343 '%StringPrototype%': ['String', 'prototype'], 58344 '%SymbolPrototype%': ['Symbol', 'prototype'], 58345 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 58346 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 58347 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 58348 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 58349 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 58350 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 58351 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 58352 '%URIErrorPrototype%': ['URIError', 'prototype'], 58353 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 58354 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 58355 }; 58356 58357 var bind = __webpack_require__("D3zA"); 58358 var hasOwn = __webpack_require__("oNNP"); 58359 var $concat = bind.call(Function.call, Array.prototype.concat); 58360 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 58361 var $replace = bind.call(Function.call, String.prototype.replace); 58362 58363 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 58364 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 58365 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 58366 var stringToPath = function stringToPath(string) { 58367 var result = []; 58368 $replace(string, rePropName, function (match, number, quote, subString) { 58369 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 58370 }); 58371 return result; 58372 }; 58373 /* end adaptation */ 58374 58375 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 58376 var intrinsicName = name; 58377 var alias; 58378 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 58379 alias = LEGACY_ALIASES[intrinsicName]; 58380 intrinsicName = '%' + alias[0] + '%'; 58381 } 58382 58383 if (hasOwn(INTRINSICS, intrinsicName)) { 58384 var value = INTRINSICS[intrinsicName]; 58385 if (typeof value === 'undefined' && !allowMissing) { 58386 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 58387 } 58388 58389 return { 58390 alias: alias, 58391 name: intrinsicName, 58392 value: value 58393 }; 58394 } 58395 58396 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 58397 }; 58398 58399 module.exports = function GetIntrinsic(name, allowMissing) { 58400 if (typeof name !== 'string' || name.length === 0) { 58401 throw new $TypeError('intrinsic name must be a non-empty string'); 58402 } 58403 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 58404 throw new $TypeError('"allowMissing" argument must be a boolean'); 58405 } 58406 58407 var parts = stringToPath(name); 58408 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 58409 58410 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 58411 var intrinsicRealName = intrinsic.name; 58412 var value = intrinsic.value; 58413 var skipFurtherCaching = false; 58414 58415 var alias = intrinsic.alias; 58416 if (alias) { 58417 intrinsicBaseName = alias[0]; 58418 $spliceApply(parts, $concat([0, 1], alias)); 58419 } 58420 58421 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 58422 var part = parts[i]; 58423 if (part === 'constructor' || !isOwn) { 58424 skipFurtherCaching = true; 58425 } 58426 58427 intrinsicBaseName += '.' + part; 58428 intrinsicRealName = '%' + intrinsicBaseName + '%'; 58429 58430 if (hasOwn(INTRINSICS, intrinsicRealName)) { 58431 value = INTRINSICS[intrinsicRealName]; 58432 } else if (value != null) { 58433 if ($gOPD && (i + 1) >= parts.length) { 58434 var desc = $gOPD(value, part); 58435 isOwn = !!desc; 58436 58437 if (!allowMissing && !(part in value)) { 58438 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 58439 } 58440 // By convention, when a data property is converted to an accessor 58441 // property to emulate a data property that does not suffer from 58442 // the override mistake, that accessor's getter is marked with 58443 // an `originalValue` property. Here, when we detect this, we 58444 // uphold the illusion by pretending to see that original data 58445 // property, i.e., returning the value rather than the getter 58446 // itself. 58447 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 58448 value = desc.get; 58449 } else { 58450 value = value[part]; 58451 } 58452 } else { 58453 isOwn = hasOwn(value, part); 58454 value = value[part]; 58455 } 58456 58457 if (isOwn && !skipFurtherCaching) { 58458 INTRINSICS[intrinsicRealName] = value; 58459 } 58460 } 58461 } 58462 return value; 58463 }; 58464 58465 58466 /***/ }), 58467 58468 /***/ "vLdR": 58469 /***/ (function(module, exports, __webpack_require__) { 58470 58471 "use strict"; 58472 58473 58474 // http://262.ecma-international.org/5.1/#sec-9.1 58475 58476 module.exports = __webpack_require__("Lxf3"); 58477 58478 58479 /***/ }), 58480 58481 /***/ "vUUf": 58482 /***/ (function(module, __webpack_exports__, __webpack_require__) { 58483 58484 "use strict"; 58485 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14"); 58486 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId"); 58487 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 58488 58489 58490 58491 /** 58492 * @typedef OwnProps 58493 * 58494 * @property {string} icon Icon name 58495 * @property {string} [className] Class name 58496 */ 58497 58498 /** @typedef {import('react').ComponentPropsWithoutRef<'span'> & OwnProps} Props */ 58499 58500 /** 58501 * @param {Props} props 58502 * @return {JSX.Element} Element 58503 */ 58504 function Dashicon({ 58505 icon, 58506 className, 58507 ...extraProps 58508 }) { 58509 const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' '); 58510 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ 58511 className: iconClass 58512 }, extraProps)); 58513 } 58514 58515 /* harmony default export */ __webpack_exports__["a"] = (Dashicon); 58516 58517 58518 /***/ }), 58519 58520 /***/ "vV+G": 58521 /***/ (function(module, exports, __webpack_require__) { 58522 58523 "use strict"; 58524 58525 58526 Object.defineProperty(exports, "__esModule", { 58527 value: true 58528 }); 58529 var calendarLabel = 'Calendar'; 58530 var closeDatePicker = 'Close'; 58531 var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.'; 58532 var clearDate = 'Clear Date'; 58533 var clearDates = 'Clear Dates'; 58534 var jumpToPrevMonth = 'Move backward to switch to the previous month.'; 58535 var jumpToNextMonth = 'Move forward to switch to the next month.'; 58536 var keyboardShortcuts = 'Keyboard Shortcuts'; 58537 var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.'; 58538 var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.'; 58539 var openThisPanel = 'Open this panel.'; 58540 var enterKey = 'Enter key'; 58541 var leftArrowRightArrow = 'Right and left arrow keys'; 58542 var upArrowDownArrow = 'up and down arrow keys'; 58543 var pageUpPageDown = 'page up and page down keys'; 58544 var homeEnd = 'Home and end keys'; 58545 var escape = 'Escape key'; 58546 var questionMark = 'Question mark'; 58547 var selectFocusedDate = 'Select the date in focus.'; 58548 var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.'; 58549 var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.'; 58550 var moveFocusByOneMonth = 'Switch months.'; 58551 var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.'; 58552 var returnFocusToInput = 'Return to the date input field.'; 58553 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.'; 58554 58555 var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) { 58556 var date = _ref.date; 58557 return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.'; 58558 }; 58559 var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) { 58560 var date = _ref2.date; 58561 return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.'; 58562 }; 58563 var chooseAvailableDate = function chooseAvailableDate(_ref3) { 58564 var date = _ref3.date; 58565 return date; 58566 }; 58567 var dateIsUnavailable = function dateIsUnavailable(_ref4) { 58568 var date = _ref4.date; 58569 return 'Not available. ' + String(date); 58570 }; 58571 var dateIsSelected = function dateIsSelected(_ref5) { 58572 var date = _ref5.date; 58573 return 'Selected. ' + String(date); 58574 }; 58575 58576 exports['default'] = { 58577 calendarLabel: calendarLabel, 58578 closeDatePicker: closeDatePicker, 58579 focusStartDate: focusStartDate, 58580 clearDate: clearDate, 58581 clearDates: clearDates, 58582 jumpToPrevMonth: jumpToPrevMonth, 58583 jumpToNextMonth: jumpToNextMonth, 58584 keyboardShortcuts: keyboardShortcuts, 58585 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 58586 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 58587 openThisPanel: openThisPanel, 58588 enterKey: enterKey, 58589 leftArrowRightArrow: leftArrowRightArrow, 58590 upArrowDownArrow: upArrowDownArrow, 58591 pageUpPageDown: pageUpPageDown, 58592 homeEnd: homeEnd, 58593 escape: escape, 58594 questionMark: questionMark, 58595 selectFocusedDate: selectFocusedDate, 58596 moveFocusByOneDay: moveFocusByOneDay, 58597 moveFocusByOneWeek: moveFocusByOneWeek, 58598 moveFocusByOneMonth: moveFocusByOneMonth, 58599 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 58600 returnFocusToInput: returnFocusToInput, 58601 keyboardNavigationInstructions: keyboardNavigationInstructions, 58602 58603 chooseAvailableStartDate: chooseAvailableStartDate, 58604 chooseAvailableEndDate: chooseAvailableEndDate, 58605 dateIsUnavailable: dateIsUnavailable, 58606 dateIsSelected: dateIsSelected 58607 }; 58608 var DateRangePickerPhrases = exports.DateRangePickerPhrases = { 58609 calendarLabel: calendarLabel, 58610 closeDatePicker: closeDatePicker, 58611 clearDates: clearDates, 58612 focusStartDate: focusStartDate, 58613 jumpToPrevMonth: jumpToPrevMonth, 58614 jumpToNextMonth: jumpToNextMonth, 58615 keyboardShortcuts: keyboardShortcuts, 58616 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 58617 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 58618 openThisPanel: openThisPanel, 58619 enterKey: enterKey, 58620 leftArrowRightArrow: leftArrowRightArrow, 58621 upArrowDownArrow: upArrowDownArrow, 58622 pageUpPageDown: pageUpPageDown, 58623 homeEnd: homeEnd, 58624 escape: escape, 58625 questionMark: questionMark, 58626 selectFocusedDate: selectFocusedDate, 58627 moveFocusByOneDay: moveFocusByOneDay, 58628 moveFocusByOneWeek: moveFocusByOneWeek, 58629 moveFocusByOneMonth: moveFocusByOneMonth, 58630 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 58631 returnFocusToInput: returnFocusToInput, 58632 keyboardNavigationInstructions: keyboardNavigationInstructions, 58633 chooseAvailableStartDate: chooseAvailableStartDate, 58634 chooseAvailableEndDate: chooseAvailableEndDate, 58635 dateIsUnavailable: dateIsUnavailable, 58636 dateIsSelected: dateIsSelected 58637 }; 58638 58639 var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = { 58640 focusStartDate: focusStartDate, 58641 clearDates: clearDates, 58642 keyboardNavigationInstructions: keyboardNavigationInstructions 58643 }; 58644 58645 var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = { 58646 calendarLabel: calendarLabel, 58647 closeDatePicker: closeDatePicker, 58648 clearDate: clearDate, 58649 jumpToPrevMonth: jumpToPrevMonth, 58650 jumpToNextMonth: jumpToNextMonth, 58651 keyboardShortcuts: keyboardShortcuts, 58652 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 58653 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 58654 openThisPanel: openThisPanel, 58655 enterKey: enterKey, 58656 leftArrowRightArrow: leftArrowRightArrow, 58657 upArrowDownArrow: upArrowDownArrow, 58658 pageUpPageDown: pageUpPageDown, 58659 homeEnd: homeEnd, 58660 escape: escape, 58661 questionMark: questionMark, 58662 selectFocusedDate: selectFocusedDate, 58663 moveFocusByOneDay: moveFocusByOneDay, 58664 moveFocusByOneWeek: moveFocusByOneWeek, 58665 moveFocusByOneMonth: moveFocusByOneMonth, 58666 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 58667 returnFocusToInput: returnFocusToInput, 58668 keyboardNavigationInstructions: keyboardNavigationInstructions, 58669 chooseAvailableDate: chooseAvailableDate, 58670 dateIsUnavailable: dateIsUnavailable, 58671 dateIsSelected: dateIsSelected 58672 }; 58673 58674 var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = { 58675 clearDate: clearDate, 58676 keyboardNavigationInstructions: keyboardNavigationInstructions 58677 }; 58678 58679 var DayPickerPhrases = exports.DayPickerPhrases = { 58680 calendarLabel: calendarLabel, 58681 jumpToPrevMonth: jumpToPrevMonth, 58682 jumpToNextMonth: jumpToNextMonth, 58683 keyboardShortcuts: keyboardShortcuts, 58684 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 58685 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 58686 openThisPanel: openThisPanel, 58687 enterKey: enterKey, 58688 leftArrowRightArrow: leftArrowRightArrow, 58689 upArrowDownArrow: upArrowDownArrow, 58690 pageUpPageDown: pageUpPageDown, 58691 homeEnd: homeEnd, 58692 escape: escape, 58693 questionMark: questionMark, 58694 selectFocusedDate: selectFocusedDate, 58695 moveFocusByOneDay: moveFocusByOneDay, 58696 moveFocusByOneWeek: moveFocusByOneWeek, 58697 moveFocusByOneMonth: moveFocusByOneMonth, 58698 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 58699 returnFocusToInput: returnFocusToInput, 58700 chooseAvailableStartDate: chooseAvailableStartDate, 58701 chooseAvailableEndDate: chooseAvailableEndDate, 58702 chooseAvailableDate: chooseAvailableDate, 58703 dateIsUnavailable: dateIsUnavailable, 58704 dateIsSelected: dateIsSelected 58705 }; 58706 58707 var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = { 58708 keyboardShortcuts: keyboardShortcuts, 58709 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 58710 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 58711 openThisPanel: openThisPanel, 58712 enterKey: enterKey, 58713 leftArrowRightArrow: leftArrowRightArrow, 58714 upArrowDownArrow: upArrowDownArrow, 58715 pageUpPageDown: pageUpPageDown, 58716 homeEnd: homeEnd, 58717 escape: escape, 58718 questionMark: questionMark, 58719 selectFocusedDate: selectFocusedDate, 58720 moveFocusByOneDay: moveFocusByOneDay, 58721 moveFocusByOneWeek: moveFocusByOneWeek, 58722 moveFocusByOneMonth: moveFocusByOneMonth, 58723 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 58724 returnFocusToInput: returnFocusToInput 58725 }; 58726 58727 var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = { 58728 jumpToPrevMonth: jumpToPrevMonth, 58729 jumpToNextMonth: jumpToNextMonth 58730 }; 58731 58732 var CalendarDayPhrases = exports.CalendarDayPhrases = { 58733 chooseAvailableDate: chooseAvailableDate, 58734 dateIsUnavailable: dateIsUnavailable, 58735 dateIsSelected: dateIsSelected 58736 }; 58737 58738 /***/ }), 58739 58740 /***/ "w3Ut": 58741 /***/ (function(module, exports, __webpack_require__) { 58742 58743 "use strict"; 58744 58745 58746 var MAX_SAFE_INTEGER = __webpack_require__("yyeE"); 58747 58748 var ToInteger = __webpack_require__("ddK1"); 58749 58750 module.exports = function ToLength(argument) { 58751 var len = ToInteger(argument); 58752 if (len <= 0) { return 0; } // includes converting -0 to +0 58753 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } 58754 return len; 58755 }; 58756 58757 58758 /***/ }), 58759 58760 /***/ "w95h": 58761 /***/ (function(module, __webpack_exports__, __webpack_require__) { 58762 58763 "use strict"; 58764 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 58765 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 58766 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 58767 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 58768 58769 58770 /** 58771 * WordPress dependencies 58772 */ 58773 58774 const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 58775 xmlns: "http://www.w3.org/2000/svg", 58776 viewBox: "0 0 24 24" 58777 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 58778 d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" 58779 })); 58780 /* harmony default export */ __webpack_exports__["a"] = (close); 58781 58782 58783 /***/ }), 58784 58785 /***/ "wTIp": 58786 /***/ (function(module, exports, __webpack_require__) { 58787 58788 "use strict"; 58789 58790 58791 var GetIntrinsic = __webpack_require__("rZ7t"); 58792 58793 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 58794 58795 if ($defineProperty) { 58796 try { 58797 $defineProperty({}, 'a', { value: 1 }); 58798 } catch (e) { 58799 // IE 8 has a broken defineProperty 58800 $defineProperty = null; 58801 } 58802 } 58803 58804 var callBound = __webpack_require__("EXo9"); 58805 58806 var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 58807 58808 // eslint-disable-next-line max-params 58809 module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { 58810 if (!$defineProperty) { 58811 if (!IsDataDescriptor(desc)) { 58812 // ES3 does not support getters/setters 58813 return false; 58814 } 58815 if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { 58816 return false; 58817 } 58818 58819 // fallback for ES3 58820 if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { 58821 // a non-enumerable existing property 58822 return false; 58823 } 58824 58825 // property does not exist at all, or exists but is enumerable 58826 var V = desc['[[Value]]']; 58827 // eslint-disable-next-line no-param-reassign 58828 O[P] = V; // will use [[Define]] 58829 return SameValue(O[P], V); 58830 } 58831 $defineProperty(O, P, FromPropertyDescriptor(desc)); 58832 return true; 58833 }; 58834 58835 58836 /***/ }), 58837 58838 /***/ "wx14": 58839 /***/ (function(module, __webpack_exports__, __webpack_require__) { 58840 58841 "use strict"; 58842 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); 58843 function _extends() { 58844 _extends = Object.assign || function (target) { 58845 for (var i = 1; i < arguments.length; i++) { 58846 var source = arguments[i]; 58847 58848 for (var key in source) { 58849 if (Object.prototype.hasOwnProperty.call(source, key)) { 58850 target[key] = source[key]; 58851 } 58852 } 58853 } 58854 58855 return target; 58856 }; 58857 58858 return _extends.apply(this, arguments); 58859 } 58860 58861 /***/ }), 58862 58863 /***/ "wy2R": 58864 /***/ (function(module, exports) { 58865 58866 (function() { module.exports = window["moment"]; }()); 58867 58868 /***/ }), 58869 58870 /***/ "xCFm": 58871 /***/ (function(module, exports, __webpack_require__) { 58872 58873 "use strict"; 58874 58875 58876 var GetIntrinsic = __webpack_require__("rZ7t"); 58877 58878 var $TypeError = GetIntrinsic('%TypeError%'); 58879 var $Number = GetIntrinsic('%Number%'); 58880 var $RegExp = GetIntrinsic('%RegExp%'); 58881 var $parseInteger = GetIntrinsic('%parseInt%'); 58882 58883 var callBound = __webpack_require__("EXo9"); 58884 var regexTester = __webpack_require__("ZbWB"); 58885 var isPrimitive = __webpack_require__("BeK9"); 58886 58887 var $strSlice = callBound('String.prototype.slice'); 58888 var isBinary = regexTester(/^0b[01]+$/i); 58889 var isOctal = regexTester(/^0o[0-7]+$/i); 58890 var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); 58891 var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); 58892 var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); 58893 var hasNonWS = regexTester(nonWSregex); 58894 58895 // whitespace from: https://es5.github.io/#x15.5.4.20 58896 // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 58897 var ws = [ 58898 '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', 58899 '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', 58900 '\u2029\uFEFF' 58901 ].join(''); 58902 var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); 58903 var $replace = callBound('String.prototype.replace'); 58904 var $trim = function (value) { 58905 return $replace(value, trimRegex, ''); 58906 }; 58907 58908 var ToPrimitive = __webpack_require__("L7Wv"); 58909 58910 // https://ecma-international.org/ecma-262/6.0/#sec-tonumber 58911 58912 module.exports = function ToNumber(argument) { 58913 var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); 58914 if (typeof value === 'symbol') { 58915 throw new $TypeError('Cannot convert a Symbol value to a number'); 58916 } 58917 if (typeof value === 'bigint') { 58918 throw new $TypeError('Conversion from \'BigInt\' to \'number\' is not allowed.'); 58919 } 58920 if (typeof value === 'string') { 58921 if (isBinary(value)) { 58922 return ToNumber($parseInteger($strSlice(value, 2), 2)); 58923 } else if (isOctal(value)) { 58924 return ToNumber($parseInteger($strSlice(value, 2), 8)); 58925 } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { 58926 return NaN; 58927 } else { 58928 var trimmed = $trim(value); 58929 if (trimmed !== value) { 58930 return ToNumber(trimmed); 58931 } 58932 } 58933 } 58934 return $Number(value); 58935 }; 58936 58937 58938 /***/ }), 58939 58940 /***/ "xEte": 58941 /***/ (function(module, exports, __webpack_require__) { 58942 58943 "use strict"; 58944 58945 58946 Object.defineProperty(exports, "__esModule", { 58947 value: true 58948 }); 58949 58950 var _react = __webpack_require__("cDcd"); 58951 58952 var _react2 = _interopRequireDefault(_react); 58953 58954 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 58955 58956 var CloseButton = function () { 58957 function CloseButton(props) { 58958 return _react2['default'].createElement( 58959 'svg', 58960 props, 58961 _react2['default'].createElement('path', { 58962 fillRule: 'evenodd', 58963 d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z' 58964 }) 58965 ); 58966 } 58967 58968 return CloseButton; 58969 }(); 58970 58971 CloseButton.defaultProps = { 58972 viewBox: '0 0 12 12' 58973 }; 58974 exports['default'] = CloseButton; 58975 58976 /***/ }), 58977 58978 /***/ "xOhs": 58979 /***/ (function(module, exports, __webpack_require__) { 58980 58981 "use strict"; 58982 58983 58984 Object.defineProperty(exports, "__esModule", { 58985 value: true 58986 }); 58987 var core = { 58988 white: '#fff', 58989 gray: '#484848', 58990 grayLight: '#82888a', 58991 grayLighter: '#cacccd', 58992 grayLightest: '#f2f2f2', 58993 58994 borderMedium: '#c4c4c4', 58995 border: '#dbdbdb', 58996 borderLight: '#e4e7e7', 58997 borderLighter: '#eceeee', 58998 borderBright: '#f4f5f5', 58999 59000 primary: '#00a699', 59001 primaryShade_1: '#33dacd', 59002 primaryShade_2: '#66e2da', 59003 primaryShade_3: '#80e8e0', 59004 primaryShade_4: '#b2f1ec', 59005 primary_dark: '#008489', 59006 59007 secondary: '#007a87', 59008 59009 yellow: '#ffe8bc', 59010 yellow_dark: '#ffce71' 59011 }; 59012 59013 exports['default'] = { 59014 reactDates: { 59015 zIndex: 0, 59016 border: { 59017 input: { 59018 border: 0, 59019 borderTop: 0, 59020 borderRight: 0, 59021 borderBottom: '2px solid transparent', 59022 borderLeft: 0, 59023 outlineFocused: 0, 59024 borderFocused: 0, 59025 borderTopFocused: 0, 59026 borderLeftFocused: 0, 59027 borderBottomFocused: '2px solid ' + String(core.primary_dark), 59028 borderRightFocused: 0, 59029 borderRadius: 0 59030 }, 59031 pickerInput: { 59032 borderWidth: 1, 59033 borderStyle: 'solid', 59034 borderRadius: 2 59035 } 59036 }, 59037 59038 color: { 59039 core: core, 59040 59041 disabled: core.grayLightest, 59042 59043 background: core.white, 59044 backgroundDark: '#f2f2f2', 59045 backgroundFocused: core.white, 59046 border: 'rgb(219, 219, 219)', 59047 text: core.gray, 59048 textDisabled: core.border, 59049 textFocused: '#007a87', 59050 placeholderText: '#757575', 59051 59052 outside: { 59053 backgroundColor: core.white, 59054 backgroundColor_active: core.white, 59055 backgroundColor_hover: core.white, 59056 color: core.gray, 59057 color_active: core.gray, 59058 color_hover: core.gray 59059 }, 59060 59061 highlighted: { 59062 backgroundColor: core.yellow, 59063 backgroundColor_active: core.yellow_dark, 59064 backgroundColor_hover: core.yellow_dark, 59065 color: core.gray, 59066 color_active: core.gray, 59067 color_hover: core.gray 59068 }, 59069 59070 minimumNights: { 59071 backgroundColor: core.white, 59072 backgroundColor_active: core.white, 59073 backgroundColor_hover: core.white, 59074 borderColor: core.borderLighter, 59075 color: core.grayLighter, 59076 color_active: core.grayLighter, 59077 color_hover: core.grayLighter 59078 }, 59079 59080 hoveredSpan: { 59081 backgroundColor: core.primaryShade_4, 59082 backgroundColor_active: core.primaryShade_3, 59083 backgroundColor_hover: core.primaryShade_4, 59084 borderColor: core.primaryShade_3, 59085 borderColor_active: core.primaryShade_3, 59086 borderColor_hover: core.primaryShade_3, 59087 color: core.secondary, 59088 color_active: core.secondary, 59089 color_hover: core.secondary 59090 }, 59091 59092 selectedSpan: { 59093 backgroundColor: core.primaryShade_2, 59094 backgroundColor_active: core.primaryShade_1, 59095 backgroundColor_hover: core.primaryShade_1, 59096 borderColor: core.primaryShade_1, 59097 borderColor_active: core.primary, 59098 borderColor_hover: core.primary, 59099 color: core.white, 59100 color_active: core.white, 59101 color_hover: core.white 59102 }, 59103 59104 selected: { 59105 backgroundColor: core.primary, 59106 backgroundColor_active: core.primary, 59107 backgroundColor_hover: core.primary, 59108 borderColor: core.primary, 59109 borderColor_active: core.primary, 59110 borderColor_hover: core.primary, 59111 color: core.white, 59112 color_active: core.white, 59113 color_hover: core.white 59114 }, 59115 59116 blocked_calendar: { 59117 backgroundColor: core.grayLighter, 59118 backgroundColor_active: core.grayLighter, 59119 backgroundColor_hover: core.grayLighter, 59120 borderColor: core.grayLighter, 59121 borderColor_active: core.grayLighter, 59122 borderColor_hover: core.grayLighter, 59123 color: core.grayLight, 59124 color_active: core.grayLight, 59125 color_hover: core.grayLight 59126 }, 59127 59128 blocked_out_of_range: { 59129 backgroundColor: core.white, 59130 backgroundColor_active: core.white, 59131 backgroundColor_hover: core.white, 59132 borderColor: core.borderLight, 59133 borderColor_active: core.borderLight, 59134 borderColor_hover: core.borderLight, 59135 color: core.grayLighter, 59136 color_active: core.grayLighter, 59137 color_hover: core.grayLighter 59138 } 59139 }, 59140 59141 spacing: { 59142 dayPickerHorizontalPadding: 9, 59143 captionPaddingTop: 22, 59144 captionPaddingBottom: 37, 59145 inputPadding: 0, 59146 displayTextPaddingVertical: undefined, 59147 displayTextPaddingTop: 11, 59148 displayTextPaddingBottom: 9, 59149 displayTextPaddingHorizontal: undefined, 59150 displayTextPaddingLeft: 11, 59151 displayTextPaddingRight: 11, 59152 displayTextPaddingVertical_small: undefined, 59153 displayTextPaddingTop_small: 7, 59154 displayTextPaddingBottom_small: 5, 59155 displayTextPaddingHorizontal_small: undefined, 59156 displayTextPaddingLeft_small: 7, 59157 displayTextPaddingRight_small: 7 59158 }, 59159 59160 sizing: { 59161 inputWidth: 130, 59162 inputWidth_small: 97, 59163 arrowWidth: 24 59164 }, 59165 59166 noScrollBarOnVerticalScrollable: false, 59167 59168 font: { 59169 size: 14, 59170 captionSize: 18, 59171 input: { 59172 size: 19, 59173 lineHeight: '24px', 59174 size_small: 15, 59175 lineHeight_small: '18px', 59176 letterSpacing_small: '0.2px', 59177 styleDisabled: 'italic' 59178 } 59179 } 59180 } 59181 }; 59182 59183 /***/ }), 59184 59185 /***/ "xoj2": 59186 /***/ (function(module, exports, __webpack_require__) { 59187 59188 "use strict"; 59189 59190 59191 var implementation = __webpack_require__("rQy3"); 59192 59193 module.exports = function getPolyfill() { 59194 return typeof Object.values === 'function' ? Object.values : implementation; 59195 }; 59196 59197 59198 /***/ }), 59199 59200 /***/ "y9oe": 59201 /***/ (function(module, exports, __webpack_require__) { 59202 59203 "use strict"; 59204 59205 59206 var GetIntrinsic = __webpack_require__("rZ7t"); 59207 59208 var $TypeError = GetIntrinsic('%TypeError%'); 59209 59210 var Get = __webpack_require__("3aeR"); 59211 var ToLength = __webpack_require__("w3Ut"); 59212 var Type = __webpack_require__("V1cy"); 59213 59214 // https://262.ecma-international.org/11.0/#sec-lengthofarraylike 59215 59216 module.exports = function LengthOfArrayLike(obj) { 59217 if (Type(obj) !== 'Object') { 59218 throw new $TypeError('Assertion failed: `obj` must be an Object'); 59219 } 59220 return ToLength(Get(obj, 'length')); 59221 }; 59222 59223 // TODO: use this all over 59224 59225 59226 /***/ }), 59227 59228 /***/ "yLpj": 59229 /***/ (function(module, exports) { 59230 59231 var g; 59232 59233 // This works in non-strict mode 59234 g = (function() { 59235 return this; 59236 })(); 59237 59238 try { 59239 // This works if eval is allowed (see CSP) 59240 g = g || new Function("return this")(); 59241 } catch (e) { 59242 // This works if the window reference is available 59243 if (typeof window === "object") g = window; 59244 } 59245 59246 // g can still be undefined, but nothing to do about it... 59247 // We return undefined, instead of nothing here, so it's 59248 // easier to handle this case. if(!global) { ...} 59249 59250 module.exports = g; 59251 59252 59253 /***/ }), 59254 59255 /***/ "yLpt": 59256 /***/ (function(module, exports, __webpack_require__) { 59257 59258 "use strict"; 59259 59260 59261 var implementation = __webpack_require__("FufO"); 59262 59263 var lacksProperEnumerationOrder = function () { 59264 if (!Object.assign) { 59265 return false; 59266 } 59267 /* 59268 * v8, specifically in node 4.x, has a bug with incorrect property enumeration order 59269 * note: this does not detect the bug unless there's 20 characters 59270 */ 59271 var str = 'abcdefghijklmnopqrst'; 59272 var letters = str.split(''); 59273 var map = {}; 59274 for (var i = 0; i < letters.length; ++i) { 59275 map[letters[i]] = letters[i]; 59276 } 59277 var obj = Object.assign({}, map); 59278 var actual = ''; 59279 for (var k in obj) { 59280 actual += k; 59281 } 59282 return str !== actual; 59283 }; 59284 59285 var assignHasPendingExceptions = function () { 59286 if (!Object.assign || !Object.preventExtensions) { 59287 return false; 59288 } 59289 /* 59290 * Firefox 37 still has "pending exception" logic in its Object.assign implementation, 59291 * which is 72% slower than our shim, and Firefox 40's native implementation. 59292 */ 59293 var thrower = Object.preventExtensions({ 1: 2 }); 59294 try { 59295 Object.assign(thrower, 'xy'); 59296 } catch (e) { 59297 return thrower[1] === 'y'; 59298 } 59299 return false; 59300 }; 59301 59302 module.exports = function getPolyfill() { 59303 if (!Object.assign) { 59304 return implementation; 59305 } 59306 if (lacksProperEnumerationOrder()) { 59307 return implementation; 59308 } 59309 if (assignHasPendingExceptions()) { 59310 return implementation; 59311 } 59312 return Object.assign; 59313 }; 59314 59315 59316 /***/ }), 59317 59318 /***/ "yN6O": 59319 /***/ (function(module, exports, __webpack_require__) { 59320 59321 "use strict"; 59322 59323 59324 var ArraySpeciesCreate = __webpack_require__("7Ji+"); 59325 var FlattenIntoArray = __webpack_require__("iz0l"); 59326 var Get = __webpack_require__("3aeR"); 59327 var ToInteger = __webpack_require__("ddK1"); 59328 var ToLength = __webpack_require__("w3Ut"); 59329 var ToObject = __webpack_require__("sA9S"); 59330 59331 module.exports = function flat() { 59332 var O = ToObject(this); 59333 var sourceLen = ToLength(Get(O, 'length')); 59334 59335 var depthNum = 1; 59336 if (arguments.length > 0 && typeof arguments[0] !== 'undefined') { 59337 depthNum = ToInteger(arguments[0]); 59338 } 59339 59340 var A = ArraySpeciesCreate(O, 0); 59341 FlattenIntoArray(A, O, sourceLen, 0, depthNum); 59342 return A; 59343 }; 59344 59345 59346 /***/ }), 59347 59348 /***/ "yc2e": 59349 /***/ (function(module, exports, __webpack_require__) { 59350 59351 "use strict"; 59352 59353 59354 Object.defineProperty(exports, "__esModule", { 59355 value: true 59356 }); 59357 exports['default'] = getPhrasePropTypes; 59358 59359 var _object = __webpack_require__("Koq/"); 59360 59361 var _object2 = _interopRequireDefault(_object); 59362 59363 var _propTypes = __webpack_require__("17x9"); 59364 59365 var _propTypes2 = _interopRequireDefault(_propTypes); 59366 59367 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 59368 59369 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; } 59370 59371 function getPhrasePropTypes(defaultPhrases) { 59372 return Object.keys(defaultPhrases).reduce(function (phrases, key) { 59373 return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node]))); 59374 }, {}); 59375 } 59376 59377 /***/ }), 59378 59379 /***/ "ym77": 59380 /***/ (function(module, __webpack_exports__, __webpack_require__) { 59381 59382 "use strict"; 59383 /* unused harmony export unstable_Id */ 59384 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_useId; }); 59385 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5"); 59386 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48"); 59387 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes"); 59388 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd"); 59389 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); 59390 /* harmony import */ var _IdProvider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("KCH1"); 59391 59392 59393 59394 59395 59396 59397 // Automatically generated 59398 var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"]; 59399 var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]); 59400 59401 var unstable_useId = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 59402 keys: ID_KEYS, 59403 useOptions: function useOptions(options, htmlProps) { 59404 var generateId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_IdProvider_js__WEBPACK_IMPORTED_MODULE_4__[/* unstable_IdContext */ "a"]); 59405 59406 var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(function () { 59407 // This comes from useIdState 59408 if (options.unstable_idCountRef) { 59409 options.unstable_idCountRef.current += 1; 59410 return "-" + options.unstable_idCountRef.current; 59411 } // If there's no useIdState, we check if `baseId` was passed (as a prop, 59412 // not from useIdState). 59413 59414 59415 if (options.baseId) { 59416 return "-" + generateId(""); 59417 } 59418 59419 return ""; 59420 }), 59421 suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState. 59422 // If there's neither, then it'll fallback to Context's generateId. 59423 // This generateId can result in a sequential ID (if there's a Provider) 59424 // or a random string (without Provider). 59425 59426 59427 var baseId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () { 59428 return options.baseId || generateId(); 59429 }, [options.baseId, generateId]); 59430 var id = htmlProps.id || options.id || "" + baseId + suffix; 59431 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, { 59432 id: id 59433 }); 59434 }, 59435 useProps: function useProps(options, htmlProps) { 59436 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 59437 id: options.id 59438 }, htmlProps); 59439 } 59440 }); 59441 var unstable_Id = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 59442 as: "div", 59443 useHook: unstable_useId 59444 }); 59445 59446 59447 59448 59449 /***/ }), 59450 59451 /***/ "yy3d": 59452 /***/ (function(module, exports, __webpack_require__) { 59453 59454 "use strict"; 59455 59456 59457 var GetIntrinsic = __webpack_require__("rZ7t"); 59458 59459 var $match = GetIntrinsic('%Symbol.match%', true); 59460 59461 var hasRegExpMatcher = __webpack_require__("SegQ"); 59462 59463 var ToBoolean = __webpack_require__("kvlw"); 59464 59465 // https://ecma-international.org/ecma-262/6.0/#sec-isregexp 59466 59467 module.exports = function IsRegExp(argument) { 59468 if (!argument || typeof argument !== 'object') { 59469 return false; 59470 } 59471 if ($match) { 59472 var isRegExp = argument[$match]; 59473 if (typeof isRegExp !== 'undefined') { 59474 return ToBoolean(isRegExp); 59475 } 59476 } 59477 return hasRegExpMatcher(argument); 59478 }; 59479 59480 59481 /***/ }), 59482 59483 /***/ "yyeE": 59484 /***/ (function(module, exports, __webpack_require__) { 59485 59486 "use strict"; 59487 59488 59489 var GetIntrinsic = __webpack_require__("rZ7t"); 59490 59491 var $Math = GetIntrinsic('%Math%'); 59492 var $Number = GetIntrinsic('%Number%'); 59493 59494 module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; 59495 59496 59497 /***/ }), 59498 59499 /***/ "z3X9": 59500 /***/ (function(module, exports, __webpack_require__) { 59501 59502 "use strict"; 59503 59504 59505 var has = __webpack_require__("oNNP"); 59506 59507 var assertRecord = __webpack_require__("10Kj"); 59508 59509 var Type = __webpack_require__("V1cy"); 59510 59511 // https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor 59512 59513 module.exports = function IsAccessorDescriptor(Desc) { 59514 if (typeof Desc === 'undefined') { 59515 return false; 59516 } 59517 59518 assertRecord(Type, 'Property Descriptor', 'Desc', Desc); 59519 59520 if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { 59521 return false; 59522 } 59523 59524 return true; 59525 }; 59526 59527 59528 /***/ }), 59529 59530 /***/ "z9I/": 59531 /***/ (function(module, __webpack_exports__, __webpack_require__) { 59532 59533 "use strict"; 59534 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StyleSheet; }); 59535 /* 59536 59537 Based off glamor's StyleSheet, thanks Sunil ❤️ 59538 59539 high performance StyleSheet for css-in-js systems 59540 59541 - uses multiple style tags behind the scenes for millions of rules 59542 - uses `insertRule` for appending in production for *much* faster performance 59543 59544 // usage 59545 59546 import { StyleSheet } from '@emotion/sheet' 59547 59548 let styleSheet = new StyleSheet({ key: '', container: document.head }) 59549 59550 styleSheet.insert('#box { border: 1px solid red; }') 59551 - appends a css rule into the stylesheet 59552 59553 styleSheet.flush() 59554 - empties the stylesheet of all its contents 59555 59556 */ 59557 // $FlowFixMe 59558 function sheetForTag(tag) { 59559 if (tag.sheet) { 59560 // $FlowFixMe 59561 return tag.sheet; 59562 } // this weirdness brought to you by firefox 59563 59564 /* istanbul ignore next */ 59565 59566 59567 for (var i = 0; i < document.styleSheets.length; i++) { 59568 if (document.styleSheets[i].ownerNode === tag) { 59569 // $FlowFixMe 59570 return document.styleSheets[i]; 59571 } 59572 } 59573 } 59574 59575 function createStyleElement(options) { 59576 var tag = document.createElement('style'); 59577 tag.setAttribute('data-emotion', options.key); 59578 59579 if (options.nonce !== undefined) { 59580 tag.setAttribute('nonce', options.nonce); 59581 } 59582 59583 tag.appendChild(document.createTextNode('')); 59584 return tag; 59585 } 59586 59587 var StyleSheet = 59588 /*#__PURE__*/ 59589 function () { 59590 function StyleSheet(options) { 59591 this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy; 59592 this.tags = []; 59593 this.ctr = 0; 59594 this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets 59595 59596 this.key = options.key; 59597 this.container = options.container; 59598 this.before = null; 59599 } 59600 59601 var _proto = StyleSheet.prototype; 59602 59603 _proto.insert = function insert(rule) { 59604 // the max length is how many rules we have per style tag, it's 65000 in speedy mode 59605 // it's 1 in dev because we insert source maps that map a single rule to a location 59606 // and you can only have one source map per style tag 59607 if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { 59608 var _tag = createStyleElement(this); 59609 59610 var before; 59611 59612 if (this.tags.length === 0) { 59613 before = this.before; 59614 } else { 59615 before = this.tags[this.tags.length - 1].nextSibling; 59616 } 59617 59618 this.container.insertBefore(_tag, before); 59619 this.tags.push(_tag); 59620 } 59621 59622 var tag = this.tags[this.tags.length - 1]; 59623 59624 if (this.isSpeedy) { 59625 var sheet = sheetForTag(tag); 59626 59627 try { 59628 // this is a really hot path 59629 // we check the second character first because having "i" 59630 // as the second character will happen less often than 59631 // having "@" as the first character 59632 var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers 59633 // the big drawback is that the css won't be editable in devtools 59634 59635 sheet.insertRule(rule, // we need to insert @import rules before anything else 59636 // otherwise there will be an error 59637 // technically this means that the @import rules will 59638 // _usually_(not always since there could be multiple style tags) 59639 // be the first ones in prod and generally later in dev 59640 // this shouldn't really matter in the real world though 59641 // @import is generally only used for font faces from google fonts and etc. 59642 // so while this could be technically correct then it would be slower and larger 59643 // for a tiny bit of correctness that won't matter in the real world 59644 isImportRule ? 0 : sheet.cssRules.length); 59645 } catch (e) { 59646 if (false) {} 59647 } 59648 } else { 59649 tag.appendChild(document.createTextNode(rule)); 59650 } 59651 59652 this.ctr++; 59653 }; 59654 59655 _proto.flush = function flush() { 59656 // $FlowFixMe 59657 this.tags.forEach(function (tag) { 59658 return tag.parentNode.removeChild(tag); 59659 }); 59660 this.tags = []; 59661 this.ctr = 0; 59662 }; 59663 59664 return StyleSheet; 59665 }(); 59666 59667 59668 59669 59670 /***/ }), 59671 59672 /***/ "zGFp": 59673 /***/ (function(module, __webpack_exports__, __webpack_require__) { 59674 59675 "use strict"; 59676 /* unused harmony export Role */ 59677 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useRole; }); 59678 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5"); 59679 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48"); 59680 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes"); 59681 /* harmony import */ var reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("uqqE"); 59682 59683 59684 59685 59686 59687 // Automatically generated 59688 var ROLE_KEYS = ["unstable_system"]; 59689 59690 var useRole = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 59691 name: "Role", 59692 keys: ROLE_KEYS, 59693 propsAreEqual: function propsAreEqual(prev, next) { 59694 var prevSystem = prev.unstable_system, 59695 prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["unstable_system"]); 59696 59697 var nextSystem = next.unstable_system, 59698 nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["unstable_system"]); 59699 59700 if (prevSystem !== nextSystem && !Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevSystem, nextSystem)) { 59701 return false; 59702 } 59703 59704 return Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevProps, nextProps); 59705 } 59706 }); 59707 var Role = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 59708 as: "div", 59709 useHook: useRole 59710 }); 59711 59712 59713 59714 59715 /***/ }), 59716 59717 /***/ "zN8g": 59718 /***/ (function(module, exports, __webpack_require__) { 59719 59720 "use strict"; 59721 59722 59723 Object.defineProperty(exports, "__esModule", { 59724 value: true 59725 }); 59726 59727 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; }; 59728 59729 var _object = __webpack_require__("Koq/"); 59730 59731 var _object2 = _interopRequireDefault(_object); 59732 59733 var _react = __webpack_require__("cDcd"); 59734 59735 var _react2 = _interopRequireDefault(_react); 59736 59737 var _propTypes = __webpack_require__("17x9"); 59738 59739 var _propTypes2 = _interopRequireDefault(_propTypes); 59740 59741 var _airbnbPropTypes = __webpack_require__("Hsqg"); 59742 59743 var _reactWithStyles = __webpack_require__("TG4+"); 59744 59745 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 59746 59747 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 59748 unicode: _propTypes2['default'].string.isRequired, 59749 label: _propTypes2['default'].string.isRequired, 59750 action: _propTypes2['default'].string.isRequired, 59751 block: _propTypes2['default'].bool 59752 })); 59753 59754 var defaultProps = { 59755 block: false 59756 }; 59757 59758 function KeyboardShortcutRow(_ref) { 59759 var unicode = _ref.unicode, 59760 label = _ref.label, 59761 action = _ref.action, 59762 block = _ref.block, 59763 styles = _ref.styles; 59764 59765 return _react2['default'].createElement( 59766 'li', 59767 (0, _reactWithStyles.css)(styles.KeyboardShortcutRow, block && styles.KeyboardShortcutRow__block), 59768 _react2['default'].createElement( 59769 'div', 59770 (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_keyContainer, block && styles.KeyboardShortcutRow_keyContainer__block), 59771 _react2['default'].createElement( 59772 'span', 59773 _extends({}, (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_key), { 59774 role: 'img', 59775 'aria-label': String(label) + ',' // add comma so screen readers will pause before reading action 59776 }), 59777 unicode 59778 ) 59779 ), 59780 _react2['default'].createElement( 59781 'div', 59782 (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_action), 59783 action 59784 ) 59785 ); 59786 } 59787 59788 KeyboardShortcutRow.propTypes = propTypes; 59789 KeyboardShortcutRow.defaultProps = defaultProps; 59790 59791 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) { 59792 var color = _ref2.reactDates.color; 59793 return { 59794 KeyboardShortcutRow: { 59795 listStyle: 'none', 59796 margin: '6px 0' 59797 }, 59798 59799 KeyboardShortcutRow__block: { 59800 marginBottom: 16 59801 }, 59802 59803 KeyboardShortcutRow_keyContainer: { 59804 display: 'inline-block', 59805 whiteSpace: 'nowrap', 59806 textAlign: 'right', 59807 marginRight: 6 59808 }, 59809 59810 KeyboardShortcutRow_keyContainer__block: { 59811 textAlign: 'left', 59812 display: 'inline' 59813 }, 59814 59815 KeyboardShortcutRow_key: { 59816 fontFamily: 'monospace', 59817 fontSize: 12, 59818 textTransform: 'uppercase', 59819 background: color.core.grayLightest, 59820 padding: '2px 6px' 59821 }, 59822 59823 KeyboardShortcutRow_action: { 59824 display: 'inline', 59825 wordBreak: 'break-word', 59826 marginLeft: 8 59827 } 59828 }; 59829 })(KeyboardShortcutRow); 59830 59831 /***/ }), 59832 59833 /***/ "zTEx": 59834 /***/ (function(module, __webpack_exports__, __webpack_require__) { 59835 59836 "use strict"; 59837 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarItem; }); 59838 /* unused harmony export useToolbarItem */ 59839 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("hE48"); 59840 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("qdes"); 59841 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("cDcd"); 59842 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); 59843 /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("KA1K"); 59844 /* harmony import */ var _Composite_CompositeItem_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("kTC8"); 59845 /* harmony import */ var _keys_ae468c11_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("mjVI"); 59846 59847 59848 59849 59850 59851 59852 59853 59854 59855 59856 59857 59858 59859 59860 59861 59862 59863 59864 59865 59866 59867 59868 59869 59870 59871 59872 59873 59874 59875 59876 59877 var useToolbarItem = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_1__[/* createHook */ "a"])({ 59878 name: "ToolbarItem", 59879 compose: _Composite_CompositeItem_js__WEBPACK_IMPORTED_MODULE_4__[/* useCompositeItem */ "b"], 59880 keys: _keys_ae468c11_js__WEBPACK_IMPORTED_MODULE_5__[/* a */ "b"] 59881 }); 59882 var ToolbarItem = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_0__[/* createComponent */ "a"])({ 59883 as: "button", 59884 memo: true, 59885 useHook: useToolbarItem 59886 }); 59887 59888 59889 59890 59891 /***/ }), 59892 59893 /***/ "zYbv": 59894 /***/ (function(module, exports, __webpack_require__) { 59895 59896 "use strict"; 59897 59898 59899 var assertRecord = __webpack_require__("10Kj"); 59900 59901 var Type = __webpack_require__("V1cy"); 59902 59903 // https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor 59904 59905 module.exports = function FromPropertyDescriptor(Desc) { 59906 if (typeof Desc === 'undefined') { 59907 return Desc; 59908 } 59909 59910 assertRecord(Type, 'Property Descriptor', 'Desc', Desc); 59911 59912 var obj = {}; 59913 if ('[[Value]]' in Desc) { 59914 obj.value = Desc['[[Value]]']; 59915 } 59916 if ('[[Writable]]' in Desc) { 59917 obj.writable = Desc['[[Writable]]']; 59918 } 59919 if ('[[Get]]' in Desc) { 59920 obj.get = Desc['[[Get]]']; 59921 } 59922 if ('[[Set]]' in Desc) { 59923 obj.set = Desc['[[Set]]']; 59924 } 59925 if ('[[Enumerable]]' in Desc) { 59926 obj.enumerable = Desc['[[Enumerable]]']; 59927 } 59928 if ('[[Configurable]]' in Desc) { 59929 obj.configurable = Desc['[[Configurable]]']; 59930 } 59931 return obj; 59932 }; 59933 59934 59935 /***/ }), 59936 59937 /***/ "zfJ5": 59938 /***/ (function(module, exports, __webpack_require__) { 59939 59940 "use strict"; 59941 59942 59943 Object.defineProperty(exports, "__esModule", { 59944 value: true 59945 }); 59946 59947 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; }; 59948 59949 var _object = __webpack_require__("Koq/"); 59950 59951 var _object2 = _interopRequireDefault(_object); 59952 59953 var _react = __webpack_require__("cDcd"); 59954 59955 var _react2 = _interopRequireDefault(_react); 59956 59957 var _propTypes = __webpack_require__("17x9"); 59958 59959 var _propTypes2 = _interopRequireDefault(_propTypes); 59960 59961 var _airbnbPropTypes = __webpack_require__("Hsqg"); 59962 59963 var _reactWithStyles = __webpack_require__("TG4+"); 59964 59965 var _defaultPhrases = __webpack_require__("vV+G"); 59966 59967 var _getPhrasePropTypes = __webpack_require__("yc2e"); 59968 59969 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 59970 59971 var _LeftArrow = __webpack_require__("0XP8"); 59972 59973 var _LeftArrow2 = _interopRequireDefault(_LeftArrow); 59974 59975 var _RightArrow = __webpack_require__("gZI3"); 59976 59977 var _RightArrow2 = _interopRequireDefault(_RightArrow); 59978 59979 var _ChevronUp = __webpack_require__("9gmn"); 59980 59981 var _ChevronUp2 = _interopRequireDefault(_ChevronUp); 59982 59983 var _ChevronDown = __webpack_require__("DHWS"); 59984 59985 var _ChevronDown2 = _interopRequireDefault(_ChevronDown); 59986 59987 var _ScrollableOrientationShape = __webpack_require__("aE6U"); 59988 59989 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 59990 59991 var _constants = __webpack_require__("Fv1B"); 59992 59993 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 59994 59995 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); } } 59996 59997 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 59998 navPrev: _propTypes2['default'].node, 59999 navNext: _propTypes2['default'].node, 60000 orientation: _ScrollableOrientationShape2['default'], 60001 60002 onPrevMonthClick: _propTypes2['default'].func, 60003 onNextMonthClick: _propTypes2['default'].func, 60004 60005 // internationalization 60006 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerNavigationPhrases)), 60007 60008 isRTL: _propTypes2['default'].bool 60009 })); 60010 60011 var defaultProps = { 60012 navPrev: null, 60013 navNext: null, 60014 orientation: _constants.HORIZONTAL_ORIENTATION, 60015 60016 onPrevMonthClick: function () { 60017 function onPrevMonthClick() {} 60018 60019 return onPrevMonthClick; 60020 }(), 60021 onNextMonthClick: function () { 60022 function onNextMonthClick() {} 60023 60024 return onNextMonthClick; 60025 }(), 60026 60027 60028 // internationalization 60029 phrases: _defaultPhrases.DayPickerNavigationPhrases, 60030 isRTL: false 60031 }; 60032 60033 function DayPickerNavigation(_ref) { 60034 var navPrev = _ref.navPrev, 60035 navNext = _ref.navNext, 60036 onPrevMonthClick = _ref.onPrevMonthClick, 60037 onNextMonthClick = _ref.onNextMonthClick, 60038 orientation = _ref.orientation, 60039 phrases = _ref.phrases, 60040 isRTL = _ref.isRTL, 60041 styles = _ref.styles; 60042 60043 var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION; 60044 var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION; 60045 var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 60046 60047 var navPrevIcon = navPrev; 60048 var navNextIcon = navNext; 60049 var isDefaultNavPrev = false; 60050 var isDefaultNavNext = false; 60051 if (!navPrevIcon) { 60052 isDefaultNavPrev = true; 60053 var Icon = isVertical ? _ChevronUp2['default'] : _LeftArrow2['default']; 60054 if (isRTL && !isVertical) { 60055 Icon = _RightArrow2['default']; 60056 } 60057 navPrevIcon = _react2['default'].createElement(Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical)); 60058 } 60059 60060 if (!navNextIcon) { 60061 isDefaultNavNext = true; 60062 var _Icon = isVertical ? _ChevronDown2['default'] : _RightArrow2['default']; 60063 if (isRTL && !isVertical) { 60064 _Icon = _LeftArrow2['default']; 60065 } 60066 navNextIcon = _react2['default'].createElement(_Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical)); 60067 } 60068 60069 var isDefaultNav = isVerticalScrollable ? isDefaultNavNext : isDefaultNavNext || isDefaultNavPrev; 60070 60071 return _react2['default'].createElement( 60072 'div', 60073 _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat(_toConsumableArray(isVertical && [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault]), _toConsumableArray(isVerticalScrollable && [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault]))), 60074 !isVerticalScrollable && _react2['default'].createElement( 60075 'div', 60076 _extends({ 60077 role: 'button', 60078 tabIndex: '0' 60079 }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault]))))), { 60080 'aria-label': phrases.jumpToPrevMonth, 60081 onClick: onPrevMonthClick, 60082 onKeyUp: function () { 60083 function onKeyUp(e) { 60084 var key = e.key; 60085 60086 if (key === 'Enter' || key === ' ') onPrevMonthClick(e); 60087 } 60088 60089 return onKeyUp; 60090 }(), 60091 onMouseUp: function () { 60092 function onMouseUp(e) { 60093 e.currentTarget.blur(); 60094 } 60095 60096 return onMouseUp; 60097 }() 60098 }), 60099 navPrevIcon 60100 ), 60101 _react2['default'].createElement( 60102 'div', 60103 _extends({ 60104 role: 'button', 60105 tabIndex: '0' 60106 }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical, styles.DayPickerNavigation_nextButton__vertical].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault]))))), { 60107 'aria-label': phrases.jumpToNextMonth, 60108 onClick: onNextMonthClick, 60109 onKeyUp: function () { 60110 function onKeyUp(e) { 60111 var key = e.key; 60112 60113 if (key === 'Enter' || key === ' ') onNextMonthClick(e); 60114 } 60115 60116 return onKeyUp; 60117 }(), 60118 onMouseUp: function () { 60119 function onMouseUp(e) { 60120 e.currentTarget.blur(); 60121 } 60122 60123 return onMouseUp; 60124 }() 60125 }), 60126 navNextIcon 60127 ) 60128 ); 60129 } 60130 60131 DayPickerNavigation.propTypes = propTypes; 60132 DayPickerNavigation.defaultProps = defaultProps; 60133 60134 exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) { 60135 var _ref2$reactDates = _ref2.reactDates, 60136 color = _ref2$reactDates.color, 60137 zIndex = _ref2$reactDates.zIndex; 60138 return { 60139 DayPickerNavigation: { 60140 position: 'relative', 60141 zIndex: zIndex + 2 60142 }, 60143 60144 DayPickerNavigation__horizontal: { 60145 height: 0 60146 }, 60147 60148 DayPickerNavigation__vertical: {}, 60149 DayPickerNavigation__verticalScrollable: {}, 60150 60151 DayPickerNavigation__verticalDefault: { 60152 position: 'absolute', 60153 width: '100%', 60154 height: 52, 60155 bottom: 0, 60156 left: 0 60157 }, 60158 60159 DayPickerNavigation__verticalScrollableDefault: { 60160 position: 'relative' 60161 }, 60162 60163 DayPickerNavigation_button: { 60164 cursor: 'pointer', 60165 userSelect: 'none', 60166 border: 0, 60167 padding: 0, 60168 margin: 0 60169 }, 60170 60171 DayPickerNavigation_button__default: { 60172 border: '1px solid ' + String(color.core.borderLight), 60173 backgroundColor: color.background, 60174 color: color.placeholderText, 60175 60176 ':focus': { 60177 border: '1px solid ' + String(color.core.borderMedium) 60178 }, 60179 60180 ':hover': { 60181 border: '1px solid ' + String(color.core.borderMedium) 60182 }, 60183 60184 ':active': { 60185 background: color.backgroundDark 60186 } 60187 }, 60188 60189 DayPickerNavigation_button__horizontal: {}, 60190 60191 DayPickerNavigation_button__horizontalDefault: { 60192 position: 'absolute', 60193 top: 18, 60194 lineHeight: 0.78, 60195 borderRadius: 3, 60196 padding: '6px 9px' 60197 }, 60198 60199 DayPickerNavigation_leftButton__horizontalDefault: { 60200 left: 22 60201 }, 60202 60203 DayPickerNavigation_rightButton__horizontalDefault: { 60204 right: 22 60205 }, 60206 60207 DayPickerNavigation_button__vertical: {}, 60208 60209 DayPickerNavigation_button__verticalDefault: { 60210 padding: 5, 60211 background: color.background, 60212 boxShadow: '0 0 5px 2px rgba(0, 0, 0, 0.1)', 60213 position: 'relative', 60214 display: 'inline-block', 60215 height: '100%', 60216 width: '50%' 60217 }, 60218 60219 DayPickerNavigation_prevButton__verticalDefault: {}, 60220 60221 DayPickerNavigation_nextButton__verticalDefault: { 60222 borderLeft: 0 60223 }, 60224 60225 DayPickerNavigation_nextButton__verticalScrollableDefault: { 60226 width: '100%' 60227 }, 60228 60229 DayPickerNavigation_svg__horizontal: { 60230 height: 19, 60231 width: 19, 60232 fill: color.core.grayLight, 60233 display: 'block' 60234 }, 60235 60236 DayPickerNavigation_svg__vertical: { 60237 height: 42, 60238 width: 42, 60239 fill: color.text, 60240 display: 'block' 60241 } 60242 }; 60243 })(DayPickerNavigation); 60244 60245 /***/ }), 60246 60247 /***/ "zt9T": 60248 /***/ (function(module, exports, __webpack_require__) { 60249 60250 "use strict"; 60251 60252 60253 var util = __webpack_require__("jB5C"); 60254 60255 function scrollIntoView(elem, container, config) { 60256 config = config || {}; 60257 // document 归一化到 window 60258 if (container.nodeType === 9) { 60259 container = util.getWindow(container); 60260 } 60261 60262 var allowHorizontalScroll = config.allowHorizontalScroll; 60263 var onlyScrollIfNeeded = config.onlyScrollIfNeeded; 60264 var alignWithTop = config.alignWithTop; 60265 var alignWithLeft = config.alignWithLeft; 60266 var offsetTop = config.offsetTop || 0; 60267 var offsetLeft = config.offsetLeft || 0; 60268 var offsetBottom = config.offsetBottom || 0; 60269 var offsetRight = config.offsetRight || 0; 60270 60271 allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; 60272 60273 var isWin = util.isWindow(container); 60274 var elemOffset = util.offset(elem); 60275 var eh = util.outerHeight(elem); 60276 var ew = util.outerWidth(elem); 60277 var containerOffset = undefined; 60278 var ch = undefined; 60279 var cw = undefined; 60280 var containerScroll = undefined; 60281 var diffTop = undefined; 60282 var diffBottom = undefined; 60283 var win = undefined; 60284 var winScroll = undefined; 60285 var ww = undefined; 60286 var wh = undefined; 60287 60288 if (isWin) { 60289 win = container; 60290 wh = util.height(win); 60291 ww = util.width(win); 60292 winScroll = { 60293 left: util.scrollLeft(win), 60294 top: util.scrollTop(win) 60295 }; 60296 // elem 相对 container 可视视窗的距离 60297 diffTop = { 60298 left: elemOffset.left - winScroll.left - offsetLeft, 60299 top: elemOffset.top - winScroll.top - offsetTop 60300 }; 60301 diffBottom = { 60302 left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, 60303 top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom 60304 }; 60305 containerScroll = winScroll; 60306 } else { 60307 containerOffset = util.offset(container); 60308 ch = container.clientHeight; 60309 cw = container.clientWidth; 60310 containerScroll = { 60311 left: container.scrollLeft, 60312 top: container.scrollTop 60313 }; 60314 // elem 相对 container 可视视窗的距离 60315 // 注意边框, offset 是边框到根节点 60316 diffTop = { 60317 left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, 60318 top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop 60319 }; 60320 diffBottom = { 60321 left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, 60322 top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom 60323 }; 60324 } 60325 60326 if (diffTop.top < 0 || diffBottom.top > 0) { 60327 // 强制向上 60328 if (alignWithTop === true) { 60329 util.scrollTop(container, containerScroll.top + diffTop.top); 60330 } else if (alignWithTop === false) { 60331 util.scrollTop(container, containerScroll.top + diffBottom.top); 60332 } else { 60333 // 自动调整 60334 if (diffTop.top < 0) { 60335 util.scrollTop(container, containerScroll.top + diffTop.top); 60336 } else { 60337 util.scrollTop(container, containerScroll.top + diffBottom.top); 60338 } 60339 } 60340 } else { 60341 if (!onlyScrollIfNeeded) { 60342 alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; 60343 if (alignWithTop) { 60344 util.scrollTop(container, containerScroll.top + diffTop.top); 60345 } else { 60346 util.scrollTop(container, containerScroll.top + diffBottom.top); 60347 } 60348 } 60349 } 60350 60351 if (allowHorizontalScroll) { 60352 if (diffTop.left < 0 || diffBottom.left > 0) { 60353 // 强制向上 60354 if (alignWithLeft === true) { 60355 util.scrollLeft(container, containerScroll.left + diffTop.left); 60356 } else if (alignWithLeft === false) { 60357 util.scrollLeft(container, containerScroll.left + diffBottom.left); 60358 } else { 60359 // 自动调整 60360 if (diffTop.left < 0) { 60361 util.scrollLeft(container, containerScroll.left + diffTop.left); 60362 } else { 60363 util.scrollLeft(container, containerScroll.left + diffBottom.left); 60364 } 60365 } 60366 } else { 60367 if (!onlyScrollIfNeeded) { 60368 alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; 60369 if (alignWithLeft) { 60370 util.scrollLeft(container, containerScroll.left + diffTop.left); 60371 } else { 60372 util.scrollLeft(container, containerScroll.left + diffBottom.left); 60373 } 60374 } 60375 } 60376 } 60377 } 60378 60379 module.exports = scrollIntoView; 60380 60381 /***/ }) 60382 60383 /******/ });