From 35005412d0ce4a9a1c4784699177a32a9753e820 Mon Sep 17 00:00:00 2001 From: desrosj Date: Tue, 12 Apr 2022 17:17:22 +0000 Subject: [PATCH] External Libraries: Update some external libraries. This updates three external libraries to their latest versions: - `backbone` from `1.4.0` to `1.4.1`. - `underscore` from `1.13.1` to `1.13.2`. - `clipboard` from `2.0.8` to `2.0.10`. These are all minor updates containing bug fixes and documentation improvements. See #55547. Built from https://develop.svn.wordpress.org/trunk@53164 git-svn-id: http://core.svn.wordpress.org/trunk@52753 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/assets/script-loader-packages.php | 2 +- wp-includes/js/backbone.js | 68 ++- wp-includes/js/backbone.min.js | 2 +- wp-includes/js/clipboard.js | 470 +++++++--------- wp-includes/js/clipboard.min.js | 2 +- wp-includes/js/dist/compose.js | 510 ++++++++---------- wp-includes/js/dist/compose.min.js | 4 +- wp-includes/js/underscore.js | 34 +- wp-includes/js/underscore.min.js | 2 +- wp-includes/script-loader.php | 4 +- wp-includes/version.php | 2 +- 11 files changed, 477 insertions(+), 623 deletions(-) diff --git a/wp-includes/assets/script-loader-packages.php b/wp-includes/assets/script-loader-packages.php index 3c7789b280..962f793be1 100644 --- a/wp-includes/assets/script-loader-packages.php +++ b/wp-includes/assets/script-loader-packages.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'a38319d7ba46c6e60f7f9d4c371222c5'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'e103c345829d2b4da838b701a4dff236'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '63050163caffa6aac54e9ebf21fe0472'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '21d1d6c005241b908b592f52ad684a28'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '87cf2365cd719a6954f1e2bb8bcc692a'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'fd489311f434eb89ad7436e8d8f0a7e8'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'f89db44f2f63108d4d0b11aa5769c07d'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '7c862c64f37bda777e3304956878ac38'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '8ee151736a1e51db2bafbb61ddd60634'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '5f2a1df817f7318d368389a0ee3fbab4'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '6ac0ebee2cf205e5aa8993d329a6a2ec'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '55c31fc1e76c3edfbfc61367b743372d'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'a16fa1df8ee0e76464d249a674e17610'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-widgets'), 'version' => '1c73c17724422c6c699315524323b3c6'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => 'e7ddc082a373bd21a10998f17d8dad52'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => '6a75067d86cf9ab901a4646595575446'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => 'e0e02b3a1c7037e6cb893486d4680631'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '96593d5d272d008fbcb6912fa0b86778'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c10edc1abf3fbbc79f17fd7d1d332eb'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd996b53411d1533a84951212ab6ac4ff'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '2e4d6c4dec8990df88caf2a873aaedcf'), 'edit-site.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport'), 'version' => '1eed77f8545a9bb10ae6c4723e5a36f9'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '7f2482b5fc9fcd25123b7cfc017fae78'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '222292ad6ea9509712bcb073f0c3d057'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '3dfdc75a0abf30f057df44e9a39abe5b'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '00a5735837e9efe13da1d979f16a7105'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '98e32e5276b4b59e7b283addf7cdbd8c'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6d64f2cb8f5c6bb49caca37f8828ce3'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6385fb7cd9fdada1cf8892a545f8a26'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'ebee46757c6a411e38fd079a7ac71d94'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '649feec00389556f8015a6b97efc1cb1'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '418fddac042f08102c4110f70e13cd47'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '84a0e6bbcf0b9e1ea0184c3f2bf28022'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2b04eb3e5628488fe2cb534f02806022'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'ee812d25ec8504c5b419a1aa3cae974d'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'e44820c667bf205cacdfc48cbeb3c2e6'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '48ab41273bfd9022769c430fcd3c23cf'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '8318bcd6086deb19e800c183bd20bafb'), 'preferences.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'a9b6f95c63bb642d0be7c3d1d208b302'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'cadf5cfaabdb15c8c8fc440547afe919'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'efad6460ae6b28406d39866cb10731e0'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5156478c032ea85a2bbdceeb7a43b0c1'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7387bed6e19d1b3aec4b6fda683a0768'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '3d28945690ee0ddbb0a8e37dfe2e0ac2'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'f3f949340f2edb72d97152f3cda119a1'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'd6964e945049b6190adc8770cda168c4'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '4ebce6423dfff99d40033fd33ce52cc9'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '16385e4d69da65c7283790971de6b297'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '6b3719cd3e4fd40e0ce2de0e0c86dbe4'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b9190af8fc6a3a48c580473c6f337b88'), 'widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '80e98954519d1dad7a91a2248dbc2cc9'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'fb8056c75aa0a0569f7ea3ceae97fbc6')); \ No newline at end of file + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'a38319d7ba46c6e60f7f9d4c371222c5'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'e103c345829d2b4da838b701a4dff236'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '63050163caffa6aac54e9ebf21fe0472'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '21d1d6c005241b908b592f52ad684a28'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '87cf2365cd719a6954f1e2bb8bcc692a'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'fd489311f434eb89ad7436e8d8f0a7e8'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'f89db44f2f63108d4d0b11aa5769c07d'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '7c862c64f37bda777e3304956878ac38'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '8ee151736a1e51db2bafbb61ddd60634'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '5f2a1df817f7318d368389a0ee3fbab4'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '6ac0ebee2cf205e5aa8993d329a6a2ec'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'da94d523b115836ddbf0b3b774ddd94a'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'a16fa1df8ee0e76464d249a674e17610'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-widgets'), 'version' => '1c73c17724422c6c699315524323b3c6'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => 'e7ddc082a373bd21a10998f17d8dad52'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => '6a75067d86cf9ab901a4646595575446'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => 'e0e02b3a1c7037e6cb893486d4680631'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '96593d5d272d008fbcb6912fa0b86778'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c10edc1abf3fbbc79f17fd7d1d332eb'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd996b53411d1533a84951212ab6ac4ff'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '2e4d6c4dec8990df88caf2a873aaedcf'), 'edit-site.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport'), 'version' => '1eed77f8545a9bb10ae6c4723e5a36f9'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '7f2482b5fc9fcd25123b7cfc017fae78'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '222292ad6ea9509712bcb073f0c3d057'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '3dfdc75a0abf30f057df44e9a39abe5b'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '00a5735837e9efe13da1d979f16a7105'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '98e32e5276b4b59e7b283addf7cdbd8c'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6d64f2cb8f5c6bb49caca37f8828ce3'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6385fb7cd9fdada1cf8892a545f8a26'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'ebee46757c6a411e38fd079a7ac71d94'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '649feec00389556f8015a6b97efc1cb1'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '418fddac042f08102c4110f70e13cd47'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '84a0e6bbcf0b9e1ea0184c3f2bf28022'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2b04eb3e5628488fe2cb534f02806022'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'ee812d25ec8504c5b419a1aa3cae974d'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'e44820c667bf205cacdfc48cbeb3c2e6'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '48ab41273bfd9022769c430fcd3c23cf'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '8318bcd6086deb19e800c183bd20bafb'), 'preferences.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'a9b6f95c63bb642d0be7c3d1d208b302'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'cadf5cfaabdb15c8c8fc440547afe919'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'efad6460ae6b28406d39866cb10731e0'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5156478c032ea85a2bbdceeb7a43b0c1'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7387bed6e19d1b3aec4b6fda683a0768'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '3d28945690ee0ddbb0a8e37dfe2e0ac2'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'f3f949340f2edb72d97152f3cda119a1'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'd6964e945049b6190adc8770cda168c4'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '4ebce6423dfff99d40033fd33ce52cc9'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '16385e4d69da65c7283790971de6b297'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '6b3719cd3e4fd40e0ce2de0e0c86dbe4'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b9190af8fc6a3a48c580473c6f337b88'), 'widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '80e98954519d1dad7a91a2248dbc2cc9'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'fb8056c75aa0a0569f7ea3ceae97fbc6')); \ No newline at end of file diff --git a/wp-includes/js/backbone.js b/wp-includes/js/backbone.js index 3e09d0dcb0..fd64012a35 100644 --- a/wp-includes/js/backbone.js +++ b/wp-includes/js/backbone.js @@ -1,6 +1,6 @@ -// Backbone.js 1.4.0 +// Backbone.js 1.4.1 -// (c) 2010-2019 Jeremy Ashkenas and DocumentCloud +// (c) 2010-2022 Jeremy Ashkenas and DocumentCloud // Backbone may be freely distributed under the MIT license. // For all details and documentation: // http://backbonejs.org @@ -44,7 +44,7 @@ var slice = Array.prototype.slice; // Current version of the library. Keep in sync with `package.json`. - Backbone.VERSION = '1.4.0'; + Backbone.VERSION = '1.4.1'; // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns // the `$` variable. @@ -516,7 +516,11 @@ } // Update the `id`. - if (this.idAttribute in attrs) this.id = this.get(this.idAttribute); + if (this.idAttribute in attrs) { + var prevId = this.id; + this.id = this.get(this.idAttribute); + this.trigger('changeId', this, prevId, options); + } // Trigger all relevant attribute changes. if (!silent) { @@ -994,7 +998,7 @@ get: function(obj) { if (obj == null) return void 0; return this._byId[obj] || - this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj)] || + this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj, obj.idAttribute)] || obj.cid && this._byId[obj.cid]; }, @@ -1098,8 +1102,8 @@ }, // Define how to uniquely identify models in the collection. - modelId: function(attrs) { - return attrs[this.model.prototype.idAttribute || 'id']; + modelId: function(attrs, idAttribute) { + return attrs[idAttribute || this.model.prototype.idAttribute || 'id']; }, // Get an iterator of all models in this collection. @@ -1134,7 +1138,15 @@ } options = options ? _.clone(options) : {}; options.collection = this; - var model = new this.model(attrs, options); + + var model; + if (this.model.prototype) { + model = new this.model(attrs, options); + } else { + // ES class methods didn't have prototype + model = this.model(attrs, options); + } + if (!model.validationError) return model; this.trigger('invalid', this, model.validationError, options); return false; @@ -1154,7 +1166,7 @@ // Remove references before triggering 'remove' event to prevent an // infinite loop. #3693 delete this._byId[model.cid]; - var id = this.modelId(model.attributes); + var id = this.modelId(model.attributes, model.idAttribute); if (id != null) delete this._byId[id]; if (!options.silent) { @@ -1177,7 +1189,7 @@ // Internal method to create a model's ties to a collection. _addReference: function(model, options) { this._byId[model.cid] = model; - var id = this.modelId(model.attributes); + var id = this.modelId(model.attributes, model.idAttribute); if (id != null) this._byId[id] = model; model.on('all', this._onModelEvent, this); }, @@ -1185,7 +1197,7 @@ // Internal method to sever a model's ties to a collection. _removeReference: function(model, options) { delete this._byId[model.cid]; - var id = this.modelId(model.attributes); + var id = this.modelId(model.attributes, model.idAttribute); if (id != null) delete this._byId[id]; if (this === model.collection) delete model.collection; model.off('all', this._onModelEvent, this); @@ -1199,13 +1211,11 @@ if (model) { if ((event === 'add' || event === 'remove') && collection !== this) return; if (event === 'destroy') this.remove(model, options); - if (event === 'change') { - var prevId = this.modelId(model.previousAttributes()); - var id = this.modelId(model.attributes); - if (prevId !== id) { - if (prevId != null) delete this._byId[prevId]; - if (id != null) this._byId[id] = model; - } + if (event === 'changeId') { + var prevId = this.modelId(model.previousAttributes(), model.idAttribute); + var id = this.modelId(model.attributes, model.idAttribute); + if (prevId != null) delete this._byId[prevId]; + if (id != null) this._byId[id] = model; } } this.trigger.apply(this, arguments); @@ -1261,7 +1271,7 @@ if (this._kind === ITERATOR_VALUES) { value = model; } else { - var id = this._collection.modelId(model.attributes); + var id = this._collection.modelId(model.attributes, model.idAttribute); if (this._kind === ITERATOR_KEYS) { value = id; } else { // ITERATOR_KEYSVALUES @@ -1615,11 +1625,11 @@ // Map from CRUD to HTTP for our default `Backbone.sync` implementation. var methodMap = { - create: 'POST', - update: 'PUT', - patch: 'PATCH', - delete: 'DELETE', - read: 'GET' + 'create': 'POST', + 'update': 'PUT', + 'patch': 'PATCH', + 'delete': 'DELETE', + 'read': 'GET' }; // Set the default implementation of `Backbone.ajax` to proxy through to `$`. @@ -1712,11 +1722,11 @@ // against the current location hash. _routeToRegExp: function(route) { route = route.replace(escapeRegExp, '\\$&') - .replace(optionalParam, '(?:$1)?') - .replace(namedParam, function(match, optional) { - return optional ? match : '([^/?]+)'; - }) - .replace(splatParam, '([^?]*?)'); + .replace(optionalParam, '(?:$1)?') + .replace(namedParam, function(match, optional) { + return optional ? match : '([^/?]+)'; + }) + .replace(splatParam, '([^?]*?)'); return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); }, diff --git a/wp-includes/js/backbone.min.js b/wp-includes/js/backbone.min.js index 1f2a51b3a1..396f6c4e5e 100644 --- a/wp-includes/js/backbone.min.js +++ b/wp-includes/js/backbone.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(n){var s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,e,i){s.Backbone=n(s,i,t,e)});else if("undefined"!=typeof exports){var t,e=require("underscore");try{t=require("jquery")}catch(t){}n(s,exports,e,t)}else s.Backbone=n(s,{},s._,s.jQuery||s.Zepto||s.ender||s.$)}(function(t,h,b,e){function a(t,e,i,n,s){var r,o=0;if(i&&"object"==typeof i){void 0!==n&&"context"in s&&void 0===s.context&&(s.context=n);for(r=b.keys(i);othis.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},u=e.add,c=e.merge,l=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;gthis.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},u=e.add,c=e.merge,l=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;g 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + var selectedText = ''; + + if (typeof target === 'string') { + var fakeElement = createFakeElement(target); + options.container.appendChild(fakeElement); + selectedText = select_default()(fakeElement); + command('copy'); + fakeElement.remove(); + } else { + selectedText = select_default()(target); + command('copy'); + } + + return selectedText; +}; + +/* harmony default export */ var actions_copy = (ClipboardActionCopy); +;// CONCATENATED MODULE: ./src/actions/default.js function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + +/** + * Inner function which performs selection from either `text` or `target` + * properties and then executes copy or cut operations. + * @param {Object} options + */ + +var ClipboardActionDefault = function ClipboardActionDefault() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // Defines base properties passed from constructor. + var _options$action = options.action, + action = _options$action === void 0 ? 'copy' : _options$action, + container = options.container, + target = options.target, + text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'. + + if (action !== 'copy' && action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } // Sets the `target` property using an element that will be have its content copied. + + + if (target !== undefined) { + if (target && _typeof(target) === 'object' && target.nodeType === 1) { + if (action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + + if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + } else { + throw new Error('Invalid "target" value, use a valid Element'); + } + } // Define selection strategy based on `text` property. + + + if (text) { + return actions_copy(text, { + container: container + }); + } // Defines which selection strategy based on `target` property. + + + if (target) { + return action === 'cut' ? actions_cut(target) : actions_copy(target, { + container: container + }); + } +}; + +/* harmony default export */ var actions_default = (ClipboardActionDefault); +;// CONCATENATED MODULE: ./src/clipboard.js +function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -/** - * Inner class which performs selection from either `text` or `target` - * properties and then executes copy or cut operations. - */ - -var ClipboardAction = /*#__PURE__*/function () { - /** - * @param {Object} options - */ - function ClipboardAction(options) { - _classCallCheck(this, ClipboardAction); - - this.resolveOptions(options); - this.initSelection(); - } - /** - * Defines base properties passed from constructor. - * @param {Object} options - */ - - - _createClass(ClipboardAction, [{ - key: "resolveOptions", - value: function resolveOptions() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this.action = options.action; - this.container = options.container; - this.emitter = options.emitter; - this.target = options.target; - this.text = options.text; - this.trigger = options.trigger; - this.selectedText = ''; - } - /** - * Decides which selection strategy is going to be applied based - * on the existence of `text` and `target` properties. - */ - - }, { - key: "initSelection", - value: function initSelection() { - if (this.text) { - this.selectFake(); - } else if (this.target) { - this.selectTarget(); - } - } - /** - * Creates a fake textarea element, sets its value from `text` property, - */ - - }, { - key: "createFakeElement", - value: function createFakeElement() { - var isRTL = document.documentElement.getAttribute('dir') === 'rtl'; - this.fakeElem = document.createElement('textarea'); // Prevent zooming on iOS - - this.fakeElem.style.fontSize = '12pt'; // Reset box model - - this.fakeElem.style.border = '0'; - this.fakeElem.style.padding = '0'; - this.fakeElem.style.margin = '0'; // Move element out of screen horizontally - - this.fakeElem.style.position = 'absolute'; - this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically - - var yPosition = window.pageYOffset || document.documentElement.scrollTop; - this.fakeElem.style.top = "".concat(yPosition, "px"); - this.fakeElem.setAttribute('readonly', ''); - this.fakeElem.value = this.text; - return this.fakeElem; - } - /** - * Get's the value of fakeElem, - * and makes a selection on it. - */ - - }, { - key: "selectFake", - value: function selectFake() { - var _this = this; - - var fakeElem = this.createFakeElement(); - - this.fakeHandlerCallback = function () { - return _this.removeFake(); - }; - - this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; - this.container.appendChild(fakeElem); - this.selectedText = select_default()(fakeElem); - this.copyText(); - this.removeFake(); - } - /** - * Only removes the fake element after another click event, that way - * a user can hit `Ctrl+C` to copy because selection still exists. - */ - - }, { - key: "removeFake", - value: function removeFake() { - if (this.fakeHandler) { - this.container.removeEventListener('click', this.fakeHandlerCallback); - this.fakeHandler = null; - this.fakeHandlerCallback = null; - } - - if (this.fakeElem) { - this.container.removeChild(this.fakeElem); - this.fakeElem = null; - } - } - /** - * Selects the content from element passed on `target` property. - */ - - }, { - key: "selectTarget", - value: function selectTarget() { - this.selectedText = select_default()(this.target); - this.copyText(); - } - /** - * Executes the copy operation based on the current selection. - */ - - }, { - key: "copyText", - value: function copyText() { - var succeeded; - - try { - succeeded = document.execCommand(this.action); - } catch (err) { - succeeded = false; - } - - this.handleResult(succeeded); - } - /** - * Fires an event based on the copy operation result. - * @param {Boolean} succeeded - */ - - }, { - key: "handleResult", - value: function handleResult(succeeded) { - this.emitter.emit(succeeded ? 'success' : 'error', { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } - /** - * Moves focus away from `target` and back to the trigger, removes current selection. - */ - - }, { - key: "clearSelection", - value: function clearSelection() { - if (this.trigger) { - this.trigger.focus(); - } - - document.activeElement.blur(); - window.getSelection().removeAllRanges(); - } - /** - * Sets the `action` to be performed which can be either 'copy' or 'cut'. - * @param {String} action - */ - - }, { - key: "destroy", - - /** - * Destroy lifecycle. - */ - value: function destroy() { - this.removeFake(); - } - }, { - key: "action", - set: function set() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; - this._action = action; - - if (this._action !== 'copy' && this._action !== 'cut') { - throw new Error('Invalid "action" value, use either "copy" or "cut"'); - } - } - /** - * Gets the `action` property. - * @return {String} - */ - , - get: function get() { - return this._action; - } - /** - * Sets the `target` property using an element - * that will be have its content copied. - * @param {Element} target - */ - - }, { - key: "target", - set: function set(target) { - if (target !== undefined) { - if (target && _typeof(target) === 'object' && target.nodeType === 1) { - if (this.action === 'copy' && target.hasAttribute('disabled')) { - throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); - } - - if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { - throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); - } - - this._target = target; - } else { - throw new Error('Invalid "target" value, use a valid Element'); - } - } - } - /** - * Gets the `target` property. - * @return {String|HTMLElement} - */ - , - get: function get() { - return this._target; - } - }]); - - return ClipboardAction; -}(); - -/* harmony default export */ var clipboard_action = (ClipboardAction); -;// CONCATENATED MODULE: ./src/clipboard.js -function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } - -function clipboard_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function clipboard_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function clipboard_createClass(Constructor, protoProps, staticProps) { if (protoProps) clipboard_defineProperties(Constructor.prototype, protoProps); if (staticProps) clipboard_defineProperties(Constructor, staticProps); return Constructor; } - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } @@ -312,6 +203,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g + + /** * Helper function to retrieve attribute value. * @param {String} suffix @@ -345,7 +238,7 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { function Clipboard(trigger, options) { var _this; - clipboard_classCallCheck(this, Clipboard); + _classCallCheck(this, Clipboard); _this = _super.call(this); @@ -362,7 +255,7 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { */ - clipboard_createClass(Clipboard, [{ + _createClass(Clipboard, [{ key: "resolveOptions", value: function resolveOptions() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -394,18 +287,26 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { key: "onClick", value: function onClick(e) { var trigger = e.delegateTarget || e.currentTarget; - - if (this.clipboardAction) { - this.clipboardAction = null; - } - - this.clipboardAction = new clipboard_action({ - action: this.action(trigger), - target: this.target(trigger), - text: this.text(trigger), + var action = this.action(trigger) || 'copy'; + var text = actions_default({ + action: action, container: this.container, + target: this.target(trigger), + text: this.text(trigger) + }); // Fires an event based on the copy operation result. + + this.emit(text ? 'success' : 'error', { + action: action, + text: text, trigger: trigger, - emitter: this + clearSelection: function clearSelection() { + if (trigger) { + trigger.focus(); + } + + document.activeElement.blur(); + window.getSelection().removeAllRanges(); + } }); } /** @@ -433,9 +334,10 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { } } /** - * Returns the support of the given action, or all actions if no action is - * given. - * @param {String} [action] + * Allow fire programmatically a copy action + * @param {String|HTMLElement} target + * @param {Object} options + * @returns Text copied. */ }, { @@ -456,13 +358,33 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { key: "destroy", value: function destroy() { this.listener.destroy(); - - if (this.clipboardAction) { - this.clipboardAction.destroy(); - this.clipboardAction = null; - } } }], [{ + key: "copy", + value: function copy(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + return actions_copy(target, options); + } + /** + * Allow fire programmatically a cut action + * @param {String|HTMLElement} target + * @returns Text cutted. + */ + + }, { + key: "cut", + value: function cut(target) { + return actions_cut(target); + } + /** + * Returns the support of the given action, or all actions if no action is + * given. + * @param {String} [action] + */ + + }, { key: "isSupported", value: function isSupported() { var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; @@ -948,7 +870,7 @@ module.exports.TinyEmitter = E; /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports -/******/ return __webpack_require__(134); +/******/ return __webpack_require__(686); /******/ })() .default; }); \ No newline at end of file diff --git a/wp-includes/js/clipboard.min.js b/wp-includes/js/clipboard.min.js index 975ec45b78..dc09154209 100644 --- a/wp-includes/js/clipboard.min.js +++ b/wp-includes/js/clipboard.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={134:function(t,e,n){"use strict";n.d(e,{default:function(){return y}});var e=n(279),e=n.n(e),r=n(370),i=n.n(r),r=n(817),o=n.n(r);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + var selectedText = ''; + + if (typeof target === 'string') { + var fakeElement = createFakeElement(target); + options.container.appendChild(fakeElement); + selectedText = select_default()(fakeElement); + command('copy'); + fakeElement.remove(); + } else { + selectedText = select_default()(target); + command('copy'); + } + + return selectedText; +}; + +/* harmony default export */ var actions_copy = (ClipboardActionCopy); +;// CONCATENATED MODULE: ./src/actions/default.js function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + +/** + * Inner function which performs selection from either `text` or `target` + * properties and then executes copy or cut operations. + * @param {Object} options + */ + +var ClipboardActionDefault = function ClipboardActionDefault() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // Defines base properties passed from constructor. + var _options$action = options.action, + action = _options$action === void 0 ? 'copy' : _options$action, + container = options.container, + target = options.target, + text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'. + + if (action !== 'copy' && action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } // Sets the `target` property using an element that will be have its content copied. + + + if (target !== undefined) { + if (target && _typeof(target) === 'object' && target.nodeType === 1) { + if (action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + + if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + } else { + throw new Error('Invalid "target" value, use a valid Element'); + } + } // Define selection strategy based on `text` property. + + + if (text) { + return actions_copy(text, { + container: container + }); + } // Defines which selection strategy based on `target` property. + + + if (target) { + return action === 'cut' ? actions_cut(target) : actions_copy(target, { + container: container + }); + } +}; + +/* harmony default export */ var actions_default = (ClipboardActionDefault); +;// CONCATENATED MODULE: ./src/clipboard.js +function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -/** - * Inner class which performs selection from either `text` or `target` - * properties and then executes copy or cut operations. - */ - -var ClipboardAction = /*#__PURE__*/function () { - /** - * @param {Object} options - */ - function ClipboardAction(options) { - _classCallCheck(this, ClipboardAction); - - this.resolveOptions(options); - this.initSelection(); - } - /** - * Defines base properties passed from constructor. - * @param {Object} options - */ - - - _createClass(ClipboardAction, [{ - key: "resolveOptions", - value: function resolveOptions() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this.action = options.action; - this.container = options.container; - this.emitter = options.emitter; - this.target = options.target; - this.text = options.text; - this.trigger = options.trigger; - this.selectedText = ''; - } - /** - * Decides which selection strategy is going to be applied based - * on the existence of `text` and `target` properties. - */ - - }, { - key: "initSelection", - value: function initSelection() { - if (this.text) { - this.selectFake(); - } else if (this.target) { - this.selectTarget(); - } - } - /** - * Creates a fake textarea element, sets its value from `text` property, - */ - - }, { - key: "createFakeElement", - value: function createFakeElement() { - var isRTL = document.documentElement.getAttribute('dir') === 'rtl'; - this.fakeElem = document.createElement('textarea'); // Prevent zooming on iOS - - this.fakeElem.style.fontSize = '12pt'; // Reset box model - - this.fakeElem.style.border = '0'; - this.fakeElem.style.padding = '0'; - this.fakeElem.style.margin = '0'; // Move element out of screen horizontally - - this.fakeElem.style.position = 'absolute'; - this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically - - var yPosition = window.pageYOffset || document.documentElement.scrollTop; - this.fakeElem.style.top = "".concat(yPosition, "px"); - this.fakeElem.setAttribute('readonly', ''); - this.fakeElem.value = this.text; - return this.fakeElem; - } - /** - * Get's the value of fakeElem, - * and makes a selection on it. - */ - - }, { - key: "selectFake", - value: function selectFake() { - var _this = this; - - var fakeElem = this.createFakeElement(); - - this.fakeHandlerCallback = function () { - return _this.removeFake(); - }; - - this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; - this.container.appendChild(fakeElem); - this.selectedText = select_default()(fakeElem); - this.copyText(); - this.removeFake(); - } - /** - * Only removes the fake element after another click event, that way - * a user can hit `Ctrl+C` to copy because selection still exists. - */ - - }, { - key: "removeFake", - value: function removeFake() { - if (this.fakeHandler) { - this.container.removeEventListener('click', this.fakeHandlerCallback); - this.fakeHandler = null; - this.fakeHandlerCallback = null; - } - - if (this.fakeElem) { - this.container.removeChild(this.fakeElem); - this.fakeElem = null; - } - } - /** - * Selects the content from element passed on `target` property. - */ - - }, { - key: "selectTarget", - value: function selectTarget() { - this.selectedText = select_default()(this.target); - this.copyText(); - } - /** - * Executes the copy operation based on the current selection. - */ - - }, { - key: "copyText", - value: function copyText() { - var succeeded; - - try { - succeeded = document.execCommand(this.action); - } catch (err) { - succeeded = false; - } - - this.handleResult(succeeded); - } - /** - * Fires an event based on the copy operation result. - * @param {Boolean} succeeded - */ - - }, { - key: "handleResult", - value: function handleResult(succeeded) { - this.emitter.emit(succeeded ? 'success' : 'error', { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } - /** - * Moves focus away from `target` and back to the trigger, removes current selection. - */ - - }, { - key: "clearSelection", - value: function clearSelection() { - if (this.trigger) { - this.trigger.focus(); - } - - document.activeElement.blur(); - window.getSelection().removeAllRanges(); - } - /** - * Sets the `action` to be performed which can be either 'copy' or 'cut'. - * @param {String} action - */ - - }, { - key: "destroy", - - /** - * Destroy lifecycle. - */ - value: function destroy() { - this.removeFake(); - } - }, { - key: "action", - set: function set() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; - this._action = action; - - if (this._action !== 'copy' && this._action !== 'cut') { - throw new Error('Invalid "action" value, use either "copy" or "cut"'); - } - } - /** - * Gets the `action` property. - * @return {String} - */ - , - get: function get() { - return this._action; - } - /** - * Sets the `target` property using an element - * that will be have its content copied. - * @param {Element} target - */ - - }, { - key: "target", - set: function set(target) { - if (target !== undefined) { - if (target && _typeof(target) === 'object' && target.nodeType === 1) { - if (this.action === 'copy' && target.hasAttribute('disabled')) { - throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); - } - - if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { - throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); - } - - this._target = target; - } else { - throw new Error('Invalid "target" value, use a valid Element'); - } - } - } - /** - * Gets the `target` property. - * @return {String|HTMLElement} - */ - , - get: function get() { - return this._target; - } - }]); - - return ClipboardAction; -}(); - -/* harmony default export */ var clipboard_action = (ClipboardAction); -;// CONCATENATED MODULE: ./src/clipboard.js -function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } - -function clipboard_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function clipboard_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function clipboard_createClass(Constructor, protoProps, staticProps) { if (protoProps) clipboard_defineProperties(Constructor.prototype, protoProps); if (staticProps) clipboard_defineProperties(Constructor, staticProps); return Constructor; } - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } @@ -313,6 +204,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g + + /** * Helper function to retrieve attribute value. * @param {String} suffix @@ -346,7 +239,7 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { function Clipboard(trigger, options) { var _this; - clipboard_classCallCheck(this, Clipboard); + _classCallCheck(this, Clipboard); _this = _super.call(this); @@ -363,7 +256,7 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { */ - clipboard_createClass(Clipboard, [{ + _createClass(Clipboard, [{ key: "resolveOptions", value: function resolveOptions() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -395,18 +288,26 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { key: "onClick", value: function onClick(e) { var trigger = e.delegateTarget || e.currentTarget; - - if (this.clipboardAction) { - this.clipboardAction = null; - } - - this.clipboardAction = new clipboard_action({ - action: this.action(trigger), - target: this.target(trigger), - text: this.text(trigger), + var action = this.action(trigger) || 'copy'; + var text = actions_default({ + action: action, container: this.container, + target: this.target(trigger), + text: this.text(trigger) + }); // Fires an event based on the copy operation result. + + this.emit(text ? 'success' : 'error', { + action: action, + text: text, trigger: trigger, - emitter: this + clearSelection: function clearSelection() { + if (trigger) { + trigger.focus(); + } + + document.activeElement.blur(); + window.getSelection().removeAllRanges(); + } }); } /** @@ -434,9 +335,10 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { } } /** - * Returns the support of the given action, or all actions if no action is - * given. - * @param {String} [action] + * Allow fire programmatically a copy action + * @param {String|HTMLElement} target + * @param {Object} options + * @returns Text copied. */ }, { @@ -457,13 +359,33 @@ var Clipboard = /*#__PURE__*/function (_Emitter) { key: "destroy", value: function destroy() { this.listener.destroy(); - - if (this.clipboardAction) { - this.clipboardAction.destroy(); - this.clipboardAction = null; - } } }], [{ + key: "copy", + value: function copy(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + return actions_copy(target, options); + } + /** + * Allow fire programmatically a cut action + * @param {String|HTMLElement} target + * @returns Text cutted. + */ + + }, { + key: "cut", + value: function cut(target) { + return actions_cut(target); + } + /** + * Returns the support of the given action, or all actions if no action is + * given. + * @param {String} [action] + */ + + }, { key: "isSupported", value: function isSupported() { var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; @@ -524,9 +446,9 @@ module.exports = closest; /***/ }), /***/ 438: -/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_17417__) { +/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15133__) { -var closest = __nested_webpack_require_17417__(828); +var closest = __nested_webpack_require_15133__(828); /** * Delegates event to a selector. @@ -665,10 +587,10 @@ exports.fn = function(value) { /***/ }), /***/ 370: -/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_20781__) { +/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_18497__) { -var is = __nested_webpack_require_20781__(879); -var delegate = __nested_webpack_require_20781__(438); +var is = __nested_webpack_require_18497__(879); +var delegate = __nested_webpack_require_18497__(438); /** * Validates all params and calls the right @@ -896,7 +818,7 @@ module.exports.TinyEmitter = E; /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function -/******/ function __nested_webpack_require_26163__(moduleId) { +/******/ function __nested_webpack_require_23879__(moduleId) { /******/ // Check if module is in cache /******/ if(__webpack_module_cache__[moduleId]) { /******/ return __webpack_module_cache__[moduleId].exports; @@ -909,7 +831,7 @@ module.exports.TinyEmitter = E; /******/ }; /******/ /******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_26163__); +/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_23879__); /******/ /******/ // Return the exports of the module /******/ return module.exports; @@ -919,11 +841,11 @@ module.exports.TinyEmitter = E; /******/ /* webpack/runtime/compat get default export */ /******/ !function() { /******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __nested_webpack_require_26163__.n = function(module) { +/******/ __nested_webpack_require_23879__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function() { return module['default']; } : /******/ function() { return module; }; -/******/ __nested_webpack_require_26163__.d(getter, { a: getter }); +/******/ __nested_webpack_require_23879__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ }(); @@ -931,9 +853,9 @@ module.exports.TinyEmitter = E; /******/ /* webpack/runtime/define property getters */ /******/ !function() { /******/ // define getter functions for harmony exports -/******/ __nested_webpack_require_26163__.d = function(exports, definition) { +/******/ __nested_webpack_require_23879__.d = function(exports, definition) { /******/ for(var key in definition) { -/******/ if(__nested_webpack_require_26163__.o(definition, key) && !__nested_webpack_require_26163__.o(exports, key)) { +/******/ if(__nested_webpack_require_23879__.o(definition, key) && !__nested_webpack_require_23879__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } @@ -942,14 +864,14 @@ module.exports.TinyEmitter = E; /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ !function() { -/******/ __nested_webpack_require_26163__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ __nested_webpack_require_23879__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } /******/ }(); /******/ /************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports -/******/ return __nested_webpack_require_26163__(134); +/******/ return __nested_webpack_require_23879__(686); /******/ })() .default; }); diff --git a/wp-includes/js/dist/compose.min.js b/wp-includes/js/dist/compose.min.js index a64fc64ba8..be0eb91678 100644 --- a/wp-includes/js/dist/compose.min.js +++ b/wp-includes/js/dist/compose.min.js @@ -1,9 +1,9 @@ /*! This file is auto-generated */ !function(){var e={8294:function(e){ /*! - * clipboard.js v2.0.8 + * clipboard.js v2.0.10 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ -var t;t=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return w}});var r=n(279),o=n.n(r),i=n(370),u=n.n(i),c=n(817),s=n.n(c);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=s()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=s()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==a(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}],n&&l(t.prototype,n),r&&l(t,r),e}(),d=f;function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===p(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=u()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new d({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],r=[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&h(t.prototype,n),r&&h(t,r),i}(o()),w=E},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var u=i.apply(this,arguments);return e.addEventListener(n,u,o),{destroy:function(){e.removeEventListener(n,u,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r":".","?":"/","|":"\\"},f={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)s[111+d]="f"+d;for(d=0;d<=9;++d)s[d+96]=d.toString();g.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},g.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},g.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(b(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},g.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},g.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);c=null},g.init=function(){var e=g(i);for(var t in e)"_"!==t.charAt(0)&&(g[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},g.init(),o.Mousetrap=g,e.exports&&(e.exports=g),void 0===(r=function(){return g}.call(t,n,t,e))||(e.exports=r)}function p(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function h(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return s[e.which]?s[e.which]:a[e.which]?a[e.which]:String.fromCharCode(e.which).toLowerCase()}function v(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function m(e,t,n){return n||(n=function(){if(!c)for(var e in c={},s)e>95&&e<112||s.hasOwnProperty(e)&&(c[s[e]]=e);return c}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function y(e,t){var n,r,o,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?d(e,c,n,r):(u=y(e,r),t._callbacks[u.key]=t._callbacks[u.key]||[],a(u.key,u.modifiers,{type:u.action},o,e,i),t._callbacks[u.key][o?"unshift":"push"]({callback:n,modifiers:u.modifiers,action:u.action,seq:o,level:i,combo:e}))}t._handleKey=function(e,t,n){var r,o=a(e,t,n),i={},f=0,d=!1;for(r=0;r{const o=t(r),i=r.displayName||r.name||"Component";return o.displayName=`${(0,e.upperFirst)((0,e.camelCase)(n))}(${i})`,o}},o=e.flowRight,i=window.wp.element;var u=e=>t((t=>n=>e(n)?(0,i.createElement)(t,n):null),"ifCondition"),c=window.wp.isShallowEqual,s=n.n(c);var a=t((e=>e.prototype instanceof i.Component?class extends e{shouldComponentUpdate(e,t){return!s()(e,this.props)||!s()(t,this.state)}}:class extends i.Component{shouldComponentUpdate(e){return!s()(e,this.props)}render(){return(0,i.createElement)(e,this.props)}}),"pure");function l(){return l=Object.assign||function(e){for(var t=1;t{e.handleEvent(t)}))}};function h(n){return d()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),t((t=>{class r extends i.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}componentDidMount(){(0,e.forEach)(n,((e,t)=>{p.add(t,this)}))}componentWillUnmount(){(0,e.forEach)(n,((e,t)=>{p.remove(t,this)}))}handleEvent(e){const t=n[e.type];"function"==typeof this.wrappedRef[t]&&this.wrappedRef[t](e)}handleRef(e){this.wrappedRef=e,this.props.forwardedRef&&this.props.forwardedRef(e)}render(){return(0,i.createElement)(t,l({},this.props.ownProps,{ref:this.handleRef}))}}return(0,i.forwardRef)(((e,t)=>(0,i.createElement)(r,{ownProps:e,forwardedRef:t})))}),"withGlobalEvents")}const v=new WeakMap;function m(e){const t=v.get(e)||0;return v.set(e,t+1),t}function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,i.useMemo)((()=>{if(n)return n;const r=m(e);return t?`${t}-${r}`:r}),[e])}var b=t((e=>t=>{const n=y(e);return(0,i.createElement)(e,l({},t,{instanceId:n}))}),"withInstanceId");var g=t((t=>class extends i.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(t){clearTimeout(t),this.timeouts=(0,e.without)(this.timeouts,t)}render(){const e={...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout};return(0,i.createElement)(t,e)}}),"withSafeTimeout");function E(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d()("wp.compose.withState",{since:"5.8",alternative:"wp.element.useState"}),t((t=>class extends i.Component{constructor(t){super(t),this.setState=this.setState.bind(this),this.state=e}render(){return(0,i.createElement)(t,l({},this.props,this.state,{setState:this.setState}))}}),"withState")}var w=window.wp.keycodes,k=window.wp.dom;function T(e,t){const n=(0,i.useRef)();return(0,i.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}var C=function(){return T((e=>{let t;function n(n){const{keyCode:r,shiftKey:o,target:i}=n;if(r!==w.TAB)return;const u=o?"findPrevious":"findNext",c=k.focus.tabbable[u](i)||null;if(e.contains(c))return;const s=o?"append":"prepend",{ownerDocument:a}=e,l=a.createElement("div");l.tabIndex=-1,e[s](l),l.focus(),t=setTimeout((()=>e.removeChild(l)))}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n),clearTimeout(t)}}),[])},S=n(8294),L=n.n(S);function x(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4e3;d()("wp.compose.useCopyOnClick",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const r=(0,i.useRef)(),[o,u]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{let o;if(e.current)return r.current=new(L())(e.current,{text:()=>"function"==typeof t?t():t}),r.current.on("success",(e=>{let{clearSelection:t,trigger:r}=e;t(),r&&r.focus(),n&&(u(!0),clearTimeout(o),o=setTimeout((()=>u(!1)),n))})),()=>{r.current&&r.current.destroy(),clearTimeout(o)}}),[t,n,u]),o}function D(e){const t=(0,i.useRef)(e);return t.current=e,t}function O(e,t){const n=D(e),r=D(t);return T((e=>{const t=new(L())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(t=>{let{clearSelection:n}=t;n(),e.focus(),r.current&&r.current()})),()=>{t.destroy()}}),[])}function R(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"firstElement";const t=(0,i.useRef)(e);return(0,i.useEffect)((()=>{t.current=e}),[e]),(0,i.useCallback)((e=>{var n,r;if(!e||!1===t.current)return;if(e.contains(null!==(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.activeElement)&&void 0!==n?n:null))return;let o=e;if("firstElement"===t.current){const t=k.focus.tabbable.find(e)[0];t&&(o=t)}o.focus()}),[])}var _=function(e){const t=(0,i.useRef)(null),n=(0,i.useRef)(null),r=(0,i.useRef)(e);return(0,i.useEffect)((()=>{r.current=e}),[e]),(0,i.useCallback)((e=>{if(e){if(t.current=e,n.current)return;n.current=e.ownerDocument.activeElement}else if(n.current){var o,i,u;const e=null===(o=t.current)||void 0===o?void 0:o.contains(null===(i=t.current)||void 0===i?void 0:i.ownerDocument.activeElement);if(null!==(u=t.current)&&void 0!==u&&u.isConnected&&!e)return;var c;if(r.current)r.current();else null===(c=n.current)||void 0===c||c.focus()}}),[])};const M=["button","submit"];function A(t){const n=(0,i.useRef)(t);(0,i.useEffect)((()=>{n.current=t}),[t]);const r=(0,i.useRef)(!1),o=(0,i.useRef)(),u=(0,i.useCallback)((()=>{clearTimeout(o.current)}),[]);(0,i.useEffect)((()=>()=>u()),[]),(0,i.useEffect)((()=>{t||u()}),[t,u]);const c=(0,i.useCallback)((t=>{const{type:n,target:o}=t;(0,e.includes)(["mouseup","touchend"],n)?r.current=!1:function(t){if(!(t instanceof window.HTMLElement))return!1;switch(t.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,e.includes)(M,t.type)}return!1}(o)&&(r.current=!0)}),[]),s=(0,i.useCallback)((e=>{e.persist(),r.current||(o.current=setTimeout((()=>{document.hasFocus()?"function"==typeof n.current&&n.current(e):e.preventDefault()}),0))}),[]);return{onFocus:u,onMouseDown:c,onMouseUp:c,onTouchStart:c,onTouchEnd:c,onBlur:s}}function P(e,t){"function"==typeof e?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function I(e){const t=(0,i.useRef)(),n=(0,i.useRef)(!1),r=(0,i.useRef)([]),o=(0,i.useRef)(e);return o.current=e,(0,i.useLayoutEffect)((()=>{!1===n.current&&e.forEach(((e,n)=>{const o=r.current[n];e!==o&&(P(o,null),P(e,t.current))})),r.current=e}),e),(0,i.useLayoutEffect)((()=>{n.current=!1})),(0,i.useCallback)((e=>{P(t,e),n.current=!0;const i=e?o.current:r.current;for(const t of i)P(t,e)}),[])}var N=function(e){const t=(0,i.useRef)();(0,i.useEffect)((()=>{t.current=e}),Object.values(e));const n=C(),r=R(e.focusOnMount),o=_(),u=A((e=>{var n,r;null!==(n=t.current)&&void 0!==n&&n.__unstableOnClose?t.current.__unstableOnClose("focus-outside",e):null!==(r=t.current)&&void 0!==r&&r.onClose&&t.current.onClose()})),c=(0,i.useCallback)((e=>{e&&e.addEventListener("keydown",(e=>{var n;e.keyCode===w.ESCAPE&&!e.defaultPrevented&&null!==(n=t.current)&&void 0!==n&&n.onClose&&(e.preventDefault(),t.current.onClose())}))}),[]);return[I([!1!==e.focusOnMount?n:null,!1!==e.focusOnMount?o:null,!1!==e.focusOnMount?r:null,c]),{...u,tabIndex:"-1"}]};const j=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA"];function F(){const t=(0,i.useRef)(null),n=()=>{t.current&&k.focus.focusable.find(t.current).forEach((t=>{(0,e.includes)(j,t.nodeName)&&t.setAttribute("disabled",""),"A"===t.nodeName&&t.setAttribute("tabindex","-1");const n=t.getAttribute("tabindex");null!==n&&"-1"!==n&&t.removeAttribute("tabindex"),t.hasAttribute("contenteditable")&&t.setAttribute("contenteditable","false")}))},r=(0,i.useCallback)((0,e.debounce)(n,void 0,{leading:!0}),[]);return(0,i.useLayoutEffect)((()=>{let e;return n(),t.current&&(e=new window.MutationObserver(r),e.observe(t.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),r.cancel()}}),[]),t}var U="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function H(e){let{onDragStart:t,onDragMove:n,onDragEnd:r}=e;const[o,u]=(0,i.useState)(!1),c=(0,i.useRef)({onDragStart:t,onDragMove:n,onDragEnd:r});U((()=>{c.current.onDragStart=t,c.current.onDragMove=n,c.current.onDragEnd=r}),[t,n,r]);const s=(0,i.useCallback)((e=>c.current.onDragMove&&c.current.onDragMove(e)),[]),a=(0,i.useCallback)((e=>{c.current.onDragEnd&&c.current.onDragEnd(e),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),u(!1)}),[]),l=(0,i.useCallback)((e=>{c.current.onDragStart&&c.current.onDragStart(e),document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),u(!0)}),[]);return(0,i.useEffect)((()=>()=>{o&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))}),[o]),{startDrag:l,endDrag:a,isDragging:o}}var q=n(7973),z=n.n(q);n(5538);function K(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:n}=t.navigator;return-1!==n.indexOf("Mac")||(0,e.includes)(["iPad","iPhone"],n)}var V=function(t,n){let{bindGlobal:r=!1,eventName:o="keydown",isDisabled:u=!1,target:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(0,i.useRef)(n);(0,i.useEffect)((()=>{s.current=n}),[n]),(0,i.useEffect)((()=>{if(u)return;const n=new(z())(c&&c.current?c.current:document);return(0,e.castArray)(t).forEach((e=>{const t=e.split("+"),i=new Set(t.filter((e=>e.length>1))),u=i.has("alt"),c=i.has("shift");if(K()&&(1===i.size&&u||2===i.size&&u&&c))throw new Error(`Cannot bind ${e}. Alt and Shift+Alt modifiers are reserved for character input.`);n[r?"bindGlobal":"bind"](e,(function(){return s.current(...arguments)}),o)})),()=>{n.reset()}}),[t,r,o,c,u])};function W(e){const[t,n]=(0,i.useState)((()=>!(!e||"undefined"==typeof window||!window.matchMedia(e).matches)));return(0,i.useEffect)((()=>{if(!e)return;const t=()=>n(window.matchMedia(e).matches);t();const r=window.matchMedia(e);return r.addListener(t),()=>{r.removeListener(t)}}),[e]),!!e&&t}function $(e){const t=(0,i.useRef)();return(0,i.useEffect)((()=>{t.current=e}),[e]),t.current}var G=()=>W("(prefers-reduced-motion: reduce)");const B={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},Z={">=":"min-width","<":"max-width"},Q={">=":(e,t)=>t>=e,"<":(e,t)=>t1&&void 0!==arguments[1]?arguments[1]:">=";const n=(0,i.useContext)(X),r=!n&&`(${Z[t]}: ${B[e]}px)`,o=W(r||void 0);return n?Q[t](B[e],n):o};Y.__experimentalWidthProvider=X.Provider;var J=Y,ee=n(235),te=n.n(ee)(),ne=window.wp.priorityQueue;function re(e,t){const n=[];for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:{step:1};const{step:n=1}=t,[r,o]=(0,i.useState)([]);return(0,i.useEffect)((()=>{let t=re(e,r);t.length{e.length<=i||(o((t=>[...t,...e.slice(i,i+n)])),i+=n,u.add({},c))};return u.add({},c),()=>u.reset()}),[e]),r};var ie=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Change detection";const n=$(e);Object.entries(null!=n?n:[]).forEach((n=>{let[r,o]=n;o!==e[r]&&console.warn(`${t}: ${r} key changed:`,o,e[r])}))},ue=n(9196);function ce(e,t){var n=(0,ue.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,ue.useRef)(!0),o=(0,ue.useRef)(n),i=r.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n(0,e.debounce)(t,n,r)),[t,n,r]);return(0,i.useEffect)((()=>()=>o.cancel()),[o]),o}function ae(t,n,r){const o=ce((()=>(0,e.throttle)(t,n,r)),[t,n,r]);return(0,i.useEffect)((()=>()=>o.cancel()),[o]),o}function le(e){const t=(0,i.useRef)();return t.current=e,t}function fe(e){let{isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:i,onDragEnd:u,onDragOver:c}=e;const s=le(n),a=le(r),l=le(o),f=le(i),d=le(u),p=le(c);return T((e=>{if(t)return;let n=!1;const{ownerDocument:r}=e;function o(e){n||(n=!0,r.removeEventListener("dragenter",o),r.addEventListener("dragend",v),r.addEventListener("mousemove",v),a.current&&a.current(e))}function i(t){t.preventDefault(),e.contains(t.relatedTarget)||l.current&&l.current(t)}function u(e){!e.defaultPrevented&&p.current&&p.current(e),e.preventDefault()}function c(t){(function(t){const{defaultView:n}=r;if(!(t&&n&&t instanceof n.HTMLElement&&e.contains(t)))return!1;let o=t;do{if(o.dataset.isDropZone)return o===e}while(o=o.parentElement);return!1})(t.relatedTarget)||f.current&&f.current(t)}function h(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,s.current&&s.current(e),v(e))}function v(e){n&&(n=!1,r.addEventListener("dragenter",o),r.removeEventListener("dragend",v),r.removeEventListener("mousemove",v),d.current&&d.current(e))}return e.dataset.isDropZone="true",e.addEventListener("drop",h),e.addEventListener("dragenter",i),e.addEventListener("dragover",u),e.addEventListener("dragleave",c),r.addEventListener("dragenter",o),()=>{s.current=null,a.current=null,l.current=null,f.current=null,d.current=null,p.current=null,delete e.dataset.isDropZone,e.removeEventListener("drop",h),e.removeEventListener("dragenter",i),e.removeEventListener("dragover",u),e.removeEventListener("dragleave",c),r.removeEventListener("dragend",v),r.removeEventListener("mousemove",v),r.addEventListener("dragenter",o)}}),[t])}function de(){return T((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])}function pe(t,n,r,o){var u,c;const s=null!==(u=null==o?void 0:o.initWindowSize)&&void 0!==u?u:30,a=null===(c=null==o?void 0:o.useWindowing)||void 0===c||c,[l,f]=(0,i.useState)({visibleItems:s,start:0,end:s,itemInView:e=>e>=0&&e<=s});return(0,i.useLayoutEffect)((()=>{var i,u,c,s;if(!a)return;const l=(0,k.getScrollContainer)(t.current),d=e=>{var t;if(!l)return;const i=Math.ceil(l.clientHeight/n),u=e?i:null!==(t=null==o?void 0:o.windowOverscan)&&void 0!==t?t:i,c=Math.floor(l.scrollTop/n),s=Math.max(0,c-u),a=Math.min(r-1,c+i+u);f((e=>{const t={visibleItems:i,start:s,end:a,itemInView:e=>s<=e&&e<=a};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};d(!0);const p=(0,e.debounce)((()=>{d()}),16);return null==l||l.addEventListener("scroll",p),null==l||null===(i=l.ownerDocument)||void 0===i||null===(u=i.defaultView)||void 0===u||u.addEventListener("resize",p),null==l||null===(c=l.ownerDocument)||void 0===c||null===(s=c.defaultView)||void 0===s||s.addEventListener("resize",p),()=>{var e,t;null==l||l.removeEventListener("scroll",p),null==l||null===(e=l.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t||t.removeEventListener("resize",p)}}),[n,t,r]),(0,i.useLayoutEffect)((()=>{var e,o;if(!a)return;const i=(0,k.getScrollContainer)(t.current),u=e=>{switch(e.keyCode){case w.HOME:return null==i?void 0:i.scrollTo({top:0});case w.END:return null==i?void 0:i.scrollTo({top:r*n});case w.PAGEUP:return null==i?void 0:i.scrollTo({top:i.scrollTop-l.visibleItems*n});case w.PAGEDOWN:return null==i?void 0:i.scrollTo({top:i.scrollTop+l.visibleItems*n})}};return null==i||null===(e=i.ownerDocument)||void 0===e||null===(o=e.defaultView)||void 0===o||o.addEventListener("keydown",u),()=>{var e,t;null==i||null===(e=i.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t||t.removeEventListener("keydown",u)}}),[r,n,t,l.visibleItems]),[l,f]}}(),(window.wp=window.wp||{}).compose=r}(); \ No newline at end of file +var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return k}});var r=n(279),o=n.n(r),u=n(370),i=n.n(u),c=n(817),s=n.n(c);function a(e){try{return document.execCommand(e)}catch(e){return!1}}var l=function(e){var t=s()(e);return a("cut"),t};function f(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}var d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";if("string"==typeof e){var r=f(e);t.container.appendChild(r),n=s()(r),a("copy"),r.remove()}else n=s()(e),a("copy");return n};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,u=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==p(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return u?d(u,{container:r}):o?"cut"===n?l(o):d(o,{container:r}):void 0};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=i()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=v({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return E("action",e)}},{key:"defaultTarget",value:function(e){var t=E("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return E("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return l(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&m(t.prototype,n),r&&m(t,r),u}(o()),k=T},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var i=u.apply(this,arguments);return e.addEventListener(n,i,o),{destroy:function(){e.removeEventListener(n,i,o)}}}function u(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,u){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,u)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r":".","?":"/","|":"\\"},f={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)s[111+d]="f"+d;for(d=0;d<=9;++d)s[d+96]=d.toString();g.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},g.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},g.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(b(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},g.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},g.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);c=null},g.init=function(){var e=g(u);for(var t in e)"_"!==t.charAt(0)&&(g[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},g.init(),o.Mousetrap=g,e.exports&&(e.exports=g),void 0===(r=function(){return g}.call(t,n,t,e))||(e.exports=r)}function p(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function v(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return s[e.which]?s[e.which]:a[e.which]?a[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function m(e,t,n){return n||(n=function(){if(!c)for(var e in c={},s)e>95&&e<112||s.hasOwnProperty(e)&&(c[s[e]]=e);return c}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function y(e,t){var n,r,o,u=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?d(e,c,n,r):(i=y(e,r),t._callbacks[i.key]=t._callbacks[i.key]||[],a(i.key,i.modifiers,{type:i.action},o,e,u),t._callbacks[i.key][o?"unshift":"push"]({callback:n,modifiers:i.modifiers,action:i.action,seq:o,level:u,combo:e}))}t._handleKey=function(e,t,n){var r,o=a(e,t,n),u={},f=0,d=!1;for(r=0;r{const o=t(r),u=r.displayName||r.name||"Component";return o.displayName=`${(0,e.upperFirst)((0,e.camelCase)(n))}(${u})`,o}},o=e.flowRight,u=window.wp.element;var i=e=>t((t=>n=>e(n)?(0,u.createElement)(t,n):null),"ifCondition"),c=window.wp.isShallowEqual,s=n.n(c);var a=t((e=>e.prototype instanceof u.Component?class extends e{shouldComponentUpdate(e,t){return!s()(e,this.props)||!s()(t,this.state)}}:class extends u.Component{shouldComponentUpdate(e){return!s()(e,this.props)}render(){return(0,u.createElement)(e,this.props)}}),"pure");function l(){return l=Object.assign||function(e){for(var t=1;t{e.handleEvent(t)}))}};function v(n){return d()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),t((t=>{class r extends u.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}componentDidMount(){(0,e.forEach)(n,((e,t)=>{p.add(t,this)}))}componentWillUnmount(){(0,e.forEach)(n,((e,t)=>{p.remove(t,this)}))}handleEvent(e){const t=n[e.type];"function"==typeof this.wrappedRef[t]&&this.wrappedRef[t](e)}handleRef(e){this.wrappedRef=e,this.props.forwardedRef&&this.props.forwardedRef(e)}render(){return(0,u.createElement)(t,l({},this.props.ownProps,{ref:this.handleRef}))}}return(0,u.forwardRef)(((e,t)=>(0,u.createElement)(r,{ownProps:e,forwardedRef:t})))}),"withGlobalEvents")}const h=new WeakMap;function m(e){const t=h.get(e)||0;return h.set(e,t+1),t}function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,u.useMemo)((()=>{if(n)return n;const r=m(e);return t?`${t}-${r}`:r}),[e])}var b=t((e=>t=>{const n=y(e);return(0,u.createElement)(e,l({},t,{instanceId:n}))}),"withInstanceId");var g=t((t=>class extends u.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(t){clearTimeout(t),this.timeouts=(0,e.without)(this.timeouts,t)}render(){const e={...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout};return(0,u.createElement)(t,e)}}),"withSafeTimeout");function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d()("wp.compose.withState",{since:"5.8",alternative:"wp.element.useState"}),t((t=>class extends u.Component{constructor(t){super(t),this.setState=this.setState.bind(this),this.state=e}render(){return(0,u.createElement)(t,l({},this.props,this.state,{setState:this.setState}))}}),"withState")}var E=window.wp.keycodes,T=window.wp.dom;function k(e,t){const n=(0,u.useRef)();return(0,u.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}var L=function(){return k((e=>{let t;function n(n){const{keyCode:r,shiftKey:o,target:u}=n;if(r!==E.TAB)return;const i=o?"findPrevious":"findNext",c=T.focus.tabbable[i](u)||null;if(e.contains(c))return;const s=o?"append":"prepend",{ownerDocument:a}=e,l=a.createElement("div");l.tabIndex=-1,e[s](l),l.focus(),t=setTimeout((()=>e.removeChild(l)))}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n),clearTimeout(t)}}),[])},C=n(8294),S=n.n(C);function x(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4e3;d()("wp.compose.useCopyOnClick",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const r=(0,u.useRef)(),[o,i]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{let o;if(e.current)return r.current=new(S())(e.current,{text:()=>"function"==typeof t?t():t}),r.current.on("success",(e=>{let{clearSelection:t,trigger:r}=e;t(),r&&r.focus(),n&&(i(!0),clearTimeout(o),o=setTimeout((()=>i(!1)),n))})),()=>{r.current&&r.current.destroy(),clearTimeout(o)}}),[t,n,i]),o}function D(e){const t=(0,u.useRef)(e);return t.current=e,t}function R(e,t){const n=D(e),r=D(t);return k((e=>{const t=new(S())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(t=>{let{clearSelection:n}=t;n(),e.focus(),r.current&&r.current()})),()=>{t.destroy()}}),[])}function M(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"firstElement";const t=(0,u.useRef)(e);return(0,u.useEffect)((()=>{t.current=e}),[e]),(0,u.useCallback)((e=>{var n,r;if(!e||!1===t.current)return;if(e.contains(null!==(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.activeElement)&&void 0!==n?n:null))return;let o=e;if("firstElement"===t.current){const t=T.focus.tabbable.find(e)[0];t&&(o=t)}o.focus()}),[])}var O=function(e){const t=(0,u.useRef)(null),n=(0,u.useRef)(null),r=(0,u.useRef)(e);return(0,u.useEffect)((()=>{r.current=e}),[e]),(0,u.useCallback)((e=>{if(e){if(t.current=e,n.current)return;n.current=e.ownerDocument.activeElement}else if(n.current){var o,u,i;const e=null===(o=t.current)||void 0===o?void 0:o.contains(null===(u=t.current)||void 0===u?void 0:u.ownerDocument.activeElement);if(null!==(i=t.current)&&void 0!==i&&i.isConnected&&!e)return;var c;if(r.current)r.current();else null===(c=n.current)||void 0===c||c.focus()}}),[])};const _=["button","submit"];function P(t){const n=(0,u.useRef)(t);(0,u.useEffect)((()=>{n.current=t}),[t]);const r=(0,u.useRef)(!1),o=(0,u.useRef)(),i=(0,u.useCallback)((()=>{clearTimeout(o.current)}),[]);(0,u.useEffect)((()=>()=>i()),[]),(0,u.useEffect)((()=>{t||i()}),[t,i]);const c=(0,u.useCallback)((t=>{const{type:n,target:o}=t;(0,e.includes)(["mouseup","touchend"],n)?r.current=!1:function(t){if(!(t instanceof window.HTMLElement))return!1;switch(t.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,e.includes)(_,t.type)}return!1}(o)&&(r.current=!0)}),[]),s=(0,u.useCallback)((e=>{e.persist(),r.current||(o.current=setTimeout((()=>{document.hasFocus()?"function"==typeof n.current&&n.current(e):e.preventDefault()}),0))}),[]);return{onFocus:i,onMouseDown:c,onMouseUp:c,onTouchStart:c,onTouchEnd:c,onBlur:s}}function A(e,t){"function"==typeof e?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function I(e){const t=(0,u.useRef)(),n=(0,u.useRef)(!1),r=(0,u.useRef)([]),o=(0,u.useRef)(e);return o.current=e,(0,u.useLayoutEffect)((()=>{!1===n.current&&e.forEach(((e,n)=>{const o=r.current[n];e!==o&&(A(o,null),A(e,t.current))})),r.current=e}),e),(0,u.useLayoutEffect)((()=>{n.current=!1})),(0,u.useCallback)((e=>{A(t,e),n.current=!0;const u=e?o.current:r.current;for(const t of u)A(t,e)}),[])}var N=function(e){const t=(0,u.useRef)();(0,u.useEffect)((()=>{t.current=e}),Object.values(e));const n=L(),r=M(e.focusOnMount),o=O(),i=P((e=>{var n,r;null!==(n=t.current)&&void 0!==n&&n.__unstableOnClose?t.current.__unstableOnClose("focus-outside",e):null!==(r=t.current)&&void 0!==r&&r.onClose&&t.current.onClose()})),c=(0,u.useCallback)((e=>{e&&e.addEventListener("keydown",(e=>{var n;e.keyCode===E.ESCAPE&&!e.defaultPrevented&&null!==(n=t.current)&&void 0!==n&&n.onClose&&(e.preventDefault(),t.current.onClose())}))}),[]);return[I([!1!==e.focusOnMount?n:null,!1!==e.focusOnMount?o:null,!1!==e.focusOnMount?r:null,c]),{...i,tabIndex:"-1"}]};const j=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA"];function U(){const t=(0,u.useRef)(null),n=()=>{t.current&&T.focus.focusable.find(t.current).forEach((t=>{(0,e.includes)(j,t.nodeName)&&t.setAttribute("disabled",""),"A"===t.nodeName&&t.setAttribute("tabindex","-1");const n=t.getAttribute("tabindex");null!==n&&"-1"!==n&&t.removeAttribute("tabindex"),t.hasAttribute("contenteditable")&&t.setAttribute("contenteditable","false")}))},r=(0,u.useCallback)((0,e.debounce)(n,void 0,{leading:!0}),[]);return(0,u.useLayoutEffect)((()=>{let e;return n(),t.current&&(e=new window.MutationObserver(r),e.observe(t.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),r.cancel()}}),[]),t}var q="undefined"!=typeof window?u.useLayoutEffect:u.useEffect;function z(e){let{onDragStart:t,onDragMove:n,onDragEnd:r}=e;const[o,i]=(0,u.useState)(!1),c=(0,u.useRef)({onDragStart:t,onDragMove:n,onDragEnd:r});q((()=>{c.current.onDragStart=t,c.current.onDragMove=n,c.current.onDragEnd=r}),[t,n,r]);const s=(0,u.useCallback)((e=>c.current.onDragMove&&c.current.onDragMove(e)),[]),a=(0,u.useCallback)((e=>{c.current.onDragEnd&&c.current.onDragEnd(e),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),i(!1)}),[]),l=(0,u.useCallback)((e=>{c.current.onDragStart&&c.current.onDragStart(e),document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),i(!0)}),[]);return(0,u.useEffect)((()=>()=>{o&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))}),[o]),{startDrag:l,endDrag:a,isDragging:o}}var K=n(7973),F=n.n(K);n(5538);function V(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:n}=t.navigator;return-1!==n.indexOf("Mac")||(0,e.includes)(["iPad","iPhone"],n)}var H=function(t,n){let{bindGlobal:r=!1,eventName:o="keydown",isDisabled:i=!1,target:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(0,u.useRef)(n);(0,u.useEffect)((()=>{s.current=n}),[n]),(0,u.useEffect)((()=>{if(i)return;const n=new(F())(c&&c.current?c.current:document);return(0,e.castArray)(t).forEach((e=>{const t=e.split("+"),u=new Set(t.filter((e=>e.length>1))),i=u.has("alt"),c=u.has("shift");if(V()&&(1===u.size&&i||2===u.size&&i&&c))throw new Error(`Cannot bind ${e}. Alt and Shift+Alt modifiers are reserved for character input.`);n[r?"bindGlobal":"bind"](e,(function(){return s.current(...arguments)}),o)})),()=>{n.reset()}}),[t,r,o,c,i])};function W(e){const[t,n]=(0,u.useState)((()=>!(!e||"undefined"==typeof window||!window.matchMedia(e).matches)));return(0,u.useEffect)((()=>{if(!e)return;const t=()=>n(window.matchMedia(e).matches);t();const r=window.matchMedia(e);return r.addListener(t),()=>{r.removeListener(t)}}),[e]),!!e&&t}function $(e){const t=(0,u.useRef)();return(0,u.useEffect)((()=>{t.current=e}),[e]),t.current}var G=()=>W("(prefers-reduced-motion: reduce)");const B={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},Z={">=":"min-width","<":"max-width"},Q={">=":(e,t)=>t>=e,"<":(e,t)=>t1&&void 0!==arguments[1]?arguments[1]:">=";const n=(0,u.useContext)(X),r=!n&&`(${Z[t]}: ${B[e]}px)`,o=W(r||void 0);return n?Q[t](B[e],n):o};Y.__experimentalWidthProvider=X.Provider;var J=Y,ee=n(235),te=n.n(ee)(),ne=window.wp.priorityQueue;function re(e,t){const n=[];for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:{step:1};const{step:n=1}=t,[r,o]=(0,u.useState)([]);return(0,u.useEffect)((()=>{let t=re(e,r);t.length{e.length<=u||(o((t=>[...t,...e.slice(u,u+n)])),u+=n,i.add({},c))};return i.add({},c),()=>i.reset()}),[e]),r};var ue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Change detection";const n=$(e);Object.entries(null!=n?n:[]).forEach((n=>{let[r,o]=n;o!==e[r]&&console.warn(`${t}: ${r} key changed:`,o,e[r])}))},ie=n(9196);function ce(e,t){var n=(0,ie.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,ie.useRef)(!0),o=(0,ie.useRef)(n),u=r.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n(0,e.debounce)(t,n,r)),[t,n,r]);return(0,u.useEffect)((()=>()=>o.cancel()),[o]),o}function ae(t,n,r){const o=ce((()=>(0,e.throttle)(t,n,r)),[t,n,r]);return(0,u.useEffect)((()=>()=>o.cancel()),[o]),o}function le(e){const t=(0,u.useRef)();return t.current=e,t}function fe(e){let{isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:u,onDragEnd:i,onDragOver:c}=e;const s=le(n),a=le(r),l=le(o),f=le(u),d=le(i),p=le(c);return k((e=>{if(t)return;let n=!1;const{ownerDocument:r}=e;function o(e){n||(n=!0,r.removeEventListener("dragenter",o),r.addEventListener("dragend",h),r.addEventListener("mousemove",h),a.current&&a.current(e))}function u(t){t.preventDefault(),e.contains(t.relatedTarget)||l.current&&l.current(t)}function i(e){!e.defaultPrevented&&p.current&&p.current(e),e.preventDefault()}function c(t){(function(t){const{defaultView:n}=r;if(!(t&&n&&t instanceof n.HTMLElement&&e.contains(t)))return!1;let o=t;do{if(o.dataset.isDropZone)return o===e}while(o=o.parentElement);return!1})(t.relatedTarget)||f.current&&f.current(t)}function v(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,s.current&&s.current(e),h(e))}function h(e){n&&(n=!1,r.addEventListener("dragenter",o),r.removeEventListener("dragend",h),r.removeEventListener("mousemove",h),d.current&&d.current(e))}return e.dataset.isDropZone="true",e.addEventListener("drop",v),e.addEventListener("dragenter",u),e.addEventListener("dragover",i),e.addEventListener("dragleave",c),r.addEventListener("dragenter",o),()=>{s.current=null,a.current=null,l.current=null,f.current=null,d.current=null,p.current=null,delete e.dataset.isDropZone,e.removeEventListener("drop",v),e.removeEventListener("dragenter",u),e.removeEventListener("dragover",i),e.removeEventListener("dragleave",c),r.removeEventListener("dragend",h),r.removeEventListener("mousemove",h),r.addEventListener("dragenter",o)}}),[t])}function de(){return k((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])}function pe(t,n,r,o){var i,c;const s=null!==(i=null==o?void 0:o.initWindowSize)&&void 0!==i?i:30,a=null===(c=null==o?void 0:o.useWindowing)||void 0===c||c,[l,f]=(0,u.useState)({visibleItems:s,start:0,end:s,itemInView:e=>e>=0&&e<=s});return(0,u.useLayoutEffect)((()=>{var u,i,c,s;if(!a)return;const l=(0,T.getScrollContainer)(t.current),d=e=>{var t;if(!l)return;const u=Math.ceil(l.clientHeight/n),i=e?u:null!==(t=null==o?void 0:o.windowOverscan)&&void 0!==t?t:u,c=Math.floor(l.scrollTop/n),s=Math.max(0,c-i),a=Math.min(r-1,c+u+i);f((e=>{const t={visibleItems:u,start:s,end:a,itemInView:e=>s<=e&&e<=a};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};d(!0);const p=(0,e.debounce)((()=>{d()}),16);return null==l||l.addEventListener("scroll",p),null==l||null===(u=l.ownerDocument)||void 0===u||null===(i=u.defaultView)||void 0===i||i.addEventListener("resize",p),null==l||null===(c=l.ownerDocument)||void 0===c||null===(s=c.defaultView)||void 0===s||s.addEventListener("resize",p),()=>{var e,t;null==l||l.removeEventListener("scroll",p),null==l||null===(e=l.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t||t.removeEventListener("resize",p)}}),[n,t,r]),(0,u.useLayoutEffect)((()=>{var e,o;if(!a)return;const u=(0,T.getScrollContainer)(t.current),i=e=>{switch(e.keyCode){case E.HOME:return null==u?void 0:u.scrollTo({top:0});case E.END:return null==u?void 0:u.scrollTo({top:r*n});case E.PAGEUP:return null==u?void 0:u.scrollTo({top:u.scrollTop-l.visibleItems*n});case E.PAGEDOWN:return null==u?void 0:u.scrollTo({top:u.scrollTop+l.visibleItems*n})}};return null==u||null===(e=u.ownerDocument)||void 0===e||null===(o=e.defaultView)||void 0===o||o.addEventListener("keydown",i),()=>{var e,t;null==u||null===(e=u.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t||t.removeEventListener("keydown",i)}}),[r,n,t,l.visibleItems]),[l,f]}}(),(window.wp=window.wp||{}).compose=r}(); \ No newline at end of file diff --git a/wp-includes/js/underscore.js b/wp-includes/js/underscore.js index d0ef49e028..22f6d87955 100644 --- a/wp-includes/js/underscore.js +++ b/wp-includes/js/underscore.js @@ -7,13 +7,13 @@ exports.noConflict = function () { global._ = current; return exports; }; }())); }(this, (function () { - // Underscore.js 1.13.1 + // Underscore.js 1.13.2 // https://underscorejs.org // (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. // Current version. - var VERSION = '1.13.1'; + var VERSION = '1.13.2'; // Establish the root object, `window` (`self`) in the browser, `global` // on the server, or `this` in some virtual machines. We use `self` @@ -249,7 +249,7 @@ var hash = {}; for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; return { - contains: function(key) { return hash[key]; }, + contains: function(key) { return hash[key] === true; }, push: function(key) { hash[key] = true; return keys.push(key); @@ -1513,6 +1513,19 @@ return result; } + // Safely create a real, live array from anything iterable. + var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; + function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); + } + // Sample **n** random values from a collection using the modern version of the // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). // If **n** is not specified, returns a single random element. @@ -1522,7 +1535,7 @@ if (!isArrayLike(obj)) obj = values(obj); return obj[random(obj.length - 1)]; } - var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var sample = toArray(obj); var length = getLength(sample); n = Math.max(Math.min(n, length), 0); var last = length - 1; @@ -1599,19 +1612,6 @@ result[pass ? 0 : 1].push(value); }, true); - // Safely create a real, live array from anything iterable. - var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; - function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); - } - // Return the number of elements in a collection. function size(obj) { if (obj == null) return 0; diff --git a/wp-includes/js/underscore.min.js b/wp-includes/js/underscore.min.js index 3169bf8a41..af25dc6142 100644 --- a/wp-includes/js/underscore.min.js +++ b/wp-includes/js/underscore.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(n,r){var t,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,t=n._,(e=n._=r()).noConflict=function(){return n._=t,e})}(this,function(){var n="1.13.1",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,F=Object.prototype,V="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,a=e.slice,s=F.toString,q=F.hasOwnProperty,t="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=t&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,i){return i=null==i?u.length-1:+i,function(){for(var n=Math.max(arguments.length-i,0),r=Array(n),t=0;t":">",'"':""","'":"'","`":"`"},Un=qn(t),t=qn(An(t)),Wn=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},zn=/(.)^/,Ln={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},$n=/\\|'|\r|\n|\u2028|\u2029/g;function Cn(n){return"\\"+Ln[n]}var Kn=/^\s*(\w|\$)+\s*$/;var Jn=0;function Gn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);e=En(n.prototype),r=n.apply(e,u);return i(r)?r:e}var M=l(function(u,i){function o(){for(var n=0,r=i.length,t=Array(r),e=0;e":">",'"':""","'":"'","`":"`"},qn=Pn(t),t=Pn(An(t)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);e=En(n.prototype),r=n.apply(e,u);return i(r)?r:e}var M=l(function(u,i){function o(){for(var n=0,r=i.length,t=Array(r),e=0;eadd( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2015-05-03' ); did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' ); - $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.13.1', 1 ); - $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.4.0', 1 ); + $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.13.2', 1 ); + $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.4.1', 1 ); $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 ); did_action( 'init' ) && $scripts->localize( diff --git a/wp-includes/version.php b/wp-includes/version.php index 945fb29836..69bb7325a2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53163'; +$wp_version = '6.0-alpha-53164'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.