Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 12.9.0 |
Comparing to | |
See all releases |
Code changes from version 12.8.1 to 12.9.0
- build/block-editor/index.js +2217 -1619
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +40 -36
build/block-editor/index.js
CHANGED
@@ -2214,6 +2214,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2214 |
"__experimentalBorderStyleControl": function() { return /* reexport */ BorderStyleControl; },
|
2215 |
"__experimentalColorGradientControl": function() { return /* reexport */ control; },
|
2216 |
"__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; },
|
|
|
2217 |
"__experimentalDuotoneControl": function() { return /* reexport */ duotone_control; },
|
2218 |
"__experimentalFontAppearanceControl": function() { return /* reexport */ FontAppearanceControl; },
|
2219 |
"__experimentalFontFamilyControl": function() { return /* reexport */ FontFamilyControl; },
|
@@ -2292,6 +2293,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
2292 |
"__experimentalGetAllowedPatterns": function() { return __experimentalGetAllowedPatterns; },
|
2293 |
"__experimentalGetBlockListSettingsForBlocks": function() { return __experimentalGetBlockListSettingsForBlocks; },
|
2294 |
"__experimentalGetDirectInsertBlock": function() { return __experimentalGetDirectInsertBlock; },
|
|
|
2295 |
"__experimentalGetLastBlockAttributeChanges": function() { return __experimentalGetLastBlockAttributeChanges; },
|
2296 |
"__experimentalGetParsedPattern": function() { return __experimentalGetParsedPattern; },
|
2297 |
"__experimentalGetPatternTransformItems": function() { return __experimentalGetPatternTransformItems; },
|
@@ -2304,6 +2306,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
2304 |
"areInnerBlocksControlled": function() { return areInnerBlocksControlled; },
|
2305 |
"canInsertBlockType": function() { return canInsertBlockType; },
|
2306 |
"canInsertBlocks": function() { return canInsertBlocks; },
|
|
|
2307 |
"canMoveBlock": function() { return canMoveBlock; },
|
2308 |
"canMoveBlocks": function() { return canMoveBlocks; },
|
2309 |
"canRemoveBlock": function() { return canRemoveBlock; },
|
@@ -2543,6 +2546,8 @@ const PREFERENCES_DEFAULTS = {
|
|
2543 |
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
|
2544 |
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
|
2545 |
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
|
|
|
|
|
2546 |
* @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
|
2547 |
*/
|
2548 |
|
@@ -2656,6 +2661,7 @@ const SETTINGS_DEFAULTS = {
|
|
2656 |
__experimentalBlockPatternCategories: [],
|
2657 |
__experimentalSpotlightEntityBlocks: [],
|
2658 |
__experimentalGenerateAnchors: false,
|
|
|
2659 |
__unstableGalleryWithImageBlocks: false,
|
2660 |
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
|
2661 |
// The setting is only kept for backward compatibility purposes.
|
@@ -4959,6 +4965,27 @@ const getGlobalBlockCount = rememo((state, blockName) => {
|
|
4959 |
return block.name === blockName ? accumulator + 1 : accumulator;
|
4960 |
}, 0);
|
4961 |
}, state => [state.blocks.order, state.blocks.byClientId]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4962 |
/**
|
4963 |
* Given an array of block client IDs, returns the corresponding array of block
|
4964 |
* objects.
|
@@ -6067,6 +6094,25 @@ function canMoveBlocks(state, clientIds) {
|
|
6067 |
let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
6068 |
return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId));
|
6069 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6070 |
/**
|
6071 |
* Returns information about how recently and frequently a block has been inserted.
|
6072 |
*
|
@@ -6530,7 +6576,9 @@ const __experimentalGetParsedPattern = rememo((state, patternName) => {
|
|
6530 |
}
|
6531 |
|
6532 |
return { ...pattern,
|
6533 |
-
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content
|
|
|
|
|
6534 |
};
|
6535 |
}, state => [state.settings.__experimentalBlockPatterns]);
|
6536 |
const getAllAllowedPatterns = rememo(state => {
|
@@ -6782,9 +6830,9 @@ function __experimentalGetLastBlockAttributeChanges(state) {
|
|
6782 |
*/
|
6783 |
|
6784 |
function getReusableBlocks(state) {
|
6785 |
-
var _state$settings$__exp, _state$
|
6786 |
|
6787 |
-
return (_state$settings$__exp = state === null || state === void 0 ? void 0 : (_state$
|
6788 |
}
|
6789 |
/**
|
6790 |
* Returns whether the navigation mode is enabled.
|
@@ -8631,6 +8679,141 @@ function appendSelectors(selectors) {
|
|
8631 |
return selectors.split(',').map(subselector => `.editor-styles-wrapper ${subselector} ${append}`).join(',');
|
8632 |
}
|
8633 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8634 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-setting/index.js
|
8635 |
/**
|
8636 |
* External dependencies
|
@@ -8769,9 +8952,35 @@ function useSetting(path) {
|
|
8769 |
return setting;
|
8770 |
}
|
8771 |
|
8772 |
-
;// CONCATENATED MODULE:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8773 |
|
8774 |
|
|
|
|
|
|
|
8775 |
|
8776 |
/**
|
8777 |
* WordPress dependencies
|
@@ -8779,75 +8988,123 @@ function useSetting(path) {
|
|
8779 |
|
8780 |
|
8781 |
|
8782 |
-
|
8783 |
-
|
8784 |
-
|
8785 |
-
|
8786 |
-
|
8787 |
-
|
|
|
|
|
8788 |
|
8789 |
-
function JustifyContentUI(_ref) {
|
8790 |
let {
|
8791 |
-
|
8792 |
-
|
8793 |
-
onChange,
|
8794 |
-
value,
|
8795 |
-
popoverProps,
|
8796 |
-
isToolbar
|
8797 |
} = _ref;
|
|
|
|
|
8798 |
|
8799 |
-
|
8800 |
-
|
8801 |
-
|
8802 |
-
|
8803 |
-
|
8804 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8805 |
} else {
|
8806 |
-
|
8807 |
}
|
8808 |
-
}
|
8809 |
|
8810 |
-
|
8811 |
-
|
8812 |
-
|
8813 |
-
|
8814 |
-
|
8815 |
-
|
8816 |
-
|
8817 |
-
|
8818 |
-
|
8819 |
-
|
8820 |
-
|
8821 |
-
|
8822 |
-
|
8823 |
-
}
|
8824 |
-
|
8825 |
-
icon: justify_right,
|
8826 |
-
title: (0,external_wp_i18n_namespaceObject.__)('Justify items right'),
|
8827 |
-
isActive: 'right' === value,
|
8828 |
-
onClick: () => handleClick('right')
|
8829 |
-
}, {
|
8830 |
-
name: 'space-between',
|
8831 |
-
icon: justify_space_between,
|
8832 |
-
title: (0,external_wp_i18n_namespaceObject.__)('Space between items'),
|
8833 |
-
isActive: 'space-between' === value,
|
8834 |
-
onClick: () => handleClick('space-between')
|
8835 |
-
}];
|
8836 |
-
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
|
8837 |
-
const extraProps = isToolbar ? {
|
8838 |
-
isCollapsed
|
8839 |
-
} : {};
|
8840 |
-
return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({
|
8841 |
-
icon: icon,
|
8842 |
-
popoverProps: popoverProps,
|
8843 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Change items justification'),
|
8844 |
-
controls: allControls.filter(elem => allowedControls.includes(elem.name))
|
8845 |
-
}, extraProps));
|
8846 |
}
|
8847 |
|
8848 |
-
|
8849 |
|
8850 |
-
|
|
|
|
|
|
|
8851 |
|
8852 |
|
8853 |
|
@@ -8855,18 +9112,85 @@ function JustifyContentUI(_ref) {
|
|
8855 |
* Internal dependencies
|
8856 |
*/
|
8857 |
|
8858 |
-
|
8859 |
-
|
8860 |
-
|
8861 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8862 |
}
|
8863 |
-
|
8864 |
-
|
8865 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8866 |
}));
|
8867 |
}
|
8868 |
|
8869 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/
|
|
|
8870 |
|
8871 |
|
8872 |
/**
|
@@ -8874,84 +9198,918 @@ function JustifyToolbar(props) {
|
|
8874 |
*/
|
8875 |
|
8876 |
|
8877 |
-
|
8878 |
/**
|
8879 |
* Internal dependencies
|
8880 |
*/
|
8881 |
|
8882 |
|
8883 |
|
8884 |
-
// Used with the default, horizontal flex orientation.
|
8885 |
|
8886 |
-
|
8887 |
-
|
8888 |
-
right: 'flex-end',
|
8889 |
-
center: 'center',
|
8890 |
-
'space-between': 'space-between'
|
8891 |
-
}; // Used with the vertical (column) flex orientation.
|
8892 |
|
8893 |
-
|
8894 |
-
|
8895 |
-
|
8896 |
-
|
8897 |
-
};
|
8898 |
-
const
|
8899 |
-
|
8900 |
-
name: 'flex',
|
8901 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Flex'),
|
8902 |
-
inspectorControls: function FlexLayoutInspectorControls(_ref) {
|
8903 |
-
let {
|
8904 |
-
layout = {},
|
8905 |
-
onChange
|
8906 |
-
} = _ref;
|
8907 |
-
const {
|
8908 |
-
allowOrientation = true
|
8909 |
-
} = layout;
|
8910 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(FlexLayoutJustifyContentControl, {
|
8911 |
-
layout: layout,
|
8912 |
-
onChange: onChange
|
8913 |
-
})), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, allowOrientation && (0,external_wp_element_namespaceObject.createElement)(OrientationControl, {
|
8914 |
-
layout: layout,
|
8915 |
-
onChange: onChange
|
8916 |
-
}))), (0,external_wp_element_namespaceObject.createElement)(FlexWrapControl, {
|
8917 |
-
layout: layout,
|
8918 |
-
onChange: onChange
|
8919 |
-
}));
|
8920 |
-
},
|
8921 |
-
toolBarControls: function FlexLayoutToolbarControls(_ref2) {
|
8922 |
-
let {
|
8923 |
-
layout = {},
|
8924 |
-
onChange,
|
8925 |
-
layoutBlockSupport
|
8926 |
-
} = _ref2;
|
8927 |
|
8928 |
-
|
8929 |
-
|
8930 |
-
|
|
|
8931 |
|
8932 |
-
|
8933 |
-
group: "block",
|
8934 |
-
__experimentalShareWithChildBlocks: true
|
8935 |
-
}, (0,external_wp_element_namespaceObject.createElement)(FlexLayoutJustifyContentControl, {
|
8936 |
-
layout: layout,
|
8937 |
-
onChange: onChange,
|
8938 |
-
isToolbar: true
|
8939 |
-
}));
|
8940 |
-
},
|
8941 |
-
save: function FlexLayoutStyle(_ref3) {
|
8942 |
-
var _style$spacing$blockG, _style$spacing;
|
8943 |
|
8944 |
-
|
8945 |
-
|
8946 |
-
|
8947 |
-
|
8948 |
-
|
8949 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8950 |
orientation = 'horizontal'
|
8951 |
} = layout;
|
8952 |
const blockGapSupport = useSetting('spacing.blockGap');
|
8953 |
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
8954 |
-
const blockGapValue = (
|
8955 |
const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
|
8956 |
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
8957 |
const rowOrientation = `
|
@@ -8967,8 +10125,8 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
|
8967 |
return (0,external_wp_element_namespaceObject.createElement)("style", null, `
|
8968 |
${appendSelectors(selector)} {
|
8969 |
display: flex;
|
8970 |
-
gap: ${hasBlockGapStylesSupport ? blockGapValue : '0.5em'};
|
8971 |
flex-wrap: ${flexWrap};
|
|
|
8972 |
${orientation === 'horizontal' ? rowOrientation : columnOrientation}
|
8973 |
}
|
8974 |
|
@@ -9159,6 +10317,7 @@ function Icon(_ref) {
|
|
9159 |
|
9160 |
|
9161 |
|
|
|
9162 |
/* harmony default export */ var flow = ({
|
9163 |
name: 'default',
|
9164 |
label: (0,external_wp_i18n_namespaceObject.__)('Flow'),
|
@@ -9227,7 +10386,7 @@ function Icon(_ref) {
|
|
9227 |
return null;
|
9228 |
},
|
9229 |
save: function DefaultLayoutStyle(_ref2) {
|
9230 |
-
var _style$spacing
|
9231 |
|
9232 |
let {
|
9233 |
selector,
|
@@ -9240,18 +10399,17 @@ function Icon(_ref) {
|
|
9240 |
} = layout;
|
9241 |
const blockGapSupport = useSetting('spacing.blockGap');
|
9242 |
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
9243 |
-
const
|
|
|
9244 |
let output = !!contentSize || !!wideSize ? `
|
9245 |
${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
|
9246 |
max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
|
9247 |
margin-left: auto !important;
|
9248 |
margin-right: auto !important;
|
9249 |
}
|
9250 |
-
|
9251 |
${appendSelectors(selector, '> .alignwide')} {
|
9252 |
max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize};
|
9253 |
}
|
9254 |
-
|
9255 |
${appendSelectors(selector, '> .alignfull')} {
|
9256 |
max-width: none;
|
9257 |
}
|
@@ -9259,26 +10417,29 @@ function Icon(_ref) {
|
|
9259 |
output += `
|
9260 |
${appendSelectors(selector, '> .alignleft')} {
|
9261 |
float: left;
|
9262 |
-
margin-
|
9263 |
-
margin-
|
9264 |
}
|
9265 |
-
|
9266 |
${appendSelectors(selector, '> .alignright')} {
|
9267 |
float: right;
|
9268 |
-
margin-
|
9269 |
-
margin-
|
9270 |
}
|
9271 |
|
|
|
|
|
|
|
|
|
9272 |
`;
|
9273 |
|
9274 |
if (hasBlockGapStylesSupport) {
|
9275 |
output += `
|
9276 |
${appendSelectors(selector, '> *')} {
|
9277 |
-
margin-
|
9278 |
-
margin-
|
9279 |
}
|
9280 |
${appendSelectors(selector, '> * + *')} {
|
9281 |
-
margin-
|
9282 |
}
|
9283 |
`;
|
9284 |
}
|
@@ -9931,326 +11092,6 @@ function lock_addAttribute(settings) {
|
|
9931 |
}
|
9932 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute);
|
9933 |
|
9934 |
-
;// CONCATENATED MODULE: external ["wp","warning"]
|
9935 |
-
var external_wp_warning_namespaceObject = window["wp"]["warning"];
|
9936 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/groups.js
|
9937 |
-
/**
|
9938 |
-
* WordPress dependencies
|
9939 |
-
*/
|
9940 |
-
|
9941 |
-
const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls');
|
9942 |
-
const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls');
|
9943 |
-
const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBorder');
|
9944 |
-
const InspectorControlsColor = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsColor');
|
9945 |
-
const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions');
|
9946 |
-
const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography');
|
9947 |
-
const groups_groups = {
|
9948 |
-
default: InspectorControlsDefault,
|
9949 |
-
advanced: InspectorControlsAdvanced,
|
9950 |
-
border: InspectorControlsBorder,
|
9951 |
-
color: InspectorControlsColor,
|
9952 |
-
dimensions: InspectorControlsDimensions,
|
9953 |
-
typography: InspectorControlsTypography
|
9954 |
-
};
|
9955 |
-
/* harmony default export */ var inspector_controls_groups = (groups_groups);
|
9956 |
-
|
9957 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/fill.js
|
9958 |
-
|
9959 |
-
|
9960 |
-
/**
|
9961 |
-
* External dependencies
|
9962 |
-
*/
|
9963 |
-
|
9964 |
-
/**
|
9965 |
-
* WordPress dependencies
|
9966 |
-
*/
|
9967 |
-
|
9968 |
-
|
9969 |
-
|
9970 |
-
/**
|
9971 |
-
* Internal dependencies
|
9972 |
-
*/
|
9973 |
-
|
9974 |
-
|
9975 |
-
|
9976 |
-
function InspectorControlsFill(_ref) {
|
9977 |
-
var _groups$group;
|
9978 |
-
|
9979 |
-
let {
|
9980 |
-
__experimentalGroup: group = 'default',
|
9981 |
-
children
|
9982 |
-
} = _ref;
|
9983 |
-
const isDisplayed = useDisplayBlockControls();
|
9984 |
-
const Fill = (_groups$group = inspector_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill;
|
9985 |
-
|
9986 |
-
if (!Fill) {
|
9987 |
-
typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
|
9988 |
-
return null;
|
9989 |
-
}
|
9990 |
-
|
9991 |
-
if (!isDisplayed) {
|
9992 |
-
return null;
|
9993 |
-
}
|
9994 |
-
|
9995 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
|
9996 |
-
document: document
|
9997 |
-
}, (0,external_wp_element_namespaceObject.createElement)(Fill, null, fillProps => {
|
9998 |
-
// Children passed to InspectorControlsFill will not have
|
9999 |
-
// access to any React Context whose Provider is part of
|
10000 |
-
// the InspectorControlsSlot tree. So we re-create the
|
10001 |
-
// Provider in this subtree.
|
10002 |
-
const value = !(0,external_lodash_namespaceObject.isEmpty)(fillProps) ? fillProps : null;
|
10003 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelContext.Provider, {
|
10004 |
-
value: value
|
10005 |
-
}, children);
|
10006 |
-
}));
|
10007 |
-
}
|
10008 |
-
|
10009 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/utils.js
|
10010 |
-
/**
|
10011 |
-
* External dependencies
|
10012 |
-
*/
|
10013 |
-
|
10014 |
-
/**
|
10015 |
-
* Removed falsy values from nested object.
|
10016 |
-
*
|
10017 |
-
* @param {*} object
|
10018 |
-
* @return {*} Object cleaned from falsy values
|
10019 |
-
*/
|
10020 |
-
|
10021 |
-
const cleanEmptyObject = object => {
|
10022 |
-
if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
|
10023 |
-
return object;
|
10024 |
-
}
|
10025 |
-
|
10026 |
-
const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
|
10027 |
-
return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
|
10028 |
-
};
|
10029 |
-
function immutableSet(object, path, value) {
|
10030 |
-
return (0,external_lodash_namespaceObject.setWith)(object ? (0,external_lodash_namespaceObject.clone)(object) : {}, path, value, external_lodash_namespaceObject.clone);
|
10031 |
-
}
|
10032 |
-
function transformStyles(activeSupports, migrationPaths, result, source, index, results) {
|
10033 |
-
var _source$;
|
10034 |
-
|
10035 |
-
// If there are no active supports return early.
|
10036 |
-
if ((0,external_lodash_namespaceObject.every)(activeSupports, isActive => !isActive)) {
|
10037 |
-
return result;
|
10038 |
-
} // If the condition verifies we are probably in the presence of a wrapping transform
|
10039 |
-
// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.
|
10040 |
-
|
10041 |
-
|
10042 |
-
if (results.length === 1 && result.innerBlocks.length === source.length) {
|
10043 |
-
return result;
|
10044 |
-
} // For cases where we have a transform from one block to multiple blocks
|
10045 |
-
// or multiple blocks to one block we apply the styles of the first source block
|
10046 |
-
// to the result(s).
|
10047 |
-
|
10048 |
-
|
10049 |
-
let referenceBlockAttributes = (_source$ = source[0]) === null || _source$ === void 0 ? void 0 : _source$.attributes; // If we are in presence of transform between more than one block in the source
|
10050 |
-
// that has more than one block in the result
|
10051 |
-
// we apply the styles on source N to the result N,
|
10052 |
-
// if source N does not exists we do nothing.
|
10053 |
-
|
10054 |
-
if (results.length > 1 && source.length > 1) {
|
10055 |
-
if (source[index]) {
|
10056 |
-
var _source$index;
|
10057 |
-
|
10058 |
-
referenceBlockAttributes = (_source$index = source[index]) === null || _source$index === void 0 ? void 0 : _source$index.attributes;
|
10059 |
-
} else {
|
10060 |
-
return result;
|
10061 |
-
}
|
10062 |
-
}
|
10063 |
-
|
10064 |
-
let returnBlock = result;
|
10065 |
-
(0,external_lodash_namespaceObject.forEach)(activeSupports, (isActive, support) => {
|
10066 |
-
if (isActive) {
|
10067 |
-
migrationPaths[support].forEach(path => {
|
10068 |
-
const styleValue = (0,external_lodash_namespaceObject.get)(referenceBlockAttributes, path);
|
10069 |
-
|
10070 |
-
if (styleValue) {
|
10071 |
-
returnBlock = { ...returnBlock,
|
10072 |
-
attributes: immutableSet(returnBlock.attributes, path, styleValue)
|
10073 |
-
};
|
10074 |
-
}
|
10075 |
-
});
|
10076 |
-
}
|
10077 |
-
});
|
10078 |
-
return returnBlock;
|
10079 |
-
}
|
10080 |
-
|
10081 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
|
10082 |
-
|
10083 |
-
|
10084 |
-
/**
|
10085 |
-
* WordPress dependencies
|
10086 |
-
*/
|
10087 |
-
|
10088 |
-
|
10089 |
-
|
10090 |
-
/**
|
10091 |
-
* Internal dependencies
|
10092 |
-
*/
|
10093 |
-
|
10094 |
-
|
10095 |
-
|
10096 |
-
function BlockSupportToolsPanel(_ref) {
|
10097 |
-
let {
|
10098 |
-
children,
|
10099 |
-
group,
|
10100 |
-
label
|
10101 |
-
} = _ref;
|
10102 |
-
const {
|
10103 |
-
updateBlockAttributes
|
10104 |
-
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
10105 |
-
const {
|
10106 |
-
getBlockAttributes,
|
10107 |
-
getMultiSelectedBlockClientIds,
|
10108 |
-
getSelectedBlockClientId,
|
10109 |
-
hasMultiSelection
|
10110 |
-
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
10111 |
-
const panelId = getSelectedBlockClientId();
|
10112 |
-
const resetAll = (0,external_wp_element_namespaceObject.useCallback)(function () {
|
10113 |
-
let resetFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
10114 |
-
const newAttributes = {};
|
10115 |
-
const clientIds = hasMultiSelection() ? getMultiSelectedBlockClientIds() : [panelId];
|
10116 |
-
clientIds.forEach(clientId => {
|
10117 |
-
const {
|
10118 |
-
style
|
10119 |
-
} = getBlockAttributes(clientId);
|
10120 |
-
let newBlockAttributes = {
|
10121 |
-
style
|
10122 |
-
};
|
10123 |
-
resetFilters.forEach(resetFilter => {
|
10124 |
-
newBlockAttributes = { ...newBlockAttributes,
|
10125 |
-
...resetFilter(newBlockAttributes)
|
10126 |
-
};
|
10127 |
-
}); // Enforce a cleaned style object.
|
10128 |
-
|
10129 |
-
newBlockAttributes = { ...newBlockAttributes,
|
10130 |
-
style: cleanEmptyObject(newBlockAttributes.style)
|
10131 |
-
};
|
10132 |
-
newAttributes[clientId] = newBlockAttributes;
|
10133 |
-
});
|
10134 |
-
updateBlockAttributes(clientIds, newAttributes, true);
|
10135 |
-
}, [cleanEmptyObject, getBlockAttributes, getMultiSelectedBlockClientIds, hasMultiSelection, panelId, updateBlockAttributes]);
|
10136 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
|
10137 |
-
className: `${group}-block-support-panel`,
|
10138 |
-
label: label,
|
10139 |
-
resetAll: resetAll,
|
10140 |
-
key: panelId,
|
10141 |
-
panelId: panelId,
|
10142 |
-
hasInnerWrapper: true,
|
10143 |
-
shouldRenderPlaceholderItems: true // Required to maintain fills ordering.
|
10144 |
-
,
|
10145 |
-
__experimentalFirstVisibleItemClass: "first",
|
10146 |
-
__experimentalLastVisibleItemClass: "last"
|
10147 |
-
}, children);
|
10148 |
-
}
|
10149 |
-
|
10150 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-slot-container.js
|
10151 |
-
|
10152 |
-
|
10153 |
-
|
10154 |
-
/**
|
10155 |
-
* WordPress dependencies
|
10156 |
-
*/
|
10157 |
-
|
10158 |
-
|
10159 |
-
function BlockSupportSlotContainer(_ref) {
|
10160 |
-
let {
|
10161 |
-
Slot,
|
10162 |
-
...props
|
10163 |
-
} = _ref;
|
10164 |
-
const toolsPanelContext = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext);
|
10165 |
-
return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, {
|
10166 |
-
fillProps: toolsPanelContext,
|
10167 |
-
bubblesVirtually: true
|
10168 |
-
}));
|
10169 |
-
}
|
10170 |
-
|
10171 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/slot.js
|
10172 |
-
|
10173 |
-
|
10174 |
-
|
10175 |
-
/**
|
10176 |
-
* WordPress dependencies
|
10177 |
-
*/
|
10178 |
-
|
10179 |
-
|
10180 |
-
/**
|
10181 |
-
* Internal dependencies
|
10182 |
-
*/
|
10183 |
-
|
10184 |
-
|
10185 |
-
|
10186 |
-
|
10187 |
-
function InspectorControlsSlot(_ref) {
|
10188 |
-
var _groups$group;
|
10189 |
-
|
10190 |
-
let {
|
10191 |
-
__experimentalGroup: group = 'default',
|
10192 |
-
label,
|
10193 |
-
...props
|
10194 |
-
} = _ref;
|
10195 |
-
const Slot = (_groups$group = inspector_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Slot;
|
10196 |
-
const slot = (0,external_wp_components_namespaceObject.__experimentalUseSlot)(Slot === null || Slot === void 0 ? void 0 : Slot.__unstableName);
|
10197 |
-
|
10198 |
-
if (!Slot || !slot) {
|
10199 |
-
typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
|
10200 |
-
return null;
|
10201 |
-
}
|
10202 |
-
|
10203 |
-
const hasFills = Boolean(slot.fills && slot.fills.length);
|
10204 |
-
|
10205 |
-
if (!hasFills) {
|
10206 |
-
return null;
|
10207 |
-
}
|
10208 |
-
|
10209 |
-
if (label) {
|
10210 |
-
return (0,external_wp_element_namespaceObject.createElement)(BlockSupportToolsPanel, {
|
10211 |
-
group: group,
|
10212 |
-
label: label
|
10213 |
-
}, (0,external_wp_element_namespaceObject.createElement)(BlockSupportSlotContainer, _extends({}, props, {
|
10214 |
-
Slot: Slot
|
10215 |
-
})));
|
10216 |
-
}
|
10217 |
-
|
10218 |
-
return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, {
|
10219 |
-
bubblesVirtually: true
|
10220 |
-
}));
|
10221 |
-
}
|
10222 |
-
|
10223 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/index.js
|
10224 |
-
|
10225 |
-
|
10226 |
-
|
10227 |
-
/**
|
10228 |
-
* Internal dependencies
|
10229 |
-
*/
|
10230 |
-
|
10231 |
-
|
10232 |
-
const InspectorControls = InspectorControlsFill;
|
10233 |
-
InspectorControls.Slot = InspectorControlsSlot; // This is just here for backward compatibility.
|
10234 |
-
|
10235 |
-
const InspectorAdvancedControls = props => {
|
10236 |
-
return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsFill, _extends({}, props, {
|
10237 |
-
__experimentalGroup: "advanced"
|
10238 |
-
}));
|
10239 |
-
};
|
10240 |
-
|
10241 |
-
InspectorAdvancedControls.Slot = props => {
|
10242 |
-
return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsSlot, _extends({}, props, {
|
10243 |
-
__experimentalGroup: "advanced"
|
10244 |
-
}));
|
10245 |
-
};
|
10246 |
-
|
10247 |
-
InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
|
10248 |
-
/**
|
10249 |
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md
|
10250 |
-
*/
|
10251 |
-
|
10252 |
-
/* harmony default export */ var inspector_controls = (InspectorControls);
|
10253 |
-
|
10254 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/anchor.js
|
10255 |
|
10256 |
|
@@ -10280,6 +11121,12 @@ InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
|
|
10280 |
*/
|
10281 |
|
10282 |
const ANCHOR_REGEX = /[\s#]/g;
|
|
|
|
|
|
|
|
|
|
|
|
|
10283 |
/**
|
10284 |
* Filters registered block settings, extending attributes with anchor using ID
|
10285 |
* of the first node.
|
@@ -10298,12 +11145,7 @@ function anchor_addAttribute(settings) {
|
|
10298 |
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'anchor')) {
|
10299 |
// Gracefully handle if settings.attributes is undefined.
|
10300 |
settings.attributes = { ...settings.attributes,
|
10301 |
-
anchor:
|
10302 |
-
type: 'string',
|
10303 |
-
source: 'attribute',
|
10304 |
-
attribute: 'id',
|
10305 |
-
selector: '*'
|
10306 |
-
}
|
10307 |
};
|
10308 |
}
|
10309 |
|
@@ -11210,7 +12052,10 @@ function BlockHTML(_ref) {
|
|
11210 |
const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(blockType, html, block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error
|
11211 |
|
11212 |
const content = html ? html : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes);
|
11213 |
-
const isValid = html ? (0,external_wp_blocks_namespaceObject.
|
|
|
|
|
|
|
11214 |
updateBlock(clientId, {
|
11215 |
attributes,
|
11216 |
originalContent: content,
|
@@ -15719,6 +16564,13 @@ function useInitialPosition(clientId) {
|
|
15719 |
return getSelectedBlocksInitialCaretPosition();
|
15720 |
}, [clientId]);
|
15721 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15722 |
/**
|
15723 |
* Transitions focus to the block or inner tabbable when the block becomes
|
15724 |
* selected and an initial position is set.
|
@@ -15759,6 +16611,17 @@ function useFocusFirstElement(clientId) {
|
|
15759 |
if (!isInsideRootBlock(ref.current, target)) {
|
15760 |
ref.current.focus();
|
15761 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15762 |
}
|
15763 |
|
15764 |
setContentEditableWrapper(ref.current, false);
|
@@ -16279,141 +17142,6 @@ function useScrollIntoView(clientId) {
|
|
16279 |
return ref;
|
16280 |
}
|
16281 |
|
16282 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/provider/block-refs-provider.js
|
16283 |
-
|
16284 |
-
|
16285 |
-
/**
|
16286 |
-
* WordPress dependencies
|
16287 |
-
*/
|
16288 |
-
|
16289 |
-
const BlockRefs = (0,external_wp_element_namespaceObject.createContext)({
|
16290 |
-
refs: new Map(),
|
16291 |
-
callbacks: new Map()
|
16292 |
-
});
|
16293 |
-
function BlockRefsProvider(_ref) {
|
16294 |
-
let {
|
16295 |
-
children
|
16296 |
-
} = _ref;
|
16297 |
-
const value = (0,external_wp_element_namespaceObject.useMemo)(() => ({
|
16298 |
-
refs: new Map(),
|
16299 |
-
callbacks: new Map()
|
16300 |
-
}), []);
|
16301 |
-
return (0,external_wp_element_namespaceObject.createElement)(BlockRefs.Provider, {
|
16302 |
-
value: value
|
16303 |
-
}, children);
|
16304 |
-
}
|
16305 |
-
|
16306 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js
|
16307 |
-
/**
|
16308 |
-
* WordPress dependencies
|
16309 |
-
*/
|
16310 |
-
|
16311 |
-
|
16312 |
-
/**
|
16313 |
-
* Internal dependencies
|
16314 |
-
*/
|
16315 |
-
|
16316 |
-
|
16317 |
-
/** @typedef {import('@wordpress/element').RefCallback} RefCallback */
|
16318 |
-
|
16319 |
-
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
16320 |
-
|
16321 |
-
/**
|
16322 |
-
* Provides a ref to the BlockRefs context.
|
16323 |
-
*
|
16324 |
-
* @param {string} clientId The client ID of the element ref.
|
16325 |
-
*
|
16326 |
-
* @return {RefCallback} Ref callback.
|
16327 |
-
*/
|
16328 |
-
|
16329 |
-
function useBlockRefProvider(clientId) {
|
16330 |
-
const {
|
16331 |
-
refs,
|
16332 |
-
callbacks
|
16333 |
-
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
|
16334 |
-
const ref = (0,external_wp_element_namespaceObject.useRef)();
|
16335 |
-
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
16336 |
-
refs.set(ref, clientId);
|
16337 |
-
return () => {
|
16338 |
-
refs.delete(ref);
|
16339 |
-
};
|
16340 |
-
}, [clientId]);
|
16341 |
-
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
|
16342 |
-
// Update the ref in the provider.
|
16343 |
-
ref.current = element; // Call any update functions.
|
16344 |
-
|
16345 |
-
callbacks.forEach((id, setElement) => {
|
16346 |
-
if (clientId === id) {
|
16347 |
-
setElement(element);
|
16348 |
-
}
|
16349 |
-
});
|
16350 |
-
}, [clientId]);
|
16351 |
-
}
|
16352 |
-
/**
|
16353 |
-
* Gets a ref pointing to the current block element. Continues to return a
|
16354 |
-
* stable ref even if the block client ID changes.
|
16355 |
-
*
|
16356 |
-
* @param {string} clientId The client ID to get a ref for.
|
16357 |
-
*
|
16358 |
-
* @return {RefObject} A ref containing the element.
|
16359 |
-
*/
|
16360 |
-
|
16361 |
-
function useBlockRef(clientId) {
|
16362 |
-
const {
|
16363 |
-
refs
|
16364 |
-
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
|
16365 |
-
const freshClientId = (0,external_wp_element_namespaceObject.useRef)();
|
16366 |
-
freshClientId.current = clientId; // Always return an object, even if no ref exists for a given client ID, so
|
16367 |
-
// that `current` works at a later point.
|
16368 |
-
|
16369 |
-
return (0,external_wp_element_namespaceObject.useMemo)(() => ({
|
16370 |
-
get current() {
|
16371 |
-
let element = null; // Multiple refs may be created for a single block. Find the
|
16372 |
-
// first that has an element set.
|
16373 |
-
|
16374 |
-
for (const [ref, id] of refs.entries()) {
|
16375 |
-
if (id === freshClientId.current && ref.current) {
|
16376 |
-
element = ref.current;
|
16377 |
-
}
|
16378 |
-
}
|
16379 |
-
|
16380 |
-
return element;
|
16381 |
-
}
|
16382 |
-
|
16383 |
-
}), []);
|
16384 |
-
}
|
16385 |
-
/**
|
16386 |
-
* Return the element for a given client ID. Updates whenever the element
|
16387 |
-
* changes, becomes available, or disappears.
|
16388 |
-
*
|
16389 |
-
* @param {string} clientId The client ID to an element for.
|
16390 |
-
*
|
16391 |
-
* @return {Element|null} The block's wrapper element.
|
16392 |
-
*/
|
16393 |
-
|
16394 |
-
|
16395 |
-
function useBlockElement(clientId) {
|
16396 |
-
const {
|
16397 |
-
callbacks
|
16398 |
-
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
|
16399 |
-
const ref = useBlockRef(clientId);
|
16400 |
-
const [element, setElement] = (0,external_wp_element_namespaceObject.useState)(null);
|
16401 |
-
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
16402 |
-
if (!clientId) {
|
16403 |
-
return;
|
16404 |
-
}
|
16405 |
-
|
16406 |
-
callbacks.set(setElement, clientId);
|
16407 |
-
return () => {
|
16408 |
-
callbacks.delete(setElement);
|
16409 |
-
};
|
16410 |
-
}, [clientId]);
|
16411 |
-
return ref.current || element;
|
16412 |
-
}
|
16413 |
-
|
16414 |
-
|
16415 |
-
|
16416 |
-
|
16417 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js
|
16418 |
/**
|
16419 |
* WordPress dependencies
|
@@ -16658,6 +17386,9 @@ function BlockListBlock(_ref2) {
|
|
16658 |
var _wrapperProps;
|
16659 |
|
16660 |
let {
|
|
|
|
|
|
|
16661 |
mode,
|
16662 |
isLocked,
|
16663 |
canRemove,
|
@@ -16727,7 +17458,7 @@ function BlockListBlock(_ref2) {
|
|
16727 |
let block;
|
16728 |
|
16729 |
if (!isValid) {
|
16730 |
-
const saveContent = (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes);
|
16731 |
block = (0,external_wp_element_namespaceObject.createElement)(Block, {
|
16732 |
className: "has-warning"
|
16733 |
}, (0,external_wp_element_namespaceObject.createElement)(block_invalid_warning, {
|
@@ -17643,7 +18374,7 @@ function use_multi_selection_useMultiSelection() {
|
|
17643 |
|
17644 |
|
17645 |
|
17646 |
-
function
|
17647 |
const {
|
17648 |
tagName
|
17649 |
} = element;
|
@@ -17739,7 +18470,7 @@ function useTabNav() {
|
|
17739 |
// future they can be rendered in an iframe or shadow DOM.
|
17740 |
|
17741 |
|
17742 |
-
if ((
|
17743 |
return;
|
17744 |
}
|
17745 |
|
@@ -23805,16 +24536,18 @@ function useBlockDisplayTitle(clientId, maximumLength) {
|
|
23805 |
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
|
23806 |
const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : null;
|
23807 |
const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current
|
23808 |
-
// label context. If the label is defined we prioritize it over
|
23809 |
// possible block variation title match.
|
23810 |
|
23811 |
-
|
23812 |
-
|
|
|
|
|
23813 |
length: maximumLength
|
23814 |
-
})
|
23815 |
}
|
23816 |
|
23817 |
-
return
|
23818 |
}
|
23819 |
|
23820 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-title/index.js
|
@@ -26770,6 +27503,234 @@ function useConvertToGroupButtonProps() {
|
|
26770 |
};
|
26771 |
}
|
26772 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26773 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-settings-menu-controls/index.js
|
26774 |
|
26775 |
|
@@ -26790,6 +27751,7 @@ function useConvertToGroupButtonProps() {
|
|
26790 |
|
26791 |
|
26792 |
|
|
|
26793 |
const {
|
26794 |
Fill,
|
26795 |
Slot: block_settings_menu_controls_Slot
|
@@ -26802,18 +27764,22 @@ const BlockSettingsMenuControlsSlot = _ref => {
|
|
26802 |
} = _ref;
|
26803 |
const {
|
26804 |
selectedBlocks,
|
26805 |
-
selectedClientIds
|
|
|
26806 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
26807 |
const {
|
26808 |
getBlocksByClientId,
|
26809 |
-
getSelectedBlockClientIds
|
|
|
26810 |
} = select(store);
|
26811 |
const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds();
|
26812 |
return {
|
26813 |
selectedBlocks: (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.compact)(getBlocksByClientId(ids)), block => block.name),
|
26814 |
-
selectedClientIds: ids
|
|
|
26815 |
};
|
26816 |
-
}, [clientIds]);
|
|
|
26817 |
// and pass this props down to ConvertToGroupButton.
|
26818 |
|
26819 |
const convertToGroupButtonProps = useConvertToGroupButtonProps();
|
@@ -26821,18 +27787,22 @@ const BlockSettingsMenuControlsSlot = _ref => {
|
|
26821 |
isGroupable,
|
26822 |
isUngroupable
|
26823 |
} = convertToGroupButtonProps;
|
26824 |
-
const showConvertToGroupButton = isGroupable || isUngroupable;
|
26825 |
return (0,external_wp_element_namespaceObject.createElement)(block_settings_menu_controls_Slot, {
|
26826 |
fillProps: { ...fillProps,
|
26827 |
selectedBlocks,
|
26828 |
selectedClientIds
|
26829 |
}
|
26830 |
}, fills => {
|
26831 |
-
if ((fills
|
26832 |
-
return
|
26833 |
-
onClose: fillProps === null || fillProps === void 0 ? void 0 : fillProps.onClose
|
26834 |
-
})));
|
26835 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
26836 |
});
|
26837 |
};
|
26838 |
/**
|
@@ -26913,13 +27883,22 @@ function BlockSettingsDropdown(_ref2) {
|
|
26913 |
const count = blockClientIds.length;
|
26914 |
const firstBlockClientId = blockClientIds[0];
|
26915 |
const {
|
26916 |
-
onlyBlock
|
|
|
|
|
|
|
26917 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
26918 |
const {
|
26919 |
-
getBlockCount
|
|
|
|
|
|
|
26920 |
} = select(store);
|
26921 |
return {
|
26922 |
-
onlyBlock: 1 === getBlockCount()
|
|
|
|
|
|
|
26923 |
};
|
26924 |
}, [firstBlockClientId]);
|
26925 |
const shortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -26933,7 +27912,7 @@ function BlockSettingsDropdown(_ref2) {
|
|
26933 |
insertBefore: getShortcutRepresentation('core/block-editor/insert-before')
|
26934 |
};
|
26935 |
}, []);
|
26936 |
-
const
|
26937 |
const ids = await clientIdsPromise;
|
26938 |
|
26939 |
if (ids && ids[0]) {
|
@@ -26941,6 +27920,17 @@ function BlockSettingsDropdown(_ref2) {
|
|
26941 |
}
|
26942 |
} : external_lodash_namespaceObject.noop, [__experimentalSelectBlock]);
|
26943 |
const blockTitle = useBlockDisplayTitle(firstBlockClientId, 25);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26944 |
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
26945 |
/* translators: %s: block name */
|
26946 |
(0,external_wp_i18n_namespaceObject.__)('Remove %s'), blockTitle);
|
@@ -26982,7 +27972,7 @@ function BlockSettingsDropdown(_ref2) {
|
|
26982 |
blocks: blocks,
|
26983 |
onCopy: onCopy
|
26984 |
}), canDuplicate && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
26985 |
-
onClick: (0,external_lodash_namespaceObject.flow)(onClose, onDuplicate,
|
26986 |
shortcut: shortcuts.duplicate
|
26987 |
}, (0,external_wp_i18n_namespaceObject.__)('Duplicate')), canInsertDefaultBlock && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
26988 |
onClick: (0,external_lodash_namespaceObject.flow)(onClose, onInsertBefore),
|
@@ -27005,7 +27995,7 @@ function BlockSettingsDropdown(_ref2) {
|
|
27005 |
}) : external_wp_element_namespaceObject.Children.map(child => (0,external_wp_element_namespaceObject.cloneElement)(child, {
|
27006 |
onClose
|
27007 |
})), canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
27008 |
-
onClick: (0,external_lodash_namespaceObject.flow)(onClose, onRemove,
|
27009 |
shortcut: shortcuts.remove
|
27010 |
}, removeBlockLabel)));
|
27011 |
});
|
@@ -27038,6 +28028,70 @@ function BlockSettingsMenu(_ref) {
|
|
27038 |
}
|
27039 |
/* harmony default export */ var block_settings_menu = (BlockSettingsMenu);
|
27040 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27041 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/index.js
|
27042 |
|
27043 |
|
@@ -27066,6 +28120,7 @@ function BlockSettingsMenu(_ref) {
|
|
27066 |
|
27067 |
|
27068 |
|
|
|
27069 |
function BlockToolbar(_ref) {
|
27070 |
let {
|
27071 |
hideDragHandle
|
@@ -27152,6 +28207,8 @@ function BlockToolbar(_ref) {
|
|
27152 |
className: "block-editor-block-toolbar__block-controls"
|
27153 |
}, (0,external_wp_element_namespaceObject.createElement)(block_switcher, {
|
27154 |
clientIds: blockClientIds
|
|
|
|
|
27155 |
}), (0,external_wp_element_namespaceObject.createElement)(block_mover, {
|
27156 |
clientIds: blockClientIds,
|
27157 |
hideDragHandle: hideDragHandle || hasReducedUI
|
@@ -28685,7 +29742,9 @@ function ColorGradientControlInner(_ref) {
|
|
28685 |
|
28686 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
|
28687 |
className: classnames_default()('block-editor-color-gradient-control', className)
|
28688 |
-
}, (0,external_wp_element_namespaceObject.createElement)("fieldset",
|
|
|
|
|
28689 |
spacing: 1
|
28690 |
}, showTitle && (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("div", {
|
28691 |
className: "block-editor-color-gradient-control__color-indicator"
|
@@ -29371,7 +30430,7 @@ function getAllValue() {
|
|
29371 |
function hasMixedValues() {
|
29372 |
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
29373 |
const allValue = getAllValue(values);
|
29374 |
-
const isMixed = isNaN(parseFloat(allValue));
|
29375 |
return isMixed;
|
29376 |
}
|
29377 |
/**
|
@@ -29614,7 +30673,6 @@ function BorderRadiusControl(_ref) {
|
|
29614 |
values: values,
|
29615 |
min: MIN_BORDER_RADIUS_VALUE,
|
29616 |
onChange: onChange,
|
29617 |
-
unit: unit,
|
29618 |
units: units
|
29619 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
29620 |
className: "components-border-radius-control__range-control",
|
@@ -31425,7 +32483,7 @@ function LineHeightControl(_ref) {
|
|
31425 |
* or by clicking the spin buttons.
|
31426 |
*/
|
31427 |
|
31428 |
-
switch (nextValue) {
|
31429 |
case `${STEP}`:
|
31430 |
// Increment by step value.
|
31431 |
return BASE_DEFAULT_VALUE + STEP;
|
@@ -31455,8 +32513,10 @@ function LineHeightControl(_ref) {
|
|
31455 |
// For example, Firefox emits an input event with inputType="insertReplacementText"
|
31456 |
// on spin button clicks, while other browsers do not even emit an input event.
|
31457 |
const wasTypedOrPasted = ['insertText', 'insertFromPaste'].includes((_action$payload$event = action.payload.event.nativeEvent) === null || _action$payload$event === void 0 ? void 0 : _action$payload$event.inputType);
|
31458 |
-
|
31459 |
-
return state
|
|
|
|
|
31460 |
};
|
31461 |
|
31462 |
const value = isDefined ? lineHeight : RESET_VALUE;
|
@@ -32887,597 +33947,14 @@ function resetLetterSpacing(_ref) {
|
|
32887 |
} = attributes;
|
32888 |
setAttributes({
|
32889 |
style: cleanEmptyObject({ ...style,
|
32890 |
-
typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
|
32891 |
-
letterSpacing: undefined
|
32892 |
-
}
|
32893 |
-
})
|
32894 |
-
});
|
32895 |
-
}
|
32896 |
-
|
32897 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/typography.js
|
32898 |
-
|
32899 |
-
|
32900 |
-
/**
|
32901 |
-
* WordPress dependencies
|
32902 |
-
*/
|
32903 |
-
|
32904 |
-
|
32905 |
-
|
32906 |
-
/**
|
32907 |
-
* Internal dependencies
|
32908 |
-
*/
|
32909 |
-
|
32910 |
-
|
32911 |
-
|
32912 |
-
|
32913 |
-
|
32914 |
-
|
32915 |
-
|
32916 |
-
|
32917 |
-
|
32918 |
-
|
32919 |
-
const TYPOGRAPHY_SUPPORT_KEY = 'typography';
|
32920 |
-
const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
|
32921 |
-
function TypographyPanel(props) {
|
32922 |
-
const {
|
32923 |
-
clientId
|
32924 |
-
} = props;
|
32925 |
-
const isFontFamilyDisabled = useIsFontFamilyDisabled(props);
|
32926 |
-
const isFontSizeDisabled = useIsFontSizeDisabled(props);
|
32927 |
-
const isFontAppearanceDisabled = useIsFontAppearanceDisabled(props);
|
32928 |
-
const isLineHeightDisabled = useIsLineHeightDisabled(props);
|
32929 |
-
const isTextDecorationDisabled = useIsTextDecorationDisabled(props);
|
32930 |
-
const isTextTransformDisabled = useIsTextTransformDisabled(props);
|
32931 |
-
const isLetterSpacingDisabled = useIsLetterSpacingDisabled(props);
|
32932 |
-
const hasFontStyles = !useIsFontStyleDisabled(props);
|
32933 |
-
const hasFontWeights = !useIsFontWeightDisabled(props);
|
32934 |
-
const isDisabled = useIsTypographyDisabled(props);
|
32935 |
-
const isSupported = hasTypographySupport(props.name);
|
32936 |
-
if (isDisabled || !isSupported) return null;
|
32937 |
-
const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [TYPOGRAPHY_SUPPORT_KEY, '__experimentalDefaultControls']);
|
32938 |
-
|
32939 |
-
const createResetAllFilter = attribute => newAttributes => {
|
32940 |
-
var _newAttributes$style;
|
32941 |
-
|
32942 |
-
return { ...newAttributes,
|
32943 |
-
style: { ...newAttributes.style,
|
32944 |
-
typography: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.typography),
|
32945 |
-
[attribute]: undefined
|
32946 |
-
}
|
32947 |
-
}
|
32948 |
-
};
|
32949 |
-
};
|
32950 |
-
|
32951 |
-
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
32952 |
-
__experimentalGroup: "typography"
|
32953 |
-
}, !isFontFamilyDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
32954 |
-
hasValue: () => hasFontFamilyValue(props),
|
32955 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Font family'),
|
32956 |
-
onDeselect: () => resetFontFamily(props),
|
32957 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontFamily,
|
32958 |
-
resetAllFilter: newAttributes => ({ ...newAttributes,
|
32959 |
-
fontFamily: undefined
|
32960 |
-
}),
|
32961 |
-
panelId: clientId
|
32962 |
-
}, (0,external_wp_element_namespaceObject.createElement)(FontFamilyEdit, props)), !isFontSizeDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
32963 |
-
hasValue: () => hasFontSizeValue(props),
|
32964 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Font size'),
|
32965 |
-
onDeselect: () => resetFontSize(props),
|
32966 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontSize,
|
32967 |
-
resetAllFilter: newAttributes => {
|
32968 |
-
var _newAttributes$style2;
|
32969 |
-
|
32970 |
-
return { ...newAttributes,
|
32971 |
-
fontSize: undefined,
|
32972 |
-
style: { ...newAttributes.style,
|
32973 |
-
typography: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.typography),
|
32974 |
-
fontSize: undefined
|
32975 |
-
}
|
32976 |
-
}
|
32977 |
-
};
|
32978 |
-
},
|
32979 |
-
panelId: clientId
|
32980 |
-
}, (0,external_wp_element_namespaceObject.createElement)(FontSizeEdit, props)), !isFontAppearanceDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
32981 |
-
className: "single-column",
|
32982 |
-
hasValue: () => hasFontAppearanceValue(props),
|
32983 |
-
label: getFontAppearanceLabel(hasFontStyles, hasFontWeights),
|
32984 |
-
onDeselect: () => resetFontAppearance(props),
|
32985 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontAppearance,
|
32986 |
-
resetAllFilter: newAttributes => {
|
32987 |
-
var _newAttributes$style3;
|
32988 |
-
|
32989 |
-
return { ...newAttributes,
|
32990 |
-
style: { ...newAttributes.style,
|
32991 |
-
typography: { ...((_newAttributes$style3 = newAttributes.style) === null || _newAttributes$style3 === void 0 ? void 0 : _newAttributes$style3.typography),
|
32992 |
-
fontStyle: undefined,
|
32993 |
-
fontWeight: undefined
|
32994 |
-
}
|
32995 |
-
}
|
32996 |
-
};
|
32997 |
-
},
|
32998 |
-
panelId: clientId
|
32999 |
-
}, (0,external_wp_element_namespaceObject.createElement)(FontAppearanceEdit, props)), !isLineHeightDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
33000 |
-
className: "single-column",
|
33001 |
-
hasValue: () => hasLineHeightValue(props),
|
33002 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Line height'),
|
33003 |
-
onDeselect: () => resetLineHeight(props),
|
33004 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.lineHeight,
|
33005 |
-
resetAllFilter: createResetAllFilter('lineHeight'),
|
33006 |
-
panelId: clientId
|
33007 |
-
}, (0,external_wp_element_namespaceObject.createElement)(LineHeightEdit, props)), !isTextDecorationDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
33008 |
-
className: "single-column",
|
33009 |
-
hasValue: () => hasTextDecorationValue(props),
|
33010 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Decoration'),
|
33011 |
-
onDeselect: () => resetTextDecoration(props),
|
33012 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textDecoration,
|
33013 |
-
resetAllFilter: createResetAllFilter('textDecoration'),
|
33014 |
-
panelId: clientId
|
33015 |
-
}, (0,external_wp_element_namespaceObject.createElement)(TextDecorationEdit, props)), !isTextTransformDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
33016 |
-
className: "single-column",
|
33017 |
-
hasValue: () => hasTextTransformValue(props),
|
33018 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Letter case'),
|
33019 |
-
onDeselect: () => resetTextTransform(props),
|
33020 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textTransform,
|
33021 |
-
resetAllFilter: createResetAllFilter('textTransform'),
|
33022 |
-
panelId: clientId
|
33023 |
-
}, (0,external_wp_element_namespaceObject.createElement)(TextTransformEdit, props)), !isLetterSpacingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
33024 |
-
className: "single-column",
|
33025 |
-
hasValue: () => hasLetterSpacingValue(props),
|
33026 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'),
|
33027 |
-
onDeselect: () => resetLetterSpacing(props),
|
33028 |
-
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.letterSpacing,
|
33029 |
-
resetAllFilter: createResetAllFilter('letterSpacing'),
|
33030 |
-
panelId: clientId
|
33031 |
-
}, (0,external_wp_element_namespaceObject.createElement)(LetterSpacingEdit, props)));
|
33032 |
-
}
|
33033 |
-
const hasTypographySupport = blockName => {
|
33034 |
-
return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, key));
|
33035 |
-
};
|
33036 |
-
|
33037 |
-
function useIsTypographyDisabled() {
|
33038 |
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33039 |
-
const configs = [useIsFontAppearanceDisabled(props), useIsFontSizeDisabled(props), useIsLineHeightDisabled(props), useIsFontFamilyDisabled(props), useIsTextDecorationDisabled(props), useIsTextTransformDisabled(props), useIsLetterSpacingDisabled(props)];
|
33040 |
-
return configs.filter(Boolean).length === configs.length;
|
33041 |
-
}
|
33042 |
-
|
33043 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/gap.js
|
33044 |
-
|
33045 |
-
|
33046 |
-
/**
|
33047 |
-
* WordPress dependencies
|
33048 |
-
*/
|
33049 |
-
|
33050 |
-
|
33051 |
-
|
33052 |
-
|
33053 |
-
/**
|
33054 |
-
* Internal dependencies
|
33055 |
-
*/
|
33056 |
-
|
33057 |
-
|
33058 |
-
|
33059 |
-
|
33060 |
-
|
33061 |
-
/**
|
33062 |
-
* Determines if there is gap support.
|
33063 |
-
*
|
33064 |
-
* @param {string|Object} blockType Block name or Block Type object.
|
33065 |
-
* @return {boolean} Whether there is support.
|
33066 |
-
*/
|
33067 |
-
|
33068 |
-
function hasGapSupport(blockType) {
|
33069 |
-
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY);
|
33070 |
-
return !!(true === support || support !== null && support !== void 0 && support.blockGap);
|
33071 |
-
}
|
33072 |
-
/**
|
33073 |
-
* Checks if there is a current value in the gap block support attributes.
|
33074 |
-
*
|
33075 |
-
* @param {Object} props Block props.
|
33076 |
-
* @return {boolean} Whether or not the block has a gap value set.
|
33077 |
-
*/
|
33078 |
-
|
33079 |
-
function hasGapValue(props) {
|
33080 |
-
var _props$attributes$sty, _props$attributes$sty2;
|
33081 |
-
|
33082 |
-
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.blockGap) !== undefined;
|
33083 |
-
}
|
33084 |
-
/**
|
33085 |
-
* Resets the gap block support attribute. This can be used when disabling
|
33086 |
-
* the gap support controls for a block via a progressive discovery panel.
|
33087 |
-
*
|
33088 |
-
* @param {Object} props Block props.
|
33089 |
-
* @param {Object} props.attributes Block's attributes.
|
33090 |
-
* @param {Object} props.setAttributes Function to set block's attributes.
|
33091 |
-
*/
|
33092 |
-
|
33093 |
-
function resetGap(_ref) {
|
33094 |
-
let {
|
33095 |
-
attributes = {},
|
33096 |
-
setAttributes
|
33097 |
-
} = _ref;
|
33098 |
-
const {
|
33099 |
-
style
|
33100 |
-
} = attributes;
|
33101 |
-
setAttributes({
|
33102 |
-
style: { ...style,
|
33103 |
-
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
33104 |
-
blockGap: undefined
|
33105 |
-
}
|
33106 |
-
}
|
33107 |
-
});
|
33108 |
-
}
|
33109 |
-
/**
|
33110 |
-
* Custom hook that checks if gap settings have been disabled.
|
33111 |
-
*
|
33112 |
-
* @param {string} name The name of the block.
|
33113 |
-
* @return {boolean} Whether the gap setting is disabled.
|
33114 |
-
*/
|
33115 |
-
|
33116 |
-
function useIsGapDisabled() {
|
33117 |
-
let {
|
33118 |
-
name: blockName
|
33119 |
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33120 |
-
const isDisabled = !useSetting('spacing.blockGap');
|
33121 |
-
return !hasGapSupport(blockName) || isDisabled;
|
33122 |
-
}
|
33123 |
-
/**
|
33124 |
-
* Inspector control panel containing the gap related configuration
|
33125 |
-
*
|
33126 |
-
* @param {Object} props
|
33127 |
-
*
|
33128 |
-
* @return {WPElement} Gap edit element.
|
33129 |
-
*/
|
33130 |
-
|
33131 |
-
function GapEdit(props) {
|
33132 |
-
var _style$spacing;
|
33133 |
-
|
33134 |
-
const {
|
33135 |
-
clientId,
|
33136 |
-
attributes: {
|
33137 |
-
style
|
33138 |
-
},
|
33139 |
-
setAttributes
|
33140 |
-
} = props;
|
33141 |
-
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
33142 |
-
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
33143 |
-
});
|
33144 |
-
const ref = useBlockRef(clientId);
|
33145 |
-
|
33146 |
-
if (useIsGapDisabled(props)) {
|
33147 |
-
return null;
|
33148 |
-
}
|
33149 |
-
|
33150 |
-
const onChange = next => {
|
33151 |
-
var _window;
|
33152 |
-
|
33153 |
-
const newStyle = { ...style,
|
33154 |
-
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
33155 |
-
blockGap: next
|
33156 |
-
}
|
33157 |
-
};
|
33158 |
-
setAttributes({
|
33159 |
-
style: cleanEmptyObject(newStyle)
|
33160 |
-
}); // In Safari, changing the `gap` CSS value on its own will not trigger the layout
|
33161 |
-
// to be recalculated / re-rendered. To force the updated gap to re-render, here
|
33162 |
-
// we replace the block's node with itself.
|
33163 |
-
|
33164 |
-
const isSafari = ((_window = window) === null || _window === void 0 ? void 0 : _window.navigator.userAgent) && window.navigator.userAgent.includes('Safari') && !window.navigator.userAgent.includes('Chrome ') && !window.navigator.userAgent.includes('Chromium ');
|
33165 |
-
|
33166 |
-
if (ref.current && isSafari) {
|
33167 |
-
var _ref$current$parentNo;
|
33168 |
-
|
33169 |
-
(_ref$current$parentNo = ref.current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.replaceChild(ref.current, ref.current);
|
33170 |
-
}
|
33171 |
-
};
|
33172 |
-
|
33173 |
-
return external_wp_element_namespaceObject.Platform.select({
|
33174 |
-
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
33175 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
33176 |
-
__unstableInputWidth: "80px",
|
33177 |
-
min: 0,
|
33178 |
-
onChange: onChange,
|
33179 |
-
units: units,
|
33180 |
-
value: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap
|
33181 |
-
})),
|
33182 |
-
native: null
|
33183 |
-
});
|
33184 |
-
}
|
33185 |
-
|
33186 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/margin.js
|
33187 |
-
|
33188 |
-
|
33189 |
-
/**
|
33190 |
-
* WordPress dependencies
|
33191 |
-
*/
|
33192 |
-
|
33193 |
-
|
33194 |
-
|
33195 |
-
|
33196 |
-
/**
|
33197 |
-
* Internal dependencies
|
33198 |
-
*/
|
33199 |
-
|
33200 |
-
|
33201 |
-
|
33202 |
-
|
33203 |
-
/**
|
33204 |
-
* Determines if there is margin support.
|
33205 |
-
*
|
33206 |
-
* @param {string|Object} blockType Block name or Block Type object.
|
33207 |
-
*
|
33208 |
-
* @return {boolean} Whether there is support.
|
33209 |
-
*/
|
33210 |
-
|
33211 |
-
function hasMarginSupport(blockType) {
|
33212 |
-
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY);
|
33213 |
-
return !!(true === support || support !== null && support !== void 0 && support.margin);
|
33214 |
-
}
|
33215 |
-
/**
|
33216 |
-
* Checks if there is a current value in the margin block support attributes.
|
33217 |
-
*
|
33218 |
-
* @param {Object} props Block props.
|
33219 |
-
* @return {boolean} Whether or not the block has a margin value set.
|
33220 |
-
*/
|
33221 |
-
|
33222 |
-
function hasMarginValue(props) {
|
33223 |
-
var _props$attributes$sty, _props$attributes$sty2;
|
33224 |
-
|
33225 |
-
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.margin) !== undefined;
|
33226 |
-
}
|
33227 |
-
/**
|
33228 |
-
* Resets the margin block support attributes. This can be used when disabling
|
33229 |
-
* the margin support controls for a block via a `ToolsPanel`.
|
33230 |
-
*
|
33231 |
-
* @param {Object} props Block props.
|
33232 |
-
* @param {Object} props.attributes Block's attributes.
|
33233 |
-
* @param {Object} props.setAttributes Function to set block's attributes.
|
33234 |
-
*/
|
33235 |
-
|
33236 |
-
function resetMargin(_ref) {
|
33237 |
-
let {
|
33238 |
-
attributes = {},
|
33239 |
-
setAttributes
|
33240 |
-
} = _ref;
|
33241 |
-
const {
|
33242 |
-
style
|
33243 |
-
} = attributes;
|
33244 |
-
setAttributes({
|
33245 |
-
style: cleanEmptyObject({ ...style,
|
33246 |
-
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
33247 |
-
margin: undefined
|
33248 |
-
}
|
33249 |
-
})
|
33250 |
-
});
|
33251 |
-
}
|
33252 |
-
/**
|
33253 |
-
* Custom hook that checks if margin settings have been disabled.
|
33254 |
-
*
|
33255 |
-
* @param {string} name The name of the block.
|
33256 |
-
*
|
33257 |
-
* @return {boolean} Whether margin setting is disabled.
|
33258 |
-
*/
|
33259 |
-
|
33260 |
-
function useIsMarginDisabled() {
|
33261 |
-
let {
|
33262 |
-
name: blockName
|
33263 |
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33264 |
-
const isDisabled = !useSetting('spacing.margin');
|
33265 |
-
const isInvalid = !useIsDimensionsSupportValid(blockName, 'margin');
|
33266 |
-
return !hasMarginSupport(blockName) || isDisabled || isInvalid;
|
33267 |
-
}
|
33268 |
-
/**
|
33269 |
-
* Inspector control panel containing the margin related configuration
|
33270 |
-
*
|
33271 |
-
* @param {Object} props Block props.
|
33272 |
-
*
|
33273 |
-
* @return {WPElement} Margin edit element.
|
33274 |
-
*/
|
33275 |
-
|
33276 |
-
function MarginEdit(props) {
|
33277 |
-
var _style$spacing;
|
33278 |
-
|
33279 |
-
const {
|
33280 |
-
name: blockName,
|
33281 |
-
attributes: {
|
33282 |
-
style
|
33283 |
-
},
|
33284 |
-
setAttributes
|
33285 |
-
} = props;
|
33286 |
-
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
33287 |
-
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
33288 |
-
});
|
33289 |
-
const sides = useCustomSides(blockName, 'margin');
|
33290 |
-
const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
|
33291 |
-
|
33292 |
-
if (useIsMarginDisabled(props)) {
|
33293 |
-
return null;
|
33294 |
-
}
|
33295 |
-
|
33296 |
-
const onChange = next => {
|
33297 |
-
const newStyle = { ...style,
|
33298 |
-
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
33299 |
-
margin: next
|
33300 |
-
}
|
33301 |
-
};
|
33302 |
-
setAttributes({
|
33303 |
-
style: cleanEmptyObject(newStyle)
|
33304 |
-
});
|
33305 |
-
};
|
33306 |
-
|
33307 |
-
const onChangeShowVisualizer = next => {
|
33308 |
-
const newStyle = { ...style,
|
33309 |
-
visualizers: {
|
33310 |
-
margin: next
|
33311 |
-
}
|
33312 |
-
};
|
33313 |
-
setAttributes({
|
33314 |
-
style: cleanEmptyObject(newStyle)
|
33315 |
-
});
|
33316 |
-
};
|
33317 |
-
|
33318 |
-
return external_wp_element_namespaceObject.Platform.select({
|
33319 |
-
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
33320 |
-
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin,
|
33321 |
-
onChange: onChange,
|
33322 |
-
onChangeShowVisualizer: onChangeShowVisualizer,
|
33323 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
33324 |
-
sides: sides,
|
33325 |
-
units: units,
|
33326 |
-
allowReset: false,
|
33327 |
-
splitOnAxis: splitOnAxis
|
33328 |
-
})),
|
33329 |
-
native: null
|
33330 |
-
});
|
33331 |
-
}
|
33332 |
-
|
33333 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/padding.js
|
33334 |
-
|
33335 |
-
|
33336 |
-
/**
|
33337 |
-
* WordPress dependencies
|
33338 |
-
*/
|
33339 |
-
|
33340 |
-
|
33341 |
-
|
33342 |
-
|
33343 |
-
/**
|
33344 |
-
* Internal dependencies
|
33345 |
-
*/
|
33346 |
-
|
33347 |
-
|
33348 |
-
|
33349 |
-
|
33350 |
-
/**
|
33351 |
-
* Determines if there is padding support.
|
33352 |
-
*
|
33353 |
-
* @param {string|Object} blockType Block name or Block Type object.
|
33354 |
-
*
|
33355 |
-
* @return {boolean} Whether there is support.
|
33356 |
-
*/
|
33357 |
-
|
33358 |
-
function hasPaddingSupport(blockType) {
|
33359 |
-
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY);
|
33360 |
-
return !!(true === support || support !== null && support !== void 0 && support.padding);
|
33361 |
-
}
|
33362 |
-
/**
|
33363 |
-
* Checks if there is a current value in the padding block support attributes.
|
33364 |
-
*
|
33365 |
-
* @param {Object} props Block props.
|
33366 |
-
* @return {boolean} Whether or not the block has a padding value set.
|
33367 |
-
*/
|
33368 |
-
|
33369 |
-
function hasPaddingValue(props) {
|
33370 |
-
var _props$attributes$sty, _props$attributes$sty2;
|
33371 |
-
|
33372 |
-
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.padding) !== undefined;
|
33373 |
-
}
|
33374 |
-
/**
|
33375 |
-
* Resets the padding block support attributes. This can be used when disabling
|
33376 |
-
* the padding support controls for a block via a `ToolsPanel`.
|
33377 |
-
*
|
33378 |
-
* @param {Object} props Block props.
|
33379 |
-
* @param {Object} props.attributes Block's attributes.
|
33380 |
-
* @param {Object} props.setAttributes Function to set block's attributes.
|
33381 |
-
*/
|
33382 |
-
|
33383 |
-
function resetPadding(_ref) {
|
33384 |
-
let {
|
33385 |
-
attributes = {},
|
33386 |
-
setAttributes
|
33387 |
-
} = _ref;
|
33388 |
-
const {
|
33389 |
-
style
|
33390 |
-
} = attributes;
|
33391 |
-
setAttributes({
|
33392 |
-
style: cleanEmptyObject({ ...style,
|
33393 |
-
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
33394 |
-
padding: undefined
|
33395 |
}
|
33396 |
})
|
33397 |
});
|
33398 |
}
|
33399 |
-
/**
|
33400 |
-
* Custom hook that checks if padding settings have been disabled.
|
33401 |
-
*
|
33402 |
-
* @param {string} name The name of the block.
|
33403 |
-
*
|
33404 |
-
* @return {boolean} Whether padding setting is disabled.
|
33405 |
-
*/
|
33406 |
-
|
33407 |
-
function useIsPaddingDisabled() {
|
33408 |
-
let {
|
33409 |
-
name: blockName
|
33410 |
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33411 |
-
const isDisabled = !useSetting('spacing.padding');
|
33412 |
-
const isInvalid = !useIsDimensionsSupportValid(blockName, 'padding');
|
33413 |
-
return !hasPaddingSupport(blockName) || isDisabled || isInvalid;
|
33414 |
-
}
|
33415 |
-
/**
|
33416 |
-
* Inspector control panel containing the padding related configuration
|
33417 |
-
*
|
33418 |
-
* @param {Object} props
|
33419 |
-
*
|
33420 |
-
* @return {WPElement} Padding edit element.
|
33421 |
-
*/
|
33422 |
-
|
33423 |
-
function PaddingEdit(props) {
|
33424 |
-
var _style$spacing;
|
33425 |
-
|
33426 |
-
const {
|
33427 |
-
name: blockName,
|
33428 |
-
attributes: {
|
33429 |
-
style
|
33430 |
-
},
|
33431 |
-
setAttributes
|
33432 |
-
} = props;
|
33433 |
-
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
33434 |
-
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
33435 |
-
});
|
33436 |
-
const sides = useCustomSides(blockName, 'padding');
|
33437 |
-
const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
|
33438 |
-
|
33439 |
-
if (useIsPaddingDisabled(props)) {
|
33440 |
-
return null;
|
33441 |
-
}
|
33442 |
-
|
33443 |
-
const onChange = next => {
|
33444 |
-
const newStyle = { ...style,
|
33445 |
-
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
33446 |
-
padding: next
|
33447 |
-
}
|
33448 |
-
};
|
33449 |
-
setAttributes({
|
33450 |
-
style: cleanEmptyObject(newStyle)
|
33451 |
-
});
|
33452 |
-
};
|
33453 |
-
|
33454 |
-
const onChangeShowVisualizer = next => {
|
33455 |
-
const newStyle = { ...style,
|
33456 |
-
visualizers: {
|
33457 |
-
padding: next
|
33458 |
-
}
|
33459 |
-
};
|
33460 |
-
setAttributes({
|
33461 |
-
style: cleanEmptyObject(newStyle)
|
33462 |
-
});
|
33463 |
-
};
|
33464 |
-
|
33465 |
-
return external_wp_element_namespaceObject.Platform.select({
|
33466 |
-
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
33467 |
-
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding,
|
33468 |
-
onChange: onChange,
|
33469 |
-
onChangeShowVisualizer: onChangeShowVisualizer,
|
33470 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
33471 |
-
sides: sides,
|
33472 |
-
units: units,
|
33473 |
-
allowReset: false,
|
33474 |
-
splitOnAxis: splitOnAxis
|
33475 |
-
})),
|
33476 |
-
native: null
|
33477 |
-
});
|
33478 |
-
}
|
33479 |
|
33480 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/
|
33481 |
|
33482 |
|
33483 |
/**
|
@@ -33486,7 +33963,6 @@ function PaddingEdit(props) {
|
|
33486 |
|
33487 |
|
33488 |
|
33489 |
-
|
33490 |
/**
|
33491 |
* Internal dependencies
|
33492 |
*/
|
@@ -33495,36 +33971,37 @@ function PaddingEdit(props) {
|
|
33495 |
|
33496 |
|
33497 |
|
33498 |
-
const SPACING_SUPPORT_KEY = 'spacing';
|
33499 |
-
const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
|
33500 |
-
const AXIAL_SIDES = ['vertical', 'horizontal'];
|
33501 |
-
/**
|
33502 |
-
* Inspector controls for dimensions support.
|
33503 |
-
*
|
33504 |
-
* @param {Object} props Block props.
|
33505 |
-
*
|
33506 |
-
* @return {WPElement} Inspector controls for spacing support features.
|
33507 |
-
*/
|
33508 |
|
33509 |
-
function DimensionsPanel(props) {
|
33510 |
-
const isGapDisabled = useIsGapDisabled(props);
|
33511 |
-
const isPaddingDisabled = useIsPaddingDisabled(props);
|
33512 |
-
const isMarginDisabled = useIsMarginDisabled(props);
|
33513 |
-
const isDisabled = useIsDimensionsDisabled(props);
|
33514 |
-
const isSupported = hasDimensionsSupport(props.name);
|
33515 |
|
33516 |
-
if (isDisabled || !isSupported) {
|
33517 |
-
return null;
|
33518 |
-
}
|
33519 |
|
33520 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33521 |
|
33522 |
const createResetAllFilter = attribute => newAttributes => {
|
33523 |
var _newAttributes$style;
|
33524 |
|
33525 |
return { ...newAttributes,
|
33526 |
style: { ...newAttributes.style,
|
33527 |
-
|
33528 |
[attribute]: undefined
|
33529 |
}
|
33530 |
}
|
@@ -33532,104 +34009,95 @@ function DimensionsPanel(props) {
|
|
33532 |
};
|
33533 |
|
33534 |
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
33535 |
-
__experimentalGroup: "
|
33536 |
-
}, !
|
33537 |
-
hasValue: () =>
|
33538 |
-
label: (0,external_wp_i18n_namespaceObject.__)('
|
33539 |
-
onDeselect: () =>
|
33540 |
-
|
33541 |
-
|
33542 |
-
|
33543 |
-
|
33544 |
-
|
33545 |
-
|
33546 |
-
|
33547 |
-
|
33548 |
-
|
33549 |
-
|
33550 |
-
|
33551 |
-
|
33552 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
33553 |
-
onDeselect: () => resetGap(props),
|
33554 |
-
resetAllFilter: createResetAllFilter('blockGap'),
|
33555 |
-
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap,
|
33556 |
-
panelId: props.clientId
|
33557 |
-
}, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props)));
|
33558 |
-
}
|
33559 |
-
/**
|
33560 |
-
* Determine whether there is dimensions related block support.
|
33561 |
-
*
|
33562 |
-
* @param {string} blockName Block name.
|
33563 |
-
*
|
33564 |
-
* @return {boolean} Whether there is support.
|
33565 |
-
*/
|
33566 |
|
33567 |
-
|
33568 |
-
|
33569 |
-
|
33570 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33571 |
|
33572 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33573 |
}
|
33574 |
-
|
33575 |
-
|
33576 |
-
*
|
33577 |
-
* @param {Object} props Block properties.
|
33578 |
-
*
|
33579 |
-
* @return {boolean} If spacing support is completely disabled.
|
33580 |
-
*/
|
33581 |
-
|
33582 |
-
const useIsDimensionsDisabled = function () {
|
33583 |
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33584 |
-
const gapDisabled = useIsGapDisabled(props);
|
33585 |
-
const paddingDisabled = useIsPaddingDisabled(props);
|
33586 |
-
const marginDisabled = useIsMarginDisabled(props);
|
33587 |
-
return gapDisabled && paddingDisabled && marginDisabled;
|
33588 |
};
|
33589 |
-
/**
|
33590 |
-
* Custom hook to retrieve which padding/margin is supported
|
33591 |
-
* e.g. top, right, bottom or left.
|
33592 |
-
*
|
33593 |
-
* Sides are opted into by default. It is only if a specific side is set to
|
33594 |
-
* false that it is omitted.
|
33595 |
-
*
|
33596 |
-
* @param {string} blockName Block name.
|
33597 |
-
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
33598 |
-
*
|
33599 |
-
* @return {Object} Sides supporting custom margin.
|
33600 |
-
*/
|
33601 |
-
|
33602 |
-
|
33603 |
-
function useCustomSides(blockName, feature) {
|
33604 |
-
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, SPACING_SUPPORT_KEY); // Skip when setting is boolean as theme isn't setting arbitrary sides.
|
33605 |
-
|
33606 |
-
if (!support || typeof support[feature] === 'boolean') {
|
33607 |
-
return;
|
33608 |
-
}
|
33609 |
-
|
33610 |
-
return support[feature];
|
33611 |
-
}
|
33612 |
-
/**
|
33613 |
-
* Custom hook to determine whether the sides configured in the
|
33614 |
-
* block support are valid. A dimension property cannot declare
|
33615 |
-
* support for a mix of axial and individual sides.
|
33616 |
-
*
|
33617 |
-
* @param {string} blockName Block name.
|
33618 |
-
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
33619 |
-
*
|
33620 |
-
* @return {boolean} If the feature has a valid configuration of sides.
|
33621 |
-
*/
|
33622 |
-
|
33623 |
-
function useIsDimensionsSupportValid(blockName, feature) {
|
33624 |
-
const sides = useCustomSides(blockName, feature);
|
33625 |
|
33626 |
-
|
33627 |
-
|
33628 |
-
|
33629 |
-
|
33630 |
-
}
|
33631 |
-
|
33632 |
-
return true;
|
33633 |
}
|
33634 |
|
33635 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/style.js
|
@@ -35989,6 +36457,215 @@ function ListViewLeaf(_ref) {
|
|
35989 |
}, props), children);
|
35990 |
}
|
35991 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35992 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/utils.js
|
35993 |
/**
|
35994 |
* External dependencies
|
@@ -36039,39 +36716,7 @@ function getCommonDepthClientIds(startId, endId, startParents, endParents) {
|
|
36039 |
};
|
36040 |
}
|
36041 |
|
36042 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/
|
36043 |
-
|
36044 |
-
|
36045 |
-
/**
|
36046 |
-
* WordPress dependencies
|
36047 |
-
*/
|
36048 |
-
|
36049 |
-
function ListViewExpander(_ref) {
|
36050 |
-
let {
|
36051 |
-
onClick
|
36052 |
-
} = _ref;
|
36053 |
-
return (// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js
|
36054 |
-
//
|
36055 |
-
// The expander component is implemented as a pseudo element in the w3 example
|
36056 |
-
// https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html
|
36057 |
-
//
|
36058 |
-
// We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree.
|
36059 |
-
// For the current tree grid implementation, please do not try to make this a button.
|
36060 |
-
//
|
36061 |
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
36062 |
-
(0,external_wp_element_namespaceObject.createElement)("span", {
|
36063 |
-
className: "block-editor-list-view__expander",
|
36064 |
-
onClick: event => onClick(event, {
|
36065 |
-
forceToggle: true
|
36066 |
-
}),
|
36067 |
-
"aria-hidden": "true"
|
36068 |
-
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
36069 |
-
icon: chevron_right_small
|
36070 |
-
}))
|
36071 |
-
);
|
36072 |
-
}
|
36073 |
-
|
36074 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/block-select-button.js
|
36075 |
|
36076 |
|
36077 |
/**
|
@@ -36086,98 +36731,6 @@ function ListViewExpander(_ref) {
|
|
36086 |
|
36087 |
|
36088 |
|
36089 |
-
/**
|
36090 |
-
* Internal dependencies
|
36091 |
-
*/
|
36092 |
-
|
36093 |
-
|
36094 |
-
|
36095 |
-
|
36096 |
-
|
36097 |
-
|
36098 |
-
|
36099 |
-
|
36100 |
-
function ListViewBlockSelectButton(_ref, ref) {
|
36101 |
-
let {
|
36102 |
-
className,
|
36103 |
-
block: {
|
36104 |
-
clientId
|
36105 |
-
},
|
36106 |
-
isSelected,
|
36107 |
-
onClick,
|
36108 |
-
onToggleExpanded,
|
36109 |
-
position,
|
36110 |
-
siblingBlockCount,
|
36111 |
-
level,
|
36112 |
-
tabIndex,
|
36113 |
-
onFocus,
|
36114 |
-
onDragStart,
|
36115 |
-
onDragEnd,
|
36116 |
-
draggable,
|
36117 |
-
isExpanded
|
36118 |
-
} = _ref;
|
36119 |
-
const blockInformation = useBlockDisplayInformation(clientId);
|
36120 |
-
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlockSelectButton);
|
36121 |
-
const descriptionId = `list-view-block-select-button__${instanceId}`;
|
36122 |
-
const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level); // The `href` attribute triggers the browser's native HTML drag operations.
|
36123 |
-
// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
|
36124 |
-
// We need to clear any HTML drag data to prevent `pasteHandler` from firing
|
36125 |
-
// inside the `useOnBlockDrop` hook.
|
36126 |
-
|
36127 |
-
const onDragStartHandler = event => {
|
36128 |
-
event.dataTransfer.clearData();
|
36129 |
-
onDragStart(event);
|
36130 |
-
};
|
36131 |
-
|
36132 |
-
function onKeyDownHandler(event) {
|
36133 |
-
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER || event.keyCode === external_wp_keycodes_namespaceObject.SPACE) {
|
36134 |
-
onClick(event);
|
36135 |
-
}
|
36136 |
-
}
|
36137 |
-
|
36138 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
36139 |
-
className: classnames_default()('block-editor-list-view-block-select-button', className),
|
36140 |
-
onClick: onClick,
|
36141 |
-
onKeyDown: onKeyDownHandler,
|
36142 |
-
"aria-describedby": descriptionId,
|
36143 |
-
ref: ref,
|
36144 |
-
tabIndex: tabIndex,
|
36145 |
-
onFocus: onFocus,
|
36146 |
-
onDragStart: onDragStartHandler,
|
36147 |
-
onDragEnd: onDragEnd,
|
36148 |
-
draggable: draggable,
|
36149 |
-
href: `#block-${clientId}`,
|
36150 |
-
"aria-expanded": isExpanded
|
36151 |
-
}, (0,external_wp_element_namespaceObject.createElement)(ListViewExpander, {
|
36152 |
-
onClick: onToggleExpanded
|
36153 |
-
}), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
36154 |
-
icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
|
36155 |
-
showColors: true
|
36156 |
-
}), (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
36157 |
-
clientId: clientId,
|
36158 |
-
maximumLength: 35
|
36159 |
-
}), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
36160 |
-
className: "block-editor-list-view-block-select-button__anchor"
|
36161 |
-
}, blockInformation.anchor), isSelected && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('(selected block)'))), (0,external_wp_element_namespaceObject.createElement)("div", {
|
36162 |
-
className: "block-editor-list-view-block-select-button__description",
|
36163 |
-
id: descriptionId
|
36164 |
-
}, blockPositionDescription));
|
36165 |
-
}
|
36166 |
-
|
36167 |
-
/* harmony default export */ var block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
|
36168 |
-
|
36169 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/block-contents.js
|
36170 |
-
|
36171 |
-
|
36172 |
-
|
36173 |
-
/**
|
36174 |
-
* External dependencies
|
36175 |
-
*/
|
36176 |
-
|
36177 |
-
/**
|
36178 |
-
* WordPress dependencies
|
36179 |
-
*/
|
36180 |
-
|
36181 |
|
36182 |
|
36183 |
/**
|
@@ -36187,104 +36740,6 @@ function ListViewBlockSelectButton(_ref, ref) {
|
|
36187 |
|
36188 |
|
36189 |
|
36190 |
-
const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
|
36191 |
-
let {
|
36192 |
-
onClick,
|
36193 |
-
onToggleExpanded,
|
36194 |
-
block,
|
36195 |
-
isSelected,
|
36196 |
-
position,
|
36197 |
-
siblingBlockCount,
|
36198 |
-
level,
|
36199 |
-
isExpanded,
|
36200 |
-
selectedClientIds,
|
36201 |
-
...props
|
36202 |
-
} = _ref;
|
36203 |
-
const {
|
36204 |
-
clientId
|
36205 |
-
} = block;
|
36206 |
-
const {
|
36207 |
-
blockMovingClientId,
|
36208 |
-
selectedBlockInBlockEditor
|
36209 |
-
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
36210 |
-
const {
|
36211 |
-
hasBlockMovingClientId,
|
36212 |
-
getSelectedBlockClientId
|
36213 |
-
} = select(store);
|
36214 |
-
return {
|
36215 |
-
blockMovingClientId: hasBlockMovingClientId(),
|
36216 |
-
selectedBlockInBlockEditor: getSelectedBlockClientId()
|
36217 |
-
};
|
36218 |
-
}, [clientId]);
|
36219 |
-
const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId;
|
36220 |
-
const className = classnames_default()('block-editor-list-view-block-contents', {
|
36221 |
-
'is-dropping-before': isBlockMoveTarget
|
36222 |
-
}); // Only include all selected blocks if the currently clicked on block
|
36223 |
-
// is one of the selected blocks. This ensures that if a user attempts
|
36224 |
-
// to drag a block that isn't part of the selection, they're still able
|
36225 |
-
// to drag it and rearrange its position.
|
36226 |
-
|
36227 |
-
const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
36228 |
-
return (0,external_wp_element_namespaceObject.createElement)(block_draggable, {
|
36229 |
-
clientIds: draggableClientIds
|
36230 |
-
}, _ref2 => {
|
36231 |
-
let {
|
36232 |
-
draggable,
|
36233 |
-
onDragStart,
|
36234 |
-
onDragEnd
|
36235 |
-
} = _ref2;
|
36236 |
-
return (0,external_wp_element_namespaceObject.createElement)(block_select_button, _extends({
|
36237 |
-
ref: ref,
|
36238 |
-
className: className,
|
36239 |
-
block: block,
|
36240 |
-
onClick: onClick,
|
36241 |
-
onToggleExpanded: onToggleExpanded,
|
36242 |
-
isSelected: isSelected,
|
36243 |
-
position: position,
|
36244 |
-
siblingBlockCount: siblingBlockCount,
|
36245 |
-
level: level,
|
36246 |
-
draggable: draggable,
|
36247 |
-
onDragStart: onDragStart,
|
36248 |
-
onDragEnd: onDragEnd,
|
36249 |
-
isExpanded: isExpanded
|
36250 |
-
}, props));
|
36251 |
-
});
|
36252 |
-
});
|
36253 |
-
/* harmony default export */ var block_contents = (ListViewBlockContents);
|
36254 |
-
|
36255 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/context.js
|
36256 |
-
/**
|
36257 |
-
* WordPress dependencies
|
36258 |
-
*/
|
36259 |
-
|
36260 |
-
const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({
|
36261 |
-
__experimentalFeatures: false,
|
36262 |
-
__experimentalPersistentListViewFeatures: false
|
36263 |
-
});
|
36264 |
-
const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext);
|
36265 |
-
|
36266 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/block.js
|
36267 |
-
|
36268 |
-
|
36269 |
-
/**
|
36270 |
-
* External dependencies
|
36271 |
-
*/
|
36272 |
-
|
36273 |
-
/**
|
36274 |
-
* WordPress dependencies
|
36275 |
-
*/
|
36276 |
-
|
36277 |
-
|
36278 |
-
|
36279 |
-
|
36280 |
-
|
36281 |
-
|
36282 |
-
/**
|
36283 |
-
* Internal dependencies
|
36284 |
-
*/
|
36285 |
-
|
36286 |
-
|
36287 |
-
|
36288 |
|
36289 |
|
36290 |
|
@@ -36305,7 +36760,8 @@ function ListViewBlock(_ref) {
|
|
36305 |
showBlockMovers,
|
36306 |
path,
|
36307 |
isExpanded,
|
36308 |
-
selectedClientIds
|
|
|
36309 |
} = _ref;
|
36310 |
const cellRef = (0,external_wp_element_namespaceObject.useRef)(null);
|
36311 |
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
|
@@ -36315,6 +36771,14 @@ function ListViewBlock(_ref) {
|
|
36315 |
const {
|
36316 |
toggleBlockHighlight
|
36317 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36318 |
const {
|
36319 |
__experimentalFeatures: withExperimentalFeatures,
|
36320 |
__experimentalPersistentListViewFeatures: withExperimentalPersistentListViewFeatures,
|
@@ -36350,8 +36814,9 @@ function ListViewBlock(_ref) {
|
|
36350 |
}, [clientId, setIsHovered, highlightBlock]);
|
36351 |
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
36352 |
selectBlock(event, clientId);
|
|
|
36353 |
}, [clientId, selectBlock]);
|
36354 |
-
const
|
36355 |
selectBlock(undefined, newClientId);
|
36356 |
}, [selectBlock]);
|
36357 |
const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
@@ -36381,10 +36846,7 @@ function ListViewBlock(_ref) {
|
|
36381 |
'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected,
|
36382 |
'is-dragging': isDragged,
|
36383 |
'has-single-cell': hideBlockActions
|
36384 |
-
});
|
36385 |
-
const blockInformation = useBlockDisplayInformation(clientId);
|
36386 |
-
const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
|
36387 |
-
(0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options'); // Only include all selected blocks if the currently clicked on block
|
36388 |
// is one of the selected blocks. This ensures that if a user attempts
|
36389 |
// to alter a block that isn't part of the selection, they're still able
|
36390 |
// to do so.
|
@@ -36402,11 +36864,16 @@ function ListViewBlock(_ref) {
|
|
36402 |
path: path,
|
36403 |
id: `list-view-block-${clientId}`,
|
36404 |
"data-block": clientId,
|
36405 |
-
isExpanded: isExpanded
|
|
|
36406 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
36407 |
className: "block-editor-list-view-block__contents-cell",
|
36408 |
colSpan: colSpan,
|
36409 |
-
ref: cellRef
|
|
|
|
|
|
|
|
|
36410 |
}, _ref2 => {
|
36411 |
let {
|
36412 |
ref,
|
@@ -36427,8 +36894,12 @@ function ListViewBlock(_ref) {
|
|
36427 |
tabIndex: tabIndex,
|
36428 |
onFocus: onFocus,
|
36429 |
isExpanded: isExpanded,
|
36430 |
-
selectedClientIds: selectedClientIds
|
36431 |
-
|
|
|
|
|
|
|
|
|
36432 |
}), hasRenderedMovers && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
36433 |
className: moverCellClassName,
|
36434 |
withoutGridItem: true
|
@@ -36459,7 +36930,8 @@ function ListViewBlock(_ref) {
|
|
36459 |
onFocus: onFocus
|
36460 |
});
|
36461 |
}))), showBlockActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
36462 |
-
className: listViewBlockSettingsClassName
|
|
|
36463 |
}, _ref5 => {
|
36464 |
let {
|
36465 |
ref,
|
@@ -36477,7 +36949,7 @@ function ListViewBlock(_ref) {
|
|
36477 |
onFocus
|
36478 |
},
|
36479 |
disableOpenOnArrowDown: true,
|
36480 |
-
__experimentalSelectBlock:
|
36481 |
});
|
36482 |
}));
|
36483 |
}
|
@@ -36511,13 +36983,14 @@ function ListViewBlock(_ref) {
|
|
36511 |
* When a block is collapsed, we do not count their children as part of that total. In the current drag
|
36512 |
* implementation dragged blocks and their children are not counted.
|
36513 |
*
|
36514 |
-
* @param {Object}
|
36515 |
-
* @param {Object}
|
36516 |
-
* @param {Array}
|
|
|
36517 |
* @return {number} block count
|
36518 |
*/
|
36519 |
|
36520 |
-
function countBlocks(block, expandedState, draggedClientIds) {
|
36521 |
var _expandedState$block$;
|
36522 |
|
36523 |
const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
|
@@ -36526,16 +36999,16 @@ function countBlocks(block, expandedState, draggedClientIds) {
|
|
36526 |
return 0;
|
36527 |
}
|
36528 |
|
36529 |
-
const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ :
|
36530 |
|
36531 |
if (isExpanded) {
|
36532 |
-
return 1 + block.innerBlocks.reduce(countReducer(expandedState, draggedClientIds), 0);
|
36533 |
}
|
36534 |
|
36535 |
return 1;
|
36536 |
}
|
36537 |
|
36538 |
-
const countReducer = (expandedState, draggedClientIds) => (count, block) => {
|
36539 |
var _expandedState$block$2;
|
36540 |
|
36541 |
const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
|
@@ -36544,10 +37017,10 @@ const countReducer = (expandedState, draggedClientIds) => (count, block) => {
|
|
36544 |
return count;
|
36545 |
}
|
36546 |
|
36547 |
-
const isExpanded = (_expandedState$block$2 = expandedState[block.clientId]) !== null && _expandedState$block$2 !== void 0 ? _expandedState$block$2 :
|
36548 |
|
36549 |
if (isExpanded && block.innerBlocks.length > 0) {
|
36550 |
-
return count + countBlocks(block, expandedState, draggedClientIds);
|
36551 |
}
|
36552 |
|
36553 |
return count + 1;
|
@@ -36564,7 +37037,8 @@ function ListViewBranch(props) {
|
|
36564 |
path = '',
|
36565 |
isBranchSelected = false,
|
36566 |
listPosition = 0,
|
36567 |
-
fixedListWindow
|
|
|
36568 |
} = props;
|
36569 |
const {
|
36570 |
expandedState,
|
@@ -36583,7 +37057,7 @@ function ListViewBranch(props) {
|
|
36583 |
} = block;
|
36584 |
|
36585 |
if (index > 0) {
|
36586 |
-
nextPosition += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds);
|
36587 |
}
|
36588 |
|
36589 |
const usesWindowing = __experimentalPersistentListViewFeatures;
|
@@ -36594,7 +37068,7 @@ function ListViewBranch(props) {
|
|
36594 |
const position = index + 1;
|
36595 |
const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
|
36596 |
const hasNestedBlocks = showNestedBlocks && !!innerBlocks && !!innerBlocks.length;
|
36597 |
-
const isExpanded = hasNestedBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client :
|
36598 |
const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId));
|
36599 |
const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous,
|
36600 |
// but asynchronous for any other block.
|
@@ -36631,7 +37105,8 @@ function ListViewBranch(props) {
|
|
36631 |
listPosition: nextPosition + 1,
|
36632 |
fixedListWindow: fixedListWindow,
|
36633 |
isBranchSelected: isSelectedBranch,
|
36634 |
-
selectedClientIds: selectedClientIds
|
|
|
36635 |
}));
|
36636 |
}));
|
36637 |
}
|
@@ -36800,7 +37275,7 @@ function useBlockSelection() {
|
|
36800 |
|
36801 |
|
36802 |
event.preventDefault();
|
36803 |
-
const isKeyPress = event.type === 'keydown' && (event.keyCode === external_wp_keycodes_namespaceObject.UP || event.keyCode === external_wp_keycodes_namespaceObject.DOWN); // Handle clicking on a block when no blocks are selected, and return early.
|
36804 |
|
36805 |
if (!isKeyPress && !hasSelectedBlock() && !hasMultiSelection()) {
|
36806 |
selectBlock(clientId, null);
|
@@ -36846,7 +37321,14 @@ function useBlockSelection() {
|
|
36846 |
await multiSelect(start, end, null); // Announce deselected block, or number of deselected blocks if
|
36847 |
// the total number of blocks deselected is greater than one.
|
36848 |
|
36849 |
-
const updatedSelectedBlocks = getSelectedBlockClientIds();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36850 |
const selectionDiff = (0,external_lodash_namespaceObject.difference)(selectedBlocks, updatedSelectedBlocks);
|
36851 |
let label;
|
36852 |
|
@@ -37235,6 +37717,8 @@ const BLOCK_LIST_ITEM_HEIGHT = 36;
|
|
37235 |
* @param {boolean} props.__experimentalFeatures Flag to enable experimental features.
|
37236 |
* @param {boolean} props.__experimentalPersistentListViewFeatures Flag to enable features for the Persistent List View experiment.
|
37237 |
* @param {boolean} props.__experimentalHideContainerBlockActions Flag to hide actions of top level blocks (like core/widget-area)
|
|
|
|
|
37238 |
* @param {Object} ref Forwarded ref
|
37239 |
*/
|
37240 |
|
@@ -37246,6 +37730,8 @@ function ListView(_ref, ref) {
|
|
37246 |
__experimentalHideContainerBlockActions,
|
37247 |
showNestedBlocks,
|
37248 |
showBlockMovers,
|
|
|
|
|
37249 |
...props
|
37250 |
} = _ref;
|
37251 |
const {
|
@@ -37349,6 +37835,7 @@ function ListView(_ref, ref) {
|
|
37349 |
listViewRef: elementRef,
|
37350 |
blockDropTarget: blockDropTarget
|
37351 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGrid, {
|
|
|
37352 |
className: "block-editor-list-view-tree",
|
37353 |
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'),
|
37354 |
ref: treeGridRef,
|
@@ -37363,7 +37850,8 @@ function ListView(_ref, ref) {
|
|
37363 |
showNestedBlocks: showNestedBlocks,
|
37364 |
showBlockMovers: showBlockMovers,
|
37365 |
fixedListWindow: fixedListWindow,
|
37366 |
-
selectedClientIds: selectedClientIds
|
|
|
37367 |
}, props)))));
|
37368 |
}
|
37369 |
|
@@ -38335,6 +38823,131 @@ function ColorPaletteControl(_ref) {
|
|
38335 |
}));
|
38336 |
}
|
38337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38338 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
|
38339 |
|
38340 |
|
@@ -44353,7 +44966,7 @@ function RichTextWrapper(_ref, forwardedRef) {
|
|
44353 |
"aria-multiline": !disableLineBreaks,
|
44354 |
"aria-label": placeholder
|
44355 |
}, props, autocompleteProps, {
|
44356 |
-
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([autocompleteProps.ref, props.ref, richTextRef, useInputRules({
|
44357 |
value,
|
44358 |
onChange,
|
44359 |
__unstableAllowPrefixTransformations,
|
@@ -44383,7 +44996,7 @@ function RichTextWrapper(_ref, forwardedRef) {
|
|
44383 |
onChange,
|
44384 |
disableLineBreaks,
|
44385 |
onSplitAtEnd
|
44386 |
-
}), anchorRef
|
44387 |
contentEditable: true,
|
44388 |
suppressContentEditableWarning: true,
|
44389 |
className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text'),
|
@@ -45047,37 +45660,21 @@ const ImageURLInputUI = _ref => {
|
|
45047 |
setIsOpen(false);
|
45048 |
});
|
45049 |
|
45050 |
-
const removeNewTabRel = currentRel => {
|
45051 |
-
let newRel = currentRel;
|
45052 |
-
|
45053 |
-
if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
|
45054 |
-
if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
|
45055 |
-
(0,external_lodash_namespaceObject.each)(NEW_TAB_REL, relVal => {
|
45056 |
-
const regExp = new RegExp('\\b' + relVal + '\\b', 'gi');
|
45057 |
-
newRel = newRel.replace(regExp, '');
|
45058 |
-
}); // Only trim if NEW_TAB_REL values was replaced.
|
45059 |
-
|
45060 |
-
if (newRel !== currentRel) {
|
45061 |
-
newRel = newRel.trim();
|
45062 |
-
}
|
45063 |
-
|
45064 |
-
if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) {
|
45065 |
-
newRel = undefined;
|
45066 |
-
}
|
45067 |
-
}
|
45068 |
-
}
|
45069 |
-
|
45070 |
-
return newRel;
|
45071 |
-
};
|
45072 |
-
|
45073 |
const getUpdatedLinkTargetSettings = value => {
|
45074 |
const newLinkTarget = value ? '_blank' : undefined;
|
45075 |
let updatedRel;
|
45076 |
|
45077 |
-
if (
|
45078 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
45079 |
} else {
|
45080 |
-
|
|
|
45081 |
}
|
45082 |
|
45083 |
return {
|
@@ -45200,7 +45797,7 @@ const ImageURLInputUI = _ref => {
|
|
45200 |
checked: linkTarget === '_blank'
|
45201 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
|
45202 |
label: (0,external_wp_i18n_namespaceObject.__)('Link Rel'),
|
45203 |
-
value:
|
45204 |
onChange: onSetLinkRel
|
45205 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
|
45206 |
label: (0,external_wp_i18n_namespaceObject.__)('Link CSS Class'),
|
@@ -46622,6 +47219,7 @@ function useNoRecursiveRenders(uniqueId) {
|
|
46622 |
|
46623 |
|
46624 |
|
|
|
46625 |
|
46626 |
|
46627 |
|
2214 |
"__experimentalBorderStyleControl": function() { return /* reexport */ BorderStyleControl; },
|
2215 |
"__experimentalColorGradientControl": function() { return /* reexport */ control; },
|
2216 |
"__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; },
|
2217 |
+
"__experimentalDateFormatPicker": function() { return /* reexport */ DateFormatPicker; },
|
2218 |
"__experimentalDuotoneControl": function() { return /* reexport */ duotone_control; },
|
2219 |
"__experimentalFontAppearanceControl": function() { return /* reexport */ FontAppearanceControl; },
|
2220 |
"__experimentalFontFamilyControl": function() { return /* reexport */ FontFamilyControl; },
|
2293 |
"__experimentalGetAllowedPatterns": function() { return __experimentalGetAllowedPatterns; },
|
2294 |
"__experimentalGetBlockListSettingsForBlocks": function() { return __experimentalGetBlockListSettingsForBlocks; },
|
2295 |
"__experimentalGetDirectInsertBlock": function() { return __experimentalGetDirectInsertBlock; },
|
2296 |
+
"__experimentalGetGlobalBlocksByName": function() { return __experimentalGetGlobalBlocksByName; },
|
2297 |
"__experimentalGetLastBlockAttributeChanges": function() { return __experimentalGetLastBlockAttributeChanges; },
|
2298 |
"__experimentalGetParsedPattern": function() { return __experimentalGetParsedPattern; },
|
2299 |
"__experimentalGetPatternTransformItems": function() { return __experimentalGetPatternTransformItems; },
|
2306 |
"areInnerBlocksControlled": function() { return areInnerBlocksControlled; },
|
2307 |
"canInsertBlockType": function() { return canInsertBlockType; },
|
2308 |
"canInsertBlocks": function() { return canInsertBlocks; },
|
2309 |
+
"canLockBlockType": function() { return canLockBlockType; },
|
2310 |
"canMoveBlock": function() { return canMoveBlock; },
|
2311 |
"canMoveBlocks": function() { return canMoveBlocks; },
|
2312 |
"canRemoveBlock": function() { return canRemoveBlock; },
|
2546 |
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
|
2547 |
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
|
2548 |
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
|
2549 |
+
* @property {boolean} __experimentalGenerateAnchors Enable/Disable auto anchor generation for Heading blocks
|
2550 |
+
* @property {boolean} __experimentalCanLockBlocks Whether the user can manage Block Lock state
|
2551 |
* @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
|
2552 |
*/
|
2553 |
|
2661 |
__experimentalBlockPatternCategories: [],
|
2662 |
__experimentalSpotlightEntityBlocks: [],
|
2663 |
__experimentalGenerateAnchors: false,
|
2664 |
+
__experimentalCanLockBlocks: true,
|
2665 |
__unstableGalleryWithImageBlocks: false,
|
2666 |
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
|
2667 |
// The setting is only kept for backward compatibility purposes.
|
4965 |
return block.name === blockName ? accumulator + 1 : accumulator;
|
4966 |
}, 0);
|
4967 |
}, state => [state.blocks.order, state.blocks.byClientId]);
|
4968 |
+
/**
|
4969 |
+
* Returns all global blocks that match a blockName. Results include nested blocks.
|
4970 |
+
*
|
4971 |
+
* @param {Object} state Global application state.
|
4972 |
+
* @param {?string} blockName Optional block name, if not specified, returns an empty array.
|
4973 |
+
*
|
4974 |
+
* @return {Array} Array of clientIds of blocks with name equal to blockName.
|
4975 |
+
*/
|
4976 |
+
|
4977 |
+
const __experimentalGetGlobalBlocksByName = rememo((state, blockName) => {
|
4978 |
+
if (!blockName) {
|
4979 |
+
return EMPTY_ARRAY;
|
4980 |
+
}
|
4981 |
+
|
4982 |
+
const clientIds = getClientIdsWithDescendants(state);
|
4983 |
+
const foundBlocks = clientIds.filter(clientId => {
|
4984 |
+
const block = state.blocks.byClientId[clientId];
|
4985 |
+
return block.name === blockName;
|
4986 |
+
});
|
4987 |
+
return foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY;
|
4988 |
+
}, state => [state.blocks.order, state.blocks.byClientId]);
|
4989 |
/**
|
4990 |
* Given an array of block client IDs, returns the corresponding array of block
|
4991 |
* objects.
|
6094 |
let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
6095 |
return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId));
|
6096 |
}
|
6097 |
+
/**
|
6098 |
+
* Determines if the given block type can be locked/unlocked by a user.
|
6099 |
+
*
|
6100 |
+
* @param {Object} state Editor state.
|
6101 |
+
* @param {(string|Object)} nameOrType Block name or type object.
|
6102 |
+
*
|
6103 |
+
* @return {boolean} Whether a given block type can be locked/unlocked.
|
6104 |
+
*/
|
6105 |
+
|
6106 |
+
function canLockBlockType(state, nameOrType) {
|
6107 |
+
var _state$settings;
|
6108 |
+
|
6109 |
+
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, '__experimentalLock', true)) {
|
6110 |
+
return false;
|
6111 |
+
} // Use block editor settings as the default value.
|
6112 |
+
|
6113 |
+
|
6114 |
+
return !!((_state$settings = state.settings) !== null && _state$settings !== void 0 && _state$settings.__experimentalCanLockBlocks);
|
6115 |
+
}
|
6116 |
/**
|
6117 |
* Returns information about how recently and frequently a block has been inserted.
|
6118 |
*
|
6576 |
}
|
6577 |
|
6578 |
return { ...pattern,
|
6579 |
+
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
|
6580 |
+
__unstableSkipMigrationLogs: true
|
6581 |
+
})
|
6582 |
};
|
6583 |
}, state => [state.settings.__experimentalBlockPatterns]);
|
6584 |
const getAllAllowedPatterns = rememo(state => {
|
6830 |
*/
|
6831 |
|
6832 |
function getReusableBlocks(state) {
|
6833 |
+
var _state$settings$__exp, _state$settings2;
|
6834 |
|
6835 |
+
return (_state$settings$__exp = state === null || state === void 0 ? void 0 : (_state$settings2 = state.settings) === null || _state$settings2 === void 0 ? void 0 : _state$settings2.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY;
|
6836 |
}
|
6837 |
/**
|
6838 |
* Returns whether the navigation mode is enabled.
|
8679 |
return selectors.split(',').map(subselector => `.editor-styles-wrapper ${subselector} ${append}`).join(',');
|
8680 |
}
|
8681 |
|
8682 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/provider/block-refs-provider.js
|
8683 |
+
|
8684 |
+
|
8685 |
+
/**
|
8686 |
+
* WordPress dependencies
|
8687 |
+
*/
|
8688 |
+
|
8689 |
+
const BlockRefs = (0,external_wp_element_namespaceObject.createContext)({
|
8690 |
+
refs: new Map(),
|
8691 |
+
callbacks: new Map()
|
8692 |
+
});
|
8693 |
+
function BlockRefsProvider(_ref) {
|
8694 |
+
let {
|
8695 |
+
children
|
8696 |
+
} = _ref;
|
8697 |
+
const value = (0,external_wp_element_namespaceObject.useMemo)(() => ({
|
8698 |
+
refs: new Map(),
|
8699 |
+
callbacks: new Map()
|
8700 |
+
}), []);
|
8701 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockRefs.Provider, {
|
8702 |
+
value: value
|
8703 |
+
}, children);
|
8704 |
+
}
|
8705 |
+
|
8706 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js
|
8707 |
+
/**
|
8708 |
+
* WordPress dependencies
|
8709 |
+
*/
|
8710 |
+
|
8711 |
+
|
8712 |
+
/**
|
8713 |
+
* Internal dependencies
|
8714 |
+
*/
|
8715 |
+
|
8716 |
+
|
8717 |
+
/** @typedef {import('@wordpress/element').RefCallback} RefCallback */
|
8718 |
+
|
8719 |
+
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
8720 |
+
|
8721 |
+
/**
|
8722 |
+
* Provides a ref to the BlockRefs context.
|
8723 |
+
*
|
8724 |
+
* @param {string} clientId The client ID of the element ref.
|
8725 |
+
*
|
8726 |
+
* @return {RefCallback} Ref callback.
|
8727 |
+
*/
|
8728 |
+
|
8729 |
+
function useBlockRefProvider(clientId) {
|
8730 |
+
const {
|
8731 |
+
refs,
|
8732 |
+
callbacks
|
8733 |
+
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
|
8734 |
+
const ref = (0,external_wp_element_namespaceObject.useRef)();
|
8735 |
+
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
8736 |
+
refs.set(ref, clientId);
|
8737 |
+
return () => {
|
8738 |
+
refs.delete(ref);
|
8739 |
+
};
|
8740 |
+
}, [clientId]);
|
8741 |
+
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
|
8742 |
+
// Update the ref in the provider.
|
8743 |
+
ref.current = element; // Call any update functions.
|
8744 |
+
|
8745 |
+
callbacks.forEach((id, setElement) => {
|
8746 |
+
if (clientId === id) {
|
8747 |
+
setElement(element);
|
8748 |
+
}
|
8749 |
+
});
|
8750 |
+
}, [clientId]);
|
8751 |
+
}
|
8752 |
+
/**
|
8753 |
+
* Gets a ref pointing to the current block element. Continues to return a
|
8754 |
+
* stable ref even if the block client ID changes.
|
8755 |
+
*
|
8756 |
+
* @param {string} clientId The client ID to get a ref for.
|
8757 |
+
*
|
8758 |
+
* @return {RefObject} A ref containing the element.
|
8759 |
+
*/
|
8760 |
+
|
8761 |
+
function useBlockRef(clientId) {
|
8762 |
+
const {
|
8763 |
+
refs
|
8764 |
+
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
|
8765 |
+
const freshClientId = (0,external_wp_element_namespaceObject.useRef)();
|
8766 |
+
freshClientId.current = clientId; // Always return an object, even if no ref exists for a given client ID, so
|
8767 |
+
// that `current` works at a later point.
|
8768 |
+
|
8769 |
+
return (0,external_wp_element_namespaceObject.useMemo)(() => ({
|
8770 |
+
get current() {
|
8771 |
+
let element = null; // Multiple refs may be created for a single block. Find the
|
8772 |
+
// first that has an element set.
|
8773 |
+
|
8774 |
+
for (const [ref, id] of refs.entries()) {
|
8775 |
+
if (id === freshClientId.current && ref.current) {
|
8776 |
+
element = ref.current;
|
8777 |
+
}
|
8778 |
+
}
|
8779 |
+
|
8780 |
+
return element;
|
8781 |
+
}
|
8782 |
+
|
8783 |
+
}), []);
|
8784 |
+
}
|
8785 |
+
/**
|
8786 |
+
* Return the element for a given client ID. Updates whenever the element
|
8787 |
+
* changes, becomes available, or disappears.
|
8788 |
+
*
|
8789 |
+
* @param {string} clientId The client ID to an element for.
|
8790 |
+
*
|
8791 |
+
* @return {Element|null} The block's wrapper element.
|
8792 |
+
*/
|
8793 |
+
|
8794 |
+
|
8795 |
+
function useBlockElement(clientId) {
|
8796 |
+
const {
|
8797 |
+
callbacks
|
8798 |
+
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
|
8799 |
+
const ref = useBlockRef(clientId);
|
8800 |
+
const [element, setElement] = (0,external_wp_element_namespaceObject.useState)(null);
|
8801 |
+
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
8802 |
+
if (!clientId) {
|
8803 |
+
return;
|
8804 |
+
}
|
8805 |
+
|
8806 |
+
callbacks.set(setElement, clientId);
|
8807 |
+
return () => {
|
8808 |
+
callbacks.delete(setElement);
|
8809 |
+
};
|
8810 |
+
}, [clientId]);
|
8811 |
+
return ref.current || element;
|
8812 |
+
}
|
8813 |
+
|
8814 |
+
|
8815 |
+
|
8816 |
+
|
8817 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-setting/index.js
|
8818 |
/**
|
8819 |
* External dependencies
|
8952 |
return setting;
|
8953 |
}
|
8954 |
|
8955 |
+
;// CONCATENATED MODULE: external ["wp","warning"]
|
8956 |
+
var external_wp_warning_namespaceObject = window["wp"]["warning"];
|
8957 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/groups.js
|
8958 |
+
/**
|
8959 |
+
* WordPress dependencies
|
8960 |
+
*/
|
8961 |
+
|
8962 |
+
const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls');
|
8963 |
+
const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls');
|
8964 |
+
const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBorder');
|
8965 |
+
const InspectorControlsColor = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsColor');
|
8966 |
+
const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions');
|
8967 |
+
const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography');
|
8968 |
+
const groups_groups = {
|
8969 |
+
default: InspectorControlsDefault,
|
8970 |
+
advanced: InspectorControlsAdvanced,
|
8971 |
+
border: InspectorControlsBorder,
|
8972 |
+
color: InspectorControlsColor,
|
8973 |
+
dimensions: InspectorControlsDimensions,
|
8974 |
+
typography: InspectorControlsTypography
|
8975 |
+
};
|
8976 |
+
/* harmony default export */ var inspector_controls_groups = (groups_groups);
|
8977 |
+
|
8978 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/fill.js
|
8979 |
|
8980 |
|
8981 |
+
/**
|
8982 |
+
* External dependencies
|
8983 |
+
*/
|
8984 |
|
8985 |
/**
|
8986 |
* WordPress dependencies
|
8988 |
|
8989 |
|
8990 |
|
8991 |
+
/**
|
8992 |
+
* Internal dependencies
|
8993 |
+
*/
|
8994 |
+
|
8995 |
+
|
8996 |
+
|
8997 |
+
function InspectorControlsFill(_ref) {
|
8998 |
+
var _groups$group;
|
8999 |
|
|
|
9000 |
let {
|
9001 |
+
__experimentalGroup: group = 'default',
|
9002 |
+
children
|
|
|
|
|
|
|
|
|
9003 |
} = _ref;
|
9004 |
+
const isDisplayed = useDisplayBlockControls();
|
9005 |
+
const Fill = (_groups$group = inspector_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill;
|
9006 |
|
9007 |
+
if (!Fill) {
|
9008 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
|
9009 |
+
return null;
|
9010 |
+
}
|
9011 |
+
|
9012 |
+
if (!isDisplayed) {
|
9013 |
+
return null;
|
9014 |
+
}
|
9015 |
+
|
9016 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
|
9017 |
+
document: document
|
9018 |
+
}, (0,external_wp_element_namespaceObject.createElement)(Fill, null, fillProps => {
|
9019 |
+
// Children passed to InspectorControlsFill will not have
|
9020 |
+
// access to any React Context whose Provider is part of
|
9021 |
+
// the InspectorControlsSlot tree. So we re-create the
|
9022 |
+
// Provider in this subtree.
|
9023 |
+
const value = !(0,external_lodash_namespaceObject.isEmpty)(fillProps) ? fillProps : null;
|
9024 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelContext.Provider, {
|
9025 |
+
value: value
|
9026 |
+
}, children);
|
9027 |
+
}));
|
9028 |
+
}
|
9029 |
+
|
9030 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/utils.js
|
9031 |
+
/**
|
9032 |
+
* External dependencies
|
9033 |
+
*/
|
9034 |
+
|
9035 |
+
/**
|
9036 |
+
* Removed falsy values from nested object.
|
9037 |
+
*
|
9038 |
+
* @param {*} object
|
9039 |
+
* @return {*} Object cleaned from falsy values
|
9040 |
+
*/
|
9041 |
+
|
9042 |
+
const cleanEmptyObject = object => {
|
9043 |
+
if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
|
9044 |
+
return object;
|
9045 |
+
}
|
9046 |
+
|
9047 |
+
const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
|
9048 |
+
return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
|
9049 |
+
};
|
9050 |
+
function immutableSet(object, path, value) {
|
9051 |
+
return (0,external_lodash_namespaceObject.setWith)(object ? (0,external_lodash_namespaceObject.clone)(object) : {}, path, value, external_lodash_namespaceObject.clone);
|
9052 |
+
}
|
9053 |
+
function transformStyles(activeSupports, migrationPaths, result, source, index, results) {
|
9054 |
+
var _source$;
|
9055 |
+
|
9056 |
+
// If there are no active supports return early.
|
9057 |
+
if ((0,external_lodash_namespaceObject.every)(activeSupports, isActive => !isActive)) {
|
9058 |
+
return result;
|
9059 |
+
} // If the condition verifies we are probably in the presence of a wrapping transform
|
9060 |
+
// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.
|
9061 |
+
|
9062 |
+
|
9063 |
+
if (results.length === 1 && result.innerBlocks.length === source.length) {
|
9064 |
+
return result;
|
9065 |
+
} // For cases where we have a transform from one block to multiple blocks
|
9066 |
+
// or multiple blocks to one block we apply the styles of the first source block
|
9067 |
+
// to the result(s).
|
9068 |
+
|
9069 |
+
|
9070 |
+
let referenceBlockAttributes = (_source$ = source[0]) === null || _source$ === void 0 ? void 0 : _source$.attributes; // If we are in presence of transform between more than one block in the source
|
9071 |
+
// that has more than one block in the result
|
9072 |
+
// we apply the styles on source N to the result N,
|
9073 |
+
// if source N does not exists we do nothing.
|
9074 |
+
|
9075 |
+
if (results.length > 1 && source.length > 1) {
|
9076 |
+
if (source[index]) {
|
9077 |
+
var _source$index;
|
9078 |
+
|
9079 |
+
referenceBlockAttributes = (_source$index = source[index]) === null || _source$index === void 0 ? void 0 : _source$index.attributes;
|
9080 |
} else {
|
9081 |
+
return result;
|
9082 |
}
|
9083 |
+
}
|
9084 |
|
9085 |
+
let returnBlock = result;
|
9086 |
+
(0,external_lodash_namespaceObject.forEach)(activeSupports, (isActive, support) => {
|
9087 |
+
if (isActive) {
|
9088 |
+
migrationPaths[support].forEach(path => {
|
9089 |
+
const styleValue = (0,external_lodash_namespaceObject.get)(referenceBlockAttributes, path);
|
9090 |
+
|
9091 |
+
if (styleValue) {
|
9092 |
+
returnBlock = { ...returnBlock,
|
9093 |
+
attributes: immutableSet(returnBlock.attributes, path, styleValue)
|
9094 |
+
};
|
9095 |
+
}
|
9096 |
+
});
|
9097 |
+
}
|
9098 |
+
});
|
9099 |
+
return returnBlock;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9100 |
}
|
9101 |
|
9102 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
|
9103 |
|
9104 |
+
|
9105 |
+
/**
|
9106 |
+
* WordPress dependencies
|
9107 |
+
*/
|
9108 |
|
9109 |
|
9110 |
|
9112 |
* Internal dependencies
|
9113 |
*/
|
9114 |
|
9115 |
+
|
9116 |
+
|
9117 |
+
function BlockSupportToolsPanel(_ref) {
|
9118 |
+
let {
|
9119 |
+
children,
|
9120 |
+
group,
|
9121 |
+
label
|
9122 |
+
} = _ref;
|
9123 |
+
const {
|
9124 |
+
updateBlockAttributes
|
9125 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
9126 |
+
const {
|
9127 |
+
getBlockAttributes,
|
9128 |
+
getMultiSelectedBlockClientIds,
|
9129 |
+
getSelectedBlockClientId,
|
9130 |
+
hasMultiSelection
|
9131 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
9132 |
+
const panelId = getSelectedBlockClientId();
|
9133 |
+
const resetAll = (0,external_wp_element_namespaceObject.useCallback)(function () {
|
9134 |
+
let resetFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
9135 |
+
const newAttributes = {};
|
9136 |
+
const clientIds = hasMultiSelection() ? getMultiSelectedBlockClientIds() : [panelId];
|
9137 |
+
clientIds.forEach(clientId => {
|
9138 |
+
const {
|
9139 |
+
style
|
9140 |
+
} = getBlockAttributes(clientId);
|
9141 |
+
let newBlockAttributes = {
|
9142 |
+
style
|
9143 |
+
};
|
9144 |
+
resetFilters.forEach(resetFilter => {
|
9145 |
+
newBlockAttributes = { ...newBlockAttributes,
|
9146 |
+
...resetFilter(newBlockAttributes)
|
9147 |
+
};
|
9148 |
+
}); // Enforce a cleaned style object.
|
9149 |
+
|
9150 |
+
newBlockAttributes = { ...newBlockAttributes,
|
9151 |
+
style: cleanEmptyObject(newBlockAttributes.style)
|
9152 |
+
};
|
9153 |
+
newAttributes[clientId] = newBlockAttributes;
|
9154 |
+
});
|
9155 |
+
updateBlockAttributes(clientIds, newAttributes, true);
|
9156 |
+
}, [cleanEmptyObject, getBlockAttributes, getMultiSelectedBlockClientIds, hasMultiSelection, panelId, updateBlockAttributes]);
|
9157 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
|
9158 |
+
className: `${group}-block-support-panel`,
|
9159 |
+
label: label,
|
9160 |
+
resetAll: resetAll,
|
9161 |
+
key: panelId,
|
9162 |
+
panelId: panelId,
|
9163 |
+
hasInnerWrapper: true,
|
9164 |
+
shouldRenderPlaceholderItems: true // Required to maintain fills ordering.
|
9165 |
+
,
|
9166 |
+
__experimentalFirstVisibleItemClass: "first",
|
9167 |
+
__experimentalLastVisibleItemClass: "last"
|
9168 |
+
}, children);
|
9169 |
}
|
9170 |
+
|
9171 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-slot-container.js
|
9172 |
+
|
9173 |
+
|
9174 |
+
|
9175 |
+
/**
|
9176 |
+
* WordPress dependencies
|
9177 |
+
*/
|
9178 |
+
|
9179 |
+
|
9180 |
+
function BlockSupportSlotContainer(_ref) {
|
9181 |
+
let {
|
9182 |
+
Slot,
|
9183 |
+
...props
|
9184 |
+
} = _ref;
|
9185 |
+
const toolsPanelContext = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext);
|
9186 |
+
return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, {
|
9187 |
+
fillProps: toolsPanelContext,
|
9188 |
+
bubblesVirtually: true
|
9189 |
}));
|
9190 |
}
|
9191 |
|
9192 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/slot.js
|
9193 |
+
|
9194 |
|
9195 |
|
9196 |
/**
|
9198 |
*/
|
9199 |
|
9200 |
|
|
|
9201 |
/**
|
9202 |
* Internal dependencies
|
9203 |
*/
|
9204 |
|
9205 |
|
9206 |
|
|
|
9207 |
|
9208 |
+
function InspectorControlsSlot(_ref) {
|
9209 |
+
var _groups$group;
|
|
|
|
|
|
|
|
|
9210 |
|
9211 |
+
let {
|
9212 |
+
__experimentalGroup: group = 'default',
|
9213 |
+
label,
|
9214 |
+
...props
|
9215 |
+
} = _ref;
|
9216 |
+
const Slot = (_groups$group = inspector_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Slot;
|
9217 |
+
const slot = (0,external_wp_components_namespaceObject.__experimentalUseSlot)(Slot === null || Slot === void 0 ? void 0 : Slot.__unstableName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9218 |
|
9219 |
+
if (!Slot || !slot) {
|
9220 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
|
9221 |
+
return null;
|
9222 |
+
}
|
9223 |
|
9224 |
+
const hasFills = Boolean(slot.fills && slot.fills.length);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9225 |
|
9226 |
+
if (!hasFills) {
|
9227 |
+
return null;
|
9228 |
+
}
|
9229 |
+
|
9230 |
+
if (label) {
|
9231 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockSupportToolsPanel, {
|
9232 |
+
group: group,
|
9233 |
+
label: label
|
9234 |
+
}, (0,external_wp_element_namespaceObject.createElement)(BlockSupportSlotContainer, _extends({}, props, {
|
9235 |
+
Slot: Slot
|
9236 |
+
})));
|
9237 |
+
}
|
9238 |
+
|
9239 |
+
return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, {
|
9240 |
+
bubblesVirtually: true
|
9241 |
+
}));
|
9242 |
+
}
|
9243 |
+
|
9244 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/index.js
|
9245 |
+
|
9246 |
+
|
9247 |
+
|
9248 |
+
/**
|
9249 |
+
* Internal dependencies
|
9250 |
+
*/
|
9251 |
+
|
9252 |
+
|
9253 |
+
const InspectorControls = InspectorControlsFill;
|
9254 |
+
InspectorControls.Slot = InspectorControlsSlot; // This is just here for backward compatibility.
|
9255 |
+
|
9256 |
+
const InspectorAdvancedControls = props => {
|
9257 |
+
return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsFill, _extends({}, props, {
|
9258 |
+
__experimentalGroup: "advanced"
|
9259 |
+
}));
|
9260 |
+
};
|
9261 |
+
|
9262 |
+
InspectorAdvancedControls.Slot = props => {
|
9263 |
+
return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsSlot, _extends({}, props, {
|
9264 |
+
__experimentalGroup: "advanced"
|
9265 |
+
}));
|
9266 |
+
};
|
9267 |
+
|
9268 |
+
InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
|
9269 |
+
/**
|
9270 |
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md
|
9271 |
+
*/
|
9272 |
+
|
9273 |
+
/* harmony default export */ var inspector_controls = (InspectorControls);
|
9274 |
+
|
9275 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/margin.js
|
9276 |
+
|
9277 |
+
|
9278 |
+
/**
|
9279 |
+
* WordPress dependencies
|
9280 |
+
*/
|
9281 |
+
|
9282 |
+
|
9283 |
+
|
9284 |
+
|
9285 |
+
/**
|
9286 |
+
* Internal dependencies
|
9287 |
+
*/
|
9288 |
+
|
9289 |
+
|
9290 |
+
|
9291 |
+
|
9292 |
+
/**
|
9293 |
+
* Determines if there is margin support.
|
9294 |
+
*
|
9295 |
+
* @param {string|Object} blockType Block name or Block Type object.
|
9296 |
+
*
|
9297 |
+
* @return {boolean} Whether there is support.
|
9298 |
+
*/
|
9299 |
+
|
9300 |
+
function hasMarginSupport(blockType) {
|
9301 |
+
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY);
|
9302 |
+
return !!(true === support || support !== null && support !== void 0 && support.margin);
|
9303 |
+
}
|
9304 |
+
/**
|
9305 |
+
* Checks if there is a current value in the margin block support attributes.
|
9306 |
+
*
|
9307 |
+
* @param {Object} props Block props.
|
9308 |
+
* @return {boolean} Whether or not the block has a margin value set.
|
9309 |
+
*/
|
9310 |
+
|
9311 |
+
function hasMarginValue(props) {
|
9312 |
+
var _props$attributes$sty, _props$attributes$sty2;
|
9313 |
+
|
9314 |
+
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.margin) !== undefined;
|
9315 |
+
}
|
9316 |
+
/**
|
9317 |
+
* Resets the margin block support attributes. This can be used when disabling
|
9318 |
+
* the margin support controls for a block via a `ToolsPanel`.
|
9319 |
+
*
|
9320 |
+
* @param {Object} props Block props.
|
9321 |
+
* @param {Object} props.attributes Block's attributes.
|
9322 |
+
* @param {Object} props.setAttributes Function to set block's attributes.
|
9323 |
+
*/
|
9324 |
+
|
9325 |
+
function resetMargin(_ref) {
|
9326 |
+
let {
|
9327 |
+
attributes = {},
|
9328 |
+
setAttributes
|
9329 |
+
} = _ref;
|
9330 |
+
const {
|
9331 |
+
style
|
9332 |
+
} = attributes;
|
9333 |
+
setAttributes({
|
9334 |
+
style: cleanEmptyObject({ ...style,
|
9335 |
+
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
9336 |
+
margin: undefined
|
9337 |
+
}
|
9338 |
+
})
|
9339 |
+
});
|
9340 |
+
}
|
9341 |
+
/**
|
9342 |
+
* Custom hook that checks if margin settings have been disabled.
|
9343 |
+
*
|
9344 |
+
* @param {string} name The name of the block.
|
9345 |
+
*
|
9346 |
+
* @return {boolean} Whether margin setting is disabled.
|
9347 |
+
*/
|
9348 |
+
|
9349 |
+
function useIsMarginDisabled() {
|
9350 |
+
let {
|
9351 |
+
name: blockName
|
9352 |
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9353 |
+
const isDisabled = !useSetting('spacing.margin');
|
9354 |
+
const isInvalid = !useIsDimensionsSupportValid(blockName, 'margin');
|
9355 |
+
return !hasMarginSupport(blockName) || isDisabled || isInvalid;
|
9356 |
+
}
|
9357 |
+
/**
|
9358 |
+
* Inspector control panel containing the margin related configuration
|
9359 |
+
*
|
9360 |
+
* @param {Object} props Block props.
|
9361 |
+
*
|
9362 |
+
* @return {WPElement} Margin edit element.
|
9363 |
+
*/
|
9364 |
+
|
9365 |
+
function MarginEdit(props) {
|
9366 |
+
var _style$spacing;
|
9367 |
+
|
9368 |
+
const {
|
9369 |
+
name: blockName,
|
9370 |
+
attributes: {
|
9371 |
+
style
|
9372 |
+
},
|
9373 |
+
setAttributes
|
9374 |
+
} = props;
|
9375 |
+
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
9376 |
+
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
9377 |
+
});
|
9378 |
+
const sides = useCustomSides(blockName, 'margin');
|
9379 |
+
const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
|
9380 |
+
|
9381 |
+
if (useIsMarginDisabled(props)) {
|
9382 |
+
return null;
|
9383 |
+
}
|
9384 |
+
|
9385 |
+
const onChange = next => {
|
9386 |
+
const newStyle = { ...style,
|
9387 |
+
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
9388 |
+
margin: next
|
9389 |
+
}
|
9390 |
+
};
|
9391 |
+
setAttributes({
|
9392 |
+
style: cleanEmptyObject(newStyle)
|
9393 |
+
});
|
9394 |
+
};
|
9395 |
+
|
9396 |
+
const onChangeShowVisualizer = next => {
|
9397 |
+
const newStyle = { ...style,
|
9398 |
+
visualizers: {
|
9399 |
+
margin: next
|
9400 |
+
}
|
9401 |
+
};
|
9402 |
+
setAttributes({
|
9403 |
+
style: cleanEmptyObject(newStyle)
|
9404 |
+
});
|
9405 |
+
};
|
9406 |
+
|
9407 |
+
return external_wp_element_namespaceObject.Platform.select({
|
9408 |
+
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
9409 |
+
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin,
|
9410 |
+
onChange: onChange,
|
9411 |
+
onChangeShowVisualizer: onChangeShowVisualizer,
|
9412 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
9413 |
+
sides: sides,
|
9414 |
+
units: units,
|
9415 |
+
allowReset: false,
|
9416 |
+
splitOnAxis: splitOnAxis
|
9417 |
+
})),
|
9418 |
+
native: null
|
9419 |
+
});
|
9420 |
+
}
|
9421 |
+
|
9422 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/padding.js
|
9423 |
+
|
9424 |
+
|
9425 |
+
/**
|
9426 |
+
* WordPress dependencies
|
9427 |
+
*/
|
9428 |
+
|
9429 |
+
|
9430 |
+
|
9431 |
+
|
9432 |
+
/**
|
9433 |
+
* Internal dependencies
|
9434 |
+
*/
|
9435 |
+
|
9436 |
+
|
9437 |
+
|
9438 |
+
|
9439 |
+
/**
|
9440 |
+
* Determines if there is padding support.
|
9441 |
+
*
|
9442 |
+
* @param {string|Object} blockType Block name or Block Type object.
|
9443 |
+
*
|
9444 |
+
* @return {boolean} Whether there is support.
|
9445 |
+
*/
|
9446 |
+
|
9447 |
+
function hasPaddingSupport(blockType) {
|
9448 |
+
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY);
|
9449 |
+
return !!(true === support || support !== null && support !== void 0 && support.padding);
|
9450 |
+
}
|
9451 |
+
/**
|
9452 |
+
* Checks if there is a current value in the padding block support attributes.
|
9453 |
+
*
|
9454 |
+
* @param {Object} props Block props.
|
9455 |
+
* @return {boolean} Whether or not the block has a padding value set.
|
9456 |
+
*/
|
9457 |
+
|
9458 |
+
function hasPaddingValue(props) {
|
9459 |
+
var _props$attributes$sty, _props$attributes$sty2;
|
9460 |
+
|
9461 |
+
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.padding) !== undefined;
|
9462 |
+
}
|
9463 |
+
/**
|
9464 |
+
* Resets the padding block support attributes. This can be used when disabling
|
9465 |
+
* the padding support controls for a block via a `ToolsPanel`.
|
9466 |
+
*
|
9467 |
+
* @param {Object} props Block props.
|
9468 |
+
* @param {Object} props.attributes Block's attributes.
|
9469 |
+
* @param {Object} props.setAttributes Function to set block's attributes.
|
9470 |
+
*/
|
9471 |
+
|
9472 |
+
function resetPadding(_ref) {
|
9473 |
+
let {
|
9474 |
+
attributes = {},
|
9475 |
+
setAttributes
|
9476 |
+
} = _ref;
|
9477 |
+
const {
|
9478 |
+
style
|
9479 |
+
} = attributes;
|
9480 |
+
setAttributes({
|
9481 |
+
style: cleanEmptyObject({ ...style,
|
9482 |
+
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
9483 |
+
padding: undefined
|
9484 |
+
}
|
9485 |
+
})
|
9486 |
+
});
|
9487 |
+
}
|
9488 |
+
/**
|
9489 |
+
* Custom hook that checks if padding settings have been disabled.
|
9490 |
+
*
|
9491 |
+
* @param {string} name The name of the block.
|
9492 |
+
*
|
9493 |
+
* @return {boolean} Whether padding setting is disabled.
|
9494 |
+
*/
|
9495 |
+
|
9496 |
+
function useIsPaddingDisabled() {
|
9497 |
+
let {
|
9498 |
+
name: blockName
|
9499 |
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9500 |
+
const isDisabled = !useSetting('spacing.padding');
|
9501 |
+
const isInvalid = !useIsDimensionsSupportValid(blockName, 'padding');
|
9502 |
+
return !hasPaddingSupport(blockName) || isDisabled || isInvalid;
|
9503 |
+
}
|
9504 |
+
/**
|
9505 |
+
* Inspector control panel containing the padding related configuration
|
9506 |
+
*
|
9507 |
+
* @param {Object} props
|
9508 |
+
*
|
9509 |
+
* @return {WPElement} Padding edit element.
|
9510 |
+
*/
|
9511 |
+
|
9512 |
+
function PaddingEdit(props) {
|
9513 |
+
var _style$spacing;
|
9514 |
+
|
9515 |
+
const {
|
9516 |
+
name: blockName,
|
9517 |
+
attributes: {
|
9518 |
+
style
|
9519 |
+
},
|
9520 |
+
setAttributes
|
9521 |
+
} = props;
|
9522 |
+
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
9523 |
+
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
9524 |
+
});
|
9525 |
+
const sides = useCustomSides(blockName, 'padding');
|
9526 |
+
const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
|
9527 |
+
|
9528 |
+
if (useIsPaddingDisabled(props)) {
|
9529 |
+
return null;
|
9530 |
+
}
|
9531 |
+
|
9532 |
+
const onChange = next => {
|
9533 |
+
const newStyle = { ...style,
|
9534 |
+
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
9535 |
+
padding: next
|
9536 |
+
}
|
9537 |
+
};
|
9538 |
+
setAttributes({
|
9539 |
+
style: cleanEmptyObject(newStyle)
|
9540 |
+
});
|
9541 |
+
};
|
9542 |
+
|
9543 |
+
const onChangeShowVisualizer = next => {
|
9544 |
+
const newStyle = { ...style,
|
9545 |
+
visualizers: {
|
9546 |
+
padding: next
|
9547 |
+
}
|
9548 |
+
};
|
9549 |
+
setAttributes({
|
9550 |
+
style: cleanEmptyObject(newStyle)
|
9551 |
+
});
|
9552 |
+
};
|
9553 |
+
|
9554 |
+
return external_wp_element_namespaceObject.Platform.select({
|
9555 |
+
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
9556 |
+
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding,
|
9557 |
+
onChange: onChange,
|
9558 |
+
onChangeShowVisualizer: onChangeShowVisualizer,
|
9559 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
9560 |
+
sides: sides,
|
9561 |
+
units: units,
|
9562 |
+
allowReset: false,
|
9563 |
+
splitOnAxis: splitOnAxis
|
9564 |
+
})),
|
9565 |
+
native: null
|
9566 |
+
});
|
9567 |
+
}
|
9568 |
+
|
9569 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/dimensions.js
|
9570 |
+
|
9571 |
+
|
9572 |
+
/**
|
9573 |
+
* WordPress dependencies
|
9574 |
+
*/
|
9575 |
+
|
9576 |
+
|
9577 |
+
|
9578 |
+
|
9579 |
+
/**
|
9580 |
+
* Internal dependencies
|
9581 |
+
*/
|
9582 |
+
|
9583 |
+
|
9584 |
+
|
9585 |
+
|
9586 |
+
|
9587 |
+
const SPACING_SUPPORT_KEY = 'spacing';
|
9588 |
+
const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
|
9589 |
+
const AXIAL_SIDES = ['vertical', 'horizontal'];
|
9590 |
+
/**
|
9591 |
+
* Inspector controls for dimensions support.
|
9592 |
+
*
|
9593 |
+
* @param {Object} props Block props.
|
9594 |
+
*
|
9595 |
+
* @return {WPElement} Inspector controls for spacing support features.
|
9596 |
+
*/
|
9597 |
+
|
9598 |
+
function DimensionsPanel(props) {
|
9599 |
+
const isGapDisabled = useIsGapDisabled(props);
|
9600 |
+
const isPaddingDisabled = useIsPaddingDisabled(props);
|
9601 |
+
const isMarginDisabled = useIsMarginDisabled(props);
|
9602 |
+
const isDisabled = useIsDimensionsDisabled(props);
|
9603 |
+
const isSupported = hasDimensionsSupport(props.name);
|
9604 |
+
|
9605 |
+
if (isDisabled || !isSupported) {
|
9606 |
+
return null;
|
9607 |
+
}
|
9608 |
+
|
9609 |
+
const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']);
|
9610 |
+
|
9611 |
+
const createResetAllFilter = attribute => newAttributes => {
|
9612 |
+
var _newAttributes$style;
|
9613 |
+
|
9614 |
+
return { ...newAttributes,
|
9615 |
+
style: { ...newAttributes.style,
|
9616 |
+
spacing: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.spacing),
|
9617 |
+
[attribute]: undefined
|
9618 |
+
}
|
9619 |
+
}
|
9620 |
+
};
|
9621 |
+
};
|
9622 |
+
|
9623 |
+
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
9624 |
+
__experimentalGroup: "dimensions"
|
9625 |
+
}, !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
9626 |
+
hasValue: () => hasPaddingValue(props),
|
9627 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
9628 |
+
onDeselect: () => resetPadding(props),
|
9629 |
+
resetAllFilter: createResetAllFilter('padding'),
|
9630 |
+
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding,
|
9631 |
+
panelId: props.clientId
|
9632 |
+
}, (0,external_wp_element_namespaceObject.createElement)(PaddingEdit, props)), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
9633 |
+
hasValue: () => hasMarginValue(props),
|
9634 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
9635 |
+
onDeselect: () => resetMargin(props),
|
9636 |
+
resetAllFilter: createResetAllFilter('margin'),
|
9637 |
+
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.margin,
|
9638 |
+
panelId: props.clientId
|
9639 |
+
}, (0,external_wp_element_namespaceObject.createElement)(MarginEdit, props)), !isGapDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
9640 |
+
hasValue: () => hasGapValue(props),
|
9641 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
9642 |
+
onDeselect: () => resetGap(props),
|
9643 |
+
resetAllFilter: createResetAllFilter('blockGap'),
|
9644 |
+
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap,
|
9645 |
+
panelId: props.clientId
|
9646 |
+
}, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props)));
|
9647 |
+
}
|
9648 |
+
/**
|
9649 |
+
* Determine whether there is dimensions related block support.
|
9650 |
+
*
|
9651 |
+
* @param {string} blockName Block name.
|
9652 |
+
*
|
9653 |
+
* @return {boolean} Whether there is support.
|
9654 |
+
*/
|
9655 |
+
|
9656 |
+
function hasDimensionsSupport(blockName) {
|
9657 |
+
if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
|
9658 |
+
return false;
|
9659 |
+
}
|
9660 |
+
|
9661 |
+
return hasGapSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName);
|
9662 |
+
}
|
9663 |
+
/**
|
9664 |
+
* Determines whether dimensions support has been disabled.
|
9665 |
+
*
|
9666 |
+
* @param {Object} props Block properties.
|
9667 |
+
*
|
9668 |
+
* @return {boolean} If spacing support is completely disabled.
|
9669 |
+
*/
|
9670 |
+
|
9671 |
+
const useIsDimensionsDisabled = function () {
|
9672 |
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9673 |
+
const gapDisabled = useIsGapDisabled(props);
|
9674 |
+
const paddingDisabled = useIsPaddingDisabled(props);
|
9675 |
+
const marginDisabled = useIsMarginDisabled(props);
|
9676 |
+
return gapDisabled && paddingDisabled && marginDisabled;
|
9677 |
+
};
|
9678 |
+
/**
|
9679 |
+
* Custom hook to retrieve which padding/margin is supported
|
9680 |
+
* e.g. top, right, bottom or left.
|
9681 |
+
*
|
9682 |
+
* Sides are opted into by default. It is only if a specific side is set to
|
9683 |
+
* false that it is omitted.
|
9684 |
+
*
|
9685 |
+
* @param {string} blockName Block name.
|
9686 |
+
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
9687 |
+
*
|
9688 |
+
* @return {Object} Sides supporting custom margin.
|
9689 |
+
*/
|
9690 |
+
|
9691 |
+
|
9692 |
+
function useCustomSides(blockName, feature) {
|
9693 |
+
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, SPACING_SUPPORT_KEY); // Skip when setting is boolean as theme isn't setting arbitrary sides.
|
9694 |
+
|
9695 |
+
if (!support || typeof support[feature] === 'boolean') {
|
9696 |
+
return;
|
9697 |
+
}
|
9698 |
+
|
9699 |
+
return support[feature];
|
9700 |
+
}
|
9701 |
+
/**
|
9702 |
+
* Custom hook to determine whether the sides configured in the
|
9703 |
+
* block support are valid. A dimension property cannot declare
|
9704 |
+
* support for a mix of axial and individual sides.
|
9705 |
+
*
|
9706 |
+
* @param {string} blockName Block name.
|
9707 |
+
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
9708 |
+
*
|
9709 |
+
* @return {boolean} If the feature has a valid configuration of sides.
|
9710 |
+
*/
|
9711 |
+
|
9712 |
+
function useIsDimensionsSupportValid(blockName, feature) {
|
9713 |
+
const sides = useCustomSides(blockName, feature);
|
9714 |
+
|
9715 |
+
if (sides && sides.some(side => ALL_SIDES.includes(side)) && sides.some(side => AXIAL_SIDES.includes(side))) {
|
9716 |
+
// eslint-disable-next-line no-console
|
9717 |
+
console.warn(`The ${feature} support for the "${blockName}" block can not be configured to support both axial and arbitrary sides.`);
|
9718 |
+
return false;
|
9719 |
+
}
|
9720 |
+
|
9721 |
+
return true;
|
9722 |
+
}
|
9723 |
+
|
9724 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/gap.js
|
9725 |
+
|
9726 |
+
|
9727 |
+
/**
|
9728 |
+
* WordPress dependencies
|
9729 |
+
*/
|
9730 |
+
|
9731 |
+
|
9732 |
+
|
9733 |
+
|
9734 |
+
/**
|
9735 |
+
* Internal dependencies
|
9736 |
+
*/
|
9737 |
+
|
9738 |
+
|
9739 |
+
|
9740 |
+
|
9741 |
+
|
9742 |
+
/**
|
9743 |
+
* Determines if there is gap support.
|
9744 |
+
*
|
9745 |
+
* @param {string|Object} blockType Block name or Block Type object.
|
9746 |
+
* @return {boolean} Whether there is support.
|
9747 |
+
*/
|
9748 |
+
|
9749 |
+
function hasGapSupport(blockType) {
|
9750 |
+
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, SPACING_SUPPORT_KEY);
|
9751 |
+
return !!(true === support || support !== null && support !== void 0 && support.blockGap);
|
9752 |
+
}
|
9753 |
+
/**
|
9754 |
+
* Checks if there is a current value in the gap block support attributes.
|
9755 |
+
*
|
9756 |
+
* @param {Object} props Block props.
|
9757 |
+
* @return {boolean} Whether or not the block has a gap value set.
|
9758 |
+
*/
|
9759 |
+
|
9760 |
+
function hasGapValue(props) {
|
9761 |
+
var _props$attributes$sty, _props$attributes$sty2;
|
9762 |
+
|
9763 |
+
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.spacing) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.blockGap) !== undefined;
|
9764 |
+
}
|
9765 |
+
/**
|
9766 |
+
* Returns a BoxControl object value from a given blockGap style.
|
9767 |
+
* The string check is for backwards compatibility before Gutenberg supported
|
9768 |
+
* split gap values (row and column) and the value was a string n + unit.
|
9769 |
+
*
|
9770 |
+
* @param {string? | Object?} rawBlockGapValue A style object.
|
9771 |
+
* @return {Object?} A value to pass to the BoxControl component.
|
9772 |
+
*/
|
9773 |
+
|
9774 |
+
function getGapValueFromStyle(rawBlockGapValue) {
|
9775 |
+
if (!rawBlockGapValue) {
|
9776 |
+
return rawBlockGapValue;
|
9777 |
+
}
|
9778 |
+
|
9779 |
+
const isValueString = typeof rawBlockGapValue === 'string';
|
9780 |
+
return {
|
9781 |
+
top: isValueString ? rawBlockGapValue : rawBlockGapValue === null || rawBlockGapValue === void 0 ? void 0 : rawBlockGapValue.top,
|
9782 |
+
left: isValueString ? rawBlockGapValue : rawBlockGapValue === null || rawBlockGapValue === void 0 ? void 0 : rawBlockGapValue.left
|
9783 |
+
};
|
9784 |
+
}
|
9785 |
+
/**
|
9786 |
+
* Returns a CSS value for the `gap` property from a given blockGap style.
|
9787 |
+
*
|
9788 |
+
* @param {string? | Object?} blockGapValue A style object.
|
9789 |
+
* @param {string?} defaultValue A default gap value.
|
9790 |
+
* @return {string|null} The concatenated gap value (row and column).
|
9791 |
+
*/
|
9792 |
+
|
9793 |
+
function getGapCSSValue(blockGapValue) {
|
9794 |
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
|
9795 |
+
const blockGapBoxControlValue = getGapValueFromStyle(blockGapValue);
|
9796 |
+
|
9797 |
+
if (!blockGapBoxControlValue) {
|
9798 |
+
return null;
|
9799 |
+
}
|
9800 |
+
|
9801 |
+
const row = (blockGapBoxControlValue === null || blockGapBoxControlValue === void 0 ? void 0 : blockGapBoxControlValue.top) || defaultValue;
|
9802 |
+
const column = (blockGapBoxControlValue === null || blockGapBoxControlValue === void 0 ? void 0 : blockGapBoxControlValue.left) || defaultValue;
|
9803 |
+
return row === column ? row : `${row} ${column}`;
|
9804 |
+
}
|
9805 |
+
/**
|
9806 |
+
* Resets the gap block support attribute. This can be used when disabling
|
9807 |
+
* the gap support controls for a block via a progressive discovery panel.
|
9808 |
+
*
|
9809 |
+
* @param {Object} props Block props.
|
9810 |
+
* @param {Object} props.attributes Block's attributes.
|
9811 |
+
* @param {Object} props.setAttributes Function to set block's attributes.
|
9812 |
+
*/
|
9813 |
+
|
9814 |
+
function resetGap(_ref) {
|
9815 |
+
let {
|
9816 |
+
attributes = {},
|
9817 |
+
setAttributes
|
9818 |
+
} = _ref;
|
9819 |
+
const {
|
9820 |
+
style
|
9821 |
+
} = attributes;
|
9822 |
+
setAttributes({
|
9823 |
+
style: { ...style,
|
9824 |
+
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
9825 |
+
blockGap: undefined
|
9826 |
+
}
|
9827 |
+
}
|
9828 |
+
});
|
9829 |
+
}
|
9830 |
+
/**
|
9831 |
+
* Custom hook that checks if gap settings have been disabled.
|
9832 |
+
*
|
9833 |
+
* @param {string} name The name of the block.
|
9834 |
+
* @return {boolean} Whether the gap setting is disabled.
|
9835 |
+
*/
|
9836 |
+
|
9837 |
+
function useIsGapDisabled() {
|
9838 |
+
let {
|
9839 |
+
name: blockName
|
9840 |
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9841 |
+
const isDisabled = !useSetting('spacing.blockGap');
|
9842 |
+
return !hasGapSupport(blockName) || isDisabled;
|
9843 |
+
}
|
9844 |
+
/**
|
9845 |
+
* Inspector control panel containing the gap related configuration
|
9846 |
+
*
|
9847 |
+
* @param {Object} props
|
9848 |
+
*
|
9849 |
+
* @return {WPElement} Gap edit element.
|
9850 |
+
*/
|
9851 |
+
|
9852 |
+
function GapEdit(props) {
|
9853 |
+
var _style$spacing;
|
9854 |
+
|
9855 |
+
const {
|
9856 |
+
clientId,
|
9857 |
+
attributes: {
|
9858 |
+
style
|
9859 |
+
},
|
9860 |
+
name: blockName,
|
9861 |
+
setAttributes
|
9862 |
+
} = props;
|
9863 |
+
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
9864 |
+
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
9865 |
+
});
|
9866 |
+
const sides = useCustomSides(blockName, 'blockGap');
|
9867 |
+
const ref = useBlockRef(clientId);
|
9868 |
+
|
9869 |
+
if (useIsGapDisabled(props)) {
|
9870 |
+
return null;
|
9871 |
+
}
|
9872 |
+
|
9873 |
+
const onChange = next => {
|
9874 |
+
var _window;
|
9875 |
+
|
9876 |
+
const newStyle = { ...style,
|
9877 |
+
spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
|
9878 |
+
blockGap: { ...getGapValueFromStyle(next)
|
9879 |
+
}
|
9880 |
+
}
|
9881 |
+
};
|
9882 |
+
setAttributes({
|
9883 |
+
style: cleanEmptyObject(newStyle)
|
9884 |
+
}); // In Safari, changing the `gap` CSS value on its own will not trigger the layout
|
9885 |
+
// to be recalculated / re-rendered. To force the updated gap to re-render, here
|
9886 |
+
// we replace the block's node with itself.
|
9887 |
+
|
9888 |
+
const isSafari = ((_window = window) === null || _window === void 0 ? void 0 : _window.navigator.userAgent) && window.navigator.userAgent.includes('Safari') && !window.navigator.userAgent.includes('Chrome ') && !window.navigator.userAgent.includes('Chromium ');
|
9889 |
+
|
9890 |
+
if (ref.current && isSafari) {
|
9891 |
+
var _ref$current$parentNo;
|
9892 |
+
|
9893 |
+
(_ref$current$parentNo = ref.current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.replaceChild(ref.current, ref.current);
|
9894 |
+
}
|
9895 |
+
};
|
9896 |
+
|
9897 |
+
const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
|
9898 |
+
const gapValue = getGapValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // The BoxControl component expects a full complement of side values.
|
9899 |
+
// Gap row and column values translate to top/bottom and left/right respectively.
|
9900 |
+
|
9901 |
+
const boxControlGapValue = splitOnAxis ? { ...gapValue,
|
9902 |
+
right: gapValue === null || gapValue === void 0 ? void 0 : gapValue.left,
|
9903 |
+
bottom: gapValue === null || gapValue === void 0 ? void 0 : gapValue.top
|
9904 |
+
} : gapValue === null || gapValue === void 0 ? void 0 : gapValue.top;
|
9905 |
+
return external_wp_element_namespaceObject.Platform.select({
|
9906 |
+
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, splitOnAxis ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
9907 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
9908 |
+
min: 0,
|
9909 |
+
onChange: onChange,
|
9910 |
+
units: units,
|
9911 |
+
sides: sides,
|
9912 |
+
values: boxControlGapValue,
|
9913 |
+
allowReset: false,
|
9914 |
+
splitOnAxis: splitOnAxis
|
9915 |
+
}) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
9916 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
9917 |
+
__unstableInputWidth: "80px",
|
9918 |
+
min: 0,
|
9919 |
+
onChange: onChange,
|
9920 |
+
units: units // Default to `row` for combined values.
|
9921 |
+
,
|
9922 |
+
value: boxControlGapValue
|
9923 |
+
})),
|
9924 |
+
native: null
|
9925 |
+
});
|
9926 |
+
}
|
9927 |
+
|
9928 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/justify-content-control/ui.js
|
9929 |
+
|
9930 |
+
|
9931 |
+
|
9932 |
+
/**
|
9933 |
+
* WordPress dependencies
|
9934 |
+
*/
|
9935 |
+
|
9936 |
+
|
9937 |
+
|
9938 |
+
const icons = {
|
9939 |
+
left: justify_left,
|
9940 |
+
center: justify_center,
|
9941 |
+
right: justify_right,
|
9942 |
+
'space-between': justify_space_between
|
9943 |
+
};
|
9944 |
+
|
9945 |
+
function JustifyContentUI(_ref) {
|
9946 |
+
let {
|
9947 |
+
allowedControls = ['left', 'center', 'right', 'space-between'],
|
9948 |
+
isCollapsed = true,
|
9949 |
+
onChange,
|
9950 |
+
value,
|
9951 |
+
popoverProps,
|
9952 |
+
isToolbar
|
9953 |
+
} = _ref;
|
9954 |
+
|
9955 |
+
// If the control is already selected we want a click
|
9956 |
+
// again on the control to deselect the item, so we
|
9957 |
+
// call onChange( undefined )
|
9958 |
+
const handleClick = next => {
|
9959 |
+
if (next === value) {
|
9960 |
+
onChange(undefined);
|
9961 |
+
} else {
|
9962 |
+
onChange(next);
|
9963 |
+
}
|
9964 |
+
};
|
9965 |
+
|
9966 |
+
const icon = value ? icons[value] : icons.left;
|
9967 |
+
const allControls = [{
|
9968 |
+
name: 'left',
|
9969 |
+
icon: justify_left,
|
9970 |
+
title: (0,external_wp_i18n_namespaceObject.__)('Justify items left'),
|
9971 |
+
isActive: 'left' === value,
|
9972 |
+
onClick: () => handleClick('left')
|
9973 |
+
}, {
|
9974 |
+
name: 'center',
|
9975 |
+
icon: justify_center,
|
9976 |
+
title: (0,external_wp_i18n_namespaceObject.__)('Justify items center'),
|
9977 |
+
isActive: 'center' === value,
|
9978 |
+
onClick: () => handleClick('center')
|
9979 |
+
}, {
|
9980 |
+
name: 'right',
|
9981 |
+
icon: justify_right,
|
9982 |
+
title: (0,external_wp_i18n_namespaceObject.__)('Justify items right'),
|
9983 |
+
isActive: 'right' === value,
|
9984 |
+
onClick: () => handleClick('right')
|
9985 |
+
}, {
|
9986 |
+
name: 'space-between',
|
9987 |
+
icon: justify_space_between,
|
9988 |
+
title: (0,external_wp_i18n_namespaceObject.__)('Space between items'),
|
9989 |
+
isActive: 'space-between' === value,
|
9990 |
+
onClick: () => handleClick('space-between')
|
9991 |
+
}];
|
9992 |
+
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
|
9993 |
+
const extraProps = isToolbar ? {
|
9994 |
+
isCollapsed
|
9995 |
+
} : {};
|
9996 |
+
return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({
|
9997 |
+
icon: icon,
|
9998 |
+
popoverProps: popoverProps,
|
9999 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Change items justification'),
|
10000 |
+
controls: allControls.filter(elem => allowedControls.includes(elem.name))
|
10001 |
+
}, extraProps));
|
10002 |
+
}
|
10003 |
+
|
10004 |
+
/* harmony default export */ var ui = (JustifyContentUI);
|
10005 |
+
|
10006 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/justify-content-control/index.js
|
10007 |
+
|
10008 |
+
|
10009 |
+
|
10010 |
+
/**
|
10011 |
+
* Internal dependencies
|
10012 |
+
*/
|
10013 |
+
|
10014 |
+
function JustifyContentControl(props) {
|
10015 |
+
return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, {
|
10016 |
+
isToolbar: false
|
10017 |
+
}));
|
10018 |
+
}
|
10019 |
+
function JustifyToolbar(props) {
|
10020 |
+
return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, {
|
10021 |
+
isToolbar: true
|
10022 |
+
}));
|
10023 |
+
}
|
10024 |
+
|
10025 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/flex.js
|
10026 |
+
|
10027 |
+
|
10028 |
+
/**
|
10029 |
+
* WordPress dependencies
|
10030 |
+
*/
|
10031 |
+
|
10032 |
+
|
10033 |
+
|
10034 |
+
/**
|
10035 |
+
* Internal dependencies
|
10036 |
+
*/
|
10037 |
+
|
10038 |
+
|
10039 |
+
|
10040 |
+
|
10041 |
+
// Used with the default, horizontal flex orientation.
|
10042 |
+
|
10043 |
+
const justifyContentMap = {
|
10044 |
+
left: 'flex-start',
|
10045 |
+
right: 'flex-end',
|
10046 |
+
center: 'center',
|
10047 |
+
'space-between': 'space-between'
|
10048 |
+
}; // Used with the vertical (column) flex orientation.
|
10049 |
+
|
10050 |
+
const alignItemsMap = {
|
10051 |
+
left: 'flex-start',
|
10052 |
+
right: 'flex-end',
|
10053 |
+
center: 'center'
|
10054 |
+
};
|
10055 |
+
const flexWrapOptions = ['wrap', 'nowrap'];
|
10056 |
+
/* harmony default export */ var flex = ({
|
10057 |
+
name: 'flex',
|
10058 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Flex'),
|
10059 |
+
inspectorControls: function FlexLayoutInspectorControls(_ref) {
|
10060 |
+
let {
|
10061 |
+
layout = {},
|
10062 |
+
onChange,
|
10063 |
+
layoutBlockSupport = {}
|
10064 |
+
} = _ref;
|
10065 |
+
const {
|
10066 |
+
allowOrientation = true
|
10067 |
+
} = layoutBlockSupport;
|
10068 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(FlexLayoutJustifyContentControl, {
|
10069 |
+
layout: layout,
|
10070 |
+
onChange: onChange
|
10071 |
+
})), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, allowOrientation && (0,external_wp_element_namespaceObject.createElement)(OrientationControl, {
|
10072 |
+
layout: layout,
|
10073 |
+
onChange: onChange
|
10074 |
+
}))), (0,external_wp_element_namespaceObject.createElement)(FlexWrapControl, {
|
10075 |
+
layout: layout,
|
10076 |
+
onChange: onChange
|
10077 |
+
}));
|
10078 |
+
},
|
10079 |
+
toolBarControls: function FlexLayoutToolbarControls(_ref2) {
|
10080 |
+
let {
|
10081 |
+
layout = {},
|
10082 |
+
onChange,
|
10083 |
+
layoutBlockSupport
|
10084 |
+
} = _ref2;
|
10085 |
+
|
10086 |
+
if (layoutBlockSupport !== null && layoutBlockSupport !== void 0 && layoutBlockSupport.allowSwitching) {
|
10087 |
+
return null;
|
10088 |
+
}
|
10089 |
+
|
10090 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_controls, {
|
10091 |
+
group: "block",
|
10092 |
+
__experimentalShareWithChildBlocks: true
|
10093 |
+
}, (0,external_wp_element_namespaceObject.createElement)(FlexLayoutJustifyContentControl, {
|
10094 |
+
layout: layout,
|
10095 |
+
onChange: onChange,
|
10096 |
+
isToolbar: true
|
10097 |
+
}));
|
10098 |
+
},
|
10099 |
+
save: function FlexLayoutStyle(_ref3) {
|
10100 |
+
var _getGapCSSValue, _style$spacing;
|
10101 |
+
|
10102 |
+
let {
|
10103 |
+
selector,
|
10104 |
+
layout,
|
10105 |
+
style
|
10106 |
+
} = _ref3;
|
10107 |
+
const {
|
10108 |
orientation = 'horizontal'
|
10109 |
} = layout;
|
10110 |
const blockGapSupport = useSetting('spacing.blockGap');
|
10111 |
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
10112 |
+
const blockGapValue = (_getGapCSSValue = getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap, '0.5em')) !== null && _getGapCSSValue !== void 0 ? _getGapCSSValue : 'var( --wp--style--block-gap, 0.5em )';
|
10113 |
const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
|
10114 |
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
10115 |
const rowOrientation = `
|
10125 |
return (0,external_wp_element_namespaceObject.createElement)("style", null, `
|
10126 |
${appendSelectors(selector)} {
|
10127 |
display: flex;
|
|
|
10128 |
flex-wrap: ${flexWrap};
|
10129 |
+
gap: ${hasBlockGapStylesSupport ? blockGapValue : '0.5em'};
|
10130 |
${orientation === 'horizontal' ? rowOrientation : columnOrientation}
|
10131 |
}
|
10132 |
|
10317 |
|
10318 |
|
10319 |
|
10320 |
+
|
10321 |
/* harmony default export */ var flow = ({
|
10322 |
name: 'default',
|
10323 |
label: (0,external_wp_i18n_namespaceObject.__)('Flow'),
|
10386 |
return null;
|
10387 |
},
|
10388 |
save: function DefaultLayoutStyle(_ref2) {
|
10389 |
+
var _style$spacing, _blockGapStyleValue$t;
|
10390 |
|
10391 |
let {
|
10392 |
selector,
|
10399 |
} = layout;
|
10400 |
const blockGapSupport = useSetting('spacing.blockGap');
|
10401 |
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
10402 |
+
const blockGapStyleValue = getGapValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap);
|
10403 |
+
const blockGapValue = (_blockGapStyleValue$t = blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top) !== null && _blockGapStyleValue$t !== void 0 ? _blockGapStyleValue$t : 'var( --wp--style--block-gap )';
|
10404 |
let output = !!contentSize || !!wideSize ? `
|
10405 |
${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
|
10406 |
max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
|
10407 |
margin-left: auto !important;
|
10408 |
margin-right: auto !important;
|
10409 |
}
|
|
|
10410 |
${appendSelectors(selector, '> .alignwide')} {
|
10411 |
max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize};
|
10412 |
}
|
|
|
10413 |
${appendSelectors(selector, '> .alignfull')} {
|
10414 |
max-width: none;
|
10415 |
}
|
10417 |
output += `
|
10418 |
${appendSelectors(selector, '> .alignleft')} {
|
10419 |
float: left;
|
10420 |
+
margin-inline-start: 0;
|
10421 |
+
margin-inline-end: 2em;
|
10422 |
}
|
|
|
10423 |
${appendSelectors(selector, '> .alignright')} {
|
10424 |
float: right;
|
10425 |
+
margin-inline-start: 2em;
|
10426 |
+
margin-inline-end: 0;
|
10427 |
}
|
10428 |
|
10429 |
+
${appendSelectors(selector, '> .aligncenter')} {
|
10430 |
+
margin-left: auto !important;
|
10431 |
+
margin-right: auto !important;
|
10432 |
+
}
|
10433 |
`;
|
10434 |
|
10435 |
if (hasBlockGapStylesSupport) {
|
10436 |
output += `
|
10437 |
${appendSelectors(selector, '> *')} {
|
10438 |
+
margin-block-start: 0;
|
10439 |
+
margin-block-end: 0;
|
10440 |
}
|
10441 |
${appendSelectors(selector, '> * + *')} {
|
10442 |
+
margin-block-start: ${blockGapValue};
|
10443 |
}
|
10444 |
`;
|
10445 |
}
|
11092 |
}
|
11093 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute);
|
11094 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11095 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/anchor.js
|
11096 |
|
11097 |
|
11121 |
*/
|
11122 |
|
11123 |
const ANCHOR_REGEX = /[\s#]/g;
|
11124 |
+
const ANCHOR_SCHEMA = {
|
11125 |
+
type: 'string',
|
11126 |
+
source: 'attribute',
|
11127 |
+
attribute: 'id',
|
11128 |
+
selector: '*'
|
11129 |
+
};
|
11130 |
/**
|
11131 |
* Filters registered block settings, extending attributes with anchor using ID
|
11132 |
* of the first node.
|
11145 |
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'anchor')) {
|
11146 |
// Gracefully handle if settings.attributes is undefined.
|
11147 |
settings.attributes = { ...settings.attributes,
|
11148 |
+
anchor: ANCHOR_SCHEMA
|
|
|
|
|
|
|
|
|
|
|
11149 |
};
|
11150 |
}
|
11151 |
|
12052 |
const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(blockType, html, block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error
|
12053 |
|
12054 |
const content = html ? html : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes);
|
12055 |
+
const [isValid] = html ? (0,external_wp_blocks_namespaceObject.validateBlock)({ ...block,
|
12056 |
+
attributes,
|
12057 |
+
originalContent: content
|
12058 |
+
}) : [true];
|
12059 |
updateBlock(clientId, {
|
12060 |
attributes,
|
12061 |
originalContent: content,
|
16564 |
return getSelectedBlocksInitialCaretPosition();
|
16565 |
}, [clientId]);
|
16566 |
}
|
16567 |
+
|
16568 |
+
function isFormElement(element) {
|
16569 |
+
const {
|
16570 |
+
tagName
|
16571 |
+
} = element;
|
16572 |
+
return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA';
|
16573 |
+
}
|
16574 |
/**
|
16575 |
* Transitions focus to the block or inner tabbable when the block becomes
|
16576 |
* selected and an initial position is set.
|
16611 |
if (!isInsideRootBlock(ref.current, target)) {
|
16612 |
ref.current.focus();
|
16613 |
return;
|
16614 |
+
} // Check to see if element is focussable before a generic caret insert.
|
16615 |
+
|
16616 |
+
|
16617 |
+
if (!target.getAttribute('contenteditable')) {
|
16618 |
+
const focusElement = external_wp_dom_namespaceObject.focus.tabbable.findNext(target); // Make sure focusElement is valid, form field, and within the current target element.
|
16619 |
+
// Ensure is not block inserter trigger, don't want to focus that in the event of the group block which doesn't contain any other focussable elements.
|
16620 |
+
|
16621 |
+
if (focusElement && isFormElement(focusElement) && target.contains(focusElement) && !focusElement.classList.contains('block-editor-button-block-appender')) {
|
16622 |
+
focusElement.focus();
|
16623 |
+
return;
|
16624 |
+
}
|
16625 |
}
|
16626 |
|
16627 |
setContentEditableWrapper(ref.current, false);
|
17142 |
return ref;
|
17143 |
}
|
17144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17145 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js
|
17146 |
/**
|
17147 |
* WordPress dependencies
|
17386 |
var _wrapperProps;
|
17387 |
|
17388 |
let {
|
17389 |
+
block: {
|
17390 |
+
__unstableBlockSource
|
17391 |
+
},
|
17392 |
mode,
|
17393 |
isLocked,
|
17394 |
canRemove,
|
17458 |
let block;
|
17459 |
|
17460 |
if (!isValid) {
|
17461 |
+
const saveContent = __unstableBlockSource ? (0,external_wp_blocks_namespaceObject.serializeRawBlock)(__unstableBlockSource) : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes);
|
17462 |
block = (0,external_wp_element_namespaceObject.createElement)(Block, {
|
17463 |
className: "has-warning"
|
17464 |
}, (0,external_wp_element_namespaceObject.createElement)(block_invalid_warning, {
|
18374 |
|
18375 |
|
18376 |
|
18377 |
+
function use_tab_nav_isFormElement(element) {
|
18378 |
const {
|
18379 |
tagName
|
18380 |
} = element;
|
18470 |
// future they can be rendered in an iframe or shadow DOM.
|
18471 |
|
18472 |
|
18473 |
+
if ((use_tab_nav_isFormElement(event.target) || event.target.getAttribute('data-block') === getSelectedBlockClientId()) && use_tab_nav_isFormElement(external_wp_dom_namespaceObject.focus.tabbable[direction](event.target))) {
|
18474 |
return;
|
18475 |
}
|
18476 |
|
24536 |
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
|
24537 |
const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : null;
|
24538 |
const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current
|
24539 |
+
// label context. If the label is defined we prioritize it over a
|
24540 |
// possible block variation title match.
|
24541 |
|
24542 |
+
const blockTitle = label && label !== blockType.title ? label : blockInformation.title;
|
24543 |
+
|
24544 |
+
if (maximumLength && maximumLength > 0) {
|
24545 |
+
return (0,external_lodash_namespaceObject.truncate)(blockTitle, {
|
24546 |
length: maximumLength
|
24547 |
+
});
|
24548 |
}
|
24549 |
|
24550 |
+
return blockTitle;
|
24551 |
}
|
24552 |
|
24553 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-title/index.js
|
27503 |
};
|
27504 |
}
|
27505 |
|
27506 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/unlock.js
|
27507 |
+
|
27508 |
+
|
27509 |
+
/**
|
27510 |
+
* WordPress dependencies
|
27511 |
+
*/
|
27512 |
+
|
27513 |
+
const unlock = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
27514 |
+
viewBox: "0 0 24 24",
|
27515 |
+
xmlns: "http://www.w3.org/2000/svg"
|
27516 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
27517 |
+
d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"
|
27518 |
+
}));
|
27519 |
+
/* harmony default export */ var library_unlock = (unlock);
|
27520 |
+
|
27521 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/lock.js
|
27522 |
+
|
27523 |
+
|
27524 |
+
/**
|
27525 |
+
* WordPress dependencies
|
27526 |
+
*/
|
27527 |
+
|
27528 |
+
const lock = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
27529 |
+
viewBox: "0 0 24 24",
|
27530 |
+
xmlns: "http://www.w3.org/2000/svg"
|
27531 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
27532 |
+
d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"
|
27533 |
+
}));
|
27534 |
+
/* harmony default export */ var library_lock = (lock);
|
27535 |
+
|
27536 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/trash.js
|
27537 |
+
|
27538 |
+
|
27539 |
+
/**
|
27540 |
+
* WordPress dependencies
|
27541 |
+
*/
|
27542 |
+
|
27543 |
+
const trash = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
27544 |
+
xmlns: "http://www.w3.org/2000/svg",
|
27545 |
+
viewBox: "0 0 24 24"
|
27546 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
27547 |
+
d: "M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"
|
27548 |
+
}));
|
27549 |
+
/* harmony default export */ var library_trash = (trash);
|
27550 |
+
|
27551 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/modal.js
|
27552 |
+
|
27553 |
+
|
27554 |
+
/**
|
27555 |
+
* WordPress dependencies
|
27556 |
+
*/
|
27557 |
+
|
27558 |
+
|
27559 |
+
|
27560 |
+
|
27561 |
+
|
27562 |
+
|
27563 |
+
/**
|
27564 |
+
* Internal dependencies
|
27565 |
+
*/
|
27566 |
+
|
27567 |
+
|
27568 |
+
|
27569 |
+
function BlockLockModal(_ref) {
|
27570 |
+
let {
|
27571 |
+
clientId,
|
27572 |
+
onClose
|
27573 |
+
} = _ref;
|
27574 |
+
const [lock, setLock] = (0,external_wp_element_namespaceObject.useState)({
|
27575 |
+
move: false,
|
27576 |
+
remove: false
|
27577 |
+
});
|
27578 |
+
const {
|
27579 |
+
canMove,
|
27580 |
+
canRemove
|
27581 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
27582 |
+
const {
|
27583 |
+
canMoveBlock,
|
27584 |
+
canRemoveBlock,
|
27585 |
+
getBlockRootClientId
|
27586 |
+
} = select(store);
|
27587 |
+
const rootClientId = getBlockRootClientId(clientId);
|
27588 |
+
return {
|
27589 |
+
canMove: canMoveBlock(clientId, rootClientId),
|
27590 |
+
canRemove: canRemoveBlock(clientId, rootClientId)
|
27591 |
+
};
|
27592 |
+
}, [clientId]);
|
27593 |
+
const {
|
27594 |
+
updateBlockAttributes
|
27595 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
27596 |
+
const blockInformation = useBlockDisplayInformation(clientId);
|
27597 |
+
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockLockModal, 'block-editor-block-lock-modal__options-title');
|
27598 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
27599 |
+
setLock({
|
27600 |
+
move: !canMove,
|
27601 |
+
remove: !canRemove
|
27602 |
+
});
|
27603 |
+
}, [canMove, canRemove]);
|
27604 |
+
const isAllChecked = Object.values(lock).every(Boolean);
|
27605 |
+
let ariaChecked;
|
27606 |
+
|
27607 |
+
if (isAllChecked) {
|
27608 |
+
ariaChecked = 'true';
|
27609 |
+
} else if (Object.values(lock).some(Boolean)) {
|
27610 |
+
ariaChecked = 'mixed';
|
27611 |
+
} else {
|
27612 |
+
ariaChecked = 'false';
|
27613 |
+
}
|
27614 |
+
|
27615 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
|
27616 |
+
title: (0,external_wp_i18n_namespaceObject.sprintf)(
|
27617 |
+
/* translators: %s: Name of the block. */
|
27618 |
+
(0,external_wp_i18n_namespaceObject.__)('Lock %s'), blockInformation.title),
|
27619 |
+
overlayClassName: "block-editor-block-lock-modal",
|
27620 |
+
closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
|
27621 |
+
onRequestClose: onClose
|
27622 |
+
}, (0,external_wp_element_namespaceObject.createElement)("form", {
|
27623 |
+
onSubmit: event => {
|
27624 |
+
event.preventDefault();
|
27625 |
+
updateBlockAttributes([clientId], {
|
27626 |
+
lock
|
27627 |
+
});
|
27628 |
+
onClose();
|
27629 |
+
}
|
27630 |
+
}, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Choose specific attributes to restrict or lock all available options.')), (0,external_wp_element_namespaceObject.createElement)("div", {
|
27631 |
+
role: "group",
|
27632 |
+
"aria-labelledby": instanceId,
|
27633 |
+
className: "block-editor-block-lock-modal__options"
|
27634 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
27635 |
+
className: "block-editor-block-lock-modal__options-title",
|
27636 |
+
label: (0,external_wp_element_namespaceObject.createElement)("span", {
|
27637 |
+
id: instanceId
|
27638 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Lock all')),
|
27639 |
+
checked: isAllChecked,
|
27640 |
+
"aria-checked": ariaChecked,
|
27641 |
+
onChange: newValue => setLock({
|
27642 |
+
move: newValue,
|
27643 |
+
remove: newValue
|
27644 |
+
})
|
27645 |
+
}), (0,external_wp_element_namespaceObject.createElement)("ul", {
|
27646 |
+
className: "block-editor-block-lock-modal__checklist"
|
27647 |
+
}, (0,external_wp_element_namespaceObject.createElement)("li", {
|
27648 |
+
className: "block-editor-block-lock-modal__checklist-item"
|
27649 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
27650 |
+
label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Disable movement'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
27651 |
+
icon: drag_handle
|
27652 |
+
})),
|
27653 |
+
checked: lock.move,
|
27654 |
+
onChange: move => setLock(prevLock => ({ ...prevLock,
|
27655 |
+
move
|
27656 |
+
}))
|
27657 |
+
})), (0,external_wp_element_namespaceObject.createElement)("li", {
|
27658 |
+
className: "block-editor-block-lock-modal__checklist-item"
|
27659 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
27660 |
+
label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Prevent removal'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
27661 |
+
icon: library_trash
|
27662 |
+
})),
|
27663 |
+
checked: lock.remove,
|
27664 |
+
onChange: remove => setLock(prevLock => ({ ...prevLock,
|
27665 |
+
remove
|
27666 |
+
}))
|
27667 |
+
})))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
|
27668 |
+
className: "block-editor-block-lock-modal__actions",
|
27669 |
+
justify: "flex-end",
|
27670 |
+
expanded: false
|
27671 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
27672 |
+
variant: "tertiary",
|
27673 |
+
onClick: onClose
|
27674 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
27675 |
+
variant: "primary",
|
27676 |
+
type: "submit"
|
27677 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Apply'))))));
|
27678 |
+
}
|
27679 |
+
|
27680 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/menu-item.js
|
27681 |
+
|
27682 |
+
|
27683 |
+
/**
|
27684 |
+
* WordPress dependencies
|
27685 |
+
*/
|
27686 |
+
|
27687 |
+
|
27688 |
+
|
27689 |
+
|
27690 |
+
|
27691 |
+
/**
|
27692 |
+
* Internal dependencies
|
27693 |
+
*/
|
27694 |
+
|
27695 |
+
|
27696 |
+
|
27697 |
+
function BlockLockMenuItem(_ref) {
|
27698 |
+
let {
|
27699 |
+
clientId
|
27700 |
+
} = _ref;
|
27701 |
+
const {
|
27702 |
+
canLockBlock,
|
27703 |
+
isLocked
|
27704 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
27705 |
+
const {
|
27706 |
+
canMoveBlock,
|
27707 |
+
canRemoveBlock,
|
27708 |
+
canLockBlockType,
|
27709 |
+
getBlockName,
|
27710 |
+
getBlockRootClientId
|
27711 |
+
} = select(store);
|
27712 |
+
const rootClientId = getBlockRootClientId(clientId);
|
27713 |
+
return {
|
27714 |
+
canLockBlock: canLockBlockType(getBlockName(clientId)),
|
27715 |
+
isLocked: !canMoveBlock(clientId, rootClientId) || !canRemoveBlock(clientId, rootClientId)
|
27716 |
+
};
|
27717 |
+
}, [clientId]);
|
27718 |
+
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
|
27719 |
+
|
27720 |
+
if (!canLockBlock) {
|
27721 |
+
return null;
|
27722 |
+
}
|
27723 |
+
|
27724 |
+
const label = isLocked ? (0,external_wp_i18n_namespaceObject.__)('Unlock') : (0,external_wp_i18n_namespaceObject.__)('Lock');
|
27725 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
27726 |
+
icon: isLocked ? library_unlock : library_lock,
|
27727 |
+
onClick: toggleModal
|
27728 |
+
}, label), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(BlockLockModal, {
|
27729 |
+
clientId: clientId,
|
27730 |
+
onClose: toggleModal
|
27731 |
+
}));
|
27732 |
+
}
|
27733 |
+
|
27734 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-settings-menu-controls/index.js
|
27735 |
|
27736 |
|
27751 |
|
27752 |
|
27753 |
|
27754 |
+
|
27755 |
const {
|
27756 |
Fill,
|
27757 |
Slot: block_settings_menu_controls_Slot
|
27764 |
} = _ref;
|
27765 |
const {
|
27766 |
selectedBlocks,
|
27767 |
+
selectedClientIds,
|
27768 |
+
canRemove
|
27769 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
27770 |
const {
|
27771 |
getBlocksByClientId,
|
27772 |
+
getSelectedBlockClientIds,
|
27773 |
+
canRemoveBlocks
|
27774 |
} = select(store);
|
27775 |
const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds();
|
27776 |
return {
|
27777 |
selectedBlocks: (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.compact)(getBlocksByClientId(ids)), block => block.name),
|
27778 |
+
selectedClientIds: ids,
|
27779 |
+
canRemove: canRemoveBlocks(ids)
|
27780 |
};
|
27781 |
+
}, [clientIds]);
|
27782 |
+
const showLockButton = selectedClientIds.length === 1; // Check if current selection of blocks is Groupable or Ungroupable
|
27783 |
// and pass this props down to ConvertToGroupButton.
|
27784 |
|
27785 |
const convertToGroupButtonProps = useConvertToGroupButtonProps();
|
27787 |
isGroupable,
|
27788 |
isUngroupable
|
27789 |
} = convertToGroupButtonProps;
|
27790 |
+
const showConvertToGroupButton = (isGroupable || isUngroupable) && canRemove;
|
27791 |
return (0,external_wp_element_namespaceObject.createElement)(block_settings_menu_controls_Slot, {
|
27792 |
fillProps: { ...fillProps,
|
27793 |
selectedBlocks,
|
27794 |
selectedClientIds
|
27795 |
}
|
27796 |
}, fills => {
|
27797 |
+
if (!(fills !== null && fills !== void 0 && fills.length) > 0 && !showConvertToGroupButton && !showLockButton) {
|
27798 |
+
return null;
|
|
|
|
|
27799 |
}
|
27800 |
+
|
27801 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, showLockButton && (0,external_wp_element_namespaceObject.createElement)(BlockLockMenuItem, {
|
27802 |
+
clientId: selectedClientIds[0]
|
27803 |
+
}), fills, showConvertToGroupButton && (0,external_wp_element_namespaceObject.createElement)(ConvertToGroupButton, _extends({}, convertToGroupButtonProps, {
|
27804 |
+
onClose: fillProps === null || fillProps === void 0 ? void 0 : fillProps.onClose
|
27805 |
+
})));
|
27806 |
});
|
27807 |
};
|
27808 |
/**
|
27883 |
const count = blockClientIds.length;
|
27884 |
const firstBlockClientId = blockClientIds[0];
|
27885 |
const {
|
27886 |
+
onlyBlock,
|
27887 |
+
previousBlockClientId,
|
27888 |
+
nextBlockClientId,
|
27889 |
+
selectedBlockClientIds
|
27890 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
27891 |
const {
|
27892 |
+
getBlockCount,
|
27893 |
+
getPreviousBlockClientId,
|
27894 |
+
getNextBlockClientId,
|
27895 |
+
getSelectedBlockClientIds
|
27896 |
} = select(store);
|
27897 |
return {
|
27898 |
+
onlyBlock: 1 === getBlockCount(),
|
27899 |
+
previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
|
27900 |
+
nextBlockClientId: getNextBlockClientId(firstBlockClientId),
|
27901 |
+
selectedBlockClientIds: getSelectedBlockClientIds()
|
27902 |
};
|
27903 |
}, [firstBlockClientId]);
|
27904 |
const shortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
27912 |
insertBefore: getShortcutRepresentation('core/block-editor/insert-before')
|
27913 |
};
|
27914 |
}, []);
|
27915 |
+
const updateSelectionAfterDuplicate = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? async clientIdsPromise => {
|
27916 |
const ids = await clientIdsPromise;
|
27917 |
|
27918 |
if (ids && ids[0]) {
|
27920 |
}
|
27921 |
} : external_lodash_namespaceObject.noop, [__experimentalSelectBlock]);
|
27922 |
const blockTitle = useBlockDisplayTitle(firstBlockClientId, 25);
|
27923 |
+
const updateSelectionAfterRemove = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? () => {
|
27924 |
+
const blockToSelect = previousBlockClientId || nextBlockClientId;
|
27925 |
+
|
27926 |
+
if (blockToSelect && // From the block options dropdown, it's possible to remove a block that is not selected,
|
27927 |
+
// in this case, it's not necessary to update the selection since the selected block wasn't removed.
|
27928 |
+
selectedBlockClientIds.includes(firstBlockClientId) && // Don't update selection when next/prev block also is in the selection ( and gets removed ),
|
27929 |
+
// In case someone selects all blocks and removes them at once.
|
27930 |
+
!selectedBlockClientIds.includes(blockToSelect)) {
|
27931 |
+
__experimentalSelectBlock(blockToSelect);
|
27932 |
+
}
|
27933 |
+
} : external_lodash_namespaceObject.noop, [__experimentalSelectBlock, previousBlockClientId, nextBlockClientId, selectedBlockClientIds]);
|
27934 |
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
27935 |
/* translators: %s: block name */
|
27936 |
(0,external_wp_i18n_namespaceObject.__)('Remove %s'), blockTitle);
|
27972 |
blocks: blocks,
|
27973 |
onCopy: onCopy
|
27974 |
}), canDuplicate && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
27975 |
+
onClick: (0,external_lodash_namespaceObject.flow)(onClose, onDuplicate, updateSelectionAfterDuplicate),
|
27976 |
shortcut: shortcuts.duplicate
|
27977 |
}, (0,external_wp_i18n_namespaceObject.__)('Duplicate')), canInsertDefaultBlock && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
27978 |
onClick: (0,external_lodash_namespaceObject.flow)(onClose, onInsertBefore),
|
27995 |
}) : external_wp_element_namespaceObject.Children.map(child => (0,external_wp_element_namespaceObject.cloneElement)(child, {
|
27996 |
onClose
|
27997 |
})), canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
27998 |
+
onClick: (0,external_lodash_namespaceObject.flow)(onClose, onRemove, updateSelectionAfterRemove),
|
27999 |
shortcut: shortcuts.remove
|
28000 |
}, removeBlockLabel)));
|
28001 |
});
|
28028 |
}
|
28029 |
/* harmony default export */ var block_settings_menu = (BlockSettingsMenu);
|
28030 |
|
28031 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/toolbar.js
|
28032 |
+
|
28033 |
+
|
28034 |
+
/**
|
28035 |
+
* WordPress dependencies
|
28036 |
+
*/
|
28037 |
+
|
28038 |
+
|
28039 |
+
|
28040 |
+
|
28041 |
+
|
28042 |
+
/**
|
28043 |
+
* Internal dependencies
|
28044 |
+
*/
|
28045 |
+
|
28046 |
+
|
28047 |
+
|
28048 |
+
|
28049 |
+
function BlockLockToolbar(_ref) {
|
28050 |
+
let {
|
28051 |
+
clientId
|
28052 |
+
} = _ref;
|
28053 |
+
const blockInformation = useBlockDisplayInformation(clientId);
|
28054 |
+
const {
|
28055 |
+
canMove,
|
28056 |
+
canRemove,
|
28057 |
+
canLockBlock
|
28058 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28059 |
+
const {
|
28060 |
+
canLockBlockType,
|
28061 |
+
getBlockName,
|
28062 |
+
canMoveBlock,
|
28063 |
+
canRemoveBlock
|
28064 |
+
} = select(store);
|
28065 |
+
return {
|
28066 |
+
canMove: canMoveBlock(clientId),
|
28067 |
+
canRemove: canRemoveBlock(clientId),
|
28068 |
+
canLockBlock: canLockBlockType(getBlockName(clientId))
|
28069 |
+
};
|
28070 |
+
}, [clientId]);
|
28071 |
+
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
|
28072 |
+
|
28073 |
+
if (!canLockBlock) {
|
28074 |
+
return null;
|
28075 |
+
}
|
28076 |
+
|
28077 |
+
if (canMove && canRemove) {
|
28078 |
+
return null;
|
28079 |
+
}
|
28080 |
+
|
28081 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
|
28082 |
+
className: "block-editor-block-lock-toolbar"
|
28083 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
28084 |
+
icon: library_lock,
|
28085 |
+
label: (0,external_wp_i18n_namespaceObject.sprintf)(
|
28086 |
+
/* translators: %s: block name */
|
28087 |
+
(0,external_wp_i18n_namespaceObject.__)('Unlock %s'), blockInformation.title),
|
28088 |
+
onClick: toggleModal
|
28089 |
+
})), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(BlockLockModal, {
|
28090 |
+
clientId: clientId,
|
28091 |
+
onClose: toggleModal
|
28092 |
+
}));
|
28093 |
+
}
|
28094 |
+
|
28095 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/index.js
|
28096 |
|
28097 |
|
28120 |
|
28121 |
|
28122 |
|
28123 |
+
|
28124 |
function BlockToolbar(_ref) {
|
28125 |
let {
|
28126 |
hideDragHandle
|
28207 |
className: "block-editor-block-toolbar__block-controls"
|
28208 |
}, (0,external_wp_element_namespaceObject.createElement)(block_switcher, {
|
28209 |
clientIds: blockClientIds
|
28210 |
+
}), !isMultiToolbar && (0,external_wp_element_namespaceObject.createElement)(BlockLockToolbar, {
|
28211 |
+
clientId: blockClientIds[0]
|
28212 |
}), (0,external_wp_element_namespaceObject.createElement)(block_mover, {
|
28213 |
clientIds: blockClientIds,
|
28214 |
hideDragHandle: hideDragHandle || hasReducedUI
|
29742 |
|
29743 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
|
29744 |
className: classnames_default()('block-editor-color-gradient-control', className)
|
29745 |
+
}, (0,external_wp_element_namespaceObject.createElement)("fieldset", {
|
29746 |
+
className: "block-editor-color-gradient-control__fieldset"
|
29747 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
29748 |
spacing: 1
|
29749 |
}, showTitle && (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("div", {
|
29750 |
className: "block-editor-color-gradient-control__color-indicator"
|
30430 |
function hasMixedValues() {
|
30431 |
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30432 |
const allValue = getAllValue(values);
|
30433 |
+
const isMixed = typeof values === 'string' ? false : isNaN(parseFloat(allValue));
|
30434 |
return isMixed;
|
30435 |
}
|
30436 |
/**
|
30673 |
values: values,
|
30674 |
min: MIN_BORDER_RADIUS_VALUE,
|
30675 |
onChange: onChange,
|
|
|
30676 |
units: units
|
30677 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
30678 |
className: "components-border-radius-control__range-control",
|
32483 |
* or by clicking the spin buttons.
|
32484 |
*/
|
32485 |
|
32486 |
+
switch (`${nextValue}`) {
|
32487 |
case `${STEP}`:
|
32488 |
// Increment by step value.
|
32489 |
return BASE_DEFAULT_VALUE + STEP;
|
32513 |
// For example, Firefox emits an input event with inputType="insertReplacementText"
|
32514 |
// on spin button clicks, while other browsers do not even emit an input event.
|
32515 |
const wasTypedOrPasted = ['insertText', 'insertFromPaste'].includes((_action$payload$event = action.payload.event.nativeEvent) === null || _action$payload$event === void 0 ? void 0 : _action$payload$event.inputType);
|
32516 |
+
const value = adjustNextValue(state.value, wasTypedOrPasted);
|
32517 |
+
return { ...state,
|
32518 |
+
value
|
32519 |
+
};
|
32520 |
};
|
32521 |
|
32522 |
const value = isDefined ? lineHeight : RESET_VALUE;
|
33947 |
} = attributes;
|
33948 |
setAttributes({
|
33949 |
style: cleanEmptyObject({ ...style,
|
33950 |
+
typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
|
33951 |
+
letterSpacing: undefined
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33952 |
}
|
33953 |
})
|
33954 |
});
|
33955 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33956 |
|
33957 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/typography.js
|
33958 |
|
33959 |
|
33960 |
/**
|
33963 |
|
33964 |
|
33965 |
|
|
|
33966 |
/**
|
33967 |
* Internal dependencies
|
33968 |
*/
|
33971 |
|
33972 |
|
33973 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33974 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33975 |
|
|
|
|
|
|
|
33976 |
|
33977 |
+
|
33978 |
+
|
33979 |
+
const TYPOGRAPHY_SUPPORT_KEY = 'typography';
|
33980 |
+
const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
|
33981 |
+
function TypographyPanel(props) {
|
33982 |
+
const {
|
33983 |
+
clientId
|
33984 |
+
} = props;
|
33985 |
+
const isFontFamilyDisabled = useIsFontFamilyDisabled(props);
|
33986 |
+
const isFontSizeDisabled = useIsFontSizeDisabled(props);
|
33987 |
+
const isFontAppearanceDisabled = useIsFontAppearanceDisabled(props);
|
33988 |
+
const isLineHeightDisabled = useIsLineHeightDisabled(props);
|
33989 |
+
const isTextDecorationDisabled = useIsTextDecorationDisabled(props);
|
33990 |
+
const isTextTransformDisabled = useIsTextTransformDisabled(props);
|
33991 |
+
const isLetterSpacingDisabled = useIsLetterSpacingDisabled(props);
|
33992 |
+
const hasFontStyles = !useIsFontStyleDisabled(props);
|
33993 |
+
const hasFontWeights = !useIsFontWeightDisabled(props);
|
33994 |
+
const isDisabled = useIsTypographyDisabled(props);
|
33995 |
+
const isSupported = hasTypographySupport(props.name);
|
33996 |
+
if (isDisabled || !isSupported) return null;
|
33997 |
+
const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [TYPOGRAPHY_SUPPORT_KEY, '__experimentalDefaultControls']);
|
33998 |
|
33999 |
const createResetAllFilter = attribute => newAttributes => {
|
34000 |
var _newAttributes$style;
|
34001 |
|
34002 |
return { ...newAttributes,
|
34003 |
style: { ...newAttributes.style,
|
34004 |
+
typography: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.typography),
|
34005 |
[attribute]: undefined
|
34006 |
}
|
34007 |
}
|
34009 |
};
|
34010 |
|
34011 |
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
34012 |
+
__experimentalGroup: "typography"
|
34013 |
+
}, !isFontFamilyDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34014 |
+
hasValue: () => hasFontFamilyValue(props),
|
34015 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Font family'),
|
34016 |
+
onDeselect: () => resetFontFamily(props),
|
34017 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontFamily,
|
34018 |
+
resetAllFilter: newAttributes => ({ ...newAttributes,
|
34019 |
+
fontFamily: undefined
|
34020 |
+
}),
|
34021 |
+
panelId: clientId
|
34022 |
+
}, (0,external_wp_element_namespaceObject.createElement)(FontFamilyEdit, props)), !isFontSizeDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34023 |
+
hasValue: () => hasFontSizeValue(props),
|
34024 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Font size'),
|
34025 |
+
onDeselect: () => resetFontSize(props),
|
34026 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontSize,
|
34027 |
+
resetAllFilter: newAttributes => {
|
34028 |
+
var _newAttributes$style2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34029 |
|
34030 |
+
return { ...newAttributes,
|
34031 |
+
fontSize: undefined,
|
34032 |
+
style: { ...newAttributes.style,
|
34033 |
+
typography: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.typography),
|
34034 |
+
fontSize: undefined
|
34035 |
+
}
|
34036 |
+
}
|
34037 |
+
};
|
34038 |
+
},
|
34039 |
+
panelId: clientId
|
34040 |
+
}, (0,external_wp_element_namespaceObject.createElement)(FontSizeEdit, props)), !isFontAppearanceDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34041 |
+
className: "single-column",
|
34042 |
+
hasValue: () => hasFontAppearanceValue(props),
|
34043 |
+
label: getFontAppearanceLabel(hasFontStyles, hasFontWeights),
|
34044 |
+
onDeselect: () => resetFontAppearance(props),
|
34045 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.fontAppearance,
|
34046 |
+
resetAllFilter: newAttributes => {
|
34047 |
+
var _newAttributes$style3;
|
34048 |
|
34049 |
+
return { ...newAttributes,
|
34050 |
+
style: { ...newAttributes.style,
|
34051 |
+
typography: { ...((_newAttributes$style3 = newAttributes.style) === null || _newAttributes$style3 === void 0 ? void 0 : _newAttributes$style3.typography),
|
34052 |
+
fontStyle: undefined,
|
34053 |
+
fontWeight: undefined
|
34054 |
+
}
|
34055 |
+
}
|
34056 |
+
};
|
34057 |
+
},
|
34058 |
+
panelId: clientId
|
34059 |
+
}, (0,external_wp_element_namespaceObject.createElement)(FontAppearanceEdit, props)), !isLineHeightDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34060 |
+
className: "single-column",
|
34061 |
+
hasValue: () => hasLineHeightValue(props),
|
34062 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Line height'),
|
34063 |
+
onDeselect: () => resetLineHeight(props),
|
34064 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.lineHeight,
|
34065 |
+
resetAllFilter: createResetAllFilter('lineHeight'),
|
34066 |
+
panelId: clientId
|
34067 |
+
}, (0,external_wp_element_namespaceObject.createElement)(LineHeightEdit, props)), !isTextDecorationDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34068 |
+
className: "single-column",
|
34069 |
+
hasValue: () => hasTextDecorationValue(props),
|
34070 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Decoration'),
|
34071 |
+
onDeselect: () => resetTextDecoration(props),
|
34072 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textDecoration,
|
34073 |
+
resetAllFilter: createResetAllFilter('textDecoration'),
|
34074 |
+
panelId: clientId
|
34075 |
+
}, (0,external_wp_element_namespaceObject.createElement)(TextDecorationEdit, props)), !isTextTransformDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34076 |
+
className: "single-column",
|
34077 |
+
hasValue: () => hasTextTransformValue(props),
|
34078 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Letter case'),
|
34079 |
+
onDeselect: () => resetTextTransform(props),
|
34080 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textTransform,
|
34081 |
+
resetAllFilter: createResetAllFilter('textTransform'),
|
34082 |
+
panelId: clientId
|
34083 |
+
}, (0,external_wp_element_namespaceObject.createElement)(TextTransformEdit, props)), !isLetterSpacingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
34084 |
+
className: "single-column",
|
34085 |
+
hasValue: () => hasLetterSpacingValue(props),
|
34086 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'),
|
34087 |
+
onDeselect: () => resetLetterSpacing(props),
|
34088 |
+
isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.letterSpacing,
|
34089 |
+
resetAllFilter: createResetAllFilter('letterSpacing'),
|
34090 |
+
panelId: clientId
|
34091 |
+
}, (0,external_wp_element_namespaceObject.createElement)(LetterSpacingEdit, props)));
|
34092 |
}
|
34093 |
+
const hasTypographySupport = blockName => {
|
34094 |
+
return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, key));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34095 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34096 |
|
34097 |
+
function useIsTypographyDisabled() {
|
34098 |
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
34099 |
+
const configs = [useIsFontAppearanceDisabled(props), useIsFontSizeDisabled(props), useIsLineHeightDisabled(props), useIsFontFamilyDisabled(props), useIsTextDecorationDisabled(props), useIsTextTransformDisabled(props), useIsLetterSpacingDisabled(props)];
|
34100 |
+
return configs.filter(Boolean).length === configs.length;
|
|
|
|
|
|
|
34101 |
}
|
34102 |
|
34103 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/style.js
|
36457 |
}, props), children);
|
36458 |
}
|
36459 |
|
36460 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/expander.js
|
36461 |
+
|
36462 |
+
|
36463 |
+
/**
|
36464 |
+
* WordPress dependencies
|
36465 |
+
*/
|
36466 |
+
|
36467 |
+
function ListViewExpander(_ref) {
|
36468 |
+
let {
|
36469 |
+
onClick
|
36470 |
+
} = _ref;
|
36471 |
+
return (// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js
|
36472 |
+
//
|
36473 |
+
// The expander component is implemented as a pseudo element in the w3 example
|
36474 |
+
// https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html
|
36475 |
+
//
|
36476 |
+
// We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree.
|
36477 |
+
// For the current tree grid implementation, please do not try to make this a button.
|
36478 |
+
//
|
36479 |
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
36480 |
+
(0,external_wp_element_namespaceObject.createElement)("span", {
|
36481 |
+
className: "block-editor-list-view__expander",
|
36482 |
+
onClick: event => onClick(event, {
|
36483 |
+
forceToggle: true
|
36484 |
+
}),
|
36485 |
+
"aria-hidden": "true"
|
36486 |
+
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
36487 |
+
icon: chevron_right_small
|
36488 |
+
}))
|
36489 |
+
);
|
36490 |
+
}
|
36491 |
+
|
36492 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/block-select-button.js
|
36493 |
+
|
36494 |
+
|
36495 |
+
/**
|
36496 |
+
* External dependencies
|
36497 |
+
*/
|
36498 |
+
|
36499 |
+
/**
|
36500 |
+
* WordPress dependencies
|
36501 |
+
*/
|
36502 |
+
|
36503 |
+
|
36504 |
+
|
36505 |
+
/**
|
36506 |
+
* Internal dependencies
|
36507 |
+
*/
|
36508 |
+
|
36509 |
+
|
36510 |
+
|
36511 |
+
|
36512 |
+
|
36513 |
+
|
36514 |
+
|
36515 |
+
function ListViewBlockSelectButton(_ref, ref) {
|
36516 |
+
let {
|
36517 |
+
className,
|
36518 |
+
block: {
|
36519 |
+
clientId
|
36520 |
+
},
|
36521 |
+
onClick,
|
36522 |
+
onToggleExpanded,
|
36523 |
+
tabIndex,
|
36524 |
+
onFocus,
|
36525 |
+
onDragStart,
|
36526 |
+
onDragEnd,
|
36527 |
+
draggable
|
36528 |
+
} = _ref;
|
36529 |
+
const blockInformation = useBlockDisplayInformation(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
|
36530 |
+
// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
|
36531 |
+
// We need to clear any HTML drag data to prevent `pasteHandler` from firing
|
36532 |
+
// inside the `useOnBlockDrop` hook.
|
36533 |
+
|
36534 |
+
const onDragStartHandler = event => {
|
36535 |
+
event.dataTransfer.clearData();
|
36536 |
+
onDragStart(event);
|
36537 |
+
};
|
36538 |
+
|
36539 |
+
function onKeyDownHandler(event) {
|
36540 |
+
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER || event.keyCode === external_wp_keycodes_namespaceObject.SPACE) {
|
36541 |
+
onClick(event);
|
36542 |
+
}
|
36543 |
+
}
|
36544 |
+
|
36545 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
36546 |
+
className: classnames_default()('block-editor-list-view-block-select-button', className),
|
36547 |
+
onClick: onClick,
|
36548 |
+
onKeyDown: onKeyDownHandler,
|
36549 |
+
ref: ref,
|
36550 |
+
tabIndex: tabIndex,
|
36551 |
+
onFocus: onFocus,
|
36552 |
+
onDragStart: onDragStartHandler,
|
36553 |
+
onDragEnd: onDragEnd,
|
36554 |
+
draggable: draggable,
|
36555 |
+
href: `#block-${clientId}`,
|
36556 |
+
"aria-hidden": true
|
36557 |
+
}, (0,external_wp_element_namespaceObject.createElement)(ListViewExpander, {
|
36558 |
+
onClick: onToggleExpanded
|
36559 |
+
}), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
36560 |
+
icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
|
36561 |
+
showColors: true
|
36562 |
+
}), (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
36563 |
+
clientId: clientId,
|
36564 |
+
maximumLength: 35
|
36565 |
+
}), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
36566 |
+
className: "block-editor-list-view-block-select-button__anchor"
|
36567 |
+
}, blockInformation.anchor)));
|
36568 |
+
}
|
36569 |
+
|
36570 |
+
/* harmony default export */ var block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
|
36571 |
+
|
36572 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/block-contents.js
|
36573 |
+
|
36574 |
+
|
36575 |
+
|
36576 |
+
/**
|
36577 |
+
* External dependencies
|
36578 |
+
*/
|
36579 |
+
|
36580 |
+
/**
|
36581 |
+
* WordPress dependencies
|
36582 |
+
*/
|
36583 |
+
|
36584 |
+
|
36585 |
+
|
36586 |
+
/**
|
36587 |
+
* Internal dependencies
|
36588 |
+
*/
|
36589 |
+
|
36590 |
+
|
36591 |
+
|
36592 |
+
|
36593 |
+
const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
|
36594 |
+
let {
|
36595 |
+
onClick,
|
36596 |
+
onToggleExpanded,
|
36597 |
+
block,
|
36598 |
+
isSelected,
|
36599 |
+
position,
|
36600 |
+
siblingBlockCount,
|
36601 |
+
level,
|
36602 |
+
isExpanded,
|
36603 |
+
selectedClientIds,
|
36604 |
+
...props
|
36605 |
+
} = _ref;
|
36606 |
+
const {
|
36607 |
+
clientId
|
36608 |
+
} = block;
|
36609 |
+
const {
|
36610 |
+
blockMovingClientId,
|
36611 |
+
selectedBlockInBlockEditor
|
36612 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
36613 |
+
const {
|
36614 |
+
hasBlockMovingClientId,
|
36615 |
+
getSelectedBlockClientId
|
36616 |
+
} = select(store);
|
36617 |
+
return {
|
36618 |
+
blockMovingClientId: hasBlockMovingClientId(),
|
36619 |
+
selectedBlockInBlockEditor: getSelectedBlockClientId()
|
36620 |
+
};
|
36621 |
+
}, [clientId]);
|
36622 |
+
const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId;
|
36623 |
+
const className = classnames_default()('block-editor-list-view-block-contents', {
|
36624 |
+
'is-dropping-before': isBlockMoveTarget
|
36625 |
+
}); // Only include all selected blocks if the currently clicked on block
|
36626 |
+
// is one of the selected blocks. This ensures that if a user attempts
|
36627 |
+
// to drag a block that isn't part of the selection, they're still able
|
36628 |
+
// to drag it and rearrange its position.
|
36629 |
+
|
36630 |
+
const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
36631 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_draggable, {
|
36632 |
+
clientIds: draggableClientIds
|
36633 |
+
}, _ref2 => {
|
36634 |
+
let {
|
36635 |
+
draggable,
|
36636 |
+
onDragStart,
|
36637 |
+
onDragEnd
|
36638 |
+
} = _ref2;
|
36639 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_select_button, _extends({
|
36640 |
+
ref: ref,
|
36641 |
+
className: className,
|
36642 |
+
block: block,
|
36643 |
+
onClick: onClick,
|
36644 |
+
onToggleExpanded: onToggleExpanded,
|
36645 |
+
isSelected: isSelected,
|
36646 |
+
position: position,
|
36647 |
+
siblingBlockCount: siblingBlockCount,
|
36648 |
+
level: level,
|
36649 |
+
draggable: draggable,
|
36650 |
+
onDragStart: onDragStart,
|
36651 |
+
onDragEnd: onDragEnd,
|
36652 |
+
isExpanded: isExpanded
|
36653 |
+
}, props));
|
36654 |
+
});
|
36655 |
+
});
|
36656 |
+
/* harmony default export */ var block_contents = (ListViewBlockContents);
|
36657 |
+
|
36658 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/context.js
|
36659 |
+
/**
|
36660 |
+
* WordPress dependencies
|
36661 |
+
*/
|
36662 |
+
|
36663 |
+
const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({
|
36664 |
+
__experimentalFeatures: false,
|
36665 |
+
__experimentalPersistentListViewFeatures: false
|
36666 |
+
});
|
36667 |
+
const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext);
|
36668 |
+
|
36669 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/utils.js
|
36670 |
/**
|
36671 |
* External dependencies
|
36716 |
};
|
36717 |
}
|
36718 |
|
36719 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/block.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36720 |
|
36721 |
|
36722 |
/**
|
36731 |
|
36732 |
|
36733 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36734 |
|
36735 |
|
36736 |
/**
|
36740 |
|
36741 |
|
36742 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36743 |
|
36744 |
|
36745 |
|
36760 |
showBlockMovers,
|
36761 |
path,
|
36762 |
isExpanded,
|
36763 |
+
selectedClientIds,
|
36764 |
+
preventAnnouncement
|
36765 |
} = _ref;
|
36766 |
const cellRef = (0,external_wp_element_namespaceObject.useRef)(null);
|
36767 |
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
|
36771 |
const {
|
36772 |
toggleBlockHighlight
|
36773 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
36774 |
+
const blockInformation = useBlockDisplayInformation(clientId);
|
36775 |
+
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlock);
|
36776 |
+
const descriptionId = `list-view-block-select-button__${instanceId}`;
|
36777 |
+
const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level);
|
36778 |
+
const blockAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block. This string indicates a link to select the block.
|
36779 |
+
(0,external_wp_i18n_namespaceObject.__)('%s link'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Link');
|
36780 |
+
const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
|
36781 |
+
(0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options');
|
36782 |
const {
|
36783 |
__experimentalFeatures: withExperimentalFeatures,
|
36784 |
__experimentalPersistentListViewFeatures: withExperimentalPersistentListViewFeatures,
|
36814 |
}, [clientId, setIsHovered, highlightBlock]);
|
36815 |
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
36816 |
selectBlock(event, clientId);
|
36817 |
+
event.preventDefault();
|
36818 |
}, [clientId, selectBlock]);
|
36819 |
+
const updateSelection = (0,external_wp_element_namespaceObject.useCallback)(newClientId => {
|
36820 |
selectBlock(undefined, newClientId);
|
36821 |
}, [selectBlock]);
|
36822 |
const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
36846 |
'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected,
|
36847 |
'is-dragging': isDragged,
|
36848 |
'has-single-cell': hideBlockActions
|
36849 |
+
}); // Only include all selected blocks if the currently clicked on block
|
|
|
|
|
|
|
36850 |
// is one of the selected blocks. This ensures that if a user attempts
|
36851 |
// to alter a block that isn't part of the selection, they're still able
|
36852 |
// to do so.
|
36864 |
path: path,
|
36865 |
id: `list-view-block-${clientId}`,
|
36866 |
"data-block": clientId,
|
36867 |
+
isExpanded: isExpanded,
|
36868 |
+
"aria-selected": !!isSelected
|
36869 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
36870 |
className: "block-editor-list-view-block__contents-cell",
|
36871 |
colSpan: colSpan,
|
36872 |
+
ref: cellRef,
|
36873 |
+
"aria-label": blockAriaLabel,
|
36874 |
+
"aria-selected": !!isSelected,
|
36875 |
+
"aria-expanded": isExpanded,
|
36876 |
+
"aria-describedby": descriptionId
|
36877 |
}, _ref2 => {
|
36878 |
let {
|
36879 |
ref,
|
36894 |
tabIndex: tabIndex,
|
36895 |
onFocus: onFocus,
|
36896 |
isExpanded: isExpanded,
|
36897 |
+
selectedClientIds: selectedClientIds,
|
36898 |
+
preventAnnouncement: preventAnnouncement
|
36899 |
+
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
36900 |
+
className: "block-editor-list-view-block-select-button__description",
|
36901 |
+
id: descriptionId
|
36902 |
+
}, blockPositionDescription));
|
36903 |
}), hasRenderedMovers && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
36904 |
className: moverCellClassName,
|
36905 |
withoutGridItem: true
|
36930 |
onFocus: onFocus
|
36931 |
});
|
36932 |
}))), showBlockActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
36933 |
+
className: listViewBlockSettingsClassName,
|
36934 |
+
"aria-selected": !!isSelected
|
36935 |
}, _ref5 => {
|
36936 |
let {
|
36937 |
ref,
|
36949 |
onFocus
|
36950 |
},
|
36951 |
disableOpenOnArrowDown: true,
|
36952 |
+
__experimentalSelectBlock: updateSelection
|
36953 |
});
|
36954 |
}));
|
36955 |
}
|
36983 |
* When a block is collapsed, we do not count their children as part of that total. In the current drag
|
36984 |
* implementation dragged blocks and their children are not counted.
|
36985 |
*
|
36986 |
+
* @param {Object} block block tree
|
36987 |
+
* @param {Object} expandedState state that notes which branches are collapsed
|
36988 |
+
* @param {Array} draggedClientIds a list of dragged client ids
|
36989 |
+
* @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state.
|
36990 |
* @return {number} block count
|
36991 |
*/
|
36992 |
|
36993 |
+
function countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault) {
|
36994 |
var _expandedState$block$;
|
36995 |
|
36996 |
const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
|
36999 |
return 0;
|
37000 |
}
|
37001 |
|
37002 |
+
const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ : isExpandedByDefault;
|
37003 |
|
37004 |
if (isExpanded) {
|
37005 |
+
return 1 + block.innerBlocks.reduce(countReducer(expandedState, draggedClientIds, isExpandedByDefault), 0);
|
37006 |
}
|
37007 |
|
37008 |
return 1;
|
37009 |
}
|
37010 |
|
37011 |
+
const countReducer = (expandedState, draggedClientIds, isExpandedByDefault) => (count, block) => {
|
37012 |
var _expandedState$block$2;
|
37013 |
|
37014 |
const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
|
37017 |
return count;
|
37018 |
}
|
37019 |
|
37020 |
+
const isExpanded = (_expandedState$block$2 = expandedState[block.clientId]) !== null && _expandedState$block$2 !== void 0 ? _expandedState$block$2 : isExpandedByDefault;
|
37021 |
|
37022 |
if (isExpanded && block.innerBlocks.length > 0) {
|
37023 |
+
return count + countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault);
|
37024 |
}
|
37025 |
|
37026 |
return count + 1;
|
37037 |
path = '',
|
37038 |
isBranchSelected = false,
|
37039 |
listPosition = 0,
|
37040 |
+
fixedListWindow,
|
37041 |
+
expandNested = true
|
37042 |
} = props;
|
37043 |
const {
|
37044 |
expandedState,
|
37057 |
} = block;
|
37058 |
|
37059 |
if (index > 0) {
|
37060 |
+
nextPosition += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds, expandNested);
|
37061 |
}
|
37062 |
|
37063 |
const usesWindowing = __experimentalPersistentListViewFeatures;
|
37068 |
const position = index + 1;
|
37069 |
const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
|
37070 |
const hasNestedBlocks = showNestedBlocks && !!innerBlocks && !!innerBlocks.length;
|
37071 |
+
const isExpanded = hasNestedBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : expandNested : undefined;
|
37072 |
const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId));
|
37073 |
const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous,
|
37074 |
// but asynchronous for any other block.
|
37105 |
listPosition: nextPosition + 1,
|
37106 |
fixedListWindow: fixedListWindow,
|
37107 |
isBranchSelected: isSelectedBranch,
|
37108 |
+
selectedClientIds: selectedClientIds,
|
37109 |
+
expandNested: expandNested
|
37110 |
}));
|
37111 |
}));
|
37112 |
}
|
37275 |
|
37276 |
|
37277 |
event.preventDefault();
|
37278 |
+
const isKeyPress = event.type === 'keydown' && (event.keyCode === external_wp_keycodes_namespaceObject.UP || event.keyCode === external_wp_keycodes_namespaceObject.DOWN || event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END); // Handle clicking on a block when no blocks are selected, and return early.
|
37279 |
|
37280 |
if (!isKeyPress && !hasSelectedBlock() && !hasMultiSelection()) {
|
37281 |
selectBlock(clientId, null);
|
37321 |
await multiSelect(start, end, null); // Announce deselected block, or number of deselected blocks if
|
37322 |
// the total number of blocks deselected is greater than one.
|
37323 |
|
37324 |
+
const updatedSelectedBlocks = getSelectedBlockClientIds(); // If the selection is greater than 1 and the Home or End keys
|
37325 |
+
// were used to generate the selection, then skip announcing the
|
37326 |
+
// deselected blocks.
|
37327 |
+
|
37328 |
+
if ((event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END) && updatedSelectedBlocks.length > 1) {
|
37329 |
+
return;
|
37330 |
+
}
|
37331 |
+
|
37332 |
const selectionDiff = (0,external_lodash_namespaceObject.difference)(selectedBlocks, updatedSelectedBlocks);
|
37333 |
let label;
|
37334 |
|
37717 |
* @param {boolean} props.__experimentalFeatures Flag to enable experimental features.
|
37718 |
* @param {boolean} props.__experimentalPersistentListViewFeatures Flag to enable features for the Persistent List View experiment.
|
37719 |
* @param {boolean} props.__experimentalHideContainerBlockActions Flag to hide actions of top level blocks (like core/widget-area)
|
37720 |
+
* @param {string} props.id Unique identifier for the root list element (primarily for a11y purposes).
|
37721 |
+
* @param {boolean} props.expandNested Flag to determine whether nested levels are expanded by default.
|
37722 |
* @param {Object} ref Forwarded ref
|
37723 |
*/
|
37724 |
|
37730 |
__experimentalHideContainerBlockActions,
|
37731 |
showNestedBlocks,
|
37732 |
showBlockMovers,
|
37733 |
+
id,
|
37734 |
+
expandNested = false,
|
37735 |
...props
|
37736 |
} = _ref;
|
37737 |
const {
|
37835 |
listViewRef: elementRef,
|
37836 |
blockDropTarget: blockDropTarget
|
37837 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGrid, {
|
37838 |
+
id: id,
|
37839 |
className: "block-editor-list-view-tree",
|
37840 |
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'),
|
37841 |
ref: treeGridRef,
|
37850 |
showNestedBlocks: showNestedBlocks,
|
37851 |
showBlockMovers: showBlockMovers,
|
37852 |
fixedListWindow: fixedListWindow,
|
37853 |
+
selectedClientIds: selectedClientIds,
|
37854 |
+
expandNested: expandNested
|
37855 |
}, props)))));
|
37856 |
}
|
37857 |
|
38823 |
}));
|
38824 |
}
|
38825 |
|
38826 |
+
;// CONCATENATED MODULE: external ["wp","date"]
|
38827 |
+
var external_wp_date_namespaceObject = window["wp"]["date"];
|
38828 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/date-format-picker/index.js
|
38829 |
+
|
38830 |
+
|
38831 |
+
/**
|
38832 |
+
* External dependencies
|
38833 |
+
*/
|
38834 |
+
|
38835 |
+
/**
|
38836 |
+
* WordPress dependencies
|
38837 |
+
*/
|
38838 |
+
|
38839 |
+
|
38840 |
+
|
38841 |
+
|
38842 |
+
// So that we can illustrate the different formats in the dropdown properly,
|
38843 |
+
// show a date that has a day greater than 12 and a month with more than three
|
38844 |
+
// letters. Here we're using 2022-01-25 which is when WordPress 5.9 was
|
38845 |
+
// released.
|
38846 |
+
|
38847 |
+
const EXAMPLE_DATE = new Date(2022, 0, 25);
|
38848 |
+
/**
|
38849 |
+
* The `DateFormatPicker` component renders controls that let the user choose a
|
38850 |
+
* _date format_. That is, how they want their dates to be formatted.
|
38851 |
+
*
|
38852 |
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md
|
38853 |
+
*
|
38854 |
+
* @param {Object} props
|
38855 |
+
* @param {string|null} props.format The selected date
|
38856 |
+
* format. If
|
38857 |
+
* `null`,
|
38858 |
+
* _Default_ is
|
38859 |
+
* selected.
|
38860 |
+
* @param {string} props.defaultFormat The date format that
|
38861 |
+
* will be used if the
|
38862 |
+
* user selects
|
38863 |
+
* 'Default'.
|
38864 |
+
* @param {( format: string|null ) => void} props.onChange Called when a
|
38865 |
+
* selection is
|
38866 |
+
* made. If `null`,
|
38867 |
+
* _Default_ is
|
38868 |
+
* selected.
|
38869 |
+
*/
|
38870 |
+
|
38871 |
+
function DateFormatPicker(_ref) {
|
38872 |
+
let {
|
38873 |
+
format,
|
38874 |
+
defaultFormat,
|
38875 |
+
onChange
|
38876 |
+
} = _ref;
|
38877 |
+
return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
|
38878 |
+
className: "block-editor-date-format-picker"
|
38879 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
|
38880 |
+
as: "legend"
|
38881 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Date format')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
38882 |
+
label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Default format'), (0,external_wp_element_namespaceObject.createElement)("span", {
|
38883 |
+
className: "block-editor-date-format-picker__default-format-toggle-control__hint"
|
38884 |
+
}, (0,external_wp_date_namespaceObject.dateI18n)(defaultFormat, EXAMPLE_DATE))),
|
38885 |
+
checked: !format,
|
38886 |
+
onChange: checked => onChange(checked ? null : defaultFormat)
|
38887 |
+
}), format && (0,external_wp_element_namespaceObject.createElement)(NonDefaultControls, {
|
38888 |
+
format: format,
|
38889 |
+
onChange: onChange
|
38890 |
+
}));
|
38891 |
+
}
|
38892 |
+
|
38893 |
+
function NonDefaultControls(_ref2) {
|
38894 |
+
var _suggestedOptions$fin;
|
38895 |
+
|
38896 |
+
let {
|
38897 |
+
format,
|
38898 |
+
onChange
|
38899 |
+
} = _ref2;
|
38900 |
+
// Suggest a short format, medium format, long format, and a standardised
|
38901 |
+
// (YYYY-MM-DD) format. The short, medium, and long formats are localised as
|
38902 |
+
// different languages have different ways of writing these. For example, 'F
|
38903 |
+
// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April
|
38904 |
+
// 2022) in German (de). The resultant array is de-duplicated as some
|
38905 |
+
// languages will use the same format string for short, medium, and long
|
38906 |
+
// formats.
|
38907 |
+
const suggestedFormats = (0,external_lodash_namespaceObject.uniq)(['Y-m-d', (0,external_wp_i18n_namespaceObject._x)('n/j/Y', 'short date format'), (0,external_wp_i18n_namespaceObject._x)('n/j/Y g:i A', 'short date format with time'), (0,external_wp_i18n_namespaceObject._x)('M j, Y', 'medium date format'), (0,external_wp_i18n_namespaceObject._x)('M j, Y g:i A', 'medium date format with time'), (0,external_wp_i18n_namespaceObject._x)('F j, Y', 'long date format')]);
|
38908 |
+
const suggestedOptions = suggestedFormats.map((suggestedFormat, index) => ({
|
38909 |
+
key: `suggested-${index}`,
|
38910 |
+
name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, EXAMPLE_DATE),
|
38911 |
+
format: suggestedFormat
|
38912 |
+
}));
|
38913 |
+
const customOption = {
|
38914 |
+
key: 'custom',
|
38915 |
+
name: (0,external_wp_i18n_namespaceObject.__)('Custom'),
|
38916 |
+
className: 'block-editor-date-format-picker__custom-format-select-control__custom-option',
|
38917 |
+
__experimentalHint: (0,external_wp_i18n_namespaceObject.__)('Enter your own date format')
|
38918 |
+
};
|
38919 |
+
const [isCustom, setIsCustom] = (0,external_wp_element_namespaceObject.useState)(() => !!format && !suggestedFormats.includes(format));
|
38920 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
|
38921 |
+
className: "block-editor-date-format-picker__custom-format-select-control"
|
38922 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, {
|
38923 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Choose a format'),
|
38924 |
+
options: [...suggestedOptions, customOption],
|
38925 |
+
value: isCustom ? customOption : (_suggestedOptions$fin = suggestedOptions.find(option => option.format === format)) !== null && _suggestedOptions$fin !== void 0 ? _suggestedOptions$fin : customOption,
|
38926 |
+
onChange: _ref3 => {
|
38927 |
+
let {
|
38928 |
+
selectedItem
|
38929 |
+
} = _ref3;
|
38930 |
+
|
38931 |
+
if (selectedItem === customOption) {
|
38932 |
+
setIsCustom(true);
|
38933 |
+
} else {
|
38934 |
+
setIsCustom(false);
|
38935 |
+
onChange(selectedItem.format);
|
38936 |
+
}
|
38937 |
+
}
|
38938 |
+
})), isCustom && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
|
38939 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Custom format'),
|
38940 |
+
hideLabelFromVision: true,
|
38941 |
+
help: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Enter a date or time <Link>format string</Link>.'), {
|
38942 |
+
Link: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
|
38943 |
+
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/formatting-date-and-time/')
|
38944 |
+
})
|
38945 |
+
}),
|
38946 |
+
value: format,
|
38947 |
+
onChange: value => onChange(value)
|
38948 |
+
}));
|
38949 |
+
}
|
38950 |
+
|
38951 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
|
38952 |
|
38953 |
|
44966 |
"aria-multiline": !disableLineBreaks,
|
44967 |
"aria-label": placeholder
|
44968 |
}, props, autocompleteProps, {
|
44969 |
+
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, autocompleteProps.ref, props.ref, richTextRef, useInputRules({
|
44970 |
value,
|
44971 |
onChange,
|
44972 |
__unstableAllowPrefixTransformations,
|
44996 |
onChange,
|
44997 |
disableLineBreaks,
|
44998 |
onSplitAtEnd
|
44999 |
+
}), anchorRef]),
|
45000 |
contentEditable: true,
|
45001 |
suppressContentEditableWarning: true,
|
45002 |
className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text'),
|
45660 |
setIsOpen(false);
|
45661 |
});
|
45662 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45663 |
const getUpdatedLinkTargetSettings = value => {
|
45664 |
const newLinkTarget = value ? '_blank' : undefined;
|
45665 |
let updatedRel;
|
45666 |
|
45667 |
+
if (newLinkTarget) {
|
45668 |
+
const rels = (rel !== null && rel !== void 0 ? rel : '').split(' ');
|
45669 |
+
NEW_TAB_REL.forEach(relVal => {
|
45670 |
+
if (!rels.includes(relVal)) {
|
45671 |
+
rels.push(relVal);
|
45672 |
+
}
|
45673 |
+
});
|
45674 |
+
updatedRel = rels.join(' ');
|
45675 |
} else {
|
45676 |
+
const rels = (rel !== null && rel !== void 0 ? rel : '').split(' ').filter(relVal => NEW_TAB_REL.includes(relVal) === false);
|
45677 |
+
updatedRel = rels.length ? rels.join(' ') : undefined;
|
45678 |
}
|
45679 |
|
45680 |
return {
|
45797 |
checked: linkTarget === '_blank'
|
45798 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
|
45799 |
label: (0,external_wp_i18n_namespaceObject.__)('Link Rel'),
|
45800 |
+
value: rel !== null && rel !== void 0 ? rel : '',
|
45801 |
onChange: onSetLinkRel
|
45802 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
|
45803 |
label: (0,external_wp_i18n_namespaceObject.__)('Link CSS Class'),
|
47219 |
|
47220 |
|
47221 |
|
47222 |
+
|
47223 |
|
47224 |
|
47225 |
|
build/block-editor/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', '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' => '
|
1 |
+
<?php return 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' => '73b4e25425d2a14f5ce43f2885c33e78');
|
build/block-editor/index.min.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Vh},AlignmentToolbar:function(){return Hh},Autocomplete:function(){return Xh},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return tv},BlockColorsStyleSelector:function(){return iv},BlockContextProvider:function(){return ur},BlockControls:function(){return Yn},BlockEdit:function(){return fr},BlockEditorKeyboardShortcuts:function(){return x_},BlockEditorProvider:function(){return Ya},BlockFormatControls:function(){return qn},BlockIcon:function(){return ja},BlockInspector:function(){return C_},BlockList:function(){return _m},BlockMover:function(){return tp},BlockNavigationDropdown:function(){return Bv},BlockPreview:function(){return vu},BlockSelectionClearer:function(){return Za},BlockSettingsMenu:function(){return Kp},BlockSettingsMenuControls:function(){return Up},BlockStyles:function(){return Pv},BlockTitle:function(){return Hd},BlockToolbar:function(){return qp},BlockTools:function(){return S_},BlockVerticalAlignmentControl:function(){return Qv},BlockVerticalAlignmentToolbar:function(){return Zv},ButtonBlockAppender:function(){return Pd},ButtonBlockerAppender:function(){return Td},ColorPalette:function(){return eb},ColorPaletteControl:function(){return tb},ContrastChecker:function(){return gf},CopyHandler:function(){return Mp},DefaultBlockAppender:function(){return xd},FontSizePicker:function(){return rg},InnerBlocks:function(){return hm},Inserter:function(){return Bd},InspectorAdvancedControls:function(){return tr},InspectorControls:function(){return nr},JustifyContentControl:function(){return ho},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Vf},MediaPlaceholder:function(){return yk},MediaReplaceFlow:function(){return hk},MediaUpload:function(){return fk},MediaUploadCheck:function(){return gk},MultiSelectScrollIntoView:function(){return I_},NavigableToolbar:function(){return $d},ObserveTyping:function(){return M_},PanelColorSettings:function(){return Ek},PlainText:function(){return qk},RichText:function(){return $k},RichTextShortcut:function(){return Qk},RichTextToolbarButton:function(){return Zk},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return h_},ToolSelector:function(){return t_},Typewriter:function(){return D_},URLInput:function(){return $b},URLInputButton:function(){return l_},URLPopover:function(){return kk},Warning:function(){return hr},WritingFlow:function(){return ac},__experimentalBlockAlignmentMatrixControl:function(){return Jh},__experimentalBlockContentOverlay:function(){return nv},__experimentalBlockFullHeightAligmentControl:function(){return Zh},__experimentalBlockPatternSetup:function(){return Gv},__experimentalBlockPatternsList:function(){return Vu},__experimentalBlockVariationPicker:function(){return Mv},__experimentalBlockVariationTransforms:function(){return Wv},__experimentalBorderRadiusControl:function(){return Ym},__experimentalBorderStyleControl:function(){return tf},__experimentalColorGradientControl:function(){return Bm},__experimentalColorGradientSettingsDropdown:function(){return xm},__experimentalDuotoneControl:function(){return ih},__experimentalFontAppearanceControl:function(){return zf},__experimentalFontFamilyControl:function(){return Xf},__experimentalGetBorderClassesAndStyles:function(){return _h},__experimentalGetColorClassesAndStyles:function(){return Eh},__experimentalGetGradientClass:function(){return uf},__experimentalGetGradientObjectByGradientValue:function(){return pf},__experimentalGetMatchingVariation:function(){return Uv},__experimentalGetSpacingClassesAndStyles:function(){return wh},__experimentalImageEditingProvider:function(){return Tb},__experimentalImageEditor:function(){return zb},__experimentalImageSizeControl:function(){return Hb},__experimentalImageURLInputUI:function(){return m_},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return Bg},__experimentalLibrary:function(){return w_},__experimentalLinkControl:function(){return dk},__experimentalLinkControlSearchInput:function(){return ok},__experimentalLinkControlSearchItem:function(){return qb},__experimentalLinkControlSearchResults:function(){return Qb},__experimentalListView:function(){return Sv},__experimentalPanelColorGradientSettings:function(){return cb},__experimentalPreviewOptions:function(){return f_},__experimentalResponsiveBlockControl:function(){return Xk},__experimentalTextDecorationControl:function(){return fg},__experimentalTextTransformControl:function(){return Eg},__experimentalToolsPanelColorDropdown:function(){return hf},__experimentalUnitControl:function(){return n_},__experimentalUseBlockPreview:function(){return bu},__experimentalUseBorderProps:function(){return yh},__experimentalUseColorProps:function(){return Sh},__experimentalUseCustomSides:function(){return qg},__experimentalUseGradient:function(){return ff},__experimentalUseNoRecursiveRenders:function(){return z_},__experimentalUseResizeCanvas:function(){return g_},__unstableBlockSettingsMenuFirstItem:function(){return Fp},__unstableEditorStyles:function(){return mu},__unstableIframe:function(){return dc},__unstableInserterMenuExtension:function(){return gd},__unstableRichTextInputEvent:function(){return Jk},__unstableUseBlockSelectionClearer:function(){return Qa},__unstableUseClipboardHandler:function(){return Np},__unstableUseMouseMoveTypingReset:function(){return P_},__unstableUseTypewriter:function(){return A_},__unstableUseTypingObserver:function(){return N_},createCustomColorsHOC:function(){return Ph},getColorClassName:function(){return Mm},getColorObjectByAttributeValues:function(){return Pm},getColorObjectByColorValue:function(){return Nm},getFontSize:function(){return tg},getFontSizeClass:function(){return og},getFontSizeObjectByValue:function(){return ng},getGradientSlugByValue:function(){return mf},getGradientValueBySlug:function(){return df},getPxFromCssUnit:function(){return Y_},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return uu},useBlockDisplayInformation:function(){return zd},useBlockEditContext:function(){return Un},useBlockProps:function(){return Aa},useCachedTruthy:function(){return Bh},useInnerBlocksProps:function(){return gm},useSetting:function(){return mo},withColorContext:function(){return Jv},withColors:function(){return Nh},withFontSizes:function(){return Rh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return It},__experimentalGetAllowedBlocks:function(){return at},__experimentalGetAllowedPatterns:function(){return pt},__experimentalGetBlockListSettingsForBlocks:function(){return bt},__experimentalGetDirectInsertBlock:function(){return ct},__experimentalGetLastBlockAttributeChanges:function(){return yt},__experimentalGetParsedPattern:function(){return ut},__experimentalGetPatternTransformItems:function(){return ft},__experimentalGetPatternsByBlockTypes:function(){return mt},__experimentalGetReusableBlockTitle:function(){return kt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return _t},areInnerBlocksControlled:function(){return xt},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Ze},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Qe},didAutomaticChange:function(){return wt},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return Z},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return xe},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return gt},getBlockMode:function(){return Le},getBlockName:function(){return V},getBlockOrder:function(){return Be},getBlockParents:function(){return ae},getBlockParentsByBlockName:function(){return ce},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return ne},getBlockSelectionStart:function(){return te},getBlockTransformItems:function(){return it},getBlocks:function(){return $},getBlocksByClientId:function(){return Q},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return X},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return _e},getLowestCommonAncestorWithSelectedBlock:function(){return de},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return be},getMultiSelectedBlocksEndClientId:function(){return we},getMultiSelectedBlocksStartClientId:function(){return Se},getNextBlockClientId:function(){return fe},getPreviousBlockClientId:function(){return me},getSelectedBlock:function(){return ie},getSelectedBlockClientId:function(){return le},getSelectedBlockClientIds:function(){return he},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return ge},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return ht},getTemplate:function(){return We},getTemplateLock:function(){return $e},hasBlockMovingClientId:function(){return St},hasInserterItems:function(){return st},hasMultiSelection:function(){return Ne},hasSelectedBlock:function(){return re},hasSelectedInnerBlock:function(){return Te},isAncestorBeingDragged:function(){return ze},isAncestorMultiSelected:function(){return Ce},isBlockBeingDragged:function(){return Fe},isBlockHighlighted:function(){return Bt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ee},isBlockSelected:function(){return Ie},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Pe},isCaretWithinFormattedText:function(){return Ve},isDraggingBlocks:function(){return De},isFirstMultiSelectedBlock:function(){return ye},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return Ct},isSelectionEnabled:function(){return Re},isTyping:function(){return Ae},isValidTemplate:function(){return Ue},wasBlockJustInserted:function(){return Tt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return In},__unstableMarkLastChangeAsPersistent:function(){return Bn},__unstableMarkNextChangeAsNotPersistent:function(){return xn},__unstableSaveReusableBlock:function(){return wn},clearSelectedBlock:function(){return jt},duplicateBlocks:function(){return Nn},enterFormattedText:function(){return bn},exitFormattedText:function(){return kn},flashBlock:function(){return An},hideInsertionPoint:function(){return ln},insertAfterBlock:function(){return Rn},insertBeforeBlock:function(){return Mn},insertBlock:function(){return nn},insertBlocks:function(){return on},insertDefaultBlock:function(){return En},mergeBlocks:function(){return cn},moveBlockToPosition:function(){return tn},moveBlocksDown:function(){return Zt},moveBlocksToPosition:function(){return en},moveBlocksUp:function(){return Jt},multiSelect:function(){return $t},receiveBlocks:function(){return Ot},removeBlock:function(){return dn},removeBlocks:function(){return un},replaceBlock:function(){return Xt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Gt},selectPreviousBlock:function(){return Ht},selectionChange:function(){return yn},setBlockMovingClientId:function(){return Pn},setHasControlledInnerBlocks:function(){return Dn},setNavigationMode:function(){return Tn},setTemplateValidity:function(){return sn},showInsertionPoint:function(){return rn},startDraggingBlocks:function(){return hn},startMultiSelect:function(){return Ut},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return gn},synchronizeTemplate:function(){return an},toggleBlockHighlight:function(){return Ln},toggleBlockMode:function(){return mn},toggleSelection:function(){return Kt},updateBlock:function(){return zt},updateBlockAttributes:function(){return Ft},updateBlockListSettings:function(){return Cn},updateSettings:function(){return Sn},validateBlocksToTemplate:function(){return At}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const I=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!w(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var P,N,M=(0,m.combineReducers)({blocks:I,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=o;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=o;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,c=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!c)return n;if(!o.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some((e=>e.clientId===c)))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:T(n.selectionStart,o),selectionEnd:T(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=N?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=N?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(P)||((l=L()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}P={},N="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const z=[];function V(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function H(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function U(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const W=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&xt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Be(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Be(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=Be(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Q=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>U(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function Z(e,t){return Be(e,t).length}function J(e){return e.selection.selectionStart}function ee(e){return e.selection.selectionEnd}function te(e){return e.selection.selectionStart.clientId}function ne(e){return e.selection.selectionEnd.clientId}function oe(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ie(e){const t=le(e);return t?U(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ae=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ce=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ae(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ue(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function de(e,t){const n=le(e),o=[...ae(e,t),t],r=[...ae(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=le(e)),void 0===t&&(t=n<0?ke(e):_e(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function me(e,t){return pe(e,t,-1)}function fe(e,t){return pe(e,t,1)}function ge(e){return e.initialPosition}const he=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Be(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:he(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...he.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ke(e){return(0,u.first)(ve(e))||null}function _e(e){return(0,u.last)(ve(e))||null}function ye(e,t){return ke(e)===t}function Ee(e,t){return-1!==ve(e).indexOf(t)}const Ce=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ee(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Be(e,t){return e.blocks.order[t||""]||z}function xe(e,t){return Be(e,se(e,t)).indexOf(t)}function Ie(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Be(e,t),(t=>Ie(e,t)||Ee(e,t)||n&&Te(e,t,n)))}function Pe(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ne(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Re(e){return e.isSelectionEnabled}function Le(e,t){return e.blocksMode[t]||"visual"}function Ae(e){return e.isTyping}function De(e){return!!e.draggedBlocks.length}function Oe(e){return e.draggedBlocks}function Fe(e,t){return e.draggedBlocks.includes(t)}function ze(e,t){if(!De(e))return!1;const n=ae(e,t);return(0,u.some)(n,(t=>Fe(e,t)))}function Ve(e){return e.isCaretWithinFormattedText}function He(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=xe(e,r.clientId)+1):n=Be(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function Ue(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=gt(e,t);return n?n.templateLock:null}const je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ke=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=ht(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=gt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=je(u,t),p=n.parent,m=V(e,o),f=je(p,m),g=null===d&&null===f||!0===d||!0===f;return g?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):g},qe=D(Ke,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>qe(e,V(e,t),n)))}function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!$e(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Xe(e,t,n)))}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===$e(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ze(e,t,n)))}function et(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const tt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Ke(e,t.name,n),nt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=et(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ot(r,l)}},ot=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},rt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Q(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=et(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ot(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},lt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=rt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=et(e,l)||{},c=ot(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>tt(e,n,t))).map(n),a=Ke(e,"core/block",t)?Et(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=nt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),it=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=rt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>tt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>tt(e,n,t)));if(n)return!0;const o=Ke(e,"core/block",t)&&Et(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),at=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ut=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),dt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=ht(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ut(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=dt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return qe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),mt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=pt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...pt.getDependants(e,t)])),ft=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||xt(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return mt(e,o,n)}),((e,t)=>[...mt.getDependants(e,t)]));function gt(e,t){return e.blockListSettings[t]}function ht(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),kt=D(((e,t)=>{var n;const o=(0,u.find)(Et(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Et(e)]));function _t(e){return e.blocks.isIgnoredChange}function yt(e){return e.lastBlockAttributesChange}function Et(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function Ct(e){return e.isNavigationMode}function St(e){return e.hasBlockMovingClientId}function wt(e){return!!e.automaticChangeStatus}function Bt(e,t){return e.highlightedBlock===t}function xt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const It=D(((e,t)=>{if(!t.length)return null;const n=le(e);if(t.includes(V(e,n)))return n;const o=ve(e),r=ce(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Tt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Pt=window.wp.a11y,Nt=window.wp.richText,Mt=window.wp.deprecated,Rt=n.n(Mt);const Lt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(At(e))},At=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Dt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ot(e){return Rt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function zt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ht=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Gt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Ut(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Pt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Yt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=qt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Xt(e,t){return Yt(e,t)}const Qt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},Zt=Qt("MOVE_BLOCKS_DOWN"),Jt=Qt("MOVE_BLOCKS_UP"),en=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return en([e],t,n,o)}function nn(e,t,n,o,r){return on([e],t,n,o,0,r)}const on=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,Rt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=qt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function ln(){return{type:"HIDE_INSERTION_POINT"}}function sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const an=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},cn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Nt.insert)((0,Nt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",h,h);e.attributes[g]=(0,Nt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Nt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf(""),a=(0,Nt.remove)(i,s,s+1),p=(0,Nt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},un=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function dn(e,t){return un([e],t)}function pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fn(){return{type:"START_TYPING"}}function gn(){return{type:"STOP_TYPING"}}function hn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function vn(){return{type:"STOP_DRAGGING_BLOCKS"}}function bn(){return{type:"ENTER_FORMATTED_TEXT"}}function kn(){return{type:"EXIT_FORMATTED_TEXT"}}function yn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}const En=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Cn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Sn(e){return{type:"UPDATE_SETTINGS",settings:e}}function wn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Bn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function xn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const In=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Tn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Pt.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Pt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Pn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Pt.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Nn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Mn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Rn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Ln(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const An=e=>async t=>{let{dispatch:n}=t;n(Ln(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Ln(e,!1))};function Dn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const On="core/block-editor",Fn={reducer:M,selectors:e,actions:t},zn=(0,m.createReduxStore)(On,{...Fn,persist:["preferences"]});(0,m.registerStore)(On,{...Fn,persist:["preferences"]});const Vn={name:"",isSelected:!1},Hn=(0,s.createContext)(Vn),{Provider:Gn}=Hn;function Un(){return(0,s.useContext)(Hn)}function Wn(){const{isSelected:e,clientId:t,name:n}=Un();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(zn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function $n(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Wn(),{clientId:o}=Un(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(zn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function jn(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const Kn=$n;Kn.Slot=jn;const qn=e=>(0,s.createElement)($n,i({group:"inline"},e));qn.Slot=e=>(0,s.createElement)(jn,i({group:"inline"},e));var Yn=Kn,Xn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Qn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Zn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Jn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),to=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),no=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),oo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ro=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),lo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),io=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const co=["color","border","typography","spacing"],uo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},po={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function mo(e){const{name:t}=Un();return(0,m.useSelect)((n=>{var o;if(co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(zn).getSettings(),i=(e=>po[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=uo[i]?uo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}const fo={left:no,center:oo,right:ro,"space-between":lo};var go=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?fo[r]:fo.left,d=[{name:"left",icon:no,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function ho(e){return(0,s.createElement)(go,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(go,i({},e,{isToolbar:!0}))}const bo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ko={left:"flex-start",right:"flex-end",center:"center"},_o=["wrap","nowrap"];var yo={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:o=!0}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Eo,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,o&&(0,s.createElement)(So,{layout:t,onChange:n}))),(0,s.createElement)(Co,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l}=e;const{orientation:i="horizontal"}=r,a=null!==mo("spacing.blockGap"),c=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=bo[r.justifyContent]||bo.left,d=_o.includes(r.flexWrap)?r.flexWrap:"wrap",p=`\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tjustify-content: ${u};\n\t\t`,m=`\n\t\tflex-direction: column;\n\t\talign-items: ${ko[r.justifyContent]||ko.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ao(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Eo(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(ho,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,g.__)("Justify items left")},{value:"center",icon:oo,label:(0,g.__)("Justify items center")},{value:"right",icon:ro,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Co(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function So(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:io,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:so,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wo=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Bo=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(wo,{icon:Zn})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(wo,{icon:eo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:o,layout:r={},style:l}=e;const{contentSize:i,wideSize:a}=r,c=null!==mo("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${ao(o,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${ao(o,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t${ao(o,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t`,c&&(d+=`\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ao(o,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},yo];function xo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bo.find((t=>t.name===e))}const Io={type:"default"},To=(0,s.createContext)(Io),Po=To.Provider;function No(){return(0,s.useContext)(To)}function Mo(e){let{layout:t={},...n}=e;const o=xo(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Ro=["none","left","center","right","wide","full"],Lo=["wide","full"];function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ro;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=No(),r=xo(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Ro}=o,s=e.filter((e=>(o.alignments||t||!Lo.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Do={none:{icon:Xn,title:(0,g.__)("None")},left:{icon:Qn,title:(0,g.__)("Align left")},center:{icon:Zn,title:(0,g.__)("Align center")},right:{icon:Jn,title:(0,g.__)("Align right")},wide:{icon:eo,title:(0,g.__)("Wide width")},full:{icon:to,title:(0,g.__)("Full width")}},Oo={isAlternate:!0};var Fo=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ao(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Do[t],m=Do.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Do[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Do[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};function zo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!1}))}function Vo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!0}))}const Ho=["left","center","right","wide","full"],Go=["wide","full"];function Uo(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Ho.filter((t=>e.includes(t))):!0===e?[...Ho]:[],!o||!0===e&&!n?(0,u.without)(t,...Go):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zo,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$o=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ho,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$o),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wo),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Uo((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e})),window.wp.warning;var jo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Ko(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Wn(),l=null===(t=jo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const qo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,qo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Yo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Xo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Yo(c.attributes,e,t)})}))})),c}function Qo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(zn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(zn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:qo(r.style)},t[n]=r})),r(n,t,!0)}),[qo,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Zo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Jo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=jo[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Qo,{group:n,label:o},(0,s.createElement)(Zo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const er=Ko;er.Slot=Jo;const tr=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));tr.Slot=e=>(0,s.createElement)(Jo,i({},e,{__experimentalGroup:"advanced"})),tr.slotName="InspectorAdvancedControls";var nr=er;const or=/[\s#]/g,rr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(or,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(nr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(nr,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",rr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const lr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(nr,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",lr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const ir=[{name:"padding",generate:(e,t)=>function(e,t,n,o){const r=(0,u.get)(e,["spacing","padding"]);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const o=(0,u.get)(r,[n]);return o&&e.push({selector:t.selector,key:`padding${(0,u.upperFirst)(n)}`,value:o}),e}),[]);l.push(...e)}return l}(e,t,0,"padding")}];function sr(e,t){const n=[];return ir.forEach((o=>{n.push(...o.generate(e,t))})),n}var ar=window.wp.dom;const cr=(0,s.createContext)({});function ur(e){let{value:t,children:n}=e;const o=(0,s.useContext)(cr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(cr.Provider,{value:r,children:n})}var dr=cr;const pr={};var mr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(dr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):pr),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function fr(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Gn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(mr,e))}var gr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),hr=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:gr,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},vr=n(1973);function br(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,ar.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var kr=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,vr.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(br,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(br,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const _r=e=>(0,r.rawHandler)({HTML:e.originalContent});var yr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(zn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(zn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,_r(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
-
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
10 |
-
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(kr,{block:i,onKeep:t,onConvert:n,convertor:_r,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Er=(0,s.createElement)(hr,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var Cr=()=>Er;class Sr extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var wr=Sr,Br=n(773),xr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(zn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Br.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),c=!n||(0,r.isValidBlockContent)(e,s,a);i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Ir=Ur();const Tr=e=>zr(e,Ir);let Pr=Ur();Tr.write=e=>zr(e,Pr);let Nr=Ur();Tr.onStart=e=>zr(e,Nr);let Mr=Ur();Tr.onFrame=e=>zr(e,Mr);let Rr=Ur();Tr.onFinish=e=>zr(e,Rr);let Lr=[];Tr.setTimeout=(e,t)=>{let n=Tr.now()+t,o=()=>{let e=Lr.findIndex((e=>e.cancel==o));~e&&Lr.splice(e,1),$r.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Lr.splice(Ar(n),0,r),$r.count+=1,Vr(),r};let Ar=e=>~(~Lr.findIndex((t=>t.time>e))||~Lr.length);Tr.cancel=e=>{Ir.delete(e),Pr.delete(e)},Tr.sync=e=>{Fr=!0,Tr.batchedUpdates(e),Fr=!1},Tr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Tr.onStart(n)}return o.handler=e,o.cancel=()=>{Nr.delete(n),t=null},o};let Dr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Tr.use=e=>Dr=e,Tr.now="undefined"!=typeof performance?()=>performance.now():Date.now,Tr.batchedUpdates=e=>e(),Tr.catch=console.error,Tr.frameLoop="always",Tr.advance=()=>{"demand"!==Tr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Gr()};let Or=-1,Fr=!1;function zr(e,t){Fr?(t.delete(e),e(0)):(t.add(e),Vr())}function Vr(){Or<0&&(Or=0,"demand"!==Tr.frameLoop&&Dr(Hr))}function Hr(){~Or&&(Dr(Hr),Tr.batchedUpdates(Gr))}function Gr(){let e=Or;Or=Tr.now();let t=Ar(Or);t&&(Wr(Lr.splice(0,t),(e=>e.handler())),$r.count-=t),Nr.flush(),Ir.flush(e?Math.min(64,Or-e):16.667),Mr.flush(),Pr.flush(),Rr.flush()}function Ur(){let e=new Set,t=e;return{add(n){$r.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>($r.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,$r.count-=t.size,Wr(t,(t=>t(n)&&e.add(t))),$r.count+=e.size,t=e)}}}function Wr(e,t){e.forEach((e=>{try{t(e)}catch(e){Tr.catch(e)}}))}const $r={count:0,clear(){Or=-1,Lr=[],Nr=Ur(),Ir=Ur(),Mr=Ur(),Pr=Ur(),Rr=Ur(),$r.count=0}};var jr=n(9196),Kr=n.n(jr);function qr(){}const Yr={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Xr(e,t){if(Yr.arr(e)){if(!Yr.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Qr=(e,t)=>e.forEach(t);function Zr(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Jr=e=>Yr.und(e)?[]:Yr.arr(e)?e:[e];function el(e,t){if(e.size){const n=Array.from(e);e.clear(),Qr(n,t)}}const tl=(e,...t)=>el(e,(e=>e(...t)));let nl,ol,rl=null,ll=!1,il=qr;var sl=Object.freeze({__proto__:null,get createStringInterpolator(){return nl},get to(){return ol},get colors(){return rl},get skipAnimation(){return ll},get willAdvance(){return il},assign:e=>{e.to&&(ol=e.to),e.now&&(Tr.now=e.now),void 0!==e.colors&&(rl=e.colors),null!=e.skipAnimation&&(ll=e.skipAnimation),e.createStringInterpolator&&(nl=e.createStringInterpolator),e.requestAnimationFrame&&Tr.use(e.requestAnimationFrame),e.batchedUpdates&&(Tr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(il=e.willAdvance),e.frameLoop&&(Tr.frameLoop=e.frameLoop)}});const al=new Set;let cl=[],ul=[],dl=0;const pl={get idle(){return!al.size&&!cl.length},start(e){dl>e.priority?(al.add(e),Tr.onStart(ml)):(fl(e),Tr(hl))},advance:hl,sort(e){if(dl)Tr.onFrame((()=>pl.sort(e)));else{const t=cl.indexOf(e);~t&&(cl.splice(t,1),gl(e))}},clear(){cl=[],al.clear()}};function ml(){al.forEach(fl),al.clear(),Tr(hl)}function fl(e){cl.includes(e)||gl(e)}function gl(e){cl.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(cl),0,e)}function hl(e){const t=ul;for(let n=0;n<cl.length;n++){const o=cl[n];dl=o.priority,o.idle||(il(o),o.advance(e),o.idle||t.push(o))}return dl=0,ul=cl,ul.length=0,cl=t,cl.length>0}const vl="[-+]?\\d*\\.?\\d+",bl=vl+"%";function kl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const _l=new RegExp("rgb"+kl(vl,vl,vl)),yl=new RegExp("rgba"+kl(vl,vl,vl,vl)),El=new RegExp("hsl"+kl(vl,bl,bl)),Cl=new RegExp("hsla"+kl(vl,bl,bl,vl)),Sl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,wl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Bl=/^#([0-9a-fA-F]{6})$/,xl=/^#([0-9a-fA-F]{8})$/;function Il(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Tl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Il(r,o,e+1/3),i=Il(r,o,e),s=Il(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Pl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Nl(e){return(parseFloat(e)%360+360)%360/360}function Ml(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Rl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ll(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Bl.exec(e))?parseInt(t[1]+"ff",16)>>>0:rl&&void 0!==rl[e]?rl[e]:(t=_l.exec(e))?(Pl(t[1])<<24|Pl(t[2])<<16|Pl(t[3])<<8|255)>>>0:(t=yl.exec(e))?(Pl(t[1])<<24|Pl(t[2])<<16|Pl(t[3])<<8|Ml(t[4]))>>>0:(t=Sl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=xl.exec(e))?parseInt(t[1],16)>>>0:(t=wl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=El.exec(e))?(255|Tl(Nl(t[1]),Rl(t[2]),Rl(t[3])))>>>0:(t=Cl.exec(e))?(Tl(Nl(t[1]),Rl(t[2]),Rl(t[3]))|Ml(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Al=(e,t,n)=>{if(Yr.fun(e))return e;if(Yr.arr(e))return Al({range:e,output:t,extrapolate:n});if(Yr.str(e.output[0]))return nl(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Dl(){return(Dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Ol=Symbol.for("FluidValue.get"),Fl=Symbol.for("FluidValue.observers"),zl=e=>Boolean(e&&e[Ol]),Vl=e=>e&&e[Ol]?e[Ol]():e,Hl=e=>e[Fl]||null;function Gl(e,t){let n=e[Fl];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ul{constructor(e){if(this[Ol]=void 0,this[Fl]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Wl(this,e)}}const Wl=(e,t)=>Kl(e,Ol,t);function $l(e,t){if(e[Ol]){let n=e[Fl];n||Kl(e,Fl,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function jl(e,t){let n=e[Fl];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Fl]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Kl=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ql=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Yl=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Xl;const Ql=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Zl=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Jl=e=>{Xl||(Xl=rl?new RegExp(`(${Object.keys(rl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Vl(e).replace(Yl,Ll).replace(Xl,Ll))),n=t.map((e=>e.match(ql).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Al(Dl({},e,{output:t}))));return e=>{let n=0;return t[0].replace(ql,(()=>String(o[n++](e)))).replace(Ql,Zl)}},ei="react-spring: ",ti=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ei}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},ni=ti(console.warn),oi=ti(console.warn);function ri(e){return Yr.str(e)&&("#"==e[0]||/\d/.test(e)||e in(rl||{}))}const li=e=>(0,jr.useEffect)(e,ii),ii=[];function si(){const e=(0,jr.useState)()[1],t=(0,jr.useState)(ai)[0];return li(t.unmount),()=>{t.current&&e({})}}function ai(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ci(e){const t=(0,jr.useRef)();return(0,jr.useEffect)((()=>{t.current=e})),t.current}const ui="undefined"!=typeof window&&window.document&&window.document.createElement?jr.useLayoutEffect:jr.useEffect,di=Symbol.for("Animated:node"),pi=e=>e&&e[di],mi=(e,t)=>{return n=e,o=di,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},fi=e=>e&&e[di]&&e[di].getPayload();class gi{constructor(){this.payload=void 0,mi(this,this)}getPayload(){return this.payload||[]}}class hi extends gi{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Yr.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new hi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Yr.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Yr.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class vi extends hi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Al({output:[e,e]})}static create(e){return new vi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Yr.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Al({output:[this.getValue(),e]})),this._value=0,super.reset()}}const bi={dependencies:null};class ki extends gi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Zr(this.source,((n,o)=>{var r;(r=n)&&r[di]===r?t[o]=n.getValue(e):zl(n)?t[o]=Vl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Qr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Zr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){bi.dependencies&&zl(e)&&bi.dependencies.add(e);const t=fi(e);t&&Qr(t,(e=>this.add(e)))}}class _i extends ki{constructor(e){super(e)}static create(e){return new _i(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(yi)),!0)}}function yi(e){return(ri(e)?vi:hi).create(e)}function Ei(e){const t=pi(e);return t?t.constructor:Yr.arr(e)?_i:ri(e)?vi:hi}function Ci(){return(Ci=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Si=(e,t)=>{const n=!Yr.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,jr.forwardRef)(((o,r)=>{const l=(0,jr.useRef)(null),i=n&&(0,jr.useCallback)((e=>{l.current=function(e,t){return e&&(Yr.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return bi.dependencies=n,e.style&&(e=Ci({},e,{style:t.createAnimatedStyle(e.style)})),e=new ki(e),bi.dependencies=null,[e,n]}(o,t),c=si(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new wi(u,a),p=(0,jr.useRef)();ui((()=>{const e=p.current;p.current=d,Qr(a,(e=>$l(e,d))),e&&(Qr(e.deps,(t=>jl(t,e))),Tr.cancel(e.update))})),(0,jr.useEffect)(u,[]),li((()=>()=>{const e=p.current;Qr(e.deps,(t=>jl(t,e)))}));const m=t.getComponentProps(s.getValue());return jr.createElement(e,Ci({},m,{ref:i}))}))};class wi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Tr.write(this.update)}}const Bi=Symbol.for("AnimatedComponent"),xi=e=>Yr.str(e)?e:e&&Yr.str(e.displayName)?e.displayName:Yr.fun(e)&&e.name||null;function Ii(){return(Ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Ti(e,...t){return Yr.fun(e)?e(...t):e}const Pi=(e,t)=>!0===e||!!(t&&e&&(Yr.fun(e)?e(t):Jr(e).includes(t))),Ni=(e,t)=>Yr.obj(e)?t&&e[t]:e,Mi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ri=e=>e,Li=(e,t=Ri)=>{let n=Ai;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Yr.und(n)||(o[r]=n)}return o},Ai=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Di={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Oi(e){const t=function(e){const t={};let n=0;if(Zr(e,((e,o)=>{Di[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Zr(e,((e,o)=>o in t||(n[o]=e))),n}return Ii({},e)}function Fi(e){return e=Vl(e),Yr.arr(e)?e.map(Fi):ri(e)?sl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function zi(e){for(const t in e)return!0;return!1}function Vi(e){return Yr.fun(e)||Yr.arr(e)&&Yr.obj(e[0])}function Hi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Gi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ui=Ii({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Wi{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Ui)}}function $i(e,t){if(Yr.und(t.decay)){const n=!Yr.und(t.tension)||!Yr.und(t.friction);!n&&Yr.und(t.frequency)&&Yr.und(t.damping)&&Yr.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ji=[];class Ki{constructor(){this.changed=!1,this.values=ji,this.toValues=null,this.fromValues=ji,this.to=void 0,this.from=void 0,this.config=new Wi,this.immediate=!1}}function qi(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Pi(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Yr.und(n.pause)||(r.paused=Pi(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Pi(e,t)),c=Ti(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-Tr.now()}function m(){c>0?(u=Tr.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ii({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Yi=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Zi(e.get()):t.every((e=>e.noop))?Xi(e.get()):Qi(e.get(),t.every((e=>e.finished))),Xi=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Qi=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Zi=e=>({value:e,cancelled:!0,finished:!1});function Ji(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Li(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Zi(o)||r!==n.asyncId&&Qi(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new ts,i=new ns;return(async()=>{if(sl.skipAnimation)throw es(n),i.result=Qi(o,!1),d(i),i;m(l);const s=Yr.obj(e)?Ii({},e):Ii({},t,{to:e});s.parentId=r,Zr(c,((e,t)=>{Yr.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let g;if(sl.skipAnimation)return es(n),Qi(o,!1);try{let t;t=Yr.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Qi(o.get(),!0,!1)}catch(e){if(e instanceof ts)g=e.result;else{if(!(e instanceof ns))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Yr.fun(i)&&Tr.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function es(e,t){el(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class ts extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class ns extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const os=e=>e instanceof ls;let rs=1;class ls extends Ul{constructor(...e){super(...e),this.id=rs++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=pi(this);return e&&e.getValue()}to(...e){return sl.to(this,e)}interpolate(...e){return ni(`${ei}The "interpolate" function is deprecated in v9 (use "to" instead)`),sl.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Gl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||pl.sort(this),Gl(this,{type:"priority",parent:this,priority:e})}}const is=Symbol.for("SpringPhase"),ss=e=>(1&e[is])>0,as=e=>(2&e[is])>0,cs=e=>(4&e[is])>0,us=(e,t)=>t?e[is]|=3:e[is]&=-3,ds=(e,t)=>t?e[is]|=4:e[is]&=-5;class ps extends ls{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ki,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Yr.und(e)||!Yr.und(t)){const n=Yr.obj(e)?Ii({},e):Ii({},t,{from:e});Yr.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(as(this)||this._state.asyncTo)||cs(this)}get goal(){return Vl(this.animation.to)}get velocity(){const e=pi(this);return e instanceof hi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ss(this)}get isAnimating(){return as(this)}get isPaused(){return cs(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=fi(o.to);!i&&zl(o.to)&&(l=Jr(Vl(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==vi?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Yr.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Yr.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Yr.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=pi(this),a=s.getValue();if(t){const e=Vl(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Tr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(as(this)){const{to:e,config:t}=this.animation;Tr.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Yr.und(e)?(n=this.queue||[],this.queue=[]):n=[Yr.obj(e)?e:Ii({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Yi(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),es(this._state,e&&this._lastCallId),Tr.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Yr.obj(n)?n[t]:n,(null==n||Vi(n))&&(n=void 0),o=Yr.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return ss(this)||(e.reverse&&([n,o]=[o,n]),o=Vl(o),Yr.und(o)?pi(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ii({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Li(n,((e,t)=>/^on/.test(t)?Ni(e,o):e))),ks(this,n,"onProps"),_s(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return qi(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{cs(this)||(ds(this,!0),tl(i.pauseQueue),_s(this,"onPause",Qi(this,ms(this,this.animation.to)),this))},resume:()=>{cs(this)&&(ds(this,!1),as(this)&&this._resume(),tl(i.resumeQueue),_s(this,"onResume",Qi(this,ms(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=fs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Zi(this));const o=!Yr.und(e.to),r=!Yr.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Zi(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Yr.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Xr(d,c);p&&(s.from=d),d=Vl(d);const m=!Xr(u,a);m&&this._focus(u);const f=Vi(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&($i(n=Ii({},n),t),t=Ii({},n,t)),$i(e,t),Object.assign(e,t);for(const t in Ui)null==e[t]&&(e[t]=Ui[t]);let{mass:o,frequency:r,damping:l}=e;Yr.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,Ti(t.config,l),t.config!==i.config?Ti(i.config,l):void 0);let b=pi(this);if(!b||Yr.und(u))return n(Qi(this,!0));const k=Yr.und(t.reset)?r&&!t.default:!Yr.und(d)&&Pi(t.reset,l),_=k?d:this.get(),y=Fi(u),E=Yr.num(y)||Yr.arr(y)||ri(y),C=!f&&(!E||Pi(i.immediate||t.immediate,l));if(m){const e=Ei(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=zl(u),B=!1;if(!w){const e=k||!ss(this)&&p;(m||e)&&(B=Xr(Fi(_),y),w=!B),(Xr(s.immediate,C)||C)&&Xr(g.decay,h)&&Xr(g.velocity,v)||(w=!0)}if(B&&as(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||zl(a))&&(s.values=b.getPayload(),s.toValues=zl(u)?null:S==vi?[1]:Jr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Qr(bs,(e=>ks(this,t,e)));const o=Qi(this,ms(this,a));tl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Tr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Ti(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ji(t.to,t,this._state,this)):w?this._start():as(this)&&!m?this._pendingCalls.add(n):n(Xi(_))}_focus(e){const t=this.animation;e!==t.to&&(Hl(this)&&this._detach(),t.to=e,Hl(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;zl(t)&&($l(t,this),os(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;zl(e)&&jl(e,this)}_set(e,t=!0){const n=Vl(e);if(!Yr.und(n)){const e=pi(this);if(!e||!Xr(n,e.getValue())){const o=Ei(n);e&&e.constructor==o?e.setValue(n):mi(this,o.create(n)),e&&Tr.batchedUpdates((()=>{this._onChange(n,t)}))}}return pi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,_s(this,"onStart",Qi(this,ms(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ti(this.animation.onChange,e,this)),Ti(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;pi(this).reset(Vl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),as(this)||(us(this,!0),cs(this)||this._resume())}_resume(){sl.skipAnimation?this.finish():pl.start(this)}_stop(e,t){if(as(this)){us(this,!1);const n=this.animation;Qr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Gl(this,{type:"idle",parent:this});const o=t?Zi(this.get()):Qi(this.get(),ms(this,null!=e?e:n.to));tl(this._pendingCalls,o),n.changed&&(n.changed=!1,_s(this,"onRest",o,this))}}}function ms(e,t){const n=Fi(t);return Xr(Fi(e.get()),n)}function fs(e,t=e.loop,n=e.to){let o=Ti(t);if(o){const r=!0!==o&&Oi(o),l=(r||e).reverse,i=!r||r.reset;return gs(Ii({},e,{loop:t,default:!1,pause:void 0,to:!l||Vi(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function gs(e){const{to:t,from:n}=e=Oi(e),o=new Set;return Yr.obj(t)&&vs(t,o),Yr.obj(n)&&vs(n,o),e.keys=o.size?Array.from(o):null,e}function hs(e){const t=gs(e);return Yr.und(t.default)&&(t.default=Li(t)),t}function vs(e,t){Zr(e,((e,n)=>null!=e&&t.add(n)))}const bs=["onStart","onRest","onChange","onPause","onResume"];function ks(e,t,n){e.animation[n]=t[n]!==Mi(t,n)?Ni(t[n],e.key):void 0}function _s(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const ys=["onStart","onChange","onRest"];let Es=1;class Cs{constructor(e,t){this.id=Es++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Ii({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Yr.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(gs(e)),this}start(e){let{queue:t}=this;return e?t=Jr(e).map(gs):this.queue=[],this._flush?this._flush(this,t):(Ps(this,t),Ss(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Qr(Jr(t),(t=>n[t].stop(!!e)))}else es(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Yr.und(e))this.start({pause:!0});else{const t=this.springs;Qr(Jr(e),(e=>t[e].pause()))}return this}resume(e){if(Yr.und(e))this.start({pause:!1});else{const t=this.springs;Qr(Jr(e),(e=>t[e].resume()))}return this}each(e){Zr(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,el(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&el(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,el(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Tr.onFrame(this._onFrame)}}function Ss(e,t){return Promise.all(t.map((t=>ws(e,t)))).then((t=>Yi(e,t)))}async function ws(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Yr.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Yr.arr(r)||Yr.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Qr(ys,(n=>{const o=t[n];if(Yr.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,tl(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Mi(t,"cancel");(u||m&&d.asyncId)&&p.push(qi(++e._lastAsyncId,{props:t,state:d,actions:{pause:qr,resume:qr,start(t,n){m?(es(d,e._lastAsyncId),n(Zi(e))):(t.onRest=s,n(Ji(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Yi(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=fs(t,i,r);if(n)return Ps(e,[n]),ws(e,n,!0)}return a&&Tr.batchedUpdates((()=>a(f,e,e.item))),f}function Bs(e,t){const n=Ii({},e.springs);return t&&Qr(Jr(t),(e=>{Yr.und(e.keys)&&(e=gs(e)),Yr.obj(e.to)||(e=Ii({},e,{to:void 0})),Ts(n,e,(e=>Is(e)))})),xs(e,n),n}function xs(e,t){Zr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,$l(t,e))}))}function Is(e,t){const n=new ps;return n.key=e,t&&$l(n,t),n}function Ts(e,t,n){t.keys&&Qr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ps(e,t){Qr(t,(t=>{Ts(e.springs,t,(t=>Is(t,e)))}))}const Ns=["children"],Ms=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Ns);const o=(0,jr.useContext)(Rs),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,jr.useState)((()=>({inputs:t,result:e()}))),o=(0,jr.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,jr.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Rs;return jr.createElement(i,{value:n},t)},Rs=(Ls=Ms,As={},Object.assign(Ls,jr.createContext(As)),Ls.Provider._context=Ls,Ls.Consumer._context=Ls,Ls);var Ls,As;Ms.Provider=Rs.Provider,Ms.Consumer=Rs.Consumer;const Ds=()=>{const e=[],t=function(t){oi(`${ei}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Qr(e,((e,r)=>{if(Yr.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Qr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Qr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Qr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Qr(e,((e,o)=>{if(Yr.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Qr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Qr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Yr.fun(e)?e(n,t):e};return t._getProps=n,t};function Os(e,t,n){const o=Yr.fun(t)&&t;o&&!n&&(n=[]);const r=(0,jr.useMemo)((()=>o||3==arguments.length?Ds():void 0),[]),l=(0,jr.useRef)(0),i=si(),s=(0,jr.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Bs(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ss(e,t):new Promise((o=>{xs(e,n),s.queue.push((()=>{o(Ss(e,t))})),i()}))}})),[]),a=(0,jr.useRef)([...s.ctrls]),c=[],u=ci(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new Cs(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=hs(n))}}(0,jr.useMemo)((()=>{Qr(a.current.slice(e,u),(e=>{Hi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,jr.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Bs(e,c[t]))),m=(0,jr.useContext)(Ms),f=ci(m),g=m!==f&&zi(m);ui((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Qr(e,(e=>e()))),Qr(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Gi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),li((()=>()=>{Qr(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Ii({},e)));return r?[h,r]:h}let Fs;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Fs||(Fs={}));class zs extends ls{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Al(...t);const n=this._get(),o=Ei(n);mi(this,o.create(n))}advance(e){const t=this._get();Xr(t,this.get())||(pi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Hs(this._active)&&Gs(this)}_get(){const e=Yr.arr(this.source)?this.source.map(Vl):Jr(Vl(this.source));return this.calc(...e)}_start(){this.idle&&!Hs(this._active)&&(this.idle=!1,Qr(fi(this),(e=>{e.done=!1})),sl.skipAnimation?(Tr.batchedUpdates((()=>this.advance())),Gs(this)):pl.start(this))}_attach(){let e=1;Qr(Jr(this.source),(t=>{zl(t)&&$l(t,this),os(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Qr(Jr(this.source),(e=>{zl(e)&&jl(e,this)})),this._active.clear(),Gs(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Jr(this.source).reduce(((e,t)=>Math.max(e,(os(t)?t.priority:0)+1)),0))}}function Vs(e){return!1!==e.idle}function Hs(e){return!e.size||Array.from(e).every(Vs)}function Gs(e){e.idle||(e.idle=!0,Qr(fi(e),(e=>{e.done=!0})),Gl(e,{type:"idle",parent:e}))}sl.assign({createStringInterpolator:Jl,to:(e,t)=>new zs(e,t)}),pl.advance;var Us=window.ReactDOM;function Ws(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const $s=["style","children","scrollTop","scrollLeft"],js=/^--/;function Ks(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||js.test(e)||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}const qs={};let Ys={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Xs=["Webkit","Ms","Moz","O"];Ys=Object.keys(Ys).reduce(((e,t)=>(Xs.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ys);const Qs=["x","y","z"],Zs=/^(matrix|translate|scale|rotate|skew)/,Js=/^(translate)/,ea=/^(rotate|skew)/,ta=(e,t)=>Yr.num(e)&&0!==e?e+t:e,na=(e,t)=>Yr.arr(e)?e.every((e=>na(e,t))):Yr.num(e)?e===t:parseFloat(e)===t;class oa extends ki{constructor(e){let{x:t,y:n,z:o}=e,r=Ws(e,Qs);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ta(e,"px"))).join(",")})`,na(e,0)]))),Zr(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Zs.test(t)){if(delete r[t],Yr.und(e))return;const n=Js.test(t)?"px":ea.test(t)?"deg":"";l.push(Jr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ta(r,n)})`,na(r,0)]:e=>[`${t}(${e.map((e=>ta(e,n))).join(",")})`,na(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new ra(l,i)),super(r)}}class ra extends Ul{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Qr(this.inputs,((n,o)=>{const r=Vl(n[0]),[l,i]=this.transforms[o](Yr.arr(r)?r:n.map(Vl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Qr(this.inputs,(e=>Qr(e,(e=>zl(e)&&$l(e,this)))))}observerRemoved(e){0==e&&Qr(this.inputs,(e=>Qr(e,(e=>zl(e)&&jl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Gl(this,e)}}const la=["scrollTop","scrollLeft"];sl.assign({batchedUpdates:Us.unstable_batchedUpdates,createStringInterpolator:Jl,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const ia=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ki(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=xi(e)||"Anonymous";return(e=Yr.str(e)?l[e]||(l[e]=Si(e,r)):e[Bi]||(e[Bi]=Si(e,r))).displayName=`Animated(${t})`,e};return Zr(e,((t,n)=>{Yr.arr(e)&&(n=xi(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=Ws(o,$s),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:qs[t]||(qs[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Ks(t,r[t]);js.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new oa(e),getComponentProps:e=>Ws(e,la)}).animated,sa=e=>e+1,aa=e=>({top:e.offsetTop,left:e.offsetLeft});var ca=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(sa,0),[u,p]=(0,s.useReducer)(sa,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?aa(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,ar.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=aa(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Yr.fun(e),[[o],r]=Os(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const ua=".block-editor-block-list__block",da=".block-list-appender";function pa(e,t){return t.closest([ua,da].join(","))===e}function ma(e,t){e.parentElement.closest("[contenteditable]").contentEditable=t}function fa(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(zn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function g(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void ma(u,!1);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ua);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(ma(u,!1),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function h(){d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),f=p.requestAnimationFrame((()=>{g({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",g),p.addEventListener("mouseup",h),ma(u,!0))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(ma(u,!0),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function ga(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(zn);if(l(e)&&!o()&&!r())return n()}),[e])}(e);return(0,s.useEffect)((()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const o=ar.focus.tabbable.find(t.current).filter((e=>(0,ar.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;pa(t.current,l)?(ma(t.current,!1),(0,ar.placeCaretAtHorizontalEdge)(l,r)):t.current.focus()}),[n]),t}function ha(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function va(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(zn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",ha),t.addEventListener("mouseover",ha),()=>{t.removeEventListener("mouseout",ha),t.removeEventListener("mouseover",ha),t.classList.remove("is-hovered")}}),[e])}function ba(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(zn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function ka(e){return(0,m.useSelect)((t=>{const n=t(zn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function _a(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(zn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function ya(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(zn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function Ea(e){const{isBlockSelected:t}=(0,m.useSelect)(zn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):pa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Ca=window.wp.keycodes;function Sa(e){const t=(0,m.useSelect)((t=>t(zn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(zn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Ca.ENTER&&s!==Ca.BACKSPACE&&s!==Ca.DELETE||a!==i||(0,ar.isTextField)(a)||(t.preventDefault(),s===Ca.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function wa(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(zn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}var Ba=n(5425),xa=n.n(Ba);function Ia(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(zn);return n(e)||o()===e}),[e]);return(0,s.useEffect)((()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=(0,ar.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&xa()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Ta=(0,s.createContext)({refs:new Map,callbacks:new Map});function Pa(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Ta.Provider,{value:n},t)}function Na(e){const{refs:t,callbacks:n}=(0,s.useContext)(Ta),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Ma(e){const{refs:t}=(0,s.useContext)(Ta),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Ra(e){const{callbacks:t}=(0,s.useContext)(Ta),n=Ma(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function La(){const e=(0,s.useContext)(bm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Aa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(Da),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(zn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ga(n),Ia(n),Na(n),Ea(n),fa(n),Sa(n),wa(n),va(),La(),ca({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Un();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,ba(n),ka(n),_a(n),ya(n)),style:{...l.style,...e.style}}}Aa.save=r.__unstableGetBlockProps;const Da=(0,s.createContext)();function Oa(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Aa(o,{__unstableIsHtml:n}),t)}const Fa=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(zn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),za=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(zn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(zn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(zn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(zn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Va=(0,d.compose)(d.pure,Fa,za,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{mode:n,isLocked:o,canRemove:l,clientId:i,isSelected:a,isSelectionEnabled:d,className:p,name:f,isValid:g,attributes:h,wrapperProps:v,setAttributes:b,onReplace:k,onInsertBlocksAfter:_,onMerge:y,toggleSelection:E}=e;const C=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),{removeBlock:S}=(0,m.useDispatch)(zn),w=(0,s.useCallback)((()=>S(i)),[i]);let B=(0,s.createElement)(fr,{name:f,isSelected:a,attributes:h,setAttributes:b,insertBlocksAfter:o?void 0:_,onReplace:l?k:void 0,onRemove:l?w:void 0,mergeBlocks:l?y:void 0,clientId:i,isSelectionEnabled:d,toggleSelection:E});const x=(0,r.getBlockType)(f);null!=x&&x.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(v,x.getEditWrapperProps(h)));const I=v&&!!v["data-align"]&&!C;let T;if(I&&(B=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},B)),g)T="html"===n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},B),(0,s.createElement)(Oa,{isHtml:!0},(0,s.createElement)(xr,{clientId:i}))):(null==x?void 0:x.apiVersion)>1?B:(0,s.createElement)(Oa,v,B);else{const e=(0,r.getSaveContent)(x,h);T=(0,s.createElement)(Oa,{className:"has-warning"},(0,s.createElement)(yr,{clientId:i}),(0,s.createElement)(s.RawHTML,null,(0,ar.safeHTML)(e)))}const P={clientId:i,className:null!==(t=v)&&void 0!==t&&t["data-align"]&&C?c()(p,`align${v["data-align"]}`):p,wrapperProps:(0,u.omit)(v,["data-align"]),isAligned:I},N=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Da.Provider,{value:N},(0,s.createElement)(wr,{fallback:(0,s.createElement)(Oa,{className:"has-warning"},(0,s.createElement)(Cr,null))},T))})),Ha=window.wp.htmlEntities,Ga=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Ua=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Wa=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Ua.length));return(0,s.createElement)(p.Tip,null,Ua[e])},$a=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),ja=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:$a});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Ka=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Rt()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(ja,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function qa(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(zn),{getBlockName:h,getBlocks:v}=a.select(zn),b=(0,m.useSelect)((e=>!t||e(zn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(zn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Ya=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(On,Fn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o(n)}),[n]),qa(e),(0,s.createElement)(Pa,null,t)}));function Xa(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(_m,null)))}function Qa(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(zn),{clearSelectedBlock:n}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Za(e){return(0,s.createElement)("div",i({ref:Qa()},e))}function Ja(e,t){const n="start"===t?"firstChild":"lastChild",o="start"===t?"nextSibling":"previousSibling";for(;e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[o];)e=e[o];return e}function ec(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l()}}function tc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r}=(0,m.useSelect)(ec,[]),l=Ma(r),i=Ma((0,u.first)(n)),s=Ma((0,u.last)(n));return(0,d.useRefEffect)((a=>{const{ownerDocument:c}=a,{defaultView:u}=c;if(null==e)return;if(!o||t){if(!r||t)return;const e=u.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=l.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:d}=n;if(d<2)return;if(!i.current||!s.current)return;a.contentEditable=!0,a.focus();const p=u.getSelection(),m=c.createRange(),f=Ja(i.current,"start"),g=Ja(s.current,"end");m.setStartBefore(f),m.setEndAfter(g),p.removeAllRanges(),p.addRange(m)}),[o,t,n,r,e])}function nc(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function oc(e,t,n,o){let r,l=ar.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!ar.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function rc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(zn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((d=>{let p;function m(){p=null}function f(l){const i=e(),s=t(),a=n(),d=o(a||i),p=r(a||i),m=l?d:p;m&&(s===m?u(m):c(s||i,m))}function g(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function h(t){const{keyCode:l,target:i}=t,c=l===Ca.UP,u=l===Ca.DOWN,m=l===Ca.LEFT,h=l===Ca.RIGHT,v=c||m,b=m||h,k=c||u,_=b||k,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=k?ar.isVerticalEdge:ar.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:g)(v),t.preventDefault()));if(k?p||(p=(0,ar.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===Ca.UP||t===Ca.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,ar.isRTL)(i)?!v:v,{keepCaretInsideBlock:x}=s(),I=e();if(y){const e=n(),l=o(e||I),s=r(e||I);(v&&l||!v&&s)&&function(e,t){const n=oc(e,t,d);return!n||!function(e,t){return e.closest(ua)===t.closest(ua)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,ar.isVerticalEdge)(i,v)&&!x){const e=oc(i,v,d,!0);e&&((0,ar.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,ar.isHorizontalEdge)(i,B)&&!x){const e=oc(i,B,d);(0,ar.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",h),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",h)}}),[])}var lc=window.wp.keyboardShortcuts;function ic(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,lc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,ar.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function sc(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(zn),{setNavigationMode:a}=(0,m.useDispatch)(zn),c=(0,m.useSelect)((e=>e(zn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";ar.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Ca.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Ca.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if((nc(e.target)||e.target.getAttribute("data-block")===l())&&nc(ar.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Ca.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=ar.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,tc(),ic(),rc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var ac=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=sc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const cc="editor-styles-wrapper";function uc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var dc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=uc(null==a?void 0:a.styles),_=uc(null==a?void 0:a.scripts),y=Qa(),[E,C,S]=sc(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",(()=>{t()}))}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),x=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${cc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:x,className:c()(cc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),pc={grad:.9,turn:360,rad:360/(2*Math.PI)},mc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},fc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},gc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},hc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},vc=function(e){return{r:gc(e.r,0,255),g:gc(e.g,0,255),b:gc(e.b,0,255),a:gc(e.a)}},bc=function(e){return{r:fc(e.r),g:fc(e.g),b:fc(e.b),a:fc(e.a,3)}},kc=/^#([0-9a-f]{3,8})$/i,_c=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},yc=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Ec=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Cc=function(e){return{h:hc(e.h),s:gc(e.s,0,100),l:gc(e.l,0,100),a:gc(e.a)}},Sc=function(e){return{h:fc(e.h),s:fc(e.s),l:fc(e.l),a:fc(e.a,3)}},wc=function(e){return Ec((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},Bc=function(e){return{h:(t=yc(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},xc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ic=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nc={string:[[function(e){var t=kc.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?fc(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?fc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Tc.exec(e)||Pc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:vc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=xc.exec(e)||Ic.exec(e);if(!t)return null;var n,o,r=Cc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(pc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return wc(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return mc(t)&&mc(n)&&mc(o)?vc({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!mc(t)||!mc(n)||!mc(o))return null;var i=Cc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return wc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!mc(t)||!mc(n)||!mc(o))return null;var i=function(e){return{h:hc(e.h),s:gc(e.s,0,100),v:gc(e.v,0,100),a:gc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Ec(i)},"hsv"]]},Mc=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Rc=function(e,t){var n=Bc(e);return{h:n.h,s:gc(n.s+100*t,0,100),l:n.l,a:n.a}},Lc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Ac=function(e,t){var n=Bc(e);return{h:n.h,s:n.s,l:gc(n.l+100*t,0,100),a:n.a}},Dc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Mc(e.trim(),Nc.string):"object"==typeof e&&null!==e?Mc(e,Nc.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return fc(Lc(this.rgba),2)},e.prototype.isDark=function(){return Lc(this.rgba)<.5},e.prototype.isLight=function(){return Lc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=bc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?_c(fc(255*r)):"","#"+_c(t)+_c(n)+_c(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return bc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=bc(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Sc(Bc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Sc(Bc(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=yc(this.rgba),{h:fc(e.h),s:fc(e.s),v:fc(e.v),a:fc(e.a,3)};var e},e.prototype.invert=function(){return Oc({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Oc(Rc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Oc(Rc(this.rgba,-e))},e.prototype.grayscale=function(){return Oc(Rc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Oc(Ac(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Oc(Ac(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Oc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):fc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Bc(this.rgba);return"number"==typeof e?Oc({h:e,s:t.s,l:t.l,a:t.a}):fc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Oc(e).toHex()},e}(),Oc=function(e){return e instanceof Dc?e:new Dc(e)},Fc=[],zc=function(e){e.forEach((function(e){Fc.indexOf(e)<0&&(e(Dc,Nc),Fc.push(e))}))};function Vc(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Hc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Gc=function(e){return.2126*Hc(e.r)+.7152*Hc(e.g)+.0722*Hc(e.b)};function Uc(e){e.prototype.luminance=function(){return e=Gc(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Gc(l))>(a=Gc(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Wc=n(3124),$c=n.n(Wc);const jc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Kc(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return qc(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=qc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(jc,""),value:n?qc(n[0]).replace(jc,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=qc(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:qc(t[1]),media:qc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=qc(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=qc(t[1]),o=qc(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Yc(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function qc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Yc(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Yc(e,o)})):n&&"object"==typeof n&&Yc(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Xc=n(8575),Qc=n.n(Xc),Zc=Jc;function Jc(e){this.options=e||{}}Jc.prototype.emit=function(e){return e},Jc.prototype.visit=function(e){return this[e.type](e)},Jc.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var eu=tu;function tu(e){Zc.call(this,e)}Qc()(tu,Zc),tu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},tu.prototype.comment=function(e){return this.emit("",e.position)},tu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},tu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},tu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},tu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},tu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},tu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},tu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},tu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},tu.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},tu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var nu=ou;function ou(e){e=e||{},Zc.call(this,e),this.indentation=e.indent}Qc()(ou,Zc),ou.prototype.compile=function(e){return this.stylesheet(e)},ou.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ou.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ou.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ou.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ou.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ou.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},ou.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},ou.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ou.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ou.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ou.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},ou.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ou.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var ru=function(e,t){try{const r=Kc(e);return n=$c().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new eu(o):new nu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function lu(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function iu(e,t){return new URL(e,t).toString()}var su=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};lu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+iu(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const au=/^(body|html|:root).*$/;var cu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(au)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},uu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(cu(t)),o&&r.push(su(o)),r.length?ru(n,(0,d.compose)(r)):n}))};const du=".editor-styles-wrapper";function pu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(du);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Oc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function mu(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>uu(t,du)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:pu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let fu;zc([Vc,Uc]);const gu=2e3;var hu=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[o,{width:r}]=(0,d.useResizeObserver)(),[l,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c}=(0,m.useSelect)((e=>{const t=e(zn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);fu=fu||(0,d.pure)(_m);const f=r/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},o,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>gu?gu*f:void 0}},(0,s.createElement)(dc,{head:(0,s.createElement)(mu,{styles:u}),assets:c,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:gu}},l,(0,s.createElement)(fu,{renderAppender:!1}))))},vu=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l}=e;const i=(0,m.useSelect)((e=>e(zn).getSettings()),[]),a=(0,s.useMemo)((()=>{const e={...i};return e.__experimentalBlockPatterns=[],e}),[i]),c=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Ya,{value:c,settings:a},r?(0,s.createElement)(Xa,{onClick:l}):(0,s.createElement)(hu,{viewportWidth:o,__experimentalPadding:n})):null}));function bu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(zn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Ya,{value:p,settings:a},(0,s.createElement)(Em,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var ku=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(vu,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Ka,{title:i,icon:a,description:c}))},_u=(0,s.createContext)(),yu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(_u);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),Eu=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Cu(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(ja,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
-
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function
|
15 |
-
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
-
title:(0,g.__)("Blocks")},
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
-
title:(0,g.__)("Patterns")},
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,g.__)("Reusable")};var
|
28 |
-
(0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:
|
29 |
-
(0,g.__)("%s block added"),a.title);(0,
|
30 |
-
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(wo,{icon:Ga}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Td=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Id(e,t))));var Pd=(0,s.forwardRef)(Id),Nd=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(zn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(xd,{rootClientId:n}):(0,s.createElement)(Pd,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),"data-block":!0},t)}));function Md(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const Rd=(0,s.createContext)();function Ld(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(Rd),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(zn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),b=Ra(u),k=Ra(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Md(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,x={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},I={start:{scale:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Bd,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Ad(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Rd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Ld,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Dd(){const e=(0,s.useContext)(Rd),t=(0,m.useSelect)((e=>e(zn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(zn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Od="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Fd="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function zd(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(zn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description}:d}),[e])}function Vd(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(zn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=zd(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a;return c&&c!==s.title?t&&t>0?(0,u.truncate)(c,{length:t}):c:i.title}function Hd(e){let{clientId:t,maximumLength:n}=e;return Vd(t,n)}var Gd=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:o,getTemplateLock:l,getBlockName:i}=e(zn),s=o(n[0]),a=s?l(s):null,c=i(n[0]);return{srcRootClientId:s,isDraggable:"all"!==a,icon:null===(t=(0,r.getBlockType)(c))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,ar.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(zn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Cu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Ud=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=zd(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(zn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(zn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Pt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:I,getPreviousBlockClientId:T,getNextBlockClientId:P,isNavigationMode:N}=(0,m.useSelect)(zn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(zn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ja,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Gd,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Eu,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Ca.UP,l=n===Ca.DOWN,i=n===Ca.LEFT,s=n===Ca.RIGHT,a=n===Ca.TAB,c=n===Ca.ESCAPE,u=n===Ca.ENTER,d=n===Ca.SPACE,p=e.shiftKey;if(n===Ca.BACKSPACE||n===Ca.DELETE)return k(t),void e.preventDefault();const m=x(),f=I(),g=T(f||m),h=P(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&N()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=w(F),t=w(m),n=S(F);let o=S(m);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;if(b){t=o;do{t=ar.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=ar.focus.tabbable.findNext(t))}else t=ar.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Hd,{clientId:t,maximumLength:35})))))};function Wd(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var $d=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!ar.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Rt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=ar.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,lc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=Wd(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Wd(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},jd=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Kd=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),qd=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Yd=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Xd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?jd:Kd:qd:"down"===e?"horizontal"===t?(0,g.isRTL)()?Kd:jd:Yd:null,Qd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Zd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Zd),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(zn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(zn),B="up"===o?w:S,x=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Xd(o,C),label:Qd(o,C),"aria-describedby":x},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:x,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
@@ -42,59 +42,64 @@ title:(0,g.__)("Reusable")};var yd=function(e){let{children:t,showPatterns:n=!1,
|
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
-
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
-
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
-
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
-
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function
|
|
|
|
|
56 |
/* translators: %s: block name */
|
57 |
-
(0,g.__)("Remove %s"),
|
58 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(qp,{hideDragHandle:n}))};function Xp(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(zn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Qp(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Xp,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(zn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(zn),x=!g&&!u&&r&&o,I=u,T=!u&&!b&&y&&!x&&!f&&(!g||h),P=!(u||T||b||r);(0,lc.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!P}),(0,s.useEffect)((()=>{T||C(!1)}),[T]);const N=(0,s.useRef)(),M=Ra(t),R=Ra(k),L=Ra(l),A=Md(a);if(!(I||T||E||x))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=x?"top left right":"top right left",{ownerDocument:z}=D,V=x?void 0:z.defaultView.frameElement||(0,ar.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(Bd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Yp,{focusOnMount:E,__experimentalInitialIndex:N.current,__experimentalOnIndexChange:e=>{N.current=e},key:t}),I&&(0,s.createElement)(Ud,{clientId:t,rootClientId:n,blockElement:D}),x&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Bd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function Zp(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(zn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Jp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(Zp,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Qp,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function em(e){let{children:t}=e;const n=(0,s.useContext)(Rd),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Rt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Ad,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Jp,{__unstablePopoverSlot:"block-toolbar"}),t))}var tm=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),nm=tm((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Pd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),om=(0,d.compose)([tm,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(zn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(xd,{rootClientId:t})})),rm=window.wp.isShallowEqual,lm=n.n(rm);const im=new WeakMap;function sm(e,t){const n=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(zn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(zn),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,ar.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function am(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function cm(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=am(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function um(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=cm(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function dm(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(zn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(zn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(zn),a=sm(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=um(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function pm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(zn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(zn).getBlockRootClientId(e);return{blockListSettings:t(zn).getBlockListSettings(e),parentLock:t(zn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=xo(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),lm()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(zn),{replaceInnerBlocks:i}=(0,m.useDispatch)(zn),a=(0,m.useSelect)((t=>t(zn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(zn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){im.has(t)||im.set(t,new WeakMap);const n=im.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(ur,{value:k},(0,s.createElement)(Em,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function mm(e){return qa(e),(0,s.createElement)(pm,e)}const fm=(0,s.forwardRef)(((e,t)=>{const n=gm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function gm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Un(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(zn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,dm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?mm:pm;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(Em,t)}}gm.save=r.__unstableGetInnerBlocksProps,fm.DefaultBlockAppender=om,fm.ButtonBlockAppender=nm,fm.Content=()=>gm.save().children;var hm=fm;const vm=(0,s.createContext)(),bm=(0,s.createContext)();function km(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(zn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=gm({ref:(0,d.useMergeRefs)([Qa(),Dd(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(vm.Provider,{value:o},(0,s.createElement)("div",p))}function _m(e){return function(){const e=(0,m.useSelect)((e=>e(zn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(zn).__experimentalGetParsedPattern(e[n].name),t=Od(o))};return t=Od(o),()=>Fd(t)}),[e])}(),(0,s.createElement)(em,null,(0,s.createElement)(Gn,{value:Vn},(0,s.createElement)(km,e)))}function ym(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Io}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(zn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Po,{value:l},(0,s.createElement)(bm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Va,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Nd,{tagName:r,rootClientId:n,renderAppender:o}))}function Em(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(ym,e))}_m.__unstableElementContext=vm;const Cm=["colors","disableCustomColors","gradients","disableCustomGradients"];function Sm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",null,(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function wm(e){const t={};return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),t.disableCustomColors=!mo("color.custom"),t.disableCustomGradients=!mo("color.customGradient"),(0,s.createElement)(Sm,i({},t,e))}var Bm=function(e){return(0,u.every)(Cm,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Sm,e):(0,s.createElement)(wm,e)};function xm(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(Bm,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Im(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function Tm(){const e=Im(),t=mo("color.palette.custom"),n=mo("color.palette.theme"),o=mo("color.palette.default"),r=mo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=mo("color.gradients.custom"),i=mo("color.gradients.theme"),a=mo("color.gradients.default"),c=mo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}zc([Vc,Uc]);const Pm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Nm=(e,t)=>(0,u.find)(e,{color:t});function Mm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Rm=[];function Lm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Tm(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=Pm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Pm(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=Nm(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:qo(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(xm,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Am(e,t,n){var o;if(!sf(t,"color")||af(t))return e;const{borderColor:r,style:l}=n,i=Mm("border-color",r),s=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=s||void 0,e}const Dm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Rm;if(!sf(r,"color")||af(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Pm(c,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,s.createElement)(e,i({},t,{wrapperProps:d}))}));function Om(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Fm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Om(o),i=0===r||r?`${r}${l}`:void 0;return i}function zm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Fm(e),n=isNaN(parseFloat(t));return n}function Vm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Hm(e){let{onChange:t,values:n,...o}=e;const r=Fm(n),l=Vm(n)&&zm(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return sf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Am),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!sf(e,"color")||af(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Am(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Dm);const Gm={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Um(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Gm).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var Wm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),$m=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function jm(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Wm:$m,iconSize:16,"aria-label":o})))}const Km={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},qm={px:100,em:20,rem:20};function Ym(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Vm(n)||!zm(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Om(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Fm(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Hm,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:i,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:qm[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Um,{min:0,onChange:t,values:n||Km,units:l}),(0,s.createElement)(jm,{onClick:()=>r(!o),isLinked:o})))}function Xm(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ym,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=qo(t)),o({style:t})}})}var Qm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"})),Zm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),Jm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const ef=[{label:(0,g.__)("Solid"),icon:Qm,value:"solid"},{label:(0,g.__)("Dashed"),icon:Zm,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Jm,value:"dotted"}];function tf(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},ef.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const nf=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(tf,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:qo(t)})}})},of=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=qo(s)),o({borderColor:p,style:s})},units:h})},rf="__experimentalBorder";function lf(e){const{clientId:t}=e,n=mo("border.color")&&sf(e.name,"color"),o=mo("border.radius")&&sf(e.name,"radius"),l=mo("border.style")&&sf(e.name,"style"),i=mo("border.width")&&sf(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const a=(0,r.getBlockSupport)(e.name,[rf,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(nr,{__experimentalGroup:"border"},i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"width")})}(e),isShownByDefault:null==a?void 0:a.width,resetAllFilter:c("width"),panelId:t},(0,s.createElement)(of,e)),l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"style")})}(e),isShownByDefault:null==a?void 0:a.style,resetAllFilter:c("style"),panelId:t},(0,s.createElement)(nf,e)),n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:cf(o,"color")})}(e),isShownByDefault:null==a?void 0:a.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Lm,e)),o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"radius")})}(e),isShownByDefault:null==a?void 0:a.radius,resetAllFilter:c("radius"),panelId:t},(0,s.createElement)(Xm,e)))}function sf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,rf);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function af(e){const t=(0,r.getBlockSupport)(e,rf);return null==t?void 0:t.__experimentalSkipSerialization}function cf(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function uf(e){if(e)return`has-${e}-gradient-background`}function df(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function pf(e,t){return(0,u.find)(e,["gradient",t])}function mf(e,t){const n=pf(e,t);return n&&n.slug}function ff(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Un(),o=mo("color.gradients.custom"),r=mo("color.gradients.theme"),l=mo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(zn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(zn),d=(0,s.useCallback)((o=>{const r=mf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=uf(a);let f;return f=a?df(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}zc([Vc,Uc]);var gf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Oc(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Oc(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
|
|
|
|
59 |
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
60 |
-
(0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Pt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function hf(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Tm(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(Bm,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function vf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=Ma(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(vf(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(vf(t).color);let n=p.current,o=vf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=vf(n).backgroundColor;i(o)})),(0,s.createElement)(nr,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(hf,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(gf,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const kf="color",_f=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},yf=e=>{const t=(0,r.getBlockSupport)(e,kf);return null==t?void 0:t.__experimentalSkipSerialization},Ef=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,kf);return(0,u.isObject)(t)&&!!t.link},Cf=e=>{const t=(0,r.getBlockSupport)(e,kf);return(0,u.isObject)(t)&&!!t.gradients},Sf=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&!1!==t.background},wf=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&!1!==t.text},Bf=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},xf=(e,t)=>qo(Yo(t,e,void 0)),If=e=>({textColor:void 0,style:xf(["color","text"],e.style)}),Tf=e=>({style:xf(["elements","link","color","text"],e.style)}),Pf=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Nf(e,t,n){var o,r,l,i,s,a;if(!_f(t)||yf(t))return e;const u=Cf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=Mm("background-color",d),h=uf(m),v=Mm("color",p),b=c()(e.className,v,h,{[g]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!g),"has-text-color":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.text),"has-background":d||(null==f||null===(l=f.color)||void 0===l?void 0:l.background)||u&&(m||(null==f||null===(i=f.color)||void 0===i?void 0:i.gradient)),"has-link-color":null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color});return e.className=b||void 0,e}const Mf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Pm(e,n[1]).color:t};function Rf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=mo("color.palette.custom"),h=mo("color.palette.theme"),v=mo("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=mo("color.gradients.custom"),_=mo("color.gradients.theme"),y=mo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=mo("color.custom"),S=mo("color.customGradient"),w=mo("color.background"),B=mo("color.link"),x=mo("color.text"),I=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,P=(0,s.useRef)(m);if((0,s.useEffect)((()=>{P.current=m}),[m]),!_f(p))return null;const N=Ef(p)&&B&&I,M=wf(p)&&x&&I,R=Sf(p)&&w&&I,L=Cf(p)&&T;if(!(N||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=df(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Nm(b,n),i=t+"Color",s={...P.current.style,color:{...null===(o=P.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:qo(s),[i]:a};e.setAttributes(c),P.current={...P.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[kf,"__experimentalDefaultControls"]);return(0,s.createElement)(bf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Pm(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Bf("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:xf(["color","text"],t.style)})})(e),resetAllFilter:If}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Pm(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=mf(E,t);let o;if(n){var r,l,i;const e={...null===(r=P.current)||void 0===r?void 0:r.style,color:{...null===(l=P.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:qo(e),gradient:n}}else{var s,a,c;const e={...null===(s=P.current)||void 0===s?void 0:s.style,color:{...null===(a=P.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:qo(e),gradient:void 0}}e.setAttributes(o),P.current={...P.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Bf("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Pf(t))})(e),resetAllFilter:Pf}]:[],...N?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Nm(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(Yo(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Mf(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Bf("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:xf(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Tf}]:[]]})}const Lf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=mo("color.palette.custom")||[],u=mo("color.palette.theme")||[],d=mo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!_f(o)||yf(o))return(0,s.createElement)(e,t);const m={};var f,g;a&&(m.color=null===(f=Pm(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(g=Pm(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Af={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return _f(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Cf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Nf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!_f(e)||yf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Nf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Lf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Xo({linkColor:Ef(r),textColor:wf(r),backgroundColor:Sf(r),gradient:Cf(r)},Af,e,t,n,o)}));const Df=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Of=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Ff=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function zf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Ff(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Df.forEach((t=>{let{name:n,value:o}=t;Of.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
61 |
/* translators: 1: Font weight name. 2: Font style name. */
|
62 |
-
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return
|
63 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
64 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
65 |
-
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function Vf(e){let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Rt()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType);return e.value=((e,t)=>{if(l)return e;switch(e){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o),e},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))}const Hf="typography.lineHeight";function Gf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vf,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:qo(t)})}})}function Uf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Hf)||t}const Wf="typography.__experimentalFontStyle",$f="typography.__experimentalFontWeight";function jf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Kf(e),i=!qf(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(zf,{onChange:e=>{r({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Kf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Wf),n=mo("typography.fontStyle");return!t||!n}function qf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,$f),n=mo("typography.fontWeight");return!t||!n}function Yf(e){const t=Kf(e),n=qf(e);return t&&n}function Xf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=mo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Qf="typography.__experimentalFontFamily";function Zf(e,t,n){if(!(0,r.hasBlockSupport)(t,Qf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(mp())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Jf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=mo("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Xf,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function eg(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Qf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Qf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Zf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Qf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zf(o,e,n)},e}));const tg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function ng(e,t){return(0,u.find)(e,{size:t})||{size:t}}function og(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var rg=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const lg="typography.fontSize";function ig(e,t,n){if(!(0,r.hasBlockSupport)(t,lg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(mp())(e.className);o.add(og(n.fontSize));const l=o.value;return e.className=l||void 0,e}function sg(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("typography.fontSizes"),a=tg(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(rg,{onChange:e=>{const t=ng(i,e).slug;l({style:qo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,lg)||!n}const cg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,lg)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=tg(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),ug={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,lg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ig),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,lg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ig(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",cg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Xo({fontSize:(0,r.hasBlockSupport)(l,lg)},ug,e,t,n,o)}));var dg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),pg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const mg=[{name:(0,g.__)("Underline"),value:"underline",icon:dg},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:pg}];function fg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},mg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const gg="typography.__experimentalTextDecoration";function hg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function vg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gg),n=mo("typography.textDecoration");return t||!n}var bg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),kg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),_g=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const yg=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:bg},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:kg},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:_g}];function Eg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},yg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Cg="typography.__experimentalTextTransform";function Sg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Eg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function wg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Cg),n=mo("typography.textTransform");return t||!n}function Bg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const xg="typography.__experimentalLetterSpacing";function Ig(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Tg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,xg),n=mo("typography.letterSpacing");return t||!n}const Pg="typography",Ng=[Hf,lg,Wf,$f,Qf,gg,Cg,xg];function Mg(e){const{clientId:t}=e,n=eg(e),o=ag(e),l=Yf(e),i=Uf(e),a=vg(e),c=wg(e),u=Tg(e),d=!Kf(e),m=!qf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Yf(e),ag(e),Uf(e),eg(e),vg(e),wg(e),Tg(e)];return t.filter(Boolean).length===t.length}(e),h=Rg(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Pg,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(nr,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Jf,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(sg,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Ff(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(jf,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(Gf,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(hg,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Sg,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(Ig,e)))}const Rg=e=>Ng.some((t=>(0,r.hasBlockSupport)(e,t)));function Lg(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.blockGap)}function Ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Lg(e)||t}function Dg(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ma(n);return Ag(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Og(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.margin)}function Fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!Yg(e,"margin");return!Og(e)||t||n}function zg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=qg(n,"margin"),a=i&&i.some((e=>$g.includes(e)));return Fg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Vg(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.padding)}function Hg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!Yg(e,"padding");return!Vg(e)||t||n}function Gg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=qg(n,"padding"),a=i&&i.some((e=>$g.includes(e)));return Hg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Ug="spacing",Wg=["top","right","bottom","left"],$g=["vertical","horizontal"];function jg(e){const t=Ag(e),n=Hg(e),o=Fg(e),l=Kg(e),i=(a=e.name,"web"===s.Platform.OS&&(Lg(a)||Vg(a)||Og(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Ug,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(nr,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Gg,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(zg,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(Dg,e)))}const Kg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ag(e),n=Hg(e),o=Fg(e);return t&&n&&o};function qg(e,t){const n=(0,r.getBlockSupport)(e,Ug);if(n&&"boolean"!=typeof n[t])return n[t]}function Yg(e,t){const n=qg(e,t);return!(n&&n.some((e=>Wg.includes(e)))&&n.some((e=>$g.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Xg=[...Ng,rf,kf,Ug],Qg=e=>Xg.some((t=>(0,r.hasBlockSupport)(e,t))),Zg="var:";function Jg(e){return(0,u.startsWith)(e,Zg)?`var(--wp--${e.slice(Zg.length).split("|").join("--")})`:e}function eh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Jg(r))})):t.includes(l.join("."))||(n[o]=Jg((0,u.get)(e,l))))}}));const o=sr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const th={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[kf],"typography.__experimentalSkipSerialization":[Pg],[`${Ug}.__experimentalSkipSerialization`]:["spacing"]},nh={...th,[`${Ug}`]:["spacing.blockGap"]};function oh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nh;if(!Qg(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...eh(l),...e.style},e}const rh=(0,d.createHigherOrderComponent)((e=>t=>{const n=Wn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rf,t),(0,s.createElement)(Mg,t),(0,s.createElement)(lf,t),(0,s.createElement)(jg,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),lh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=eh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(_m.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Qg(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",oh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Qg(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),oh(o,e,n,th)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",rh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",lh);var ih=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Ca.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const sh=[];function ah(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Oc(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function ch(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function uh(e){let{presetSetting:t,defaultSetting:n}=e;const o=!mo(n),r=mo(`${t}.custom`)||sh,l=mo(`${t}.theme`)||sh,i=mo(`${t}.default`)||sh;return(0,s.useMemo)((()=>[...r,...l,...o?sh:i]),[o,r,l,i])}function dh(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=uh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=uh({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(ih,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}zc([Vc]);const ph=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(dh,t))}),"withDuotoneControls"),mh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(_m.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(ch,{selector:m,id:p,values:ah(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",ph),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",mh);const fh="__experimentalLayout";function gh(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,fh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=l||h||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=xo(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(nr,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(hh,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function hh(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const vh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,fh)&&(0,s.createElement)(gh,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),bh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,fh),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(_m.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,fh)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,fh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",bh),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",vh);const kh=[];function _h(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Mm("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:eh({border:r})}}function yh(e){const t=mo("color.palette")||kh,n=_h(e);if(e.borderColor){const o=Pm(t,e.borderColor);n.style.borderColor=o.color}return n}function Eh(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Mm("background-color",s),m=Mm("color",a),f=uf(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:eh({color:(null==d?void 0:d.color)||{}})}}const Ch={};function Sh(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette.custom")||[],l=mo("color.palette.theme")||[],i=mo("color.palette.default")||[],a=mo("color.gradients")||Ch,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=Eh(e);if(t){const e=Pm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=df(u,o)),n){const e=Pm(c,n);d.style.color=e.color}return d}function wh(e){const{style:t}=e;return{style:eh({spacing:(null==t?void 0:t.spacing)||{}})}}function Bh(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const xh=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Ih=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette.custom"),o=mo("color.palette.theme"),r=mo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Th(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Oc(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Nm(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Pm(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Mm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Ph(e){return function(){const t=xh(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(Th(o,t),"withCustomColors")}}function Nh(){const e=Ih();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Th(n,e),"withColors")}const Mh=[];var Rh=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("typography.fontSizes")||Mh;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=tg(r,l,n[t]);return e[o]={...i,class:og(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Lh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Ah=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Dh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Oh=[{icon:Lh,title:(0,g.__)("Align text left"),align:"left"},{icon:Ah,title:(0,g.__)("Align text center"),align:"center"},{icon:Dh,title:(0,g.__)("Align text right"),align:"right"}],Fh={position:"bottom right",isAlternate:!0};var zh=function(e){let{value:t,onChange:n,alignmentControls:o=Oh,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Dh:Lh,label:r,toggleProps:{describedBy:l},popoverProps:Fh,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};function Vh(e){return(0,s.createElement)(zh,i({},e,{isToolbar:!1}))}function Hh(e){return(0,s.createElement)(zh,i({},e,{isToolbar:!0}))}var Gh={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(zn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Nu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?td(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ja,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Uh=window.wp.apiFetch,Wh=n.n(Uh),$h=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),jh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Kh={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Wh()({path:(0,ud.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,{key:"icon",icon:"page"===e.subtype?$h:jh}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const qh=[];function Yh(e){let{completers:t=qh}=e;const{name:n}=Un();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Gh,Kh])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Xh=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Yh(e)}))},Qh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),Zh=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Qh,label:n,onClick:()=>o(!t),disabled:r})},Jh=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Ca.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},ev=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),tv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(zn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(zn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(wo,{icon:ev,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Hd,{clientId:e,maximumLength:35})),(0,s.createElement)(wo,{icon:ev,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Hd,{clientId:r,maximumLength:35})))};function nv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(zn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":h,"is-dragging-blocks":g});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const ov=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),rv=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(ov,null)))},lv=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Ca.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(rv,null)))}))}};var iv=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:lv(n),renderContent:()=>t})},sv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const av=ia(p.__experimentalTreeGridRow);function cv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=ca({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(av,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function uv(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(wo,{icon:ev}))}var dv=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:h,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_,isExpanded:y}=t;const E=zd(r),C=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,S=((e,t,n)=>(0,g.sprintf)(
|
66 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
67 |
-
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(
|
68 |
-
(0,g.__)("
|
|
|
69 |
/* translators: %s: block name */
|
70 |
(0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
|
71 |
/* translators: %s: number of deselected blocks */
|
72 |
-
(0,g.__)("%s blocks deselected."),w.length));B&&(0,
|
73 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Bv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(zn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(wv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(Sv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function xv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=fp(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(ku,{item:i,isStylePreview:!0})}function Iv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function Tv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=hp({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{l(e),o(null),h(null),_.cancel()},E=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{Ca.ENTER!==t.keyCode&&Ca.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(Iv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(xv,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}Tv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Pv=Tv,Nv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),Mv=function(e){let{icon:t=Nv,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))},Rv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Lv="carousel",Av="grid",Dv=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Ov=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Kd,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:jd,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Fv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Lv,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:to,label:(0,g.__)("Carousel view"),onClick:()=>n(Lv),isPressed:u}),(0,s.createElement)(p.Button,{icon:Rv,label:(0,g.__)("Grid view"),onClick:()=>n(Av),isPressed:t===Av}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Ov,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Dv,{onBlockPatternSelect:a,onStartBlank:c}))};const zv=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Lv){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Hv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Vv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Vv(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)(Vv,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(vu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Hv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Hv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(vu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Gv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Lv),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:g}=(0,m.useDispatch)(zn),h=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(zn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==h||!h.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));g(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Fv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:h.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(h[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(zv,{viewMode:a,activeSlide:u,patterns:h,onBlockPatternSelect:v}))};const Uv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var Wv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(zn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(zn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Uv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:Yd,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const $v=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),jv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Kv={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:jv,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:$v,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},qv=["top","center","bottom"],Yv={isAlternate:!0};var Xv=function(e){let{value:t,onChange:n,controls:o=qv,isCollapsed:r=!0,isToolbar:l}=e;const a=Kv[t],c=Kv.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Yv,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Kv[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function Qv(e){return(0,s.createElement)(Xv,i({},e,{isToolbar:!1}))}function Zv(e){return(0,s.createElement)(Xv,i({},e,{isToolbar:!0}))}var Jv=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),eb=Jv(p.ColorPalette);function tb(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Bm,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}
|
74 |
// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
75 |
-
const
|
76 |
-
var cb=e=>(0,u.every)(rb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(ib,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(ab,e):(0,s.createElement)(sb,e),ub=function(e,t){return(ub=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},db=function(){return(db=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function pb(e,t,n,o){void 0===o&&(o=0);var r=Cb(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function mb(e,t,n,o,r){void 0===r&&(r=0);var l=Cb(t.width,t.height,r),i=l.width,s=l.height;return{x:fb(e.x,i,n.width,o),y:fb(e.y,s,n.height,o)}}function fb(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function gb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function hb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function vb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?bb:kb,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:db(db({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function bb(e,t){return Math.min(e,Math.max(0,t))}function kb(e,t){return t}function _b(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function yb(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Eb(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function Cb(e,t,n){var o=e/2,r=t/2,l=[Eb(0,0,o,r,n),Eb(e,0,o,r,n),Eb(e,t,o,r,n),Eb(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function Sb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var wb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=_b(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:pb(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=db({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?mb(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?mb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=vb(n.props.restrictPosition?mb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?mb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}ub(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=gb(n,o),this.lastPinchRotation=hb(n,o),this.onDragStart(yb(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=yb(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=gb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=hb(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return Kr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Sb("reactEasyCrop_Container",v)},n?Kr().createElement("img",db({alt:"",className:Sb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:db(db({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Kr().createElement("video",db({autoPlay:!0,loop:!0,muted:!0,className:Sb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:db(db({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Kr().createElement("div",{style:db(db({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Sb("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Kr().Component);const Bb={position:"bottom right",isAlternate:!0};const xb=(0,s.createContext)({}),Ib=()=>(0,s.useContext)(xb);function Tb(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),g(e),v(1/h),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),g(e),v(1/h),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,g,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Du.store),[p,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,Wh()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,g.sprintf)(
|
77 |
/* translators: 1. Error message */
|
78 |
-
(0,g.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(xb.Provider,{value:f},u)}function Pb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=Ib();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(wb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var Nb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function Mb(){const{isInProgress:e,zoom:t,setZoom:n}=Ib();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Bb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:Nb,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Rb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Lb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?dp:void 0},t)})))}function Ab(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Ib();return(0,s.createElement)(p.DropdownMenu,{icon:Rb,label:(0,g.__)("Aspect Ratio"),popoverProps:Bb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Lb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(Lb,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Lb,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Db=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Ob(){const{isInProgress:e,rotateClockwise:t}=Ib();return(0,s.createElement)(p.ToolbarButton,{icon:Db,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Fb(){const{isInProgress:e,apply:t,cancel:n}=Ib();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function zb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pb,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Yn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Mb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Ab,{toggleProps:e}))),(0,s.createElement)(Ob,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Fb,null))))}const Vb=[25,50,75,100];function Hb(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Vb.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var Gb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Ub=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)};class Wb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,xa()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,ud.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
|
79 |
/* translators: %s: number of results. */
|
80 |
-
(0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case
|
81 |
/* translators: %s: search term. */
|
82 |
-
(0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(
|
83 |
/* translators: %s: search term. */
|
84 |
-
(0,g.__)('Search results for "%s"'),o),w=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},S));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&Yb===e.type?(0,s.createElement)(jb,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Yb===e.type?null:(0,s.createElement)(qb,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Zb(e){const t=(0,u.startsWith)(e,"#");return(0,ud.isURL)(e)||e&&e.includes("www.")||t}const Jb=()=>Promise.resolve([]),ek=e=>{let t="URL";const n=(0,ud.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,ud.prependHTTP)(e):e,type:t}])};const tk=()=>Promise.resolve([]),nk=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:f=u.noop,onSelect:h=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Qb,e)),fetchSuggestions:k=null,allowDirectEntry:_=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?ek:Jb;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Zb(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||Zb(e)||!r?c:c.concat({title:e,url:e,type:Yb})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),x=v?k||B:tk,I=(0,d.useInstanceId)(nk),[T,P]=(0,s.useState)(),N=async e=>{let t=e;if(Yb!==e.type)(_||t&&Object.keys(t).length>=1)&&h({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&h(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)($b,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),P(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:I,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),N(t)}}):null,__experimentalFetchLinkSuggestions:x,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?N(r||{url:n}):t.preventDefault()},ref:t}),o)}));var ok=nk,rk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),lk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:ik,Fill:sk}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function ak(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function ck(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:u,isFetching:d}=function(e){const[t,n]=(0,s.useReducer)(ak,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(a),f=u&&Object.keys(u).length,h=n&&(0,ud.filterURLForDisplay)((0,ud.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||h,b=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let k;return k=null!=u&&u.icon?(0,s.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):b?(0,s.createElement)(wo,{icon:rk,size:32}):(0,s.createElement)(wo,{icon:Kb}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":f,"is-fetching":!!d,"is-preview":!0,"is-error":b})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},k),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},b?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,g.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,ar.__unstableStripHTML)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},h)))),(0,s.createElement)(p.Button,{icon:lk,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:$m,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(ik,{fillProps:n})),(f&&((null==u?void 0:u.image)||(null==u?void 0:u.description))||d)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=u&&u.image)})},(null==u?void 0:u.image)&&(0,s.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=u&&u.description)})},(null==u?void 0:u.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}function uk(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Xb,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const x=(0,s.useRef)(!0),I=(0,s.useRef)(),T=(0,s.useRef)(),[P,N]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||P,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length);function z(){var e;O.current=!(null===(e=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(x.current)return void(x.current=!1);const e=null!=T&&T.current?1:0;(ar.focus.focusable.find(I.current)[e]||I.current).focus(),O.current=!1}),[A]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&N(l.url)}),[l]);const{createPage:V,isCreatingPage:H,errorMessage:G}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b),U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),z()},W=d&&l&&!A&&!H,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},H&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(A||!l)&&!H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==Ca.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(ok,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:V,onChange:N,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),z()},showInitialSuggestions:h,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:U,label:(0,g.__)("Submit"),icon:Gb,className:"block-editor-link-control__search-submit",disabled:F})))),G&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),l&&!A&&!H&&(0,s.createElement)(ck,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Ub,{value:l,settings:i,onChange:a})),B&&B())}uk.ViewerFill=sk;var dk=uk,pk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),mk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),fk=(0,p.withFilters)("editor.MediaUpload")((()=>null)),gk=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return!!t().mediaUpload}),[])?n:t},hk=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Du.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:c,onFilesUpload:d=u.noop,onCloseModal:f=u.noop,name:h=(0,g.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const[C,S]=(0,s.useState)(t),w=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),B=(0,s.useRef)(),x=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),I=e=>{const t=(0,ar.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:x,isDismissible:!0})}),1e3)},T=(e,t)=>{t(),S(null==e?void 0:e.url),a(e),(0,Pt.speak)((0,g.__)("The media file has been replaced")),b(x)},P=e=>{e.keyCode===Ca.DOWN&&(e.preventDefault(),e.target.click())},N=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:B,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:P},h)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(fk,{gallery:N,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,onClose:f,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:pk,onClick:t},(0,g.__)("Open Media Library"))}}),(0,s.createElement)(gk,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:I})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:mk,onClick:()=>{t()}},(0,g.__)("Upload"))}})),k),c&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,s.createElement)(dk,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;S(t),c(t),B.current.focus()}})))}})}));function vk(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,ud.filterURLForDisplay)((0,ud.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function bk(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Yd,label:(0,g.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}bk.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)($b,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Gb,label:(0,g.__)("Apply"),type:"submit"}))},bk.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(vk,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:lk,label:(0,g.__)("Edit"),onClick:o}))};var kk=bk;const _k=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(kk,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Gb,label:(0,g.__)("Apply"),type:"submit"})))};var yk=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:h,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:S,onDoubleClick:w,onFilesPreUpload:B=u.noop,onHTMLDrop:x=u.noop,onClose:I=u.noop,children:T,mediaLibraryButton:P,placeholder:N,style:M}=e;const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().mediaUpload}),[]),[L,A]=(0,s.useState)(""),[D,O]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const F=e=>{A(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},H=e=>{e.preventDefault(),L&&S&&(S(L),V())},G=e=>{if(!b)return E(e);let o;if(B(e),v)if(h){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));E(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=E;else o=e=>{let[t]=e;return E(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},U=e=>{G(e.target.files)},W=null!=N?N:e=>{let{instructions:t,title:u}=l;if(R||S||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&R&&(t=(0,g.__)("Upload a media file or pick one from your media library."),l?t=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,g.__)("Media"),l?u=(0,g.__)("Audio"):i?u=(0,g.__)("Image"):s&&(u=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:w,preview:i,style:M},e,T)},$=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:G,onHTMLDrop:x}),j=()=>C&&(0,s.createElement)(p.Button,{className:"block-editor-media-pla
|
1 |
+
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Xh},AlignmentToolbar:function(){return Qh},Autocomplete:function(){return iv},BlockAlignmentControl:function(){return _r},BlockAlignmentToolbar:function(){return yr},BlockBreadcrumb:function(){return dv},BlockColorsStyleSelector:function(){return hv},BlockContextProvider:function(){return Ar},BlockControls:function(){return Qn},BlockEdit:function(){return zr},BlockEditorKeyboardShortcuts:function(){return H_},BlockEditorProvider:function(){return gc},BlockFormatControls:function(){return Xn},BlockIcon:function(){return pc},BlockInspector:function(){return O_},BlockList:function(){return jm},BlockMover:function(){return yp},BlockNavigationDropdown:function(){return Dv},BlockPreview:function(){return Ou},BlockSelectionClearer:function(){return bc},BlockSettingsMenu:function(){return bm},BlockSettingsMenuControls:function(){return fm},BlockStyles:function(){return Vv},BlockTitle:function(){return sp},BlockToolbar:function(){return _m},BlockTools:function(){return F_},BlockVerticalAlignmentControl:function(){return sb},BlockVerticalAlignmentToolbar:function(){return ab},ButtonBlockAppender:function(){return Xd},ButtonBlockerAppender:function(){return Yd},ColorPalette:function(){return ub},ColorPaletteControl:function(){return db},ContrastChecker:function(){return Hf},CopyHandler:function(){return Zp},DefaultBlockAppender:function(){return Kd},FontSizePicker:function(){return Ng},InnerBlocks:function(){return Gm},Inserter:function(){return jd},InspectorAdvancedControls:function(){return No},InspectorControls:function(){return Po},JustifyContentControl:function(){return Qo},JustifyToolbar:function(){return Zo},LineHeightControl:function(){return pg},MediaPlaceholder:function(){return Ak},MediaReplaceFlow:function(){return Nk},MediaUpload:function(){return Ik},MediaUploadCheck:function(){return Tk},MultiSelectScrollIntoView:function(){return G_},NavigableToolbar:function(){return dp},ObserveTyping:function(){return j_},PanelColorSettings:function(){return Dk},PlainText:function(){return a_},RichText:function(){return l_},RichTextShortcut:function(){return d_},RichTextToolbarButton:function(){return p_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return P_},ToolSelector:function(){return g_},Typewriter:function(){return X_},URLInput:function(){return lk},URLInputButton:function(){return k_},URLPopover:function(){return Rk},Warning:function(){return Hr},WritingFlow:function(){return Ic},__experimentalBlockAlignmentMatrixControl:function(){return cv},__experimentalBlockContentOverlay:function(){return pv},__experimentalBlockFullHeightAligmentControl:function(){return av},__experimentalBlockPatternSetup:function(){return Zv},__experimentalBlockPatternsList:function(){return id},__experimentalBlockVariationPicker:function(){return Gv},__experimentalBlockVariationTransforms:function(){return eb},__experimentalBorderRadiusControl:function(){return Ef},__experimentalBorderStyleControl:function(){return If},__experimentalColorGradientControl:function(){return Zm},__experimentalColorGradientSettingsDropdown:function(){return Jm},__experimentalDateFormatPicker:function(){return fb},__experimentalDuotoneControl:function(){return hh},__experimentalFontAppearanceControl:function(){return dg},__experimentalFontFamilyControl:function(){return Eg},__experimentalGetBorderClassesAndStyles:function(){return Nh},__experimentalGetColorClassesAndStyles:function(){return Mh},__experimentalGetGradientClass:function(){return Df},__experimentalGetGradientObjectByGradientValue:function(){return Ff},__experimentalGetMatchingVariation:function(){return Jv},__experimentalGetSpacingClassesAndStyles:function(){return Ah},__experimentalImageEditingProvider:function(){return Ub},__experimentalImageEditor:function(){return Jb},__experimentalImageSizeControl:function(){return tk},__experimentalImageURLInputUI:function(){return I_},__experimentalLayoutStyle:function(){return mr},__experimentalLetterSpacingControl:function(){return Zg},__experimentalLibrary:function(){return z_},__experimentalLinkControl:function(){return wk},__experimentalLinkControlSearchInput:function(){return vk},__experimentalLinkControlSearchItem:function(){return ak},__experimentalLinkControlSearchResults:function(){return dk},__experimentalListView:function(){return Lv},__experimentalPanelColorGradientSettings:function(){return Cb},__experimentalPreviewOptions:function(){return T_},__experimentalResponsiveBlockControl:function(){return u_},__experimentalTextDecorationControl:function(){return Vg},__experimentalTextTransformControl:function(){return qg},__experimentalToolsPanelColorDropdown:function(){return Gf},__experimentalUnitControl:function(){return h_},__experimentalUseBlockPreview:function(){return Fu},__experimentalUseBorderProps:function(){return Ph},__experimentalUseColorProps:function(){return Lh},__experimentalUseCustomSides:function(){return Uo},__experimentalUseGradient:function(){return Vf},__experimentalUseNoRecursiveRenders:function(){return J_},__experimentalUseResizeCanvas:function(){return N_},__unstableBlockSettingsMenuFirstItem:function(){return rm},__unstableEditorStyles:function(){return Ru},__unstableIframe:function(){return Pc},__unstableInserterMenuExtension:function(){return Ad},__unstableRichTextInputEvent:function(){return m_},__unstableUseBlockSelectionClearer:function(){return vc},__unstableUseClipboardHandler:function(){return Qp},__unstableUseMouseMoveTypingReset:function(){return W_},__unstableUseTypewriter:function(){return Y_},__unstableUseTypingObserver:function(){return $_},createCustomColorsHOC:function(){return Vh},getColorClassName:function(){return rf},getColorObjectByAttributeValues:function(){return nf},getColorObjectByColorValue:function(){return of},getFontSize:function(){return xg},getFontSizeClass:function(){return Tg},getFontSizeObjectByValue:function(){return Ig},getGradientSlugByValue:function(){return zf},getGradientValueBySlug:function(){return Of},getPxFromCssUnit:function(){return cy},store:function(){return Hn},storeConfig:function(){return Vn},transformStyles:function(){return Nu},useBlockDisplayInformation:function(){return lp},useBlockEditContext:function(){return $n},useBlockProps:function(){return tc},useCachedTruthy:function(){return Dh},useInnerBlocksProps:function(){return Hm},useSetting:function(){return _o},withColorContext:function(){return cb},withColors:function(){return Hh},withFontSizes:function(){return Uh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Nt},__experimentalGetAllowedBlocks:function(){return ut},__experimentalGetAllowedPatterns:function(){return ft},__experimentalGetBlockListSettingsForBlocks:function(){return _t},__experimentalGetDirectInsertBlock:function(){return dt},__experimentalGetGlobalBlocksByName:function(){return Q},__experimentalGetLastBlockAttributeChanges:function(){return Ct},__experimentalGetParsedPattern:function(){return pt},__experimentalGetPatternTransformItems:function(){return ht},__experimentalGetPatternsByBlockTypes:function(){return gt},__experimentalGetReusableBlockTitle:function(){return yt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return Et},areInnerBlocksControlled:function(){return Tt},canInsertBlockType:function(){return Ye},canInsertBlocks:function(){return Xe},canLockBlockType:function(){return tt},canMoveBlock:function(){return Je},canMoveBlocks:function(){return et},canRemoveBlock:function(){return Qe},canRemoveBlocks:function(){return Ze},didAutomaticChange:function(){return xt},getAdjacentBlockClientId:function(){return me},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return J},getBlockHierarchyRootClientId:function(){return de},getBlockIndex:function(){return Ie},getBlockInsertionPoint:function(){return Ge},getBlockListSettings:function(){return vt},getBlockMode:function(){return Ae},getBlockName:function(){return V},getBlockOrder:function(){return xe},getBlockParents:function(){return ce},getBlockParentsByBlockName:function(){return ue},getBlockRootClientId:function(){return ae},getBlockSelectionEnd:function(){return oe},getBlockSelectionStart:function(){return ne},getBlockTransformItems:function(){return at},getBlocks:function(){return $},getBlocksByClientId:function(){return Z},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Fe},getFirstMultiSelectedBlockClientId:function(){return _e},getGlobalBlockCount:function(){return X},getInserterItems:function(){return st},getLastMultiSelectedBlockClientId:function(){return ye},getLowestCommonAncestorWithSelectedBlock:function(){return pe},getMultiSelectedBlockClientIds:function(){return be},getMultiSelectedBlocks:function(){return ke},getMultiSelectedBlocksEndClientId:function(){return Be},getMultiSelectedBlocksStartClientId:function(){return we},getNextBlockClientId:function(){return ge},getPreviousBlockClientId:function(){return fe},getSelectedBlock:function(){return se},getSelectedBlockClientId:function(){return ie},getSelectedBlockClientIds:function(){return ve},getSelectedBlockCount:function(){return re},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return te},getSelectionStart:function(){return ee},getSettings:function(){return bt},getTemplate:function(){return $e},getTemplateLock:function(){return je},hasBlockMovingClientId:function(){return Bt},hasInserterItems:function(){return ct},hasMultiSelection:function(){return Me},hasSelectedBlock:function(){return le},hasSelectedInnerBlock:function(){return Ne},isAncestorBeingDragged:function(){return Ve},isAncestorMultiSelected:function(){return Se},isBlockBeingDragged:function(){return ze},isBlockHighlighted:function(){return It},isBlockInsertionPointVisible:function(){return Ue},isBlockMultiSelected:function(){return Ce},isBlockSelected:function(){return Te},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Pe},isCaretWithinFormattedText:function(){return He},isDraggingBlocks:function(){return Oe},isFirstMultiSelectedBlock:function(){return Ee},isLastBlockChangePersistent:function(){return kt},isMultiSelecting:function(){return Re},isNavigationMode:function(){return wt},isSelectionEnabled:function(){return Le},isTyping:function(){return De},isValidTemplate:function(){return We},wasBlockJustInserted:function(){return Pt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return Nn},__unstableMarkLastChangeAsPersistent:function(){return In},__unstableMarkNextChangeAsNotPersistent:function(){return Tn},__unstableSaveReusableBlock:function(){return xn},clearSelectedBlock:function(){return qt},duplicateBlocks:function(){return Rn},enterFormattedText:function(){return yn},exitFormattedText:function(){return En},flashBlock:function(){return On},hideInsertionPoint:function(){return an},insertAfterBlock:function(){return An},insertBeforeBlock:function(){return Ln},insertBlock:function(){return rn},insertBlocks:function(){return ln},insertDefaultBlock:function(){return Sn},mergeBlocks:function(){return dn},moveBlockToPosition:function(){return on},moveBlocksDown:function(){return en},moveBlocksToPosition:function(){return nn},moveBlocksUp:function(){return tn},multiSelect:function(){return Kt},receiveBlocks:function(){return zt},removeBlock:function(){return mn},removeBlocks:function(){return pn},replaceBlock:function(){return Zt},replaceBlocks:function(){return Qt},replaceInnerBlocks:function(){return fn},resetBlocks:function(){return Dt},resetSelection:function(){return Ft},selectBlock:function(){return Gt},selectNextBlock:function(){return Wt},selectPreviousBlock:function(){return Ut},selectionChange:function(){return Cn},setBlockMovingClientId:function(){return Mn},setHasControlledInnerBlocks:function(){return Fn},setNavigationMode:function(){return Pn},setTemplateValidity:function(){return cn},showInsertionPoint:function(){return sn},startDraggingBlocks:function(){return bn},startMultiSelect:function(){return $t},startTyping:function(){return hn},stopDraggingBlocks:function(){return kn},stopMultiSelect:function(){return jt},stopTyping:function(){return vn},synchronizeTemplate:function(){return un},toggleBlockHighlight:function(){return Dn},toggleBlockMode:function(){return gn},toggleSelection:function(){return Yt},updateBlock:function(){return Ht},updateBlockAttributes:function(){return Vt},updateBlockListSettings:function(){return wn},updateSettings:function(){return Bn},validateBlocksToTemplate:function(){return Ot}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__experimentalCanLockBlocks:!0,__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const I=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!w(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:I,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=o;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=o;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,c=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!c)return n;if(!o.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some((e=>e.clientId===c)))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:T(n.selectionStart,o),selectionEnd:T(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const z=[];function V(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function H(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function U(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const W=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&Tt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(xe(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=xe(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=xe(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Q=D(((e,t)=>{if(!t)return z;const n=Y(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:z}),(e=>[e.blocks.order,e.blocks.byClientId])),Z=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>U(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function J(e,t){return xe(e,t).length}function ee(e){return e.selection.selectionStart}function te(e){return e.selection.selectionEnd}function ne(e){return e.selection.selectionStart.clientId}function oe(e){return e.selection.selectionEnd.clientId}function re(e){return be(e).length||(e.selection.selectionStart.clientId?1:0)}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ie(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function se(e){const t=ie(e);return t?U(e,t):null}function ae(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ce=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ue=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ce(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function de(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function pe(e,t){const n=ie(e),o=[...ce(e,t),t],r=[...ce(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function me(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ie(e)),void 0===t&&(t=n<0?_e(e):ye(e)),!t)return null;const o=ae(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function fe(e,t){return me(e,t,-1)}function ge(e,t){return me(e,t,1)}function he(e){return e.initialPosition}const ve=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=ae(e,t.clientId);if(null===o)return z;const r=xe(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:ve(e)}const ke=D((e=>{const t=be(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...ve.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function _e(e){return(0,u.first)(be(e))||null}function ye(e){return(0,u.last)(be(e))||null}function Ee(e,t){return _e(e)===t}function Ce(e,t){return-1!==be(e).indexOf(t)}const Se=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ae(e,n),o=Ce(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function xe(e,t){return e.blocks.order[t||""]||z}function Ie(e,t){return xe(e,ae(e,t)).indexOf(t)}function Te(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(xe(e,t),(t=>Te(e,t)||Ce(e,t)||n&&Ne(e,t,n)))}function Pe(e,t){if(!t)return!1;const n=be(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Re(e){return e.isMultiSelecting}function Le(e){return e.isSelectionEnabled}function Ae(e,t){return e.blocksMode[t]||"visual"}function De(e){return e.isTyping}function Oe(e){return!!e.draggedBlocks.length}function Fe(e){return e.draggedBlocks}function ze(e,t){return e.draggedBlocks.includes(t)}function Ve(e,t){if(!Oe(e))return!1;const n=ce(e,t);return(0,u.some)(n,(t=>ze(e,t)))}function He(e){return e.isCaretWithinFormattedText}function Ge(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ae(e,l)||void 0,n=Ie(e,r.clientId)+1):n=xe(e).length,{rootClientId:t,index:n}}function Ue(e){return null!==e.insertionPoint}function We(e){return e.template.isValid}function $e(e){return e.settings.template}function je(e,t){if(!t)return e.settings.templateLock;const n=vt(e,t);return n?n.templateLock:null}const Ke=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},qe=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=bt(e),s=Ke(i,t,!0);if(!s)return!1;const a=!!je(e,o);if(a)return!1;const c=vt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=Ke(u,t),p=n.parent,m=V(e,o),f=Ke(p,m),g=null===d&&null===f||!0===d||!0===f;return g?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ue.bind(null,e)}):g},Ye=D(qe,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ye(e,V(e,t),n)))}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Qe(e,t,n)))}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function et(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Je(e,t,n)))}function tt(e,t){var n;return!!(0,r.hasBlockSupport)(t,"__experimentalLock",!0)&&!(null===(n=e.settings)||void 0===n||!n.__experimentalCanLockBlocks)}function nt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const ot=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&qe(e,t.name,n),rt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=nt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:lt(r,l)}},lt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},it=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Z(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=nt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:lt(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=it(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=nt(e,l)||{},c=lt(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>ot(e,n,t))).map(n),a=qe(e,"core/block",t)?St(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=rt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,St(e),(0,r.getBlockTypes)()])),at=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=it(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>ot(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ot(e,n,t)));if(n)return!0;const o=qe(e,"core/block",t)&&St(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,St(e),(0,r.getBlockTypes)()])),ut=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>ot(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),dt=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),pt=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),mt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=bt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return pt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Ke(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),ft=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=mt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return Ye(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),gt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=ft(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...ft.getDependants(e,t)])),ht=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Tt(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return gt(e,o,n)}),((e,t)=>[...gt.getDependants(e,t)]));function vt(e,t){return e.blockListSettings[t]}function bt(e){return e.settings}function kt(e){return e.blocks.isPersistentChange}const _t=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),yt=D(((e,t)=>{var n;const o=(0,u.find)(St(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[St(e)]));function Et(e){return e.blocks.isIgnoredChange}function Ct(e){return e.lastBlockAttributesChange}function St(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function wt(e){return e.isNavigationMode}function Bt(e){return e.hasBlockMovingClientId}function xt(e){return!!e.automaticChangeStatus}function It(e,t){return e.highlightedBlock===t}function Tt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Nt=D(((e,t)=>{if(!t.length)return null;const n=ie(e);if(t.includes(V(e,n)))return n;const o=be(e),r=ue(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Pt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Mt=window.wp.a11y,Rt=window.wp.richText,Lt=window.wp.deprecated,At=n.n(Lt);const Dt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ot(e))},Ot=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Ft(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function zt(e){return At()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Ht(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Gt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ut=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Wt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function $t(){return{type:"START_MULTI_SELECT"}}function jt(){return{type:"STOP_MULTI_SELECT"}}const Kt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Mt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function qt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Yt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Xt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Qt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=Xt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Zt(e,t){return Qt(e,t)}const Jt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},en=Jt("MOVE_BLOCKS_DOWN"),tn=Jt("MOVE_BLOCKS_UP"),nn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function on(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return nn([e],t,n,o)}function rn(e,t,n,o,r){return ln([e],t,n,o,0,r)}const ln=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,At()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Xt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function sn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function an(){return{type:"HIDE_INSERTION_POINT"}}function cn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const un=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},dn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Rt.insert)((0,Rt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",h,h);e.attributes[g]=(0,Rt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Rt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf(""),a=(0,Rt.remove)(i,s,s+1),p=(0,Rt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},pn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function mn(e,t){return pn([e],t)}function fn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function gn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function hn(){return{type:"START_TYPING"}}function vn(){return{type:"STOP_TYPING"}}function bn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function kn(){return{type:"STOP_DRAGGING_BLOCKS"}}function yn(){return{type:"ENTER_FORMATTED_TEXT"}}function En(){return{type:"EXIT_FORMATTED_TEXT"}}function Cn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}const Sn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function wn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Bn(e){return{type:"UPDATE_SETTINGS",settings:e}}function xn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function In(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Tn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Nn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Pn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Mt.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Mt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Mn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Mt.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Rn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Ln=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},An=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Dn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const On=e=>async t=>{let{dispatch:n}=t;n(Dn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Dn(e,!1))};function Fn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const zn="core/block-editor",Vn={reducer:M,selectors:e,actions:t},Hn=(0,m.createReduxStore)(zn,{...Vn,persist:["preferences"]});(0,m.registerStore)(zn,{...Vn,persist:["preferences"]});const Gn={name:"",isSelected:!1},Un=(0,s.createContext)(Gn),{Provider:Wn}=Un;function $n(){return(0,s.useContext)(Un)}function jn(){const{isSelected:e,clientId:t,name:n}=$n();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Hn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Kn(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=jn(),{clientId:o}=$n(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Hn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function qn(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const Yn=Kn;Yn.Slot=qn;const Xn=e=>(0,s.createElement)(Kn,i({group:"inline"},e));Xn.Slot=e=>(0,s.createElement)(qn,i({group:"inline"},e));var Qn=Yn,Zn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Jn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),to=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),no=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),oo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),ro=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),lo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),io=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),ao=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),co=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function uo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const po=(0,s.createContext)({refs:new Map,callbacks:new Map});function mo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(po.Provider,{value:n},t)}function fo(e){const{refs:t,callbacks:n}=(0,s.useContext)(po),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function go(e){const{refs:t}=(0,s.useContext)(po),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function ho(e){const{callbacks:t}=(0,s.useContext)(po),n=go(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const vo=["color","border","typography","spacing"],bo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},ko={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function _o(e){const{name:t}=$n();return(0,m.useSelect)((n=>{var o;if(vo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Hn).getSettings(),i=(e=>ko[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=bo[i]?bo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}window.wp.warning;var yo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Eo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=jn(),l=null===(t=yo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Co=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Co),u.identity);return(0,u.isEmpty)(t)?void 0:t};function So(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function wo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:So(c.attributes,e,t)})}))})),c}function Bo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Hn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Hn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Co(r.style)},t[n]=r})),r(n,t,!0)}),[Co,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function xo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Io(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=yo[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Bo,{group:n,label:o},(0,s.createElement)(xo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const To=Eo;To.Slot=Io;const No=e=>(0,s.createElement)(Eo,i({},e,{__experimentalGroup:"advanced"}));No.Slot=e=>(0,s.createElement)(Io,i({},e,{__experimentalGroup:"advanced"})),No.slotName="InspectorAdvancedControls";var Po=To;function Mo(e){const t=(0,r.getBlockSupport)(e,Fo);return!!(!0===t||null!=t&&t.margin)}function Ro(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("spacing.margin"),n=!Wo(e,"margin");return!Mo(e)||t||n}function Lo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]}),i=Uo(n,"margin"),a=i&&i.some((e=>Vo.includes(e)));return Ro(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Co(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Co(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Ao(e){const t=(0,r.getBlockSupport)(e,Fo);return!!(!0===t||null!=t&&t.padding)}function Do(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("spacing.padding"),n=!Wo(e,"padding");return!Ao(e)||t||n}function Oo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]}),i=Uo(n,"padding"),a=i&&i.some((e=>Vo.includes(e)));return Do(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Co(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Co(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Fo="spacing",zo=["top","right","bottom","left"],Vo=["vertical","horizontal"];function Ho(e){const t=Ko(e),n=Do(e),o=Ro(e),l=Go(e),i=(a=e.name,"web"===s.Platform.OS&&($o(a)||Ao(a)||Mo(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Fo,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(Po,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Oo,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Lo,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(qo,e)))}const Go=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ko(e),n=Do(e),o=Ro(e);return t&&n&&o};function Uo(e,t){const n=(0,r.getBlockSupport)(e,Fo);if(n&&"boolean"!=typeof n[t])return n[t]}function Wo(e,t){const n=Uo(e,t);return!(n&&n.some((e=>zo.includes(e)))&&n.some((e=>Vo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function $o(e){const t=(0,r.getBlockSupport)(e,Fo);return!!(!0===t||null!=t&&t.blockGap)}function jo(e){if(!e)return e;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Ko(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("spacing.blockGap");return!$o(e)||t}function qo(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]}),a=Uo(r,"blockGap"),c=go(n);if(Ko(e))return null;const u=e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:{...jo(e)}}};l({style:Co(n)});const r=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var i;c.current&&r&&(null===(i=c.current.parentNode)||void 0===i||i.replaceChild(c.current,c.current))},d=a&&a.some((e=>Vo.includes(e))),m=jo(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,d?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:u,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:d}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:u,units:i,value:f})),native:null})}const Yo={left:ro,center:lo,right:io,"space-between":so};var Xo=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?Yo[r]:Yo.left,d=[{name:"left",icon:ro,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:lo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:io,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:so,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function Qo(e){return(0,s.createElement)(Xo,i({},e,{isToolbar:!1}))}function Zo(e){return(0,s.createElement)(Xo,i({},e,{isToolbar:!0}))}const Jo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},er={left:"flex-start",right:"flex-end",center:"center"},tr=["wrap","nowrap"];var nr={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(or,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(lr,{layout:t,onChange:n}))),(0,s.createElement)(rr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(Qn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(or,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l}=e;const{orientation:i="horizontal"}=r,a=null!==_o("spacing.blockGap"),c=null!==(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=jo(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"))&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=Jo[r.justifyContent]||Jo.left,d=tr.includes(r.flexWrap)?r.flexWrap:"wrap",p=`\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tjustify-content: ${u};\n\t\t`,m=`\n\t\tflex-direction: column;\n\t\talign-items: ${er[r.justifyContent]||er.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${uo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${uo(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function or(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(Qo,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:ro,label:(0,g.__)("Justify items left")},{value:"center",icon:lo,label:(0,g.__)("Justify items center")},{value:"right",icon:io,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:so,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function rr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function lr(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:ao,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:co,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var ir=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const sr=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(ir,{icon:eo})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(ir,{icon:no}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:o,layout:r={},style:l}=e;const{contentSize:i,wideSize:a}=r,c=null!==_o("spacing.blockGap"),u=jo(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap),d=null!==(n=null==u?void 0:u.top)&&void 0!==n?n:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${uo(o,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${uo(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${uo(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${uo(o,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${uo(o,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${uo(o,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${uo(o,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${uo(o,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},nr];function ar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return sr.find((t=>t.name===e))}const cr={type:"default"},ur=(0,s.createContext)(cr),dr=ur.Provider;function pr(){return(0,s.useContext)(ur)}function mr(e){let{layout:t={},...n}=e;const o=ar(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const fr=["none","left","center","right","wide","full"],gr=["wide","full"];function hr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=pr(),r=ar(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=fr}=o,s=e.filter((e=>(o.alignments||t||!gr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const vr={none:{icon:Zn,title:(0,g.__)("None")},left:{icon:Jn,title:(0,g.__)("Align left")},center:{icon:eo,title:(0,g.__)("Align center")},right:{icon:to,title:(0,g.__)("Align right")},wide:{icon:no,title:(0,g.__)("Wide width")},full:{icon:oo,title:(0,g.__)("Full width")}},br={isAlternate:!0};var kr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=hr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=vr[t],m=vr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:br,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...vr[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=vr[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};function _r(e){return(0,s.createElement)(kr,i({},e,{isToolbar:!1}))}function yr(e){return(0,s.createElement)(kr,i({},e,{isToolbar:!0}))}const Er=["left","center","right","wide","full"],Cr=["wide","full"];function Sr(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Er.filter((t=>e.includes(t))):!0===e?[...Er]:[],!o||!0===e&&!n?(0,u.without)(t,...Cr):t}const wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=hr(Sr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(Qn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(_r,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),Br=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=hr(Sr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Er,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Br),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",wr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Sr((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const xr=/[\s#]/g,Ir={type:"string",source:"attribute",attribute:"id",selector:"*"},Tr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(xr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Po,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Po,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Ir}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Tr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Nr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Po,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Nr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Pr=[{name:"padding",generate:(e,t)=>function(e,t,n,o){const r=(0,u.get)(e,["spacing","padding"]);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const o=(0,u.get)(r,[n]);return o&&e.push({selector:t.selector,key:`padding${(0,u.upperFirst)(n)}`,value:o}),e}),[]);l.push(...e)}return l}(e,t,0,"padding")}];function Mr(e,t){const n=[];return Pr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Rr=window.wp.dom;const Lr=(0,s.createContext)({});function Ar(e){let{value:t,children:n}=e;const o=(0,s.useContext)(Lr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(Lr.Provider,{value:r,children:n})}var Dr=Lr;const Or={};var Fr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Dr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):Or),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function zr(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Wn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Fr,e))}var Vr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Hr=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:Vr,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},Gr=n(1973);function Ur(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,Rr.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var Wr=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,Gr.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Ur,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Ur,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const $r=e=>(0,r.rawHandler)({HTML:e.originalContent});var jr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Hn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Hn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,$r(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
+
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Hr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
+
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Wr,{block:i,onKeep:t,onConvert:n,convertor:$r,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Kr=(0,s.createElement)(Hr,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var qr=()=>Kr;class Yr extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var Xr=Yr,Qr=n(773),Zr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Hn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Hn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Qr.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Jr=fl();const el=e=>ul(e,Jr);let tl=fl();el.write=e=>ul(e,tl);let nl=fl();el.onStart=e=>ul(e,nl);let ol=fl();el.onFrame=e=>ul(e,ol);let rl=fl();el.onFinish=e=>ul(e,rl);let ll=[];el.setTimeout=(e,t)=>{let n=el.now()+t,o=()=>{let e=ll.findIndex((e=>e.cancel==o));~e&&ll.splice(e,1),hl.count-=~e?1:0},r={time:n,handler:e,cancel:o};return ll.splice(il(n),0,r),hl.count+=1,dl(),r};let il=e=>~(~ll.findIndex((t=>t.time>e))||~ll.length);el.cancel=e=>{Jr.delete(e),tl.delete(e)},el.sync=e=>{cl=!0,el.batchedUpdates(e),cl=!1},el.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,el.onStart(n)}return o.handler=e,o.cancel=()=>{nl.delete(n),t=null},o};let sl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};el.use=e=>sl=e,el.now="undefined"!=typeof performance?()=>performance.now():Date.now,el.batchedUpdates=e=>e(),el.catch=console.error,el.frameLoop="always",el.advance=()=>{"demand"!==el.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ml()};let al=-1,cl=!1;function ul(e,t){cl?(t.delete(e),e(0)):(t.add(e),dl())}function dl(){al<0&&(al=0,"demand"!==el.frameLoop&&sl(pl))}function pl(){~al&&(sl(pl),el.batchedUpdates(ml))}function ml(){let e=al;al=el.now();let t=il(al);t&&(gl(ll.splice(0,t),(e=>e.handler())),hl.count-=t),nl.flush(),Jr.flush(e?Math.min(64,al-e):16.667),ol.flush(),tl.flush(),rl.flush()}function fl(){let e=new Set,t=e;return{add(n){hl.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(hl.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,hl.count-=t.size,gl(t,(t=>t(n)&&e.add(t))),hl.count+=e.size,t=e)}}}function gl(e,t){e.forEach((e=>{try{t(e)}catch(e){el.catch(e)}}))}const hl={count:0,clear(){al=-1,ll=[],nl=fl(),Jr=fl(),ol=fl(),tl=fl(),rl=fl(),hl.count=0}};var vl=n(9196),bl=n.n(vl);function kl(){}const _l={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function yl(e,t){if(_l.arr(e)){if(!_l.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const El=(e,t)=>e.forEach(t);function Cl(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Sl=e=>_l.und(e)?[]:_l.arr(e)?e:[e];function wl(e,t){if(e.size){const n=Array.from(e);e.clear(),El(n,t)}}const Bl=(e,...t)=>wl(e,(e=>e(...t)));let xl,Il,Tl=null,Nl=!1,Pl=kl;var Ml=Object.freeze({__proto__:null,get createStringInterpolator(){return xl},get to(){return Il},get colors(){return Tl},get skipAnimation(){return Nl},get willAdvance(){return Pl},assign:e=>{e.to&&(Il=e.to),e.now&&(el.now=e.now),void 0!==e.colors&&(Tl=e.colors),null!=e.skipAnimation&&(Nl=e.skipAnimation),e.createStringInterpolator&&(xl=e.createStringInterpolator),e.requestAnimationFrame&&el.use(e.requestAnimationFrame),e.batchedUpdates&&(el.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Pl=e.willAdvance),e.frameLoop&&(el.frameLoop=e.frameLoop)}});const Rl=new Set;let Ll=[],Al=[],Dl=0;const Ol={get idle(){return!Rl.size&&!Ll.length},start(e){Dl>e.priority?(Rl.add(e),el.onStart(Fl)):(zl(e),el(Hl))},advance:Hl,sort(e){if(Dl)el.onFrame((()=>Ol.sort(e)));else{const t=Ll.indexOf(e);~t&&(Ll.splice(t,1),Vl(e))}},clear(){Ll=[],Rl.clear()}};function Fl(){Rl.forEach(zl),Rl.clear(),el(Hl)}function zl(e){Ll.includes(e)||Vl(e)}function Vl(e){Ll.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Ll),0,e)}function Hl(e){const t=Al;for(let n=0;n<Ll.length;n++){const o=Ll[n];Dl=o.priority,o.idle||(Pl(o),o.advance(e),o.idle||t.push(o))}return Dl=0,Al=Ll,Al.length=0,Ll=t,Ll.length>0}const Gl="[-+]?\\d*\\.?\\d+",Ul=Gl+"%";function Wl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const $l=new RegExp("rgb"+Wl(Gl,Gl,Gl)),jl=new RegExp("rgba"+Wl(Gl,Gl,Gl,Gl)),Kl=new RegExp("hsl"+Wl(Gl,Ul,Ul)),ql=new RegExp("hsla"+Wl(Gl,Ul,Ul,Gl)),Yl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Xl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ql=/^#([0-9a-fA-F]{6})$/,Zl=/^#([0-9a-fA-F]{8})$/;function Jl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ei(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Jl(r,o,e+1/3),i=Jl(r,o,e),s=Jl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function ti(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ni(e){return(parseFloat(e)%360+360)%360/360}function oi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ri(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function li(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ql.exec(e))?parseInt(t[1]+"ff",16)>>>0:Tl&&void 0!==Tl[e]?Tl[e]:(t=$l.exec(e))?(ti(t[1])<<24|ti(t[2])<<16|ti(t[3])<<8|255)>>>0:(t=jl.exec(e))?(ti(t[1])<<24|ti(t[2])<<16|ti(t[3])<<8|oi(t[4]))>>>0:(t=Yl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Zl.exec(e))?parseInt(t[1],16)>>>0:(t=Xl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Kl.exec(e))?(255|ei(ni(t[1]),ri(t[2]),ri(t[3])))>>>0:(t=ql.exec(e))?(ei(ni(t[1]),ri(t[2]),ri(t[3]))|oi(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const ii=(e,t,n)=>{if(_l.fun(e))return e;if(_l.arr(e))return ii({range:e,output:t,extrapolate:n});if(_l.str(e.output[0]))return xl(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function si(){return(si=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const ai=Symbol.for("FluidValue.get"),ci=Symbol.for("FluidValue.observers"),ui=e=>Boolean(e&&e[ai]),di=e=>e&&e[ai]?e[ai]():e,pi=e=>e[ci]||null;function mi(e,t){let n=e[ci];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class fi{constructor(e){if(this[ai]=void 0,this[ci]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");gi(this,e)}}const gi=(e,t)=>bi(e,ai,t);function hi(e,t){if(e[ai]){let n=e[ci];n||bi(e,ci,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function vi(e,t){let n=e[ci];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[ci]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const bi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ki=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_i=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let yi;const Ei=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ci=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Si=e=>{yi||(yi=Tl?new RegExp(`(${Object.keys(Tl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>di(e).replace(_i,li).replace(yi,li))),n=t.map((e=>e.match(ki).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>ii(si({},e,{output:t}))));return e=>{let n=0;return t[0].replace(ki,(()=>String(o[n++](e)))).replace(Ei,Ci)}},wi="react-spring: ",Bi=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${wi}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},xi=Bi(console.warn),Ii=Bi(console.warn);function Ti(e){return _l.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Tl||{}))}const Ni=e=>(0,vl.useEffect)(e,Pi),Pi=[];function Mi(){const e=(0,vl.useState)()[1],t=(0,vl.useState)(Ri)[0];return Ni(t.unmount),()=>{t.current&&e({})}}function Ri(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function Li(e){const t=(0,vl.useRef)();return(0,vl.useEffect)((()=>{t.current=e})),t.current}const Ai="undefined"!=typeof window&&window.document&&window.document.createElement?vl.useLayoutEffect:vl.useEffect,Di=Symbol.for("Animated:node"),Oi=e=>e&&e[Di],Fi=(e,t)=>{return n=e,o=Di,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},zi=e=>e&&e[Di]&&e[Di].getPayload();class Vi{constructor(){this.payload=void 0,Fi(this,this)}getPayload(){return this.payload||[]}}class Hi extends Vi{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,_l.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Hi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return _l.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Gi extends Hi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=ii({output:[e,e]})}static create(e){return new Gi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(_l.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ii({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Ui={dependencies:null};class Wi extends Vi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Cl(this.source,((n,o)=>{var r;(r=n)&&r[Di]===r?t[o]=n.getValue(e):ui(n)?t[o]=di(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&El(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Cl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ui.dependencies&&ui(e)&&Ui.dependencies.add(e);const t=zi(e);t&&El(t,(e=>this.add(e)))}}class $i extends Wi{constructor(e){super(e)}static create(e){return new $i(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(ji)),!0)}}function ji(e){return(Ti(e)?Gi:Hi).create(e)}function Ki(e){const t=Oi(e);return t?t.constructor:_l.arr(e)?$i:Ti(e)?Gi:Hi}function qi(){return(qi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Yi=(e,t)=>{const n=!_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,vl.forwardRef)(((o,r)=>{const l=(0,vl.useRef)(null),i=n&&(0,vl.useCallback)((e=>{l.current=function(e,t){return e&&(_l.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Ui.dependencies=n,e.style&&(e=qi({},e,{style:t.createAnimatedStyle(e.style)})),e=new Wi(e),Ui.dependencies=null,[e,n]}(o,t),c=Mi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Xi(u,a),p=(0,vl.useRef)();Ai((()=>{const e=p.current;p.current=d,El(a,(e=>hi(e,d))),e&&(El(e.deps,(t=>vi(t,e))),el.cancel(e.update))})),(0,vl.useEffect)(u,[]),Ni((()=>()=>{const e=p.current;El(e.deps,(t=>vi(t,e)))}));const m=t.getComponentProps(s.getValue());return vl.createElement(e,qi({},m,{ref:i}))}))};class Xi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&el.write(this.update)}}const Qi=Symbol.for("AnimatedComponent"),Zi=e=>_l.str(e)?e:e&&_l.str(e.displayName)?e.displayName:_l.fun(e)&&e.name||null;function Ji(){return(Ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function es(e,...t){return _l.fun(e)?e(...t):e}const ts=(e,t)=>!0===e||!!(t&&e&&(_l.fun(e)?e(t):Sl(e).includes(t))),ns=(e,t)=>_l.obj(e)?t&&e[t]:e,os=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,rs=e=>e,ls=(e,t=rs)=>{let n=is;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);_l.und(n)||(o[r]=n)}return o},is=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ss={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function as(e){const t=function(e){const t={};let n=0;if(Cl(e,((e,o)=>{ss[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Cl(e,((e,o)=>o in t||(n[o]=e))),n}return Ji({},e)}function cs(e){return e=di(e),_l.arr(e)?e.map(cs):Ti(e)?Ml.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function us(e){for(const t in e)return!0;return!1}function ds(e){return _l.fun(e)||_l.arr(e)&&_l.obj(e[0])}function ps(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function ms(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const fs=Ji({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class gs{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,fs)}}function hs(e,t){if(_l.und(t.decay)){const n=!_l.und(t.tension)||!_l.und(t.friction);!n&&_l.und(t.frequency)&&_l.und(t.damping)&&_l.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const vs=[];class bs{constructor(){this.changed=!1,this.values=vs,this.toValues=null,this.fromValues=vs,this.to=void 0,this.from=void 0,this.config=new gs,this.immediate=!1}}function ks(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=ts(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{_l.und(n.pause)||(r.paused=ts(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||ts(e,t)),c=es(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-el.now()}function m(){c>0?(u=el.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ji({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const _s=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Cs(e.get()):t.every((e=>e.noop))?ys(e.get()):Es(e.get(),t.every((e=>e.finished))),ys=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Es=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Cs=e=>({value:e,cancelled:!0,finished:!1});function Ss(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=ls(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Cs(o)||r!==n.asyncId&&Es(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Bs,i=new xs;return(async()=>{if(Ml.skipAnimation)throw ws(n),i.result=Es(o,!1),d(i),i;m(l);const s=_l.obj(e)?Ji({},e):Ji({},t,{to:e});s.parentId=r,Cl(c,((e,t)=>{_l.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let g;if(Ml.skipAnimation)return ws(n),Es(o,!1);try{let t;t=_l.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Es(o.get(),!0,!1)}catch(e){if(e instanceof Bs)g=e.result;else{if(!(e instanceof xs))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return _l.fun(i)&&el.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function ws(e,t){wl(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Bs extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class xs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Is=e=>e instanceof Ns;let Ts=1;class Ns extends fi{constructor(...e){super(...e),this.id=Ts++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Oi(this);return e&&e.getValue()}to(...e){return Ml.to(this,e)}interpolate(...e){return xi(`${wi}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ml.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){mi(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ol.sort(this),mi(this,{type:"priority",parent:this,priority:e})}}const Ps=Symbol.for("SpringPhase"),Ms=e=>(1&e[Ps])>0,Rs=e=>(2&e[Ps])>0,Ls=e=>(4&e[Ps])>0,As=(e,t)=>t?e[Ps]|=3:e[Ps]&=-3,Ds=(e,t)=>t?e[Ps]|=4:e[Ps]&=-5;class Os extends Ns{constructor(e,t){if(super(),this.key=void 0,this.animation=new bs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!_l.und(e)||!_l.und(t)){const n=_l.obj(e)?Ji({},e):Ji({},t,{from:e});_l.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Rs(this)||this._state.asyncTo)||Ls(this)}get goal(){return di(this.animation.to)}get velocity(){const e=Oi(this);return e instanceof Hi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ms(this)}get isAnimating(){return Rs(this)}get isPaused(){return Ls(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=zi(o.to);!i&&ui(o.to)&&(l=Sl(di(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Gi?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=_l.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(_l.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!_l.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=Oi(this),a=s.getValue();if(t){const e=di(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return el.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Rs(this)){const{to:e,config:t}=this.animation;el.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return _l.und(e)?(n=this.queue||[],this.queue=[]):n=[_l.obj(e)?e:Ji({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>_s(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ws(this._state,e&&this._lastCallId),el.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=_l.obj(n)?n[t]:n,(null==n||ds(n))&&(n=void 0),o=_l.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Ms(this)||(e.reverse&&([n,o]=[o,n]),o=di(o),_l.und(o)?Oi(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ji({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,ls(n,((e,t)=>/^on/.test(t)?ns(e,o):e))),Ws(this,n,"onProps"),$s(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return ks(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{Ls(this)||(Ds(this,!0),Bl(i.pauseQueue),$s(this,"onPause",Es(this,Fs(this,this.animation.to)),this))},resume:()=>{Ls(this)&&(Ds(this,!1),Rs(this)&&this._resume(),Bl(i.resumeQueue),$s(this,"onResume",Es(this,Fs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=zs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Cs(this));const o=!_l.und(e.to),r=!_l.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Cs(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!_l.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!yl(d,c);p&&(s.from=d),d=di(d);const m=!yl(u,a);m&&this._focus(u);const f=ds(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(hs(n=Ji({},n),t),t=Ji({},n,t)),hs(e,t),Object.assign(e,t);for(const t in fs)null==e[t]&&(e[t]=fs[t]);let{mass:o,frequency:r,damping:l}=e;_l.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,es(t.config,l),t.config!==i.config?es(i.config,l):void 0);let b=Oi(this);if(!b||_l.und(u))return n(Es(this,!0));const k=_l.und(t.reset)?r&&!t.default:!_l.und(d)&&ts(t.reset,l),_=k?d:this.get(),y=cs(u),E=_l.num(y)||_l.arr(y)||Ti(y),C=!f&&(!E||ts(i.immediate||t.immediate,l));if(m){const e=Ki(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=ui(u),B=!1;if(!w){const e=k||!Ms(this)&&p;(m||e)&&(B=yl(cs(_),y),w=!B),(yl(s.immediate,C)||C)&&yl(g.decay,h)&&yl(g.velocity,v)||(w=!0)}if(B&&Rs(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||ui(a))&&(s.values=b.getPayload(),s.toValues=ui(u)?null:S==Gi?[1]:Sl(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;El(Us,(e=>Ws(this,t,e)));const o=Es(this,Fs(this,a));Bl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&el.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?es(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ss(t.to,t,this._state,this)):w?this._start():Rs(this)&&!m?this._pendingCalls.add(n):n(ys(_))}_focus(e){const t=this.animation;e!==t.to&&(pi(this)&&this._detach(),t.to=e,pi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ui(t)&&(hi(t,this),Is(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ui(e)&&vi(e,this)}_set(e,t=!0){const n=di(e);if(!_l.und(n)){const e=Oi(this);if(!e||!yl(n,e.getValue())){const o=Ki(n);e&&e.constructor==o?e.setValue(n):Fi(this,o.create(n)),e&&el.batchedUpdates((()=>{this._onChange(n,t)}))}}return Oi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,$s(this,"onStart",Es(this,Fs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),es(this.animation.onChange,e,this)),es(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Oi(this).reset(di(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Rs(this)||(As(this,!0),Ls(this)||this._resume())}_resume(){Ml.skipAnimation?this.finish():Ol.start(this)}_stop(e,t){if(Rs(this)){As(this,!1);const n=this.animation;El(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),mi(this,{type:"idle",parent:this});const o=t?Cs(this.get()):Es(this.get(),Fs(this,null!=e?e:n.to));Bl(this._pendingCalls,o),n.changed&&(n.changed=!1,$s(this,"onRest",o,this))}}}function Fs(e,t){const n=cs(t);return yl(cs(e.get()),n)}function zs(e,t=e.loop,n=e.to){let o=es(t);if(o){const r=!0!==o&&as(o),l=(r||e).reverse,i=!r||r.reset;return Vs(Ji({},e,{loop:t,default:!1,pause:void 0,to:!l||ds(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Vs(e){const{to:t,from:n}=e=as(e),o=new Set;return _l.obj(t)&&Gs(t,o),_l.obj(n)&&Gs(n,o),e.keys=o.size?Array.from(o):null,e}function Hs(e){const t=Vs(e);return _l.und(t.default)&&(t.default=ls(t)),t}function Gs(e,t){Cl(e,((e,n)=>null!=e&&t.add(n)))}const Us=["onStart","onRest","onChange","onPause","onResume"];function Ws(e,t,n){e.animation[n]=t[n]!==os(t,n)?ns(t[n],e.key):void 0}function $s(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const js=["onStart","onChange","onRest"];let Ks=1;class qs{constructor(e,t){this.id=Ks++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Ji({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];_l.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Vs(e)),this}start(e){let{queue:t}=this;return e?t=Sl(e).map(Vs):this.queue=[],this._flush?this._flush(this,t):(ta(this,t),Ys(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;El(Sl(t),(t=>n[t].stop(!!e)))}else ws(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(_l.und(e))this.start({pause:!0});else{const t=this.springs;El(Sl(e),(e=>t[e].pause()))}return this}resume(e){if(_l.und(e))this.start({pause:!1});else{const t=this.springs;El(Sl(e),(e=>t[e].resume()))}return this}each(e){Cl(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,wl(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&wl(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,wl(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}el.onFrame(this._onFrame)}}function Ys(e,t){return Promise.all(t.map((t=>Xs(e,t)))).then((t=>_s(e,t)))}async function Xs(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=_l.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=_l.arr(r)||_l.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):El(js,(n=>{const o=t[n];if(_l.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Bl(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===os(t,"cancel");(u||m&&d.asyncId)&&p.push(ks(++e._lastAsyncId,{props:t,state:d,actions:{pause:kl,resume:kl,start(t,n){m?(ws(d,e._lastAsyncId),n(Cs(e))):(t.onRest=s,n(Ss(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=_s(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=zs(t,i,r);if(n)return ta(e,[n]),Xs(e,n,!0)}return a&&el.batchedUpdates((()=>a(f,e,e.item))),f}function Qs(e,t){const n=Ji({},e.springs);return t&&El(Sl(t),(e=>{_l.und(e.keys)&&(e=Vs(e)),_l.obj(e.to)||(e=Ji({},e,{to:void 0})),ea(n,e,(e=>Js(e)))})),Zs(e,n),n}function Zs(e,t){Cl(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,hi(t,e))}))}function Js(e,t){const n=new Os;return n.key=e,t&&hi(n,t),n}function ea(e,t,n){t.keys&&El(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function ta(e,t){El(t,(t=>{ea(e.springs,t,(t=>Js(t,e)))}))}const na=["children"],oa=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,na);const o=(0,vl.useContext)(ra),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,vl.useState)((()=>({inputs:t,result:e()}))),o=(0,vl.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,vl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=ra;return vl.createElement(i,{value:n},t)},ra=(la=oa,ia={},Object.assign(la,vl.createContext(ia)),la.Provider._context=la,la.Consumer._context=la,la);var la,ia;oa.Provider=ra.Provider,oa.Consumer=ra.Consumer;const sa=()=>{const e=[],t=function(t){Ii(`${wi}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return El(e,((e,r)=>{if(_l.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return El(e,(e=>e.pause(...arguments))),this},t.resume=function(){return El(e,(e=>e.resume(...arguments))),this},t.set=function(t){El(e,(e=>e.set(t)))},t.start=function(t){const n=[];return El(e,((e,o)=>{if(_l.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return El(e,(e=>e.stop(...arguments))),this},t.update=function(t){return El(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return _l.fun(e)?e(n,t):e};return t._getProps=n,t};function aa(e,t,n){const o=_l.fun(t)&&t;o&&!n&&(n=[]);const r=(0,vl.useMemo)((()=>o||3==arguments.length?sa():void 0),[]),l=(0,vl.useRef)(0),i=Mi(),s=(0,vl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Qs(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ys(e,t):new Promise((o=>{Zs(e,n),s.queue.push((()=>{o(Ys(e,t))})),i()}))}})),[]),a=(0,vl.useRef)([...s.ctrls]),c=[],u=Li(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new qs(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=Hs(n))}}(0,vl.useMemo)((()=>{El(a.current.slice(e,u),(e=>{ps(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,vl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Qs(e,c[t]))),m=(0,vl.useContext)(oa),f=Li(m),g=m!==f&&us(m);Ai((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],El(e,(e=>e()))),El(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(ms(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ni((()=>()=>{El(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Ji({},e)));return r?[h,r]:h}let ca;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(ca||(ca={}));class ua extends Ns{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=ii(...t);const n=this._get(),o=Ki(n);Fi(this,o.create(n))}advance(e){const t=this._get();yl(t,this.get())||(Oi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&pa(this._active)&&ma(this)}_get(){const e=_l.arr(this.source)?this.source.map(di):Sl(di(this.source));return this.calc(...e)}_start(){this.idle&&!pa(this._active)&&(this.idle=!1,El(zi(this),(e=>{e.done=!1})),Ml.skipAnimation?(el.batchedUpdates((()=>this.advance())),ma(this)):Ol.start(this))}_attach(){let e=1;El(Sl(this.source),(t=>{ui(t)&&hi(t,this),Is(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){El(Sl(this.source),(e=>{ui(e)&&vi(e,this)})),this._active.clear(),ma(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Sl(this.source).reduce(((e,t)=>Math.max(e,(Is(t)?t.priority:0)+1)),0))}}function da(e){return!1!==e.idle}function pa(e){return!e.size||Array.from(e).every(da)}function ma(e){e.idle||(e.idle=!0,El(zi(e),(e=>{e.done=!0})),mi(e,{type:"idle",parent:e}))}Ml.assign({createStringInterpolator:Si,to:(e,t)=>new ua(e,t)}),Ol.advance;var fa=window.ReactDOM;function ga(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const ha=["style","children","scrollTop","scrollLeft"],va=/^--/;function ba(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||va.test(e)||_a.hasOwnProperty(e)&&_a[e]?(""+t).trim():t+"px"}const ka={};let _a={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const ya=["Webkit","Ms","Moz","O"];_a=Object.keys(_a).reduce(((e,t)=>(ya.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),_a);const Ea=["x","y","z"],Ca=/^(matrix|translate|scale|rotate|skew)/,Sa=/^(translate)/,wa=/^(rotate|skew)/,Ba=(e,t)=>_l.num(e)&&0!==e?e+t:e,xa=(e,t)=>_l.arr(e)?e.every((e=>xa(e,t))):_l.num(e)?e===t:parseFloat(e)===t;class Ia extends Wi{constructor(e){let{x:t,y:n,z:o}=e,r=ga(e,Ea);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Ba(e,"px"))).join(",")})`,xa(e,0)]))),Cl(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Ca.test(t)){if(delete r[t],_l.und(e))return;const n=Sa.test(t)?"px":wa.test(t)?"deg":"";l.push(Sl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Ba(r,n)})`,xa(r,0)]:e=>[`${t}(${e.map((e=>Ba(e,n))).join(",")})`,xa(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ta(l,i)),super(r)}}class Ta extends fi{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return El(this.inputs,((n,o)=>{const r=di(n[0]),[l,i]=this.transforms[o](_l.arr(r)?r:n.map(di));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&El(this.inputs,(e=>El(e,(e=>ui(e)&&hi(e,this)))))}observerRemoved(e){0==e&&El(this.inputs,(e=>El(e,(e=>ui(e)&&vi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),mi(this,e)}}const Na=["scrollTop","scrollLeft"];Ml.assign({batchedUpdates:fa.unstable_batchedUpdates,createStringInterpolator:Si,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const Pa=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Wi(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Zi(e)||"Anonymous";return(e=_l.str(e)?l[e]||(l[e]=Yi(e,r)):e[Qi]||(e[Qi]=Yi(e,r))).displayName=`Animated(${t})`,e};return Cl(e,((t,n)=>{_l.arr(e)&&(n=Zi(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=ga(o,ha),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ka[t]||(ka[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=ba(t,r[t]);va.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new Ia(e),getComponentProps:e=>ga(e,Na)}).animated,Ma=e=>e+1,Ra=e=>({top:e.offsetTop,left:e.offsetLeft});var La=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(Ma,0),[u,p]=(0,s.useReducer)(Ma,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?Ra(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Rr.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=Ra(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=_l.fun(e),[[o],r]=aa(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const Aa=".block-editor-block-list__block",Da=".block-list-appender";function Oa(e,t){return t.closest([Aa,Da].join(","))===e}function Fa(e,t){e.parentElement.closest("[contenteditable]").contentEditable=t}function za(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(Hn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(Hn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function g(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void Fa(u,!1);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Aa);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(Fa(u,!1),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function h(){d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),f=p.requestAnimationFrame((()=>{g({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",g),p.addEventListener("mouseup",h),Fa(u,!0))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(Fa(u,!0),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function Va(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(Hn);if(l(e)&&!o()&&!r())return n()}),[e])}(e);return(0,s.useEffect)((()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const o=Rr.focus.tabbable.find(t.current).filter((e=>(0,Rr.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;if(Oa(t.current,l)){if(!l.getAttribute("contenteditable")){const e=Rr.focus.tabbable.findNext(l);if(e&&function(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}(e)&&l.contains(e)&&!e.classList.contains("block-editor-button-block-appender"))return void e.focus()}Fa(t.current,!1),(0,Rr.placeCaretAtHorizontalEdge)(l,r)}else t.current.focus()}),[n]),t}function Ha(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Ga(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Hn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Ha),t.addEventListener("mouseover",Ha),()=>{t.removeEventListener("mouseout",Ha),t.removeEventListener("mouseover",Ha),t.classList.remove("is-hovered")}}),[e])}function Ua(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(Hn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function Wa(e){return(0,m.useSelect)((t=>{const n=t(Hn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function $a(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Hn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function ja(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Hn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function Ka(e){const{isBlockSelected:t}=(0,m.useSelect)(Hn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):Oa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var qa=window.wp.keycodes;function Ya(e){const t=(0,m.useSelect)((t=>t(Hn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Hn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==qa.ENTER&&s!==qa.BACKSPACE&&s!==qa.DELETE||a!==i||(0,Rr.isTextField)(a)||(t.preventDefault(),s===qa.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Xa(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Hn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}var Qa=n(5425),Za=n.n(Qa);function Ja(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(Hn);return n(e)||o()===e}),[e]);return(0,s.useEffect)((()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=(0,Rr.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&Za()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}function ec(){const e=(0,s.useContext)(Wm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function tc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(nc),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Hn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,Va(n),Ja(n),fo(n),Ka(n),za(n),Ya(n),Xa(n),Ga(),ec(),La({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=$n();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,Ua(n),Wa(n),$a(n),ja(n)),style:{...l.style,...e.style}}}tc.save=r.__unstableGetBlockProps;const nc=(0,s.createContext)();function oc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",tc(o,{__unstableIsHtml:n}),t)}const rc=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(Hn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),lc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Hn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Hn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Hn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Hn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var ic=(0,d.compose)(d.pure,rc,lc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Hn),B=(0,s.useCallback)((()=>w(a)),[a]);let x=(0,s.createElement)(zr,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const I=(0,r.getBlockType)(g);null!=I&&I.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,I.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(x=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},x)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},x),(0,s.createElement)(oc,{isHtml:!0},(0,s.createElement)(Zr,{clientId:a}))):(null==I?void 0:I.apiVersion)>1?x:(0,s.createElement)(oc,b,x);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(I,v);N=(0,s.createElement)(oc,{className:"has-warning"},(0,s.createElement)(jr,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Rr.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(nc.Provider,{value:M},(0,s.createElement)(Xr,{fallback:(0,s.createElement)(oc,{className:"has-warning"},(0,s.createElement)(qr,null))},N))})),sc=window.wp.htmlEntities,ac=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const cc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var uc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*cc.length));return(0,s.createElement)(p.Tip,null,cc[e])},dc=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),pc=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:dc});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),mc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(At()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(pc,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function fc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Hn),{getBlockName:h,getBlocks:v}=a.select(Hn),b=(0,m.useSelect)((e=>!t||e(Hn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(Hn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var gc=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(zn,Vn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Hn);return(0,s.useEffect)((()=>{o(n)}),[n]),fc(e),(0,s.createElement)(mo,null,t)}));function hc(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(jm,null)))}function vc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Hn),{clearSelectedBlock:n}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function bc(e){return(0,s.createElement)("div",i({ref:vc()},e))}function kc(e,t){const n="start"===t?"firstChild":"lastChild",o="start"===t?"nextSibling":"previousSibling";for(;e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[o];)e=e[o];return e}function _c(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l}=e(Hn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l()}}function yc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r}=(0,m.useSelect)(_c,[]),l=go(r),i=go((0,u.first)(n)),s=go((0,u.last)(n));return(0,d.useRefEffect)((a=>{const{ownerDocument:c}=a,{defaultView:u}=c;if(null==e)return;if(!o||t){if(!r||t)return;const e=u.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=l.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:d}=n;if(d<2)return;if(!i.current||!s.current)return;a.contentEditable=!0,a.focus();const p=u.getSelection(),m=c.createRange(),f=kc(i.current,"start"),g=kc(s.current,"end");m.setStartBefore(f),m.setEndAfter(g),p.removeAllRanges(),p.addRange(m)}),[o,t,n,r,e])}function Ec(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Cc(e,t,n,o){let r,l=Rr.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!Rr.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function Sc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(Hn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((d=>{let p;function m(){p=null}function f(l){const i=e(),s=t(),a=n(),d=o(a||i),p=r(a||i),m=l?d:p;m&&(s===m?u(m):c(s||i,m))}function g(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function h(t){const{keyCode:l,target:i}=t,c=l===qa.UP,u=l===qa.DOWN,m=l===qa.LEFT,h=l===qa.RIGHT,v=c||m,b=m||h,k=c||u,_=b||k,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=k?Rr.isVerticalEdge:Rr.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:g)(v),t.preventDefault()));if(k?p||(p=(0,Rr.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===qa.UP||t===qa.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,Rr.isRTL)(i)?!v:v,{keepCaretInsideBlock:x}=s(),I=e();if(y){const e=n(),l=o(e||I),s=r(e||I);(v&&l||!v&&s)&&function(e,t){const n=Cc(e,t,d);return!n||!function(e,t){return e.closest(Aa)===t.closest(Aa)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,Rr.isVerticalEdge)(i,v)&&!x){const e=Cc(i,v,d,!0);e&&((0,Rr.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,Rr.isHorizontalEdge)(i,B)&&!x){const e=Cc(i,B,d);(0,Rr.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",h),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",h)}}),[])}var wc=window.wp.keyboardShortcuts;function Bc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Hn),{multiSelect:o}=(0,m.useDispatch)(Hn),r=(0,wc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Rr.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function xc(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(Hn),{setNavigationMode:a}=(0,m.useDispatch)(Hn),c=(0,m.useSelect)((e=>e(Hn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Rr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===qa.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==qa.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if((Ec(e.target)||e.target.getAttribute("data-block")===l())&&Ec(Rr.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==qa.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Rr.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Hn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,yc(),Bc(),Sc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var Ic=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=xc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const Tc="editor-styles-wrapper";function Nc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Pc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Nc(null==a?void 0:a.styles),_=Nc(null==a?void 0:a.scripts),y=vc(),[E,C,S]=xc(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",(()=>{t()}))}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),x=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${Tc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:x,className:c()(Tc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),Mc={grad:.9,turn:360,rad:360/(2*Math.PI)},Rc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Lc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ac=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Dc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Oc=function(e){return{r:Ac(e.r,0,255),g:Ac(e.g,0,255),b:Ac(e.b,0,255),a:Ac(e.a)}},Fc=function(e){return{r:Lc(e.r),g:Lc(e.g),b:Lc(e.b),a:Lc(e.a,3)}},zc=/^#([0-9a-f]{3,8})$/i,Vc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Hc=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Gc=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Uc=function(e){return{h:Dc(e.h),s:Ac(e.s,0,100),l:Ac(e.l,0,100),a:Ac(e.a)}},Wc=function(e){return{h:Lc(e.h),s:Lc(e.s),l:Lc(e.l),a:Lc(e.a,3)}},$c=function(e){return Gc((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},jc=function(e){return{h:(t=Hc(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Kc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qc={string:[[function(e){var t=zc.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Lc(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Lc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Yc.exec(e)||Xc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Oc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Kc.exec(e)||qc.exec(e);if(!t)return null;var n,o,r=Uc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Mc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return $c(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return Rc(t)&&Rc(n)&&Rc(o)?Oc({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!Rc(t)||!Rc(n)||!Rc(o))return null;var i=Uc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return $c(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Rc(t)||!Rc(n)||!Rc(o))return null;var i=function(e){return{h:Dc(e.h),s:Ac(e.s,0,100),v:Ac(e.v,0,100),a:Ac(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Gc(i)},"hsv"]]},Zc=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Jc=function(e,t){var n=jc(e);return{h:n.h,s:Ac(n.s+100*t,0,100),l:n.l,a:n.a}},eu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},tu=function(e,t){var n=jc(e);return{h:n.h,s:n.s,l:Ac(n.l+100*t,0,100),a:n.a}},nu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Zc(e.trim(),Qc.string):"object"==typeof e&&null!==e?Zc(e,Qc.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Lc(eu(this.rgba),2)},e.prototype.isDark=function(){return eu(this.rgba)<.5},e.prototype.isLight=function(){return eu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Fc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Vc(Lc(255*r)):"","#"+Vc(t)+Vc(n)+Vc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Fc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Fc(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Wc(jc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Wc(jc(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Hc(this.rgba),{h:Lc(e.h),s:Lc(e.s),v:Lc(e.v),a:Lc(e.a,3)};var e},e.prototype.invert=function(){return ou({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),ou(Jc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),ou(Jc(this.rgba,-e))},e.prototype.grayscale=function(){return ou(Jc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),ou(tu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),ou(tu(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?ou({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Lc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=jc(this.rgba);return"number"==typeof e?ou({h:e,s:t.s,l:t.l,a:t.a}):Lc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===ou(e).toHex()},e}(),ou=function(e){return e instanceof nu?e:new nu(e)},ru=[],lu=function(e){e.forEach((function(e){ru.indexOf(e)<0&&(e(nu,Qc),ru.push(e))}))};function iu(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var su=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},au=function(e){return.2126*su(e.r)+.7152*su(e.g)+.0722*su(e.b)};function cu(e){e.prototype.luminance=function(){return e=au(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=au(l))>(a=au(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var uu=n(3124),du=n.n(uu);const pu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function mu(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return fu(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=fu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(pu,""),value:n?fu(n[0]).replace(pu,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=fu(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:fu(t[1]),media:fu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=fu(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=fu(t[1]),o=fu(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return gu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function fu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function gu(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){gu(e,o)})):n&&"object"==typeof n&&gu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var hu=n(8575),vu=n.n(hu),bu=ku;function ku(e){this.options=e||{}}ku.prototype.emit=function(e){return e},ku.prototype.visit=function(e){return this[e.type](e)},ku.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var _u=yu;function yu(e){bu.call(this,e)}vu()(yu,bu),yu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},yu.prototype.comment=function(e){return this.emit("",e.position)},yu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},yu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},yu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},yu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},yu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},yu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},yu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},yu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},yu.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},yu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Eu=Cu;function Cu(e){e=e||{},bu.call(this,e),this.indentation=e.indent}vu()(Cu,bu),Cu.prototype.compile=function(e){return this.stylesheet(e)},Cu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Cu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Cu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Cu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Cu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Cu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Cu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Cu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Cu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},Cu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},Cu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Cu.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Cu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Cu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Cu.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},Cu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Cu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var Su=function(e,t){try{const r=mu(e);return n=du().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new _u(o):new Eu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function wu(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function Bu(e,t){return new URL(e,t).toString()}var xu=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};wu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Bu(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const Iu=/^(body|html|:root).*$/;var Tu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(Iu)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Nu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Tu(t)),o&&r.push(xu(o)),r.length?Su(n,(0,d.compose)(r)):n}))};const Pu=".editor-styles-wrapper";function Mu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Pu);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=ou(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Ru(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Nu(t,Pu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Mu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let Lu;lu([iu,cu]);const Au=2e3;var Du=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[o,{width:r}]=(0,d.useResizeObserver)(),[l,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c}=(0,m.useSelect)((e=>{const t=e(Hn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);Lu=Lu||(0,d.pure)(jm);const f=r/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},o,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>Au?Au*f:void 0}},(0,s.createElement)(Pc,{head:(0,s.createElement)(Ru,{styles:u}),assets:c,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:Au}},l,(0,s.createElement)(Lu,{renderAppender:!1}))))},Ou=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l}=e;const i=(0,m.useSelect)((e=>e(Hn).getSettings()),[]),a=(0,s.useMemo)((()=>{const e={...i};return e.__experimentalBlockPatterns=[],e}),[i]),c=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(gc,{value:c,settings:a},r?(0,s.createElement)(hc,{onClick:l}):(0,s.createElement)(Du,{viewportWidth:o,__experimentalPadding:n})):null}));function Fu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Hn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(gc,{value:p,settings:a},(0,s.createElement)(qm,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var zu=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(Ou,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(mc,{title:i,icon:a,description:c}))},Vu=(0,s.createContext)(),Hu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(Vu);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),Gu=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Uu(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(pc,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
+
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(pc,{icon:Gu})))))}var Wu=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(Uu,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function $u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var ju=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Wu,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(Hu,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,$u()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===qa.ENTER&&(e.preventDefault(),l(o,$u()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(pc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),Ku=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Mt.speak)((0,g.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),qu=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(Vu);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Yu=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Ku,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(qu,{key:t},e.map(((e,l)=>(0,s.createElement)(ju,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Xu=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},Qu=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Hn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},Zu=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(Vu.Provider,{value:n},t)};const Ju=[];var ed=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Qu(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:Ju);return(0,s.createElement)(Zu,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Xu,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(Yu,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Xu,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Yu,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Xu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(Yu,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(Xu,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Yu,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},td=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(p.FlexItem,{isBlock:!0},(0,s.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,g.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},nd=window.wp.notices,od=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Hn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(nd.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
+
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function rd(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(rd)}`;return(0,s.createElement)(Wu,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(Ou,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function ld(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var id=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(rd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(ld,{key:e.name}))))};function sd(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function ad(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var cd=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(ad,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(sd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},ud=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(ir,{className:"block-editor-inserter__no-results-icon",icon:dc}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},dd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Hn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Hn),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Hn),k=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
|
15 |
+
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Mt.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const pd=e=>e.name||"",md=e=>e.title,fd=e=>e.description||"",gd=e=>e.keywords||[],hd=e=>e.category,vd=()=>null;function bd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const kd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(bd(e))},_d=(e,t)=>(0,u.differenceWith)(e,kd(t),((e,t)=>t.includes(e))),yd=(e,t,n,o)=>0===kd(o).length?e:Ed(e,o,{getCategory:e=>{var n;return null===(n=(0,u.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}}),Ed=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=kd(t);if(0===o.length)return e;const r=e.map((e=>[e,Cd(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function Cd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=pd,getTitle:r=md,getDescription:l=fd,getKeywords:i=gd,getCategory:s=hd,getCollection:a=vd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=bd(t),v=bd(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===_d(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Sd(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,g.sprintf)(
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
+
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var wd=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Mt.speak,500),[l,i]=dd({shouldFocusBlock:!0}),[a,,c]=od(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ed(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,s.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,g.sprintf)(
|
18 |
/* translators: %d: number of results. */
|
19 |
+
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(Sd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Zu,null,!f&&(0,s.createElement)(ud,null),f&&(0,s.createElement)(id,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Bd(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(cd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(wd,{filterValue:o,selectedCategory:l,patternCategories:n}))}var xd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Bd,n))};function Id(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=od(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(id,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var Td=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=od(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(td,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Id,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(xd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Nd=window.wp.url;function Pd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Qu(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(ud,null):(0,s.createElement)(Xu,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(Yu,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var Md=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pd,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,Nd.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:Rd,Slot:Ld}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Rd.Slot=Ld;var Ad=Rd;const Dd=[];var Od=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Mt.speak,500),[_,y]=dd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Qu(_,y),[B,,x]=od(y,_),I=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ed(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&I.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=yd((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+I.length,n=(0,g.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?I:Dd),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(I),L=!!N.length&&(0,s.createElement)(Xu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(Yu,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!I.length&&(0,s.createElement)(Xu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(id,{shownPatterns:M,blockPatterns:I,onClickPattern:x,isDraggable:h})));return(0,s.createElement)(Zu,null,!f&&!R&&(0,s.createElement)(ud,null),b?A:L,!!N.length&&!!I.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(Ad.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(ud,null))))};const Fd={name:"blocks",
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
+
title:(0,g.__)("Blocks")},zd={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
+
title:(0,g.__)("Patterns")},Vd={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
+
title:(0,g.__)("Reusable")};var Hd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Fd];return n&&e.push(zd),o&&e.push(Vd),e}),[Fd,n,zd,o,Vd]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Gd=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=dd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Hn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),x=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),I=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(ed,{rootClientId:y,onInsert:B,onHover:I,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,s.createElement)(uc,null)))),[y,B,I,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Td,{rootClientId:y,onInsert:x,onClickCategory:T,selectedCategory:k})),[y,x,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(Md,{rootClientId:y,onInsert:B,onHover:I})),[y,B,I]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:"block-editor-inserter__main-area"},(0,s.createElement)("div",{className:"block-editor-inserter__content"},(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(Od,{filterValue:f,onSelect:i,onHover:I,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(Hd,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(zu,{item:v}))}));function Ud(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=dd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Qu(a,u),[f]=od(u,a),{setInserterIsOpened:h,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(Hn),i=t(),s=r(o),a=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&s>0&&(s<a||0===a),insertionIndex:-1===s?a:s}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,s.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return k&&(y=b?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":h})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Od,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),h&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Wd=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
28 |
+
(0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:ac,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},d))};class $d extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Wd}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,s.createElement)(Ud,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(Gd,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var jd=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(Hn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=s(o),p=a(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(Hn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Hn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(Hn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
|
29 |
+
(0,g.__)("%s block added"),a.title);(0,Mt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])($d),Kd=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Hn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Hn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,sc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{qa.ENTER!==e.keyCode&&qa.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(jd,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function qd(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(jd,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(ir,{icon:ac}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Yd=(0,s.forwardRef)(((e,t)=>(At()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),qd(e,t))));var Xd=(0,s.forwardRef)(qd),Qd=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Hn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(Kd,{rootClientId:n}):(0,s.createElement)(Xd,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),"data-block":!0},t)}));function Zd(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const Jd=(0,s.createContext)();function ep(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Hn),l=(0,s.useContext)(Jd),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Hn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),b=ho(u),k=ho(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Zd(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,x={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},I={start:{scale:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(jd,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function tp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(Hn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Jd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(ep,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function np(){const e=(0,s.useContext)(Jd),t=(0,m.useSelect)((e=>e(Hn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Hn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const op="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,rp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function lp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Hn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description}:d}),[e])}function ip(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Hn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=lp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function sp(e){let{clientId:t,maximumLength:n}=e;return ip(t,n)}var ap=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:o,getTemplateLock:l,getBlockName:i}=e(Hn),s=o(n[0]),a=s?l(s):null,c=i(n[0]);return{srcRootClientId:s,isDraggable:"all"!==a,icon:null===(t=(0,r.getBlockType)(c))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,Rr.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(Hn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Uu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},cp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=lp(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Hn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(Hn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Mt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:I,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Hn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Hn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(pc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ap,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Gu,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===qa.UP,l=n===qa.DOWN,i=n===qa.LEFT,s=n===qa.RIGHT,a=n===qa.TAB,c=n===qa.ESCAPE,u=n===qa.ENTER,d=n===qa.SPACE,p=e.shiftKey;if(n===qa.BACKSPACE||n===qa.DELETE)return k(t),void e.preventDefault();const m=x(),f=I(),g=T(f||m),h=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=w(F),t=w(m),n=S(F);let o=S(m);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;if(b){t=o;do{t=Rr.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=Rr.focus.tabbable.findNext(t))}else t=Rr.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(sp,{clientId:t,maximumLength:35})))))};function up(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var dp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Rr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||At()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Rr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,wc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=up(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=up(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},pp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),mp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),fp=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),gp=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const hp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?pp:mp:fp:"down"===e?"horizontal"===t?(0,g.isRTL)()?mp:pp:gp:null,vp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,bp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(bp),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Hn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Hn),B="up"===o?w:S,x=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:hp(o,C),label:vp(o,C),"aria-describedby":x},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:x,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),kp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(bp,i({direction:"up",ref:t},e)))),_p=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(bp,i({direction:"down",ref:t},e))));var yp=(0,m.withSelect)(((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:l,getBlockIndex:i,getBlockListSettings:s,canMoveBlocks:a,getBlockOrder:c,getBlockRootClientId:d}=e(Hn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),g=d((0,u.first)(p)),h=i(m),v=0===h,b=i((0,u.last)(p))===c(g).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:a(o,g),rootClientId:g,firstIndex:h,isFirst:v,isLast:b,orientation:null===(n=s(g))||void 0===n?void 0:n.orientation}}))((function(e){let{isFirst:t,isLast:n,clientIds:o,canMove:r,isHidden:l,rootClientId:a,orientation:u,hideDragHandle:d}=e;const[m,f]=(0,s.useState)(!1),h=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!a)return null;const b=(0,g.__)("Drag");return(0,s.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,s.createElement)(ap,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:Gu,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:b,tabIndex:"-1"},e)))),(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(kp,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(_p,i({clientIds:o},e))))))}));const{clearTimeout:Ep,setTimeout:Cp}=window,Sp=200;function wp(e){let{ref:t,isFocused:n,debounceTimeout:o=Sp,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=a.current;e&&Ep&&Ep(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Cp((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Bp(e){let{ref:t,debounceTimeout:n=Sp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=wp({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function xp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Hn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Hn),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=lp(n),c=(0,s.useRef)(),{gestures:u}=Bp({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,g.sprintf)(
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
+
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(pc,{icon:a.icon})}))}var Ip=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Tp(e){let{blocks:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(Ou,{viewportWidth:500,blocks:t})))))}var Np=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)();return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,s.createElement)(Tp,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,s.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>a(null),onMouseEnter:()=>a(t)},(0,s.createElement)(pc,{icon:n,showColors:!0}),l)})))},Pp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Mp=window.wp.tokenList,Rp=n.n(Mp);function Lp(e,t,n){const o=new(Rp())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Ap(e){return(0,u.find)(e,"isDefault")}function Dp(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Hn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(Hn),d=function(e){return e&&0!==e.length?Ap(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(Rp())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(d,a),f=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=Lp(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function Op(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Dp({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?Pp:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Fp(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(Op,{clientId:o,onSwitch:n}))}const zp=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=zp(e,t,n);if(o)return o}}},Vp=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function Hp(e){let{patterns:t,onSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(Gp,{patterns:t,onSelect:n})))))}function Gp(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,s.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Up,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Up(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Up,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(Ou,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(p.VisuallyHidden,{id:l},t.description))}var Wp=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=zp(r,t.name,o);if(n){e=!0,o.add(n.clientId),Vp(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(Hp,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:pp},(0,g.__)("Patterns"))):null};const $p=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Hn),l=lp(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Hn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Hn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon:v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:Ip;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==h||!h.length)&&a;if(!c&&!k)return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(pc,{icon:d,showColors:!0})}));const y=f,E=1===n.length?(0,g.sprintf)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
+
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(sp,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(Wp,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Np,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(Fp,{hoveredBlock:n[0],onSwitch:l}))})))))};var jp=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Hn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)($p,{clientIds:t,blocks:n})},Kp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),qp=window.wp.blob;function Yp(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function Xp(){const{getBlockName:e}=(0,m.useSelect)(Hn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(nd.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
+
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Qp(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(Hn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(Hn),a=Xp();return(0,d.useRefEffect)((c=>{function u(u){const d=t();if(0===d.length)return;if(!n()){const{target:e}=u,{ownerDocument:t}=e;if("copy"===u.type||"cut"===u.type?(0,Rr.documentHasUncollapsedSelection)(t):(0,Rr.documentHasSelection)(t))return}if(!c.contains(u.target.ownerDocument.activeElement))return;const p=u.defaultPrevented;if(u.preventDefault(),"copy"===u.type||"cut"===u.type){1===d.length&&l(d[0]),a(u.type,d);const t=e(d),n=(0,r.serialize)(t);u.clipboardData.setData("text/plain",n),u.clipboardData.setData("text/html",n)}if("cut"===u.type)i(d);else if("paste"===u.type){if(p)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Rr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Yp(r,o)&&(o=r.map((e=>`<img src="${(0,qp.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(u),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});s(d,l,l.length-1,-1)}}return c.ownerDocument.addEventListener("copy",u),c.ownerDocument.addEventListener("cut",u),c.ownerDocument.addEventListener("paste",u),()=>{c.ownerDocument.removeEventListener("copy",u),c.ownerDocument.removeEventListener("cut",u),c.ownerDocument.removeEventListener("paste",u)}}),[])}var Zp=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Qp()},t)};function Jp(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Hn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:x,selectBlock:I}=(0,m.useDispatch)(Hn),T=Xp();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){x(!0),I(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&w(e[0]),T("copy",e)}})}var em=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Hn),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(Hn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),tm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Hn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Hn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:nm,Slot:om}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");nm.Slot=om;var rm=nm;function lm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Hn);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}var im=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),sm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})),am=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"}));function cm(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,s.useState)({move:!1,remove:!1}),{canMove:l,canRemove:i}=(0,m.useSelect)((e=>{const{canMoveBlock:n,canRemoveBlock:o,getBlockRootClientId:r}=e(Hn),l=r(t);return{canMove:n(t,l),canRemove:o(t,l)}}),[t]),{updateBlockAttributes:a}=(0,m.useDispatch)(Hn),c=lp(t),u=(0,d.useInstanceId)(cm,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{r({move:!l,remove:!i})}),[l,i]);const f=Object.values(o).every(Boolean);let h;return h=f?"true":Object.values(o).some(Boolean)?"mixed":"false",(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
|
56 |
+
/* translators: %s: Name of the block. */
|
57 |
+
(0,g.__)("Lock %s"),c.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),a([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":u,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:u},(0,g.__)("Lock all")),checked:f,"aria-checked":h,onChange:e=>r({move:e,remove:e})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:Gu})),checked:o.move,onChange:e=>r((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:am})),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))})))),(0,s.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function um(e){let{clientId:t}=e;const{canLockBlock:n,isLocked:o}=(0,m.useSelect)((e=>{const{canMoveBlock:n,canRemoveBlock:o,canLockBlockType:r,getBlockName:l,getBlockRootClientId:i}=e(Hn),s=i(t);return{canLockBlock:r(l(t)),isLocked:!n(t,s)||!o(t,s)}}),[t]),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?im:sm,onClick:l},i),r&&(0,s.createElement)(cm,{clientId:t,onClose:l}))}const{Fill:dm,Slot:pm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function mm(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(dm,t))}mm.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:l,canRemove:a}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Hn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),c=1===l.length,d=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(Hn),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}(),{isGroupable:f,isUngroupable:g}=d,h=(f||g)&&a;return(0,s.createElement)(pm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!h&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(um,{clientId:l[0]}),e,h&&(0,s.createElement)(lm,i({},d,{onClose:null==t?void 0:t.onClose})))))};var fm=mm;const gm={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function hm(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var vm=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...r}=e;const l=(0,u.castArray)(t),a=l.length,c=l[0],{onlyBlock:d,previousBlockClientId:f,nextBlockClientId:h,selectedBlockClientIds:v}=(0,m.useSelect)((e=>{const{getBlockCount:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSelectedBlockClientIds:r}=e(Hn);return{onlyBlock:1===t(),previousBlockClientId:n(c),nextBlockClientId:o(c),selectedBlockClientIds:r()}}),[c]),b=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(wc.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),k=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),_=ip(c,25),y=(0,s.useCallback)(n?()=>{const e=f||h;e&&v.includes(c)&&!v.includes(e)&&n(e)}:u.noop,[n,f,h,v]),E=(0,g.sprintf)(
|
58 |
/* translators: %s: block name */
|
59 |
+
(0,g.__)("Remove %s"),_),C=1===a?E:(0,g.__)("Remove blocks");return(0,s.createElement)(Jp,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:m,canRemove:f,onDuplicate:h,onInsertAfter:v,onInsertBefore:_,onRemove:E,onCopy:S,onMoveTo:w,blocks:B}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Kp,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:gm,noIcons:!0},r),(e=>{let{onClose:r}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(rm.Slot,{fillProps:{onClose:r}}),1===a&&(0,s.createElement)(tm,{clientId:c}),(0,s.createElement)(hm,{blocks:B,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,h,k),shortcut:b.duplicate},(0,g.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,_),shortcut:b.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,v),shortcut:b.insertAfter},(0,g.__)("Insert after"))),m&&!d&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,w)},(0,g.__)("Move to")),1===a&&(0,s.createElement)(em,{clientId:c,onToggle:r})),(0,s.createElement)(fm.Slot,{fillProps:{onClose:r},clientIds:t}),"function"==typeof o?o({onClose:r}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:r}))),f&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,E,y),shortcut:b.remove},C)))}))}))},bm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(vm,i({clientIds:t,toggleProps:e},n)))))};function km(e){let{clientId:t}=e;const n=lp(t),{canMove:o,canRemove:r,canLockBlock:l}=(0,m.useSelect)((e=>{const{canLockBlockType:n,getBlockName:o,canMoveBlock:r,canRemoveBlock:l}=e(Hn);return{canMove:r(t),canRemove:l(t),canLockBlock:n(o(t))}}),[t]),[i,a]=(0,s.useReducer)((e=>!e),!1);return l?o&&r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:sm,label:(0,g.sprintf)(
|
60 |
+
/* translators: %s: block name */
|
61 |
+
(0,g.__)("Unlock %s"),n.title),onClick:a})),i&&(0,s.createElement)(cm,{clientId:t,onClose:a})):null}function _m(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Hn),a=o(),c=a[0],u=i(c),d=s();return{blockClientIds:a,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:a.every((e=>l(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:h}=(0,m.useDispatch)(Hn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=Bp({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(xp,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(jp,{clientIds:n}),!C&&(0,s.createElement)(km,{clientId:n[0]}),(0,s.createElement)(yp,{clientIds:n,hideDragHandle:t||u}))),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Qn.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Qn.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Qn.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Qn.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Qn.Slot,{group:"other",className:"block-editor-block-toolbar__slot"})),(0,s.createElement)(bm,{clientIds:n}))}var ym=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(Hn),{getBlockType:l}=e(r.store),i=o(),s=i[0],a=n(s),c=l(t(a[a.length-1]));return{blockType:s&&l(t(s)),hasParents:a.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(dp,i({focusOnMount:t,className:d
|
62 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(_m,{hideDragHandle:n}))};function Em(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(Hn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Cm(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Em,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Hn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(Hn),x=!g&&!u&&r&&o,I=u,T=!u&&!b&&y&&!x&&!f&&(!g||h),N=!(u||T||b||r);(0,wc.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,s.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,s.useRef)(),M=ho(t),R=ho(k),L=ho(l),A=Zd(a);if(!(I||T||E||x))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=x?"top left right":"top right left",{ownerDocument:z}=D,V=x?void 0:z.defaultView.frameElement||(0,Rr.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(jd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(ym,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),I&&(0,s.createElement)(cp,{clientId:t,rootClientId:n,blockElement:D}),x&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(jd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function Sm(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Hn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function wm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(Sm,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Cm,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Bm(e){let{children:t}=e;const n=(0,s.useContext)(Jd),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(At()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(tp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(wm,{__unstablePopoverSlot:"block-toolbar"}),t))}var xm=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=$n();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Im=xm((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Xd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Tm=(0,d.compose)([xm,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Hn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Kd,{rootClientId:t})})),Nm=window.wp.isShallowEqual,Pm=n.n(Nm);const Mm=new WeakMap;function Rm(e,t){const n=(0,m.useSelect)((e=>e(Hn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Hn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Hn),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,Rr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function Lm(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function Am(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Lm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Dm(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Am(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function Om(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Hn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Hn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Hn),a=Rm(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Dm(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function Fm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Hn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Hn).getBlockRootClientId(e);return{blockListSettings:t(Hn).getBlockListSettings(e),parentLock:t(Hn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=ar(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Pm()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Hn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Hn),a=(0,m.useSelect)((t=>t(Hn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(Hn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Mm.has(t)||Mm.set(t,new WeakMap);const n=Mm.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(Ar,{value:k},(0,s.createElement)(qm,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function zm(e){return fc(e),(0,s.createElement)(Fm,e)}const Vm=(0,s.forwardRef)(((e,t)=>{const n=Hm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Hm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=$n(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(Hn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Om({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?zm:Fm;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(qm,t)}}Hm.save=r.__unstableGetInnerBlocksProps,Vm.DefaultBlockAppender=Tm,Vm.ButtonBlockAppender=Im,Vm.Content=()=>Hm.save().children;var Gm=Vm;const Um=(0,s.createContext)(),Wm=(0,s.createContext)();function $m(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Hn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=Hm({ref:(0,d.useMergeRefs)([vc(),np(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(Um.Provider,{value:o},(0,s.createElement)("div",p))}function jm(e){return function(){const e=(0,m.useSelect)((e=>e(Hn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Hn).__experimentalGetParsedPattern(e[n].name),t=op(o))};return t=op(o),()=>rp(t)}),[e])}(),(0,s.createElement)(Bm,null,(0,s.createElement)(Wn,{value:Gn},(0,s.createElement)($m,e)))}function Km(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=cr}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Hn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(dr,{value:l},(0,s.createElement)(Wm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(ic,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Qd,{tagName:r,rootClientId:n,renderAppender:o}))}function qm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Km,e))}jm.__unstableElementContext=Um;const Ym=["colors","disableCustomColors","gradients","disableCustomGradients"];function Xm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Qm(e){const t={};return t.colors=_o("color.palette"),t.gradients=_o("color.gradients"),t.disableCustomColors=!_o("color.custom"),t.disableCustomGradients=!_o("color.customGradient"),(0,s.createElement)(Xm,i({},t,e))}var Zm=function(e){return(0,u.every)(Ym,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Xm,e):(0,s.createElement)(Qm,e)};function Jm(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(Zm,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function ef(){return{disableCustomColors:!_o("color.custom"),disableCustomGradients:!_o("color.customGradient")}}function tf(){const e=ef(),t=_o("color.palette.custom"),n=_o("color.palette.theme"),o=_o("color.palette.default"),r=_o("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=_o("color.gradients.custom"),i=_o("color.gradients.theme"),a=_o("color.gradients.default"),c=_o("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}lu([iu,cu]);const nf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},of=(e,t)=>(0,u.find)(e,{color:t});function rf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const lf=[];function sf(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=tf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=nf(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=nf(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=of(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:Co(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(Jm,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function af(e,t,n){var o;if(!Rf(t,"color")||Lf(t))return e;const{borderColor:r,style:l}=n,i=rf("border-color",r),s=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=s||void 0,e}const cf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=_o("color.palette")||lf;if(!Rf(r,"color")||Lf(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=nf(c,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,s.createElement)(e,i({},t,{wrapperProps:d}))}));function uf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function df(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=uf(o),i=0===r||r?`${r}${l}`:void 0;return i}function pf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=df(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function mf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function ff(e){let{onChange:t,values:n,...o}=e;const r=df(n),l=mf(n)&&pf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Rf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",af),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Rf(e,"color")||Lf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),af(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",cf);const gf={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function hf(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(gf).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var vf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),bf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function kf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?vf:bf,iconSize:16,"aria-label":o})))}const _f={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},yf={px:100,em:20,rem:20};function Ef(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!mf(n)||!pf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return uf(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(df(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ff,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:yf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(hf,{min:0,onChange:t,values:n||_f,units:l}),(0,s.createElement)(kf,{onClick:()=>r(!o),isLinked:o})))}function Cf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ef,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Co(t)),o({style:t})}})}var Sf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"})),wf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),Bf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const xf=[{label:(0,g.__)("Solid"),icon:Sf,value:"solid"},{label:(0,g.__)("Dashed"),icon:wf,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Bf,value:"dotted"}];function If(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},xf.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const Tf=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(If,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:Co(t)})}})},Nf=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=Co(s)),o({borderColor:p,style:s})},units:h})},Pf="__experimentalBorder";function Mf(e){const{clientId:t}=e,n=_o("border.color")&&Rf(e.name,"color"),o=_o("border.radius")&&Rf(e.name,"radius"),l=_o("border.style")&&Rf(e.name,"style"),i=_o("border.width")&&Rf(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const a=(0,r.getBlockSupport)(e.name,[Pf,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(Po,{__experimentalGroup:"border"},i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Af(o,"width")})}(e),isShownByDefault:null==a?void 0:a.width,resetAllFilter:c("width"),panelId:t},(0,s.createElement)(Nf,e)),l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Af(o,"style")})}(e),isShownByDefault:null==a?void 0:a.style,resetAllFilter:c("style"),panelId:t},(0,s.createElement)(Tf,e)),n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:Af(o,"color")})}(e),isShownByDefault:null==a?void 0:a.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(sf,e)),o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Af(o,"radius")})}(e),isShownByDefault:null==a?void 0:a.radius,resetAllFilter:c("radius"),panelId:t},(0,s.createElement)(Cf,e)))}function Rf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,Pf);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function Lf(e){const t=(0,r.getBlockSupport)(e,Pf);return null==t?void 0:t.__experimentalSkipSerialization}function Af(e,t){return Co({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Df(e){if(e)return`has-${e}-gradient-background`}function Of(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Ff(e,t){return(0,u.find)(e,["gradient",t])}function zf(e,t){const n=Ff(e,t);return n&&n.slug}function Vf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=$n(),o=_o("color.gradients.custom"),r=_o("color.gradients.theme"),l=_o("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Hn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Hn),d=(0,s.useCallback)((o=>{const r=zf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Df(a);let f;return f=a?Of(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}lu([iu,cu]);var Hf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=ou(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=ou(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
63 |
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
64 |
+
(0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Mt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Gf(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...tf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(Zm,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function Uf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Wf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=go(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(Uf(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(Uf(t).color);let n=p.current,o=Uf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Uf(n).backgroundColor;i(o)})),(0,s.createElement)(Po,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(Gf,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(Hf,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const $f="color",jf=e=>{const t=(0,r.getBlockSupport)(e,$f);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Kf=e=>{const t=(0,r.getBlockSupport)(e,$f);return null==t?void 0:t.__experimentalSkipSerialization},qf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,$f);return(0,u.isObject)(t)&&!!t.link},Yf=e=>{const t=(0,r.getBlockSupport)(e,$f);return(0,u.isObject)(t)&&!!t.gradients},Xf=e=>{const t=(0,r.getBlockSupport)(e,$f);return t&&!1!==t.background},Qf=e=>{const t=(0,r.getBlockSupport)(e,$f);return t&&!1!==t.text},Zf=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Jf=(e,t)=>Co(So(t,e,void 0)),eg=e=>({textColor:void 0,style:Jf(["color","text"],e.style)}),tg=e=>({style:Jf(["elements","link","color","text"],e.style)}),ng=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function og(e,t,n){var o,r,l,i,s,a;if(!jf(t)||Kf(t))return e;const u=Yf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=rf("background-color",d),h=Df(m),v=rf("color",p),b=c()(e.className,v,h,{[g]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!g),"has-text-color":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.text),"has-background":d||(null==f||null===(l=f.color)||void 0===l?void 0:l.background)||u&&(m||(null==f||null===(i=f.color)||void 0===i?void 0:i.gradient)),"has-link-color":null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color});return e.className=b||void 0,e}const rg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?nf(e,n[1]).color:t};function lg(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=_o("color.palette.custom"),h=_o("color.palette.theme"),v=_o("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=_o("color.gradients.custom"),_=_o("color.gradients.theme"),y=_o("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=_o("color.custom"),S=_o("color.customGradient"),w=_o("color.background"),B=_o("color.link"),x=_o("color.text"),I=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!jf(p))return null;const P=qf(p)&&B&&I,M=Qf(p)&&x&&I,R=Xf(p)&&w&&I,L=Yf(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=Of(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=of(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:Co(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[$f,"__experimentalDefaultControls"]);return(0,s.createElement)(Wf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:nf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Zf("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Jf(["color","text"],t.style)})})(e),resetAllFilter:eg}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:nf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=zf(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Co(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Co(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Zf("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(ng(t))})(e),resetAllFilter:ng}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=of(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Co(So(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:rg(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Zf("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Jf(["elements","link","color","text"],t.style)})})(e),resetAllFilter:tg}]:[]]})}const ig=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=_o("color.palette.custom")||[],u=_o("color.palette.theme")||[],d=_o("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!jf(o)||Kf(o))return(0,s.createElement)(e,t);const m={};var f,g;a&&(m.color=null===(f=nf(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(g=nf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),sg={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return jf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Yf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",og),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!jf(e)||Kf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),og(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ig),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return wo({linkColor:qf(r),textColor:Qf(r),backgroundColor:Xf(r),gradient:Yf(r)},sg,e,t,n,o)}));const ag=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],cg=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],ug=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function dg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=ug(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return ag.forEach((t=>{let{name:n,value:o}=t;cg.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
65 |
/* translators: 1: Font weight name. 2: Font style name. */
|
66 |
+
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return ag.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return cg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
67 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
68 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
69 |
+
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function pg(e){let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||At()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))}const mg="typography.lineHeight";function fg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(pg,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Co(t)})}})}function gg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("typography.lineHeight");return!(0,r.hasBlockSupport)(e,mg)||t}const hg="typography.__experimentalFontStyle",vg="typography.__experimentalFontWeight";function bg(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!kg(e),i=!_g(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(dg,{onChange:e=>{r({style:Co({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function kg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,hg),n=_o("typography.fontStyle");return!t||!n}function _g(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,vg),n=_o("typography.fontWeight");return!t||!n}function yg(e){const t=kg(e),n=_g(e);return t&&n}function Eg(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=_o("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Cg="typography.__experimentalFontFamily";function Sg(e,t,n){if(!(0,r.hasBlockSupport)(t,Cg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(Rp())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function wg(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=_o("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Eg,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function Bg(e){let{name:t}=e;const n=_o("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Cg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Cg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Sg),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Cg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Sg(o,e,n)},e}));const xg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Ig(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Tg(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Ng=function(e){const t=_o("typography.fontSizes"),n=!_o("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Pg="typography.fontSize";function Mg(e,t,n){if(!(0,r.hasBlockSupport)(t,Pg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(Rp())(e.className);o.add(Tg(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Rg(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=_o("typography.fontSizes"),a=xg(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(Ng,{onChange:e=>{const t=Ig(i,e).slug;l({style:Co({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Lg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=_o("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Pg)||!n}const Ag=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=_o("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Pg)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=xg(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),Dg={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Pg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Mg),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Pg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Mg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Ag),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return wo({fontSize:(0,r.hasBlockSupport)(l,Pg)},Dg,e,t,n,o)}));var Og=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),Fg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const zg=[{name:(0,g.__)("Underline"),value:"underline",icon:Og},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:Fg}];function Vg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},zg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Hg="typography.__experimentalTextDecoration";function Gg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Co({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Ug(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Hg),n=_o("typography.textDecoration");return t||!n}var Wg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),$g=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),jg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Kg=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:Wg},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:$g},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:jg}];function qg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Kg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Yg="typography.__experimentalTextTransform";function Xg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(qg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Co({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Qg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Yg),n=_o("typography.textTransform");return t||!n}function Zg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Jg="typography.__experimentalLetterSpacing";function eh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Zg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Co({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Jg),n=_o("typography.letterSpacing");return t||!n}const nh="typography",oh=[mg,Pg,hg,vg,Cg,Hg,Yg,Jg];function rh(e){const{clientId:t}=e,n=Bg(e),o=Lg(e),l=yg(e),i=gg(e),a=Ug(e),c=Qg(e),u=th(e),d=!kg(e),m=!_g(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[yg(e),Lg(e),gg(e),Bg(e),Ug(e),Qg(e),th(e)];return t.filter(Boolean).length===t.length}(e),h=lh(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[nh,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(Po,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(wg,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Co({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(Rg,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:ug(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(bg,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(fg,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(Gg,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Xg,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(eh,e)))}const lh=e=>oh.some((t=>(0,r.hasBlockSupport)(e,t))),ih=[...oh,Pf,$f,Fo],sh=e=>ih.some((t=>(0,r.hasBlockSupport)(e,t))),ah="var:";function ch(e){return(0,u.startsWith)(e,ah)?`var(--wp--${e.slice(ah.length).split("|").join("--")})`:e}function uh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=ch(r))})):t.includes(l.join("."))||(n[o]=ch((0,u.get)(e,l))))}}));const o=Mr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const dh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[$f],"typography.__experimentalSkipSerialization":[nh],[`${Fo}.__experimentalSkipSerialization`]:["spacing"]},ph={...dh,[`${Fo}`]:["spacing.blockGap"]};function mh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ph;if(!sh(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...uh(l),...e.style},e}const fh=(0,d.createHigherOrderComponent)((e=>t=>{const n=jn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lg,t),(0,s.createElement)(rh,t),(0,s.createElement)(Mf,t),(0,s.createElement)(Ho,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),gh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=uh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(jm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return sh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",mh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!sh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),mh(o,e,n,dh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",fh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",gh);var hh=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==qa.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const vh=[];function bh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=ou(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function kh(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function _h(e){let{presetSetting:t,defaultSetting:n}=e;const o=!_o(n),r=_o(`${t}.custom`)||vh,l=_o(`${t}.theme`)||vh,i=_o(`${t}.default`)||vh;return(0,s.useMemo)((()=>[...r,...l,...o?vh:i]),[o,r,l,i])}function yh(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=_h({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=_h({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!_o("color.custom"),u=!_o("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Qn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(hh,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}lu([iu]);const Eh=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(yh,t))}),"withDuotoneControls"),Ch=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(jm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(kh,{selector:m,id:p,values:bh(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Eh),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Ch);const Sh="__experimentalLayout";function wh(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=_o("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Sh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=l||h||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=ar(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Po,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(Bh,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function Bh(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,sr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const xh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Sh)&&(0,s.createElement)(wh,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ih=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Sh),a=(0,d.useInstanceId)(e),u=_o("layout")||{},p=(0,s.useContext)(jm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,Sh)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(mr,{selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Sh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ih),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",xh);const Th=[];function Nh(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=rf("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:uh({border:r})}}function Ph(e){const t=_o("color.palette")||Th,n=Nh(e);if(e.borderColor){const o=nf(t,e.borderColor);n.style.borderColor=o.color}return n}function Mh(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=rf("background-color",s),m=rf("color",a),f=Df(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:uh({color:(null==d?void 0:d.color)||{}})}}const Rh={};function Lh(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=_o("color.palette.custom")||[],l=_o("color.palette.theme")||[],i=_o("color.palette.default")||[],a=_o("color.gradients")||Rh,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=Mh(e);if(t){const e=nf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Of(u,o)),n){const e=nf(c,n);d.style.color=e.color}return d}function Ah(e){const{style:t}=e;return{style:uh({spacing:(null==t?void 0:t.spacing)||{}})}}function Dh(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Oh=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Fh=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=_o("color.palette.custom"),o=_o("color.palette.theme"),r=_o("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function zh(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=ou(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=of(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=nf(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:rf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Vh(e){return function(){const t=Oh(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(zh(o,t),"withCustomColors")}}function Hh(){const e=Fh();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(zh(n,e),"withColors")}const Gh=[];var Uh=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=_o("typography.fontSizes")||Gh;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=xg(r,l,n[t]);return e[o]={...i,class:Tg(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Wh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),$h=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),jh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Kh=[{icon:Wh,title:(0,g.__)("Align text left"),align:"left"},{icon:$h,title:(0,g.__)("Align text center"),align:"center"},{icon:jh,title:(0,g.__)("Align text right"),align:"right"}],qh={position:"bottom right",isAlternate:!0};var Yh=function(e){let{value:t,onChange:n,alignmentControls:o=Kh,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?jh:Wh,label:r,toggleProps:{describedBy:l},popoverProps:qh,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};function Xh(e){return(0,s.createElement)(Yh,i({},e,{isToolbar:!1}))}function Qh(e){return(0,s.createElement)(Yh,i({},e,{isToolbar:!0}))}var Zh={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Hn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Qu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?yd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Jh=window.wp.apiFetch,ev=n.n(Jh),tv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),nv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),ov={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await ev()({path:(0,Nd.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ir,{key:"icon",icon:"page"===e.subtype?tv:nv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const rv=[];function lv(e){let{completers:t=rv}=e;const{name:n}=$n();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Zh,ov])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var iv=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:lv(e)}))},sv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),av=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:sv,label:n,onClick:()=>o(!t),disabled:r})},cv=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==qa.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},uv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),dv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Hn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Hn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(ir,{icon:uv,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(sp,{clientId:e,maximumLength:35})),(0,s.createElement)(ir,{icon:uv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(sp,{clientId:r,maximumLength:35})))};function pv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(Hn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":h,"is-dragging-blocks":g});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const mv=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),fv=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(mv,null)))},gv=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==qa.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(fv,null)))}))}};var hv=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:gv(n),renderContent:()=>t})},vv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const bv=Pa(p.__experimentalTreeGridRow);function kv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=La({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(bv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function _v(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(ir,{icon:uv}))}var yv=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=lp(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==qa.ENTER&&e.keyCode!==qa.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(_v,{onClick:l}),(0,s.createElement)(pc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)(sp,{clientId:o,maximumLength:35}),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor)))})),Ev=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Hn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(ap,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(yv,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const Cv=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Sv=()=>(0,s.useContext)(Cv);var wv=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:a,level:u,rowCount:f,siblingBlockCount:h,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,s.useRef)(null),[C,S]=(0,s.useState)(!1),{clientId:w}=n,{toggleBlockHighlight:B}=(0,m.useDispatch)(Hn),x=lp(w),I=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,T=((e,t,n)=>(0,g.sprintf)(
|
70 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
71 |
+
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,h,u),N=x?(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
|
72 |
+
(0,g.__)("%s link"),x.title):(0,g.__)("Link"),P=x?(0,g.sprintf)(// translators: %s: The title of the block.
|
73 |
+
(0,g.__)("Options for %s block"),x.title):(0,g.__)("Options"),{__experimentalFeatures:M,__experimentalPersistentListViewFeatures:R,__experimentalHideContainerBlockActions:L,isTreeGridMounted:A,expand:D,collapse:O}=Sv(),F=v&&h>0,z=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),V=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||r});(0,s.useEffect)((()=>{R&&!A&&r&&E.current.focus()}),[]);const H=R?B:()=>{},G=(0,s.useCallback)((()=>{S(!0),H(w,!0)}),[w,S,H]),U=(0,s.useCallback)((()=>{S(!1),H(w,!1)}),[w,S,H]),W=(0,s.useCallback)((e=>{i(e,w),e.preventDefault()}),[w,i]),$=(0,s.useCallback)((e=>{i(void 0,e)}),[i]),j=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?O(w):!1===k&&D(w)}),[w,D,O,k]),K=M&&(!L||L&&u>1),q=M&&!K;let Y;F?Y=2:q&&(Y=3);const X=c()({"is-selected":r,"is-branch-selected":R&&l,"is-dragging":o,"has-single-cell":q}),Q=_.includes(w)?_:[w];return(0,s.createElement)(kv,{className:X,onMouseEnter:G,onMouseLeave:U,onFocus:G,onBlur:U,level:u,position:a,rowCount:f,path:b,id:`list-view-block-${w}`,"data-block":w,isExpanded:k,"aria-selected":!!r},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:E,"aria-label":N,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":I},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Ev,{block:n,onClick:W,onToggleExpanded:j,isSelected:r,position:a,siblingBlockCount:h,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:I},T))})),F&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:z,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(kp,{orientation:"vertical",clientIds:[w],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(_p,{orientation:"vertical",clientIds:[w],ref:t,tabIndex:n,onFocus:o})})))),K&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:V,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(vm,{clientIds:Q,icon:Kp,label:P,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:$})})))}));function Bv(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(xv(t,n,o),0):1}const xv=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+Bv(r,e,t,n):o+1};function Iv(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p,expandNested:f=!0}=e,{expandedState:g,draggedClientIds:h,__experimentalPersistentListViewFeatures:v}=Sv(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,s.createElement)(s.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=Bv(b[t-1],g,h,f));const C=v,{itemInView:S}=p,w=!C||S(_),B=t+1,x=a.length>0?`${a}_${B}`:`${B}`,I=r&&!!E&&!!E.length,T=I?null!==(d=g[y])&&void 0!==d?d:f:void 0,N=!(null==h||!h.includes(y)),P=N||w,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&I;return(0,s.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,s.createElement)(wv,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:x,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&T&&!N&&(0,s.createElement)(Iv,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:x,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}Iv.defaultProps={selectBlock:()=>{}};var Tv=(0,s.memo)(Iv);function Nv(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Pv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Mv=["top","bottom"];const Rv=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Lv=(0,s.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:f,id:h,expandNested:v=!1,...b}=e;const{clientIdsTree:k,draggedClientIds:_,selectedClientIds:y}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Hn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:E}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Hn),o=(null==_?void 0:_.length)>0?n(_).length+1:0;return{visibleBlockCount:t()-o}}),[_]),{updateBlockSelection:C}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Hn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Hn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===qa.UP||r.keyCode===qa.DOWN||r.keyCode===qa.HOME||r.keyCode===qa.END);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===qa.HOME||r.keyCode===qa.END)&&S.length>1)return;const w=(0,u.difference)(h,S);let B;if(1===w.length){var x;const e=null===(x=f(o(w[0])))||void 0===x?void 0:x.title;e&&(B=(0,g.sprintf)(
|
74 |
/* translators: %s: block name */
|
75 |
(0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
|
76 |
/* translators: %s: number of deselected blocks */
|
77 |
+
(0,g.__)("%s blocks deselected."),w.length));B&&(0,Mt.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[S,w]=(0,s.useReducer)(Rv,{}),{ref:B,target:x}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Hn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Rm(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=Am(t,s,Mv),u=Pv(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),I=(0,s.useRef)(),T=(0,d.useMergeRefs)([I,B,t]),N=(0,s.useRef)(!1),{setSelectedTreeId:P}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Hn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:y[0],setExpandedState:w}),M=(0,s.useCallback)(((e,t)=>{C(e,t),P(t)}),[P,C]);(0,s.useEffect)((()=>{N.current=!0}),[]);const[R]=(0,d.__experimentalUseFixedWindowList)(I,36,E,{useWindowing:l,windowOverscan:40}),L=(0,s.useCallback)((e=>{e&&w({type:"expand",clientIds:[e]})}),[w]),A=(0,s.useCallback)((e=>{e&&w({type:"collapse",clientIds:[e]})}),[w]),D=(0,s.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),O=(0,s.useCallback)((e=>{var t;A(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[A]),F=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&C(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[C]),z=(0,s.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:N.current,draggedClientIds:_,expandedState:S,expand:L,collapse:A})),[o,l,a,N.current,_,S,L,A]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Nv,{listViewRef:I,blockDropTarget:x}),(0,s.createElement)(p.__experimentalTreeGrid,{id:h,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:T,onCollapseRow:O,onExpandRow:D,onFocusRow:F},(0,s.createElement)(Cv.Provider,{value:z},(0,s.createElement)(Tv,i({blocks:k,selectBlock:M,showNestedBlocks:c,showBlockMovers:f,fixedListWindow:R,selectedClientIds:y,expandNested:v},b)))))}));function Av(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:vv,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
|
78 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Dv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Hn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(Av,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(Lv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function Ov(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=Lp(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(zu,{item:i,isStylePreview:!0})}function Fv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function zv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=Dp({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{l(e),o(null),h(null),_.cancel()},E=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{qa.ENTER!==t.keyCode&&qa.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(Fv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(Ov,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}zv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Vv=zv,Hv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),Gv=function(e){let{icon:t=Hv,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))},Uv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Wv="carousel",$v="grid",jv=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Kv=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:mp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:pp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var qv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Wv,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:oo,label:(0,g.__)("Carousel view"),onClick:()=>n(Wv),isPressed:u}),(0,s.createElement)(p.Button,{icon:Uv,label:(0,g.__)("Grid view"),onClick:()=>n($v),isPressed:t===$v}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Kv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(jv,{onBlockPatternSelect:a,onStartBlank:c}))};const Yv=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Wv){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Qv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Xv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Xv(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)(Xv,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(Ou,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Qv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Qv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(Ou,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Zv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Wv),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:g}=(0,m.useDispatch)(Hn),h=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Hn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==h||!h.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));g(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(qv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:h.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(h[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(Yv,{viewMode:a,activeSlide:u,patterns:h,onBlockPatternSelect:v}))};const Jv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var eb=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(Hn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(Hn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Jv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:gp,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const tb=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),nb=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),ob={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:nb,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:tb,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},rb=["top","center","bottom"],lb={isAlternate:!0};var ib=function(e){let{value:t,onChange:n,controls:o=rb,isCollapsed:r=!0,isToolbar:l}=e;const a=ob[t],c=ob.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:lb,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ob[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function sb(e){return(0,s.createElement)(ib,i({},e,{isToolbar:!1}))}function ab(e){return(0,s.createElement)(ib,i({},e,{isToolbar:!0}))}var cb=(0,d.createHigherOrderComponent)((e=>t=>{const n=_o("color.palette"),o=!_o("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),ub=cb(p.ColorPalette);function db(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Zm,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var pb=window.wp.date;const mb=new Date(2022,0,25);function fb(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,pb.dateI18n)(n,mb))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(gb,{format:t,onChange:o}))}function gb(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,pb.dateI18n)(e,mb),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}
|
79 |
// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
80 |
+
const hb=(0,g.__)("(%s: color %s)"),vb=(0,g.__)("(%s: gradient %s)"),bb=["colors","disableCustomColors","gradients","disableCustomGradients"],kb=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:a,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=of(c||t,l);r=(0,g.sprintf)(hb,a.toLowerCase(),e&&e.name||l)}else{const e=Ff(u||n,l);r=(0,g.sprintf)(vb,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},_b=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(kb,{colors:n,gradients:o,settings:d}));return(0,s.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,s.createElement)(Jm,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},yb=e=>{const t=ef();return t.colors=_o("color.palette"),t.gradients=_o("color.gradients"),(0,s.createElement)(_b,i({},t,e))},Eb=e=>{const t=tf();return(0,s.createElement)(_b,i({},t,e))};// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
81 |
+
var Cb=e=>(0,u.every)(bb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(_b,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Eb,e):(0,s.createElement)(yb,e),Sb=function(e,t){return(Sb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},wb=function(){return(wb=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Bb(e,t,n,o){void 0===o&&(o=0);var r=Ob(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function xb(e,t,n,o,r){void 0===r&&(r=0);var l=Ob(t.width,t.height,r),i=l.width,s=l.height;return{x:Ib(e.x,i,n.width,o),y:Ib(e.y,s,n.height,o)}}function Ib(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Tb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Nb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Pb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Mb:Rb,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:wb(wb({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Mb(e,t){return Math.min(e,Math.max(0,t))}function Rb(e,t){return t}function Lb(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function Ab(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Db(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function Ob(e,t,n){var o=e/2,r=t/2,l=[Db(0,0,o,r,n),Db(e,0,o,r,n),Db(e,t,o,r,n),Db(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function Fb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var zb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Lb(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:Bb(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=wb({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?xb(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?xb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Pb(n.props.restrictPosition?xb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?xb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}Sb(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=Tb(n,o),this.lastPinchRotation=Nb(n,o),this.onDragStart(Ab(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Ab(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Tb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Nb(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return bl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Fb("reactEasyCrop_Container",v)},n?bl().createElement("img",wb({alt:"",className:Fb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:wb(wb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&bl().createElement("video",wb({autoPlay:!0,loop:!0,muted:!0,className:Fb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:wb(wb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&bl().createElement("div",{style:wb(wb({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Fb("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(bl().Component);const Vb={position:"bottom right",isAlternate:!0};const Hb=(0,s.createContext)({}),Gb=()=>(0,s.useContext)(Hb);function Ub(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),g(e),v(1/h),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),g(e),v(1/h),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,g,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(nd.store),[p,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,ev()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,g.sprintf)(
|
82 |
/* translators: 1. Error message */
|
83 |
+
(0,g.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(Hb.Provider,{value:f},u)}function Wb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=Gb();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(zb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var $b=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function jb(){const{isInProgress:e,zoom:t,setZoom:n}=Gb();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Vb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:$b,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Kb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function qb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?Pp:void 0},t)})))}function Yb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Gb();return(0,s.createElement)(p.DropdownMenu,{icon:Kb,label:(0,g.__)("Aspect Ratio"),popoverProps:Vb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(qb,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(qb,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Xb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Qb(){const{isInProgress:e,rotateClockwise:t}=Gb();return(0,s.createElement)(p.ToolbarButton,{icon:Xb,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Zb(){const{isInProgress:e,apply:t,cancel:n}=Gb();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Jb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wb,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Qn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(jb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Yb,{toggleProps:e}))),(0,s.createElement)(Qb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Zb,null))))}const ek=[25,50,75,100];function tk(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},ek.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var nk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),ok=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)};class rk extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,Za()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,Nd.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
|
84 |
/* translators: %s: number of results. */
|
85 |
+
(0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case qa.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case qa.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case qa.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case qa.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case qa.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case qa.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case qa.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,v,a):(0,s.createElement)(p.BaseControl,h,(0,s.createElement)("input",v),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var lk=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Hn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(rk),ik=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?(0,u.isFunction)(a)?a(n):a:(0,s.createInterpolateElement)((0,g.sprintf)(
|
86 |
/* translators: %s: search term. */
|
87 |
+
(0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(ir,{className:"block-editor-link-control__search-item-icon",icon:ac}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},sk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),ak=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(ir,{className:"block-editor-link-control__search-item-icon",icon:sk}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:n.title,highlight:a})),(0,s.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,Nd.filterURLForDisplay)((0,Nd.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const ck="__CREATE__",uk=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function dk(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,S=f?(0,g.__)("Recently updated"):(0,g.sprintf)(
|
88 |
/* translators: %s: search term. */
|
|