[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
1 this["wp"] = this["wp"] || {}; this["wp"]["blockLibrary"] = 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 = 455); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ({ 89 90 /***/ 0: 91 /***/ (function(module, exports) { 92 93 (function() { module.exports = window["wp"]["element"]; }()); 94 95 /***/ }), 96 97 /***/ 1: 98 /***/ (function(module, exports) { 99 100 (function() { module.exports = window["wp"]["i18n"]; }()); 101 102 /***/ }), 103 104 /***/ 10: 105 /***/ (function(module, exports, __webpack_require__) { 106 107 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 108 Copyright (c) 2017 Jed Watson. 109 Licensed under the MIT License (MIT), see 110 http://jedwatson.github.io/classnames 111 */ 112 /* global define */ 113 114 (function () { 115 'use strict'; 116 117 var hasOwn = {}.hasOwnProperty; 118 119 function classNames () { 120 var classes = []; 121 122 for (var i = 0; i < arguments.length; i++) { 123 var arg = arguments[i]; 124 if (!arg) continue; 125 126 var argType = typeof arg; 127 128 if (argType === 'string' || argType === 'number') { 129 classes.push(arg); 130 } else if (Array.isArray(arg) && arg.length) { 131 var inner = classNames.apply(null, arg); 132 if (inner) { 133 classes.push(inner); 134 } 135 } else if (argType === 'object') { 136 for (var key in arg) { 137 if (hasOwn.call(arg, key) && arg[key]) { 138 classes.push(key); 139 } 140 } 141 } 142 } 143 144 return classes.join(' '); 145 } 146 147 if ( true && module.exports) { 148 classNames.default = classNames; 149 module.exports = classNames; 150 } else if (true) { 151 // register as 'classnames', consistent with npm package name 152 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 153 return classNames; 154 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 155 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 156 } else {} 157 }()); 158 159 160 /***/ }), 161 162 /***/ 11: 163 /***/ (function(module, __webpack_exports__, __webpack_require__) { 164 165 "use strict"; 166 167 // EXPORTS 168 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); 169 170 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js 171 var arrayWithHoles = __webpack_require__(38); 172 173 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js 174 function _iterableToArrayLimit(arr, i) { 175 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 176 var _arr = []; 177 var _n = true; 178 var _d = false; 179 var _e = undefined; 180 181 try { 182 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 183 _arr.push(_s.value); 184 185 if (i && _arr.length === i) break; 186 } 187 } catch (err) { 188 _d = true; 189 _e = err; 190 } finally { 191 try { 192 if (!_n && _i["return"] != null) _i["return"](); 193 } finally { 194 if (_d) throw _e; 195 } 196 } 197 198 return _arr; 199 } 200 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 201 var unsupportedIterableToArray = __webpack_require__(31); 202 203 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js 204 var nonIterableRest = __webpack_require__(39); 205 206 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js 207 208 209 210 211 function _slicedToArray(arr, i) { 212 return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); 213 } 214 215 /***/ }), 216 217 /***/ 114: 218 /***/ (function(module, exports) { 219 220 (function() { module.exports = window["wp"]["viewport"]; }()); 221 222 /***/ }), 223 224 /***/ 115: 225 /***/ (function(module, exports) { 226 227 (function() { module.exports = window["wp"]["autop"]; }()); 228 229 /***/ }), 230 231 /***/ 117: 232 /***/ (function(module, exports, __webpack_require__) { 233 234 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 235 Copyright (c) 2017 Jed Watson. 236 Licensed under the MIT License (MIT), see 237 http://jedwatson.github.io/classnames 238 */ 239 /* global define */ 240 241 (function () { 242 'use strict'; 243 244 var classNames = (function () { 245 // don't inherit from Object so we can skip hasOwnProperty check later 246 // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232 247 function StorageObject() {} 248 StorageObject.prototype = Object.create(null); 249 250 function _parseArray (resultSet, array) { 251 var length = array.length; 252 253 for (var i = 0; i < length; ++i) { 254 _parse(resultSet, array[i]); 255 } 256 } 257 258 var hasOwn = {}.hasOwnProperty; 259 260 function _parseNumber (resultSet, num) { 261 resultSet[num] = true; 262 } 263 264 function _parseObject (resultSet, object) { 265 for (var k in object) { 266 if (hasOwn.call(object, k)) { 267 // set value to false instead of deleting it to avoid changing object structure 268 // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions 269 resultSet[k] = !!object[k]; 270 } 271 } 272 } 273 274 var SPACE = /\s+/; 275 function _parseString (resultSet, str) { 276 var array = str.split(SPACE); 277 var length = array.length; 278 279 for (var i = 0; i < length; ++i) { 280 resultSet[array[i]] = true; 281 } 282 } 283 284 function _parse (resultSet, arg) { 285 if (!arg) return; 286 var argType = typeof arg; 287 288 // 'foo bar' 289 if (argType === 'string') { 290 _parseString(resultSet, arg); 291 292 // ['foo', 'bar', ...] 293 } else if (Array.isArray(arg)) { 294 _parseArray(resultSet, arg); 295 296 // { 'foo': true, ... } 297 } else if (argType === 'object') { 298 _parseObject(resultSet, arg); 299 300 // '130' 301 } else if (argType === 'number') { 302 _parseNumber(resultSet, arg); 303 } 304 } 305 306 function _classNames () { 307 // don't leak arguments 308 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments 309 var len = arguments.length; 310 var args = Array(len); 311 for (var i = 0; i < len; i++) { 312 args[i] = arguments[i]; 313 } 314 315 var classSet = new StorageObject(); 316 _parseArray(classSet, args); 317 318 var list = []; 319 320 for (var k in classSet) { 321 if (classSet[k]) { 322 list.push(k) 323 } 324 } 325 326 return list.join(' '); 327 } 328 329 return _classNames; 330 })(); 331 332 if ( true && module.exports) { 333 classNames.default = classNames; 334 module.exports = classNames; 335 } else if (true) { 336 // register as 'classnames', consistent with npm package name 337 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 338 return classNames; 339 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 340 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 341 } else {} 342 }()); 343 344 345 /***/ }), 346 347 /***/ 12: 348 /***/ (function(module, exports) { 349 350 (function() { module.exports = window["wp"]["compose"]; }()); 351 352 /***/ }), 353 354 /***/ 13: 355 /***/ (function(module, __webpack_exports__, __webpack_require__) { 356 357 "use strict"; 358 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); 359 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44); 360 361 function _objectWithoutProperties(source, excluded) { 362 if (source == null) return {}; 363 var target = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); 364 var key, i; 365 366 if (Object.getOwnPropertySymbols) { 367 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 368 369 for (i = 0; i < sourceSymbolKeys.length; i++) { 370 key = sourceSymbolKeys[i]; 371 if (excluded.indexOf(key) >= 0) continue; 372 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 373 target[key] = source[key]; 374 } 375 } 376 377 return target; 378 } 379 380 /***/ }), 381 382 /***/ 138: 383 /***/ (function(module, __webpack_exports__, __webpack_require__) { 384 385 "use strict"; 386 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); 387 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); 388 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); 389 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 390 391 392 393 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; } 394 395 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 396 397 /** 398 * WordPress dependencies 399 */ 400 401 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 402 403 /** 404 * Return an SVG icon. 405 * 406 * @param {IconProps} props icon is the SVG component to render 407 * size is a number specifiying the icon size in pixels 408 * Other props will be passed to wrapped SVG component 409 * 410 * @return {JSX.Element} Icon component 411 */ 412 413 function Icon(_ref) { 414 var icon = _ref.icon, 415 _ref$size = _ref.size, 416 size = _ref$size === void 0 ? 24 : _ref$size, 417 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]); 418 419 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({ 420 width: size, 421 height: size 422 }, props)); 423 } 424 425 /* harmony default export */ __webpack_exports__["a"] = (Icon); 426 427 428 /***/ }), 429 430 /***/ 14: 431 /***/ (function(module, exports) { 432 433 (function() { module.exports = window["React"]; }()); 434 435 /***/ }), 436 437 /***/ 146: 438 /***/ (function(module, exports) { 439 440 (function() { module.exports = window["wp"]["reusableBlocks"]; }()); 441 442 /***/ }), 443 444 /***/ 15: 445 /***/ (function(module, __webpack_exports__, __webpack_require__) { 446 447 "use strict"; 448 449 // EXPORTS 450 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); 451 452 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js 453 var arrayLikeToArray = __webpack_require__(24); 454 455 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js 456 457 function _arrayWithoutHoles(arr) { 458 if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); 459 } 460 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js 461 var iterableToArray = __webpack_require__(37); 462 463 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 464 var unsupportedIterableToArray = __webpack_require__(31); 465 466 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js 467 function _nonIterableSpread() { 468 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 469 } 470 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js 471 472 473 474 475 function _toConsumableArray(arr) { 476 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); 477 } 478 479 /***/ }), 480 481 /***/ 159: 482 /***/ (function(module, __webpack_exports__, __webpack_require__) { 483 484 "use strict"; 485 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 486 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 487 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 488 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 489 490 491 /** 492 * WordPress dependencies 493 */ 494 495 var closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 496 xmlns: "http://www.w3.org/2000/svg", 497 viewBox: "0 0 24 24" 498 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 499 d: "M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z" 500 })); 501 /* harmony default export */ __webpack_exports__["a"] = (closeSmall); 502 503 504 /***/ }), 505 506 /***/ 161: 507 /***/ (function(module, __webpack_exports__, __webpack_require__) { 508 509 "use strict"; 510 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 511 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 512 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 513 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 514 515 516 /** 517 * WordPress dependencies 518 */ 519 520 var check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 521 xmlns: "http://www.w3.org/2000/svg", 522 viewBox: "0 0 24 24" 523 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 524 d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z" 525 })); 526 /* harmony default export */ __webpack_exports__["a"] = (check); 527 528 529 /***/ }), 530 531 /***/ 17: 532 /***/ (function(module, exports) { 533 534 (function() { module.exports = window["wp"]["keycodes"]; }()); 535 536 /***/ }), 537 538 /***/ 18: 539 /***/ (function(module, __webpack_exports__, __webpack_require__) { 540 541 "use strict"; 542 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); 543 function _assertThisInitialized(self) { 544 if (self === void 0) { 545 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 546 } 547 548 return self; 549 } 550 551 /***/ }), 552 553 /***/ 19: 554 /***/ (function(module, __webpack_exports__, __webpack_require__) { 555 556 "use strict"; 557 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); 558 function _getPrototypeOf(o) { 559 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 560 return o.__proto__ || Object.getPrototypeOf(o); 561 }; 562 return _getPrototypeOf(o); 563 } 564 565 /***/ }), 566 567 /***/ 192: 568 /***/ (function(module, __webpack_exports__, __webpack_require__) { 569 570 "use strict"; 571 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 572 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 573 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 574 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 575 576 577 /** 578 * WordPress dependencies 579 */ 580 581 var link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 582 xmlns: "http://www.w3.org/2000/svg", 583 viewBox: "0 0 24 24" 584 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 585 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" 586 })); 587 /* harmony default export */ __webpack_exports__["a"] = (link); 588 589 590 /***/ }), 591 592 /***/ 2: 593 /***/ (function(module, exports) { 594 595 (function() { module.exports = window["lodash"]; }()); 596 597 /***/ }), 598 599 /***/ 21: 600 /***/ (function(module, exports) { 601 602 (function() { module.exports = window["wp"]["richText"]; }()); 603 604 /***/ }), 605 606 /***/ 217: 607 /***/ (function(module, __webpack_exports__, __webpack_require__) { 608 609 "use strict"; 610 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 611 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 612 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 613 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 614 615 616 /** 617 * WordPress dependencies 618 */ 619 620 var search = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 621 xmlns: "http://www.w3.org/2000/svg", 622 viewBox: "0 0 24 24" 623 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 624 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" 625 })); 626 /* harmony default export */ __webpack_exports__["a"] = (search); 627 628 629 /***/ }), 630 631 /***/ 218: 632 /***/ (function(module, __webpack_exports__, __webpack_require__) { 633 634 "use strict"; 635 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 636 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 637 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 638 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 639 640 641 /** 642 * WordPress dependencies 643 */ 644 645 var chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 646 xmlns: "http://www.w3.org/2000/svg", 647 viewBox: "0 0 24 24" 648 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 649 d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" 650 })); 651 /* harmony default export */ __webpack_exports__["a"] = (chevronRight); 652 653 654 /***/ }), 655 656 /***/ 219: 657 /***/ (function(module, __webpack_exports__, __webpack_require__) { 658 659 "use strict"; 660 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 661 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 662 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 663 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 664 665 666 /** 667 * WordPress dependencies 668 */ 669 670 var chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 671 xmlns: "http://www.w3.org/2000/svg", 672 viewBox: "0 0 24 24" 673 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 674 d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" 675 })); 676 /* harmony default export */ __webpack_exports__["a"] = (chevronLeft); 677 678 679 /***/ }), 680 681 /***/ 220: 682 /***/ (function(module, __webpack_exports__, __webpack_require__) { 683 684 "use strict"; 685 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 686 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 687 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 688 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 689 690 691 /** 692 * WordPress dependencies 693 */ 694 695 var keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 696 xmlns: "http://www.w3.org/2000/svg", 697 viewBox: "-2 -2 24 24" 698 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 699 d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z" 700 })); 701 /* harmony default export */ __webpack_exports__["a"] = (keyboardReturn); 702 703 704 /***/ }), 705 706 /***/ 221: 707 /***/ (function(module, __webpack_exports__, __webpack_require__) { 708 709 "use strict"; 710 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 711 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 712 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 713 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 714 715 716 /** 717 * WordPress dependencies 718 */ 719 720 var upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 721 xmlns: "http://www.w3.org/2000/svg", 722 viewBox: "0 0 24 24" 723 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 724 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" 725 })); 726 /* harmony default export */ __webpack_exports__["a"] = (upload); 727 728 729 /***/ }), 730 731 /***/ 222: 732 /***/ (function(module, __webpack_exports__, __webpack_require__) { 733 734 "use strict"; 735 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 736 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 737 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 738 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 739 740 741 /** 742 * WordPress dependencies 743 */ 744 745 var textColor = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 746 xmlns: "http://www.w3.org/2000/svg", 747 viewBox: "-2 -2 24 24" 748 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 749 d: "M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z" 750 })); 751 /* harmony default export */ __webpack_exports__["a"] = (textColor); 752 753 754 /***/ }), 755 756 /***/ 223: 757 /***/ (function(module, __webpack_exports__, __webpack_require__) { 758 759 "use strict"; 760 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 761 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 762 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 763 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 764 765 766 /** 767 * WordPress dependencies 768 */ 769 770 var linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 771 xmlns: "http://www.w3.org/2000/svg", 772 viewBox: "0 0 24 24" 773 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 774 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" 775 })); 776 /* harmony default export */ __webpack_exports__["a"] = (linkOff); 777 778 779 /***/ }), 780 781 /***/ 24: 782 /***/ (function(module, __webpack_exports__, __webpack_require__) { 783 784 "use strict"; 785 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); 786 function _arrayLikeToArray(arr, len) { 787 if (len == null || len > arr.length) len = arr.length; 788 789 for (var i = 0, arr2 = new Array(len); i < len; i++) { 790 arr2[i] = arr[i]; 791 } 792 793 return arr2; 794 } 795 796 /***/ }), 797 798 /***/ 25: 799 /***/ (function(module, __webpack_exports__, __webpack_require__) { 800 801 "use strict"; 802 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); 803 function _classCallCheck(instance, Constructor) { 804 if (!(instance instanceof Constructor)) { 805 throw new TypeError("Cannot call a class as a function"); 806 } 807 } 808 809 /***/ }), 810 811 /***/ 26: 812 /***/ (function(module, __webpack_exports__, __webpack_require__) { 813 814 "use strict"; 815 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); 816 function _defineProperties(target, props) { 817 for (var i = 0; i < props.length; i++) { 818 var descriptor = props[i]; 819 descriptor.enumerable = descriptor.enumerable || false; 820 descriptor.configurable = true; 821 if ("value" in descriptor) descriptor.writable = true; 822 Object.defineProperty(target, descriptor.key, descriptor); 823 } 824 } 825 826 function _createClass(Constructor, protoProps, staticProps) { 827 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 828 if (staticProps) _defineProperties(Constructor, staticProps); 829 return Constructor; 830 } 831 832 /***/ }), 833 834 /***/ 276: 835 /***/ (function(module, __webpack_exports__, __webpack_require__) { 836 837 "use strict"; 838 839 // EXTERNAL MODULE: external ["wp","element"] 840 var external_wp_element_ = __webpack_require__(0); 841 842 // EXTERNAL MODULE: external ["wp","primitives"] 843 var external_wp_primitives_ = __webpack_require__(7); 844 845 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js 846 847 848 /** 849 * WordPress dependencies 850 */ 851 852 var pencil = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 853 xmlns: "http://www.w3.org/2000/svg", 854 viewBox: "0 0 24 24" 855 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 856 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" 857 })); 858 /* harmony default export */ var library_pencil = (pencil); 859 860 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js 861 /** 862 * Internal dependencies 863 */ 864 865 /* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil); 866 867 868 /***/ }), 869 870 /***/ 28: 871 /***/ (function(module, __webpack_exports__, __webpack_require__) { 872 873 "use strict"; 874 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; }); 875 /* harmony import */ var _babel_runtime_helpers_esm_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52); 876 877 function _inherits(subClass, superClass) { 878 if (typeof superClass !== "function" && superClass !== null) { 879 throw new TypeError("Super expression must either be null or a function"); 880 } 881 882 subClass.prototype = Object.create(superClass && superClass.prototype, { 883 constructor: { 884 value: subClass, 885 writable: true, 886 configurable: true 887 } 888 }); 889 if (superClass) Object(_babel_runtime_helpers_esm_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(subClass, superClass); 890 } 891 892 /***/ }), 893 894 /***/ 282: 895 /***/ (function(module, exports, __webpack_require__) { 896 897 module.exports = __webpack_require__(315); 898 899 900 /***/ }), 901 902 /***/ 283: 903 /***/ (function(module, exports, __webpack_require__) { 904 905 /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */ 906 (function (global, factory) { 907 true ? module.exports = factory() : 908 undefined; 909 }(this, (function () { 'use strict'; 910 911 function _classCallCheck(instance, Constructor) { 912 if (!(instance instanceof Constructor)) { 913 throw new TypeError("Cannot call a class as a function"); 914 } 915 } 916 917 function _defineProperties(target, props) { 918 for (var i = 0; i < props.length; i++) { 919 var descriptor = props[i]; 920 descriptor.enumerable = descriptor.enumerable || false; 921 descriptor.configurable = true; 922 if ("value" in descriptor) descriptor.writable = true; 923 Object.defineProperty(target, descriptor.key, descriptor); 924 } 925 } 926 927 function _createClass(Constructor, protoProps, staticProps) { 928 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 929 if (staticProps) _defineProperties(Constructor, staticProps); 930 return Constructor; 931 } 932 933 function _slicedToArray(arr, i) { 934 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); 935 } 936 937 function _arrayWithHoles(arr) { 938 if (Array.isArray(arr)) return arr; 939 } 940 941 function _iterableToArrayLimit(arr, i) { 942 var _arr = []; 943 var _n = true; 944 var _d = false; 945 var _e = undefined; 946 947 try { 948 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 949 _arr.push(_s.value); 950 951 if (i && _arr.length === i) break; 952 } 953 } catch (err) { 954 _d = true; 955 _e = err; 956 } finally { 957 try { 958 if (!_n && _i["return"] != null) _i["return"](); 959 } finally { 960 if (_d) throw _e; 961 } 962 } 963 964 return _arr; 965 } 966 967 function _nonIterableRest() { 968 throw new TypeError("Invalid attempt to destructure non-iterable instance"); 969 } 970 971 var FastAverageColor = 972 /*#__PURE__*/ 973 function () { 974 function FastAverageColor() { 975 _classCallCheck(this, FastAverageColor); 976 } 977 978 _createClass(FastAverageColor, [{ 979 key: "getColorAsync", 980 981 /** 982 * Get asynchronously the average color from not loaded image. 983 * 984 * @param {HTMLImageElement} resource 985 * @param {Function} callback 986 * @param {Object|null} [options] 987 * @param {Array} [options.defaultColor=[255, 255, 255, 255]] 988 * @param {*} [options.data] 989 * @param {string} [options.mode="speed"] "precision" or "speed" 990 * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" 991 * @param {number} [options.step=1] 992 * @param {number} [options.left=0] 993 * @param {number} [options.top=0] 994 * @param {number} [options.width=width of resource] 995 * @param {number} [options.height=height of resource] 996 */ 997 value: function getColorAsync(resource, callback, options) { 998 if (resource.complete) { 999 callback.call(resource, this.getColor(resource, options), options && options.data); 1000 } else { 1001 this._bindImageEvents(resource, callback, options); 1002 } 1003 } 1004 /** 1005 * Get the average color from images, videos and canvas. 1006 * 1007 * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource 1008 * @param {Object|null} [options] 1009 * @param {Array} [options.defaultColor=[255, 255, 255, 255]] 1010 * @param {*} [options.data] 1011 * @param {string} [options.mode="speed"] "precision" or "speed" 1012 * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" 1013 * @param {number} [options.step=1] 1014 * @param {number} [options.left=0] 1015 * @param {number} [options.top=0] 1016 * @param {number} [options.width=width of resource] 1017 * @param {number} [options.height=height of resource] 1018 * 1019 * @returns {Object} 1020 */ 1021 1022 }, { 1023 key: "getColor", 1024 value: function getColor(resource, options) { 1025 options = options || {}; 1026 1027 var defaultColor = this._getDefaultColor(options), 1028 originalSize = this._getOriginalSize(resource), 1029 size = this._prepareSizeAndPosition(originalSize, options); 1030 1031 var error = null, 1032 value = defaultColor; 1033 1034 if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { 1035 return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.')); 1036 } 1037 1038 if (!this._ctx) { 1039 this._canvas = this._makeCanvas(); 1040 this._ctx = this._canvas.getContext && this._canvas.getContext('2d'); 1041 1042 if (!this._ctx) { 1043 return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.')); 1044 } 1045 } 1046 1047 this._canvas.width = size.destWidth; 1048 this._canvas.height = size.destHeight; 1049 1050 try { 1051 this._ctx.clearRect(0, 0, size.destWidth, size.destHeight); 1052 1053 this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); 1054 1055 var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; 1056 1057 value = this.getColorFromArray4(bitmapData, options); 1058 } catch (e) { 1059 // Security error, CORS 1060 // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image 1061 error = e; 1062 } 1063 1064 return this._prepareResult(value, error); 1065 } 1066 /** 1067 * Get the average color from a array when 1 pixel is 4 bytes. 1068 * 1069 * @param {Array|Uint8Array} arr 1070 * @param {Object} [options] 1071 * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" 1072 * @param {Array} [options.defaultColor=[255, 255, 255, 255]] 1073 * @param {number} [options.step=1] 1074 * 1075 * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)] 1076 */ 1077 1078 }, { 1079 key: "getColorFromArray4", 1080 value: function getColorFromArray4(arr, options) { 1081 options = options || {}; 1082 var bytesPerPixel = 4, 1083 arrLength = arr.length; 1084 1085 if (arrLength < bytesPerPixel) { 1086 return this._getDefaultColor(options); 1087 } 1088 1089 var len = arrLength - arrLength % bytesPerPixel, 1090 preparedStep = (options.step || 1) * bytesPerPixel, 1091 algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm'; 1092 1093 if (typeof this[algorithm] !== 'function') { 1094 throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm.")); 1095 } 1096 1097 return this[algorithm](arr, len, preparedStep); 1098 } 1099 /** 1100 * Destroy the instance. 1101 */ 1102 1103 }, { 1104 key: "destroy", 1105 value: function destroy() { 1106 delete this._canvas; 1107 delete this._ctx; 1108 } 1109 }, { 1110 key: "_getDefaultColor", 1111 value: function _getDefaultColor(options) { 1112 return this._getOption(options, 'defaultColor', [255, 255, 255, 255]); 1113 } 1114 }, { 1115 key: "_getOption", 1116 value: function _getOption(options, name, defaultValue) { 1117 return typeof options[name] === 'undefined' ? defaultValue : options[name]; 1118 } 1119 }, { 1120 key: "_prepareSizeAndPosition", 1121 value: function _prepareSizeAndPosition(originalSize, options) { 1122 var srcLeft = this._getOption(options, 'left', 0), 1123 srcTop = this._getOption(options, 'top', 0), 1124 srcWidth = this._getOption(options, 'width', originalSize.width), 1125 srcHeight = this._getOption(options, 'height', originalSize.height), 1126 destWidth = srcWidth, 1127 destHeight = srcHeight; 1128 1129 if (options.mode === 'precision') { 1130 return { 1131 srcLeft: srcLeft, 1132 srcTop: srcTop, 1133 srcWidth: srcWidth, 1134 srcHeight: srcHeight, 1135 destWidth: destWidth, 1136 destHeight: destHeight 1137 }; 1138 } 1139 1140 var maxSize = 100, 1141 minSize = 10; 1142 var factor; 1143 1144 if (srcWidth > srcHeight) { 1145 factor = srcWidth / srcHeight; 1146 destWidth = maxSize; 1147 destHeight = Math.round(destWidth / factor); 1148 } else { 1149 factor = srcHeight / srcWidth; 1150 destHeight = maxSize; 1151 destWidth = Math.round(destHeight / factor); 1152 } 1153 1154 if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) { 1155 destWidth = srcWidth; 1156 destHeight = srcHeight; 1157 } 1158 1159 return { 1160 srcLeft: srcLeft, 1161 srcTop: srcTop, 1162 srcWidth: srcWidth, 1163 srcHeight: srcHeight, 1164 destWidth: destWidth, 1165 destHeight: destHeight 1166 }; 1167 } 1168 }, { 1169 key: "_simpleAlgorithm", 1170 value: function _simpleAlgorithm(arr, len, preparedStep) { 1171 var redTotal = 0, 1172 greenTotal = 0, 1173 blueTotal = 0, 1174 alphaTotal = 0, 1175 count = 0; 1176 1177 for (var i = 0; i < len; i += preparedStep) { 1178 var alpha = arr[i + 3], 1179 red = arr[i] * alpha, 1180 green = arr[i + 1] * alpha, 1181 blue = arr[i + 2] * alpha; 1182 redTotal += red; 1183 greenTotal += green; 1184 blueTotal += blue; 1185 alphaTotal += alpha; 1186 count++; 1187 } 1188 1189 return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; 1190 } 1191 }, { 1192 key: "_sqrtAlgorithm", 1193 value: function _sqrtAlgorithm(arr, len, preparedStep) { 1194 var redTotal = 0, 1195 greenTotal = 0, 1196 blueTotal = 0, 1197 alphaTotal = 0, 1198 count = 0; 1199 1200 for (var i = 0; i < len; i += preparedStep) { 1201 var red = arr[i], 1202 green = arr[i + 1], 1203 blue = arr[i + 2], 1204 alpha = arr[i + 3]; 1205 redTotal += red * red * alpha; 1206 greenTotal += green * green * alpha; 1207 blueTotal += blue * blue * alpha; 1208 alphaTotal += alpha; 1209 count++; 1210 } 1211 1212 return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; 1213 } 1214 }, { 1215 key: "_dominantAlgorithm", 1216 value: function _dominantAlgorithm(arr, len, preparedStep) { 1217 var colorHash = {}, 1218 divider = 24; 1219 1220 for (var i = 0; i < len; i += preparedStep) { 1221 var red = arr[i], 1222 green = arr[i + 1], 1223 blue = arr[i + 2], 1224 alpha = arr[i + 3], 1225 key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider); 1226 1227 if (colorHash[key]) { 1228 colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1]; 1229 } else { 1230 colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; 1231 } 1232 } 1233 1234 var buffer = Object.keys(colorHash).map(function (key) { 1235 return colorHash[key]; 1236 }).sort(function (a, b) { 1237 var countA = a[4], 1238 countB = b[4]; 1239 return countA > countB ? -1 : countA === countB ? 0 : 1; 1240 }); 1241 1242 var _buffer$ = _slicedToArray(buffer[0], 5), 1243 redTotal = _buffer$[0], 1244 greenTotal = _buffer$[1], 1245 blueTotal = _buffer$[2], 1246 alphaTotal = _buffer$[3], 1247 count = _buffer$[4]; 1248 1249 return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; 1250 } 1251 }, { 1252 key: "_bindImageEvents", 1253 value: function _bindImageEvents(resource, callback, options) { 1254 var _this = this; 1255 1256 options = options || {}; 1257 1258 var data = options && options.data, 1259 defaultColor = this._getDefaultColor(options), 1260 onload = function onload() { 1261 unbindEvents(); 1262 callback.call(resource, _this.getColor(resource, options), data); 1263 }, 1264 onerror = function onerror() { 1265 unbindEvents(); 1266 callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data); 1267 }, 1268 onabort = function onabort() { 1269 unbindEvents(); 1270 callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data); 1271 }, 1272 unbindEvents = function unbindEvents() { 1273 resource.removeEventListener('load', onload); 1274 resource.removeEventListener('error', onerror); 1275 resource.removeEventListener('abort', onabort); 1276 }; 1277 1278 resource.addEventListener('load', onload); 1279 resource.addEventListener('error', onerror); 1280 resource.addEventListener('abort', onabort); 1281 } 1282 }, { 1283 key: "_prepareResult", 1284 value: function _prepareResult(value, error) { 1285 var rgb = value.slice(0, 3), 1286 rgba = [].concat(rgb, value[3] / 255), 1287 isDark = this._isDark(value); 1288 1289 return { 1290 error: error, 1291 value: value, 1292 rgb: 'rgb(' + rgb.join(',') + ')', 1293 rgba: 'rgba(' + rgba.join(',') + ')', 1294 hex: this._arrayToHex(rgb), 1295 hexa: this._arrayToHex(value), 1296 isDark: isDark, 1297 isLight: !isDark 1298 }; 1299 } 1300 }, { 1301 key: "_getOriginalSize", 1302 value: function _getOriginalSize(resource) { 1303 if (resource instanceof HTMLImageElement) { 1304 return { 1305 width: resource.naturalWidth, 1306 height: resource.naturalHeight 1307 }; 1308 } 1309 1310 if (resource instanceof HTMLVideoElement) { 1311 return { 1312 width: resource.videoWidth, 1313 height: resource.videoHeight 1314 }; 1315 } 1316 1317 return { 1318 width: resource.width, 1319 height: resource.height 1320 }; 1321 } 1322 }, { 1323 key: "_toHex", 1324 value: function _toHex(num) { 1325 var str = num.toString(16); 1326 return str.length === 1 ? '0' + str : str; 1327 } 1328 }, { 1329 key: "_arrayToHex", 1330 value: function _arrayToHex(arr) { 1331 return '#' + arr.map(this._toHex).join(''); 1332 } 1333 }, { 1334 key: "_isDark", 1335 value: function _isDark(color) { 1336 // http://www.w3.org/TR/AERT#color-contrast 1337 var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; 1338 return result < 128; 1339 } 1340 }, { 1341 key: "_makeCanvas", 1342 value: function _makeCanvas() { 1343 return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas'); 1344 } 1345 }]); 1346 1347 return FastAverageColor; 1348 }(); 1349 1350 return FastAverageColor; 1351 1352 }))); 1353 1354 1355 /***/ }), 1356 1357 /***/ 29: 1358 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1359 1360 "use strict"; 1361 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); 1362 /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42); 1363 /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18); 1364 1365 1366 function _possibleConstructorReturn(self, call) { 1367 if (call && (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) { 1368 return call; 1369 } 1370 1371 return Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); 1372 } 1373 1374 /***/ }), 1375 1376 /***/ 3: 1377 /***/ (function(module, exports) { 1378 1379 (function() { module.exports = window["wp"]["components"]; }()); 1380 1381 /***/ }), 1382 1383 /***/ 306: 1384 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1385 1386 "use strict"; 1387 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1388 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1389 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1390 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1391 1392 1393 /** 1394 * WordPress dependencies 1395 */ 1396 1397 var alignLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1398 xmlns: "http://www.w3.org/2000/svg", 1399 viewBox: "0 0 24 24" 1400 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1401 d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z" 1402 })); 1403 /* harmony default export */ __webpack_exports__["a"] = (alignLeft); 1404 1405 1406 /***/ }), 1407 1408 /***/ 307: 1409 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1410 1411 "use strict"; 1412 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1413 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1414 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1415 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1416 1417 1418 /** 1419 * WordPress dependencies 1420 */ 1421 1422 var alignCenter = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1423 xmlns: "http://www.w3.org/2000/svg", 1424 viewBox: "0 0 24 24" 1425 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1426 d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z" 1427 })); 1428 /* harmony default export */ __webpack_exports__["a"] = (alignCenter); 1429 1430 1431 /***/ }), 1432 1433 /***/ 308: 1434 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1435 1436 "use strict"; 1437 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1438 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1439 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1440 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1441 1442 1443 /** 1444 * WordPress dependencies 1445 */ 1446 1447 var alignRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1448 xmlns: "http://www.w3.org/2000/svg", 1449 viewBox: "0 0 24 24" 1450 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1451 d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z" 1452 })); 1453 /* harmony default export */ __webpack_exports__["a"] = (alignRight); 1454 1455 1456 /***/ }), 1457 1458 /***/ 31: 1459 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1460 1461 "use strict"; 1462 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); 1463 /* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24); 1464 1465 function _unsupportedIterableToArray(o, minLen) { 1466 if (!o) return; 1467 if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 1468 var n = Object.prototype.toString.call(o).slice(8, -1); 1469 if (n === "Object" && o.constructor) n = o.constructor.name; 1470 if (n === "Map" || n === "Set") return Array.from(o); 1471 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 1472 } 1473 1474 /***/ }), 1475 1476 /***/ 314: 1477 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1478 1479 "use strict"; 1480 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1481 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1482 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1483 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1484 1485 1486 /** 1487 * WordPress dependencies 1488 */ 1489 1490 var media = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1491 xmlns: "http://www.w3.org/2000/svg", 1492 viewBox: "0 0 24 24" 1493 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1494 d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" 1495 })); 1496 /* harmony default export */ __webpack_exports__["a"] = (media); 1497 1498 1499 /***/ }), 1500 1501 /***/ 315: 1502 /***/ (function(module, exports, __webpack_require__) { 1503 1504 "use strict"; 1505 /** 1506 * Copyright (c) 2015, Facebook, Inc. 1507 * All rights reserved. 1508 * 1509 * This source code is licensed under the BSD-style license found in the 1510 * LICENSE file in the root directory of this source tree. An additional grant 1511 * of patent rights can be found in the PATENTS file in the same directory. 1512 * 1513 * @providesModule normalizeWheel 1514 * @typechecks 1515 */ 1516 1517 1518 1519 var UserAgent_DEPRECATED = __webpack_require__(316); 1520 1521 var isEventSupported = __webpack_require__(317); 1522 1523 1524 // Reasonable defaults 1525 var PIXEL_STEP = 10; 1526 var LINE_HEIGHT = 40; 1527 var PAGE_HEIGHT = 800; 1528 1529 /** 1530 * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is 1531 * complicated, thus this doc is long and (hopefully) detailed enough to answer 1532 * your questions. 1533 * 1534 * If you need to react to the mouse wheel in a predictable way, this code is 1535 * like your bestest friend. * hugs * 1536 * 1537 * As of today, there are 4 DOM event types you can listen to: 1538 * 1539 * 'wheel' -- Chrome(31+), FF(17+), IE(9+) 1540 * 'mousewheel' -- Chrome, IE(6+), Opera, Safari 1541 * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! 1542 * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 1543 * 1544 * So what to do? The is the best: 1545 * 1546 * normalizeWheel.getEventType(); 1547 * 1548 * In your event callback, use this code to get sane interpretation of the 1549 * deltas. This code will return an object with properties: 1550 * 1551 * spinX -- normalized spin speed (use for zoom) - x plane 1552 * spinY -- " - y plane 1553 * pixelX -- normalized distance (to pixels) - x plane 1554 * pixelY -- " - y plane 1555 * 1556 * Wheel values are provided by the browser assuming you are using the wheel to 1557 * scroll a web page by a number of lines or pixels (or pages). Values can vary 1558 * significantly on different platforms and browsers, forgetting that you can 1559 * scroll at different speeds. Some devices (like trackpads) emit more events 1560 * at smaller increments with fine granularity, and some emit massive jumps with 1561 * linear speed or acceleration. 1562 * 1563 * This code does its best to normalize the deltas for you: 1564 * 1565 * - spin is trying to normalize how far the wheel was spun (or trackpad 1566 * dragged). This is super useful for zoom support where you want to 1567 * throw away the chunky scroll steps on the PC and make those equal to 1568 * the slow and smooth tiny steps on the Mac. Key data: This code tries to 1569 * resolve a single slow step on a wheel to 1. 1570 * 1571 * - pixel is normalizing the desired scroll delta in pixel units. You'll 1572 * get the crazy differences between browsers, but at least it'll be in 1573 * pixels! 1574 * 1575 * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This 1576 * should translate to positive value zooming IN, negative zooming OUT. 1577 * This matches the newer 'wheel' event. 1578 * 1579 * Why are there spinX, spinY (or pixels)? 1580 * 1581 * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn 1582 * with a mouse. It results in side-scrolling in the browser by default. 1583 * 1584 * - spinY is what you expect -- it's the classic axis of a mouse wheel. 1585 * 1586 * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and 1587 * probably is by browsers in conjunction with fancy 3D controllers .. but 1588 * you know. 1589 * 1590 * Implementation info: 1591 * 1592 * Examples of 'wheel' event if you scroll slowly (down) by one step with an 1593 * average mouse: 1594 * 1595 * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) 1596 * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) 1597 * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) 1598 * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) 1599 * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) 1600 * 1601 * On the trackpad: 1602 * 1603 * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) 1604 * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) 1605 * 1606 * On other/older browsers.. it's more complicated as there can be multiple and 1607 * also missing delta values. 1608 * 1609 * The 'wheel' event is more standard: 1610 * 1611 * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents 1612 * 1613 * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and 1614 * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain 1615 * backward compatibility with older events. Those other values help us 1616 * better normalize spin speed. Example of what the browsers provide: 1617 * 1618 * | event.wheelDelta | event.detail 1619 * ------------------+------------------+-------------- 1620 * Safari v5/OS X | -120 | 0 1621 * Safari v5/Win7 | -120 | 0 1622 * Chrome v17/OS X | -120 | 0 1623 * Chrome v17/Win7 | -120 | 0 1624 * IE9/Win7 | -120 | undefined 1625 * Firefox v4/OS X | undefined | 1 1626 * Firefox v4/Win7 | undefined | 3 1627 * 1628 */ 1629 function normalizeWheel(/*object*/ event) /*object*/ { 1630 var sX = 0, sY = 0, // spinX, spinY 1631 pX = 0, pY = 0; // pixelX, pixelY 1632 1633 // Legacy 1634 if ('detail' in event) { sY = event.detail; } 1635 if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } 1636 if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } 1637 if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } 1638 1639 // side scrolling on FF with DOMMouseScroll 1640 if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) { 1641 sX = sY; 1642 sY = 0; 1643 } 1644 1645 pX = sX * PIXEL_STEP; 1646 pY = sY * PIXEL_STEP; 1647 1648 if ('deltaY' in event) { pY = event.deltaY; } 1649 if ('deltaX' in event) { pX = event.deltaX; } 1650 1651 if ((pX || pY) && event.deltaMode) { 1652 if (event.deltaMode == 1) { // delta in LINE units 1653 pX *= LINE_HEIGHT; 1654 pY *= LINE_HEIGHT; 1655 } else { // delta in PAGE units 1656 pX *= PAGE_HEIGHT; 1657 pY *= PAGE_HEIGHT; 1658 } 1659 } 1660 1661 // Fall-back if spin cannot be determined 1662 if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } 1663 if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } 1664 1665 return { spinX : sX, 1666 spinY : sY, 1667 pixelX : pX, 1668 pixelY : pY }; 1669 } 1670 1671 1672 /** 1673 * The best combination if you prefer spinX + spinY normalization. It favors 1674 * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with 1675 * 'wheel' event, making spin speed determination impossible. 1676 */ 1677 normalizeWheel.getEventType = function() /*string*/ { 1678 return (UserAgent_DEPRECATED.firefox()) 1679 ? 'DOMMouseScroll' 1680 : (isEventSupported('wheel')) 1681 ? 'wheel' 1682 : 'mousewheel'; 1683 }; 1684 1685 module.exports = normalizeWheel; 1686 1687 1688 /***/ }), 1689 1690 /***/ 316: 1691 /***/ (function(module, exports) { 1692 1693 /** 1694 * Copyright 2004-present Facebook. All Rights Reserved. 1695 * 1696 * @providesModule UserAgent_DEPRECATED 1697 */ 1698 1699 /** 1700 * Provides entirely client-side User Agent and OS detection. You should prefer 1701 * the non-deprecated UserAgent module when possible, which exposes our 1702 * authoritative server-side PHP-based detection to the client. 1703 * 1704 * Usage is straightforward: 1705 * 1706 * if (UserAgent_DEPRECATED.ie()) { 1707 * // IE 1708 * } 1709 * 1710 * You can also do version checks: 1711 * 1712 * if (UserAgent_DEPRECATED.ie() >= 7) { 1713 * // IE7 or better 1714 * } 1715 * 1716 * The browser functions will return NaN if the browser does not match, so 1717 * you can also do version compares the other way: 1718 * 1719 * if (UserAgent_DEPRECATED.ie() < 7) { 1720 * // IE6 or worse 1721 * } 1722 * 1723 * Note that the version is a float and may include a minor version number, 1724 * so you should always use range operators to perform comparisons, not 1725 * strict equality. 1726 * 1727 * **Note:** You should **strongly** prefer capability detection to browser 1728 * version detection where it's reasonable: 1729 * 1730 * http://www.quirksmode.org/js/support.html 1731 * 1732 * Further, we have a large number of mature wrapper functions and classes 1733 * which abstract away many browser irregularities. Check the documentation, 1734 * grep for things, or ask on javascript@lists.facebook.com before writing yet 1735 * another copy of "event || window.event". 1736 * 1737 */ 1738 1739 var _populated = false; 1740 1741 // Browsers 1742 var _ie, _firefox, _opera, _webkit, _chrome; 1743 1744 // Actual IE browser for compatibility mode 1745 var _ie_real_version; 1746 1747 // Platforms 1748 var _osx, _windows, _linux, _android; 1749 1750 // Architectures 1751 var _win64; 1752 1753 // Devices 1754 var _iphone, _ipad, _native; 1755 1756 var _mobile; 1757 1758 function _populate() { 1759 if (_populated) { 1760 return; 1761 } 1762 1763 _populated = true; 1764 1765 // To work around buggy JS libraries that can't handle multi-digit 1766 // version numbers, Opera 10's user agent string claims it's Opera 1767 // 9, then later includes a Version/X.Y field: 1768 // 1769 // Opera/9.80 (foo) Presto/2.2.15 Version/10.10 1770 var uas = navigator.userAgent; 1771 var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); 1772 var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); 1773 1774 _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); 1775 _ipad = /\b(iP[ao]d)/.exec(uas); 1776 _android = /Android/i.exec(uas); 1777 _native = /FBAN\/\w+;/i.exec(uas); 1778 _mobile = /Mobile/i.exec(uas); 1779 1780 // Note that the IE team blog would have you believe you should be checking 1781 // for 'Win64; x64'. But MSDN then reveals that you can actually be coming 1782 // from either x64 or ia64; so ultimately, you should just check for Win64 1783 // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit 1784 // Windows will send 'WOW64' instead. 1785 _win64 = !!(/Win64/.exec(uas)); 1786 1787 if (agent) { 1788 _ie = agent[1] ? parseFloat(agent[1]) : ( 1789 agent[5] ? parseFloat(agent[5]) : NaN); 1790 // IE compatibility mode 1791 if (_ie && document && document.documentMode) { 1792 _ie = document.documentMode; 1793 } 1794 // grab the "true" ie version from the trident token if available 1795 var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); 1796 _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; 1797 1798 _firefox = agent[2] ? parseFloat(agent[2]) : NaN; 1799 _opera = agent[3] ? parseFloat(agent[3]) : NaN; 1800 _webkit = agent[4] ? parseFloat(agent[4]) : NaN; 1801 if (_webkit) { 1802 // We do not add the regexp to the above test, because it will always 1803 // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in 1804 // the userAgent string. 1805 agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); 1806 _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; 1807 } else { 1808 _chrome = NaN; 1809 } 1810 } else { 1811 _ie = _firefox = _opera = _chrome = _webkit = NaN; 1812 } 1813 1814 if (os) { 1815 if (os[1]) { 1816 // Detect OS X version. If no version number matches, set _osx to true. 1817 // Version examples: 10, 10_6_1, 10.7 1818 // Parses version number as a float, taking only first two sets of 1819 // digits. If only one set of digits is found, returns just the major 1820 // version number. 1821 var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); 1822 1823 _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true; 1824 } else { 1825 _osx = false; 1826 } 1827 _windows = !!os[2]; 1828 _linux = !!os[3]; 1829 } else { 1830 _osx = _windows = _linux = false; 1831 } 1832 } 1833 1834 var UserAgent_DEPRECATED = { 1835 1836 /** 1837 * Check if the UA is Internet Explorer. 1838 * 1839 * 1840 * @return float|NaN Version number (if match) or NaN. 1841 */ 1842 ie: function() { 1843 return _populate() || _ie; 1844 }, 1845 1846 /** 1847 * Check if we're in Internet Explorer compatibility mode. 1848 * 1849 * @return bool true if in compatibility mode, false if 1850 * not compatibility mode or not ie 1851 */ 1852 ieCompatibilityMode: function() { 1853 return _populate() || (_ie_real_version > _ie); 1854 }, 1855 1856 1857 /** 1858 * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we 1859 * only need this because Skype can't handle 64-bit IE yet. We need to remove 1860 * this when we don't need it -- tracked by #601957. 1861 */ 1862 ie64: function() { 1863 return UserAgent_DEPRECATED.ie() && _win64; 1864 }, 1865 1866 /** 1867 * Check if the UA is Firefox. 1868 * 1869 * 1870 * @return float|NaN Version number (if match) or NaN. 1871 */ 1872 firefox: function() { 1873 return _populate() || _firefox; 1874 }, 1875 1876 1877 /** 1878 * Check if the UA is Opera. 1879 * 1880 * 1881 * @return float|NaN Version number (if match) or NaN. 1882 */ 1883 opera: function() { 1884 return _populate() || _opera; 1885 }, 1886 1887 1888 /** 1889 * Check if the UA is WebKit. 1890 * 1891 * 1892 * @return float|NaN Version number (if match) or NaN. 1893 */ 1894 webkit: function() { 1895 return _populate() || _webkit; 1896 }, 1897 1898 /** 1899 * For Push 1900 * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit 1901 */ 1902 safari: function() { 1903 return UserAgent_DEPRECATED.webkit(); 1904 }, 1905 1906 /** 1907 * Check if the UA is a Chrome browser. 1908 * 1909 * 1910 * @return float|NaN Version number (if match) or NaN. 1911 */ 1912 chrome : function() { 1913 return _populate() || _chrome; 1914 }, 1915 1916 1917 /** 1918 * Check if the user is running Windows. 1919 * 1920 * @return bool `true' if the user's OS is Windows. 1921 */ 1922 windows: function() { 1923 return _populate() || _windows; 1924 }, 1925 1926 1927 /** 1928 * Check if the user is running Mac OS X. 1929 * 1930 * @return float|bool Returns a float if a version number is detected, 1931 * otherwise true/false. 1932 */ 1933 osx: function() { 1934 return _populate() || _osx; 1935 }, 1936 1937 /** 1938 * Check if the user is running Linux. 1939 * 1940 * @return bool `true' if the user's OS is some flavor of Linux. 1941 */ 1942 linux: function() { 1943 return _populate() || _linux; 1944 }, 1945 1946 /** 1947 * Check if the user is running on an iPhone or iPod platform. 1948 * 1949 * @return bool `true' if the user is running some flavor of the 1950 * iPhone OS. 1951 */ 1952 iphone: function() { 1953 return _populate() || _iphone; 1954 }, 1955 1956 mobile: function() { 1957 return _populate() || (_iphone || _ipad || _android || _mobile); 1958 }, 1959 1960 nativeApp: function() { 1961 // webviews inside of the native apps 1962 return _populate() || _native; 1963 }, 1964 1965 android: function() { 1966 return _populate() || _android; 1967 }, 1968 1969 ipad: function() { 1970 return _populate() || _ipad; 1971 } 1972 }; 1973 1974 module.exports = UserAgent_DEPRECATED; 1975 1976 1977 /***/ }), 1978 1979 /***/ 317: 1980 /***/ (function(module, exports, __webpack_require__) { 1981 1982 "use strict"; 1983 /** 1984 * Copyright 2013-2015, Facebook, Inc. 1985 * All rights reserved. 1986 * 1987 * This source code is licensed under the BSD-style license found in the 1988 * LICENSE file in the root directory of this source tree. An additional grant 1989 * of patent rights can be found in the PATENTS file in the same directory. 1990 * 1991 * @providesModule isEventSupported 1992 */ 1993 1994 1995 1996 var ExecutionEnvironment = __webpack_require__(318); 1997 1998 var useHasFeature; 1999 if (ExecutionEnvironment.canUseDOM) { 2000 useHasFeature = 2001 document.implementation && 2002 document.implementation.hasFeature && 2003 // always returns true in newer browsers as per the standard. 2004 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature 2005 document.implementation.hasFeature('', '') !== true; 2006 } 2007 2008 /** 2009 * Checks if an event is supported in the current execution environment. 2010 * 2011 * NOTE: This will not work correctly for non-generic events such as `change`, 2012 * `reset`, `load`, `error`, and `select`. 2013 * 2014 * Borrows from Modernizr. 2015 * 2016 * @param {string} eventNameSuffix Event name, e.g. "click". 2017 * @param {?boolean} capture Check if the capture phase is supported. 2018 * @return {boolean} True if the event is supported. 2019 * @internal 2020 * @license Modernizr 3.0.0pre (Custom Build) | MIT 2021 */ 2022 function isEventSupported(eventNameSuffix, capture) { 2023 if (!ExecutionEnvironment.canUseDOM || 2024 capture && !('addEventListener' in document)) { 2025 return false; 2026 } 2027 2028 var eventName = 'on' + eventNameSuffix; 2029 var isSupported = eventName in document; 2030 2031 if (!isSupported) { 2032 var element = document.createElement('div'); 2033 element.setAttribute(eventName, 'return;'); 2034 isSupported = typeof element[eventName] === 'function'; 2035 } 2036 2037 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { 2038 // This is the only way to test support for the `wheel` event in IE9+. 2039 isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); 2040 } 2041 2042 return isSupported; 2043 } 2044 2045 module.exports = isEventSupported; 2046 2047 2048 /***/ }), 2049 2050 /***/ 318: 2051 /***/ (function(module, exports, __webpack_require__) { 2052 2053 "use strict"; 2054 /** 2055 * Copyright (c) 2015, Facebook, Inc. 2056 * All rights reserved. 2057 * 2058 * This source code is licensed under the BSD-style license found in the 2059 * LICENSE file in the root directory of this source tree. An additional grant 2060 * of patent rights can be found in the PATENTS file in the same directory. 2061 * 2062 * @providesModule ExecutionEnvironment 2063 */ 2064 2065 /*jslint evil: true */ 2066 2067 2068 2069 var canUseDOM = !!( 2070 typeof window !== 'undefined' && 2071 window.document && 2072 window.document.createElement 2073 ); 2074 2075 /** 2076 * Simple, lightweight module assisting with the detection and context of 2077 * Worker. Helps avoid circular dependencies and allows code to reason about 2078 * whether or not they are in a Worker, even if they never include the main 2079 * `ReactWorker` dependency. 2080 */ 2081 var ExecutionEnvironment = { 2082 2083 canUseDOM: canUseDOM, 2084 2085 canUseWorkers: typeof Worker !== 'undefined', 2086 2087 canUseEventListeners: 2088 canUseDOM && !!(window.addEventListener || window.attachEvent), 2089 2090 canUseViewport: canUseDOM && !!window.screen, 2091 2092 isInWorker: !canUseDOM // For now, this is true - might change in the future. 2093 2094 }; 2095 2096 module.exports = ExecutionEnvironment; 2097 2098 2099 /***/ }), 2100 2101 /***/ 319: 2102 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2103 2104 "use strict"; 2105 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 2106 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2107 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 2108 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 2109 2110 2111 /** 2112 * WordPress dependencies 2113 */ 2114 2115 var button = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 2116 viewBox: "0 0 24 24", 2117 xmlns: "http://www.w3.org/2000/svg" 2118 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 2119 d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z" 2120 })); 2121 /* harmony default export */ __webpack_exports__["a"] = (button); 2122 2123 2124 /***/ }), 2125 2126 /***/ 32: 2127 /***/ (function(module, exports) { 2128 2129 (function() { module.exports = window["wp"]["url"]; }()); 2130 2131 /***/ }), 2132 2133 /***/ 320: 2134 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2135 2136 "use strict"; 2137 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 2138 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2139 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 2140 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 2141 2142 2143 /** 2144 * WordPress dependencies 2145 */ 2146 2147 var code = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 2148 viewBox: "0 0 24 24", 2149 xmlns: "http://www.w3.org/2000/svg" 2150 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 2151 d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" 2152 })); 2153 /* harmony default export */ __webpack_exports__["a"] = (code); 2154 2155 2156 /***/ }), 2157 2158 /***/ 33: 2159 /***/ (function(module, exports) { 2160 2161 (function() { module.exports = window["wp"]["hooks"]; }()); 2162 2163 /***/ }), 2164 2165 /***/ 35: 2166 /***/ (function(module, exports) { 2167 2168 (function() { module.exports = window["wp"]["deprecated"]; }()); 2169 2170 /***/ }), 2171 2172 /***/ 37: 2173 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2174 2175 "use strict"; 2176 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); 2177 function _iterableToArray(iter) { 2178 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); 2179 } 2180 2181 /***/ }), 2182 2183 /***/ 38: 2184 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2185 2186 "use strict"; 2187 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); 2188 function _arrayWithHoles(arr) { 2189 if (Array.isArray(arr)) return arr; 2190 } 2191 2192 /***/ }), 2193 2194 /***/ 39: 2195 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2196 2197 "use strict"; 2198 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); 2199 function _nonIterableRest() { 2200 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 2201 } 2202 2203 /***/ }), 2204 2205 /***/ 4: 2206 /***/ (function(module, exports) { 2207 2208 (function() { module.exports = window["wp"]["data"]; }()); 2209 2210 /***/ }), 2211 2212 /***/ 42: 2213 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2214 2215 "use strict"; 2216 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); 2217 function _typeof(obj) { 2218 "@babel/helpers - typeof"; 2219 2220 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 2221 _typeof = function _typeof(obj) { 2222 return typeof obj; 2223 }; 2224 } else { 2225 _typeof = function _typeof(obj) { 2226 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2227 }; 2228 } 2229 2230 return _typeof(obj); 2231 } 2232 2233 /***/ }), 2234 2235 /***/ 43: 2236 /***/ (function(module, exports) { 2237 2238 (function() { module.exports = window["wp"]["blob"]; }()); 2239 2240 /***/ }), 2241 2242 /***/ 44: 2243 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2244 2245 "use strict"; 2246 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 2247 function _objectWithoutPropertiesLoose(source, excluded) { 2248 if (source == null) return {}; 2249 var target = {}; 2250 var sourceKeys = Object.keys(source); 2251 var key, i; 2252 2253 for (i = 0; i < sourceKeys.length; i++) { 2254 key = sourceKeys[i]; 2255 if (excluded.indexOf(key) >= 0) continue; 2256 target[key] = source[key]; 2257 } 2258 2259 return target; 2260 } 2261 2262 /***/ }), 2263 2264 /***/ 45: 2265 /***/ (function(module, exports) { 2266 2267 (function() { module.exports = window["moment"]; }()); 2268 2269 /***/ }), 2270 2271 /***/ 455: 2272 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2273 2274 "use strict"; 2275 // ESM COMPAT FLAG 2276 __webpack_require__.r(__webpack_exports__); 2277 2278 // EXPORTS 2279 __webpack_require__.d(__webpack_exports__, "__experimentalGetCoreBlocks", function() { return /* binding */ build_module_experimentalGetCoreBlocks; }); 2280 __webpack_require__.d(__webpack_exports__, "registerCoreBlocks", function() { return /* binding */ build_module_registerCoreBlocks; }); 2281 __webpack_require__.d(__webpack_exports__, "__experimentalRegisterExperimentalCoreBlocks", function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; }); 2282 2283 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 2284 var build_module_paragraph_namespaceObject = {}; 2285 __webpack_require__.r(build_module_paragraph_namespaceObject); 2286 __webpack_require__.d(build_module_paragraph_namespaceObject, "metadata", function() { return paragraph_metadata; }); 2287 __webpack_require__.d(build_module_paragraph_namespaceObject, "name", function() { return paragraph_name; }); 2288 __webpack_require__.d(build_module_paragraph_namespaceObject, "settings", function() { return paragraph_settings; }); 2289 2290 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js 2291 var build_module_image_namespaceObject = {}; 2292 __webpack_require__.r(build_module_image_namespaceObject); 2293 __webpack_require__.d(build_module_image_namespaceObject, "metadata", function() { return image_metadata; }); 2294 __webpack_require__.d(build_module_image_namespaceObject, "name", function() { return image_name; }); 2295 __webpack_require__.d(build_module_image_namespaceObject, "settings", function() { return image_settings; }); 2296 2297 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js 2298 var build_module_heading_namespaceObject = {}; 2299 __webpack_require__.r(build_module_heading_namespaceObject); 2300 __webpack_require__.d(build_module_heading_namespaceObject, "metadata", function() { return heading_metadata; }); 2301 __webpack_require__.d(build_module_heading_namespaceObject, "name", function() { return heading_name; }); 2302 __webpack_require__.d(build_module_heading_namespaceObject, "settings", function() { return heading_settings; }); 2303 2304 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js 2305 var build_module_quote_namespaceObject = {}; 2306 __webpack_require__.r(build_module_quote_namespaceObject); 2307 __webpack_require__.d(build_module_quote_namespaceObject, "metadata", function() { return quote_metadata; }); 2308 __webpack_require__.d(build_module_quote_namespaceObject, "name", function() { return quote_name; }); 2309 __webpack_require__.d(build_module_quote_namespaceObject, "settings", function() { return quote_settings; }); 2310 2311 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js 2312 var build_module_gallery_namespaceObject = {}; 2313 __webpack_require__.r(build_module_gallery_namespaceObject); 2314 __webpack_require__.d(build_module_gallery_namespaceObject, "metadata", function() { return gallery_metadata; }); 2315 __webpack_require__.d(build_module_gallery_namespaceObject, "name", function() { return gallery_name; }); 2316 __webpack_require__.d(build_module_gallery_namespaceObject, "settings", function() { return gallery_settings; }); 2317 2318 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js 2319 var archives_namespaceObject = {}; 2320 __webpack_require__.r(archives_namespaceObject); 2321 __webpack_require__.d(archives_namespaceObject, "metadata", function() { return archives_metadata; }); 2322 __webpack_require__.d(archives_namespaceObject, "name", function() { return archives_name; }); 2323 __webpack_require__.d(archives_namespaceObject, "settings", function() { return archives_settings; }); 2324 2325 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js 2326 var build_module_audio_namespaceObject = {}; 2327 __webpack_require__.r(build_module_audio_namespaceObject); 2328 __webpack_require__.d(build_module_audio_namespaceObject, "metadata", function() { return audio_metadata; }); 2329 __webpack_require__.d(build_module_audio_namespaceObject, "name", function() { return audio_name; }); 2330 __webpack_require__.d(build_module_audio_namespaceObject, "settings", function() { return audio_settings; }); 2331 2332 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js 2333 var button_namespaceObject = {}; 2334 __webpack_require__.r(button_namespaceObject); 2335 __webpack_require__.d(button_namespaceObject, "metadata", function() { return button_metadata; }); 2336 __webpack_require__.d(button_namespaceObject, "name", function() { return button_name; }); 2337 __webpack_require__.d(button_namespaceObject, "settings", function() { return button_settings; }); 2338 2339 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js 2340 var buttons_namespaceObject = {}; 2341 __webpack_require__.r(buttons_namespaceObject); 2342 __webpack_require__.d(buttons_namespaceObject, "metadata", function() { return buttons_metadata; }); 2343 __webpack_require__.d(buttons_namespaceObject, "name", function() { return buttons_name; }); 2344 __webpack_require__.d(buttons_namespaceObject, "settings", function() { return buttons_settings; }); 2345 2346 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js 2347 var build_module_calendar_namespaceObject = {}; 2348 __webpack_require__.r(build_module_calendar_namespaceObject); 2349 __webpack_require__.d(build_module_calendar_namespaceObject, "metadata", function() { return calendar_metadata; }); 2350 __webpack_require__.d(build_module_calendar_namespaceObject, "name", function() { return calendar_name; }); 2351 __webpack_require__.d(build_module_calendar_namespaceObject, "settings", function() { return calendar_settings; }); 2352 2353 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js 2354 var categories_namespaceObject = {}; 2355 __webpack_require__.r(categories_namespaceObject); 2356 __webpack_require__.d(categories_namespaceObject, "metadata", function() { return categories_metadata; }); 2357 __webpack_require__.d(categories_namespaceObject, "name", function() { return categories_name; }); 2358 __webpack_require__.d(categories_namespaceObject, "settings", function() { return categories_settings; }); 2359 2360 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js 2361 var code_namespaceObject = {}; 2362 __webpack_require__.r(code_namespaceObject); 2363 __webpack_require__.d(code_namespaceObject, "metadata", function() { return code_metadata; }); 2364 __webpack_require__.d(code_namespaceObject, "name", function() { return code_name; }); 2365 __webpack_require__.d(code_namespaceObject, "settings", function() { return code_settings; }); 2366 2367 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js 2368 var build_module_columns_namespaceObject = {}; 2369 __webpack_require__.r(build_module_columns_namespaceObject); 2370 __webpack_require__.d(build_module_columns_namespaceObject, "metadata", function() { return columns_metadata; }); 2371 __webpack_require__.d(build_module_columns_namespaceObject, "name", function() { return columns_name; }); 2372 __webpack_require__.d(build_module_columns_namespaceObject, "settings", function() { return columns_settings; }); 2373 2374 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js 2375 var build_module_column_namespaceObject = {}; 2376 __webpack_require__.r(build_module_column_namespaceObject); 2377 __webpack_require__.d(build_module_column_namespaceObject, "metadata", function() { return column_metadata; }); 2378 __webpack_require__.d(build_module_column_namespaceObject, "name", function() { return column_name; }); 2379 __webpack_require__.d(build_module_column_namespaceObject, "settings", function() { return column_settings; }); 2380 2381 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js 2382 var build_module_cover_namespaceObject = {}; 2383 __webpack_require__.r(build_module_cover_namespaceObject); 2384 __webpack_require__.d(build_module_cover_namespaceObject, "metadata", function() { return cover_metadata; }); 2385 __webpack_require__.d(build_module_cover_namespaceObject, "name", function() { return cover_name; }); 2386 __webpack_require__.d(build_module_cover_namespaceObject, "settings", function() { return cover_settings; }); 2387 2388 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js 2389 var embed_namespaceObject = {}; 2390 __webpack_require__.r(embed_namespaceObject); 2391 __webpack_require__.d(embed_namespaceObject, "metadata", function() { return embed_metadata; }); 2392 __webpack_require__.d(embed_namespaceObject, "name", function() { return embed_name; }); 2393 __webpack_require__.d(embed_namespaceObject, "settings", function() { return embed_settings; }); 2394 2395 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js 2396 var build_module_file_namespaceObject = {}; 2397 __webpack_require__.r(build_module_file_namespaceObject); 2398 __webpack_require__.d(build_module_file_namespaceObject, "metadata", function() { return file_metadata; }); 2399 __webpack_require__.d(build_module_file_namespaceObject, "name", function() { return file_name; }); 2400 __webpack_require__.d(build_module_file_namespaceObject, "settings", function() { return file_settings; }); 2401 2402 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js 2403 var build_module_html_namespaceObject = {}; 2404 __webpack_require__.r(build_module_html_namespaceObject); 2405 __webpack_require__.d(build_module_html_namespaceObject, "metadata", function() { return html_metadata; }); 2406 __webpack_require__.d(build_module_html_namespaceObject, "name", function() { return html_name; }); 2407 __webpack_require__.d(build_module_html_namespaceObject, "settings", function() { return html_settings; }); 2408 2409 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js 2410 var media_text_namespaceObject = {}; 2411 __webpack_require__.r(media_text_namespaceObject); 2412 __webpack_require__.d(media_text_namespaceObject, "metadata", function() { return media_text_metadata; }); 2413 __webpack_require__.d(media_text_namespaceObject, "name", function() { return media_text_name; }); 2414 __webpack_require__.d(media_text_namespaceObject, "settings", function() { return media_text_settings; }); 2415 2416 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js 2417 var latest_comments_namespaceObject = {}; 2418 __webpack_require__.r(latest_comments_namespaceObject); 2419 __webpack_require__.d(latest_comments_namespaceObject, "metadata", function() { return latest_comments_metadata; }); 2420 __webpack_require__.d(latest_comments_namespaceObject, "name", function() { return latest_comments_name; }); 2421 __webpack_require__.d(latest_comments_namespaceObject, "settings", function() { return latest_comments_settings; }); 2422 2423 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js 2424 var latest_posts_namespaceObject = {}; 2425 __webpack_require__.r(latest_posts_namespaceObject); 2426 __webpack_require__.d(latest_posts_namespaceObject, "metadata", function() { return latest_posts_metadata; }); 2427 __webpack_require__.d(latest_posts_namespaceObject, "name", function() { return latest_posts_name; }); 2428 __webpack_require__.d(latest_posts_namespaceObject, "settings", function() { return latest_posts_settings; }); 2429 2430 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js 2431 var build_module_list_namespaceObject = {}; 2432 __webpack_require__.r(build_module_list_namespaceObject); 2433 __webpack_require__.d(build_module_list_namespaceObject, "metadata", function() { return list_metadata; }); 2434 __webpack_require__.d(build_module_list_namespaceObject, "name", function() { return list_name; }); 2435 __webpack_require__.d(build_module_list_namespaceObject, "settings", function() { return list_settings; }); 2436 2437 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js 2438 var missing_namespaceObject = {}; 2439 __webpack_require__.r(missing_namespaceObject); 2440 __webpack_require__.d(missing_namespaceObject, "metadata", function() { return missing_metadata; }); 2441 __webpack_require__.d(missing_namespaceObject, "name", function() { return missing_name; }); 2442 __webpack_require__.d(missing_namespaceObject, "settings", function() { return missing_settings; }); 2443 2444 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js 2445 var build_module_more_namespaceObject = {}; 2446 __webpack_require__.r(build_module_more_namespaceObject); 2447 __webpack_require__.d(build_module_more_namespaceObject, "metadata", function() { return more_metadata; }); 2448 __webpack_require__.d(build_module_more_namespaceObject, "name", function() { return more_name; }); 2449 __webpack_require__.d(build_module_more_namespaceObject, "settings", function() { return more_settings; }); 2450 2451 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js 2452 var nextpage_namespaceObject = {}; 2453 __webpack_require__.r(nextpage_namespaceObject); 2454 __webpack_require__.d(nextpage_namespaceObject, "metadata", function() { return nextpage_metadata; }); 2455 __webpack_require__.d(nextpage_namespaceObject, "name", function() { return nextpage_name; }); 2456 __webpack_require__.d(nextpage_namespaceObject, "settings", function() { return nextpage_settings; }); 2457 2458 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js 2459 var build_module_preformatted_namespaceObject = {}; 2460 __webpack_require__.r(build_module_preformatted_namespaceObject); 2461 __webpack_require__.d(build_module_preformatted_namespaceObject, "metadata", function() { return preformatted_metadata; }); 2462 __webpack_require__.d(build_module_preformatted_namespaceObject, "name", function() { return preformatted_name; }); 2463 __webpack_require__.d(build_module_preformatted_namespaceObject, "settings", function() { return preformatted_settings; }); 2464 2465 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js 2466 var build_module_pullquote_namespaceObject = {}; 2467 __webpack_require__.r(build_module_pullquote_namespaceObject); 2468 __webpack_require__.d(build_module_pullquote_namespaceObject, "metadata", function() { return pullquote_metadata; }); 2469 __webpack_require__.d(build_module_pullquote_namespaceObject, "name", function() { return pullquote_name; }); 2470 __webpack_require__.d(build_module_pullquote_namespaceObject, "settings", function() { return pullquote_settings; }); 2471 2472 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js 2473 var block_namespaceObject = {}; 2474 __webpack_require__.r(block_namespaceObject); 2475 __webpack_require__.d(block_namespaceObject, "metadata", function() { return block_metadata; }); 2476 __webpack_require__.d(block_namespaceObject, "name", function() { return block_name; }); 2477 __webpack_require__.d(block_namespaceObject, "settings", function() { return block_settings; }); 2478 2479 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js 2480 var build_module_rss_namespaceObject = {}; 2481 __webpack_require__.r(build_module_rss_namespaceObject); 2482 __webpack_require__.d(build_module_rss_namespaceObject, "metadata", function() { return rss_metadata; }); 2483 __webpack_require__.d(build_module_rss_namespaceObject, "name", function() { return rss_name; }); 2484 __webpack_require__.d(build_module_rss_namespaceObject, "settings", function() { return rss_settings; }); 2485 2486 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js 2487 var search_namespaceObject = {}; 2488 __webpack_require__.r(search_namespaceObject); 2489 __webpack_require__.d(search_namespaceObject, "metadata", function() { return search_metadata; }); 2490 __webpack_require__.d(search_namespaceObject, "name", function() { return search_name; }); 2491 __webpack_require__.d(search_namespaceObject, "settings", function() { return search_settings; }); 2492 2493 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js 2494 var build_module_group_namespaceObject = {}; 2495 __webpack_require__.r(build_module_group_namespaceObject); 2496 __webpack_require__.d(build_module_group_namespaceObject, "metadata", function() { return group_metadata; }); 2497 __webpack_require__.d(build_module_group_namespaceObject, "name", function() { return group_name; }); 2498 __webpack_require__.d(build_module_group_namespaceObject, "settings", function() { return group_settings; }); 2499 2500 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js 2501 var build_module_separator_namespaceObject = {}; 2502 __webpack_require__.r(build_module_separator_namespaceObject); 2503 __webpack_require__.d(build_module_separator_namespaceObject, "metadata", function() { return separator_metadata; }); 2504 __webpack_require__.d(build_module_separator_namespaceObject, "name", function() { return separator_name; }); 2505 __webpack_require__.d(build_module_separator_namespaceObject, "settings", function() { return build_module_separator_settings; }); 2506 2507 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js 2508 var build_module_shortcode_namespaceObject = {}; 2509 __webpack_require__.r(build_module_shortcode_namespaceObject); 2510 __webpack_require__.d(build_module_shortcode_namespaceObject, "metadata", function() { return shortcode_metadata; }); 2511 __webpack_require__.d(build_module_shortcode_namespaceObject, "name", function() { return shortcode_name; }); 2512 __webpack_require__.d(build_module_shortcode_namespaceObject, "settings", function() { return shortcode_settings; }); 2513 2514 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js 2515 var spacer_namespaceObject = {}; 2516 __webpack_require__.r(spacer_namespaceObject); 2517 __webpack_require__.d(spacer_namespaceObject, "metadata", function() { return spacer_metadata; }); 2518 __webpack_require__.d(spacer_namespaceObject, "name", function() { return spacer_name; }); 2519 __webpack_require__.d(spacer_namespaceObject, "settings", function() { return spacer_settings; }); 2520 2521 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/subhead/index.js 2522 var subhead_namespaceObject = {}; 2523 __webpack_require__.r(subhead_namespaceObject); 2524 __webpack_require__.d(subhead_namespaceObject, "metadata", function() { return subhead_metadata; }); 2525 __webpack_require__.d(subhead_namespaceObject, "name", function() { return subhead_name; }); 2526 __webpack_require__.d(subhead_namespaceObject, "settings", function() { return subhead_settings; }); 2527 2528 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js 2529 var build_module_table_namespaceObject = {}; 2530 __webpack_require__.r(build_module_table_namespaceObject); 2531 __webpack_require__.d(build_module_table_namespaceObject, "metadata", function() { return table_metadata; }); 2532 __webpack_require__.d(build_module_table_namespaceObject, "name", function() { return table_name; }); 2533 __webpack_require__.d(build_module_table_namespaceObject, "settings", function() { return table_settings; }); 2534 2535 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js 2536 var text_columns_namespaceObject = {}; 2537 __webpack_require__.r(text_columns_namespaceObject); 2538 __webpack_require__.d(text_columns_namespaceObject, "metadata", function() { return text_columns_metadata; }); 2539 __webpack_require__.d(text_columns_namespaceObject, "name", function() { return text_columns_name; }); 2540 __webpack_require__.d(text_columns_namespaceObject, "settings", function() { return text_columns_settings; }); 2541 2542 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js 2543 var build_module_verse_namespaceObject = {}; 2544 __webpack_require__.r(build_module_verse_namespaceObject); 2545 __webpack_require__.d(build_module_verse_namespaceObject, "metadata", function() { return verse_metadata; }); 2546 __webpack_require__.d(build_module_verse_namespaceObject, "name", function() { return verse_name; }); 2547 __webpack_require__.d(build_module_verse_namespaceObject, "settings", function() { return verse_settings; }); 2548 2549 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js 2550 var build_module_video_namespaceObject = {}; 2551 __webpack_require__.r(build_module_video_namespaceObject); 2552 __webpack_require__.d(build_module_video_namespaceObject, "metadata", function() { return video_metadata; }); 2553 __webpack_require__.d(build_module_video_namespaceObject, "name", function() { return video_name; }); 2554 __webpack_require__.d(build_module_video_namespaceObject, "settings", function() { return video_settings; }); 2555 2556 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js 2557 var tag_cloud_namespaceObject = {}; 2558 __webpack_require__.r(tag_cloud_namespaceObject); 2559 __webpack_require__.d(tag_cloud_namespaceObject, "metadata", function() { return tag_cloud_metadata; }); 2560 __webpack_require__.d(tag_cloud_namespaceObject, "name", function() { return tag_cloud_name; }); 2561 __webpack_require__.d(tag_cloud_namespaceObject, "settings", function() { return tag_cloud_settings; }); 2562 2563 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js 2564 var freeform_namespaceObject = {}; 2565 __webpack_require__.r(freeform_namespaceObject); 2566 __webpack_require__.d(freeform_namespaceObject, "metadata", function() { return freeform_metadata; }); 2567 __webpack_require__.d(freeform_namespaceObject, "name", function() { return freeform_name; }); 2568 __webpack_require__.d(freeform_namespaceObject, "settings", function() { return freeform_settings; }); 2569 2570 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js 2571 var social_links_namespaceObject = {}; 2572 __webpack_require__.r(social_links_namespaceObject); 2573 __webpack_require__.d(social_links_namespaceObject, "metadata", function() { return social_links_metadata; }); 2574 __webpack_require__.d(social_links_namespaceObject, "name", function() { return social_links_name; }); 2575 __webpack_require__.d(social_links_namespaceObject, "settings", function() { return social_links_settings; }); 2576 2577 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js 2578 var social_link_namespaceObject = {}; 2579 __webpack_require__.r(social_link_namespaceObject); 2580 __webpack_require__.d(social_link_namespaceObject, "metadata", function() { return social_link_metadata; }); 2581 __webpack_require__.d(social_link_namespaceObject, "name", function() { return social_link_name; }); 2582 __webpack_require__.d(social_link_namespaceObject, "settings", function() { return social_link_settings; }); 2583 2584 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules 2585 var toConsumableArray = __webpack_require__(15); 2586 2587 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 2588 var defineProperty = __webpack_require__(5); 2589 2590 // EXTERNAL MODULE: external ["wp","coreData"] 2591 var external_wp_coreData_ = __webpack_require__(57); 2592 2593 // EXTERNAL MODULE: external ["wp","blockEditor"] 2594 var external_wp_blockEditor_ = __webpack_require__(6); 2595 2596 // EXTERNAL MODULE: external ["wp","blocks"] 2597 var external_wp_blocks_ = __webpack_require__(9); 2598 2599 // EXTERNAL MODULE: external "lodash" 2600 var external_lodash_ = __webpack_require__(2); 2601 2602 // EXTERNAL MODULE: external ["wp","i18n"] 2603 var external_wp_i18n_ = __webpack_require__(1); 2604 2605 // EXTERNAL MODULE: external ["wp","element"] 2606 var external_wp_element_ = __webpack_require__(0); 2607 2608 // EXTERNAL MODULE: external ["wp","primitives"] 2609 var external_wp_primitives_ = __webpack_require__(7); 2610 2611 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js 2612 2613 2614 /** 2615 * WordPress dependencies 2616 */ 2617 2618 var paragraph = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 2619 xmlns: "http://www.w3.org/2000/svg", 2620 viewBox: "0 0 24 24" 2621 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 2622 d: "M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z" 2623 })); 2624 /* harmony default export */ var library_paragraph = (paragraph); 2625 2626 // EXTERNAL MODULE: ./node_modules/classnames/index.js 2627 var classnames = __webpack_require__(10); 2628 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 2629 2630 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js 2631 2632 2633 2634 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; } 2635 2636 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 2637 2638 /** 2639 * External dependencies 2640 */ 2641 2642 2643 /** 2644 * WordPress dependencies 2645 */ 2646 2647 2648 2649 var supports = { 2650 className: false 2651 }; 2652 var deprecated_blockAttributes = { 2653 align: { 2654 type: 'string' 2655 }, 2656 content: { 2657 type: 'string', 2658 source: 'html', 2659 selector: 'p', 2660 default: '' 2661 }, 2662 dropCap: { 2663 type: 'boolean', 2664 default: false 2665 }, 2666 placeholder: { 2667 type: 'string' 2668 }, 2669 textColor: { 2670 type: 'string' 2671 }, 2672 backgroundColor: { 2673 type: 'string' 2674 }, 2675 fontSize: { 2676 type: 'string' 2677 }, 2678 direction: { 2679 type: 'string', 2680 enum: ['ltr', 'rtl'] 2681 }, 2682 style: { 2683 type: 'object' 2684 } 2685 }; 2686 2687 var deprecated_migrateCustomColorsAndFontSizes = function migrateCustomColorsAndFontSizes(attributes) { 2688 if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) { 2689 return attributes; 2690 } 2691 2692 var style = {}; 2693 2694 if (attributes.customTextColor || attributes.customBackgroundColor) { 2695 style.color = {}; 2696 } 2697 2698 if (attributes.customTextColor) { 2699 style.color.text = attributes.customTextColor; 2700 } 2701 2702 if (attributes.customBackgroundColor) { 2703 style.color.background = attributes.customBackgroundColor; 2704 } 2705 2706 if (attributes.customFontSize) { 2707 style.typography = { 2708 fontSize: attributes.customFontSize 2709 }; 2710 } 2711 2712 return _objectSpread(_objectSpread({}, Object(external_lodash_["omit"])(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize'])), {}, { 2713 style: style 2714 }); 2715 }; 2716 2717 var deprecated = [{ 2718 supports: supports, 2719 attributes: _objectSpread(_objectSpread({}, Object(external_lodash_["omit"])(deprecated_blockAttributes, ['style'])), {}, { 2720 customTextColor: { 2721 type: 'string' 2722 }, 2723 customBackgroundColor: { 2724 type: 'string' 2725 }, 2726 customFontSize: { 2727 type: 'number' 2728 } 2729 }), 2730 migrate: deprecated_migrateCustomColorsAndFontSizes, 2731 save: function save(_ref) { 2732 var _classnames; 2733 2734 var attributes = _ref.attributes; 2735 var align = attributes.align, 2736 content = attributes.content, 2737 dropCap = attributes.dropCap, 2738 backgroundColor = attributes.backgroundColor, 2739 textColor = attributes.textColor, 2740 customBackgroundColor = attributes.customBackgroundColor, 2741 customTextColor = attributes.customTextColor, 2742 fontSize = attributes.fontSize, 2743 customFontSize = attributes.customFontSize, 2744 direction = attributes.direction; 2745 var textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); 2746 var backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); 2747 var fontSizeClass = Object(external_wp_blockEditor_["getFontSizeClass"])(fontSize); 2748 var className = classnames_default()((_classnames = { 2749 'has-text-color': textColor || customTextColor, 2750 'has-background': backgroundColor || customBackgroundColor, 2751 'has-drop-cap': dropCap 2752 }, Object(defineProperty["a" /* default */])(_classnames, "has-text-align-".concat(align), align), Object(defineProperty["a" /* default */])(_classnames, fontSizeClass, fontSizeClass), Object(defineProperty["a" /* default */])(_classnames, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames, backgroundClass, backgroundClass), _classnames)); 2753 var styles = { 2754 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 2755 color: textClass ? undefined : customTextColor, 2756 fontSize: fontSizeClass ? undefined : customFontSize 2757 }; 2758 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 2759 tagName: "p", 2760 style: styles, 2761 className: className ? className : undefined, 2762 value: content, 2763 dir: direction 2764 }); 2765 } 2766 }, { 2767 supports: supports, 2768 attributes: _objectSpread(_objectSpread({}, Object(external_lodash_["omit"])(deprecated_blockAttributes, ['style'])), {}, { 2769 customTextColor: { 2770 type: 'string' 2771 }, 2772 customBackgroundColor: { 2773 type: 'string' 2774 }, 2775 customFontSize: { 2776 type: 'number' 2777 } 2778 }), 2779 migrate: deprecated_migrateCustomColorsAndFontSizes, 2780 save: function save(_ref2) { 2781 var _classnames2; 2782 2783 var attributes = _ref2.attributes; 2784 var align = attributes.align, 2785 content = attributes.content, 2786 dropCap = attributes.dropCap, 2787 backgroundColor = attributes.backgroundColor, 2788 textColor = attributes.textColor, 2789 customBackgroundColor = attributes.customBackgroundColor, 2790 customTextColor = attributes.customTextColor, 2791 fontSize = attributes.fontSize, 2792 customFontSize = attributes.customFontSize, 2793 direction = attributes.direction; 2794 var textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); 2795 var backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); 2796 var fontSizeClass = Object(external_wp_blockEditor_["getFontSizeClass"])(fontSize); 2797 var className = classnames_default()((_classnames2 = { 2798 'has-text-color': textColor || customTextColor, 2799 'has-background': backgroundColor || customBackgroundColor, 2800 'has-drop-cap': dropCap 2801 }, Object(defineProperty["a" /* default */])(_classnames2, fontSizeClass, fontSizeClass), Object(defineProperty["a" /* default */])(_classnames2, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames2, backgroundClass, backgroundClass), _classnames2)); 2802 var styles = { 2803 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 2804 color: textClass ? undefined : customTextColor, 2805 fontSize: fontSizeClass ? undefined : customFontSize, 2806 textAlign: align 2807 }; 2808 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 2809 tagName: "p", 2810 style: styles, 2811 className: className ? className : undefined, 2812 value: content, 2813 dir: direction 2814 }); 2815 } 2816 }, { 2817 supports: supports, 2818 attributes: _objectSpread(_objectSpread({}, Object(external_lodash_["omit"])(deprecated_blockAttributes, ['style'])), {}, { 2819 customTextColor: { 2820 type: 'string' 2821 }, 2822 customBackgroundColor: { 2823 type: 'string' 2824 }, 2825 customFontSize: { 2826 type: 'number' 2827 }, 2828 width: { 2829 type: 'string' 2830 } 2831 }), 2832 migrate: deprecated_migrateCustomColorsAndFontSizes, 2833 save: function save(_ref3) { 2834 var _classnames3; 2835 2836 var attributes = _ref3.attributes; 2837 var width = attributes.width, 2838 align = attributes.align, 2839 content = attributes.content, 2840 dropCap = attributes.dropCap, 2841 backgroundColor = attributes.backgroundColor, 2842 textColor = attributes.textColor, 2843 customBackgroundColor = attributes.customBackgroundColor, 2844 customTextColor = attributes.customTextColor, 2845 fontSize = attributes.fontSize, 2846 customFontSize = attributes.customFontSize; 2847 var textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); 2848 var backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); 2849 var fontSizeClass = fontSize && "is-".concat(fontSize, "-text"); 2850 var className = classnames_default()((_classnames3 = {}, Object(defineProperty["a" /* default */])(_classnames3, "align".concat(width), width), Object(defineProperty["a" /* default */])(_classnames3, 'has-background', backgroundColor || customBackgroundColor), Object(defineProperty["a" /* default */])(_classnames3, 'has-drop-cap', dropCap), Object(defineProperty["a" /* default */])(_classnames3, fontSizeClass, fontSizeClass), Object(defineProperty["a" /* default */])(_classnames3, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames3, backgroundClass, backgroundClass), _classnames3)); 2851 var styles = { 2852 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 2853 color: textClass ? undefined : customTextColor, 2854 fontSize: fontSizeClass ? undefined : customFontSize, 2855 textAlign: align 2856 }; 2857 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 2858 tagName: "p", 2859 style: styles, 2860 className: className ? className : undefined, 2861 value: content 2862 }); 2863 } 2864 }, { 2865 supports: supports, 2866 attributes: Object(external_lodash_["omit"])(_objectSpread(_objectSpread({}, deprecated_blockAttributes), {}, { 2867 fontSize: { 2868 type: 'number' 2869 } 2870 }), ['style']), 2871 save: function save(_ref4) { 2872 var _classnames4; 2873 2874 var attributes = _ref4.attributes; 2875 var width = attributes.width, 2876 align = attributes.align, 2877 content = attributes.content, 2878 dropCap = attributes.dropCap, 2879 backgroundColor = attributes.backgroundColor, 2880 textColor = attributes.textColor, 2881 fontSize = attributes.fontSize; 2882 var className = classnames_default()((_classnames4 = {}, Object(defineProperty["a" /* default */])(_classnames4, "align".concat(width), width), Object(defineProperty["a" /* default */])(_classnames4, 'has-background', backgroundColor), Object(defineProperty["a" /* default */])(_classnames4, 'has-drop-cap', dropCap), _classnames4)); 2883 var styles = { 2884 backgroundColor: backgroundColor, 2885 color: textColor, 2886 fontSize: fontSize, 2887 textAlign: align 2888 }; 2889 return Object(external_wp_element_["createElement"])("p", { 2890 style: styles, 2891 className: className ? className : undefined 2892 }, content); 2893 }, 2894 migrate: function migrate(attributes) { 2895 return deprecated_migrateCustomColorsAndFontSizes(Object(external_lodash_["omit"])(_objectSpread(_objectSpread({}, attributes), {}, { 2896 customFontSize: Object(external_lodash_["isFinite"])(attributes.fontSize) ? attributes.fontSize : undefined, 2897 customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, 2898 customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined 2899 })), ['fontSize', 'textColor', 'backgroundColor', 'style']); 2900 } 2901 }, { 2902 supports: supports, 2903 attributes: _objectSpread(_objectSpread({}, deprecated_blockAttributes), {}, { 2904 content: { 2905 type: 'string', 2906 source: 'html', 2907 default: '' 2908 } 2909 }), 2910 save: function save(_ref5) { 2911 var attributes = _ref5.attributes; 2912 return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, attributes.content); 2913 }, 2914 migrate: function migrate(attributes) { 2915 return attributes; 2916 } 2917 }]; 2918 /* harmony default export */ var paragraph_deprecated = (deprecated); 2919 2920 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 2921 var esm_extends = __webpack_require__(8); 2922 2923 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules 2924 var slicedToArray = __webpack_require__(11); 2925 2926 // EXTERNAL MODULE: external ["wp","components"] 2927 var external_wp_components_ = __webpack_require__(3); 2928 2929 // EXTERNAL MODULE: external ["wp","data"] 2930 var external_wp_data_ = __webpack_require__(4); 2931 2932 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js 2933 2934 2935 /** 2936 * WordPress dependencies 2937 */ 2938 2939 var formatLtr = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 2940 xmlns: "http://www.w3.org/2000/svg", 2941 viewBox: "-2 -2 24 24" 2942 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 2943 d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z" 2944 })); 2945 /* harmony default export */ var format_ltr = (formatLtr); 2946 2947 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js 2948 2949 2950 2951 2952 2953 2954 function edit_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; } 2955 2956 function edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 2957 2958 /** 2959 * External dependencies 2960 */ 2961 2962 /** 2963 * WordPress dependencies 2964 */ 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 function getComputedStyle(node, pseudo) { 2975 return node.ownerDocument.defaultView.getComputedStyle(node, pseudo); 2976 } 2977 2978 var edit_name = 'core/paragraph'; 2979 2980 function ParagraphRTLToolbar(_ref) { 2981 var direction = _ref.direction, 2982 setDirection = _ref.setDirection; 2983 return Object(external_wp_i18n_["isRTL"])() && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], { 2984 controls: [{ 2985 icon: format_ltr, 2986 title: Object(external_wp_i18n_["_x"])('Left to right', 'editor button'), 2987 isActive: direction === 'ltr', 2988 onClick: function onClick() { 2989 setDirection(direction === 'ltr' ? undefined : 'ltr'); 2990 } 2991 }] 2992 }); 2993 } 2994 2995 function useDropCapMinHeight(ref, isDisabled, dependencies) { 2996 var _useState = Object(external_wp_element_["useState"])(), 2997 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 2998 minHeight = _useState2[0], 2999 setMinHeight = _useState2[1]; 3000 3001 Object(external_wp_element_["useEffect"])(function () { 3002 if (isDisabled) { 3003 setMinHeight(); 3004 return; 3005 } 3006 3007 setMinHeight(getComputedStyle(ref.current, 'first-letter').lineHeight); 3008 }, [isDisabled].concat(Object(toConsumableArray["a" /* default */])(dependencies))); 3009 return minHeight; 3010 } 3011 3012 function ParagraphBlock(_ref2) { 3013 var attributes = _ref2.attributes, 3014 mergeBlocks = _ref2.mergeBlocks, 3015 onReplace = _ref2.onReplace, 3016 onRemove = _ref2.onRemove, 3017 setAttributes = _ref2.setAttributes; 3018 var align = attributes.align, 3019 content = attributes.content, 3020 direction = attributes.direction, 3021 dropCap = attributes.dropCap, 3022 placeholder = attributes.placeholder, 3023 fontSize = attributes.fontSize, 3024 style = attributes.style; 3025 var isDropCapFeatureEnabled = Object(external_wp_blockEditor_["__experimentalUseEditorFeature"])('typography.dropCap'); 3026 var ref = Object(external_wp_element_["useRef"])(); 3027 var inlineFontSize = style === null || style === void 0 ? void 0 : style.fontSize; 3028 var size = Object(external_wp_data_["useSelect"])(function (select) { 3029 var _select$getSettings = select('core/block-editor').getSettings(), 3030 fontSizes = _select$getSettings.fontSizes; 3031 3032 return Object(external_wp_blockEditor_["getFontSize"])(fontSizes, fontSize, inlineFontSize).size; 3033 }, [fontSize, inlineFontSize]); 3034 var hasDropCap = isDropCapFeatureEnabled && dropCap; 3035 var minHeight = useDropCapMinHeight(ref, !hasDropCap, [size]); 3036 var blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ 3037 ref: ref, 3038 className: classnames_default()(Object(defineProperty["a" /* default */])({ 3039 'has-drop-cap': dropCap 3040 }, "has-text-align-".concat(align), align)), 3041 style: { 3042 direction: direction, 3043 minHeight: minHeight 3044 } 3045 }); 3046 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentToolbar"], { 3047 value: align, 3048 onChange: function onChange(newAlign) { 3049 return setAttributes({ 3050 align: newAlign 3051 }); 3052 } 3053 }), Object(external_wp_element_["createElement"])(ParagraphRTLToolbar, { 3054 direction: direction, 3055 setDirection: function setDirection(newDirection) { 3056 return setAttributes({ 3057 direction: newDirection 3058 }); 3059 } 3060 })), isDropCapFeatureEnabled && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 3061 title: Object(external_wp_i18n_["__"])('Text settings') 3062 }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { 3063 label: Object(external_wp_i18n_["__"])('Drop cap'), 3064 checked: !!dropCap, 3065 onChange: function onChange() { 3066 return setAttributes({ 3067 dropCap: !dropCap 3068 }); 3069 }, 3070 help: dropCap ? Object(external_wp_i18n_["__"])('Showing large initial letter.') : Object(external_wp_i18n_["__"])('Toggle to show a large initial letter.') 3071 }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({ 3072 identifier: "content", 3073 tagName: "p" 3074 }, blockProps, { 3075 value: content, 3076 onChange: function onChange(newContent) { 3077 return setAttributes({ 3078 content: newContent 3079 }); 3080 }, 3081 onSplit: function onSplit(value) { 3082 if (!value) { 3083 return Object(external_wp_blocks_["createBlock"])(edit_name); 3084 } 3085 3086 return Object(external_wp_blocks_["createBlock"])(edit_name, edit_objectSpread(edit_objectSpread({}, attributes), {}, { 3087 content: value 3088 })); 3089 }, 3090 onMerge: mergeBlocks, 3091 onReplace: onReplace, 3092 onRemove: onRemove, 3093 "aria-label": content ? Object(external_wp_i18n_["__"])('Paragraph block') : Object(external_wp_i18n_["__"])('Empty block; start writing or type forward slash to choose a block'), 3094 placeholder: placeholder || Object(external_wp_i18n_["__"])('Start writing or type / to choose a block'), 3095 __unstableEmbedURLOnPaste: true, 3096 __unstableAllowPrefixTransformations: true 3097 }))); 3098 } 3099 3100 /* harmony default export */ var edit = (ParagraphBlock); 3101 3102 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js 3103 3104 3105 3106 /** 3107 * External dependencies 3108 */ 3109 3110 /** 3111 * WordPress dependencies 3112 */ 3113 3114 3115 function save_save(_ref) { 3116 var attributes = _ref.attributes; 3117 var align = attributes.align, 3118 content = attributes.content, 3119 dropCap = attributes.dropCap, 3120 direction = attributes.direction; 3121 var className = classnames_default()(Object(defineProperty["a" /* default */])({ 3122 'has-drop-cap': dropCap 3123 }, "has-text-align-".concat(align), align)); 3124 return Object(external_wp_element_["createElement"])("p", external_wp_blockEditor_["useBlockProps"].save({ 3125 className: className, 3126 dir: direction 3127 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 3128 value: content 3129 })); 3130 } 3131 3132 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js 3133 /** 3134 * WordPress dependencies 3135 */ 3136 3137 /** 3138 * Internal dependencies 3139 */ 3140 3141 var _apiVersion$name$cate = { 3142 apiVersion: 2, 3143 name: "core/paragraph", 3144 category: "text", 3145 attributes: { 3146 align: { 3147 type: "string" 3148 }, 3149 content: { 3150 type: "string", 3151 source: "html", 3152 selector: "p", 3153 "default": "" 3154 }, 3155 dropCap: { 3156 type: "boolean", 3157 "default": false 3158 }, 3159 placeholder: { 3160 type: "string" 3161 }, 3162 direction: { 3163 type: "string", 3164 "enum": ["ltr", "rtl"] 3165 } 3166 }, 3167 supports: { 3168 anchor: true, 3169 className: false, 3170 color: { 3171 link: true 3172 }, 3173 fontSize: true, 3174 lineHeight: true, 3175 __experimentalSelector: "p", 3176 __unstablePasteTextInline: true 3177 }, 3178 editorStyle: "wp-block-paragraph-editor", 3179 style: "wp-block-paragraph" 3180 }, 3181 transforms_name = _apiVersion$name$cate.name; 3182 var transforms = { 3183 from: [{ 3184 type: 'raw', 3185 // Paragraph is a fallback and should be matched last. 3186 priority: 20, 3187 selector: 'p', 3188 schema: function schema(_ref) { 3189 var phrasingContentSchema = _ref.phrasingContentSchema, 3190 isPaste = _ref.isPaste; 3191 return { 3192 p: { 3193 children: phrasingContentSchema, 3194 attributes: isPaste ? [] : ['style', 'id'] 3195 } 3196 }; 3197 }, 3198 transform: function transform(node) { 3199 var attributes = Object(external_wp_blocks_["getBlockAttributes"])(transforms_name, node.outerHTML); 3200 3201 var _ref2 = node.style || {}, 3202 textAlign = _ref2.textAlign; 3203 3204 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 3205 attributes.align = textAlign; 3206 } 3207 3208 return Object(external_wp_blocks_["createBlock"])(transforms_name, attributes); 3209 } 3210 }] 3211 }; 3212 /* harmony default export */ var paragraph_transforms = (transforms); 3213 3214 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 3215 /** 3216 * External dependencies 3217 */ 3218 3219 /** 3220 * WordPress dependencies 3221 */ 3222 3223 3224 3225 /** 3226 * Internal dependencies 3227 */ 3228 3229 3230 3231 var paragraph_metadata = { 3232 apiVersion: 2, 3233 name: "core/paragraph", 3234 category: "text", 3235 attributes: { 3236 align: { 3237 type: "string" 3238 }, 3239 content: { 3240 type: "string", 3241 source: "html", 3242 selector: "p", 3243 "default": "" 3244 }, 3245 dropCap: { 3246 type: "boolean", 3247 "default": false 3248 }, 3249 placeholder: { 3250 type: "string" 3251 }, 3252 direction: { 3253 type: "string", 3254 "enum": ["ltr", "rtl"] 3255 } 3256 }, 3257 supports: { 3258 anchor: true, 3259 className: false, 3260 color: { 3261 link: true 3262 }, 3263 fontSize: true, 3264 lineHeight: true, 3265 __experimentalSelector: "p", 3266 __unstablePasteTextInline: true 3267 }, 3268 editorStyle: "wp-block-paragraph-editor", 3269 style: "wp-block-paragraph" 3270 }; 3271 3272 3273 var paragraph_name = paragraph_metadata.name; 3274 3275 var paragraph_settings = { 3276 title: Object(external_wp_i18n_["_x"])('Paragraph', 'block title'), 3277 description: Object(external_wp_i18n_["__"])('Start with the building block of all narrative.'), 3278 icon: library_paragraph, 3279 keywords: [Object(external_wp_i18n_["__"])('text')], 3280 example: { 3281 attributes: { 3282 content: Object(external_wp_i18n_["__"])('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'), 3283 style: { 3284 typography: { 3285 fontSize: 28 3286 } 3287 }, 3288 dropCap: true 3289 } 3290 }, 3291 __experimentalLabel: function __experimentalLabel(attributes, _ref) { 3292 var context = _ref.context; 3293 3294 if (context === 'accessibility') { 3295 var content = attributes.content; 3296 return Object(external_lodash_["isEmpty"])(content) ? Object(external_wp_i18n_["__"])('Empty') : content; 3297 } 3298 }, 3299 transforms: paragraph_transforms, 3300 deprecated: paragraph_deprecated, 3301 merge: function merge(attributes, attributesToMerge) { 3302 return { 3303 content: (attributes.content || '') + (attributesToMerge.content || '') 3304 }; 3305 }, 3306 edit: edit, 3307 save: save_save 3308 }; 3309 3310 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js 3311 3312 3313 /** 3314 * WordPress dependencies 3315 */ 3316 3317 var image_image = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 3318 viewBox: "0 0 24 24", 3319 xmlns: "http://www.w3.org/2000/svg" 3320 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 3321 d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" 3322 })); 3323 /* harmony default export */ var library_image = (image_image); 3324 3325 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js 3326 3327 3328 3329 3330 /** 3331 * External dependencies 3332 */ 3333 3334 /** 3335 * WordPress dependencies 3336 */ 3337 3338 3339 var image_deprecated_blockAttributes = { 3340 align: { 3341 type: 'string' 3342 }, 3343 url: { 3344 type: 'string', 3345 source: 'attribute', 3346 selector: 'img', 3347 attribute: 'src' 3348 }, 3349 alt: { 3350 type: 'string', 3351 source: 'attribute', 3352 selector: 'img', 3353 attribute: 'alt', 3354 default: '' 3355 }, 3356 caption: { 3357 type: 'string', 3358 source: 'html', 3359 selector: 'figcaption' 3360 }, 3361 href: { 3362 type: 'string', 3363 source: 'attribute', 3364 selector: 'figure > a', 3365 attribute: 'href' 3366 }, 3367 rel: { 3368 type: 'string', 3369 source: 'attribute', 3370 selector: 'figure > a', 3371 attribute: 'rel' 3372 }, 3373 linkClass: { 3374 type: 'string', 3375 source: 'attribute', 3376 selector: 'figure > a', 3377 attribute: 'class' 3378 }, 3379 id: { 3380 type: 'number' 3381 }, 3382 width: { 3383 type: 'number' 3384 }, 3385 height: { 3386 type: 'number' 3387 }, 3388 linkDestination: { 3389 type: 'string' 3390 }, 3391 linkTarget: { 3392 type: 'string', 3393 source: 'attribute', 3394 selector: 'figure > a', 3395 attribute: 'target' 3396 } 3397 }; 3398 var deprecated_deprecated = [{ 3399 attributes: image_deprecated_blockAttributes, 3400 save: function save(_ref) { 3401 var _classnames; 3402 3403 var attributes = _ref.attributes; 3404 var url = attributes.url, 3405 alt = attributes.alt, 3406 caption = attributes.caption, 3407 align = attributes.align, 3408 href = attributes.href, 3409 width = attributes.width, 3410 height = attributes.height, 3411 id = attributes.id; 3412 var classes = classnames_default()((_classnames = {}, Object(defineProperty["a" /* default */])(_classnames, "align".concat(align), align), Object(defineProperty["a" /* default */])(_classnames, 'is-resized', width || height), _classnames)); 3413 var image = Object(external_wp_element_["createElement"])("img", { 3414 src: url, 3415 alt: alt, 3416 className: id ? "wp-image-".concat(id) : null, 3417 width: width, 3418 height: height 3419 }); 3420 return Object(external_wp_element_["createElement"])("figure", { 3421 className: classes 3422 }, href ? Object(external_wp_element_["createElement"])("a", { 3423 href: href 3424 }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 3425 tagName: "figcaption", 3426 value: caption 3427 })); 3428 } 3429 }, { 3430 attributes: image_deprecated_blockAttributes, 3431 save: function save(_ref2) { 3432 var attributes = _ref2.attributes; 3433 var url = attributes.url, 3434 alt = attributes.alt, 3435 caption = attributes.caption, 3436 align = attributes.align, 3437 href = attributes.href, 3438 width = attributes.width, 3439 height = attributes.height, 3440 id = attributes.id; 3441 var image = Object(external_wp_element_["createElement"])("img", { 3442 src: url, 3443 alt: alt, 3444 className: id ? "wp-image-".concat(id) : null, 3445 width: width, 3446 height: height 3447 }); 3448 return Object(external_wp_element_["createElement"])("figure", { 3449 className: align ? "align".concat(align) : null 3450 }, href ? Object(external_wp_element_["createElement"])("a", { 3451 href: href 3452 }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 3453 tagName: "figcaption", 3454 value: caption 3455 })); 3456 } 3457 }, { 3458 attributes: image_deprecated_blockAttributes, 3459 save: function save(_ref3) { 3460 var attributes = _ref3.attributes; 3461 var url = attributes.url, 3462 alt = attributes.alt, 3463 caption = attributes.caption, 3464 align = attributes.align, 3465 href = attributes.href, 3466 width = attributes.width, 3467 height = attributes.height; 3468 var extraImageProps = width || height ? { 3469 width: width, 3470 height: height 3471 } : {}; 3472 var image = Object(external_wp_element_["createElement"])("img", Object(esm_extends["a" /* default */])({ 3473 src: url, 3474 alt: alt 3475 }, extraImageProps)); 3476 var figureStyle = {}; 3477 3478 if (width) { 3479 figureStyle = { 3480 width: width 3481 }; 3482 } else if (align === 'left' || align === 'right') { 3483 figureStyle = { 3484 maxWidth: '50%' 3485 }; 3486 } 3487 3488 return Object(external_wp_element_["createElement"])("figure", { 3489 className: align ? "align".concat(align) : null, 3490 style: figureStyle 3491 }, href ? Object(external_wp_element_["createElement"])("a", { 3492 href: href 3493 }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 3494 tagName: "figcaption", 3495 value: caption 3496 })); 3497 } 3498 }]; 3499 /* harmony default export */ var image_deprecated = (deprecated_deprecated); 3500 3501 // EXTERNAL MODULE: external ["wp","blob"] 3502 var external_wp_blob_ = __webpack_require__(43); 3503 3504 // EXTERNAL MODULE: external ["wp","compose"] 3505 var external_wp_compose_ = __webpack_require__(12); 3506 3507 // EXTERNAL MODULE: external ["wp","url"] 3508 var external_wp_url_ = __webpack_require__(32); 3509 3510 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js 3511 3512 3513 /** 3514 * WordPress dependencies 3515 */ 3516 3517 var crop_crop = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 3518 xmlns: "http://www.w3.org/2000/svg", 3519 viewBox: "0 0 24 24" 3520 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 3521 d: "M17.5 7v8H19V7c0-1.1-.9-2-2-2H9v1.5h8c.3 0 .5.2.5.5zM7 17.5c-.3 0-.5-.2-.5-.5V1H5v4H1v1.5h4V17c0 1.1.9 2 2 2h10.5v4H19v-4h4v-1.5H7z" 3522 })); 3523 /* harmony default export */ var library_crop = (crop_crop); 3524 3525 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js 3526 var upload = __webpack_require__(221); 3527 3528 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js 3529 var text_color = __webpack_require__(222); 3530 3531 // EXTERNAL MODULE: external ["wp","notices"] 3532 var external_wp_notices_ = __webpack_require__(51); 3533 3534 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js 3535 var ASPECT_RATIOS = [// Common video resolutions. 3536 { 3537 ratio: '2.33', 3538 className: 'wp-embed-aspect-21-9' 3539 }, { 3540 ratio: '2.00', 3541 className: 'wp-embed-aspect-18-9' 3542 }, { 3543 ratio: '1.78', 3544 className: 'wp-embed-aspect-16-9' 3545 }, { 3546 ratio: '1.33', 3547 className: 'wp-embed-aspect-4-3' 3548 }, // Vertical video and instagram square video support. 3549 { 3550 ratio: '1.00', 3551 className: 'wp-embed-aspect-1-1' 3552 }, { 3553 ratio: '0.56', 3554 className: 'wp-embed-aspect-9-16' 3555 }, { 3556 ratio: '0.50', 3557 className: 'wp-embed-aspect-1-2' 3558 }]; 3559 var WP_EMBED_TYPE = 'wp-embed'; 3560 3561 // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js 3562 var dedupe = __webpack_require__(117); 3563 var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe); 3564 3565 // EXTERNAL MODULE: ./node_modules/memize/index.js 3566 var memize = __webpack_require__(71); 3567 var memize_default = /*#__PURE__*/__webpack_require__.n(memize); 3568 3569 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js 3570 3571 3572 3573 function util_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; } 3574 3575 function util_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { util_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { util_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 3576 3577 /** 3578 * Internal dependencies 3579 */ 3580 3581 /** 3582 * External dependencies 3583 */ 3584 3585 3586 3587 3588 /** 3589 * WordPress dependencies 3590 */ 3591 3592 3593 3594 /** 3595 * Internal dependencies 3596 */ 3597 3598 var util_metadata = { 3599 apiVersion: 2, 3600 name: "core/embed", 3601 category: "embed", 3602 attributes: { 3603 url: { 3604 type: "string" 3605 }, 3606 caption: { 3607 type: "string", 3608 source: "html", 3609 selector: "figcaption" 3610 }, 3611 type: { 3612 type: "string" 3613 }, 3614 providerNameSlug: { 3615 type: "string" 3616 }, 3617 allowResponsive: { 3618 type: "boolean", 3619 "default": true 3620 }, 3621 responsive: { 3622 type: "boolean", 3623 "default": false 3624 }, 3625 previewable: { 3626 type: "boolean", 3627 "default": true 3628 } 3629 }, 3630 supports: { 3631 align: true 3632 }, 3633 editorStyle: "wp-block-embed-editor", 3634 style: "wp-block-embed" 3635 }; 3636 var DEFAULT_EMBED_BLOCK = util_metadata.name; 3637 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 3638 3639 /** 3640 * Returns the embed block's information by matching the provided service provider 3641 * 3642 * @param {string} provider The embed block's provider 3643 * @return {WPBlockVariation} The embed block's information 3644 */ 3645 3646 var util_getEmbedInfoByProvider = function getEmbedInfoByProvider(provider) { 3647 var _getBlockVariations; 3648 3649 return (_getBlockVariations = Object(external_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(function (_ref) { 3650 var name = _ref.name; 3651 return name === provider; 3652 }); 3653 }; 3654 /** 3655 * Returns true if any of the regular expressions match the URL. 3656 * 3657 * @param {string} url The URL to test. 3658 * @param {Array} patterns The list of regular expressions to test agains. 3659 * @return {boolean} True if any of the regular expressions match the URL. 3660 */ 3661 3662 var matchesPatterns = function matchesPatterns(url) { 3663 var patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 3664 return patterns.some(function (pattern) { 3665 return url.match(pattern); 3666 }); 3667 }; 3668 /** 3669 * Finds the block variation that should be used for the URL, 3670 * based on the provided URL and the variation's patterns. 3671 * 3672 * @param {string} url The URL to test. 3673 * @return {WPBlockVariation} The block variation that should be used for this URL 3674 */ 3675 3676 var util_findMoreSuitableBlock = function findMoreSuitableBlock(url) { 3677 var _getBlockVariations2; 3678 3679 return (_getBlockVariations2 = Object(external_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(function (_ref2) { 3680 var patterns = _ref2.patterns; 3681 return matchesPatterns(url, patterns); 3682 }); 3683 }; 3684 var isFromWordPress = function isFromWordPress(html) { 3685 return html && html.includes('class="wp-embedded-content"'); 3686 }; 3687 var util_getPhotoHtml = function getPhotoHtml(photo) { 3688 // 100% width for the preview so it fits nicely into the document, some "thumbnails" are 3689 // actually the full size photo. If thumbnails not found, use full image. 3690 var imageUrl = photo.thumbnail_url || photo.url; 3691 var photoPreview = Object(external_wp_element_["createElement"])("p", null, Object(external_wp_element_["createElement"])("img", { 3692 src: imageUrl, 3693 alt: photo.title, 3694 width: "100%" 3695 })); 3696 return Object(external_wp_element_["renderToString"])(photoPreview); 3697 }; 3698 /** 3699 * Creates a more suitable embed block based on the passed in props 3700 * and attributes generated from an embed block's preview. 3701 * 3702 * We require `attributesFromPreview` to be generated from the latest attributes 3703 * and preview, and because of the way the react lifecycle operates, we can't 3704 * guarantee that the attributes contained in the block's props are the latest 3705 * versions, so we require that these are generated separately. 3706 * See `getAttributesFromPreview` in the generated embed edit component. 3707 * 3708 * @param {Object} props The block's props. 3709 * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview. 3710 * @return {Object|undefined} A more suitable embed block if one exists. 3711 */ 3712 3713 var util_createUpgradedEmbedBlock = function createUpgradedEmbedBlock(props) { 3714 var _getBlockVariations3; 3715 3716 var attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 3717 var preview = props.preview, 3718 _props$attributes = props.attributes; 3719 _props$attributes = _props$attributes === void 0 ? {} : _props$attributes; 3720 var url = _props$attributes.url, 3721 providerNameSlug = _props$attributes.providerNameSlug, 3722 type = _props$attributes.type; 3723 if (!url || !Object(external_wp_blocks_["getBlockType"])(DEFAULT_EMBED_BLOCK)) return; 3724 var matchedBlock = util_findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns, 3725 // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. 3726 3727 var isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // if current block is not WordPress and a more suitable block found 3728 // that is different from the current one, create the new matched block 3729 3730 var shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); 3731 3732 if (shouldCreateNewBlock) { 3733 return Object(external_wp_blocks_["createBlock"])(DEFAULT_EMBED_BLOCK, util_objectSpread({ 3734 url: url 3735 }, matchedBlock.attributes)); 3736 } 3737 3738 var wpVariation = (_getBlockVariations3 = Object(external_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(function (_ref3) { 3739 var name = _ref3.name; 3740 return name === 'wordpress'; 3741 }); // We can't match the URL for WordPress embeds, we have to check the HTML instead. 3742 3743 if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { 3744 return; 3745 } // This is not the WordPress embed block so transform it into one. 3746 3747 3748 return Object(external_wp_blocks_["createBlock"])(DEFAULT_EMBED_BLOCK, util_objectSpread(util_objectSpread({ 3749 url: url 3750 }, wpVariation.attributes), attributesFromPreview)); 3751 }; 3752 /** 3753 * Removes all previously set aspect ratio related classes and return the rest 3754 * existing class names. 3755 * 3756 * @param {string} existingClassNames Any existing class names. 3757 * @return {string} The class names without any aspect ratio related class. 3758 */ 3759 3760 var util_removeAspectRatioClasses = function removeAspectRatioClasses(existingClassNames) { 3761 var aspectRatioClassNames = ASPECT_RATIOS.reduce(function (accumulator, _ref4) { 3762 var className = _ref4.className; 3763 accumulator[className] = false; 3764 return accumulator; 3765 }, { 3766 'wp-has-aspect-ratio': false 3767 }); 3768 return dedupe_default()(existingClassNames, aspectRatioClassNames); 3769 }; 3770 /** 3771 * Returns class names with any relevant responsive aspect ratio names. 3772 * 3773 * @param {string} html The preview HTML that possibly contains an iframe with width and height set. 3774 * @param {string} existingClassNames Any existing class names. 3775 * @param {boolean} allowResponsive If the responsive class names should be added, or removed. 3776 * @return {string} Deduped class names. 3777 */ 3778 3779 function getClassNames(html) { 3780 var existingClassNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 3781 var allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 3782 3783 if (!allowResponsive) { 3784 return util_removeAspectRatioClasses(existingClassNames); 3785 } 3786 3787 var previewDocument = document.implementation.createHTMLDocument(''); 3788 previewDocument.body.innerHTML = html; 3789 var iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block. 3790 3791 if (iframe && iframe.height && iframe.width) { 3792 var aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it. 3793 3794 for (var ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { 3795 var potentialRatio = ASPECT_RATIOS[ratioIndex]; 3796 3797 if (aspectRatio >= potentialRatio.ratio) { 3798 return dedupe_default()(util_removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); 3799 } 3800 } 3801 } 3802 3803 return existingClassNames; 3804 } 3805 /** 3806 * Fallback behaviour for unembeddable URLs. 3807 * Creates a paragraph block containing a link to the URL, and calls `onReplace`. 3808 * 3809 * @param {string} url The URL that could not be embedded. 3810 * @param {Function} onReplace Function to call with the created fallback block. 3811 */ 3812 3813 function util_fallback(url, onReplace) { 3814 var link = Object(external_wp_element_["createElement"])("a", { 3815 href: url 3816 }, url); 3817 onReplace(Object(external_wp_blocks_["createBlock"])('core/paragraph', { 3818 content: Object(external_wp_element_["renderToString"])(link) 3819 })); 3820 } 3821 /*** 3822 * Gets block attributes based on the preview and responsive state. 3823 * 3824 * @param {Object} preview The preview data. 3825 * @param {string} title The block's title, e.g. Twitter. 3826 * @param {Object} currentClassNames The block's current class names. 3827 * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. 3828 * @param {boolean} allowResponsive Apply responsive classes to fixed size content. 3829 * @return {Object} Attributes and values. 3830 */ 3831 3832 var getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) { 3833 var allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; 3834 3835 if (!preview) { 3836 return {}; 3837 } 3838 3839 var attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'. 3840 3841 var _preview$type = preview.type, 3842 type = _preview$type === void 0 ? 'rich' : _preview$type; // If we got a provider name from the API, use it for the slug, otherwise we use the title, 3843 // because not all embed code gives us a provider name. 3844 3845 var html = preview.html, 3846 providerName = preview.provider_name; 3847 var providerNameSlug = Object(external_lodash_["kebabCase"])((providerName || title).toLowerCase()); 3848 3849 if (isFromWordPress(html)) { 3850 type = WP_EMBED_TYPE; 3851 } 3852 3853 if (html || 'photo' === type) { 3854 attributes.type = type; 3855 attributes.providerNameSlug = providerNameSlug; 3856 } 3857 3858 attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive); 3859 return attributes; 3860 }); 3861 3862 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js 3863 3864 3865 /** 3866 * WordPress dependencies 3867 */ 3868 3869 function useClientWidth(ref, dependencies) { 3870 var _useState = Object(external_wp_element_["useState"])(), 3871 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 3872 clientWidth = _useState2[0], 3873 setClientWidth = _useState2[1]; 3874 3875 function calculateClientWidth() { 3876 setClientWidth(ref.current.clientWidth); 3877 } 3878 3879 Object(external_wp_element_["useEffect"])(calculateClientWidth, dependencies); 3880 Object(external_wp_element_["useEffect"])(function () { 3881 var defaultView = ref.current.ownerDocument.defaultView; 3882 defaultView.addEventListener('resize', calculateClientWidth); 3883 return function () { 3884 defaultView.removeEventListener('resize', calculateClientWidth); 3885 }; 3886 }, []); 3887 return clientWidth; 3888 } 3889 3890 // CONCATENATED MODULE: ./node_modules/react-easy-crop/node_modules/tslib/tslib.es6.js 3891 /*! ***************************************************************************** 3892 Copyright (c) Microsoft Corporation. 3893 3894 Permission to use, copy, modify, and/or distribute this software for any 3895 purpose with or without fee is hereby granted. 3896 3897 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 3898 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 3899 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 3900 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 3901 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 3902 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 3903 PERFORMANCE OF THIS SOFTWARE. 3904 ***************************************************************************** */ 3905 /* global Reflect, Promise */ 3906 3907 var extendStatics = function(d, b) { 3908 extendStatics = Object.setPrototypeOf || 3909 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 3910 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 3911 return extendStatics(d, b); 3912 }; 3913 3914 function __extends(d, b) { 3915 extendStatics(d, b); 3916 function __() { this.constructor = d; } 3917 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 3918 } 3919 3920 var __assign = function() { 3921 __assign = Object.assign || function __assign(t) { 3922 for (var s, i = 1, n = arguments.length; i < n; i++) { 3923 s = arguments[i]; 3924 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 3925 } 3926 return t; 3927 } 3928 return __assign.apply(this, arguments); 3929 } 3930 3931 function __rest(s, e) { 3932 var t = {}; 3933 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 3934 t[p] = s[p]; 3935 if (s != null && typeof Object.getOwnPropertySymbols === "function") 3936 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 3937 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 3938 t[p[i]] = s[p[i]]; 3939 } 3940 return t; 3941 } 3942 3943 function __decorate(decorators, target, key, desc) { 3944 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3945 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 3946 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; 3947 return c > 3 && r && Object.defineProperty(target, key, r), r; 3948 } 3949 3950 function __param(paramIndex, decorator) { 3951 return function (target, key) { decorator(target, key, paramIndex); } 3952 } 3953 3954 function __metadata(metadataKey, metadataValue) { 3955 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 3956 } 3957 3958 function __awaiter(thisArg, _arguments, P, generator) { 3959 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 3960 return new (P || (P = Promise))(function (resolve, reject) { 3961 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 3962 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 3963 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 3964 step((generator = generator.apply(thisArg, _arguments || [])).next()); 3965 }); 3966 } 3967 3968 function __generator(thisArg, body) { 3969 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 3970 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 3971 function verb(n) { return function (v) { return step([n, v]); }; } 3972 function step(op) { 3973 if (f) throw new TypeError("Generator is already executing."); 3974 while (_) try { 3975 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; 3976 if (y = 0, t) op = [op[0] & 2, t.value]; 3977 switch (op[0]) { 3978 case 0: case 1: t = op; break; 3979 case 4: _.label++; return { value: op[1], done: false }; 3980 case 5: _.label++; y = op[1]; op = [0]; continue; 3981 case 7: op = _.ops.pop(); _.trys.pop(); continue; 3982 default: 3983 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 3984 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 3985 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 3986 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 3987 if (t[2]) _.ops.pop(); 3988 _.trys.pop(); continue; 3989 } 3990 op = body.call(thisArg, _); 3991 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 3992 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 3993 } 3994 } 3995 3996 var __createBinding = Object.create ? (function(o, m, k, k2) { 3997 if (k2 === undefined) k2 = k; 3998 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 3999 }) : (function(o, m, k, k2) { 4000 if (k2 === undefined) k2 = k; 4001 o[k2] = m[k]; 4002 }); 4003 4004 function __exportStar(m, o) { 4005 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 4006 } 4007 4008 function __values(o) { 4009 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 4010 if (m) return m.call(o); 4011 if (o && typeof o.length === "number") return { 4012 next: function () { 4013 if (o && i >= o.length) o = void 0; 4014 return { value: o && o[i++], done: !o }; 4015 } 4016 }; 4017 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 4018 } 4019 4020 function __read(o, n) { 4021 var m = typeof Symbol === "function" && o[Symbol.iterator]; 4022 if (!m) return o; 4023 var i = m.call(o), r, ar = [], e; 4024 try { 4025 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 4026 } 4027 catch (error) { e = { error: error }; } 4028 finally { 4029 try { 4030 if (r && !r.done && (m = i["return"])) m.call(i); 4031 } 4032 finally { if (e) throw e.error; } 4033 } 4034 return ar; 4035 } 4036 4037 function __spread() { 4038 for (var ar = [], i = 0; i < arguments.length; i++) 4039 ar = ar.concat(__read(arguments[i])); 4040 return ar; 4041 } 4042 4043 function __spreadArrays() { 4044 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 4045 for (var r = Array(s), k = 0, i = 0; i < il; i++) 4046 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 4047 r[k] = a[j]; 4048 return r; 4049 }; 4050 4051 function __await(v) { 4052 return this instanceof __await ? (this.v = v, this) : new __await(v); 4053 } 4054 4055 function __asyncGenerator(thisArg, _arguments, generator) { 4056 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 4057 var g = generator.apply(thisArg, _arguments || []), i, q = []; 4058 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 4059 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); }); }; } 4060 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 4061 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 4062 function fulfill(value) { resume("next", value); } 4063 function reject(value) { resume("throw", value); } 4064 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 4065 } 4066 4067 function __asyncDelegator(o) { 4068 var i, p; 4069 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 4070 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; } 4071 } 4072 4073 function __asyncValues(o) { 4074 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 4075 var m = o[Symbol.asyncIterator], i; 4076 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); 4077 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); }); }; } 4078 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 4079 } 4080 4081 function __makeTemplateObject(cooked, raw) { 4082 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 4083 return cooked; 4084 }; 4085 4086 var __setModuleDefault = Object.create ? (function(o, v) { 4087 Object.defineProperty(o, "default", { enumerable: true, value: v }); 4088 }) : function(o, v) { 4089 o["default"] = v; 4090 }; 4091 4092 function __importStar(mod) { 4093 if (mod && mod.__esModule) return mod; 4094 var result = {}; 4095 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 4096 __setModuleDefault(result, mod); 4097 return result; 4098 } 4099 4100 function __importDefault(mod) { 4101 return (mod && mod.__esModule) ? mod : { default: mod }; 4102 } 4103 4104 function __classPrivateFieldGet(receiver, privateMap) { 4105 if (!privateMap.has(receiver)) { 4106 throw new TypeError("attempted to get private field on non-instance"); 4107 } 4108 return privateMap.get(receiver); 4109 } 4110 4111 function __classPrivateFieldSet(receiver, privateMap, value) { 4112 if (!privateMap.has(receiver)) { 4113 throw new TypeError("attempted to set private field on non-instance"); 4114 } 4115 privateMap.set(receiver, value); 4116 return value; 4117 } 4118 4119 // EXTERNAL MODULE: external "React" 4120 var external_React_ = __webpack_require__(14); 4121 var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); 4122 4123 // EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js 4124 var normalize_wheel = __webpack_require__(282); 4125 var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel); 4126 4127 // CONCATENATED MODULE: ./node_modules/react-easy-crop/index.module.js 4128 4129 4130 4131 4132 /** 4133 * Compute the dimension of the crop area based on media size, 4134 * aspect ratio and optionally rotation 4135 */ 4136 4137 function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) { 4138 if (rotation === void 0) { 4139 rotation = 0; 4140 } 4141 4142 var _a = translateSize(mediaWidth, mediaHeight, rotation), 4143 width = _a.width, 4144 height = _a.height; 4145 4146 var fittingWidth = Math.min(width, containerWidth); 4147 var fittingHeight = Math.min(height, containerHeight); 4148 4149 if (fittingWidth > fittingHeight * aspect) { 4150 return { 4151 width: fittingHeight * aspect, 4152 height: fittingHeight 4153 }; 4154 } 4155 4156 return { 4157 width: fittingWidth, 4158 height: fittingWidth / aspect 4159 }; 4160 } 4161 /** 4162 * Ensure a new media position stays in the crop area. 4163 */ 4164 4165 function index_module_restrictPosition(position, mediaSize, cropSize, zoom, rotation) { 4166 if (rotation === void 0) { 4167 rotation = 0; 4168 } 4169 4170 var _a = translateSize(mediaSize.width, mediaSize.height, rotation), 4171 width = _a.width, 4172 height = _a.height; 4173 4174 return { 4175 x: restrictPositionCoord(position.x, width, cropSize.width, zoom), 4176 y: restrictPositionCoord(position.y, height, cropSize.height, zoom) 4177 }; 4178 } 4179 4180 function restrictPositionCoord(position, mediaSize, cropSize, zoom) { 4181 var maxPosition = mediaSize * zoom / 2 - cropSize / 2; 4182 return Math.min(maxPosition, Math.max(position, -maxPosition)); 4183 } 4184 4185 function getDistanceBetweenPoints(pointA, pointB) { 4186 return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2)); 4187 } 4188 function getRotationBetweenPoints(pointA, pointB) { 4189 return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI; 4190 } 4191 /** 4192 * Compute the output cropped area of the media in percentages and pixels. 4193 * x/y are the top-left coordinates on the src media 4194 */ 4195 4196 function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) { 4197 if (rotation === void 0) { 4198 rotation = 0; 4199 } 4200 4201 if (restrictPosition === void 0) { 4202 restrictPosition = true; 4203 } // if the media is rotated by the user, we cannot limit the position anymore 4204 // as it might need to be negative. 4205 4206 4207 var limitAreaFn = restrictPosition && rotation === 0 ? limitArea : noOp; 4208 var croppedAreaPercentages = { 4209 x: limitAreaFn(100, ((mediaSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaSize.width * 100), 4210 y: limitAreaFn(100, ((mediaSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaSize.height * 100), 4211 width: limitAreaFn(100, cropSize.width / mediaSize.width * 100 / zoom), 4212 height: limitAreaFn(100, cropSize.height / mediaSize.height * 100 / zoom) 4213 }; // we compute the pixels size naively 4214 4215 var widthInPixels = Math.round(limitAreaFn(mediaSize.naturalWidth, croppedAreaPercentages.width * mediaSize.naturalWidth / 100)); 4216 var heightInPixels = Math.round(limitAreaFn(mediaSize.naturalHeight, croppedAreaPercentages.height * mediaSize.naturalHeight / 100)); 4217 var isImgWiderThanHigh = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; // then we ensure the width and height exactly match the aspect (to avoid rounding approximations) 4218 // if the media is wider than high, when zoom is 0, the crop height will be equals to iamge height 4219 // thus we want to compute the width from the height and aspect for accuracy. 4220 // Otherwise, we compute the height from width and aspect. 4221 4222 var sizePixels = isImgWiderThanHigh ? { 4223 width: Math.round(heightInPixels * aspect), 4224 height: heightInPixels 4225 } : { 4226 width: widthInPixels, 4227 height: Math.round(widthInPixels / aspect) 4228 }; 4229 4230 var croppedAreaPixels = __assign(__assign({}, sizePixels), { 4231 x: Math.round(limitAreaFn(mediaSize.naturalWidth - sizePixels.width, croppedAreaPercentages.x * mediaSize.naturalWidth / 100)), 4232 y: Math.round(limitAreaFn(mediaSize.naturalHeight - sizePixels.height, croppedAreaPercentages.y * mediaSize.naturalHeight / 100)) 4233 }); 4234 4235 return { 4236 croppedAreaPercentages: croppedAreaPercentages, 4237 croppedAreaPixels: croppedAreaPixels 4238 }; 4239 } 4240 /** 4241 * Ensure the returned value is between 0 and max 4242 */ 4243 4244 function limitArea(max, value) { 4245 return Math.min(max, Math.max(0, value)); 4246 } 4247 4248 function noOp(_max, value) { 4249 return value; 4250 } 4251 /** 4252 * Compute the crop and zoom from the croppedAreaPixels 4253 */ 4254 4255 4256 function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { 4257 var mediaZoom = mediaSize.width / mediaSize.naturalWidth; 4258 4259 if (cropSize) { 4260 var isHeightMaxSize_1 = cropSize.height > cropSize.width; 4261 return isHeightMaxSize_1 ? cropSize.height / mediaZoom / croppedAreaPixels.height : cropSize.width / mediaZoom / croppedAreaPixels.width; 4262 } 4263 4264 var aspect = croppedAreaPixels.width / croppedAreaPixels.height; 4265 var isHeightMaxSize = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; 4266 return isHeightMaxSize ? mediaSize.naturalHeight / croppedAreaPixels.height : mediaSize.naturalWidth / croppedAreaPixels.width; 4267 } 4268 /** 4269 * Compute the crop and zoom from the croppedAreaPixels 4270 */ 4271 4272 4273 function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { 4274 var mediaZoom = mediaSize.width / mediaSize.naturalWidth; 4275 var zoom = getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize); 4276 var cropZoom = mediaZoom * zoom; 4277 var crop = { 4278 x: ((mediaSize.naturalWidth - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom, 4279 y: ((mediaSize.naturalHeight - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom 4280 }; 4281 return { 4282 crop: crop, 4283 zoom: zoom 4284 }; 4285 } 4286 /** 4287 * Return the point that is the center of point a and b 4288 */ 4289 4290 function getCenter(a, b) { 4291 return { 4292 x: (b.x + a.x) / 2, 4293 y: (b.y + a.y) / 2 4294 }; 4295 } 4296 /** 4297 * 4298 * Returns an x,y point once rotated around xMid,yMid 4299 */ 4300 4301 function rotateAroundMidPoint(x, y, xMid, yMid, degrees) { 4302 var cos = Math.cos; 4303 var sin = Math.sin; 4304 var radian = degrees * Math.PI / 180; // Convert to radians 4305 // Subtract midpoints, so that midpoint is translated to origin 4306 // and add it in the end again 4307 4308 var xr = (x - xMid) * cos(radian) - (y - yMid) * sin(radian) + xMid; 4309 var yr = (x - xMid) * sin(radian) + (y - yMid) * cos(radian) + yMid; 4310 return [xr, yr]; 4311 } 4312 /** 4313 * Returns the new bounding area of a rotated rectangle. 4314 */ 4315 4316 function translateSize(width, height, rotation) { 4317 var centerX = width / 2; 4318 var centerY = height / 2; 4319 var outerBounds = [rotateAroundMidPoint(0, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, height, centerX, centerY, rotation), rotateAroundMidPoint(0, height, centerX, centerY, rotation)]; 4320 var minX = Math.min.apply(Math, outerBounds.map(function (p) { 4321 return p[0]; 4322 })); 4323 var maxX = Math.max.apply(Math, outerBounds.map(function (p) { 4324 return p[0]; 4325 })); 4326 var minY = Math.min.apply(Math, outerBounds.map(function (p) { 4327 return p[1]; 4328 })); 4329 var maxY = Math.max.apply(Math, outerBounds.map(function (p) { 4330 return p[1]; 4331 })); 4332 return { 4333 width: maxX - minX, 4334 height: maxY - minY 4335 }; 4336 } 4337 /** 4338 * Combine multiple class names into a single string. 4339 */ 4340 4341 function index_module_classNames() { 4342 var args = []; 4343 4344 for (var _i = 0; _i < arguments.length; _i++) { 4345 args[_i] = arguments[_i]; 4346 } 4347 4348 return args.filter(function (value) { 4349 if (typeof value === 'string' && value.length > 0) { 4350 return true; 4351 } 4352 4353 return false; 4354 }).join(' ').trim(); 4355 } 4356 4357 var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n"; 4358 4359 var MIN_ZOOM = 1; 4360 var MAX_ZOOM = 3; 4361 4362 var index_module_Cropper = 4363 /** @class */ 4364 function (_super) { 4365 __extends(Cropper, _super); 4366 4367 function Cropper() { 4368 var _this = _super !== null && _super.apply(this, arguments) || this; 4369 4370 _this.imageRef = null; 4371 _this.videoRef = null; 4372 _this.containerRef = null; 4373 _this.styleRef = null; 4374 _this.containerRect = null; 4375 _this.mediaSize = { 4376 width: 0, 4377 height: 0, 4378 naturalWidth: 0, 4379 naturalHeight: 0 4380 }; 4381 _this.dragStartPosition = { 4382 x: 0, 4383 y: 0 4384 }; 4385 _this.dragStartCrop = { 4386 x: 0, 4387 y: 0 4388 }; 4389 _this.lastPinchDistance = 0; 4390 _this.lastPinchRotation = 0; 4391 _this.rafDragTimeout = null; 4392 _this.rafPinchTimeout = null; 4393 _this.wheelTimer = null; 4394 _this.state = { 4395 cropSize: null, 4396 hasWheelJustStarted: false 4397 }; // this is to prevent Safari on iOS >= 10 to zoom the page 4398 4399 _this.preventZoomSafari = function (e) { 4400 return e.preventDefault(); 4401 }; 4402 4403 _this.cleanEvents = function () { 4404 document.removeEventListener('mousemove', _this.onMouseMove); 4405 document.removeEventListener('mouseup', _this.onDragStopped); 4406 document.removeEventListener('touchmove', _this.onTouchMove); 4407 document.removeEventListener('touchend', _this.onDragStopped); 4408 }; 4409 4410 _this.clearScrollEvent = function () { 4411 if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel); 4412 4413 if (_this.wheelTimer) { 4414 clearTimeout(_this.wheelTimer); 4415 } 4416 }; 4417 4418 _this.onMediaLoad = function () { 4419 _this.computeSizes(); 4420 4421 _this.emitCropData(); 4422 4423 _this.setInitialCrop(); 4424 4425 if (_this.props.onMediaLoaded) { 4426 _this.props.onMediaLoaded(_this.mediaSize); 4427 } 4428 }; 4429 4430 _this.setInitialCrop = function () { 4431 var _a = _this.props, 4432 initialCroppedAreaPixels = _a.initialCroppedAreaPixels, 4433 cropSize = _a.cropSize; 4434 4435 if (!initialCroppedAreaPixels) { 4436 return; 4437 } 4438 4439 var _b = getInitialCropFromCroppedAreaPixels(initialCroppedAreaPixels, _this.mediaSize, cropSize), 4440 crop = _b.crop, 4441 zoom = _b.zoom; 4442 4443 _this.props.onCropChange(crop); 4444 4445 _this.props.onZoomChange && _this.props.onZoomChange(zoom); 4446 }; 4447 4448 _this.computeSizes = function () { 4449 var _a, _b, _c, _d, _e, _f; 4450 4451 var mediaRef = _this.imageRef || _this.videoRef; 4452 4453 if (mediaRef && _this.containerRef) { 4454 _this.containerRect = _this.containerRef.getBoundingClientRect(); 4455 _this.mediaSize = { 4456 width: mediaRef.offsetWidth, 4457 height: mediaRef.offsetHeight, 4458 naturalWidth: ((_a = _this.imageRef) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0, 4459 naturalHeight: ((_c = _this.imageRef) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0 4460 }; 4461 var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(mediaRef.offsetWidth, mediaRef.offsetHeight, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation); 4462 4463 if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) { 4464 _this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize); 4465 } 4466 4467 _this.setState({ 4468 cropSize: cropSize 4469 }, _this.recomputeCropPosition); 4470 } 4471 }; 4472 4473 _this.onMouseDown = function (e) { 4474 e.preventDefault(); 4475 document.addEventListener('mousemove', _this.onMouseMove); 4476 document.addEventListener('mouseup', _this.onDragStopped); 4477 4478 _this.onDragStart(Cropper.getMousePoint(e)); 4479 }; 4480 4481 _this.onMouseMove = function (e) { 4482 return _this.onDrag(Cropper.getMousePoint(e)); 4483 }; 4484 4485 _this.onTouchStart = function (e) { 4486 e.preventDefault(); 4487 document.addEventListener('touchmove', _this.onTouchMove, { 4488 passive: false 4489 }); // iOS 11 now defaults to passive: true 4490 4491 document.addEventListener('touchend', _this.onDragStopped); 4492 4493 if (e.touches.length === 2) { 4494 _this.onPinchStart(e); 4495 } else if (e.touches.length === 1) { 4496 _this.onDragStart(Cropper.getTouchPoint(e.touches[0])); 4497 } 4498 }; 4499 4500 _this.onTouchMove = function (e) { 4501 // Prevent whole page from scrolling on iOS. 4502 e.preventDefault(); 4503 4504 if (e.touches.length === 2) { 4505 _this.onPinchMove(e); 4506 } else if (e.touches.length === 1) { 4507 _this.onDrag(Cropper.getTouchPoint(e.touches[0])); 4508 } 4509 }; 4510 4511 _this.onDragStart = function (_a) { 4512 var _b, _c; 4513 4514 var x = _a.x, 4515 y = _a.y; 4516 _this.dragStartPosition = { 4517 x: x, 4518 y: y 4519 }; 4520 _this.dragStartCrop = __assign({}, _this.props.crop); 4521 (_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b); 4522 }; 4523 4524 _this.onDrag = function (_a) { 4525 var x = _a.x, 4526 y = _a.y; 4527 if (_this.rafDragTimeout) window.cancelAnimationFrame(_this.rafDragTimeout); 4528 _this.rafDragTimeout = window.requestAnimationFrame(function () { 4529 if (!_this.state.cropSize) return; 4530 if (x === undefined || y === undefined) return; 4531 var offsetX = x - _this.dragStartPosition.x; 4532 var offsetY = y - _this.dragStartPosition.y; 4533 var requestedPosition = { 4534 x: _this.dragStartCrop.x + offsetX, 4535 y: _this.dragStartCrop.y + offsetY 4536 }; 4537 var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition; 4538 4539 _this.props.onCropChange(newPosition); 4540 }); 4541 }; 4542 4543 _this.onDragStopped = function () { 4544 var _a, _b; 4545 4546 _this.cleanEvents(); 4547 4548 _this.emitCropData(); 4549 4550 (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); 4551 }; 4552 4553 _this.onWheel = function (e) { 4554 e.preventDefault(); 4555 var point = Cropper.getMousePoint(e); 4556 var pixelY = normalize_wheel_default()(e).pixelY; 4557 var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200; 4558 4559 _this.setNewZoom(newZoom, point); 4560 4561 if (!_this.state.hasWheelJustStarted) { 4562 _this.setState({ 4563 hasWheelJustStarted: true 4564 }, function () { 4565 var _a, _b; 4566 4567 return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a); 4568 }); 4569 } 4570 4571 if (_this.wheelTimer) { 4572 clearTimeout(_this.wheelTimer); 4573 } 4574 4575 _this.wheelTimer = window.setTimeout(function () { 4576 return _this.setState({ 4577 hasWheelJustStarted: false 4578 }, function () { 4579 var _a, _b; 4580 4581 return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); 4582 }); 4583 }, 250); 4584 }; 4585 4586 _this.getPointOnContainer = function (_a) { 4587 var x = _a.x, 4588 y = _a.y; 4589 4590 if (!_this.containerRect) { 4591 throw new Error('The Cropper is not mounted'); 4592 } 4593 4594 return { 4595 x: _this.containerRect.width / 2 - (x - _this.containerRect.left), 4596 y: _this.containerRect.height / 2 - (y - _this.containerRect.top) 4597 }; 4598 }; 4599 4600 _this.getPointOnMedia = function (_a) { 4601 var x = _a.x, 4602 y = _a.y; 4603 var _b = _this.props, 4604 crop = _b.crop, 4605 zoom = _b.zoom; 4606 return { 4607 x: (x + crop.x) / zoom, 4608 y: (y + crop.y) / zoom 4609 }; 4610 }; 4611 4612 _this.setNewZoom = function (zoom, point) { 4613 if (!_this.state.cropSize || !_this.props.onZoomChange) return; 4614 4615 var zoomPoint = _this.getPointOnContainer(point); 4616 4617 var zoomTarget = _this.getPointOnMedia(zoomPoint); 4618 4619 var newZoom = Math.min(_this.props.maxZoom, Math.max(zoom, _this.props.minZoom)); 4620 var requestedPosition = { 4621 x: zoomTarget.x * newZoom - zoomPoint.x, 4622 y: zoomTarget.y * newZoom - zoomPoint.y 4623 }; 4624 var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition; 4625 4626 _this.props.onCropChange(newPosition); 4627 4628 _this.props.onZoomChange(newZoom); 4629 }; 4630 4631 _this.getCropData = function () { 4632 if (!_this.state.cropSize) { 4633 return null; 4634 } // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ricardo-ch/react-easy-crop/issues/6) 4635 4636 4637 var restrictedPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; 4638 return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition); 4639 }; 4640 4641 _this.emitCropData = function () { 4642 var cropData = _this.getCropData(); 4643 4644 if (!cropData) return; 4645 var croppedAreaPercentages = cropData.croppedAreaPercentages, 4646 croppedAreaPixels = cropData.croppedAreaPixels; 4647 4648 if (_this.props.onCropComplete) { 4649 _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels); 4650 } 4651 4652 if (_this.props.onCropAreaChange) { 4653 _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); 4654 } 4655 }; 4656 4657 _this.emitCropAreaChange = function () { 4658 var cropData = _this.getCropData(); 4659 4660 if (!cropData) return; 4661 var croppedAreaPercentages = cropData.croppedAreaPercentages, 4662 croppedAreaPixels = cropData.croppedAreaPixels; 4663 4664 if (_this.props.onCropAreaChange) { 4665 _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); 4666 } 4667 }; 4668 4669 _this.recomputeCropPosition = function () { 4670 if (!_this.state.cropSize) return; 4671 var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; 4672 4673 _this.props.onCropChange(newPosition); 4674 4675 _this.emitCropData(); 4676 }; 4677 4678 return _this; 4679 } 4680 4681 Cropper.prototype.componentDidMount = function () { 4682 window.addEventListener('resize', this.computeSizes); 4683 4684 if (this.containerRef) { 4685 this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, { 4686 passive: false 4687 }); 4688 this.containerRef.addEventListener('gesturestart', this.preventZoomSafari); 4689 this.containerRef.addEventListener('gesturechange', this.preventZoomSafari); 4690 } 4691 4692 if (!this.props.disableAutomaticStylesInjection) { 4693 this.styleRef = document.createElement('style'); 4694 this.styleRef.setAttribute('type', 'text/css'); 4695 this.styleRef.innerHTML = css_248z; 4696 document.head.appendChild(this.styleRef); 4697 } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called 4698 4699 4700 if (this.imageRef && this.imageRef.complete) { 4701 this.onMediaLoad(); 4702 } 4703 }; 4704 4705 Cropper.prototype.componentWillUnmount = function () { 4706 window.removeEventListener('resize', this.computeSizes); 4707 4708 if (this.containerRef) { 4709 this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari); 4710 this.containerRef.removeEventListener('gesturechange', this.preventZoomSafari); 4711 } 4712 4713 if (this.styleRef) { 4714 this.styleRef.remove(); 4715 } 4716 4717 this.cleanEvents(); 4718 this.props.zoomWithScroll && this.clearScrollEvent(); 4719 }; 4720 4721 Cropper.prototype.componentDidUpdate = function (prevProps) { 4722 var _a, _b, _c, _d, _e, _f, _g, _h; 4723 4724 if (prevProps.rotation !== this.props.rotation) { 4725 this.computeSizes(); 4726 this.recomputeCropPosition(); 4727 } else if (prevProps.aspect !== this.props.aspect) { 4728 this.computeSizes(); 4729 } else if (prevProps.zoom !== this.props.zoom) { 4730 this.recomputeCropPosition(); 4731 } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) { 4732 this.computeSizes(); 4733 } else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) { 4734 this.emitCropAreaChange(); 4735 } 4736 4737 if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) { 4738 this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, { 4739 passive: false 4740 }) : this.clearScrollEvent(); 4741 } 4742 }; 4743 4744 Cropper.prototype.getAspect = function () { 4745 var _a = this.props, 4746 cropSize = _a.cropSize, 4747 aspect = _a.aspect; 4748 4749 if (cropSize) { 4750 return cropSize.width / cropSize.height; 4751 } 4752 4753 return aspect; 4754 }; 4755 4756 Cropper.prototype.onPinchStart = function (e) { 4757 var pointA = Cropper.getTouchPoint(e.touches[0]); 4758 var pointB = Cropper.getTouchPoint(e.touches[1]); 4759 this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB); 4760 this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB); 4761 this.onDragStart(getCenter(pointA, pointB)); 4762 }; 4763 4764 Cropper.prototype.onPinchMove = function (e) { 4765 var _this = this; 4766 4767 var pointA = Cropper.getTouchPoint(e.touches[0]); 4768 var pointB = Cropper.getTouchPoint(e.touches[1]); 4769 var center = getCenter(pointA, pointB); 4770 this.onDrag(center); 4771 if (this.rafPinchTimeout) window.cancelAnimationFrame(this.rafPinchTimeout); 4772 this.rafPinchTimeout = window.requestAnimationFrame(function () { 4773 var distance = getDistanceBetweenPoints(pointA, pointB); 4774 var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance); 4775 4776 _this.setNewZoom(newZoom, center); 4777 4778 _this.lastPinchDistance = distance; 4779 var rotation = getRotationBetweenPoints(pointA, pointB); 4780 var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation); 4781 _this.props.onRotationChange && _this.props.onRotationChange(newRotation); 4782 _this.lastPinchRotation = rotation; 4783 }); 4784 }; 4785 4786 Cropper.prototype.render = function () { 4787 var _this = this; 4788 4789 var _a = this.props, 4790 image = _a.image, 4791 video = _a.video, 4792 mediaProps = _a.mediaProps, 4793 transform = _a.transform, 4794 _b = _a.crop, 4795 x = _b.x, 4796 y = _b.y, 4797 rotation = _a.rotation, 4798 zoom = _a.zoom, 4799 cropShape = _a.cropShape, 4800 showGrid = _a.showGrid, 4801 _c = _a.style, 4802 containerStyle = _c.containerStyle, 4803 cropAreaStyle = _c.cropAreaStyle, 4804 mediaStyle = _c.mediaStyle, 4805 _d = _a.classes, 4806 containerClassName = _d.containerClassName, 4807 cropAreaClassName = _d.cropAreaClassName, 4808 mediaClassName = _d.mediaClassName; 4809 return /*#__PURE__*/external_React_default.a.createElement("div", { 4810 onMouseDown: this.onMouseDown, 4811 onTouchStart: this.onTouchStart, 4812 ref: function ref(el) { 4813 return _this.containerRef = el; 4814 }, 4815 "data-testid": "container", 4816 style: containerStyle, 4817 className: index_module_classNames('reactEasyCrop_Container', containerClassName) 4818 }, image ? /*#__PURE__*/external_React_default.a.createElement("img", __assign({ 4819 alt: "", 4820 className: index_module_classNames('reactEasyCrop_Image', mediaClassName) 4821 }, mediaProps, { 4822 src: image, 4823 ref: function ref(el) { 4824 return _this.imageRef = el; 4825 }, 4826 style: __assign(__assign({}, mediaStyle), { 4827 transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" 4828 }), 4829 onLoad: this.onMediaLoad 4830 })) : video && /*#__PURE__*/external_React_default.a.createElement("video", __assign({ 4831 autoPlay: true, 4832 loop: true, 4833 muted: true, 4834 className: index_module_classNames('reactEasyCrop_Video', mediaClassName) 4835 }, mediaProps, { 4836 src: video, 4837 ref: function ref(el) { 4838 return _this.videoRef = el; 4839 }, 4840 onLoadedMetadata: this.onMediaLoad, 4841 style: __assign(__assign({}, mediaStyle), { 4842 transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" 4843 }), 4844 controls: false 4845 })), this.state.cropSize && /*#__PURE__*/external_React_default.a.createElement("div", { 4846 style: __assign(__assign({}, cropAreaStyle), { 4847 width: this.state.cropSize.width, 4848 height: this.state.cropSize.height 4849 }), 4850 "data-testid": "cropper", 4851 className: index_module_classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName) 4852 })); 4853 }; 4854 4855 Cropper.defaultProps = { 4856 zoom: 1, 4857 rotation: 0, 4858 aspect: 4 / 3, 4859 maxZoom: MAX_ZOOM, 4860 minZoom: MIN_ZOOM, 4861 cropShape: 'rect', 4862 showGrid: true, 4863 style: {}, 4864 classes: {}, 4865 mediaProps: {}, 4866 zoomSpeed: 1, 4867 restrictPosition: true, 4868 zoomWithScroll: true 4869 }; 4870 4871 Cropper.getMousePoint = function (e) { 4872 return { 4873 x: Number(e.clientX), 4874 y: Number(e.clientY) 4875 }; 4876 }; 4877 4878 Cropper.getTouchPoint = function (touch) { 4879 return { 4880 x: Number(touch.clientX), 4881 y: Number(touch.clientY) 4882 }; 4883 }; 4884 4885 return Cropper; 4886 }(external_React_default.a.Component); 4887 4888 /* harmony default export */ var index_module = (index_module_Cropper); 4889 4890 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/constants.js 4891 var constants_MIN_ZOOM = 100; 4892 var constants_MAX_ZOOM = 300; 4893 var constants_POPOVER_PROPS = { 4894 position: 'bottom right', 4895 isAlternate: true 4896 }; 4897 4898 // EXTERNAL MODULE: external ["wp","apiFetch"] 4899 var external_wp_apiFetch_ = __webpack_require__(50); 4900 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_); 4901 4902 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/use-save-image.js 4903 4904 4905 /** 4906 * WordPress dependencies 4907 */ 4908 4909 4910 4911 4912 4913 function useSaveImage(_ref) { 4914 var crop = _ref.crop, 4915 rotation = _ref.rotation, 4916 height = _ref.height, 4917 width = _ref.width, 4918 aspect = _ref.aspect, 4919 url = _ref.url, 4920 id = _ref.id, 4921 onSaveImage = _ref.onSaveImage, 4922 onFinishEditing = _ref.onFinishEditing; 4923 4924 var _useDispatch = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]), 4925 createErrorNotice = _useDispatch.createErrorNotice; 4926 4927 var _useState = Object(external_wp_element_["useState"])(false), 4928 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 4929 isInProgress = _useState2[0], 4930 setIsInProgress = _useState2[1]; 4931 4932 var cancel = Object(external_wp_element_["useCallback"])(function () { 4933 setIsInProgress(false); 4934 onFinishEditing(); 4935 }, [setIsInProgress, onFinishEditing]); 4936 var apply = Object(external_wp_element_["useCallback"])(function () { 4937 setIsInProgress(true); 4938 var attrs = {}; // The crop script may return some very small, sub-pixel values when the image was not cropped. 4939 // Crop only when the new size has changed by more than 0.1%. 4940 4941 if (crop.width < 99.9 || crop.height < 99.9) { 4942 attrs = crop; 4943 } 4944 4945 if (rotation > 0) { 4946 attrs.rotation = rotation; 4947 } 4948 4949 attrs.src = url; 4950 external_wp_apiFetch_default()({ 4951 path: "/wp/v2/media/".concat(id, "/edit"), 4952 method: 'POST', 4953 data: attrs 4954 }).then(function (response) { 4955 onSaveImage({ 4956 id: response.id, 4957 url: response.source_url, 4958 height: height && width ? width / aspect : undefined 4959 }); 4960 }).catch(function (error) { 4961 createErrorNotice(Object(external_wp_i18n_["sprintf"])( 4962 /* translators: 1. Error message */ 4963 Object(external_wp_i18n_["__"])('Could not edit image. %s'), error.message), { 4964 id: 'image-editing-error', 4965 type: 'snackbar' 4966 }); 4967 }).finally(function () { 4968 setIsInProgress(false); 4969 onFinishEditing(); 4970 }); 4971 }, [setIsInProgress, crop, rotation, height, width, aspect, url, onSaveImage, createErrorNotice, setIsInProgress, onFinishEditing]); 4972 return Object(external_wp_element_["useMemo"])(function () { 4973 return { 4974 isInProgress: isInProgress, 4975 apply: apply, 4976 cancel: cancel 4977 }; 4978 }, [isInProgress, apply, cancel]); 4979 } 4980 4981 // EXTERNAL MODULE: external ["wp","hooks"] 4982 var external_wp_hooks_ = __webpack_require__(33); 4983 4984 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/use-transform-image.js 4985 4986 4987 /** 4988 * WordPress dependencies 4989 */ 4990 4991 4992 4993 function useTransformState(_ref) { 4994 var url = _ref.url, 4995 naturalWidth = _ref.naturalWidth, 4996 naturalHeight = _ref.naturalHeight; 4997 4998 var _useState = Object(external_wp_element_["useState"])(), 4999 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 5000 editedUrl = _useState2[0], 5001 setEditedUrl = _useState2[1]; 5002 5003 var _useState3 = Object(external_wp_element_["useState"])(), 5004 _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), 5005 crop = _useState4[0], 5006 setCrop = _useState4[1]; 5007 5008 var _useState5 = Object(external_wp_element_["useState"])({ 5009 x: 0, 5010 y: 0 5011 }), 5012 _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), 5013 position = _useState6[0], 5014 setPosition = _useState6[1]; 5015 5016 var _useState7 = Object(external_wp_element_["useState"])(), 5017 _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), 5018 zoom = _useState8[0], 5019 setZoom = _useState8[1]; 5020 5021 var _useState9 = Object(external_wp_element_["useState"])(), 5022 _useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2), 5023 rotation = _useState10[0], 5024 setRotation = _useState10[1]; 5025 5026 var _useState11 = Object(external_wp_element_["useState"])(), 5027 _useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2), 5028 aspect = _useState12[0], 5029 setAspect = _useState12[1]; 5030 5031 var _useState13 = Object(external_wp_element_["useState"])(), 5032 _useState14 = Object(slicedToArray["a" /* default */])(_useState13, 2), 5033 defaultAspect = _useState14[0], 5034 setDefaultAspect = _useState14[1]; 5035 5036 var initializeTransformValues = Object(external_wp_element_["useCallback"])(function () { 5037 setPosition({ 5038 x: 0, 5039 y: 0 5040 }); 5041 setZoom(100); 5042 setRotation(0); 5043 setAspect(naturalWidth / naturalHeight); 5044 setDefaultAspect(naturalWidth / naturalHeight); 5045 }, [naturalWidth, naturalHeight, setPosition, setZoom, setRotation, setAspect, setDefaultAspect]); 5046 var rotateClockwise = Object(external_wp_element_["useCallback"])(function () { 5047 var angle = (rotation + 90) % 360; 5048 var naturalAspectRatio = naturalWidth / naturalHeight; 5049 5050 if (rotation % 180 === 90) { 5051 naturalAspectRatio = naturalHeight / naturalWidth; 5052 } 5053 5054 if (angle === 0) { 5055 setEditedUrl(); 5056 setRotation(angle); 5057 setAspect(1 / aspect); 5058 setPosition({ 5059 x: -(position.y * naturalAspectRatio), 5060 y: position.x * naturalAspectRatio 5061 }); 5062 return; 5063 } 5064 5065 function editImage(event) { 5066 var canvas = document.createElement('canvas'); 5067 var translateX = 0; 5068 var translateY = 0; 5069 5070 if (angle % 180) { 5071 canvas.width = event.target.height; 5072 canvas.height = event.target.width; 5073 } else { 5074 canvas.width = event.target.width; 5075 canvas.height = event.target.height; 5076 } 5077 5078 if (angle === 90 || angle === 180) { 5079 translateX = canvas.width; 5080 } 5081 5082 if (angle === 270 || angle === 180) { 5083 translateY = canvas.height; 5084 } 5085 5086 var context = canvas.getContext('2d'); 5087 context.translate(translateX, translateY); 5088 context.rotate(angle * Math.PI / 180); 5089 context.drawImage(event.target, 0, 0); 5090 canvas.toBlob(function (blob) { 5091 setEditedUrl(URL.createObjectURL(blob)); 5092 setRotation(angle); 5093 setAspect(1 / aspect); 5094 setPosition({ 5095 x: -(position.y * naturalAspectRatio), 5096 y: position.x * naturalAspectRatio 5097 }); 5098 }); 5099 } 5100 5101 var el = new window.Image(); 5102 el.src = url; 5103 el.onload = editImage; 5104 var imgCrossOrigin = Object(external_wp_hooks_["applyFilters"])('media.crossOrigin', undefined, url); 5105 5106 if (typeof imgCrossOrigin === 'string') { 5107 el.crossOrigin = imgCrossOrigin; 5108 } 5109 }, [rotation, naturalWidth, naturalHeight, setEditedUrl, setRotation, setAspect, setPosition]); 5110 return Object(external_wp_element_["useMemo"])(function () { 5111 return { 5112 editedUrl: editedUrl, 5113 setEditedUrl: setEditedUrl, 5114 crop: crop, 5115 setCrop: setCrop, 5116 position: position, 5117 setPosition: setPosition, 5118 zoom: zoom, 5119 setZoom: setZoom, 5120 rotation: rotation, 5121 setRotation: setRotation, 5122 rotateClockwise: rotateClockwise, 5123 aspect: aspect, 5124 setAspect: setAspect, 5125 defaultAspect: defaultAspect, 5126 initializeTransformValues: initializeTransformValues 5127 }; 5128 }, [editedUrl, setEditedUrl, crop, setCrop, position, setPosition, zoom, setZoom, rotation, setRotation, rotateClockwise, aspect, setAspect, defaultAspect, initializeTransformValues]); 5129 } 5130 5131 function useTransformImage(imageProperties, isEditing) { 5132 var transformState = useTransformState(imageProperties); 5133 var initializeTransformValues = transformState.initializeTransformValues; 5134 Object(external_wp_element_["useEffect"])(function () { 5135 if (isEditing) { 5136 initializeTransformValues(); 5137 } 5138 }, [isEditing, initializeTransformValues]); 5139 return transformState; 5140 } 5141 5142 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/context.js 5143 5144 5145 5146 function context_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; } 5147 5148 function context_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { context_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { context_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 5149 5150 /** 5151 * WordPress dependencies 5152 */ 5153 5154 /** 5155 * Internal dependencies 5156 */ 5157 5158 5159 5160 var ImageEditingContext = Object(external_wp_element_["createContext"])({}); 5161 var context_useImageEditingContext = function useImageEditingContext() { 5162 return Object(external_wp_element_["useContext"])(ImageEditingContext); 5163 }; 5164 function ImageEditingProvider(_ref) { 5165 var id = _ref.id, 5166 url = _ref.url, 5167 naturalWidth = _ref.naturalWidth, 5168 naturalHeight = _ref.naturalHeight, 5169 isEditing = _ref.isEditing, 5170 onFinishEditing = _ref.onFinishEditing, 5171 onSaveImage = _ref.onSaveImage, 5172 children = _ref.children; 5173 var transformImage = useTransformImage({ 5174 url: url, 5175 naturalWidth: naturalWidth, 5176 naturalHeight: naturalHeight 5177 }, isEditing); 5178 var saveImage = useSaveImage(context_objectSpread({ 5179 id: id, 5180 url: url, 5181 onSaveImage: onSaveImage, 5182 onFinishEditing: onFinishEditing 5183 }, transformImage)); 5184 var providerValue = Object(external_wp_element_["useMemo"])(function () { 5185 return context_objectSpread(context_objectSpread({}, transformImage), saveImage); 5186 }, [transformImage, saveImage]); 5187 return Object(external_wp_element_["createElement"])(ImageEditingContext.Provider, { 5188 value: providerValue 5189 }, children); 5190 } 5191 5192 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/cropper.js 5193 5194 5195 /** 5196 * External dependencies 5197 */ 5198 5199 5200 /** 5201 * WordPress dependencies 5202 */ 5203 5204 5205 /** 5206 * Internal dependencies 5207 */ 5208 5209 5210 5211 function ImageCropper(_ref) { 5212 var url = _ref.url, 5213 width = _ref.width, 5214 height = _ref.height, 5215 clientWidth = _ref.clientWidth, 5216 naturalHeight = _ref.naturalHeight, 5217 naturalWidth = _ref.naturalWidth; 5218 5219 var _useImageEditingConte = context_useImageEditingContext(), 5220 isInProgress = _useImageEditingConte.isInProgress, 5221 editedUrl = _useImageEditingConte.editedUrl, 5222 position = _useImageEditingConte.position, 5223 zoom = _useImageEditingConte.zoom, 5224 aspect = _useImageEditingConte.aspect, 5225 setPosition = _useImageEditingConte.setPosition, 5226 setCrop = _useImageEditingConte.setCrop, 5227 setZoom = _useImageEditingConte.setZoom, 5228 rotation = _useImageEditingConte.rotation; 5229 5230 var editedHeight = height || clientWidth * naturalHeight / naturalWidth; 5231 5232 if (rotation % 180 === 90) { 5233 editedHeight = clientWidth * naturalWidth / naturalHeight; 5234 } 5235 5236 return Object(external_wp_element_["createElement"])("div", { 5237 className: classnames_default()('wp-block-image__crop-area', { 5238 'is-applying': isInProgress 5239 }), 5240 style: { 5241 width: width || clientWidth, 5242 height: editedHeight 5243 } 5244 }, Object(external_wp_element_["createElement"])(index_module, { 5245 image: editedUrl || url, 5246 disabled: isInProgress, 5247 minZoom: constants_MIN_ZOOM / 100, 5248 maxZoom: constants_MAX_ZOOM / 100, 5249 crop: position, 5250 zoom: zoom / 100, 5251 aspect: aspect, 5252 onCropChange: setPosition, 5253 onCropComplete: function onCropComplete(newCropPercent) { 5254 setCrop(newCropPercent); 5255 }, 5256 onZoomChange: function onZoomChange(newZoom) { 5257 setZoom(newZoom * 100); 5258 } 5259 }), isInProgress && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)); 5260 } 5261 5262 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js 5263 var search = __webpack_require__(217); 5264 5265 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/zoom-dropdown.js 5266 5267 5268 /** 5269 * WordPress dependencies 5270 */ 5271 5272 5273 5274 /** 5275 * Internal dependencies 5276 */ 5277 5278 5279 5280 function ZoomDropdown() { 5281 var _useImageEditingConte = context_useImageEditingContext(), 5282 isInProgress = _useImageEditingConte.isInProgress, 5283 zoom = _useImageEditingConte.zoom, 5284 setZoom = _useImageEditingConte.setZoom; 5285 5286 return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { 5287 contentClassName: "wp-block-image__zoom", 5288 popoverProps: constants_POPOVER_PROPS, 5289 renderToggle: function renderToggle(_ref) { 5290 var isOpen = _ref.isOpen, 5291 onToggle = _ref.onToggle; 5292 return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5293 icon: search["a" /* default */], 5294 label: Object(external_wp_i18n_["__"])('Zoom'), 5295 onClick: onToggle, 5296 "aria-expanded": isOpen, 5297 disabled: isInProgress 5298 }); 5299 }, 5300 renderContent: function renderContent() { 5301 return Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], { 5302 label: Object(external_wp_i18n_["__"])('Zoom'), 5303 min: constants_MIN_ZOOM, 5304 max: constants_MAX_ZOOM, 5305 value: Math.round(zoom), 5306 onChange: setZoom 5307 }); 5308 } 5309 }); 5310 } 5311 5312 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js 5313 var check = __webpack_require__(161); 5314 5315 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js 5316 5317 5318 /** 5319 * WordPress dependencies 5320 */ 5321 5322 var aspect_ratio_aspectRatio = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 5323 xmlns: "http://www.w3.org/2000/svg", 5324 viewBox: "0 0 24 24" 5325 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 5326 d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" 5327 })); 5328 /* harmony default export */ var aspect_ratio = (aspect_ratio_aspectRatio); 5329 5330 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/aspect-ratio-dropdown.js 5331 5332 5333 /** 5334 * WordPress dependencies 5335 */ 5336 5337 5338 5339 /** 5340 * Internal dependencies 5341 */ 5342 5343 5344 5345 5346 function AspectGroup(_ref) { 5347 var aspectRatios = _ref.aspectRatios, 5348 isDisabled = _ref.isDisabled, 5349 label = _ref.label, 5350 _onClick = _ref.onClick, 5351 value = _ref.value; 5352 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { 5353 label: label 5354 }, aspectRatios.map(function (_ref2) { 5355 var title = _ref2.title, 5356 aspect = _ref2.aspect; 5357 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 5358 key: aspect, 5359 disabled: isDisabled, 5360 onClick: function onClick() { 5361 _onClick(aspect); 5362 }, 5363 role: "menuitemradio", 5364 isSelected: aspect === value, 5365 icon: aspect === value ? check["a" /* default */] : undefined 5366 }, title); 5367 })); 5368 } 5369 5370 function AspectRatioDropdown(_ref3) { 5371 var toggleProps = _ref3.toggleProps; 5372 5373 var _useImageEditingConte = context_useImageEditingContext(), 5374 isInProgress = _useImageEditingConte.isInProgress, 5375 aspect = _useImageEditingConte.aspect, 5376 setAspect = _useImageEditingConte.setAspect, 5377 defaultAspect = _useImageEditingConte.defaultAspect; 5378 5379 return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { 5380 icon: aspect_ratio, 5381 label: Object(external_wp_i18n_["__"])('Aspect Ratio'), 5382 popoverProps: constants_POPOVER_PROPS, 5383 toggleProps: toggleProps, 5384 className: "wp-block-image__aspect-ratio" 5385 }, function (_ref4) { 5386 var onClose = _ref4.onClose; 5387 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(AspectGroup, { 5388 isDisabled: isInProgress, 5389 onClick: function onClick(newAspect) { 5390 setAspect(newAspect); 5391 onClose(); 5392 }, 5393 value: aspect, 5394 aspectRatios: [{ 5395 title: Object(external_wp_i18n_["__"])('Original'), 5396 aspect: defaultAspect 5397 }, { 5398 title: Object(external_wp_i18n_["__"])('Square'), 5399 aspect: 1 5400 }] 5401 }), Object(external_wp_element_["createElement"])(AspectGroup, { 5402 label: Object(external_wp_i18n_["__"])('Landscape'), 5403 isDisabled: isInProgress, 5404 onClick: function onClick(newAspect) { 5405 setAspect(newAspect); 5406 onClose(); 5407 }, 5408 value: aspect, 5409 aspectRatios: [{ 5410 title: Object(external_wp_i18n_["__"])('16:10'), 5411 aspect: 16 / 10 5412 }, { 5413 title: Object(external_wp_i18n_["__"])('16:9'), 5414 aspect: 16 / 9 5415 }, { 5416 title: Object(external_wp_i18n_["__"])('4:3'), 5417 aspect: 4 / 3 5418 }, { 5419 title: Object(external_wp_i18n_["__"])('3:2'), 5420 aspect: 3 / 2 5421 }] 5422 }), Object(external_wp_element_["createElement"])(AspectGroup, { 5423 label: Object(external_wp_i18n_["__"])('Portrait'), 5424 isDisabled: isInProgress, 5425 onClick: function onClick(newAspect) { 5426 setAspect(newAspect); 5427 onClose(); 5428 }, 5429 value: aspect, 5430 aspectRatios: [{ 5431 title: Object(external_wp_i18n_["__"])('10:16'), 5432 aspect: 10 / 16 5433 }, { 5434 title: Object(external_wp_i18n_["__"])('9:16'), 5435 aspect: 9 / 16 5436 }, { 5437 title: Object(external_wp_i18n_["__"])('3:4'), 5438 aspect: 3 / 4 5439 }, { 5440 title: Object(external_wp_i18n_["__"])('2:3'), 5441 aspect: 2 / 3 5442 }] 5443 })); 5444 }); 5445 } 5446 5447 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-right.js 5448 5449 5450 /** 5451 * WordPress dependencies 5452 */ 5453 5454 var rotateRight = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 5455 xmlns: "http://www.w3.org/2000/svg", 5456 viewBox: "0 0 24 24" 5457 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 5458 d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" 5459 })); 5460 /* harmony default export */ var rotate_right = (rotateRight); 5461 5462 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/rotation-button.js 5463 5464 5465 /** 5466 * WordPress dependencies 5467 */ 5468 5469 5470 5471 /** 5472 * Internal dependencies 5473 */ 5474 5475 5476 function RotationButton() { 5477 var _useImageEditingConte = context_useImageEditingContext(), 5478 isInProgress = _useImageEditingConte.isInProgress, 5479 rotateClockwise = _useImageEditingConte.rotateClockwise; 5480 5481 return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5482 icon: rotate_right, 5483 label: Object(external_wp_i18n_["__"])('Rotate'), 5484 onClick: rotateClockwise, 5485 disabled: isInProgress 5486 }); 5487 } 5488 5489 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/form-controls.js 5490 5491 5492 /** 5493 * WordPress dependencies 5494 */ 5495 5496 5497 /** 5498 * Internal dependencies 5499 */ 5500 5501 5502 function FormControls() { 5503 var _useImageEditingConte = context_useImageEditingContext(), 5504 isInProgress = _useImageEditingConte.isInProgress, 5505 apply = _useImageEditingConte.apply, 5506 cancel = _useImageEditingConte.cancel; 5507 5508 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5509 onClick: apply, 5510 disabled: isInProgress 5511 }, Object(external_wp_i18n_["__"])('Apply')), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5512 onClick: cancel 5513 }, Object(external_wp_i18n_["__"])('Cancel'))); 5514 } 5515 5516 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editing/index.js 5517 5518 5519 /** 5520 * WordPress dependencies 5521 */ 5522 5523 5524 /** 5525 * Internal dependencies 5526 */ 5527 5528 5529 5530 5531 5532 5533 function ImageEditor(_ref) { 5534 var url = _ref.url, 5535 width = _ref.width, 5536 height = _ref.height, 5537 clientWidth = _ref.clientWidth, 5538 naturalHeight = _ref.naturalHeight, 5539 naturalWidth = _ref.naturalWidth; 5540 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ImageCropper, { 5541 url: url, 5542 width: width, 5543 height: height, 5544 clientWidth: clientWidth, 5545 naturalHeight: naturalHeight, 5546 naturalWidth: naturalWidth 5547 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(ZoomDropdown, null), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], null, function (toggleProps) { 5548 return Object(external_wp_element_["createElement"])(AspectRatioDropdown, { 5549 toggleProps: toggleProps 5550 }); 5551 })), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(RotationButton, null)), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(FormControls, null)))); 5552 } 5553 5554 5555 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js 5556 var MIN_SIZE = 20; 5557 var LINK_DESTINATION_NONE = 'none'; 5558 var LINK_DESTINATION_MEDIA = 'media'; 5559 var LINK_DESTINATION_ATTACHMENT = 'attachment'; 5560 var LINK_DESTINATION_CUSTOM = 'custom'; 5561 var NEW_TAB_REL = ['noreferrer', 'noopener']; 5562 var ALLOWED_MEDIA_TYPES = ['image']; 5563 var DEFAULT_SIZE_SLUG = 'large'; 5564 5565 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js 5566 5567 5568 5569 /** 5570 * External dependencies 5571 */ 5572 5573 /** 5574 * WordPress dependencies 5575 */ 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 /** 5589 * Internal dependencies 5590 */ 5591 5592 5593 5594 5595 5596 /** 5597 * Module constants 5598 */ 5599 5600 5601 5602 function getFilename(url) { 5603 var path = Object(external_wp_url_["getPath"])(url); 5604 5605 if (path) { 5606 return Object(external_lodash_["last"])(path.split('/')); 5607 } 5608 } 5609 5610 function Image(_ref) { 5611 var _ref$attributes = _ref.attributes, 5612 _ref$attributes$url = _ref$attributes.url, 5613 url = _ref$attributes$url === void 0 ? '' : _ref$attributes$url, 5614 alt = _ref$attributes.alt, 5615 caption = _ref$attributes.caption, 5616 align = _ref$attributes.align, 5617 id = _ref$attributes.id, 5618 href = _ref$attributes.href, 5619 rel = _ref$attributes.rel, 5620 linkClass = _ref$attributes.linkClass, 5621 linkDestination = _ref$attributes.linkDestination, 5622 title = _ref$attributes.title, 5623 width = _ref$attributes.width, 5624 height = _ref$attributes.height, 5625 linkTarget = _ref$attributes.linkTarget, 5626 sizeSlug = _ref$attributes.sizeSlug, 5627 setAttributes = _ref.setAttributes, 5628 isSelected = _ref.isSelected, 5629 insertBlocksAfter = _ref.insertBlocksAfter, 5630 onReplace = _ref.onReplace, 5631 onSelectImage = _ref.onSelectImage, 5632 onSelectURL = _ref.onSelectURL, 5633 onUploadError = _ref.onUploadError, 5634 containerRef = _ref.containerRef; 5635 var captionRef = Object(external_wp_element_["useRef"])(); 5636 var prevUrl = Object(external_wp_compose_["usePrevious"])(url); 5637 5638 var _useSelect = Object(external_wp_data_["useSelect"])(function (select) { 5639 var _select = select('core'), 5640 getMedia = _select.getMedia; 5641 5642 var _select2 = select('core/block-editor'), 5643 getMultiSelectedBlockClientIds = _select2.getMultiSelectedBlockClientIds, 5644 getBlockName = _select2.getBlockName, 5645 getSelectedBlock = _select2.getSelectedBlock, 5646 getSelectedBlockClientId = _select2.getSelectedBlockClientId; 5647 5648 var multiSelectedClientIds = getMultiSelectedBlockClientIds(); 5649 return { 5650 block: getSelectedBlock(), 5651 currentId: getSelectedBlockClientId(), 5652 image: id && isSelected ? getMedia(id) : null, 5653 multiImageSelection: multiSelectedClientIds.length && multiSelectedClientIds.every(function (clientId) { 5654 return getBlockName(clientId) === 'core/image'; 5655 }) 5656 }; 5657 }, [id, isSelected]), 5658 block = _useSelect.block, 5659 currentId = _useSelect.currentId, 5660 image = _useSelect.image, 5661 multiImageSelection = _useSelect.multiImageSelection; 5662 5663 var _useSelect2 = Object(external_wp_data_["useSelect"])(function (select) { 5664 var _select3 = select('core/block-editor'), 5665 getSettings = _select3.getSettings; 5666 5667 return Object(external_lodash_["pick"])(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']); 5668 }), 5669 imageEditing = _useSelect2.imageEditing, 5670 imageSizes = _useSelect2.imageSizes, 5671 maxWidth = _useSelect2.maxWidth, 5672 mediaUpload = _useSelect2.mediaUpload; 5673 5674 var _useDispatch = Object(external_wp_data_["useDispatch"])('core/block-editor'), 5675 replaceBlocks = _useDispatch.replaceBlocks, 5676 toggleSelection = _useDispatch.toggleSelection; 5677 5678 var _useDispatch2 = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]), 5679 createErrorNotice = _useDispatch2.createErrorNotice, 5680 createSuccessNotice = _useDispatch2.createSuccessNotice; 5681 5682 var isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); 5683 5684 var _useState = Object(external_wp_element_["useState"])(false), 5685 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 5686 captionFocused = _useState2[0], 5687 setCaptionFocused = _useState2[1]; 5688 5689 var isWideAligned = Object(external_lodash_["includes"])(['wide', 'full'], align); 5690 5691 var _useState3 = Object(external_wp_element_["useState"])({}), 5692 _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), 5693 _useState4$ = _useState4[0], 5694 naturalWidth = _useState4$.naturalWidth, 5695 naturalHeight = _useState4$.naturalHeight, 5696 setNaturalSize = _useState4[1]; 5697 5698 var _useState5 = Object(external_wp_element_["useState"])(false), 5699 _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), 5700 isEditingImage = _useState6[0], 5701 setIsEditingImage = _useState6[1]; 5702 5703 var _useState7 = Object(external_wp_element_["useState"])(), 5704 _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), 5705 externalBlob = _useState8[0], 5706 setExternalBlob = _useState8[1]; 5707 5708 var clientWidth = useClientWidth(containerRef, [align]); 5709 var isResizable = !isWideAligned && isLargeViewport; 5710 var imageSizeOptions = Object(external_lodash_["map"])(Object(external_lodash_["filter"])(imageSizes, function (_ref2) { 5711 var slug = _ref2.slug; 5712 return Object(external_lodash_["get"])(image, ['media_details', 'sizes', slug, 'source_url']); 5713 }), function (_ref3) { 5714 var name = _ref3.name, 5715 slug = _ref3.slug; 5716 return { 5717 value: slug, 5718 label: name 5719 }; 5720 }); // Check if the cover block is registered. 5721 5722 var coverBlockExists = !!Object(external_wp_blocks_["getBlockType"])('core/cover'); 5723 Object(external_wp_element_["useEffect"])(function () { 5724 if (!isSelected) { 5725 setCaptionFocused(false); 5726 } 5727 }, [isSelected]); // If an image is externally hosted, try to fetch the image data. This may 5728 // fail if the image host doesn't allow CORS with the domain. If it works, 5729 // we can enable a button in the toolbar to upload the image. 5730 5731 Object(external_wp_element_["useEffect"])(function () { 5732 if (!edit_isExternalImage(id, url) || !isSelected || externalBlob) { 5733 return; 5734 } 5735 5736 window.fetch(url).then(function (response) { 5737 return response.blob(); 5738 }).then(function (blob) { 5739 return setExternalBlob(blob); 5740 }); 5741 }, [id, url, isSelected, externalBlob]); // Focus the caption after inserting an image from the placeholder. This is 5742 // done to preserve the behaviour of focussing the first tabbable element 5743 // when a block is mounted. Previously, the image block would remount when 5744 // the placeholder is removed. Maybe this behaviour could be removed. 5745 5746 Object(external_wp_element_["useEffect"])(function () { 5747 if (url && !prevUrl && isSelected) { 5748 captionRef.current.focus(); 5749 } 5750 }, [url, prevUrl]); 5751 5752 function onResizeStart() { 5753 toggleSelection(false); 5754 } 5755 5756 function _onResizeStop() { 5757 toggleSelection(true); 5758 } 5759 5760 function onImageError() { 5761 // Check if there's an embed block that handles this URL. 5762 var embedBlock = util_createUpgradedEmbedBlock({ 5763 attributes: { 5764 url: url 5765 } 5766 }); 5767 5768 if (undefined !== embedBlock) { 5769 onReplace(embedBlock); 5770 } 5771 } 5772 5773 function onSetHref(props) { 5774 setAttributes(props); 5775 } 5776 5777 function onSetTitle(value) { 5778 // This is the HTML title attribute, separate from the media object 5779 // title. 5780 setAttributes({ 5781 title: value 5782 }); 5783 } 5784 5785 function onFocusCaption() { 5786 if (!captionFocused) { 5787 setCaptionFocused(true); 5788 } 5789 } 5790 5791 function onImageClick() { 5792 if (captionFocused) { 5793 setCaptionFocused(false); 5794 } 5795 } 5796 5797 function updateAlt(newAlt) { 5798 setAttributes({ 5799 alt: newAlt 5800 }); 5801 } 5802 5803 function updateImage(newSizeSlug) { 5804 var newUrl = Object(external_lodash_["get"])(image, ['media_details', 'sizes', newSizeSlug, 'source_url']); 5805 5806 if (!newUrl) { 5807 return null; 5808 } 5809 5810 setAttributes({ 5811 url: newUrl, 5812 width: undefined, 5813 height: undefined, 5814 sizeSlug: newSizeSlug 5815 }); 5816 } 5817 5818 function uploadExternal() { 5819 mediaUpload({ 5820 filesList: [externalBlob], 5821 onFileChange: function onFileChange(_ref4) { 5822 var _ref5 = Object(slicedToArray["a" /* default */])(_ref4, 1), 5823 img = _ref5[0]; 5824 5825 onSelectImage(img); 5826 5827 if (Object(external_wp_blob_["isBlobURL"])(img.url)) { 5828 return; 5829 } 5830 5831 setExternalBlob(); 5832 createSuccessNotice(Object(external_wp_i18n_["__"])('Image uploaded.'), { 5833 type: 'snackbar' 5834 }); 5835 }, 5836 allowedTypes: ALLOWED_MEDIA_TYPES, 5837 onError: function onError(message) { 5838 createErrorNotice(message, { 5839 type: 'snackbar' 5840 }); 5841 } 5842 }); 5843 } 5844 5845 Object(external_wp_element_["useEffect"])(function () { 5846 if (!isSelected) { 5847 setIsEditingImage(false); 5848 } 5849 }, [isSelected]); 5850 var canEditImage = id && naturalWidth && naturalHeight && imageEditing; 5851 var allowCrop = !multiImageSelection && canEditImage && !isEditingImage; 5852 var controls = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, !multiImageSelection && !isEditingImage && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageURLInputUI"], { 5853 url: href || '', 5854 onChangeUrl: onSetHref, 5855 linkDestination: linkDestination, 5856 mediaUrl: image && image.source_url || url, 5857 mediaLink: image && image.link, 5858 linkTarget: linkTarget, 5859 linkClass: linkClass, 5860 rel: rel 5861 })), allowCrop && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5862 onClick: function onClick() { 5863 return setIsEditingImage(true); 5864 }, 5865 icon: library_crop, 5866 label: Object(external_wp_i18n_["__"])('Crop') 5867 })), externalBlob && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5868 onClick: uploadExternal, 5869 icon: upload["a" /* default */], 5870 label: Object(external_wp_i18n_["__"])('Upload external image') 5871 })), !multiImageSelection && !isEditingImage && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaReplaceFlow"], { 5872 mediaId: id, 5873 mediaURL: url, 5874 allowedTypes: ALLOWED_MEDIA_TYPES, 5875 accept: "image/*", 5876 onSelect: onSelectImage, 5877 onSelectURL: onSelectURL, 5878 onError: onUploadError 5879 }), !multiImageSelection && coverBlockExists && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 5880 icon: text_color["a" /* default */], 5881 label: Object(external_wp_i18n_["__"])('Add text over image'), 5882 onClick: function onClick() { 5883 return replaceBlocks(currentId, Object(external_wp_blocks_["switchToBlockType"])(block, 'core/cover')); 5884 } 5885 }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 5886 title: Object(external_wp_i18n_["__"])('Image settings') 5887 }, !multiImageSelection && Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], { 5888 label: Object(external_wp_i18n_["__"])('Alt text (alternative text)'), 5889 value: alt, 5890 onChange: updateAlt, 5891 help: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { 5892 href: "https://www.w3.org/WAI/tutorials/images/decision-tree" 5893 }, Object(external_wp_i18n_["__"])('Describe the purpose of the image')), Object(external_wp_i18n_["__"])('Leave empty if the image is purely decorative.')) 5894 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageSizeControl"], { 5895 onChangeImage: updateImage, 5896 onChange: function onChange(value) { 5897 return setAttributes(value); 5898 }, 5899 slug: sizeSlug, 5900 width: width, 5901 height: height, 5902 imageSizeOptions: imageSizeOptions, 5903 isResizable: isResizable, 5904 imageWidth: naturalWidth, 5905 imageHeight: naturalHeight 5906 }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorAdvancedControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { 5907 label: Object(external_wp_i18n_["__"])('Title attribute'), 5908 value: title || '', 5909 onChange: onSetTitle, 5910 help: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_i18n_["__"])('Describe the role of this image on the page.'), Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { 5911 href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute" 5912 }, Object(external_wp_i18n_["__"])('(Note: many devices and browsers do not display this text.)'))) 5913 }))); 5914 var filename = getFilename(url); 5915 var defaultedAlt; 5916 5917 if (alt) { 5918 defaultedAlt = alt; 5919 } else if (filename) { 5920 defaultedAlt = Object(external_wp_i18n_["sprintf"])( 5921 /* translators: %s: file name */ 5922 Object(external_wp_i18n_["__"])('This image has an empty alt attribute; its file name is %s'), filename); 5923 } else { 5924 defaultedAlt = Object(external_wp_i18n_["__"])('This image has an empty alt attribute'); 5925 } 5926 5927 var img = // Disable reason: Image itself is not meant to be interactive, but 5928 // should direct focus to block. 5929 5930 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 5931 Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("img", { 5932 src: url, 5933 alt: defaultedAlt, 5934 onClick: onImageClick, 5935 onError: function onError() { 5936 return onImageError(); 5937 }, 5938 onLoad: function onLoad(event) { 5939 setNaturalSize(Object(external_lodash_["pick"])(event.target, ['naturalWidth', 'naturalHeight'])); 5940 } 5941 }), Object(external_wp_blob_["isBlobURL"])(url) && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)) 5942 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 5943 ; 5944 var imageWidthWithinContainer; 5945 var imageHeightWithinContainer; 5946 5947 if (clientWidth && naturalWidth && naturalHeight) { 5948 var exceedMaxWidth = naturalWidth > clientWidth; 5949 var ratio = naturalHeight / naturalWidth; 5950 imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth; 5951 imageHeightWithinContainer = exceedMaxWidth ? clientWidth * ratio : naturalHeight; 5952 } 5953 5954 if (canEditImage && isEditingImage) { 5955 img = Object(external_wp_element_["createElement"])(ImageEditor, { 5956 url: url, 5957 width: width, 5958 height: height, 5959 clientWidth: clientWidth, 5960 naturalHeight: naturalHeight, 5961 naturalWidth: naturalWidth 5962 }); 5963 } else if (!isResizable || !imageWidthWithinContainer) { 5964 img = Object(external_wp_element_["createElement"])("div", { 5965 style: { 5966 width: width, 5967 height: height 5968 } 5969 }, img); 5970 } else { 5971 var currentWidth = width || imageWidthWithinContainer; 5972 var currentHeight = height || imageHeightWithinContainer; 5973 5974 var _ratio = naturalWidth / naturalHeight; 5975 5976 var minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * _ratio; 5977 var minHeight = naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / _ratio; // With the current implementation of ResizableBox, an image needs an 5978 // explicit pixel value for the max-width. In absence of being able to 5979 // set the content-width, this max-width is currently dictated by the 5980 // vanilla editor style. The following variable adds a buffer to this 5981 // vanilla style, so 3rd party themes have some wiggleroom. This does, 5982 // in most cases, allow you to scale the image beyond the width of the 5983 // main column, though not infinitely. 5984 // @todo It would be good to revisit this once a content-width variable 5985 // becomes available. 5986 5987 var maxWidthBuffer = maxWidth * 2.5; 5988 var showRightHandle = false; 5989 var showLeftHandle = false; 5990 /* eslint-disable no-lonely-if */ 5991 // See https://github.com/WordPress/gutenberg/issues/7584. 5992 5993 if (align === 'center') { 5994 // When the image is centered, show both handles. 5995 showRightHandle = true; 5996 showLeftHandle = true; 5997 } else if (Object(external_wp_i18n_["isRTL"])()) { 5998 // In RTL mode the image is on the right by default. 5999 // Show the right handle and hide the left handle only when it is 6000 // aligned left. Otherwise always show the left handle. 6001 if (align === 'left') { 6002 showRightHandle = true; 6003 } else { 6004 showLeftHandle = true; 6005 } 6006 } else { 6007 // Show the left handle and hide the right handle only when the 6008 // image is aligned right. Otherwise always show the right handle. 6009 if (align === 'right') { 6010 showLeftHandle = true; 6011 } else { 6012 showRightHandle = true; 6013 } 6014 } 6015 /* eslint-enable no-lonely-if */ 6016 6017 6018 img = Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], { 6019 size: { 6020 width: width, 6021 height: height 6022 }, 6023 showHandle: isSelected, 6024 minWidth: minWidth, 6025 maxWidth: maxWidthBuffer, 6026 minHeight: minHeight, 6027 maxHeight: maxWidthBuffer / _ratio, 6028 lockAspectRatio: true, 6029 enable: { 6030 top: false, 6031 right: showRightHandle, 6032 bottom: true, 6033 left: showLeftHandle 6034 }, 6035 onResizeStart: onResizeStart, 6036 onResizeStop: function onResizeStop(event, direction, elt, delta) { 6037 _onResizeStop(); 6038 6039 setAttributes({ 6040 width: parseInt(currentWidth + delta.width, 10), 6041 height: parseInt(currentHeight + delta.height, 10) 6042 }); 6043 } 6044 }, img); 6045 } 6046 6047 return Object(external_wp_element_["createElement"])(ImageEditingProvider, { 6048 id: id, 6049 url: url, 6050 naturalWidth: naturalWidth, 6051 naturalHeight: naturalHeight, 6052 clientWidth: clientWidth, 6053 onSaveImage: function onSaveImage(imageAttributes) { 6054 return setAttributes(imageAttributes); 6055 }, 6056 isEditing: isEditingImage, 6057 onFinishEditing: function onFinishEditing() { 6058 return setIsEditingImage(false); 6059 } 6060 }, controls, img, (!external_wp_blockEditor_["RichText"].isEmpty(caption) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { 6061 ref: captionRef, 6062 tagName: "figcaption", 6063 "aria-label": Object(external_wp_i18n_["__"])('Image caption text'), 6064 placeholder: Object(external_wp_i18n_["__"])('Write caption…'), 6065 value: caption, 6066 unstableOnFocus: onFocusCaption, 6067 onChange: function onChange(value) { 6068 return setAttributes({ 6069 caption: value 6070 }); 6071 }, 6072 isSelected: captionFocused, 6073 inlineToolbar: true, 6074 __unstableOnSplitAtEnd: function __unstableOnSplitAtEnd() { 6075 return insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph')); 6076 } 6077 })); 6078 } 6079 6080 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js 6081 6082 6083 6084 6085 function image_edit_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; } 6086 6087 function image_edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { image_edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { image_edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 6088 6089 /** 6090 * External dependencies 6091 */ 6092 6093 6094 /** 6095 * WordPress dependencies 6096 */ 6097 6098 6099 6100 6101 6102 6103 6104 6105 /* global wp */ 6106 6107 /** 6108 * Internal dependencies 6109 */ 6110 6111 6112 /** 6113 * Module constants 6114 */ 6115 6116 6117 var edit_pickRelevantMediaFiles = function pickRelevantMediaFiles(image) { 6118 var imageProps = Object(external_lodash_["pick"])(image, ['alt', 'id', 'link', 'caption']); 6119 imageProps.url = Object(external_lodash_["get"])(image, ['sizes', 'large', 'url']) || Object(external_lodash_["get"])(image, ['media_details', 'sizes', 'large', 'source_url']) || image.url; 6120 return imageProps; 6121 }; 6122 /** 6123 * Is the URL a temporary blob URL? A blob URL is one that is used temporarily 6124 * while the image is being uploaded and will not have an id yet allocated. 6125 * 6126 * @param {number=} id The id of the image. 6127 * @param {string=} url The url of the image. 6128 * 6129 * @return {boolean} Is the URL a Blob URL 6130 */ 6131 6132 var edit_isTemporaryImage = function isTemporaryImage(id, url) { 6133 return !id && Object(external_wp_blob_["isBlobURL"])(url); 6134 }; 6135 /** 6136 * Is the url for the image hosted externally. An externally hosted image has no 6137 * id and is not a blob url. 6138 * 6139 * @param {number=} id The id of the image. 6140 * @param {string=} url The url of the image. 6141 * 6142 * @return {boolean} Is the url an externally hosted url? 6143 */ 6144 6145 6146 var edit_isExternalImage = function isExternalImage(id, url) { 6147 return url && !id && !Object(external_wp_blob_["isBlobURL"])(url); 6148 }; 6149 function ImageEdit(_ref) { 6150 var attributes = _ref.attributes, 6151 setAttributes = _ref.setAttributes, 6152 isSelected = _ref.isSelected, 6153 className = _ref.className, 6154 noticeUI = _ref.noticeUI, 6155 insertBlocksAfter = _ref.insertBlocksAfter, 6156 noticeOperations = _ref.noticeOperations, 6157 onReplace = _ref.onReplace; 6158 var _attributes$url = attributes.url, 6159 url = _attributes$url === void 0 ? '' : _attributes$url, 6160 alt = attributes.alt, 6161 caption = attributes.caption, 6162 align = attributes.align, 6163 id = attributes.id, 6164 width = attributes.width, 6165 height = attributes.height, 6166 sizeSlug = attributes.sizeSlug; 6167 var altRef = Object(external_wp_element_["useRef"])(); 6168 Object(external_wp_element_["useEffect"])(function () { 6169 altRef.current = alt; 6170 }, [alt]); 6171 var captionRef = Object(external_wp_element_["useRef"])(); 6172 Object(external_wp_element_["useEffect"])(function () { 6173 captionRef.current = caption; 6174 }, [caption]); 6175 var ref = Object(external_wp_element_["useRef"])(); 6176 var mediaUpload = Object(external_wp_data_["useSelect"])(function (select) { 6177 var _select = select('core/block-editor'), 6178 getSettings = _select.getSettings; 6179 6180 return getSettings().mediaUpload; 6181 }); 6182 6183 function onUploadError(message) { 6184 noticeOperations.removeAllNotices(); 6185 noticeOperations.createErrorNotice(message); 6186 } 6187 6188 function onSelectImage(media) { 6189 var _wp, _wp$media, _wp$media$view, _wp$media$view$settin, _wp$media$view$settin2; 6190 6191 if (!media || !media.url) { 6192 setAttributes({ 6193 url: undefined, 6194 alt: undefined, 6195 id: undefined, 6196 title: undefined, 6197 caption: undefined 6198 }); 6199 return; 6200 } 6201 6202 var mediaAttributes = edit_pickRelevantMediaFiles(media); // If the current image is temporary but an alt text was meanwhile 6203 // written by the user, make sure the text is not overwritten. 6204 6205 if (edit_isTemporaryImage(id, url)) { 6206 if (altRef.current) { 6207 mediaAttributes = Object(external_lodash_["omit"])(mediaAttributes, ['alt']); 6208 } 6209 } // If a caption text was meanwhile written by the user, 6210 // make sure the text is not overwritten by empty captions. 6211 6212 6213 if (captionRef.current && !Object(external_lodash_["get"])(mediaAttributes, ['caption'])) { 6214 mediaAttributes = Object(external_lodash_["omit"])(mediaAttributes, ['caption']); 6215 } 6216 6217 var additionalAttributes; // Reset the dimension attributes if changing to a different image. 6218 6219 if (!media.id || media.id !== id) { 6220 additionalAttributes = { 6221 width: undefined, 6222 height: undefined, 6223 sizeSlug: DEFAULT_SIZE_SLUG 6224 }; 6225 } else { 6226 // Keep the same url when selecting the same file, so "Image Size" 6227 // option is not changed. 6228 additionalAttributes = { 6229 url: url 6230 }; 6231 } // Check if default link setting should be used. 6232 6233 6234 var linkDestination = attributes.linkDestination; 6235 6236 if (!linkDestination) { 6237 // Use the WordPress option to determine the proper default. 6238 // The constants used in Gutenberg do not match WP options so a little more complicated than ideal. 6239 // TODO: fix this in a follow up PR, requires updating media-text and ui component. 6240 switch (((_wp = wp) === null || _wp === void 0 ? void 0 : (_wp$media = _wp.media) === null || _wp$media === void 0 ? void 0 : (_wp$media$view = _wp$media.view) === null || _wp$media$view === void 0 ? void 0 : (_wp$media$view$settin = _wp$media$view.settings) === null || _wp$media$view$settin === void 0 ? void 0 : (_wp$media$view$settin2 = _wp$media$view$settin.defaultProps) === null || _wp$media$view$settin2 === void 0 ? void 0 : _wp$media$view$settin2.link) || LINK_DESTINATION_NONE) { 6241 case 'file': 6242 case LINK_DESTINATION_MEDIA: 6243 linkDestination = LINK_DESTINATION_MEDIA; 6244 break; 6245 6246 case 'post': 6247 case LINK_DESTINATION_ATTACHMENT: 6248 linkDestination = LINK_DESTINATION_ATTACHMENT; 6249 break; 6250 6251 case LINK_DESTINATION_CUSTOM: 6252 linkDestination = LINK_DESTINATION_CUSTOM; 6253 break; 6254 6255 case LINK_DESTINATION_NONE: 6256 linkDestination = LINK_DESTINATION_NONE; 6257 break; 6258 } 6259 } // Check if the image is linked to it's media. 6260 6261 6262 var href; 6263 6264 switch (linkDestination) { 6265 case LINK_DESTINATION_MEDIA: 6266 href = media.url; 6267 break; 6268 6269 case LINK_DESTINATION_ATTACHMENT: 6270 href = media.link; 6271 break; 6272 } 6273 6274 mediaAttributes.href = href; 6275 setAttributes(image_edit_objectSpread(image_edit_objectSpread(image_edit_objectSpread({}, mediaAttributes), additionalAttributes), {}, { 6276 linkDestination: linkDestination 6277 })); 6278 } 6279 6280 function onSelectURL(newURL) { 6281 if (newURL !== url) { 6282 setAttributes({ 6283 url: newURL, 6284 id: undefined, 6285 sizeSlug: DEFAULT_SIZE_SLUG 6286 }); 6287 } 6288 } 6289 6290 function updateAlignment(nextAlign) { 6291 var extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? { 6292 width: undefined, 6293 height: undefined 6294 } : {}; 6295 setAttributes(image_edit_objectSpread(image_edit_objectSpread({}, extraUpdatedAttributes), {}, { 6296 align: nextAlign 6297 })); 6298 } 6299 6300 var isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount. 6301 6302 Object(external_wp_element_["useEffect"])(function () { 6303 if (!isTemp) { 6304 return; 6305 } 6306 6307 var file = Object(external_wp_blob_["getBlobByURL"])(url); 6308 6309 if (file) { 6310 mediaUpload({ 6311 filesList: [file], 6312 onFileChange: function onFileChange(_ref2) { 6313 var _ref3 = Object(slicedToArray["a" /* default */])(_ref2, 1), 6314 img = _ref3[0]; 6315 6316 onSelectImage(img); 6317 }, 6318 allowedTypes: ALLOWED_MEDIA_TYPES, 6319 onError: function onError(message) { 6320 noticeOperations.createErrorNotice(message); 6321 setAttributes({ 6322 src: undefined, 6323 id: undefined, 6324 url: undefined 6325 }); 6326 } 6327 }); 6328 } 6329 }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is 6330 // no longer temporary). 6331 6332 Object(external_wp_element_["useEffect"])(function () { 6333 if (!isTemp) { 6334 return; 6335 } 6336 6337 return function () { 6338 Object(external_wp_blob_["revokeBlobURL"])(url); 6339 }; 6340 }, [isTemp]); 6341 var isExternal = edit_isExternalImage(id, url); 6342 var controls = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockAlignmentToolbar"], { 6343 value: align, 6344 onChange: updateAlignment 6345 })); 6346 var src = isExternal ? url : undefined; 6347 var mediaPreview = !!url && Object(external_wp_element_["createElement"])("img", { 6348 alt: Object(external_wp_i18n_["__"])('Edit image'), 6349 title: Object(external_wp_i18n_["__"])('Edit image'), 6350 className: 'edit-image-preview', 6351 src: url 6352 }); 6353 var mediaPlaceholder = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], { 6354 icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { 6355 icon: library_image 6356 }), 6357 onSelect: onSelectImage, 6358 onSelectURL: onSelectURL, 6359 notices: noticeUI, 6360 onError: onUploadError, 6361 accept: "image/*", 6362 allowedTypes: ALLOWED_MEDIA_TYPES, 6363 value: { 6364 id: id, 6365 src: src 6366 }, 6367 mediaPreview: mediaPreview, 6368 disableMediaButtons: url 6369 }); 6370 var classes = classnames_default()(className, Object(defineProperty["a" /* default */])({ 6371 'is-transient': Object(external_wp_blob_["isBlobURL"])(url), 6372 'is-resized': !!width || !!height, 6373 'is-focused': isSelected 6374 }, "size-".concat(sizeSlug), sizeSlug)); 6375 var blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ 6376 ref: ref, 6377 className: classes 6378 }); 6379 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, controls, Object(external_wp_element_["createElement"])("figure", blockProps, url && Object(external_wp_element_["createElement"])(Image, { 6380 attributes: attributes, 6381 setAttributes: setAttributes, 6382 isSelected: isSelected, 6383 insertBlocksAfter: insertBlocksAfter, 6384 onReplace: onReplace, 6385 onSelectImage: onSelectImage, 6386 onSelectURL: onSelectURL, 6387 onUploadError: onUploadError, 6388 containerRef: ref 6389 }), mediaPlaceholder)); 6390 } 6391 /* harmony default export */ var image_edit = (Object(external_wp_components_["withNotices"])(ImageEdit)); 6392 6393 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js 6394 6395 6396 6397 /** 6398 * External dependencies 6399 */ 6400 6401 6402 /** 6403 * WordPress dependencies 6404 */ 6405 6406 6407 function image_save_save(_ref) { 6408 var _classnames; 6409 6410 var attributes = _ref.attributes; 6411 var url = attributes.url, 6412 alt = attributes.alt, 6413 caption = attributes.caption, 6414 align = attributes.align, 6415 href = attributes.href, 6416 rel = attributes.rel, 6417 linkClass = attributes.linkClass, 6418 width = attributes.width, 6419 height = attributes.height, 6420 id = attributes.id, 6421 linkTarget = attributes.linkTarget, 6422 sizeSlug = attributes.sizeSlug, 6423 title = attributes.title; 6424 var newRel = Object(external_lodash_["isEmpty"])(rel) ? undefined : rel; 6425 var classes = classnames_default()((_classnames = {}, Object(defineProperty["a" /* default */])(_classnames, "align".concat(align), align), Object(defineProperty["a" /* default */])(_classnames, "size-".concat(sizeSlug), sizeSlug), Object(defineProperty["a" /* default */])(_classnames, 'is-resized', width || height), _classnames)); 6426 var image = Object(external_wp_element_["createElement"])("img", { 6427 src: url, 6428 alt: alt, 6429 className: id ? "wp-image-".concat(id) : null, 6430 width: width, 6431 height: height, 6432 title: title 6433 }); 6434 var figure = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, href ? Object(external_wp_element_["createElement"])("a", { 6435 className: linkClass, 6436 href: href, 6437 target: linkTarget, 6438 rel: newRel 6439 }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 6440 tagName: "figcaption", 6441 value: caption 6442 })); 6443 6444 if ('left' === align || 'right' === align || 'center' === align) { 6445 return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])("figure", { 6446 className: classes 6447 }, figure)); 6448 } 6449 6450 return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save({ 6451 className: classes 6452 }), figure); 6453 } 6454 6455 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js 6456 6457 6458 function transforms_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; } 6459 6460 function transforms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { transforms_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { transforms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 6461 6462 /** 6463 * WordPress dependencies 6464 */ 6465 6466 6467 function stripFirstImage(attributes, _ref) { 6468 var shortcode = _ref.shortcode; 6469 6470 var _document$implementat = document.implementation.createHTMLDocument(''), 6471 body = _document$implementat.body; 6472 6473 body.innerHTML = shortcode.content; 6474 var nodeToRemove = body.querySelector('img'); // if an image has parents, find the topmost node to remove 6475 6476 while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { 6477 nodeToRemove = nodeToRemove.parentNode; 6478 } 6479 6480 if (nodeToRemove) { 6481 nodeToRemove.parentNode.removeChild(nodeToRemove); 6482 } 6483 6484 return body.innerHTML.trim(); 6485 } 6486 6487 function getFirstAnchorAttributeFormHTML(html, attributeName) { 6488 var _document$implementat2 = document.implementation.createHTMLDocument(''), 6489 body = _document$implementat2.body; 6490 6491 body.innerHTML = html; 6492 var firstElementChild = body.firstElementChild; 6493 6494 if (firstElementChild && firstElementChild.nodeName === 'A') { 6495 return firstElementChild.getAttribute(attributeName) || undefined; 6496 } 6497 } 6498 6499 var imageSchema = { 6500 img: { 6501 attributes: ['src', 'alt', 'title'], 6502 classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/] 6503 } 6504 }; 6505 6506 var schema = function schema(_ref2) { 6507 var phrasingContentSchema = _ref2.phrasingContentSchema; 6508 return { 6509 figure: { 6510 require: ['img'], 6511 children: transforms_objectSpread(transforms_objectSpread({}, imageSchema), {}, { 6512 a: { 6513 attributes: ['href', 'rel', 'target'], 6514 children: imageSchema 6515 }, 6516 figcaption: { 6517 children: phrasingContentSchema 6518 } 6519 }) 6520 } 6521 }; 6522 }; 6523 6524 var transforms_transforms = { 6525 from: [{ 6526 type: 'raw', 6527 isMatch: function isMatch(node) { 6528 return node.nodeName === 'FIGURE' && !!node.querySelector('img'); 6529 }, 6530 schema: schema, 6531 transform: function transform(node) { 6532 // Search both figure and image classes. Alignment could be 6533 // set on either. ID is set on the image. 6534 var className = node.className + ' ' + node.querySelector('img').className; 6535 var alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className); 6536 var anchor = node.id === '' ? undefined : node.id; 6537 var align = alignMatches ? alignMatches[1] : undefined; 6538 var idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className); 6539 var id = idMatches ? Number(idMatches[1]) : undefined; 6540 var anchorElement = node.querySelector('a'); 6541 var linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined; 6542 var href = anchorElement && anchorElement.href ? anchorElement.href : undefined; 6543 var rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined; 6544 var linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined; 6545 var attributes = Object(external_wp_blocks_["getBlockAttributes"])('core/image', node.outerHTML, { 6546 align: align, 6547 id: id, 6548 linkDestination: linkDestination, 6549 href: href, 6550 rel: rel, 6551 linkClass: linkClass, 6552 anchor: anchor 6553 }); 6554 return Object(external_wp_blocks_["createBlock"])('core/image', attributes); 6555 } 6556 }, { 6557 type: 'files', 6558 isMatch: function isMatch(files) { 6559 return files.length === 1 && files[0].type.indexOf('image/') === 0; 6560 }, 6561 transform: function transform(files) { 6562 var file = files[0]; // We don't need to upload the media directly here 6563 // It's already done as part of the `componentDidMount` 6564 // int the image block 6565 6566 return Object(external_wp_blocks_["createBlock"])('core/image', { 6567 url: Object(external_wp_blob_["createBlobURL"])(file) 6568 }); 6569 } 6570 }, { 6571 type: 'shortcode', 6572 tag: 'caption', 6573 attributes: { 6574 url: { 6575 type: 'string', 6576 source: 'attribute', 6577 attribute: 'src', 6578 selector: 'img' 6579 }, 6580 alt: { 6581 type: 'string', 6582 source: 'attribute', 6583 attribute: 'alt', 6584 selector: 'img' 6585 }, 6586 caption: { 6587 shortcode: stripFirstImage 6588 }, 6589 href: { 6590 shortcode: function shortcode(attributes, _ref3) { 6591 var _shortcode = _ref3.shortcode; 6592 return getFirstAnchorAttributeFormHTML(_shortcode.content, 'href'); 6593 } 6594 }, 6595 rel: { 6596 shortcode: function shortcode(attributes, _ref4) { 6597 var _shortcode2 = _ref4.shortcode; 6598 return getFirstAnchorAttributeFormHTML(_shortcode2.content, 'rel'); 6599 } 6600 }, 6601 linkClass: { 6602 shortcode: function shortcode(attributes, _ref5) { 6603 var _shortcode3 = _ref5.shortcode; 6604 return getFirstAnchorAttributeFormHTML(_shortcode3.content, 'class'); 6605 } 6606 }, 6607 id: { 6608 type: 'number', 6609 shortcode: function shortcode(_ref6) { 6610 var id = _ref6.named.id; 6611 6612 if (!id) { 6613 return; 6614 } 6615 6616 return parseInt(id.replace('attachment_', ''), 10); 6617 } 6618 }, 6619 align: { 6620 type: 'string', 6621 shortcode: function shortcode(_ref7) { 6622 var _ref7$named$align = _ref7.named.align, 6623 align = _ref7$named$align === void 0 ? 'alignnone' : _ref7$named$align; 6624 return align.replace('align', ''); 6625 } 6626 } 6627 } 6628 }] 6629 }; 6630 /* harmony default export */ var image_transforms = (transforms_transforms); 6631 6632 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js 6633 /** 6634 * WordPress dependencies 6635 */ 6636 6637 6638 /** 6639 * Internal dependencies 6640 */ 6641 6642 6643 6644 var image_metadata = { 6645 apiVersion: 2, 6646 name: "core/image", 6647 category: "media", 6648 attributes: { 6649 align: { 6650 type: "string" 6651 }, 6652 url: { 6653 type: "string", 6654 source: "attribute", 6655 selector: "img", 6656 attribute: "src" 6657 }, 6658 alt: { 6659 type: "string", 6660 source: "attribute", 6661 selector: "img", 6662 attribute: "alt", 6663 "default": "" 6664 }, 6665 caption: { 6666 type: "string", 6667 source: "html", 6668 selector: "figcaption" 6669 }, 6670 title: { 6671 type: "string", 6672 source: "attribute", 6673 selector: "img", 6674 attribute: "title" 6675 }, 6676 href: { 6677 type: "string", 6678 source: "attribute", 6679 selector: "figure > a", 6680 attribute: "href" 6681 }, 6682 rel: { 6683 type: "string", 6684 source: "attribute", 6685 selector: "figure > a", 6686 attribute: "rel" 6687 }, 6688 linkClass: { 6689 type: "string", 6690 source: "attribute", 6691 selector: "figure > a", 6692 attribute: "class" 6693 }, 6694 id: { 6695 type: "number" 6696 }, 6697 width: { 6698 type: "number" 6699 }, 6700 height: { 6701 type: "number" 6702 }, 6703 sizeSlug: { 6704 type: "string" 6705 }, 6706 linkDestination: { 6707 type: "string" 6708 }, 6709 linkTarget: { 6710 type: "string", 6711 source: "attribute", 6712 selector: "figure > a", 6713 attribute: "target" 6714 } 6715 }, 6716 supports: { 6717 anchor: true, 6718 __experimentalBorder: { 6719 radius: true 6720 } 6721 }, 6722 editorStyle: "wp-block-image-editor", 6723 style: "wp-block-image" 6724 }; 6725 6726 6727 var image_name = image_metadata.name; 6728 6729 var image_settings = { 6730 title: Object(external_wp_i18n_["_x"])('Image', 'block title'), 6731 description: Object(external_wp_i18n_["__"])('Insert an image to make a visual statement.'), 6732 icon: library_image, 6733 keywords: ['img', // "img" is not translated as it is intended to reflect the HTML <img> tag. 6734 Object(external_wp_i18n_["__"])('photo'), Object(external_wp_i18n_["__"])('picture')], 6735 example: { 6736 attributes: { 6737 sizeSlug: 'large', 6738 url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg', 6739 // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. 6740 caption: Object(external_wp_i18n_["__"])('Mont Blanc appears—still, snowy, and serene.') 6741 } 6742 }, 6743 styles: [{ 6744 name: 'default', 6745 label: Object(external_wp_i18n_["_x"])('Default', 'block style'), 6746 isDefault: true 6747 }, { 6748 name: 'rounded', 6749 label: Object(external_wp_i18n_["_x"])('Rounded', 'block style') 6750 }], 6751 __experimentalLabel: function __experimentalLabel(attributes, _ref) { 6752 var context = _ref.context; 6753 6754 if (context === 'accessibility') { 6755 var caption = attributes.caption, 6756 alt = attributes.alt, 6757 url = attributes.url; 6758 6759 if (!url) { 6760 return Object(external_wp_i18n_["__"])('Empty'); 6761 } 6762 6763 if (!alt) { 6764 return caption || ''; 6765 } // This is intended to be read by a screen reader. 6766 // A period simply means a pause, no need to translate it. 6767 6768 6769 return alt + (caption ? '. ' + caption : ''); 6770 } 6771 }, 6772 getEditWrapperProps: function getEditWrapperProps(attributes) { 6773 return { 6774 'data-align': attributes.align 6775 }; 6776 }, 6777 transforms: image_transforms, 6778 edit: image_edit, 6779 save: image_save_save, 6780 deprecated: image_deprecated 6781 }; 6782 6783 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js 6784 6785 6786 /** 6787 * WordPress dependencies 6788 */ 6789 6790 var heading = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 6791 xmlns: "http://www.w3.org/2000/svg", 6792 viewBox: "0 0 24 24" 6793 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 6794 d: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z" 6795 })); 6796 /* harmony default export */ var library_heading = (heading); 6797 6798 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 6799 var objectWithoutProperties = __webpack_require__(13); 6800 6801 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js 6802 6803 6804 6805 6806 function deprecated_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; } 6807 6808 function deprecated_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { deprecated_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { deprecated_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 6809 6810 /** 6811 * External dependencies 6812 */ 6813 6814 6815 /** 6816 * WordPress dependencies 6817 */ 6818 6819 6820 var blockSupports = { 6821 className: false, 6822 anchor: true 6823 }; 6824 var heading_deprecated_blockAttributes = { 6825 align: { 6826 type: 'string' 6827 }, 6828 content: { 6829 type: 'string', 6830 source: 'html', 6831 selector: 'h1,h2,h3,h4,h5,h6', 6832 default: '' 6833 }, 6834 level: { 6835 type: 'number', 6836 default: 2 6837 }, 6838 placeholder: { 6839 type: 'string' 6840 } 6841 }; 6842 6843 var deprecated_migrateCustomColors = function migrateCustomColors(attributes) { 6844 if (!attributes.customTextColor) { 6845 return attributes; 6846 } 6847 6848 var style = { 6849 color: { 6850 text: attributes.customTextColor 6851 } 6852 }; 6853 return deprecated_objectSpread(deprecated_objectSpread({}, Object(external_lodash_["omit"])(attributes, ['customTextColor'])), {}, { 6854 style: style 6855 }); 6856 }; 6857 6858 var TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; 6859 6860 var deprecated_migrateTextAlign = function migrateTextAlign(attributes) { 6861 var align = attributes.align, 6862 rest = Object(objectWithoutProperties["a" /* default */])(attributes, ["align"]); 6863 6864 return TEXT_ALIGN_OPTIONS.includes(align) ? deprecated_objectSpread(deprecated_objectSpread({}, rest), {}, { 6865 textAlign: align 6866 }) : attributes; 6867 }; 6868 6869 var heading_deprecated_deprecated = [{ 6870 supports: { 6871 align: ['wide', 'full'], 6872 anchor: true, 6873 className: false, 6874 color: { 6875 link: true 6876 }, 6877 fontSize: true, 6878 lineHeight: true, 6879 __experimentalSelector: { 6880 'core/heading/h1': 'h1', 6881 'core/heading/h2': 'h2', 6882 'core/heading/h3': 'h3', 6883 'core/heading/h4': 'h4', 6884 'core/heading/h5': 'h5', 6885 'core/heading/h6': 'h6' 6886 }, 6887 __unstablePasteTextInline: true 6888 }, 6889 attributes: heading_deprecated_blockAttributes, 6890 isEligible: function isEligible(_ref) { 6891 var align = _ref.align; 6892 return TEXT_ALIGN_OPTIONS.includes(align); 6893 }, 6894 migrate: deprecated_migrateTextAlign, 6895 save: function save(_ref2) { 6896 var attributes = _ref2.attributes; 6897 var align = attributes.align, 6898 content = attributes.content, 6899 level = attributes.level; 6900 var TagName = 'h' + level; 6901 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(align), align)); 6902 return Object(external_wp_element_["createElement"])(TagName, external_wp_blockEditor_["useBlockProps"].save({ 6903 className: className 6904 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 6905 value: content 6906 })); 6907 } 6908 }, { 6909 supports: blockSupports, 6910 attributes: deprecated_objectSpread(deprecated_objectSpread({}, heading_deprecated_blockAttributes), {}, { 6911 customTextColor: { 6912 type: 'string' 6913 }, 6914 textColor: { 6915 type: 'string' 6916 } 6917 }), 6918 migrate: function migrate(attributes) { 6919 return deprecated_migrateCustomColors(deprecated_migrateTextAlign(attributes)); 6920 }, 6921 save: function save(_ref3) { 6922 var _classnames2; 6923 6924 var attributes = _ref3.attributes; 6925 var align = attributes.align, 6926 content = attributes.content, 6927 customTextColor = attributes.customTextColor, 6928 level = attributes.level, 6929 textColor = attributes.textColor; 6930 var tagName = 'h' + level; 6931 var textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); 6932 var className = classnames_default()((_classnames2 = {}, Object(defineProperty["a" /* default */])(_classnames2, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames2, 'has-text-color', textColor || customTextColor), Object(defineProperty["a" /* default */])(_classnames2, "has-text-align-".concat(align), align), _classnames2)); 6933 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 6934 className: className ? className : undefined, 6935 tagName: tagName, 6936 style: { 6937 color: textClass ? undefined : customTextColor 6938 }, 6939 value: content 6940 }); 6941 } 6942 }, { 6943 attributes: deprecated_objectSpread(deprecated_objectSpread({}, heading_deprecated_blockAttributes), {}, { 6944 customTextColor: { 6945 type: 'string' 6946 }, 6947 textColor: { 6948 type: 'string' 6949 } 6950 }), 6951 migrate: function migrate(attributes) { 6952 return deprecated_migrateCustomColors(deprecated_migrateTextAlign(attributes)); 6953 }, 6954 save: function save(_ref4) { 6955 var _classnames3; 6956 6957 var attributes = _ref4.attributes; 6958 var align = attributes.align, 6959 content = attributes.content, 6960 customTextColor = attributes.customTextColor, 6961 level = attributes.level, 6962 textColor = attributes.textColor; 6963 var tagName = 'h' + level; 6964 var textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); 6965 var className = classnames_default()((_classnames3 = {}, Object(defineProperty["a" /* default */])(_classnames3, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames3, "has-text-align-".concat(align), align), _classnames3)); 6966 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 6967 className: className ? className : undefined, 6968 tagName: tagName, 6969 style: { 6970 color: textClass ? undefined : customTextColor 6971 }, 6972 value: content 6973 }); 6974 }, 6975 supports: blockSupports 6976 }, { 6977 supports: blockSupports, 6978 attributes: deprecated_objectSpread(deprecated_objectSpread({}, heading_deprecated_blockAttributes), {}, { 6979 customTextColor: { 6980 type: 'string' 6981 }, 6982 textColor: { 6983 type: 'string' 6984 } 6985 }), 6986 migrate: function migrate(attributes) { 6987 return deprecated_migrateCustomColors(deprecated_migrateTextAlign(attributes)); 6988 }, 6989 save: function save(_ref5) { 6990 var attributes = _ref5.attributes; 6991 var align = attributes.align, 6992 level = attributes.level, 6993 content = attributes.content, 6994 textColor = attributes.textColor, 6995 customTextColor = attributes.customTextColor; 6996 var tagName = 'h' + level; 6997 var textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor); 6998 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, textClass, textClass)); 6999 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7000 className: className ? className : undefined, 7001 tagName: tagName, 7002 style: { 7003 textAlign: align, 7004 color: textClass ? undefined : customTextColor 7005 }, 7006 value: content 7007 }); 7008 } 7009 }]; 7010 /* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated); 7011 7012 // EXTERNAL MODULE: external ["wp","keycodes"] 7013 var external_wp_keycodes_ = __webpack_require__(17); 7014 7015 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js 7016 7017 7018 /** 7019 * WordPress dependencies 7020 */ 7021 7022 /** @typedef {import('@wordpress/element').WPComponent} WPComponent */ 7023 7024 /** 7025 * HeadingLevelIcon props. 7026 * 7027 * @typedef WPHeadingLevelIconProps 7028 * 7029 * @property {number} level The heading level to show an icon for. 7030 * @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false. 7031 */ 7032 7033 /** 7034 * Heading level icon. 7035 * 7036 * @param {WPHeadingLevelIconProps} props Component props. 7037 * 7038 * @return {?WPComponent} The icon. 7039 */ 7040 7041 function HeadingLevelIcon(_ref) { 7042 var level = _ref.level, 7043 _ref$isPressed = _ref.isPressed, 7044 isPressed = _ref$isPressed === void 0 ? false : _ref$isPressed; 7045 var levelToPath = { 7046 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z', 7047 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z', 7048 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z', 7049 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z', 7050 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z', 7051 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z' 7052 }; 7053 7054 if (!levelToPath.hasOwnProperty(level)) { 7055 return null; 7056 } 7057 7058 return Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { 7059 width: "24", 7060 height: "24", 7061 viewBox: "0 0 20 20", 7062 xmlns: "http://www.w3.org/2000/svg", 7063 isPressed: isPressed 7064 }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { 7065 d: levelToPath[level] 7066 })); 7067 } 7068 7069 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js 7070 7071 7072 /** 7073 * WordPress dependencies 7074 */ 7075 7076 7077 7078 /** 7079 * Internal dependencies 7080 */ 7081 7082 7083 var HEADING_LEVELS = [1, 2, 3, 4, 5, 6]; 7084 var heading_level_dropdown_POPOVER_PROPS = { 7085 className: 'block-library-heading-level-dropdown', 7086 isAlternate: true 7087 }; 7088 /** @typedef {import('@wordpress/element').WPComponent} WPComponent */ 7089 7090 /** 7091 * HeadingLevelDropdown props. 7092 * 7093 * @typedef WPHeadingLevelDropdownProps 7094 * 7095 * @property {number} selectedLevel The chosen heading level. 7096 * @property {(newValue:number)=>any} onChange Callback to run when 7097 * toolbar value is changed. 7098 */ 7099 7100 /** 7101 * Dropdown for selecting a heading level (1 through 6). 7102 * 7103 * @param {WPHeadingLevelDropdownProps} props Component props. 7104 * 7105 * @return {WPComponent} The toolbar. 7106 */ 7107 7108 function HeadingLevelDropdown(_ref) { 7109 var selectedLevel = _ref.selectedLevel, 7110 onChange = _ref.onChange; 7111 return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { 7112 popoverProps: heading_level_dropdown_POPOVER_PROPS, 7113 renderToggle: function renderToggle(_ref2) { 7114 var onToggle = _ref2.onToggle, 7115 isOpen = _ref2.isOpen; 7116 7117 var openOnArrowDown = function openOnArrowDown(event) { 7118 if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) { 7119 event.preventDefault(); 7120 event.stopPropagation(); 7121 onToggle(); 7122 } 7123 }; 7124 7125 return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], { 7126 "aria-expanded": isOpen, 7127 "aria-haspopup": "true", 7128 icon: Object(external_wp_element_["createElement"])(HeadingLevelIcon, { 7129 level: selectedLevel 7130 }), 7131 label: Object(external_wp_i18n_["__"])('Change heading level'), 7132 onClick: onToggle, 7133 onKeyDown: openOnArrowDown, 7134 showTooltip: true 7135 }); 7136 }, 7137 renderContent: function renderContent() { 7138 return Object(external_wp_element_["createElement"])(external_wp_components_["Toolbar"], { 7139 className: "block-library-heading-level-toolbar", 7140 label: Object(external_wp_i18n_["__"])('Change heading level') 7141 }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], { 7142 isCollapsed: false, 7143 controls: HEADING_LEVELS.map(function (targetLevel) { 7144 var isActive = targetLevel === selectedLevel; 7145 return { 7146 icon: Object(external_wp_element_["createElement"])(HeadingLevelIcon, { 7147 level: targetLevel, 7148 isPressed: isActive 7149 }), 7150 title: Object(external_wp_i18n_["sprintf"])( // translators: %s: heading level e.g: "1", "2", "3" 7151 Object(external_wp_i18n_["__"])('Heading %d'), targetLevel), 7152 isActive: isActive, 7153 onClick: function onClick() { 7154 onChange(targetLevel); 7155 } 7156 }; 7157 }) 7158 })); 7159 } 7160 }); 7161 } 7162 7163 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js 7164 7165 7166 7167 7168 function heading_edit_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; } 7169 7170 function heading_edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { heading_edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { heading_edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7171 7172 /** 7173 * External dependencies 7174 */ 7175 7176 /** 7177 * WordPress dependencies 7178 */ 7179 7180 7181 7182 7183 7184 /** 7185 * Internal dependencies 7186 */ 7187 7188 7189 7190 function HeadingEdit(_ref) { 7191 var attributes = _ref.attributes, 7192 setAttributes = _ref.setAttributes, 7193 mergeBlocks = _ref.mergeBlocks, 7194 onReplace = _ref.onReplace, 7195 mergedStyle = _ref.mergedStyle; 7196 var textAlign = attributes.textAlign, 7197 content = attributes.content, 7198 level = attributes.level, 7199 placeholder = attributes.placeholder; 7200 var tagName = 'h' + level; 7201 var blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ 7202 className: classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(textAlign), textAlign)), 7203 style: mergedStyle 7204 }); 7205 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(HeadingLevelDropdown, { 7206 selectedLevel: level, 7207 onChange: function onChange(newLevel) { 7208 return setAttributes({ 7209 level: newLevel 7210 }); 7211 } 7212 })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentToolbar"], { 7213 value: textAlign, 7214 onChange: function onChange(nextAlign) { 7215 setAttributes({ 7216 textAlign: nextAlign 7217 }); 7218 } 7219 })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({ 7220 identifier: "content", 7221 tagName: tagName, 7222 value: content, 7223 onChange: function onChange(value) { 7224 return setAttributes({ 7225 content: value 7226 }); 7227 }, 7228 onMerge: mergeBlocks, 7229 onSplit: function onSplit(value) { 7230 if (!value) { 7231 return Object(external_wp_blocks_["createBlock"])('core/paragraph'); 7232 } 7233 7234 return Object(external_wp_blocks_["createBlock"])('core/heading', heading_edit_objectSpread(heading_edit_objectSpread({}, attributes), {}, { 7235 content: value 7236 })); 7237 }, 7238 onReplace: onReplace, 7239 onRemove: function onRemove() { 7240 return onReplace([]); 7241 }, 7242 "aria-label": Object(external_wp_i18n_["__"])('Heading text'), 7243 placeholder: placeholder || Object(external_wp_i18n_["__"])('Write heading…'), 7244 textAlign: textAlign 7245 }, blockProps))); 7246 } 7247 7248 /* harmony default export */ var heading_edit = (HeadingEdit); 7249 7250 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js 7251 7252 7253 7254 /** 7255 * External dependencies 7256 */ 7257 7258 /** 7259 * WordPress dependencies 7260 */ 7261 7262 7263 function heading_save_save(_ref) { 7264 var attributes = _ref.attributes; 7265 var textAlign = attributes.textAlign, 7266 content = attributes.content, 7267 level = attributes.level; 7268 var TagName = 'h' + level; 7269 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(textAlign), textAlign)); 7270 return Object(external_wp_element_["createElement"])(TagName, external_wp_blockEditor_["useBlockProps"].save({ 7271 className: className 7272 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7273 value: content 7274 })); 7275 } 7276 7277 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js 7278 /** 7279 * Given a node name string for a heading node, returns its numeric level. 7280 * 7281 * @param {string} nodeName Heading node name. 7282 * 7283 * @return {number} Heading level. 7284 */ 7285 function getLevelFromHeadingNodeName(nodeName) { 7286 return Number(nodeName.substr(1)); 7287 } 7288 7289 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js 7290 7291 7292 /** 7293 * WordPress dependencies 7294 */ 7295 7296 /** 7297 * Internal dependencies 7298 */ 7299 7300 7301 var transforms_apiVersion$name$cate = { 7302 apiVersion: 2, 7303 name: "core/heading", 7304 category: "text", 7305 attributes: { 7306 textAlign: { 7307 type: "string" 7308 }, 7309 content: { 7310 type: "string", 7311 source: "html", 7312 selector: "h1,h2,h3,h4,h5,h6", 7313 "default": "" 7314 }, 7315 level: { 7316 type: "number", 7317 "default": 2 7318 }, 7319 placeholder: { 7320 type: "string" 7321 } 7322 }, 7323 supports: { 7324 align: ["wide", "full"], 7325 anchor: true, 7326 className: false, 7327 color: { 7328 link: true 7329 }, 7330 fontSize: true, 7331 lineHeight: true, 7332 __experimentalSelector: { 7333 "core/heading/h1": { 7334 selector: "h1", 7335 title: "h1", 7336 attributes: { 7337 level: 1 7338 } 7339 }, 7340 "core/heading/h2": { 7341 selector: "h2", 7342 title: "h2", 7343 attributes: { 7344 level: 2 7345 } 7346 }, 7347 "core/heading/h3": { 7348 selector: "h3", 7349 title: "h3", 7350 attributes: { 7351 level: 3 7352 } 7353 }, 7354 "core/heading/h4": { 7355 selector: "h4", 7356 title: "h4", 7357 attributes: { 7358 level: 4 7359 } 7360 }, 7361 "core/heading/h5": { 7362 selector: "h5", 7363 title: "h5", 7364 attributes: { 7365 level: 5 7366 } 7367 }, 7368 "core/heading/h6": { 7369 selector: "h6", 7370 title: "h6", 7371 attributes: { 7372 level: 6 7373 } 7374 } 7375 }, 7376 __unstablePasteTextInline: true 7377 }, 7378 editorStyle: "wp-block-heading-editor", 7379 style: "wp-block-heading" 7380 }, 7381 heading_transforms_name = transforms_apiVersion$name$cate.name; 7382 var heading_transforms_transforms = { 7383 from: [{ 7384 type: 'block', 7385 isMultiBlock: true, 7386 blocks: ['core/paragraph'], 7387 transform: function transform(attributes) { 7388 return attributes.map(function (_ref) { 7389 var content = _ref.content, 7390 anchor = _ref.anchor; 7391 return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, { 7392 content: content, 7393 anchor: anchor 7394 }); 7395 }); 7396 } 7397 }, { 7398 type: 'raw', 7399 selector: 'h1,h2,h3,h4,h5,h6', 7400 schema: function schema(_ref2) { 7401 var phrasingContentSchema = _ref2.phrasingContentSchema, 7402 isPaste = _ref2.isPaste; 7403 var schema = { 7404 children: phrasingContentSchema, 7405 attributes: isPaste ? [] : ['style', 'id'] 7406 }; 7407 return { 7408 h1: schema, 7409 h2: schema, 7410 h3: schema, 7411 h4: schema, 7412 h5: schema, 7413 h6: schema 7414 }; 7415 }, 7416 transform: function transform(node) { 7417 var attributes = Object(external_wp_blocks_["getBlockAttributes"])(heading_transforms_name, node.outerHTML); 7418 7419 var _ref3 = node.style || {}, 7420 textAlign = _ref3.textAlign; 7421 7422 attributes.level = getLevelFromHeadingNodeName(node.nodeName); 7423 7424 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 7425 attributes.align = textAlign; 7426 } 7427 7428 return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, attributes); 7429 } 7430 }].concat(Object(toConsumableArray["a" /* default */])([1, 2, 3, 4, 5, 6].map(function (level) { 7431 return { 7432 type: 'prefix', 7433 prefix: Array(level + 1).join('#'), 7434 transform: function transform(content) { 7435 return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, { 7436 level: level, 7437 content: content 7438 }); 7439 } 7440 }; 7441 })), Object(toConsumableArray["a" /* default */])([1, 2, 3, 4, 5, 6].map(function (level) { 7442 return { 7443 type: 'enter', 7444 regExp: new RegExp("^/(h|H)".concat(level, "$")), 7445 transform: function transform(content) { 7446 return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, { 7447 level: level, 7448 content: content 7449 }); 7450 } 7451 }; 7452 }))), 7453 to: [{ 7454 type: 'block', 7455 isMultiBlock: true, 7456 blocks: ['core/paragraph'], 7457 transform: function transform(attributes) { 7458 return attributes.map(function (_ref4) { 7459 var content = _ref4.content, 7460 anchor = _ref4.anchor; 7461 return Object(external_wp_blocks_["createBlock"])('core/paragraph', { 7462 content: content, 7463 anchor: anchor 7464 }); 7465 }); 7466 } 7467 }] 7468 }; 7469 /* harmony default export */ var heading_transforms = (heading_transforms_transforms); 7470 7471 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js 7472 /** 7473 * External dependencies 7474 */ 7475 7476 /** 7477 * WordPress dependencies 7478 */ 7479 7480 7481 7482 /** 7483 * Internal dependencies 7484 */ 7485 7486 7487 7488 var heading_metadata = { 7489 apiVersion: 2, 7490 name: "core/heading", 7491 category: "text", 7492 attributes: { 7493 textAlign: { 7494 type: "string" 7495 }, 7496 content: { 7497 type: "string", 7498 source: "html", 7499 selector: "h1,h2,h3,h4,h5,h6", 7500 "default": "" 7501 }, 7502 level: { 7503 type: "number", 7504 "default": 2 7505 }, 7506 placeholder: { 7507 type: "string" 7508 } 7509 }, 7510 supports: { 7511 align: ["wide", "full"], 7512 anchor: true, 7513 className: false, 7514 color: { 7515 link: true 7516 }, 7517 fontSize: true, 7518 lineHeight: true, 7519 __experimentalSelector: { 7520 "core/heading/h1": { 7521 selector: "h1", 7522 title: "h1", 7523 attributes: { 7524 level: 1 7525 } 7526 }, 7527 "core/heading/h2": { 7528 selector: "h2", 7529 title: "h2", 7530 attributes: { 7531 level: 2 7532 } 7533 }, 7534 "core/heading/h3": { 7535 selector: "h3", 7536 title: "h3", 7537 attributes: { 7538 level: 3 7539 } 7540 }, 7541 "core/heading/h4": { 7542 selector: "h4", 7543 title: "h4", 7544 attributes: { 7545 level: 4 7546 } 7547 }, 7548 "core/heading/h5": { 7549 selector: "h5", 7550 title: "h5", 7551 attributes: { 7552 level: 5 7553 } 7554 }, 7555 "core/heading/h6": { 7556 selector: "h6", 7557 title: "h6", 7558 attributes: { 7559 level: 6 7560 } 7561 } 7562 }, 7563 __unstablePasteTextInline: true 7564 }, 7565 editorStyle: "wp-block-heading-editor", 7566 style: "wp-block-heading" 7567 }; 7568 7569 7570 var heading_name = heading_metadata.name; 7571 7572 var heading_settings = { 7573 title: Object(external_wp_i18n_["_x"])('Heading', 'block title'), 7574 description: Object(external_wp_i18n_["__"])('Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.'), 7575 icon: library_heading, 7576 keywords: [Object(external_wp_i18n_["__"])('title'), Object(external_wp_i18n_["__"])('subtitle')], 7577 example: { 7578 attributes: { 7579 content: Object(external_wp_i18n_["__"])('Code is Poetry'), 7580 level: 2 7581 } 7582 }, 7583 __experimentalLabel: function __experimentalLabel(attributes, _ref) { 7584 var context = _ref.context; 7585 7586 if (context === 'accessibility') { 7587 var content = attributes.content, 7588 level = attributes.level; 7589 return Object(external_lodash_["isEmpty"])(content) ? Object(external_wp_i18n_["sprintf"])( 7590 /* translators: accessibility text. %s: heading level. */ 7591 Object(external_wp_i18n_["__"])('Level %s. Empty.'), level) : Object(external_wp_i18n_["sprintf"])( 7592 /* translators: accessibility text. 1: heading level. 2: heading content. */ 7593 Object(external_wp_i18n_["__"])('Level %1$s. %2$s'), level, content); 7594 } 7595 }, 7596 transforms: heading_transforms, 7597 deprecated: heading_deprecated, 7598 merge: function merge(attributes, attributesToMerge) { 7599 return { 7600 content: (attributes.content || '') + (attributesToMerge.content || '') 7601 }; 7602 }, 7603 edit: heading_edit, 7604 save: heading_save_save 7605 }; 7606 7607 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js 7608 7609 7610 /** 7611 * WordPress dependencies 7612 */ 7613 7614 var quote = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { 7615 viewBox: "0 0 24 24", 7616 xmlns: "http://www.w3.org/2000/svg" 7617 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { 7618 d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z" 7619 })); 7620 /* harmony default export */ var library_quote = (quote); 7621 7622 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js 7623 7624 7625 7626 function quote_deprecated_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; } 7627 7628 function quote_deprecated_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_deprecated_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_deprecated_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7629 7630 /** 7631 * External dependencies 7632 */ 7633 7634 /** 7635 * WordPress dependencies 7636 */ 7637 7638 7639 var quote_deprecated_blockAttributes = { 7640 value: { 7641 type: 'string', 7642 source: 'html', 7643 selector: 'blockquote', 7644 multiline: 'p', 7645 default: '' 7646 }, 7647 citation: { 7648 type: 'string', 7649 source: 'html', 7650 selector: 'cite', 7651 default: '' 7652 }, 7653 align: { 7654 type: 'string' 7655 } 7656 }; 7657 var quote_deprecated_deprecated = [{ 7658 attributes: quote_deprecated_blockAttributes, 7659 save: function save(_ref) { 7660 var attributes = _ref.attributes; 7661 var align = attributes.align, 7662 value = attributes.value, 7663 citation = attributes.citation; 7664 return Object(external_wp_element_["createElement"])("blockquote", { 7665 style: { 7666 textAlign: align ? align : null 7667 } 7668 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7669 multiline: true, 7670 value: value 7671 }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7672 tagName: "cite", 7673 value: citation 7674 })); 7675 } 7676 }, { 7677 attributes: quote_deprecated_objectSpread(quote_deprecated_objectSpread({}, quote_deprecated_blockAttributes), {}, { 7678 style: { 7679 type: 'number', 7680 default: 1 7681 } 7682 }), 7683 migrate: function migrate(attributes) { 7684 if (attributes.style === 2) { 7685 return quote_deprecated_objectSpread(quote_deprecated_objectSpread({}, Object(external_lodash_["omit"])(attributes, ['style'])), {}, { 7686 className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large' 7687 }); 7688 } 7689 7690 return attributes; 7691 }, 7692 save: function save(_ref2) { 7693 var attributes = _ref2.attributes; 7694 var align = attributes.align, 7695 value = attributes.value, 7696 citation = attributes.citation, 7697 style = attributes.style; 7698 return Object(external_wp_element_["createElement"])("blockquote", { 7699 className: style === 2 ? 'is-large' : '', 7700 style: { 7701 textAlign: align ? align : null 7702 } 7703 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7704 multiline: true, 7705 value: value 7706 }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7707 tagName: "cite", 7708 value: citation 7709 })); 7710 } 7711 }, { 7712 attributes: quote_deprecated_objectSpread(quote_deprecated_objectSpread({}, quote_deprecated_blockAttributes), {}, { 7713 citation: { 7714 type: 'string', 7715 source: 'html', 7716 selector: 'footer', 7717 default: '' 7718 }, 7719 style: { 7720 type: 'number', 7721 default: 1 7722 } 7723 }), 7724 save: function save(_ref3) { 7725 var attributes = _ref3.attributes; 7726 var align = attributes.align, 7727 value = attributes.value, 7728 citation = attributes.citation, 7729 style = attributes.style; 7730 return Object(external_wp_element_["createElement"])("blockquote", { 7731 className: "blocks-quote-style-".concat(style), 7732 style: { 7733 textAlign: align ? align : null 7734 } 7735 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7736 multiline: true, 7737 value: value 7738 }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7739 tagName: "footer", 7740 value: citation 7741 })); 7742 } 7743 }]; 7744 /* harmony default export */ var quote_deprecated = (quote_deprecated_deprecated); 7745 7746 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js 7747 7748 7749 7750 function quote_edit_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; } 7751 7752 function quote_edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7753 7754 /** 7755 * External dependencies 7756 */ 7757 7758 /** 7759 * WordPress dependencies 7760 */ 7761 7762 7763 7764 7765 7766 function QuoteEdit(_ref) { 7767 var attributes = _ref.attributes, 7768 setAttributes = _ref.setAttributes, 7769 isSelected = _ref.isSelected, 7770 mergeBlocks = _ref.mergeBlocks, 7771 onReplace = _ref.onReplace, 7772 className = _ref.className, 7773 insertBlocksAfter = _ref.insertBlocksAfter, 7774 mergedStyle = _ref.mergedStyle; 7775 var align = attributes.align, 7776 value = attributes.value, 7777 citation = attributes.citation; 7778 var blockProps = Object(external_wp_blockEditor_["useBlockProps"])({ 7779 className: classnames_default()(className, Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(align), align)), 7780 style: mergedStyle 7781 }); 7782 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentToolbar"], { 7783 value: align, 7784 onChange: function onChange(nextAlign) { 7785 setAttributes({ 7786 align: nextAlign 7787 }); 7788 } 7789 })), Object(external_wp_element_["createElement"])(external_wp_components_["BlockQuotation"], blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { 7790 identifier: "value", 7791 multiline: true, 7792 value: value, 7793 onChange: function onChange(nextValue) { 7794 return setAttributes({ 7795 value: nextValue 7796 }); 7797 }, 7798 onMerge: mergeBlocks, 7799 onRemove: function onRemove(forward) { 7800 var hasEmptyCitation = !citation || citation.length === 0; 7801 7802 if (!forward && hasEmptyCitation) { 7803 onReplace([]); 7804 } 7805 }, 7806 "aria-label": Object(external_wp_i18n_["__"])('Quote text'), 7807 placeholder: // translators: placeholder text used for the quote 7808 Object(external_wp_i18n_["__"])('Write quote…'), 7809 onReplace: onReplace, 7810 onSplit: function onSplit(piece) { 7811 return Object(external_wp_blocks_["createBlock"])('core/quote', quote_edit_objectSpread(quote_edit_objectSpread({}, attributes), {}, { 7812 value: piece 7813 })); 7814 }, 7815 __unstableOnSplitMiddle: function __unstableOnSplitMiddle() { 7816 return Object(external_wp_blocks_["createBlock"])('core/paragraph'); 7817 }, 7818 textAlign: align 7819 }), (!external_wp_blockEditor_["RichText"].isEmpty(citation) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], { 7820 identifier: "citation", 7821 value: citation, 7822 onChange: function onChange(nextCitation) { 7823 return setAttributes({ 7824 citation: nextCitation 7825 }); 7826 }, 7827 __unstableMobileNoFocusOnMount: true, 7828 "aria-label": Object(external_wp_i18n_["__"])('Quote citation text'), 7829 placeholder: // translators: placeholder text used for the citation 7830 Object(external_wp_i18n_["__"])('Write citation…'), 7831 className: "wp-block-quote__citation", 7832 textAlign: align, 7833 __unstableOnSplitAtEnd: function __unstableOnSplitAtEnd() { 7834 return insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph')); 7835 } 7836 }))); 7837 } 7838 7839 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js 7840 7841 7842 7843 /** 7844 * External dependencies 7845 */ 7846 7847 /** 7848 * WordPress dependencies 7849 */ 7850 7851 7852 function quote_save_save(_ref) { 7853 var attributes = _ref.attributes; 7854 var align = attributes.align, 7855 value = attributes.value, 7856 citation = attributes.citation; 7857 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(align), align)); 7858 return Object(external_wp_element_["createElement"])("blockquote", external_wp_blockEditor_["useBlockProps"].save({ 7859 className: className 7860 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7861 multiline: true, 7862 value: value 7863 }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, { 7864 tagName: "cite", 7865 value: citation 7866 })); 7867 } 7868 7869 // EXTERNAL MODULE: external ["wp","richText"] 7870 var external_wp_richText_ = __webpack_require__(21); 7871 7872 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js 7873 7874 7875 7876 7877 function quote_transforms_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; } 7878 7879 function quote_transforms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_transforms_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_transforms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7880 7881 /** 7882 * WordPress dependencies 7883 */ 7884 7885 7886 var quote_transforms_transforms = { 7887 from: [{ 7888 type: 'block', 7889 isMultiBlock: true, 7890 blocks: ['core/paragraph'], 7891 transform: function transform(attributes) { 7892 return Object(external_wp_blocks_["createBlock"])('core/quote', { 7893 value: Object(external_wp_richText_["toHTMLString"])({ 7894 value: Object(external_wp_richText_["join"])(attributes.map(function (_ref) { 7895 var content = _ref.content; 7896 return Object(external_wp_richText_["create"])({ 7897 html: content 7898 }); 7899 }), "\u2028"), 7900 multilineTag: 'p' 7901 }), 7902 anchor: attributes.anchor 7903 }); 7904 } 7905 }, { 7906 type: 'block', 7907 blocks: ['core/heading'], 7908 transform: function transform(_ref2) { 7909 var content = _ref2.content, 7910 anchor = _ref2.anchor; 7911 return Object(external_wp_blocks_["createBlock"])('core/quote', { 7912 value: "<p>".concat(content, "</p>"), 7913 anchor: anchor 7914 }); 7915 } 7916 }, { 7917 type: 'block', 7918 blocks: ['core/pullquote'], 7919 transform: function transform(_ref3) { 7920 var value = _ref3.value, 7921 citation = _ref3.citation, 7922 anchor = _ref3.anchor; 7923 return Object(external_wp_blocks_["createBlock"])('core/quote', { 7924 value: value, 7925 citation: citation, 7926 anchor: anchor 7927 }); 7928 } 7929 }, { 7930 type: 'prefix', 7931 prefix: '>', 7932 transform: function transform(content) { 7933 return Object(external_wp_blocks_["createBlock"])('core/quote', { 7934 value: "<p>".concat(content, "</p>") 7935 }); 7936 } 7937 }, { 7938 type: 'raw', 7939 isMatch: function isMatch(node) { 7940 var isParagraphOrSingleCite = function () { 7941 var hasCitation = false; 7942 return function (child) { 7943 // Child is a paragraph. 7944 if (child.nodeName === 'P') { 7945 return true; 7946 } // Child is a cite and no other cite child exists before it. 7947 7948 7949 if (!hasCitation && child.nodeName === 'CITE') { 7950 hasCitation = true; 7951 return true; 7952 } 7953 }; 7954 }(); 7955 7956 return node.nodeName === 'BLOCKQUOTE' && // The quote block can only handle multiline paragraph 7957 // content with an optional cite child. 7958 Array.from(node.childNodes).every(isParagraphOrSingleCite); 7959 }, 7960 schema: function schema(_ref4) { 7961 var phrasingContentSchema = _ref4.phrasingContentSchema; 7962 return { 7963 blockquote: { 7964 children: { 7965 p: { 7966 children: phrasingContentSchema 7967 }, 7968 cite: { 7969 children: phrasingContentSchema 7970 } 7971 } 7972 } 7973 }; 7974 } 7975 }], 7976 to: [{ 7977 type: 'block', 7978 blocks: ['core/paragraph'], 7979 transform: function transform(_ref5) { 7980 var value = _ref5.value, 7981 citation = _ref5.citation; 7982 var paragraphs = []; 7983 7984 if (value && value !== '<p></p>') { 7985 paragraphs.push.apply(paragraphs, Object(toConsumableArray["a" /* default */])(Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({ 7986 html: value, 7987 multilineTag: 'p' 7988 }), "\u2028").map(function (piece) { 7989 return Object(external_wp_blocks_["createBlock"])('core/paragraph', { 7990 content: Object(external_wp_richText_["toHTMLString"])({ 7991 value: piece 7992 }) 7993 }); 7994 }))); 7995 } 7996 7997 if (citation && citation !== '<p></p>') { 7998 paragraphs.push(Object(external_wp_blocks_["createBlock"])('core/paragraph', { 7999 content: citation 8000 })); 8001 } 8002 8003 if (paragraphs.length === 0) { 8004 return Object(external_wp_blocks_["createBlock"])('core/paragraph', { 8005 content: '' 8006 }); 8007 } 8008 8009 return paragraphs; 8010 } 8011 }, { 8012 type: 'block', 8013 blocks: ['core/heading'], 8014 transform: function transform(_ref6) { 8015 var value = _ref6.value, 8016 citation = _ref6.citation, 8017 attrs = Object(objectWithoutProperties["a" /* default */])(_ref6, ["value", "citation"]); 8018 8019 // If there is no quote content, use the citation as the 8020 // content of the resulting heading. A nonexistent citation 8021 // will result in an empty heading. 8022 if (value === '<p></p>') { 8023 return Object(external_wp_blocks_["createBlock"])('core/heading', { 8024 content: citation 8025 }); 8026 } 8027 8028 var pieces = Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({ 8029 html: value, 8030 multilineTag: 'p' 8031 }), "\u2028"); 8032 var headingBlock = Object(external_wp_blocks_["createBlock"])('core/heading', { 8033 content: Object(external_wp_richText_["toHTMLString"])({ 8034 value: pieces[0] 8035 }) 8036 }); 8037 8038 if (!citation && pieces.length === 1) { 8039 return headingBlock; 8040 } 8041 8042 var quotePieces = pieces.slice(1); 8043 var quoteBlock = Object(external_wp_blocks_["createBlock"])('core/quote', quote_transforms_objectSpread(quote_transforms_objectSpread({}, attrs), {}, { 8044 citation: citation, 8045 value: Object(external_wp_richText_["toHTMLString"])({ 8046 value: quotePieces.length ? Object(external_wp_richText_["join"])(pieces.slice(1), "\u2028") : Object(external_wp_richText_["create"])(), 8047 multilineTag: 'p' 8048 }) 8049 })); 8050 return [headingBlock, quoteBlock]; 8051 } 8052 }, { 8053 type: 'block', 8054 blocks: ['core/pullquote'], 8055 transform: function transform(_ref7) { 8056 var value = _ref7.value, 8057 citation = _ref7.citation, 8058 anchor = _ref7.anchor; 8059 return Object(external_wp_blocks_["createBlock"])('core/pullquote', { 8060 value: value, 8061 citation: citation, 8062 anchor: anchor 8063 }); 8064 } 8065 }] 8066 }; 8067 /* harmony default export */ var quote_transforms = (quote_transforms_transforms); 8068 8069 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js 8070 8071 8072 function quote_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; } 8073 8074 function quote_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 8075 8076 /** 8077 * WordPress dependencies 8078 */ 8079 8080 8081 /** 8082 * Internal dependencies 8083 */ 8084 8085 8086 8087 var quote_metadata = { 8088 apiVersion: 2, 8089 name: "core/quote", 8090 category: "text", 8091 attributes: { 8092 value: { 8093 type: "string", 8094 source: "html",